Skip to content

feat(training): implement rc.3 consumer-status hardening in the public training agent - #7521

Merged
bokelley merged 6 commits into
mainfrom
conductor/training-agent-rc3-reliable-reporting-hardening
Sep 14, 2026
Merged

bokelley merged 6 commits into
mainfrom
conductor/training-agent-rc3-reliable-reporting-hardening

Conversation

@bokelley

@bokelley bokelley commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Brings the public training agent up to the AdCP 3.2.0-rc.3 Reliable Reporting
consumer-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_status storyboard resolved to
not applicable and every rc.3 clause was graded only by schema tests.

What landed

sync_reporting_status on the seller. The agent advertises
consumer_status_task and serves the task. Ingest derives the consumer
principal 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 received and
content_mismatch, resolves seller_ledger_snapshot_id against the
(id, ledger_as_of) pairs this caller was actually issued, and returns
per-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 and
revision views on the same flat pagination union, cursor snapshot, and
changes_checkpoint ordering; 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 — 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.

Capability block. operations_contact (a fictional example.org contact)
and consumer_mismatch_escalation_seconds: 900, both sourced from one exported
constant shared with the projection so the advertised window and the enforced
window cannot drift.

Two additive controller operations. reporting_core_lifecycle_probe gains
advance_past_status_deadline (crosses expected_at + automated_recovery_window_seconds recording nothing) and
advance_past_escalation (crosses the open issue's opened_at plus the
advertised window and returns both boundaries, so precedence is graded rather
than assumed). restate_after_received now also requires a current received
statement from the caller, as its schema already documented for a seller
advertising consumer_status_task.

Storyboard. reporting-consumer-status.yaml goes 0 graded steps →
43 passing: declaration, counted silence rising past the posting deadline
and clearing on any posted leaf without moving health or any other count,
each closed mismatch_code on one supersession chain plus rejection of one
that omits it, one issue_id/opened_at carried across every severity change,
escalation to contact_* while the grace window is still open, and an
exact-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
d88f6c47f and e680c97e0:

  • A request filter (finality, feed_purposes) could retire an open
    mismatch
    and flip the caller's view to complete with an empty issues[].
    Diagnosis now runs against the period-scoped denominator; only emission is
    filtered.
  • obligation_missing / content_mismatch were silently discarded when the
    seller's own projection disagreed — the one outcome
    consumer_mismatch_lifecycle forbids. 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.
  • A leap-second timestamp (valid date-time, unparseable by Date.parse) or a
    prototype-chain period threw out of the statement loop, discarding
    siblings that had already recorded and skipping the version bump.
  • The declaration phase asserted consumer_mismatch_escalation_seconds and
    operations_contact as present, which would have failed a conformant
    seller
    that opts into consumer status without an escalation clock. Both are
    now phase-gated on the advertised window.
  • Plus: unresolvable supersedes_reporting_status_id → REFERENCE_NOT_FOUND
    (indistinguishable from unauthorized) rather than CONFLICT; identity reuse
    with changed content → IDEMPOTENCY_CONFLICT/correctable per the registered
    vocabulary; exact seller_ledger_as_of match; O(n) chain grouping instead of
    rescanning caller-controlled history per chain; internal errors no longer
    echoed to the buyer as "fix your request".

Two things for a reviewer's eye

  1. Pre-existing failure, unchanged. reporting_core's
    publish_nonempty_core pins a literal reporting_revision_id and its
    derived digest. Both are implementation-chosen, and the reference runner
    resolves a controller step's account itself, so the vector cannot match —
    this fails on main today (CI: 155/156 clean, 1 failed step) and still
    fails 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.
  2. responsible_party: buyer for a stale received. The seller caused it
    by restating, but the only bounded next action is the buyer's re-read, and
    consumer_mismatch_escalation forces recommended_action into
    contact_{responsible_party} — contact_seller would page the wrong
    party. The storyboard grades the contact_* family, not the specific
    value, 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.mdx records which modules are safe to
adopt (scheduler, canonicalization, pagination, checkpoints) and which are not
(the consumer-status projection), for whenever an rc.3-based SDK ships.

Validation

Gate Result
npm run test:unit 1063 passed
npm run test:server-unit (full) 614 files, 9386 passed
npm run typecheck clean
npm run test:schemas 42 passed
npm run build:compliance / test:compliance-snippets clean
npm run test:doc-compliance-drift clean
storyboard lints (12 suites) clean
reporting-status-contract + reporting-core-fixture 42 passed
reporting storyboards reporting_consumer_status 43/43, reliable_reporting_managed_delivery 6/6, reliable_reporting_reconciled_billing 16/16, reporting_core_declaration 1/1
/sales matrix (8 shards) 814 passed, 1 failed (the pre-existing reporting_core step), floors 133 clean / 632 steps cleared

One /sales storyboard (wholesale_feed_signals) lost its compliance cache
mid-run locally because a concurrent build:compliance --check rewrote
dist/compliance/latest — the documented #7478 race, not a regression.

CI's authoritative training-agent-storyboards run: 155/157 clean, 913
passed, 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) and
media_buy_seller/account_change_feed/expect_account_change_webhook, a
loopback-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 SDK fails with TS2322 in adcp-client main's
src/lib/reporting/ledger/status-ingest.ts, whose handwritten
consumer_status union lacks content_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 SDK was a network flake — codegen timed out fetching
https://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

bokelley and others added 6 commits September 14, 2026 15:16
…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]>

@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-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) with review_decision: REVIEW_REQUIRED — human/CODEOWNERS approval required.
  • Modifies static/schemas/source/compliance/comply-test-controller-response.json (gated path) with review_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) 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.

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