Repository navigation
Description
Summary
Running npm run test:lib on main (commit 0884b25) reports 20 failures and 8 cancellations in the governance E2E suite. The failures reproduce with my working tree stashed, so this is pre-existing and independent of PR #611 / issue #599.
Filing this so the governance E2E suite gets attention and stops masking regressions — right now a contributor touching unrelated code sees 20 red tests at pre-push / CI time and has to manually confirm they were already broken.
Failure taxonomy
Two distinct patterns in the output:
1. reallocation_threshold validation errors (blocks setup)
syncPlans failed: validation_error: plan e2e-plan-1776594288604 budget
must specify exactly one of reallocation_threshold (number >= 0) or
reallocation_unlimited (true)
Fires on Governance E2E: SDK integration with training agent and Governance E2E: Delivery monitoring. Looks like the governance training-agent fixture was updated to require one of the two reallocation fields but the E2E's test fixtures were not; every subsequent subtest in these suites cancels because the setup never completes.
Suites affected (setup failure cascades):
- Governance E2E: SDK integration with training agent (6 cancellations)
- Governance E2E: Delivery monitoring (2 cancellations)
2. Missing governance findings (failing assertions)
Expected channel_compliance finding
Expected flight_compliance finding
Expected delegation_authority finding for expired delegation
Fires on suites that exercise check_governance against the training agent. Either the training agent stopped emitting these findings or the test expectations drifted from the spec.
Suites affected (assertion failures):
- Governance E2E: Advisory and audit modes (2 failures)
- Governance E2E: Channel compliance (2 failures)
- Governance E2E: Flight compliance (2 failures)
- Governance E2E: Delegation authority (2 failures)
- Governance E2E: Plan sync and update (2 failures)
Full failure list
not ok 1 - should approve a compliant create_media_buy [cancelled]
not ok 2 - should deny an over-budget create_media_buy [cancelled]
not ok 3 - should deny unauthorized market [cancelled]
not ok 4 - should auto-apply conditions for seller concentration [cancelled]
not ok 5 - should get audit logs with budget tracking [cancelled]
not ok 6 - should skip governance for excluded tools [cancelled]
not ok 89 - Governance E2E: SDK integration with training agent [syncPlans failed]
not ok 1 - should approve normal delivery metrics [cancelled]
not ok 2 - should flag overspend drift [cancelled]
not ok 90 - Governance E2E: Delivery monitoring [syncPlans failed]
not ok 1 - should approve with findings in advisory mode [testCodeFailure]
not ok 2 - should approve everything in audit mode [testCodeFailure]
not ok 93 - Governance E2E: Advisory and audit modes [2 subtests failed]
not ok 1 - should deny unauthorized channel [Expected channel_compliance]
not ok 2 - should approve authorized channel [testCodeFailure]
not ok 94 - Governance E2E: Channel compliance [2 subtests failed]
not ok 1 - should deny start date before plan flight [Expected flight_compliance]
not ok 2 - should deny end date after plan flight [Expected flight_compliance]
not ok 95 - Governance E2E: Flight compliance [2 subtests failed]
not ok 1 - should deny caller not in delegations list [Expected delegation_authority]
not ok 2 - should deny expired delegation [Expected delegation_authority for expired]
not ok 96 - Governance E2E: Delegation authority [2 subtests failed]
not ok 1 - should increment version on plan re-sync [testCodeFailure]
not ok 2 - should return governance categories on sync [testCodeFailure]
not ok 98 - Governance E2E: Plan sync and update [2 subtests failed]
Repro
git checkout main
npm install
npm run build
npm run test:lib 2>&1 | grep -E "not ok|cancelled"Expected: 20 not ok lines from Governance E2E:* + 8 cancelled subtests. Unit tests (test/lib/governance*.test.js that don't hit the training agent) are green.
Asks
- Investigate whether the training agent fixture (
test-helpers.ts/ the governance stub) needs updating for thereallocation_threshold/reallocation_unlimitedbranch. - Decide whether the
check_governanceexpectations moved in spec — if the training agent is correct and the tests are stale, update the assertions. - Consider gating the governance E2E suite behind an env var (
ADCP_E2E=1or similar) so day-to-day contributors see a greennpm run test:libwhile CI still runs the full suite against a known-working training agent build.
Not in scope
This is independent of PR #611 (runner-output contract). That PR only modified src/lib/testing/storyboard/*, compliance/comply.ts, compliance/storyboard-tracks.ts, and the corresponding tests — none of the governance E2E code is touched.
Activity
bokelley commentedon Apr 19, 2026
Re-running on main (f29780a) — taxonomy has shifted. Posting updated state so the issue reflects reality.
Current state
Without the training agent running (normal
npm run test:lib): all 15Governance E2E:*suites auto-skip via{ skip: skipReason }(sync probe againstTEST_AGENT_URL/http://localhost:4100/mcpat describe-registration time,test/lib/governance-e2e.test.js:20-73). Day-to-day contributors do not see red tests — the suite is already gated by connectivity. The gating ask from this issue is effectively already implemented, just keyed on reachability instead of an env flag.With the training agent reachable: 4 failures, 0 cancellations — not 20/8.
The
reallocation_thresholdsetup cascade is gone — all 16 fixtures ingovernance-e2e.test.jsalready usereallocation_unlimited: true. That was fixed somewhere between the issue being filed and today; the cancellation fan-out it caused is gone with it.Remaining 4 failures (updated taxonomy)
1. Fixture drift —
bid_pricemissing for auction pricingshould approve a compliant create_media_buy(governance-e2e.test.js:138)INVALID_REQUEST: Package 0: bid_price is required for auction pricing (pricing option playfield_standard_pricing_0)bid_priceon the package.2. Schema-generator bug —
conditions[].required_valuetyped as record but spec is typelessshould flag when committed exceeds authorized(governance-e2e.test.js:1105)campaign_governance_conditions scenario passes(governance-e2e.test.js:1355)Schema validation: conditions.0.required_value: Invalid input: expected record, received numberschemas/cache/latest/governance/check-governance-response.json:88-90declaresrequired_valuewith only a description (notype) — intentionally typeless per the spec ("The value the field must have for approval").json-schema-to-typescriptemitted{ [k: string]: unknown }for this typeless property, which then flowed intosrc/lib/types/schemas.generated.ts:5936asz.record(z.string(), z.unknown()).optional(). The training agent legitimately returns a number (e.g. an adjusted budget cap), and our client rejects the response.scripts/generate-types.tsthat maps typeless JSON-schema properties tounknown, or (b) a targeted post-process for this property. Affects anyrequired_valuescalar returned by any compliant governance agent, not just training.3. Response drift — audit log missing
campaignsshould track campaign breakdown(governance-e2e.test.js:1220)Expected campaignscampaignsinget_plan_audit_logs, or the assertion is outdated.Recommended split
required_value. Resolves 2 of 4 failures and prevents the same class of bug appearing elsewhere the spec uses typeless properties.bid_priceto thecreate_media_buyfixture at line 138.campaignsin audit logs; file upstream if the agent regressed, or update the assertion if the spec moved.npm run test:libfor day-to-day contributors" goal. An explicitADCP_E2E=1env gate on top would be belt-and-suspenders; probably not worth it given the connectivity gate is working.