Repository navigation
fix(compliance): make the reporting_core non-empty phase pass on the training agent - #7717
Merged
Merged
Conversation
…formant agent The reporting_core storyboard failed at publish_nonempty_core on the training agent's /sales tenant, and skipped the 11 steps after it. Root cause, in three layers: - The training agent derived the non-empty revision ID from the caller's obligation (account + delivery config + period), but the storyboard pins that ID as part of its literal RFC 8785/JCS vector. No account/config input produces reporting-revision.ecc62efa...; the agent's canonicalization was already correct and yields the vector digest once it uses the vector's identity. publish_nonempty now commits the fixed vector (rows + identity) from one exported fixture. - The runner addresses comply_test_controller and get_media_buy_delivery with the test-kit account but passes get_reporting_status accounts through, so the phase's separate reporting_core_nonempty_lab account named a ledger the controller never wrote to. The phase now re-prepares reporting_core_lab (prepare is a deterministic reset). Its two rejection steps declare expect_error: true like every other error_code storyboard step. - reliable_reporting_core_integrity_probe advertised probe_scheduler_dst (schema and its own error text) but only the lifecycle probe implemented it. The controller doc now lists publish_nonempty and notes its identity is the one fixture identifier fixed by the test vector. Closes #7714 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean three-part fix to the reporting_core non-empty phase with no blocking or medium findings.
What I checked:
- Vector ID/digest/control-total consistency across code (
reporting-reliability.ts), doc (comply-test-controller.mdx), and test (reporting-reliability-regressions.test.ts) — consistent. - Account routing to reporting_core_lab and probe_scheduler_dst moved to integrity probe — coherent.
prepareis a true ledger reset.- Patch changeset present and correctly scoped (
fix-reporting-core-nonempty-account-routing.md). - No
dist/**immutable artifacts touched. static/compliance/source/universal/reporting-core.yamlchange matches the code/doc/test — no spec drift.
No no-auto-approve team match. gated_paths is false, so the REVIEW_REQUIRED status does not force escalation. high_risk is false. No critical/high/medium findings; only one Low follow-up (omitted). Falls through to row 9.
This was referenced Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7714
Summary
reporting_core("Reliable Reporting: Core lifecycle") failed atpublish_nonempty_coreon the training agent's/salestenant, and the 11 steps after it were skipped. Fixing the reported vector mismatch exposed two more defects further down the same phase. This PR fixes all three, so the storyboard now passes all 23 steps.Root cause
1. Revision identity: the agent was wrong, not the vector. The training agent derived the
publish_nonemptyrevision ID withstableId('reporting-revision', [obligationId(account, config, period_end), 'zero-row-v1']). The storyboard pins that ID as part of its literal RFC 8785/JCS vector, because the runner has no check that recomputes a digest from captured values. So the binding digest can only be fixed if the ID is fixed too.canonicalize({reporting_revision_id, row_count, control_totals, reporting_rows})hashes to exactly5199a776…. The digest mismatch came entirely from the ID.ee48b534…is exactlyobligationId("reporting_core_lab", training-pacing-core, 1), the account the controller actually resolved (see 2).ecc62efa…. The vector's ID was never reachable by the agent. On the commit that introduced the vector (049bca3, feat(reporting): harden Reliable Reporting for RC1 #7254), the sales tenant skipped this storyboard (0P / 1S), so the step was never graded.dist/compliance/3.2.0-rc.1throughrc.7. Fixing the agent makes that step pass against the released artifacts too. Rewriting the vector to the agent's account-derived ID would bake training-agent internals into a conformance vector.2. Account routing in the storyboard.
@adcp/sdk's runner sendscomply_test_controllerandget_media_buy_deliverywith the test-kit account (acmeoutdoor.example), but passesget_reporting_statusaccounts through unchanged. The non-empty phase used a second account,reporting_core_nonempty_lab, that the controller never wrote to, soread_nonempty_revision_statusreturnedNOT_FOUND. This can't pass under either runner behavior. If the runner honored the fixture account instead, the delivery reads would miss.3.
probe_scheduler_dstwas in the wrong handler. The request schema assigns it to the Reliable Reporting tier probes, and thereporting_core_lifecycle_probeoperation enum omits it.reliable_reporting_core_integrity_probe's own error text listed it too. Only the lifecycle handler implemented it, sorun_real_source_calendar_dst_schedulergotINVALID_PARAMS.Fix
server/src/training-agent/):publish_nonemptycommitsREPORTING_CORE_NONEMPTY_VECTOR: the literal rows plus the fixedreporting-revision.ecc62efa00946aa1e2788ad9, defined once inreporting-reliability.ts. Revision content is scoped per (principal, account) ledger, so a fixed ID is safe. It also removes a latent collision between the non-empty revision and the zero-row revision ID.reliable_reporting_core_integrity_probenow handlesprobe_scheduler_dst.static/compliance/source/universal/reporting-core.yaml, patch changeset):reporting_core_lab.prepareis a documented deterministic reset.expect_error: true. This was the only storyboard of 71 gradingerror_codewithout it.docs/building/by-layer/L3/comply-test-controller.mdx): adds the missingpublish_nonemptyrow. The doc also said "implementations choose fixture identifiers"; it now namespublish_nonempty's revision ID as the one exception that the test vector fixes.publish_nonemptyreturns the literal vector ID and digest for two different accounts, and that the status ledger exposes them.dist/**is untouched.Storyboard results
TENANT_PATH=sales PUBLIC_TEST_AGENT_TOKEN=storyboard-local-token ADCP_COMPLIANCE_DIR=dist/compliance/latest npx tsx server/tests/manual/run-storyboards.ts --storyboard-id reporting_core✗ 11P / 1F / 11S—publish_nonempty_corefails (ecc62efa…expected,ee48b534…got), and the 11 steps after it areprerequisite_failed✓ 23P / 0S / 0N/A— 23 passed, 0 failed, 0 skippedVerification
npx vitest run --config server/vitest.config.ts src/ tests/unit/reporting-reliability-regressions.test.ts tests/unit/reporting-reliability.test.ts: all reporting tests pass. The one failure is insrc/training-agent/tenants/account-change-feed-transport.test.ts, and it fails identically on unmodified main (theaccount_change_feedarea, tracked separately in account_change_feed storyboard: no account.change_recorded webhook arrives after a shared-account creative change #7715).npm run typecheck: passes.tests/lint-storyboard-*,tests/lint-compliance-*,tests/lint-doc-compliance-drift,tests/reporting-status-contract,tests/reporting-reconciliation-fixture): 300/300 pass.node scripts/check-changeset-protocol-scope.cjs origin/mainandchangeset status --since=origin/main: pass.Follow-up (not in this PR)
The runner overrides
sample_request.accounton controller calls (except for the fourforce_*scenarios). As a result, per-step controller accounts in storyboards are silently ignored. That is@adcp/sdkbehavior, which lives in adcp-client.🤖 Generated with Claude Code