Skip to content

chore(skills): recurring test-health audit, a full-pass wrapper and tracker helpers - #3841

Merged
schlessera merged 2 commits into
mainfrom
chore/3840-test-health-skills
Nov 10, 2026
Merged

schlessera merged 2 commits into
mainfrom
chore/3840-test-health-skills

Conversation

@schlessera

@schlessera schlessera commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Closes #3840

What changed

Two repo-local skills now keep the existing tests in shape, backed by scripts that decide everything a script can decide. test-health does one recurring run: it picks a few clusters of related test files, audits them through eight lenses (tests that cannot fail, overlap between tiers, non-determinism, open failure issues, cost, tests that do not run, wrong tier or double, hygiene), proves each fix, lands fixes in per-package batches and records the run on an append-only ledger ref. test-health-push runs the same audit over the whole suite in parallel against an integration branch; it adds only scale. docs/process/test-authoring.md is the guide the audit checks against.

The work-issue and triage-issues skills now use scripts/issue-queue.ts and scripts/pr-status.ts instead of gh and jq shell pipelines, and no longer prefix 41 commands with rtk proxy, which switched output compression off.

Why this shape

The rulings are in docs/decisions/test-health.md. In short:

  • Nobody reviews these changes by reading them, so review is mechanical. A fixed finding must carry the evidence its action requires, and a batch passes a gate that refuses a change outside test code, a proof-system change, a commit with no recorded audit, a new skip, retry or longer budget, and any test that disappears without a finding naming it.
  • A batch stays inside one package and lands as one pull request, because hosted proof for a test edit is priced by the workspaces it touches, not by the number of files.
  • The ledger lives on its own ref, not in the tree, so a run can record itself without a pull request and no document becomes a progress log.
  • The tooling's own tests are not product proof. Root tests/ accompanies every package change's unit proof, so they live in scripts/skill-tests/ (bun run test:skills), where a broken audit tool blocks only itself.

Rejected: one pull request per audited cluster; relying on the leaf-test shortcut (about 15% of test files qualify); keeping the rotation's state in the main tree.

Proof

bun run test:skills                      # 240 pass, 0 fail, 12 files
bun run lint                             # all gates clean
NODE_OPTIONS=--max-old-space-size=6144 tsc --noEmit   # 0 errors
bun scripts/proof-system.ts classify --base origin/main --head HEAD   # proofSystem: false
bun run check:pr --base origin/main      # passed; receipt below

Tested head ab79790ede42b976fbb2ad1e132f14401527cb37 on base d79eeed0a1860184bc552e034525286a230eaa0f.

Mutation receipts, each produced by the new mutate command against the real runner (the named test fails with the guard broken and passes with it restored):

Guard broken Test that failed
Worksheet accepts a cannot-fail fix with no mutation receipt "a cannot-fail fix without a mutation receipt is refused"
Gate accepts a change outside test code "a change outside test code is refused"
Ledger push without its compare-and-swap lease "a writer that loses the race"
An audit waiting on a batch branch counted as stale "an audit still counts while its change waits on a batch branch"
A load error counted as a killed mutant "a mutant that only fails to load is not a kill"
Gate ignores undeclared test removals "one declared removal does not cover for a second test"
Executed-case allowance widened "a shortened table loses cases the source never shows"
Recorder accepts a cluster that loses a test "a cluster that loses a test without declaring it cannot be recorded"
Claim ignores a second owner appearing "when another owner appears during the claim"
agent-ready allowed beside a needs: label "a change that would leave agent-ready beside a need is refused"
A skipped proof check read as passed "a proof check that ended ... is failed"

