Skip to content

Governance E2E test suite: 20 failures + 8 cancellations on main #613

Closed

Description

@bokelley

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 the reallocation_threshold/reallocation_unlimited branch.
  • Decide whether the check_governance expectations 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=1 or similar) so day-to-day contributors see a green npm run test:lib while 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

  1. bokelley commented on Apr 19, 2026

    @bokelley
    ContributorAuthor

    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 15 Governance E2E:* suites auto-skip via { skip: skipReason } (sync probe against TEST_AGENT_URL / http://localhost:4100/mcp at 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.

    not ok 1 - Governance E2E: SDK integration with training agent
        not ok 1 - should approve a compliant create_media_buy
    not ok 11 - Governance E2E: Outcome reporting
        not ok 3 - should flag when committed exceeds authorized
    not ok 12 - Governance E2E: Audit log detail
        not ok 3 - should track campaign breakdown
    not ok 15 - Governance E2E: CLI test scenarios
        not ok 3 - campaign_governance_conditions scenario passes
    # tests 35
    # pass 31
    # fail 4
    # cancelled 0
    

    The reallocation_threshold setup cascade is gone — all 16 fixtures in governance-e2e.test.js already use reallocation_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_price missing for auction pricing

    • should approve a compliant create_media_buy (governance-e2e.test.js:138)
    • Error: INVALID_REQUEST: Package 0: bid_price is required for auction pricing (pricing option playfield_standard_pricing_0)
    • The training agent's default product now uses auction pricing; the fixture doesn't supply bid_price on the package.

    2. Schema-generator bug — conditions[].required_value typed as record but spec is typeless

    • should flag when committed exceeds authorized (governance-e2e.test.js:1105)
    • campaign_governance_conditions scenario passes (governance-e2e.test.js:1355)
    • Validation error: Schema validation: conditions.0.required_value: Invalid input: expected record, received number
    • Root cause: the JSON schema in schemas/cache/latest/governance/check-governance-response.json:88-90 declares required_value with only a description (no type) — intentionally typeless per the spec ("The value the field must have for approval"). json-schema-to-typescript emitted { [k: string]: unknown } for this typeless property, which then flowed into src/lib/types/schemas.generated.ts:5936 as z.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.
    • This is a client-side generator bug, not a training-agent or test bug. Fix is either (a) a preprocessing pass in scripts/generate-types.ts that maps typeless JSON-schema properties to unknown, or (b) a targeted post-process for this property. Affects any required_value scalar returned by any compliant governance agent, not just training.

    3. Response drift — audit log missing campaigns

    • should track campaign breakdown (governance-e2e.test.js:1220)
    • Error: Expected campaigns
    • Either the training agent stopped emitting campaigns in get_plan_audit_logs, or the assertion is outdated.

    Recommended split

    • Client bug (this repo, blocking): fix the typeless-property generator behavior for required_value. Resolves 2 of 4 failures and prevents the same class of bug appearing elsewhere the spec uses typeless properties.
    • Fixture drift (this repo): add bid_price to the create_media_buy fixture at line 138.
    • Response-drift investigation: confirm whether the training agent should still emit campaigns in audit logs; file upstream if the agent regressed, or update the assertion if the spec moved.
    • Gating: the auto-skip on connectivity already achieves the "green npm run test:lib for day-to-day contributors" goal. An explicit ADCP_E2E=1 env gate on top would be belt-and-suspenders; probably not worth it given the connectivity gate is working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions