Skip to content

feat(creative): report how current creative assignment and approval state is - #8174

Merged
bokelley merged 3 commits into
mainfrom
bokelley/creative-state-as-of
Oct 15, 2026
Merged

bokelley merged 3 commits into
mainfrom
bokelley/creative-state-as-of

Conversation

@bokelley

@bokelley bokelley commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A buyer reading creative state from a sales agent can't tell how current it is. A seller may confirm assignments and approvals asynchronously, for example a system that confirms a day after the write. A buyer seeing pending_review or a missing assignment can't tell "the seller's system says so" from "the seller hasn't heard back yet".

This PR applies the existing media_buys[].status_as_of pattern to creative state. Keeping state current stays the seller's job. AdCP does not get a "re-pull" task and does not assume what sits behind the sales agent. The buyer only learns how current each answer is.

Four optional, non-nullable date-time fields (x-added-in: 3.3.0):

Read Field Covers
get_media_buys packages[].creative_assignments_as_of the package's assignment set, so a missing creative is absent "as of" this time
get_media_buys packages[].creative_approvals[].approval_status_as_of approval_status, rejection_reason, approval_scopes
list_creatives creatives[].status_as_of creative status
list_creatives assignments.assigned_packages[].approval_status_as_of the same relationship, as seen by list_creatives

Rules, in a new creative state freshness section:

  • What the value means: the seller's last observation of its source of truth. It is never later than the oldest upstream observation that could affect it. If it's omitted, the seller makes no freshness claim.
  • Writes don't advance it: accepting an AdCP write MUST NOT advance the value; observing the resulting state does. For a seller whose AdCP store is the source of truth, that happens at commit time.
  • "Not known yet" needs no new status: a value earlier than the buyer's last accepted write means the write isn't confirmed yet.
  • No timestamp-only notifications: a change that only advances an *_as_of value fires no creative.assignment_changed / creative.status_changed and writes no account change record.
  • Reads agree: approval_status_as_of joins the fields get_media_buys and list_creatives MUST agree on for the same relationship, when both carry it. The existing agreement rule is unchanged, so this PR is purely additive.
  • STALE_RESPONSE: described as the complementary signal for when the seller could not reach its source and served cached state past its freshness target.

This is one of three related 3.3 PRs about creative state a buyer can rely on. The other two:

  • identifying seller-created creatives and returning seller IDs on reads
  • merging a seller-created copy into the buyer's creative on a package

Test plan

  • status-as-of vectors extended: a new creative-state-freshness vector, declaration checks for all four fields, and a test that null is rejected (15/15)
  • schema-validation, json-schema and snippet checks on the touched docs, error-codes, platform-agnostic, composed, examples, contracts, mcp-schema-projection, build:compliance --check, changeset scope

🤖 Generated with Claude Code

…tate is

A buyer reading creative state cannot tell how current it is. Sellers
whose source of truth confirms assignment or approval asynchronously
(for example, a system that confirms a day after the write) serve state
that may predate the buyer's last write, and the buyer cannot tell
"not yet confirmed" from "confirmed".

Apply the existing media_buys[].status_as_of pattern to creative state
with four optional, non-nullable date-time fields:
get_media_buys packages[].creative_assignments_as_of and
creative_approvals[].approval_status_as_of, and list_creatives
creatives[].status_as_of and assigned_packages[].approval_status_as_of.

Each value is the seller's last observation of its source of truth and
is not advanced by accepting an AdCP write alone, so a value earlier
than the buyer's last accepted write means that write is unconfirmed.
A change that only advances an *_as_of value fires no creative webhook
and writes no account change record. The get_media_buys/list_creatives
consistency rule now lets approval_status_as_of differ between reads,
reconciling toward the newer observation. No re-pull task is added:
keeping state current remains the seller's job.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@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: Escalate to human review

Escalate — gated schema paths require human/CODEOWNERS approval.