Collisions at head ab79790ede42b976fbb2ad1e132f14401527cb37 (bun scripts/collisions.ts --json --pr 3841): no textual or path collision. 21 open pull requests share a proof closure with this one (#3054, #3056, #3059, #3069, #3116, #3393, #3437, #3464, #3581, #3622, #3662, #3726, #3735, #3761, #3772, #3786, #3805, #3806, #3827, #3837, #3839), as expected for a change to root tooling whose affected closure is every workspace.

Read-only commands were also run against the live tracker and a live pull request: issue-queue candidates, snapshot, show, check, and pr-status with --failures --logs. The planner was run offline against the real tree with a scratch ledger.

{"version":1,"kind":"brain-check-pr-receipt","head":"ab79790ede42b976fbb2ad1e132f14401527cb37","base":"origin/main","mode":"focused","startedAt":"2026-11-10T10:55:33.210Z","finishedAt":"2026-11-10T10:56:56.968Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":11984.643028},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":101.39566299999933},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":69.6613899999993},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":17.41590499999984},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":71568.454044}]}

Anything left open

  • No agent has done a real audit run yet, and the browser-tier path of measure and mutate (the pinned container) was not exercised. For browser tiers the test accounting checks titles only, because that runner reports no case list.
  • No hosted job runs bun run test:skills. The test-health skill runs it as its first step. A workflow for it would be a proof-system change and is out of scope here.
  • The ledger ref does not exist yet; the first real plan creates it.

Checklist

  • Focused local preflight/behavioral receipts and complete selected hosted proof passed; actual head/base/job checkout evidence is in Proof.
  • Acceptance criteria from the issue are all met, or the gap is named below.
  • The PR and completed/advanced issues have verified release milestones under docs/process/github.md.
  • A changeset is included, or this changes nothing a consumer can see.
  • No personal data anywhere in the diff — the leakage gate covers the whole tree.
  • The integration contract index or relevant component is updated in this same commit, or nothing in the machine surface moved.
  • Docs under docs/ reflect the change, or nothing documented moved.
  • A fail-closed guard added or changed answers the proportionate-containment checklist in this body, or no guard changed.
  • Provider history stays append-only (docs/decisions/provider-history.md): the provider-history guard passes, or nothing on a turn's path changed.

🤖 Generated with Claude Code

…racker helpers

Adds two repo-local skills that keep the existing tests in shape, and the
scripts that make them deterministic across agents.

- test-health: one run audits a few clusters of related test files through
  eight lenses, proves each fix (mutation receipts, repeated runs, obligation
  maps), lands fixes in per-package batches behind a mechanical gate, and
  records the run on an append-only ledger ref.
- test-health-push: the same audit over the whole suite in parallel against
  an integration branch. It adds only scale.
- scripts/test-health.ts: inventory, static smell scanner, neighbours,
  rotation and claims, measure, mutate, worksheet validation, the batch gate
  with test accounting, shards and metrics. Output is one line of JSON by
  default, with the detail in files.
- docs/process/test-authoring.md: which test proves which claim, structure,
  determinism and cost. docs/decisions/test-health.md records the rulings.
- scripts/issue-queue.ts and scripts/pr-status.ts replace the gh-and-jq
  pipelines of the work-issue and triage-issues skills, which no longer
  prefix commands with `rtk proxy`.
- The tooling's own tests live in scripts/skill-tests/ (bun run test:skills),
  outside product discovery, so they never gate a product change.

Closes #3840

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@schlessera schlessera added this to the 0.45.0 milestone Nov 10, 2026
@schlessera schlessera added type: chore Tooling, CI, release plumbing, dependencies. area: ci CI workflows, the gates they run, release scripts, packaging. area: docs The docs/ tree and the README / AGENTS / CONTRIBUTING surfaces. labels Nov 10, 2026
@schlessera
schlessera marked this pull request as ready for review November 10, 2026 11:06
@schlessera
schlessera merged commit a26e254 into main Nov 10, 2026
49 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, the gates they run, release scripts, packaging. area: docs The docs/ tree and the README / AGENTS / CONTRIBUTING surfaces. type: chore Tooling, CI, release plumbing, dependencies.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: agent skills keep the automated tests healthy with scripted selection, proof and metrics

1 participant