fix(compliance): flow-derived id captures, context-echo cleanup, format_id integrity step#2600
Merged
Conversation
…at_id integrity step Closes #2585, #2589, #2597 at the storyboard-YAML layer. - Seven storyboards now capture media_buy_id via context_outputs and reference it via $context.media_buy_id in downstream steps, replacing hardcoded mb_* literals that only resolved under the prior scenario-seeded fixtures. - Two context-echo authoring bugs fixed: validators asserted on context.* but sample_request sent none, relying on runner synthesis the spec now forbids. - New list_formats_integrity step on media_buy_seller catches stale format_ids[] references at discovery rather than silently at sync_creatives, and asserts the format_id round-trips verbatim through the list_creative_formats filter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…correlation_id fix Address three pre-merge observations on PR #2600: 1. Changeset flags the content-standards correlation_id correction as a spec-aligned tightening, not a new requirement — agents that were "passing" by echoing the stale prior-step id will now correctly fail. 2. governance_denied_recovery:create_media_buy_retry now declares context_outputs on the successful retry, so a future phase asserting pacing/delivery on the retried buy can consume $context.media_buy_id without re-discovering the capture. 3. media-buy/index.yaml verified — create_media_buy captures media_buy_id upstream of every downstream consumer (check_buy_status and get_delivery across distinct phases). No change needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 21, 2026
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.
Summary
Closes #2585, #2589, #2597 at the storyboard-YAML layer. Each of these issues has a spec/doc side that already landed (#2585 + #2589 via #2593, #2597 is net-new); this PR completes the storyboard migration so the training-agent conformance suite stops tripping on hardcoded fixtures and missing context blocks.
#2588 is not touched —
test:error-codeslint + alias file landed in #2595 + #2596; issue stayed open because the close-on-merge marker didn't fire.What changed
#2585 — flow-derived IDs via
$context.media_buy_id. Seven storyboards hardcodedmb_*literals against media buys created earlier in the same run. Eachcreate_media_buystep now declarescontext_outputs: [{ name: media_buy_id, path: "media_buy_id" }], and downstreamget_media_buys/update_media_buy/get_media_buy_delivery/report_plan_outcomesteps resolve"$context.media_buy_id". Storyboards covered:protocols/media-buy/index.yaml,protocols/governance/index.yaml(governance_escalation phase), and specialismssales-guaranteed/sales-non-guaranteed/sales-proposal-mode/sales-broadcast-tv/sales-catalog-driven/creative-generative/generative-seller.creative-ad-serverandgovernance-delivery-monitorkeep their literals — those storyboards reference prerequisite media buys (Pattern A /fixtures:block) with no creating step to capture from.#2589 — two context-echo authoring bugs. Both storyboards asserted
context.correlation_idon the response but did not sendcontext:on the sample_request, relying on runner-synthesized context that #2593 now explicitly forbids.specialisms/content-standards/index.yaml:calibrate_after_policy_change— sendscontext.correlation_idexplicitly (assertion value was also stale — it pointed at the prior step's correlation id).protocols/media-buy/scenarios/governance_denied_recovery.yaml:create_media_buy_denied— sendscontext:explicitly and tightensfield_present: contextto afield_value: context.correlation_idecho assertion. Exercises the echo-on-error contract directly (the step hasexpect_error: true).#2597 —
list_formats_integritystep onmedia_buy_seller. New step inproduct_discoveryphase betweenget_products_briefandcreate_buy. Filterslist_creative_formatsbyformat_ids: ["$context.product_format_id"](captured FormatID object fromget_products) and asserts:formats[0]resolves (stale/typo'd format_id → empty array → fail).formats[0].format_idequals$context.product_format_idverbatim (agent cannot substitute a different format under the filter).Implements the issue's Option B (baseline check for every seller agent). Cross-agent dispatch — calling the creative agent at
format_ids[].agent_urldirectly rather than the sales agent under test — is a runner follow-up: for single-agent sellers the current step is an integrity check; for true cross-agent sellers the sales agent either proxies the lookup or fails with an empty result, which still catches the failure mode the issue describes.Review addressed
field_presentchecks on schema-required subfields; addedfield_valueequality on the round-tripped FormatID so the narrative claim is actually enforced by a validation (previously onlyfield_present: formats[0]).name→keyalias in loader.js:31, explicit outputs applied after convention extractors in runner.js:842).$context.<name>substitution confirmed to walk nested objects and array elements and resolve to captured values including FormatID objects.test:storyboard-scoping,test:error-codes,test:schemas,test:examples,test:composed,test:unit,typecheck,build:complianceall green. Kept explicitcontext_outputs:oncreate_media_buy(even though the convention extractor at context.js:63 produces the same key) to match the Pattern B example indocs/contributing/storyboard-authoring.md— authoring-doc consistency over terseness.$context.<k>substitution is anchored whole-string regex (no prompt-injection surface). Context accumulator is run-scoped via a per-run object identity (no cross-run leakage). Correlation_id values are non-secret storyboard identifiers already committed to the repo.Test plan
npm run test:storyboard-scoping— 3/3 passnpm run test:error-codes— clean (0 errors, 1 pre-existing YAML-parse warning onrunner-output-contract.yaml)npm run test:schemas— 7/7 passnpm run test:examples— 31/31 passnpm run test:composed— 15/15 passnpm run test:unit— 627/627 passnpm run typecheck— cleannpm run build:compliance— clean@adcp/clientagainst the training agent (follow-up; this repo has no runner-integration test suite)list_creative_formatsdispatch inlist_formats_integrity🤖 Generated with Claude Code