Skip to content

fix(compliance): skip webhook phases on sync create_media_buy (3.1.x backport of #8894) - #9127

Merged
bokelley merged 1 commit into
3.1.xfrom
backport/3.1.x-webhook-emission-sync-create-media-buy
Nov 20, 2026
Merged

bokelley merged 1 commit into
3.1.xfrom
backport/3.1.x-webhook-emission-sync-create-media-buy

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

Backport of #8894 to 3.1.x. webhook_emission fails polling-only sellers whose create_media_buy returns the media buy inline, although the spec says a synchronous completion sends no webhook (webhooks.mdx "When webhooks fire", #5389). The seller report in #8771 was against 3.1.31; sellers certify against 3.1.

Changes

Squash cherry-pick of 7ec4059021 with -x, adapted to 3.1.x.

Same semantics as main:

  • The primary create_media_buy trigger moves into its own phase (primary_webhook_trigger).
  • When it returns a media_buy_id (an inline terminal result), synchronous_trigger_silence asserts that no matching task webhook arrives within 5 s.
  • On a sync trigger, the emitted-webhook phases (idempotency_key_presence, operation_id_echo, idempotency_replay_side_effects, idempotency_key_stability, signing_keys_published, signature_validity) are skipped with skip_if: "context.media_buy_id". Triggers that return submitted, or working without a media_buy_id, are graded on signed webhooks as before.
  • A sync seller that declares webhook_signing.supported: true is still graded on its JWKS (signing_keys_published_declared).

Differences from main:

  • Storyboard version 1.3.2, not 1.5.0. The storyboard hunks are main's verbatim, but main's 1.4.x/1.5.0 also carry the wholesale get_products silence step (test(compliance): enforce sync webhook silence #6539), which 3.1 does not.
  • expect_no_webhook is documented in universal/storyboard-schema.yaml. No 3.1 storyboard used it before, so its task entry is copied from main's. Additive harness step kind.
  • Tests. 3.1.x pins @adcp/sdk 9.6.2, whose runner only evaluates test_kit.* phase skip_if and has no expect_no_webhook. The structural gating test runs on every SDK; the six full-run tests are skipped below SDK 14 with a reason. 3.1's wholesale get_products branch is not capability-gated (main gates it on media_buy.buying_modes), so the fake agent in those runs echoes context for it.
  • 3.1 schemas match the narrative: the create_media_buy submitted branch forbids media_buy_id, create-media-buy-async-response-working.json is open, and webhook_signing.supported / media_buy.reporting_delivery_methods exist.

The working + media_buy_id misclassification noted in #8894 is fixed in the runner by adcontextprotocol/adcp-client#3683.

Patch eligibility

Conformance harness: an additive phase, an additive step kind on this line, and gates that stop grading a conformant seller on a webhook the spec says it must not send. No schema, task or normative change.

Testing

  • npm run test:webhook-emission-storyboard with the pinned SDK 9.6.2: 12 pass, 6 skipped (runner-gated), 0 fail.
  • Same file with @adcp/sdk swapped in locally: 17.0.0-beta.29 (hosted grading) and 16.7.2 both pass all six full runs and the gating test. One existing test, old missing-discovery behavior ships test-product…, fails under both because it pins 9.6.2's default pricing_option_id; that is unchanged by this PR. SDK 13.1.4 (adcp-3.1 dist-tag) does not evaluate context.* skip_if, as with 3.1's existing creative gates.
  • node scripts/build-compliance.cjs --check and every test:storyboard-* suite pass (cli-scenario-fixtures needed a longer local timeout on a loaded machine); test:compliance-packaged-refs, test:compliance-source-authority, test:sdk-runner-capability-gates, test:immutable-release-artifacts pass.
  • check-changeset-protocol-scope.cjs origin/3.1.x and changeset status --since=origin/3.1.x pass.

Refs #8771

🤖 Generated with Claude Code

…backport of #8894)

webhook_emission failed polling-only sellers whose create_media_buy
returns the media buy inline. The spec says a synchronous completion
sends no webhook, even when push_notification_config is present
(webhooks.mdx "When webhooks fire", #5389), so such a seller failed
expect_webhook_presence and the signing-key precheck.

When the primary create_media_buy trigger returns the media buy inline,
the storyboard now asserts that no task webhook arrives and skips the
emitted-webhook phases. Triggers that return submitted, or working
without a media_buy_id, are still graded on signed webhooks. A
synchronous seller that declares webhook_signing.supported: true is
still graded on its JWKS (signing_keys_published_declared).

Adapted to 3.1.x:
- The storyboard hunks are main's verbatim. Its version moves 1.3.1 ->
  1.3.2: main's 1.4.x/1.5.0 include the wholesale get_products silence
  step (#6539), which 3.1 does not carry.
- expect_no_webhook is new to the 3.1 storyboards, so its task entry is
  added to universal/storyboard-schema.yaml as main documents it.
- 3.1.x pins @adcp/sdk 9.6.2, whose runner ignores context.* skip_if.
  The full-run tests are skipped under it; the structural gating test
  runs everywhere. They pass under 17.0.0-beta.29 (hosted grading) and
  16.7.2. 3.1's wholesale get_products branch is not capability-gated,
  so the fake agent echoes context for it.

Refs #8771

(cherry picked from commit 7ec4059)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bokelley
bokelley requested a review from a team as a code owner November 20, 2026 13:03

@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 backport of #8894 to 3.1.x with no blocking or Medium findings.

Checked:

  • Gate logic in webhook-emission.yaml: synchronous_trigger_silence skips on !context.media_buy_id (L304) and its expect_no_webhook filter/triggered_by (L315-L318) are exact complements to the six emitted-webhook phases (skip_if context.media_buy_id) — exactly one branch grades per run.
  • signing_keys_published_declared (L864) does not double-grade with signing_keys_published.
  • expect_no_webhook is additive doc-comment only; webhook_signing/reporting_delivery_methods exist in 3.1 base schemas.
  • Test harness change (172 adds) is additive; the completed→submitted flip and per-key replayed detection are correct; known working+media_buy_id limitation is covered.
  • Patch eligibility holds — no schema/task/normative changes.

No high-risk flag, no gated paths, no author team gate, no prior decision. Minor Low note (PR body cites adcp-client#3683 vs #3682 in artifacts) not surfaced.

@bokelley
bokelley merged commit 46a0ba9 into 3.1.x Nov 20, 2026
11 checks passed
@bokelley
bokelley deleted the backport/3.1.x-webhook-emission-sync-create-media-buy branch November 20, 2026 13:19
bokelley added a commit that referenced this pull request Nov 20, 2026
Adds 3.1.34 to static/compliance/published-versions.json
(registerPublishedVersion) so hosted 3.1 resolves to the release carrying
the webhook_emission synchronous-create_media_buy fix (#8894, 3.1.x
backport #9127). Raises the stale hosted 3.1 alias floor in
server/tests/unit/storyboards.test.ts from 3.1.30 to 3.1.34.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
KonstantinMirin pushed a commit to KonstantinMirin/adcp that referenced this pull request Nov 21, 2026
Brings the published 3.1.34 release records to main.

Resolved:
- package.json, package-lock.json, static/schemas/source/index.json: main's.
- CHANGELOG.md: main's plus the 3.1.34 block (forward-merge-release-records.cjs changelog).
- dist/schemas/index.json, latest.json: 3.1.x's, regenerated in the next commit.
- static/compliance/source/universal/webhook-emission.yaml and
  tests/webhook-emission-storyboard.test.cjs: main's. adcontextprotocol#9127 is the 3.1
  adaptation of adcontextprotocol#8894, which main already carries in its 3.3 form.
- docs/building/by-layer/L0/a2a-guide.mdx and
  docs/creative/canonical-formats-migration.mdx: main's. adcontextprotocol#8979 brought
  3.1.x's docs to the agent-card.json path main already uses.

Co-Authored-By: Claude Opus 5.5 <[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.

1 participant