Skip to content

allow passing a decision point via in assign call - #3414

Open
danoswaltCL wants to merge 1 commit into
devfrom
wip/assign-single-dp-response
Open

danoswaltCL wants to merge 1 commit into
devfrom
wip/assign-single-dp-response

Conversation

@danoswaltCL

@danoswaltCL danoswaltCL commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator
  • API /assign endpoint updated to allow optional decisionPoint to limit the response to just that assignment
  • Java client updated to rewire the getExperimentCondition method to this new usage automatically
  • Full-context fetching of valid experiments remains intact, as this is needed for experiment-pooling and keeping the server instance cache warm; this is now pretty optimized and doesn't add overhead, so we don't trim the response until after selecting the experiment from the pool.

Also:

  • Most of the 'extra' files changed are from reconciling multiple "Decision-Point" types (it got confusing to know which implementation to use or borrow).
  • Refactors slightly in order to take advantage of shared utility functions
  • Adds ability to pass --singleDecisionPoint flag to quickburst tester

Testing showed this to be potentially 30%+ quicker /assign calls, across the board

Note: left out is client-caching of the single decision-point response. I wanted to discuss how to do this, it wasn't as straightforward as one would think. It doesn't seem all that important at this point as there isn't a present usage that a client would return again to an already fetched single-decision-point experiment, so I'm punting this for now....

…se to just that one assignment. consolidates DecisionPoint types
@danoswaltCL
danoswaltCL requested review from bcb37 and a balanced review from Copilot November 6, 2026 21:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The uncached scoped lookup is case-sensitive while the warm-cache lookup is not, causing previously valid decision-point lookups to fail depending on cache state.

1 open issue
What changed in this PR

Adds optional decision-point scoping to /assign and integrates it into the Java client, reducing per-request assignment work while retaining full-context fetching and experiment-pool selection.

Changes:

  • Limits assignment evaluation to the relevant pool and returns only the requested decision point.
  • Consolidates decision-point validation and adds scoped-assignment regression tests.
  • Updates Java single-condition requests and adds a --singleDecisionPoint load-testing mode.
File Description
packages/​backend/​test/​unit/​services/​ExperimentAssignmentService.test.ts Tests scoped assignment, pooling, and mark consistency.
packages/​backend/​test/​unit/​controllers/​validators/​ExperimentAssignmentValidator.test.ts Tests optional decision-point validation and target defaults.
packages/​backend/​src/​api/​services/​ThompsonSamplingRewardService.ts Reuses the shared decision-point reference type.
packages/​backend/​src/​api/​services/​ExperimentAssignmentService.ts Scopes evaluation to relevant pools and filters returned assignments.
packages/​backend/​src/​api/​controllers/​validators/​RewardValidator.ts Uses shared nested decision-point validation.
packages/​backend/​src/​api/​controllers/​validators/​MarkExperimentValidator.v6.ts Inherits shared decision-point validation.
packages/​backend/​src/​api/​controllers/​validators/​ExperimentAssignmentValidator.ts Accepts an optional decision point.
packages/​backend/​src/​api/​controllers/​validators/​DecisionPointValidator.ts Defines shared validation and target normalization.
packages/​backend/​src/​api/​controllers/​validators/​BatchAssignValidator.ts Reuses shared decision-point validation.
packages/​backend/​src/​api/​controllers/​ExperimentClientController.v6.ts Documents and forwards the scoped-assignment parameter.
packages/​backend/​CLAUDE.md Documents dormant preview-user behavior.
clientlibs/​java/​src/​main/​resources/​org/​upgradeplatform/​client/​quicktest-burst-ui.html Adds an assignment-mode selector.
clientlibs/​java/​src/​main/​java/​org/​upgradeplatform/​requestbeans/​ExperimentRequest.java Adds an optional decision-point request payload.
clientlibs/​java/​src/​main/​java/​org/​upgradeplatform/​client/​QuickTestBurst.java Adds scoped-request load testing.
clientlibs/​java/​src/​main/​java/​org/​upgradeplatform/​client/​ExperimentClient.java Shares request handling and scopes uncached single-condition lookups.
clientlibs/​java/​CLAUDE.md Documents updated lookup and caching behavior.

Review effort: Balanced

if (allExperiments != null) {
toAssignment.onSuccess(allExperiments);
} else {
requestAssignments(new ExperimentRequest(this.context, site, target), false, toAssignment);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this case-sensitivity issue would be resolved by your pr @bcb37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants