Repository navigation
fix(compliance): send the committed buy's currency on total_budget redistribution updates - #8244
Merged
Merged
Conversation
…distribution updates 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 fix for #8232, no blocking or medium findings.
This PR fixes the total_budget_redistribution scenario to read the committed currency off get_media_buys (media_buys[].currency) and reuse it on both update_media_buy requests instead of hardcoding USD, so an EUR-denominated seller correctly refusing a redenominating update is no longer failed.
Checks performed:
- New grade read-back assertion
media_buys[0].currency == committedhas normative basis (update-media-buy-request.json:165— "currency MUST equal the existing media-buy currency"); DR-0001 satisfied. patchchangeset is correct — the change fixes grading without a wire-shape change; USD sellers still pass.narrative/ phasedepends_onare established scenario fields.revision→created_revisionrename is sound (avoids clobbering the create value).- Test file (521 new lines) gates currency before the package-sum check and pins the three #8232 symptoms via negative-control/cascade-skip tests.
Gate checks: gated_paths false, high_risk false, no no-auto-approve team match, no prior decision. No critical/high/medium findings. Falls through to row 9 → approve. (review_decision is REVIEW_REQUIRED but gated_paths is false, so row 2 does not apply.)
bokelley
added a commit
that referenced
this pull request
Oct 17, 2026
…distribution updates (#8244) (#8265) 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]>
TekWorx
pushed a commit
to TekWorx/adcp
that referenced
this pull request
Oct 24, 2026
Merge the published v3.2.6 maintenance release (tag v3.2.6, 3523bdc, the adcontextprotocol#8274 Version Packages merge on 3.2.x) into main as a record-only merge, following adcontextprotocol#8278 for 3.2.5. The merge keeps main's tree (ours strategy) and adds only the 3.2.6 release records: - dist/schemas/3.2.6/, dist/compliance/3.2.6/ and the signed dist/protocol/3.2.6.tgz{,.crt,.sha256,.sig} tuple, byte-identical to the tag. - CHANGELOG.md: the 3.2.6 block, verbatim from the tag, inserted below main's 3.3.0-beta.0 section. (The workflow's take-3.2.x rule would have dropped that section.) - static/compliance/published-versions.json: register 3.2.6, matching the 3.2.x manifest. - dist/schemas/index.json and latest.json: regenerated by build:schemas; latest_stable, v3 and v3.2 now 3.2.6. main's 3.3.0-beta.0 entry and v3.0 (3.0.28) are kept; taking 3.2.x's copy would have regressed both. The 3.2.5..3.2.6 source changes are all backports of work already on main in its main form (adcontextprotocol#8335, adcontextprotocol#8402, adcontextprotocol#8218, adcontextprotocol#8216, adcontextprotocol#8341/adcontextprotocol#8387, adcontextprotocol#8327/adcontextprotocol#8334, adcontextprotocol#8260, adcontextprotocol#8261, adcontextprotocol#8263, adcontextprotocol#8244), so no 3.2.x source is taken. The second parent records that reconciliation so the next 3.2.x forward merge does not re-conflict on it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Closes #8232.
Problem
media_buy_seller/total_budget_redistributiongradestotal_budgetredistribution, not currency selection — that ismedia_buy_seller/pricing_currency_filter's job. But both of itsupdate_media_buyrequests wrotetotal_budget.currency: "USD".update-media-buy-request.jsonrequirestotal_budget.currencyand says it "MUST equal the existing media-buy currency; an update does not redenominate a buy." So a seller whose buy is denominated in anything else was failed for doing exactly the right thing. The reporter's run (heartbeat39678d17) shows all three symptoms: a successful 100000 EUR buy, the 50000 USD update rejected withVALIDATION_ERROR, and the consequentially unchanged read.There is a third symptom the issue does not mention, which this PR's negative control now pins: under the bug,
reject_total_with_packagesgoes green for the wrong reason — the seller rejects it on currency, not on the inconsistent package sum the step exists to grade, anderror_code: VALIDATION_ERRORcannot tell the two apart.Fix
A new
read_committed_currencystep capturesmedia_buys[0].currency; both updates send$context.media_buy_currency, and the post-update read-back asserts the redistribution did not redenominate the buy.Why
get_media_buysand notcreate_media_buy(the issue suggested the latter):media_buys[].currencyis the only required carrier of a committed buy's currency anywhere on the media-buy surface.currencyrequired?get-media-buys-response.json→media_buys[]create-media-buy-response.json→CreateMediaBuySuccessupdate-media-buy-response.json→UpdateMediaBuySuccesscore/package.jsonA capture whose path does not resolve grades the capturing step
capture_path_not_resolvable(a failure, not a skip). Capturing from the create response would therefore have traded one false failure for another against a conformant seller that omits the optional field.tests/total-budget-redistribution-currency.test.cjspins this: the EUR lane's seller deliberately omitscurrencyfrom its create response.Two supporting corrections
Both were found by review, not authored defensively — each closes a hole the main change would otherwise have opened.
create_fixed_buynow captures its revision ascreated_revision.CONTEXT_EXTRACTORS.get_media_buyswritesrevisionby convention, and the runner applies convention extraction before explicitcontext_outputswith no provenance guard. The new read would have silently overwritten the revisioncreate_media_buyreturned, so the scenario would no longer grade that token's usability.reject_total_with_packagesisstateful: true, and its phase declaresdepends_on: [setup]. The runner deliberately does not skipexpect_errorsteps carrying unresolved$contexttokens. Without the cascade, a failed capture would put the literal"$context.media_buy_currency"on the wire — a value no^[A-Z]{3}$field accepts — and the step would pass on the seller's rejection of that.depends_on: [setup]keeps the probe graded when only theredistributephase trips, which preserves the reporter's observed symptom chain. A test mutation confirms this is load-bearing: revertingstatefultofalseturns the guard red.Deliberate non-goals
prerequisites/narrativeprose describes what the storyboard tolerates rather than asserting what the controller contract permits sellers to do —comply-test-controller.mdxdoes not authorize silently redenominating a suppliedfixture.currency, and this PR does not change that.get_adcp_capabilitiesexposes onlysupported_account_currency_modes(fixed/per_media_buy), an account-provisioning model, not a list of transactable ISO codes — and it would narrow applicability for zero grading benefit.fixture_resolutionblock. This storyboard's effective strategy stays[seed]. The fix is correct under either path because it reads the committed buy rather than the fixture.storyboard-schema.yaml's own workeddiscoverexample is literallypath: /currency, operator: equals, value: USDon a pricing option. Copying it into this scenario later would send the EUR seller back tofixture_unsatisfiedand undo this fix.Testing
tests/total-budget-redistribution-currency.test.cjs— 7 tests, new. Drives the scenario through the SDK storyboard runner against EUR and USD sellers (all 10 steps graded, 0 skipped, including the controller seeding phase), 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. Registered intest:schemas;test:test-coveragegreen.storyboard-{scoping,branch-sets,provides-state-for,fixture-resolution,contradictions,context-entity,sample-request-schema,response-schema,context-output-paths,validations-paths,check-enum,controller-requires,generate-phase-scope,advisory-expiry,doc-parity},update-media-buy-affected-packages).npm run build:compliance+test:compliance-snippets+test:doc-compliance-driftgreen;dist/compliance/latestis gitignored, no versioned artifact touched.patch, protocol-scope check andchangesets statusgreen. Patch-eligible under the playbook's conformance-harness rule (no renamed or repurposed step kinds).TENANT_PATH=sales run-storyboards.ts --storyboard-id media_buy_seller/total_budget_redistribution→10P / 0S / 0N/A, clean.ADCP_SKIP_STORYBOARD_MATRIX=1.training-agent-storyboards.ymlis the authoritative gate.Backport
3.2.xis at3.2.4and carries the identical buggy storyboard — a backport is needed and is not included here.3.1.xdoes not have this storyboard at all, so no backport there. Per the playbook this lands onmainfirst; the cherry-pick PR to3.2.xis a follow-up, not cut here.Follow-ups (not in scope, surfaced by review)
create-media-buy-response.jsonandupdate-media-buy-response.jsonpermittotal_budgetwith nocurrency— a denominated value with no denominator.total_budgetat least carries "Present for/when…" prose;currencycarries none. That is the root ambiguity behind this issue.lint-storyboard-context-output-paths.cjschecks only that a capture path resolves against the response schema, never whether the property isrequired. It would have green-lit thecreate_media_buycapture.update_media_buystep in the corpus sends a literaltotal_budget.currency— this closes that class. But 39create_media_buysteps across 16 files still do. For proposal-mode creates a literal is defensible (the seller derives currency from it); for fixed explicit-package creates against seeded pricing options an EUR-only seller fails identically. Worth a triage pass.🤖 Generated with Claude Code
Open workspace in Conductor