Repository navigation
fix(storyboard): skip interim create/update_media_buy context on SDK 16 (#3683) - #3755
Conversation
…16 (#3683) Backport of #3683. The storyboard runner recorded context.media_buy_id and media_buy_status from any create_media_buy or update_media_buy response, including interim task envelopes (submitted, working, input-required). A schema-valid working envelope can carry media_buy_id, so storyboards that gate on context.media_buy_id, such as webhook_emission's synchronous-trigger check (adcontextprotocol/adcp#8894), classified an asynchronous seller as synchronous. Interim envelopes now contribute nothing to context; any other response extracts as before. 16.x's context.ts and context-extractors test were identical to main's, so this is a clean cherry-pick. Closes #3682 (cherry picked from commit 2995c6e) Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean, well-scoped bugfix.
The storyboard context extractor now suppresses media_buy_id/media_buy_status capture from interim create_media_buy/update_media_buy task envelopes (submitted/working/input-required), fixing adcp-client#3682 where an async seller looked synchronous to storyboards gating on context.media_buy_id. The INTERIM_TASK_STATUSES set matches runner.ts's POLL_ELIGIBLE_STATUSES verbatim and is intentionally duplicated to avoid a context→runner import cycle; none of the three values is a media-buy lifecycle status per getAuthoritativeMediaBuyStatus, so the top-level guard is safe. Test matrix (2 tasks × 3 interim statuses × nested/top-level) plus terminal regression cases is thorough. Changeset type patch is correct for a runner bugfix with no wire/export impact.
No Critical/High/Medium findings. high_risk false, gated_paths false, no author-team gate, no prior decision. Falls through to row 9.
Summary
Backport of #3683 to the SDK 16 line (
adcp-3.2andlatestdist-tags). The storyboard runner recordedcontext.media_buy_idandmedia_buy_statusfrom anycreate_media_buyorupdate_media_buyresponse, including interim task envelopes (submitted,working,input-required). A schema-validworkingenvelope can carrymedia_buy_id, sowebhook_emission's synchronous-trigger gate (adcontextprotocol/adcp#8894, being backported to AdCP 3.1.x and 3.2.x) classified an asynchronous seller as synchronous and failed its completion webhook.Changes
Cherry-pick of the #3683 squash commit
2995c6edd3with-x. 16.x'ssrc/lib/testing/storyboard/context.tsandtest/lib/context-extractors.test.jswere identical to main's, so it applied cleanly. It carries #3683's own patch changeset (.changeset/skip-interim-create-media-buy-context.md).create_media_buyandupdate_media_buyextract no context when the top-levelstatusissubmitted,workingorinput-required. Any other response, including legacy top-level lifecycle statuses, extracts as before.Testing
node --test test/lib/context-extractors.test.js: 46/46.npm run build:lib,npm run typecheck, commitlint: clean.tests/webhook-emission-storyboard.test.cjs(with #8894 backported) run against this build: the sync, submitted and declared-signing cases pass, and the test that pins the old misclassification (a working envelope carrying media_buy_id is classified as synchronous) now fails as intended, because the working seller is graded on its webhooks.Refs #3682, adcontextprotocol/adcp#8771
🤖 Generated with Claude Code