Skip to content

fix(compliance): extend $generate:uuid_v4 to all hardcoded idempotency_keys across compliance storyboards - #4231

Merged
bokelley merged 1 commit into
mainfrom
claude/issue-4230-extend-uuid-idempotency-keys
May 10, 2026
Merged

bokelley merged 1 commit into
mainfrom
claude/issue-4230-extend-uuid-idempotency-keys

Conversation

@bokelley

@bokelley bokelley commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4230
Closes #4344

Summary

Extends the $generate:uuid_v4#<alias> pattern to all remaining hardcoded idempotency_key literals across the compliance storyboard suite. Scope expanded on rebase after #4232 merged the original media-buy sweep; this PR covers the universal, specialism, and protocol files that were out of scope for that sweep.

What this PR converts (16 keys, 9 files):

File Keys
universal/error-compliance.yaml 5 (negative-budget, nonexistent-product, reversed-dates, structure, transport)
universal/error-compliance-signals.yaml 4 (signals-nonexistent, signals-missing-field, signals-structure, signals-transport)
universal/schema-validation.yaml 1 (reversed-dates)
specialisms/governance-spend-authority/{index,denied}.yaml 2 (sync, denied-sync)
specialisms/governance-delivery-monitor/index.yaml 1
specialisms/signal-marketplace/scenarios/governance_denied.yaml 1
specialisms/creative-ad-server/index.yaml 1 (was the literal a1b2c3d4-… UUID)
protocols/governance/index.yaml 1 (escalation-sync)

Root cause: Hardcoded keys collide cross-run when a seller's IdempotencyStore is long-lived. The runner shifts start_time forward to keep buys future-dated, so each run produces same key + different canonical body → seller correctly replays a stale cached response. This blocks conformance scenarios whenever the seller ships a spec-version upgrade that changes its response shape.

Literal UUID handling: The a1b2c3d4-e5f6-7890-abcd-ef1234567890 literal in creative-ad-server/index.yaml was inside an executed sample_request block under a steps: chain (not a docs-only example). Converted to $generate:uuid_v4#creative-ad-server-report-usage. No format-probe semantics in the surrounding validations.

Not in scope: measurement_terms_rejected.yaml and provenance_enforcement.yaml still have non-prefixed aliases (pre-existing, pre-date the naming convention). Left as follow-up to avoid scope creep.

Verification: grep -rn 'idempotency_key: "[^$]' static/compliance/source --include='*.yaml' returns zero results. Storyboard sweep complete.

Non-breaking justification

Storyboard YAML files are conformance test harness configuration, not published protocol schema. No wire format, task definition, schema field, or normative requirement is changed. The $generate:uuid_v4#alias token is runner-internal and never transmitted to a seller. Per playbook "Conformance harness" — additive or fix changes are --empty (no protocol bump).

Build

npm run build:compliance passes with all 12 storyboard lints green:

✓ scoping lint ✓ branch-set lint ✓ provides_state_for lint
✓ contradiction lint ✓ context-entity lint ✓ auth-shape lint
✓ test-kits lint ✓ pagination-invariant lint ✓ vendor metric uniqueness lint
✓ check-enum lint ✓ raw-mode-required lint ✓ advisory-expiry lint
✅ 23 universal, 6 protocols, 20 specialisms

Pre-PR review

