Repository navigation
feat(training): implement rc.3 consumer-status hardening in the public training agent - #7521
Conversation
…umer-status contract The public training agent advertised no consumer-status loop at all, so the capability-gated reporting_consumer_status storyboard was skipped and the rc.3 hardening was graded only by schema tests. Advertise consumer_status_task, serve sync_reporting_status, and join the caller's separately attributed status ledger onto the seller projection. The ingest derives the consumer principal only from authenticated transport, validates the expected period from the accepted configuration generation (so a missing obligation stays addressable), enforces exact-leaf compare-and-swap supersession, requires the recomputed Core revision binding for received and content_mismatch, resolves seller_ledger_snapshot_id against the identities this caller was actually issued, and returns per-statement results so one rejection cannot roll back a sibling. The projection adds consumer_status_count / current_consumer_status_id, consumer_statuses[] in the periods and revision views on the same flat pagination union and checkpoint ordering, and obligation_counts.consumer_status_pending as visibility over the caller's own silence. CONSUMER_STATUS_MISMATCH carries a stable issue_id, an opened_at anchored to the instant the conflict actually began, issue_state, and a caller-scoped inert external_ref. Every conflict is action_required immediately except a received statement made stale only by a seller restatement, which is delayed until the first supersession's created_at plus delivery_sla — and the advertised consumer_mismatch_escalation_seconds boundary takes precedence when the two overlap, forcing a contact_ action. The pinned @adcp/sdk generates its strict zod projection from an older bundle that predates these fields, so the reporting tests validate the wire shape against in-repo source schemas instead. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ler operations reporting_core_lifecycle_probe could cross the production SLA, the recovery deadline, and the stale-received grace window, but not the two boundaries the rc.3 consumer-status projection depends on. Add advance_past_status_deadline, which moves the virtual clock strictly past expected_at plus the advertised automated_recovery_window_seconds without recording any statement, and advance_past_escalation, which moves it strictly past the open mismatch's opened_at plus the advertised consumer_mismatch_escalation_seconds and returns both boundaries so the precedence rule is gradable rather than assumed. Both are additive enum values on an existing conformance-harness scenario. restate_after_received now also requires a current received consumer status from the caller, as its schema already documented for a seller advertising consumer_status_task: without one there is no stale-received projection to grade, only a bare restatement. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ryboard The storyboard addressed buyer-side tasks with guessed sandbox account IDs, which the reference runner overrides for controller steps; thread the account the controller actually returns through context instead, so the loop is graded against one account whichever way a runner resolves it. Adds the declaration phase (consumer_status_task, the escalation window, and operations_contact), a counted-silence phase proving obligation_counts.consumer_status_pending rises past the posting deadline, clears on any posted leaf, and moves neither health nor any other count, and a content_mismatch phase accepting each closed mismatch_code on one supersession chain while rejecting one that omits it. The revision-recovery phase now also crosses the escalation boundary while the grace window is still open and asserts that one issue_id and one opened_at survive every severity change. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…undary The task-reference notes still told implementers that the consumer-status hardening was unpublished and to validate it against /schemas/latest/; it shipped in 3.2.0-rc.3, so retarget both schema pins and state what landed where. Known limitations now describes what the storyboard grades live, and separately names the pre-existing reporting_core fixed-vector phase that pins seller-chosen identifiers, with a removal condition. Adds an implementor-FAQ answer on which parts of a published SDK reporting ledger are safe to adopt: the scheduler, canonicalization, pagination, and checkpoint machinery are reusable, while a ledger built against the earlier published shape predates the consumer-status hardening and would silently regress a seller that already implements it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…d batch containment Review of the first pass found three ways the projection diverged from the consumer-status clauses, all confirmed by repro: - A request filter could retire an open mismatch. projectConsumerStatus was handed the fully filtered record set, so selecting `finality` or `feed_purposes` turned an open action_required mismatch into `complete` with an empty issues[] — and could fabricate a standalone issue for an obligation the filter merely hid. Diagnosis now runs against the period-scoped denominator and only emission is filtered. - `obligation_missing` and `content_mismatch` were silently discarded whenever the seller's own projection disagreed with the buyer's claim, which is the one outcome consumer_mismatch_lifecycle forbids: repairing an obligation makes the two claims disagree, it does not reconcile them. Conflict is now "the current leaf is not an agreeing received", with the deliberate carve-out that a negative statement against a seller that has published nothing corroborates the seller's own overdue issue rather than opening a second one. - An unparseable-but-schema-valid timestamp (a leap second) or a `period` reachable only through the prototype chain threw out of the statement loop, discarding siblings that had already recorded and skipping the version bump. Each statement is now evaluated in isolation. Also: resolve `supersedes_reporting_status_id` before comparing it to the leaf so an unresolvable pointer is indistinguishable from an unauthorized one; classify identity reuse with changed content as IDEMPOTENCY_CONFLICT (correctable) rather than CONFLICT (transient, per the registered vocabulary); require `seller_ledger_as_of` to match the snapshot exactly and retain the pairs; group the chain once per operation instead of rescanning the whole caller-controlled history per chain; reject a `reporting_status_id` the failed result arm cannot echo with an explicit message; and stop converting arbitrary internal errors into caller-facing validation failures. Both advertised windows now come from one exported constant so the capability block and the projection cannot drift. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…sed clock The declaration phase asserted consumer_mismatch_escalation_seconds and operations_contact as present, but both are optional and the capability schema explicitly blesses publishing a contact without committing to a clock. A conformant seller that opts into consumer status without an escalation window failed step one and cascade-skipped the rest of the phase. The escalation assertions and the two escalation steps now live in their own phases gated on the advertised window, with targeted depends_on so a seller that skips them still runs the grace-window close. The counted-silence phase also stops pinning total issue cardinality and a specific overdue code: it now captures the whole issues[] array and deep-compares it across the posted status, which proves the same invariant without constraining what else a seller may report. Adds an exact-revision read so the both-views requirement for consumer_statuses[] is graded rather than assumed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated-path change requires human/CODEOWNERS approval.
This PR modifies protocol schema source files under the hard approval gate (static/schemas/source/**) while review_decision is REVIEW_REQUIRED (not APPROVED). Per decision rule row 2, this cannot be auto-approved and must be escalated for human review.
The reviewer found no Critical/High/Medium findings — the change is an additive RC.3 consumer-status implementation (new sync_reporting_status handler, projection fields, two additive comply-controller operations) with matching docs, storyboard, and a correct patch changeset. Schema↔docs coherence, caller isolation, write-surface bounds, and no-new-oneOf were all verified; tests pass 43/43. One non-blocking Low was noted (string-prefix error demux in v6-sales-platform.ts).
The diff appears mechanically clean, but the gate on schema source files is deterministic and non-overridable without an explicit approval. A human/CODEOWNERS reviewer must approve before merge.
Escalation reasons
- Modifies
static/schemas/source/compliance/comply-test-controller-request.json(gated path) withreview_decision: REVIEW_REQUIRED— human/CODEOWNERS approval required. - Modifies
static/schemas/source/compliance/comply-test-controller-response.json(gated path) withreview_decision: REVIEW_REQUIRED— human/CODEOWNERS approval required.
Why human review
- Modifies gated schema source static/schemas/source/compliance/comply-test-controller-request.json while review_decision is REVIEW_REQUIRED — human/CODEOWNERS approval required
- Modifies gated schema source static/schemas/source/compliance/comply-test-controller-response.json while review_decision is REVIEW_REQUIRED — human/CODEOWNERS approval required
- This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/compliance/comply-test-controller-request.json (modified) matches
static/schemas/source/**; static/schemas/source/compliance/comply-test-controller-response.json (modified) matchesstatic/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.
Brings the public training agent up to the AdCP
3.2.0-rc.3Reliable Reportingconsumer-status contract and makes the conformance harness grade it. Before
this, the agent advertised no consumer-status loop at all, so the
capability-gated
reporting_consumer_statusstoryboard resolved tonot applicable and every rc.3 clause was graded only by schema tests.
What landed
sync_reporting_statuson the seller. The agent advertisesconsumer_status_taskand serves the task. Ingest derives the consumerprincipal only from authenticated transport, validates the expected period from
the accepted configuration generation (so a missing obligation stays
addressable without a seller-issued ID), enforces exact-leaf compare-and-swap
supersession, requires the recomputed Core revision binding for
receivedandcontent_mismatch, resolvesseller_ledger_snapshot_idagainst the(id, ledger_as_of)pairs this caller was actually issued, and returnsper-statement results so one rejection cannot roll back a sibling.
The rc.3 projection.
consumer_status_count/current_consumer_status_id;consumer_statuses[]in the periods andrevision views on the same flat pagination union, cursor snapshot, and
changes_checkpointordering;obligation_counts.consumer_status_pendingasvisibility over the caller's own silence.
CONSUMER_STATUS_MISMATCHcarries astable
issue_id, anopened_atanchored to the instant the conflict actuallybegan,
issue_state, and a caller-scoped inertexternal_ref. Every conflictis
action_requiredimmediately except areceivedstatement made stale onlyby a seller restatement —
delayeduntil the first supersession'screated_atplusdelivery_sla— and the advertisedconsumer_mismatch_escalation_secondsboundary takes precedence when the twooverlap, forcing a
contact_*action.Capability block.
operations_contact(a fictionalexample.orgcontact)and
consumer_mismatch_escalation_seconds: 900, both sourced from one exportedconstant shared with the projection so the advertised window and the enforced
window cannot drift.
Two additive controller operations.
reporting_core_lifecycle_probegainsadvance_past_status_deadline(crossesexpected_at + automated_recovery_window_secondsrecording nothing) andadvance_past_escalation(crosses the open issue'sopened_atplus theadvertised window and returns both boundaries, so precedence is graded rather
than assumed).
restate_after_receivednow also requires a currentreceivedstatement from the caller, as its schema already documented for a seller
advertising
consumer_status_task.Storyboard.
reporting-consumer-status.yamlgoes 0 graded steps →43 passing: declaration, counted silence rising past the posting deadline
and clearing on any posted leaf without moving
healthor any other count,each closed
mismatch_codeon one supersession chain plus rejection of onethat omits it, one
issue_id/opened_atcarried across every severity change,escalation to
contact_*while the grace window is still open, and anexact-revision read. Buyer-side steps now address the account the controller
actually returns, so the loop is graded against one account whichever way a
runner resolves it.
Review outcomes
Both expert passes found real defects; all of the confirmed ones are fixed in
d88f6c47fande680c97e0:finality,feed_purposes) could retire an openmismatch and flip the caller's view to
completewith an emptyissues[].Diagnosis now runs against the period-scoped denominator; only emission is
filtered.
obligation_missing/content_mismatchwere silently discarded when theseller's own projection disagreed — the one outcome
consumer_mismatch_lifecycleforbids. Conflict is now "the current leaf isnot an agreeing
received", with the deliberate carve-out that a negativestatement against a seller that has published nothing corroborates the
seller's own overdue issue rather than opening a second one.
date-time, unparseable byDate.parse) or aprototype-chain
periodthrew out of the statement loop, discardingsiblings that had already recorded and skipping the version bump.
consumer_mismatch_escalation_secondsandoperations_contactas present, which would have failed a conformantseller that opts into consumer status without an escalation clock. Both are
now phase-gated on the advertised window.
supersedes_reporting_status_id→REFERENCE_NOT_FOUND(indistinguishable from unauthorized) rather than
CONFLICT; identity reusewith changed content →
IDEMPOTENCY_CONFLICT/correctableper the registeredvocabulary; exact
seller_ledger_as_ofmatch; O(n) chain grouping instead ofrescanning caller-controlled history per chain; internal errors no longer
echoed to the buyer as "fix your request".
Two things for a reviewer's eye
reporting_core'spublish_nonempty_corepins a literalreporting_revision_idand itsderived digest. Both are implementation-chosen, and the reference runner
resolves a controller step's account itself, so the vector cannot match —
this fails on
maintoday (CI: 155/156 clean, 1 failed step) and stillfails here. Left alone deliberately: fixing it means regrading that phase on
internal consistency, which is a separate change. Recorded in known
limitations with a removal condition.
responsible_party: buyerfor a stalereceived. The seller caused itby restating, but the only bounded next action is the buyer's re-read, and
consumer_mismatch_escalationforcesrecommended_actionintocontact_{responsible_party}—contact_sellerwould page the wrongparty. The storyboard grades the
contact_*family, not the specificvalue, so another seller may diagnose it differently.
Per deliverable 5, the training agent is not moved onto the SDK reporting
ledger: the ledger shipping in rc.36 is rc.2-based and predates everything
above.
docs/reference/implementor-faq.mdxrecords which modules are safe toadopt (scheduler, canonicalization, pagination, checkpoints) and which are not
(the consumer-status projection), for whenever an rc.3-based SDK ships.
Validation
npm run test:unitnpm run test:server-unit(full)npm run typechecknpm run test:schemasnpm run build:compliance/test:compliance-snippetsnpm run test:doc-compliance-driftreporting_consumer_status43/43,reliable_reporting_managed_delivery6/6,reliable_reporting_reconciled_billing16/16,reporting_core_declaration1/1/salesmatrix (8 shards)reporting_corestep), floors 133 clean / 632 steps clearedOne
/salesstoryboard (wholesale_feed_signals) lost its compliance cachemid-run locally because a concurrent
build:compliance --checkrewrotedist/compliance/latest— the documented #7478 race, not a regression.CI's authoritative
training-agent-storyboardsrun: 155/157 clean, 913passed, 2 failed, against 155/156 clean / 771 passed / 1 failed on
main(+1 storyboard now applicable, +142 graded steps). Both failing steps
pre-date this PR:
reporting_core/publish_nonempty_core(above) andmedia_buy_seller/account_change_feed/expect_account_change_webhook, aloopback-webhook storyboard that nondeterministically executes instead of
skipping and then fails — it failed identically on main run
34860948050,which contains none of these commits.
Red SDK gates are pre-existing, not from this PR
Generate TypeScript SDKfails withTS2322in adcp-clientmain'ssrc/lib/reporting/ledger/status-ingest.ts, whose handwrittenconsumer_statusunion lackscontent_mismatch; it is fixed by adcp-client#2911 (green, awaiting merge) and stays red on every protocol PR until that
merges. The identical error reproduces on unrelated branches
(
fix/supply-path-verifier-golden-vectors,changeset-release/main).Generate Python SDKwas a network flake — codegen timed out fetchinghttps://adcontextprotocol.org/schemas/3.2.0-rc.3/core/assets/published-post-asset.json— and has been re-run.
🤖 Generated with Claude Code
Open workspace in Conductor