Repository navigation
fix(compliance): backport committed-currency total_budget redistribution to 3.2.x - #8265
Merged
bokelley merged 1 commit intoOct 17, 2026
Merged
Conversation
…distribution updates (#8244) media_buy_seller/total_budget_redistribution grades total_budget redistribution, not currency selection — that is graded by media_buy_seller/pricing_currency_filter. Both of its update_media_buy requests wrote total_budget.currency: "USD", so a seller whose buy is denominated in another currency was failed for correctly rejecting an update that would have redenominated it, and the read-back then graded the consequentially unchanged total as wrong too (#8232). A new read_committed_currency step captures media_buys[0].currency and both updates send $context.media_buy_currency; the post-update read-back asserts the redistribution did not redenominate the buy. get_media_buys is the source because media_buys[].currency is the only required carrier of a committed buy's currency — create-media-buy-response.json and update-media-buy-response.json both leave currency optional and core/package.json has none, so capturing from the create response as the issue suggested would have traded a VALIDATION_ERROR for a capture_path_not_resolvable against a conformant seller that omits it. Two supporting corrections. create_fixed_buy captures its revision as created_revision: CONTEXT_EXTRACTORS.get_media_buys writes `revision` by convention and convention extraction runs before explicit context_outputs, so the new read would otherwise have overwritten the revision create_media_buy returned and the scenario would no longer grade that token. reject_total_with_packages becomes stateful: true and its phase declares depends_on: [setup]: expect_error steps are deliberately not skipped on unresolved $context substitution, so a failed capture would otherwise put the raw "$context.media_buy_currency" token on the wire — a value no ^[A-Z]{3}$ field accepts — and let the step pass on the seller's rejection of that instead of on the inconsistent package sum it exists to grade. depends_on keeps the probe graded when only the redistribute phase trips, and keeps the reporter's observed symptom chain (failed update, consequential unchanged read) intact. The seeded USD rate card is unchanged; the scenario simply no longer assumes it was the rate card that priced the buy. No currency capability gate is added — pricing_currency_filter already grades currency selection, and get_adcp_capabilities exposes no list of transactable currencies to gate on. tests/total-budget-redistribution-currency.test.cjs drives the scenario through the SDK runner against EUR and USD sellers (the EUR lane omits the optional currency from its create response), plus three executable negatives: the pre-fix USD literal, a seller that redenominates mid-redistribution, and a failed capture that must cascade-skip rather than ship a raw token. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean backport with no findings.
This is a byte-identical backport of #8244 to the 3.2.x stable line, fixing #8232. The reviewer verified:
- Patch-eligibility: conformance-harness fix with no step-kind rename, no new enum/runner-output surface; the new read-back asserts behavior update-media-buy-request.json already mandates.
- Schema premises confirmed against base-pinned 3.2.x: get-media-buys-response.json:886 requires media_buys[].currency while create-media-buy-response.json:185-190 makes it optional, so get_media_buys is the correct currency source (no spec drift).
- The 521-line test handles the cascade-skip asymmetry, proven by negative-control tests.
- Changeset correctly scoped (patch/adcontextprotocol).
No Critical/High/Medium findings. high_risk is false, gated_paths is false, no author team gate, no prior decision. None of decision rows 1–8 fire → row 9 approve.
bokelley
deleted the
backport/3.2.x-total-budget-redistribution-currency
branch
October 17, 2026 16:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #8244 (main commit
20ace531a26509d079b07d1f1a4c4f3832239e8a) to the3.2.xmaintenance line. Fixes #8232 on the line the reporter actually hit it on —3.2.4, now3.2.5.Why 3.2.x needs it
media_buy_seller/total_budget_redistributionhardcodedtotal_budget.currency: "USD"in both of itsupdate_media_buyrequests, so a seller whose buy is denominated in another currency was failed for correctly rejecting an update that would redenominate it. The storyboard grades redistribution, not currency selection (that'smedia_buy_seller/pricing_currency_filter).I confirmed the bug is still present and unowned on this line:
git cherry origin/3.2.x 20ace531areports+, the storyboard onorigin/3.2.xstill carriescurrency: "USD"at both update steps, and no existing backport PR or branch covers it.3.1.xdoes not have this storyboard at all, so no 3.1 backport is needed.The fix replaces the literal with
$context.media_buy_currency, captured by a newread_committed_currencystep frommedia_buys[0].currency— the only required carrier of a committed buy's currency on this line too (verified againstorigin/3.2.x's own schemas, not main's).Patch eligibility
Patch-eligible under the playbook's conformance harness rule: no renamed or repurposed step kinds, no new
comply_test_controllerenum values, norunner-output.jsonchanges. The one genuinely new assertion — the read-backfield_valueonmedia_buys[0].currency— imposes no new requirement, because3.2.x's ownupdate-media-buy-request.jsonalready states "currency MUST equal the existing media-buy currency; an update does not redenominate a buy." Only the storyboard was wrong. The changeset is the unmodified"adcontextprotocol": patchfrom main.Conflict resolution — one file, one line
The cherry-pick hit exactly one conflict:
package.json'stest:schemasscript, becausemainregisters many more test files than3.2.xdoes. This is ordinary branch divergence, not a newer-version dependency. I took3.2.x's own list and inserted onlytests/total-budget-redistribution-currency.test.cjsafter the same anchor main uses. Verified by parsing both sides: 40 → 41 files, nothing removed, no main-only test leaked in (those files don't exist here and would break CI), and no other key in the file changed —versionstays3.2.5, dependencies untouched.The three content files (storyboard, test, changeset) are byte-identical to main's, which is correct here: the pre-change storyboard on
3.2.xwas itself identical to main's, so there is no maintenance-line divergence for an identical copy to clobber.The SDK pin — checked, not assumed
3.2.xpins@adcp/[email protected];mainpins15.9.2. This was the one plausible place a newer-version dependency could hide, so I reinstalled the maintenance line's own lockfile (npm ci→ 14.0.0-rc.53) and ran everything against it rather than against main's tree. No newer-version dependency exists.storyboard-schema.yamlandrunner-output-contract.yamlare byte-identical between the two lines, sonarrative, phasedepends_on,stateful, andcontext_outputsare all available here.Testing (all on
@adcp/[email protected])tests/total-budget-redistribution-currency.test.cjs— 7/7 pass. Drives the storyboard through rc.53's realrunStoryboardagainst EUR and USD sellers, plus three executable negatives: the pre-fix USD literal, a seller that redenominates mid-redistribution, and a failed capture that must cascade-skip rather than ship a raw$contexttoken.TENANT_PATH=sales run-storyboards.ts --storyboard-id media_buy_seller/total_budget_redistribution→10P / 0S / 0N/A, clean.test-coverageregistration +build:compliance: green.check-changeset-protocol-scope.cjs origin/3.2.xandchangesets status --since=origin/3.2.x→patch,adcontextprotocol.dist/**edit, nopackage-lock.jsonchange, no manual version bump, no.changeset/pre.json— this cuts a stable3.2.6, not an RC.One behavior change worth naming
read_committed_currencycallsget_media_buysimmediately after create, whereas before the first read came only after anupdate_media_buyround-trip. A seller with a lagging read surface that was coasting on that extra latency could now fail the capture. Such a seller is already non-conformant (get_media_buysmust reflect committed state), but no 3.2 normative text spells out a read-after-write deadline, so it is worth knowing rather than discovering at grading time.Follow-ups for
main(deliberately not changed here)A backport should stay byte-identical to its source; both reviewers agreed these belong on
mainfirst, if at all:check: field_valuewithvalue: "$context.media_buy_currency".storyboard-schema.yamlnamesfield_equals_contextas the idiom for comparing a response field to a prior capture. Sound as written — the comparand came from a prior response, not the circular case the schema warns about — but a strengthening opportunity.created_revisionrationale says "convention extraction runs before explicit captures," which describes within-step precedence. The operative hazard is cross-step: the later read's convention extraction overwrites the earlier step's explicit capture. The fix is right; the sentence is imprecise.🤖 Generated with Claude Code
Open workspace in Conductor