Skip to content

ci: small packages share one test-health batch instead of landing one pull request each #3854

Closed

Description

@schlessera

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 smallPackageFiles test files (new key in scripts/test-health/config.json, default 25, counted over the profile's tiers) belongs to the shared group small. Every other package is a group of its own, named by the package.
  • Planner. A run stays inside one group. In small it 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 small batch is small-<runId> on test-health/small-<runId>. batch status counts 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-react batch continues unchanged.
  • Shards. makeShards keeps 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 the area: label of every package it changed (.agents/skills/test-health/references/landing.md:57-63).
  • Decision record and skill wording. docs/decisions/test-health.md states the one-group rule and why small packages share; SKILL.md and 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 planRun returns 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 in scripts/skill-tests/ shows both and fails before the change.
  • A second plan on the same base continues the open small batch (same id and branch) whichever small package it draws from.
  • batch status reports a small batch as not exhausted while any small package has an eligible file, and ripe by exhaustion only when none has.
  • A ledger holding an opened record from before this change, for one package, resolves to that batch and plans continue it. A test replays such a record.
  • shards output 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 and landing.md are updated as scoped.
  • 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 --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

  1. added
    type: chore
    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-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.

  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: chore

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions