Skip to content

ci: a test-health finding deferred for budget takes its file out of the rotation #3852

Closed

Description

@schlessera

Context

A test-health finding that a run could not finish is recorded as deferred (.agents/skills/test-health/SKILL.md:132: "you ran out of budget, or the proof would not come out"). Recording the cluster still marks every member file as audited at its current content, and fileState (scripts/test-health/select.ts:78-83) then reads the file as fresh for reauditDays (180, scripts/test-health/config.json:11). The planner skips fresh files, so nothing brings the deferred work back.

This hits the files the audit exists for. A deflake needs 10 clean runs after the change (validateWorksheet, scripts/test-health/worksheet.ts:190-193; stableRuns, scripts/test-health/config.json:17). For a browser file that takes minutes per run, that proof is longer than the run's 45-minute budget (.agents/skills/test-health/SKILL.md:64-66), so the slowest and flakiest files are the ones that get deferred.

Observed on 2026-11-10, in the ledger on refs/heads/brain-test-health, cluster record th-20261110115220-5ecaed#0:

Scope

  • Say why a finding is deferred. A deferred finding carries deferredFor: budget, proof, assigned, unreproduced or context. validate refuses a deferred finding without it.
  • Unfinished files stay in the rotation. A file whose latest audit has a finding on that file deferred for budget or proof is unfinished, not fresh. It stays eligible in both queues, and in the hot queue it ranks ahead of a never-audited file with the same score. A record written before this change, with no deferredFor, counts as budget unless its smell is unreproduced.
  • The next run starts from the earlier findings. brief lists the unfinished file's deferred findings from its latest audit (id, lens, smell, action, note), so the auditor resumes them instead of rediscovering them.
  • A prepared patch survives the machine. record cluster accepts --wip <patch file>, stores it on the ledger ref next to the record (size-capped, test files only, the same path rule as the batch gate), and brief names it for a later run.
  • A prepared fix gets its proof. The skill says that a fix already written is proven even when that runs past the run's budget, up to a configured cap, before the run takes any new cluster; and that a run which resumes an unfinished file does that proof first.
  • The report counts it. report shows unfinished files and findings by deferredFor.

Out of scope

  • Lowering stableRuns or any other proof requirement for slow files.
  • Any timeout, deadline, shard or workflow change.
  • Re-running an unreproduced failure issue on a timer; those files keep the ordinary reauditDays.
  • How a batch lands.

Acceptance criteria

  • With a cluster record whose member file has a finding deferred for budget, planRun selects that file again, and stats counts it as unfinished. With deferredFor: "assigned" or "unreproduced" the file is fresh. A test in scripts/skill-tests/ shows both and fails before the change.
  • A test replays a record shaped like th-20261110115220-5ecaed#0 (deferred findings, no deferredFor) and shows hygiene-review.layout.tsx unfinished.
  • validate reports a problem for a deferred finding without deferredFor.
  • record cluster --wip stores the patch through DirLedgerStore and GitLedgerStore; a patch that touches a non-test path is refused; brief for a later plan that contains the file prints the earlier deferred findings and the patch's location. Tests cover each.
  • report prints the unfinished count and the deferredFor breakdown.
  • SKILL.md (the decision table and step 4) and references/worksheet.md describe deferredFor, the proof-past-budget rule and --wip.
  • bun run test:skills passes.

Verification

bun run test:skills, with a failing-first receipt for the planner test. Then bun scripts/test-health.ts plan --dry-run --package ui-react --mode hot against the live ledger lists hygiene-review.layout.tsx in its first cluster.

Contract impact

None. Repository tooling; the worksheet's schemaVersion gains an additive field.

Activity

  1. added
    type: fix
    area: ci
    priority: p2
    agent-ready
    on Nov 10, 2026
  2. self-assigned this
    on Nov 10, 2026
  3. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-ab9c5800. Branch: fix/3852-test-health-unfinished-and-groups.

    Path collision with #3851 on .agents/skills/test-health/SKILL.md; #3852 and #3854 land together in one pull request because both change planRun.

  4. added this to the 0.45.0 milestone on Nov 10, 2026
  5. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Implementation is complete in #3856 (head 1fdfc6e49, which merged main at b77987afb) and the pull request is ready. It has not merged yet. Main went red at b77987afb (#3805; incident #3884, whose fix #3899 is in the integration lane now). One candidate confirmation on this head was cancelled by that red-main gate before its proof ran. Two earlier attempts were refused before acquiring a lease: the lane was busy, and the pull request's base had gone stale.

    Done so far:

    • bun run test:skills: 262 pass. bun run lint is clean. A check:pr receipt for the current head is in the PR body.
    • Failing-first receipts on the pre-change tree for every planner and CLI test the acceptance criteria name.
    • 16 mutations, each killed by its named test.
    • An independent review (gpt-6-astra); all seven of its findings are fixed with tests.
    • Live dry runs against the ledger. hygiene-review.layout.tsx is the first seed of plan --package ui-react --mode hot. A push shard set puts 12 small packages in one small shard.

    To resume, once bun scripts/integrate.ts main-status --json reports "red": false:

    1. Merge origin/main into the branch.
    2. Rerun bun run check:pr --base origin/main and replace the PR body's receipt.
    3. Push.
    4. Run bun scripts/integrate.ts confirm 3856 --issues schlessera/brain-kit#3852,schlessera/brain-kit#3854.

    The milestone is 0.45.0 on the pull request and on both issues.

  6. removed their assignment
    on Nov 10, 2026
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

    agent-readyarea: cipriority: p2type: fix

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions