Skip to content

optional decision point sent in assign - #3410

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

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

Conversation

@danoswaltCL

Copy link
Copy Markdown
Collaborator
  • Adds optional decision point to assign calls
  • Rewires the Java Client getExperimentCondition call to send decision point (will add the others once before moving this out of draft status)
  • Retains all same caching as before, but now trims response post experiment-pool selection so that only the one experiment assignment is processed and sent in response.
  • Assign without sending a decision point will work the same

Also to note:

  • Guarantee assign and mark using same logic to pick experiments for pooling (the logic does do this currently, but still could drift later accidentally. This can be removed if it seems like it's not quite related to the real task here, but I felt it was hard not to.
  • Reconciles multiple implementations of a DecisionPoint type into one type.

This dramatically improved times in local testing.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 20:50

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

Single-condition lookups now miss case-insensitive matches on a cold cache and issue repeated HTTP requests rather than caching focused responses.

2 open issues
What changed in this PR

Adds optional decision-point scoping to /v6/assign, reducing assignment work while retaining the full-context backend cache. Updates the Java client's single-condition lookup to use scoped requests.

Changes:

  • Limits assignment processing to the relevant experiment pool and shares pool selection between assign and mark.
  • Consolidates decision-point validation and adds scoped-assignment regression tests.
  • Adds optional decision-point request data to the Java SDK.
File Description
packages/​backend/​test/​unit/​services/​ExperimentAssignmentService.test.ts Tests scoped assignment, pool selection, and mark consistency.
packages/​backend/​test/​unit/​controllers/​validators/​ExperimentAssignmentValidator.test.ts Tests optional decision points and target normalization.
packages/​backend/​src/​api/​services/​ThompsonSamplingRewardService.ts Uses the shared decision-point reference type.
packages/​backend/​src/​api/​services/​ExperimentAssignmentService.ts Narrows experiment pools and filters scoped assignments.
packages/​backend/​src/​api/​controllers/​validators/​RewardValidator.ts Reuses shared 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 nested decision point.
packages/​backend/​src/​api/​controllers/​validators/​DecisionPointValidator.ts Defines shared validation and target normalization.
packages/​backend/​src/​api/​controllers/​validators/​BatchAssignValidator.ts Inherits shared decision-point validation.
packages/​backend/​src/​api/​controllers/​ExperimentClientController.v6.ts Documents and forwards assignment scoping.
packages/​backend/​CLAUDE.md Adds documentation about dormant preview-user behavior.
clientlibs/​java/​src/​main/​java/​org/​upgradeplatform/​requestbeans/​ExperimentRequest.java Adds optional decision-point request fields.
clientlibs/​java/​src/​main/​java/​org/​upgradeplatform/​client/​ExperimentClient.java Sends scoped requests when the full-response cache is empty.
clientlibs/​java/​CLAUDE.md Documents Java lookup and caching behavior.

Review effort: Balanced

} else {
// Still filtered client-side: a server without decisionPoint support drops the field and returns the
// whole context.
requestAssignments(new ExperimentRequest(this.context, site, target), false, toAssignment);
} else {
// Still filtered client-side: a server without decisionPoint support drops the field and returns the
// whole context.
requestAssignments(new ExperimentRequest(this.context, site, target), false, toAssignment);
…rimentCondition, normales decision-point types
@danoswaltCL
danoswaltCL force-pushed the wip/assign-single-dp-response branch from 4d24917 to 0e51947 Compare November 2, 2026 17:40
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