Skip to content

fix(compliance): send the committed buy's currency on total_budget redistribution updates - #8244

Merged
bokelley merged 1 commit into
mainfrom
conductor/compliance-currency-8232
Oct 16, 2026
Merged

bokelley merged 1 commit into
mainfrom
conductor/compliance-currency-8232

Conversation

@bokelley

@bokelley bokelley commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #8232.

Problem

media_buy_seller/total_budget_redistribution grades total_budget redistribution, not currency selection — that is media_buy_seller/pricing_currency_filter's job. But both of its update_media_buy requests wrote total_budget.currency: "USD".

update-media-buy-request.json requires total_budget.currency and 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 (heartbeat 39678d17) shows all three symptoms: a successful 100000 EUR buy, the 50000 USD update rejected with VALIDATION_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_packages goes green for the wrong reason — the seller rejects it on currency, not on the inconsistent package sum the step exists to grade, and error_code: VALIDATION_ERROR cannot tell the two apart.

Fix

A new read_committed_currency step captures media_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_buys and not create_media_buy (the issue suggested the latter): media_buys[].currency is the only required carrier of a committed buy's currency anywhere on the media-buy surface.

Source currency required?
get-media-buys-response.json → media_buys[] yes
create-media-buy-response.json → CreateMediaBuySuccess no
update-media-buy-response.json → UpdateMediaBuySuccess no
core/package.json field does not exist

A 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.cjs pins this: the EUR lane's seller deliberately omits currency from 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.

  1. create_fixed_buy now captures its revision as created_revision. CONTEXT_EXTRACTORS.get_media_buys writes revision by convention, and the runner applies convention extraction before explicit context_outputs with no provenance guard. The new read would have silently overwritten the revision create_media_buy returned, so the scenario would no longer grade that token's usability.

  2. reject_total_with_packages is stateful: true, and its phase declares depends_on: [setup]. The runner deliberately does not skip expect_error steps carrying unresolved $context tokens. 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 the redistribute phase trips, which preserves the reporter's observed symptom chain. A test mutation confirms this is load-bearing: reverting stateful to false turns the guard red.

Deliberate non-goals

  • The seeded USD rate card is unchanged. It stays the single-currency precondition; the scenario simply no longer assumes it was the rate card that priced the buy. The prerequisites/narrative prose describes what the storyboard tolerates rather than asserting what the controller contract permits sellers to do — comply-test-controller.mdx does not authorize silently redenominating a supplied fixture.currency, and this PR does not change that.
  • No currency capability gate (the issue's alternative 2). It isn't implementable — get_adcp_capabilities exposes only supported_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.
  • No fixture_resolution block. This storyboard's effective strategy stays [seed]. The fix is correct under either path because it reads the committed buy rather than the fixture. ⚠️ Forward risk worth knowing: storyboard-schema.yaml's own worked discover example is literally path: /currency, operator: equals, value: USD on a pricing option. Copying it into this scenario later would send the EUR seller back to fixture_unsatisfied and 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 in test:schemas; test:test-coverage green.
  • Storyboard lints: all 16 suites green (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-drift green; dist/compliance/latest is gitignored, no versioned artifact touched.
  • Changeset: patch, protocol-scope check and changesets status green. Patch-eligible under the playbook's conformance-harness rule (no renamed or repurposed step kinds).
  • Full pre-commit suite (4612 server unit tests + typecheck) green.
  • Real seller: TENANT_PATH=sales run-storyboards.ts --storyboard-id media_buy_seller/total_budget_redistribution → 10P / 0S / 0N/A, clean.
  • The full local storyboard matrix stalled on this sandbox and was skipped via the sanctioned ADCP_SKIP_STORYBOARD_MATRIX=1. training-agent-storyboards.yml is the authoritative gate.

Backport

3.2.x is at 3.2.4 and carries the identical buggy storyboard — a backport is needed and is not included here. 3.1.x does not have this storyboard at all, so no backport there. Per the playbook this lands on main first; the cherry-pick PR to 3.2.x is a follow-up, not cut here.

Follow-ups (not in scope, surfaced by review)

  1. create-media-buy-response.json and update-media-buy-response.json permit total_budget with no currency — a denominated value with no denominator. total_budget at least carries "Present for/when…" prose; currency carries none. That is the root ambiguity behind this issue.
  2. lint-storyboard-context-output-paths.cjs checks only that a capture path resolves against the response schema, never whether the property is required. It would have green-lit the create_media_buy capture.
  3. No other update_media_buy step in the corpus sends a literal total_budget.currency — this closes that class. But 39 create_media_buy steps 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

…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]>

@aao-secretariat aao-secretariat Bot 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.

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 == committed has normative basis (update-media-buy-request.json:165 — "currency MUST equal the existing media-buy currency"); DR-0001 satisfied.
  • patch changeset is correct — the change fixes grading without a wire-shape change; USD sellers still pass.
  • narrative / phase depends_on are established scenario fields.
  • revision→created_revision rename 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
bokelley merged commit 20ace53 into main Oct 16, 2026
61 checks passed
@bokelley
bokelley deleted the conductor/compliance-currency-8232 branch October 16, 2026 22:36
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]>
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.

media_buy_seller/total_budget_redistribution: hard-coded USD in update_total_budget fails sellers that do not price in USD

1 participant