Note: pre-PR review was conducted on the original 15-key media-buy scope (before @bokelley's scope expansion on 2026-05-10 to 16 keys across universal/specialism/protocol files). The additional keys follow the same $generate:uuid_v4#alias pattern; re-review can be requested if needed.

  • code-reviewer: approved — all 15 keys covered (original scope), aliases unique (53/53), convention consistent, --empty correct. Noted measurement_terms_rejected / provenance_enforcement pre-existing non-prefixed aliases are out of scope for this PR.
  • ad-tech-protocol-expert: approved — non-breaking per spec, sync_plans dynamic key is sound (governance agent upserts on plan_id deterministically regardless of key), --empty changeset classification is correct per playbook.

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num> →
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See #3121
for context.

Session: https://claude.ai/code/session_016efYC8QLXVZZSPiisZ83oM


Generated by Claude Code

@bokelley bokelley added the claude-triaged Issue has been triaged by the Claude Code triage routine. Remove to re-triage. label May 8, 2026
@bokelley

Copy link
Copy Markdown
Contributor Author

Issue #4344 identifies ~14 additional static idempotency_key values not covered by this PR: error-structure-test, error-test-negative-budget, error-test-nonexistent-product, error-test-reversed-dates, error-transport-test, governance-delivery-monitor-sync-plans-v1, governance-spend-authority-denied-sync-plans-v1, governance-spend-authority-sync-plans-v1, measurement-terms-probe-aggressive-v1, measurement-terms-probe-relaxed-v1, media-buy-governance-escalation-sync-plans-v1, schema-validation-reversed-dates-v1, signal-gov-denied-v1, plus the literal UUID a1b2c3d4-e5f6-7890-abcd-ef1234567890. Same surface as this PR (compliance/source/protocols/**/scenarios/*.yaml), same mechanism. Consider folding before merge or confirm a follow-up PR.

One flag before folding: a1b2c3d4-e5f6-7890-abcd-ef1234567890 may be a format-probe scenario (some conformance validators check UUID format, not freshness) — verify before converting to $generate:uuid_v4#alias.

Note on the three immediate blockers from #4344: pending-creatives-transition-v1 is already covered here; measurement-terms-probe-aggressive-v1 and measurement-terms-probe-relaxed-v1 are the uncovered ones causing the live replay failures against wonderstruck.sales-agent.scope3.com.


Generated by Claude Code

@bokelley

Copy link
Copy Markdown
Contributor Author

Folded — commit f230a0a.

13 keys converted across 8 files:

File Key → alias
universal/error-compliance.yaml 5 keys: error-test-negative-budget, error-test-nonexistent-product, error-test-reversed-dates, error-structure-test, error-transport-test
universal/schema-validation.yaml schema-validation-reversed-dates-v1
protocols/governance/index.yaml media-buy-governance-escalation-sync-plans-v1
specialisms/creative-ad-server/index.yaml a1b2c3d4-e5f6-7890-abcd-ef1234567890
specialisms/governance-delivery-monitor/index.yaml governance-delivery-monitor-sync-plans-v1
specialisms/governance-spend-authority/denied.yaml governance-spend-authority-denied-sync-plans-v1
specialisms/governance-spend-authority/index.yaml governance-spend-authority-sync-plans-v1
specialisms/signal-marketplace/scenarios/governance_denied.yaml signal-gov-denied-v1

On the UUID flag: a1b2c3d4-e5f6-7890-abcd-ef1234567890 is safe to convert — the report_billing/report_usage step in creative-ad-server validates response_schema and context.correlation_id echo only; no check inspects the idempotency_key value or format. Converted.

On measurement-terms-probe-aggressive-v1 / measurement-terms-probe-relaxed-v1: these are already $generate:uuid_v4 in the current source (measurement_terms_rejected.yaml, fixed in #4218). The hardcoded values you're seeing in live replay are from the immutable dist/3.0.x/ snapshots — those don't change without a new release cut.

Not folded: error-compliance-signals.yaml (4 keys: error-test-signals-nonexistent, error-test-signals-missing-field, error-structure-signals-test, error-transport-signals-test) — these weren't in #4344's list; tracked separately.

build:compliance — 23 universal, 6 protocols, 20 specialisms, all 12 lints green.


Generated by Claude Code


Generated by Claude Code

…al/schema storyboards

Converts the 16 remaining static idempotency_key literals across:
- universal/error-compliance.yaml (5)
- universal/error-compliance-signals.yaml (4)
- universal/schema-validation.yaml (1)
- specialisms/governance-spend-authority/{index,denied}.yaml (2)
- specialisms/governance-delivery-monitor/index.yaml (1)
- specialisms/signal-marketplace/scenarios/governance_denied.yaml (1)
- specialisms/creative-ad-server/index.yaml (1, includes the literal a1b2c3d4 UUID)
- protocols/governance/index.yaml (1)

After this commit, zero static idempotency_keys remain under
static/compliance/source/. Storyboard re-runs against spec-compliant sellers
will no longer collide with cached responses after seller-side deploys.

Closes #4344. Builds on #4232 (the original media-buy sweep).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@bokelley
bokelley force-pushed the claude/issue-4230-extend-uuid-idempotency-keys branch from f230a0a to f71d5b7 Compare May 10, 2026 17:38
@bokelley
bokelley marked this pull request as ready for review May 10, 2026 17:39
@bokelley

Copy link
Copy Markdown
Contributor Author

Scope expanded to close #4344

Force-with-lease rebased onto main (8675d6ab) and replaced the original two-commit history with a single commit f71d5b7d86 covering only the keys that remain static after #4232 already merged the original media-buy sweep.

What this commit converts (16 keys, 9 files)

File Keys
universal/error-compliance.yaml 5 (negative-budget, nonexistent-product, reversed-dates, structure, transport)
universal/error-compliance-signals.yaml 4 (signals-nonexistent, signals-missing-field, signals-structure, signals-transport)
universal/schema-validation.yaml 1 (reversed-dates)
specialisms/governance-spend-authority/{index,denied}.yaml 2 (sync, denied-sync)
specialisms/governance-delivery-monitor/index.yaml 1
specialisms/signal-marketplace/scenarios/governance_denied.yaml 1
specialisms/creative-ad-server/index.yaml 1 (was the literal a1b2c3d4-… UUID)
protocols/governance/index.yaml 1 (escalation-sync)

Literal UUID handling

The a1b2c3d4-e5f6-7890-abcd-ef1234567890 literal in creative-ad-server/index.yaml was inside an executed sample_request block under a steps: chain (verified — not a docs-only example). Converted to $generate:uuid_v4#creative-ad-server-report-usage. No format-probe semantics in the surrounding validations.

Verification

grep -rn 'idempotency_key: "[^$]' static/compliance/source --include='*.yaml'

returns zero results (modulo comments). Storyboard sweep is complete.

Why force-push

The original two commits (3550611 + f230a0a) were largely redundant with #4232 once it merged, and rebasing them produced cross-step alias conflicts. Resetting to main and reapplying as one commit is clean and reviewable.

Closes #4344.

@bokelley bokelley changed the title fix(compliance): extend $generate:uuid_v4 to all hardcoded idempotency_keys in media-buy storyboards fix(compliance): extend $generate:uuid_v4 to all hardcoded idempotency_keys across compliance storyboards May 10, 2026
@bokelley
bokelley merged commit 36662da into main May 10, 2026
19 checks passed
@bokelley
bokelley deleted the claude/issue-4230-extend-uuid-idempotency-keys branch May 10, 2026 18:33
bokelley added a commit that referenced this pull request May 10, 2026
…al/schema storyboards (3.0.x) (#4351)

3.0.x port of #4231. Converts the 12 static idempotency_key literals that exist on this branch:
- universal/error-compliance.yaml (5)
- universal/schema-validation.yaml (1)
- specialisms/governance-spend-authority/{index,denied}.yaml (2)
- specialisms/governance-delivery-monitor/index.yaml (1)
- specialisms/signal-marketplace/scenarios/governance_denied.yaml (1)
- specialisms/creative-ad-server/index.yaml (1, includes the literal a1b2c3d4 UUID)
- protocols/governance/index.yaml (1)

Note: error-compliance-signals.yaml does not exist on 3.0.x (3.1-era addition),
so the 4 keys converted there on main are not applicable here.

After this commit, zero static idempotency_keys remain under
static/compliance/source/ on 3.0.x.

Closes #4344 on the 3.0.x line. Forward-merge will sync back to main.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@aao-release-bot aao-release-bot Bot mentioned this pull request May 10, 2026
bokelley added a commit that referenced this pull request May 10, 2026