Repository navigation
Description
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:
- The first hot run took
packages/ui-react/tests/browser/hygiene-review.layout.tsx, the top of the hot queue, with three open failure issues (ui-react: hygiene-review layout test reads the item before it renders #1685, ui-react: the hygiene-review Actions-limit set-aside case polls the limit panel before the retirement reaches the browser #2855, ui-react: investigate Actions-limit timeout and duplicate scene controls #3111) and a median of 183 s per run. - It recorded four
deferredfindings on that file. The note on the ui-react: hygiene-review layout test reads the item before it renders #1685 finding says a fix was prepared as a patch in the run directory, and that its 10-run proof (183 s per run) did not fit the run's budget. - The run spent its whole budget on this one cluster: 3 of the 27 claimed files were audited.
plan --dry-runafterwards counts the file among 13freshfiles. The prepared patch exists only in a run directory on the machine that ran the audit.
Scope
- Say why a finding is deferred. A
deferredfinding carriesdeferredFor:budget,proof,assigned,unreproducedorcontext.validaterefuses a deferred finding without it. - Unfinished files stay in the rotation. A file whose latest audit has a finding on that file deferred for
budgetorproofisunfinished, notfresh. 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 nodeferredFor, counts asbudgetunless its smell isunreproduced. - The next run starts from the earlier findings.
brieflists 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 clusteraccepts--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), andbriefnames 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.
reportshows unfinished files and findings bydeferredFor.
Out of scope
- Lowering
stableRunsor any other proof requirement for slow files. - Any timeout, deadline, shard or workflow change.
- Re-running an
unreproducedfailure issue on a timer; those files keep the ordinaryreauditDays. - How a batch lands.
Acceptance criteria
- With a cluster record whose member file has a finding deferred for
budget,planRunselects that file again, andstatscounts it as unfinished. WithdeferredFor: "assigned"or"unreproduced"the file isfresh. A test inscripts/skill-tests/shows both and fails before the change. - A test replays a record shaped like
th-20261110115220-5ecaed#0(deferred findings, nodeferredFor) and showshygiene-review.layout.tsxunfinished. validatereports a problem for adeferredfinding withoutdeferredFor.record cluster --wipstores the patch throughDirLedgerStoreandGitLedgerStore; a patch that touches a non-test path is refused;brieffor a later plan that contains the file prints the earlier deferred findings and the patch's location. Tests cover each.reportprints the unfinished count and thedeferredForbreakdown.SKILL.md(the decision table and step 4) andreferences/worksheet.mddescribedeferredFor, the proof-past-budget rule and--wip.bun run test:skillspasses.
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
schlessera commentedon Nov 10, 2026
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.
schlessera commentedon Nov 10, 2026
Implementation is complete in #3856 (head
1fdfc6e49, which merged main atb77987afb) and the pull request is ready. It has not merged yet. Main went red atb77987afb(#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 lintis clean. Acheck:prreceipt for the current head is in the PR body.hygiene-review.layout.tsxis the first seed ofplan --package ui-react --mode hot. A push shard set puts 12 small packages in onesmallshard.To resume, once
bun scripts/integrate.ts main-status --jsonreports"red": false:origin/maininto the branch.bun run check:pr --base origin/mainand replace the PR body's receipt.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.