This PR modifies protocol source-of-truth files under static/schemas/source/** (creative/list-creatives-response.json, media-buy/get-media-buys-response.json), which fall under the repo's hard, path-based approval gate (gated_paths: true). review_decision is REVIEW_REQUIRED, not APPROVED, so the gate is not satisfied and I cannot approve — decision table row 2 fires.

The change itself looks clean: four optional, non-nullable date-time freshness fields (x-added-in: 3.3.0) extending the existing status_as_of pattern. Schema↔docs coherence holds across all four fields, the minor changeset matches the additive/optional surface, no oneOf or dist/** changes, and the cross-read consistency relaxation is gated on the new field so pre-3.3 adopters are unaffected. Test vector and null-rejection tests match. No blocking or Medium findings were surfaced.

This is a Normative (non-breaking) change, not Breaking-class, so the breaking-change hard gate does not independently apply — but the deterministic gated-paths gate stands until a human/CODEOWNERS approval lands.

Escalation reasons:

  • Touches gated schema source static/schemas/source/creative/list-creatives-response.json and static/schemas/source/media-buy/get-media-buys-response.json — human/CODEOWNERS review required (review_decision is REVIEW_REQUIRED).

Why human review

  • Modifies gated protocol source static/schemas/source/creative/list-creatives-response.json and static/schemas/source/media-buy/get-media-buys-response.json; review_decision is REVIEW_REQUIRED (not APPROVED), so the hard approval gate requires human/CODEOWNERS review before merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/creative/list-creatives-response.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/get-media-buys-response.json (modified) matches static/schemas/source/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@aao-secretariat aao-secretariat Bot added the ladon/needs-human-review Ladon has escalated this PR for human review. label Oct 13, 2026
bokelley and others added 2 commits October 13, 2026 23:51
The existing rule already requires get_media_buys and list_creatives to
agree on approval state for a relationship, so both reads describe one
observation. Relaxing it for approval_status_as_of was unnecessary and
would have loosened a 3.2 MUST. approval_status_as_of now joins the
fields that must agree when both reads carry it, keeping this change
purely additive.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@bokelley
bokelley enabled auto-merge (squash) October 13, 2026 23:51

@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: Escalate to human review

Escalate — gated protocol source modified and review not yet APPROVED.

This PR modifies two files under the hard approval gate static/schemas/source/** (static/schemas/source/creative/list-creatives-response.json and static/schemas/source/media-buy/get-media-buys-response.json). gated_paths is true and review_decision is REVIEW_REQUIRED (not APPROVED), so decision rule row 2 forces escalation — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded.

The diff itself is clean: it tightens approval_status_as_of from "two reads MAY differ, reconcile toward newer" to "MUST agree when both reads carry it," applied coherently across the changeset, both schemas, and both docs. The removed "reconcile toward newer" clause survives only for indicators_as_of (which may still diverge), leaving no contradiction. Schema↔docs coherence holds; the minor changeset is correct for an additive optional field within unreleased 3.3.0; no oneOf/dist/immutability concerns. Only a Low nit (indicative vs normative wording at list_creatives.mdx:57), dropped. No Critical/High/Medium findings.

Escalation reasons

  • Modifies gated protocol source static/schemas/source/creative/list-creatives-response.json and static/schemas/source/media-buy/get-media-buys-response.json; review_decision is REVIEW_REQUIRED, not APPROVED. Human/CODEOWNERS review is required before merge.

Why human review

  • Gated path: static/schemas/source/creative/list-creatives-response.json and static/schemas/source/media-buy/get-media-buys-response.json match static/schemas/source/** (hard approval gate) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS review required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/creative/list-creatives-response.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/get-media-buys-response.json (modified) matches static/schemas/source/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@bokelley
bokelley merged commit cd94fd9 into main Oct 15, 2026
63 checks passed
@bokelley
bokelley deleted the bokelley/creative-state-as-of branch October 15, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ladon/needs-human-review Ladon has escalated this PR for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant