Skip to content

spec: creative lifecycle on buy rejection/cancellation (#2254, #2262) - #2622

Merged
bokelley merged 2 commits into
mainfrom
bokelley/creative-fate-on-buy-rejection
Apr 21, 2026
Merged

bokelley merged 2 commits into
mainfrom
bokelley/creative-fate-on-buy-rejection

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

External contributor filed #2254 flagging an undefined behavior in the media-buy lifecycle: what happens to synced creatives when a media buy is subsequently rejected or canceled? Two defensible interpretations existed: atomic (buy rejection unwinds the creative create) or decoupled (creative enters the library regardless; buy rejection only releases the assignment).

Partial text was added to creative-libraries.mdx:252 adopting the decoupled interpretation, but the rule wasn't discoverable from the media-buy side and #2262's open questions (review flow fate, capability-flag scope, inline vs sync equivalence) were left implicit. This PR closes the loop.

Decision

Decoupled semantics are normative. The creative lifecycle is independent of the containing buy's lifecycle. Assignments are released on buy rejection or cancellation; the creatives themselves remain in the creative library and are reusable.

Changes

  • docs/media-buy/specification.mdx (Media Buy State Transitions): normative bullet stating creative assignments are released on rejection/cancellation; creatives remain in the library, reusable by creative_id — including inline creatives submitted on the rejected/canceled create. Creative review proceeds independently; sales agents MUST NOT implicitly reject a creative because its containing buy was rejected. Released assignments no longer appear in get_media_buys responses for that buy.
  • docs/media-buy/specification.mdx (Package-level lifecycle): clarifies package cancellation releases assignments on the canceled package only; other packages on the same buy are unaffected.
  • docs/creative/creative-libraries.mdx (Path 2 inline): reverse cross-reference to the media-buy rule, MUST on deliberate-review-decision rejections (no implicit cascade from buy status), capability-flag scope note (inline_creative_management: true advertises acceptance, not lifecycle tie).

Scope deliberately excluded

Test plan

  • npm run test:unit passes (631 tests)
  • npm run typecheck passes
  • Spec review — confirm bidirectional cross-references are healthy and the MUSTs are the right teeth

Closes #2254. Closes #2262.

🤖 Generated with Claude Code

…released, creatives remain (#2254, #2262)

External contributor filed #2254 flagging that the spec did not define
what happens to synced creatives when a media buy is subsequently
rejected or canceled. Partial text was added to creative-libraries.mdx
adopting the decoupled interpretation, but the rule wasn't discoverable
from the media-buy side and #2262's open questions (review flow fate,
capability-flag scope) were left implicit.

Changes:

- docs/media-buy/specification.mdx (Media Buy State Transitions):
  normative bullet stating assignments are released on rejection/
  cancellation; creatives remain in the library, reusable by
  creative_id — including inline creatives. Creative review proceeds
  independently; agents MUST NOT implicitly reject a creative because
  its containing buy was rejected. Released assignments no longer
  appear in get_media_buys responses for that buy.
- docs/media-buy/specification.mdx (Package-level lifecycle):
  clarifies package cancellation releases assignments on that
  package only; other packages unaffected.
- docs/creative/creative-libraries.mdx (Path 2 inline): reverse
  cross-reference to the media-buy rule, MUST on deliberate-review-
  decision rejections, capability-flag scope note.

Scope excludes #2260 (retention floor, stays 3.1) and purge-
notification webhooks (stays 3.1).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@github-actions

github-actions Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Schema Link Check Results

Commit: ac153d5 - spec: address reviewer feedback on creative-fate PR (#2254, #2262)

⚠️ Warnings (schema not yet released)

These schemas exist in source but haven't been released yet. The links will be broken until the next version is published:

  • https://adcontextprotocol.org/schemas/v3/enums/specialism.json
    • Schema exists in latest (source) but not yet released in v3
    • Action: This link will work after next 3.x release is published

To fix: Either:

  1. Wait for the next release and merge this PR after the release is published
  2. Use latest instead of a version alias if you need the link to work immediately (note: latest is the development version and may change)
  3. Coordinate with maintainers to cut a new release before merging

Fix reviewer-identified issues:

- BLOCKER (dx-expert): broken anchor
  #creative-state-vs-assignment-state → actual Docusaurus slug
  #creative-state-and-assignment-state-are-separate

- Protocol nit (ad-tech-protocol-expert): "silently absent"
  observability was too weak. Add explicit "the media-buy-level
  canceled/rejected transition IS the audit record for all its
  released assignments; buyers MUST NOT rely on per-assignment
  diffs." Frames existing history + webhook notifications as the
  intentional audit surface.

- DX nit (dx-expert): retention punt without a floor weakens the
  reusability contract. Add SHOULD-90-days placeholder referencing
  #2260 where the normative contract lands. 90 matches existing
  variant-retention guidance.

- DX nit (dx-expert): 180-word run-on bullet. Split into four
  separate bullets (release, review independence, observability,
  retention) at the same list level.

- PM nit (adtech-product-expert): buyer guidance incomplete. Add
  "SHOULD call list_creatives to verify" for the affirmative
  reusability check.

- Protocol nit (ad-tech-protocol-expert): creative_deadline
  scoping. Add one-sentence carve-out — prior package's deadline
  has no bearing on the creative's eligibility for a new buy.

- DX nit (ad-tech-protocol-expert): "regardless of whether via
  sync_creatives" → "regardless of submission path" in
  creative-libraries.mdx capability-flag scope note.

- DX nit (dx-expert): MUST-NOT-implicitly-reject needle. Add
  explicit "the buy's rejected status is not itself sufficient"
  clause for the policy-triggered creative rejection case.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
bokelley added a commit that referenced this pull request Apr 21, 2026
Before #2619, re-cancel of a canceled buy was spec-ambiguous —
§128 MAY NOT_CANCELLABLE and §129 MUST INVALID_STATE both applied.
state-machine.yaml reflected the ambiguity with "Either reject with
INVALID_STATE or accept idempotently."

#2619 pinned NOT_CANCELLABLE as the required code for re-cancel.
This storyboard now matches:

- expect_error: true (was missing — allowed idempotent accept)
- Expected code: NOT_CANCELLABLE (was INVALID_STATE-or-accept)
- validations: error_code check + context echo (mirrors
  invalid_transitions.yaml > second_cancel pattern)

Narrative updated to explain the carve-out: cancellation-specific
code takes precedence over the generic terminal-state rule;
idempotent acceptance is NOT conformant.

No other storyboards tested this case; invalid_transitions.yaml's
second_cancel phase already expected NOT_CANCELLABLE and stays
correct. No conflicts found with #2620 or #2622 storyboards.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
bokelley added a commit that referenced this pull request Apr 21, 2026
* storyboards: align state-machine recancel_buy with #2619 spec tightening

Before #2619, re-cancel of a canceled buy was spec-ambiguous —
§128 MAY NOT_CANCELLABLE and §129 MUST INVALID_STATE both applied.
state-machine.yaml reflected the ambiguity with "Either reject with
INVALID_STATE or accept idempotently."

#2619 pinned NOT_CANCELLABLE as the required code for re-cancel.
This storyboard now matches:

- expect_error: true (was missing — allowed idempotent accept)
- Expected code: NOT_CANCELLABLE (was INVALID_STATE-or-accept)
- validations: error_code check + context echo (mirrors
  invalid_transitions.yaml > second_cancel pattern)

Narrative updated to explain the carve-out: cancellation-specific
code takes precedence over the generic terminal-state rule;
idempotent acceptance is NOT conformant.

No other storyboards tested this case; invalid_transitions.yaml's
second_cancel phase already expected NOT_CANCELLABLE and stays
correct. No conflicts found with #2620 or #2622 storyboards.

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

* add changeset for storyboard-recancel-alignment fixup

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@bokelley
bokelley merged commit 56c68f8 into main Apr 21, 2026
16 checks passed
bokelley added a commit that referenced this pull request Apr 21, 2026
…) (#2641)

PR #2622 / merged #2623 pinned the decoupled creative-lifecycle rule:
canceling a media buy releases its package-creative assignments but
leaves the creatives in the library, reusable by creative_id. The
spec change had no runtime conformance test — every sales specialism
tests sync_creatives during a successful flow, but none tested
creative state after a buy cancel end-to-end. A seller that evaporated
library creatives on cancel, or implicitly flipped them to rejected,
could pass every existing storyboard.

New scenario exercises the full loop with synchronous AdCP tools (no
new infrastructure):

1. setup — create buy, sync creative with inline assignment
2. verify_creative_in_library_pre_cancel — list_creatives baseline
3. cancel_buy — update_media_buy canceled: true
4. verify_creative_persists_post_cancel — list_creatives still
   returns creative; status in {processing, pending_review, approved}
   (NOT rejected, NOT archived)
5. reuse_creative_on_new_buy — sync_creatives assigning the original
   creative_id to a second buy's package

Hooked into media-buy/index.yaml requires_scenarios so every seller
claiming the track MUST pass it. Sellers without a creative library
grade not_applicable.

Co-authored-by: Claude Opus 4.7 (1M context) <[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

1 participant