Skip to content

fix(compliance): UUID-aliased idempotency_keys across remaining storyboard scenarios - #4232

Merged
bokelley merged 1 commit into
mainfrom
claude/issue-4230-uuid-aliases-storyboards
May 8, 2026
Merged

bokelley merged 1 commit into
mainfrom
claude/issue-4230-uuid-aliases-storyboards

Conversation

@bokelley

@bokelley bokelley commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Extends #4218 (measurement_terms_rejected) to the rest of the storyboard suite. 15 steps across 9 scenarios still shipped hardcoded idempotency_key literals on state-mutating tasks (create_media_buy, sync_creatives, sync_plans, update_media_buy).

Same root cause as #4218: the runner shifts start_time substitutions forward each run to keep buys future-dated, so against a long-running seller deployment those static keys produce same key + different canonical body cross-run. That arms the spec-mandated IDEMPOTENCY_CONFLICT. Worse: when the seller's emit shape changed between runs (e.g. a CreateMediaBuyResponse variant fix), subsequent runs replay now-spec-non-compliant cached payloads — the production failure mode that surfaced this issue, knocking out 5 stateful chains on media_buy_seller and cascading into ~43 dependent skipped steps.

Change

Every remaining literal idempotency_key is replaced with \$generate:uuid_v4#<scenario>_<step> so each run mints fresh keys. Affected:

Scenario Steps
creative_fate_after_cancellation 5
governance_approved 1
governance_conditions 1
governance_denied 1
governance_denied_recovery 3
invalid_transitions 1
inventory_list_no_match 1
inventory_list_targeting 1
pending_creatives_to_start 1

15 keys total, matching the issue inventory. Source files at static/compliance/source/protocols/media-buy/scenarios/*.yaml; the compliance/cache/3.0.7/... paths in the issue body are generated.

After this, no hardcoded idempotency_key literals remain in the storyboard suite (verified by grep on the source dir).

Why this matters beyond the symptom

The runner's stale-cache replay is correct seller behavior — the spec mandates that an idempotency_key replay returns the cached response. But any time the spec or seller's emit shape changes (which happens whenever AdCP versions roll forward), every storyboard scenario with a static key becomes a one-shot landmine: works on first run, breaks after the seller updates. The \$generate:uuid_v4 pattern is the systemic prevention.

Test plan

  • npm run test:substitution-vector-names — clean
  • npm run build:compliance — clean rebuild
  • precommit (test:unit + test:test-dynamic-imports + test:callapi-state-change + typecheck) — passing
  • Storyboard runner against media_buy_seller post-merge: confirm the 5 previously-failing create_buy* scenarios + 43 dependent steps unblock

Release

Patch-eligible (compliance fixture fix, no spec/wire changes). Same shape as #4218 — should land in 3.0.8 via cherry-pick to 3.0.x.

Closes #4230. Refs #4218, adcontextprotocol/adcp-client#1586.

🤖 Generated with Claude Code

…board scenarios

Extends #4218 (measurement_terms_rejected) to the rest of the suite. 15
storyboard steps across 9 scenarios still shipped hardcoded
`idempotency_key` literals on state-mutating tasks. Same root cause: the
runner's dynamic `start_time` substitution shifts dates forward each run,
producing same key + different canonical body and arming
IDEMPOTENCY_CONFLICT (or replaying stale cached payloads when seller
emit shape changes between runs).

Switch every remaining literal to `$generate:uuid_v4#<scenario>_<step>`.

Closes #4230.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@bokelley
bokelley merged commit 8edd3f9 into main May 8, 2026
19 checks passed
@bokelley
bokelley deleted the claude/issue-4230-uuid-aliases-storyboards branch May 8, 2026 14:00
bokelley added a commit that referenced this pull request May 8, 2026
…board scenarios (#4232)

Extends #4218 (measurement_terms_rejected) to the rest of the suite. 15
storyboard steps across 9 scenarios still shipped hardcoded
`idempotency_key` literals on state-mutating tasks. Same root cause: the
runner's dynamic `start_time` substitution shifts dates forward each run,
producing same key + different canonical body and arming
IDEMPOTENCY_CONFLICT (or replaying stale cached payloads when seller
emit shape changes between runs).

Switch every remaining literal to `$generate:uuid_v4#<scenario>_<step>`.

Closes #4230.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>