Repository navigation
Description
Context
A test-health batch stays inside one package and lands as one pull request (docs/decisions/test-health.md:40-45; batchIdFor, scripts/test-health/batch.ts:22; planRun, scripts/test-health/select.ts:114-174). In the cron profile a batch is ripe at 25 changed files, at 72 hours, or when its package has nothing left to audit (scripts/test-health/config.json:13; ripeness, scripts/test-health/batch.ts:49-60).
A small package can only ever land the third way, with whatever few files changed. Observed on 2026-11-10: the first landed batch, common-th-20261110125824-17b8eb, audited all 10 test files of common, changed one file by five lines, and landed alone. It took a main-lane slot, three confirmation attempts and a main run of 15 jobs (run 42836821339, about 3.4 runner-hours).
bun scripts/test-health.ts inventory at 7f1c15837 lists 13 packages with 25 or fewer test files, 115 files together: common 10, compute-boat 13, geo 11, module-diagrams 17, module-finance 1, module-images 7, module-jobs 25, module-speaking 1, module-travel 9, module-video 2, render-template 6, scrape 8, ui-render-puppeteer 5. Under the current rule each lands its own pull request. The push wrapper has the same shape: makeShards (scripts/test-health/select.ts:189-214) gives every package with work its own shard, so each becomes its own worker pull request.
The one-package rule exists because hosted proof is priced per workspace touched. That argument holds for large packages. For small ones it is outweighed: one pull request that touches several small packages pays the union of their closures once, and 13 pull requests pay each closure and a lane slot apiece.
Touches planRun, as #3852 does; land them one after the other.
Decision
Decision (maintainer, 2026-11-10): small packages share one batch.
Scope
- Groups. A package with at most
smallPackageFilestest files (new key inscripts/test-health/config.json, default 25, counted over the profile's tiers) belongs to the shared groupsmall. Every other package is a group of its own, named by the package. - Planner. A run stays inside one group. In
smallit takes clusters from as many packages as its file budget allows. A cluster still stays inside one package: its members share a package and other packages remain read-only context. The plan and the brief name each cluster's package, which the cluster's commit subject uses. - Batch. One open batch per group and base. A
smallbatch issmall-<runId>ontest-health/small-<runId>.batch statuscounts what is left to audit in the group, and "exhausted" means the group. - Earlier records. A batch record written before this change names a package; it reads as that package's own group. The open
ui-reactbatch continues unchanged. - Shards.
makeShardskeeps a shard inside one group, so the small packages share shards in a push. - Landing reference. A group batch's pull request is titled
test: test-health batch <batch id>and carries thearea:label of every package it changed (.agents/skills/test-health/references/landing.md:57-63). - Decision record and skill wording.
docs/decisions/test-health.mdstates the one-group rule and why small packages share;SKILL.mdand the wrapper skill say "group" where they say a run or shard stays inside one package.
Out of scope
- Mixing a large package into a shared batch, or two large packages into one.
- Changing the ripeness thresholds.
- Clusters that span packages.
- How a batch is confirmed and merged.
Acceptance criteria
- With an inventory of three packages under the threshold and one above it, a sweep
planRunreturns clusters from more than one small package in one plan, names the group, and every cluster's members share one package. A plan for the large package contains only that package. A test inscripts/skill-tests/shows both and fails before the change. - A second
planon the same base continues the opensmallbatch (same id and branch) whichever small package it draws from. batch statusreports asmallbatch as not exhausted while any small package has an eligible file, and ripe by exhaustion only when none has.- A ledger holding an
openedrecord from before this change, for one package, resolves to that batch and plans continue it. A test replays such a record. shardsoutput has no shard that mixes a small-group file with a large package's file, and the small packages do not each get a shard of their own.- The test that pins "a batch never widens beyond one package" is replaced by one that pins "never beyond one group".
- The decision record,
SKILL.md, the wrapper skill andlanding.mdare updated as scoped. 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 --mode sweep against the live ledger lists clusters from more than one small package.
Contract impact
None. Repository tooling. The plan's one-line JSON gains a group name and a package per cluster; the skills are its only readers.
Activity
schlessera commentedon Nov 10, 2026
Claimed for implementation. Claim token:
claim-369eb7d0. 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.