Skip to content

Infra TV14: a test-code budget: over 400 net new test lines needs offsetting deletions or a recorded allowance #1139

Closed

Description

@jparker2006

Parent

Ticket TV14 of spec #787 (Infra).

What to build

Jake's J147 (orchestrator ruling on ClosedWiz #325; private record https://github.com/jparker2006/ClosedWiz/issues/325#issuecomment-6996593562): a test-code budget guard, an OpenClaw-style ratchet, so the test suite this campaign pruned doesn't grow back unchecked.

  • What it measures: on every pull request, the net change in test lines between the pull request's base and head: lines added minus lines deleted, in test files only. Test files are the paths the test-value kit already treats as tests: tests/**, crates/*/tests/**, **/test_*.py, **/*_test.py, **/*.test.mjs, **/*.test.ts(x) and **/__tests__/**. Fixture and evidence files count as test lines only where they sit under those paths.
  • The ceiling: 400 net new test lines per pull request, OpenClaw's current figure, kept as one named constant so it can change in one place.
  • Over the ceiling: the check fails unless the pull request offsets the growth with deletions (it's a net count), or records a justified allowance. That's one line in the description, Test budget allowance: <N> lines. Why: <reason>, with N at least the overage. The check reads the line and passes when it covers the overage. The reviewer judges the reason as part of the ordinary review, and an unjustified allowance is a finding.
  • Where it runs: pull requests only, as one step in a job that already runs on pull requests in .github/workflows/ci.yml. Merge groups, pushes and the schedule don't run it. It reads only git and the pull request's own description.

Owned paths

  • tools/test-value/budget.py
  • tools/test-value/test_budget.py
  • tools/test-value/README.md (shared: one section on the budget and the allowance line)
  • .github/workflows/ci.yml (shared: the one step that runs the guard on pull requests; a workflow change approved by J147)
  • docs/agents/fleet.md (shared: one sentence telling builders about the ceiling and the allowance line)
  • tools/open-import/paths.json (shared: rows for this ticket's own new files, under the standing J110 allowance)

Relies on: nothing

Links

none

Acceptance criteria

  • Failing first, on synthetic diffs: 401 net new test lines with no allowance fails. 400 passes. 600 added with 250 deleted passes. 500 net with an allowance of at least 100 passes, and with a smaller allowance fails. Non-test files never count.
  • A missing or unreadable base, or an unreadable description, fails closed with a clear message, never a silent pass.
  • The step runs only on pull requests, and CI on this ticket's own pull request shows it running and passing.
  • The README and docs/agents/fleet.md say what counts, the ceiling, and the exact allowance line form.
  • No other workflow, job, guard or contract changes.
  • Test rule (The test rule: what earns a test, and what never does #687): every new test protects a supported behaviour, a contract others rely on or a safety invariant, and the pull request says per test catches: <the bug>, or no new test: <why>. No mock-returns-stub, source mirroring, compiler re-checks, quota tests or unreachable cases; a bug gets a failing test first.
  • Every test the pull request deletes names its keeper (a test that still catches its bug) or says the behaviour it protected is gone.

Proof

T4 (the shared folder shrinks): growth is now bounded per change. Evidence: the red-first synthetic cases, and the step's run on this pull request.

Builder and reviewer: per J148, a Codex Sol 6.1 High builder with a Claude Code Opus 5.5 High reviewer.

Activity

  1. added this to the Infra milestone on Nov 19, 2026
  2. added
    ready-for-agent
    on Nov 19, 2026
  3. jparker2006 commented on Nov 19, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: start checked, branch room/1139-test-budget

  4. jparker2006 commented on Nov 19, 2026

    @jparker2006
    MemberAuthor

    Builder push receipt: the first successful push of room/1139-test-budget completed in 434 seconds with the normal hook enabled. Privacy passed; all four format, Clippy, checks-target and classifier checks passed. GitHub read-back confirms head 07e1dbfb97237a882af5d60bcff2d9df0d4e9f32. This is push duration, not a CI or campaign-speed measurement.

  5. jparker2006 commented on Nov 19, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: archived

    PR #1140 merged into main at the approved head 360ba06 (merge commit 83931a4). Exact-head approval, passing merge-group ci/privacy, completed ticket closure and both agent archives are verified.

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

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions