Skip to content

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

Closed

Description

@schlessera

Context

The rules for good tests are written down (docs/process/testing.md, docs/process/test-waits.md), and one-off epics have repaired the suite before, but nothing audits the existing tests on a schedule. At 3aadc8df51294fc32fc14cd3b5552de4d52193fc the unit cost table lists 1,179 files and 4,354 s, with 62% of that time in the 50 slowest files, and 80 type: test issues are open, 23 of them needs: repro.

The two skills that pick up and triage issues also cost more than they need to. .agents/skills/work-issue/SKILL.md, its references/ci-and-merge.md and .agents/skills/triage-issues/SKILL.md prefix 41 commands with rtk proxy, which switches rtk's output compression off, and they select issues with gh ... | jq shell pipelines that depend on tools an agent environment may lack and that each agent has to re-derive.

Scope

  • A test-health skill for a recurring run: it audits a few clusters of related test files in depth through eight lenses, proves each fix, lands fixes in per-package batches and records the run.
  • A test-health-push wrapper skill that runs the same audit over the whole suite in parallel against an integration branch and lands once. It adds only scale.
  • scripts/test-health.ts and its modules: inventory, static smell scanner, neighbour detection, rotation and claims on an append-only ledger ref, repeated-run measurement, mutation receipts, worksheet validation, the batch gate with test accounting, shards and metrics.
  • docs/process/test-authoring.md: which kind of test proves which claim, structure, determinism and cost, mapped to every smell the audit knows. docs/decisions/test-health.md records the rulings.
  • scripts/issue-queue.ts and scripts/pr-status.ts, and the work-issue and triage-issues skills rewritten around them without rtk proxy or jq pipelines.
  • The tooling's own tests in scripts/skill-tests/, run with bun run test:skills, outside product discovery.

Out of scope

  • A hosted workflow for the skill-tooling tier. It would be a proof-system change and needs its own decision.
  • Running the first audit or a full push. This delivers the tooling only.
  • Any change to product code, product tests, timeouts, shards, selection rules or workflows.
  • Reconciling labels that exist on issues but not in scripts/labels.ts.

Acceptance criteria

  • bun run test:skills passes, and product discovery (./packages, ./tests) and the experiment tier contain none of those tests, proven by a test.
  • The batch gate refuses: a change outside test code, a proof-system change, a commit with no recorded audit, a new skip, retry, focused test or long time budget, and any test title that disappears without a fixed finding naming it. Each refusal is proven by a test, and a mutation of each guard makes its named test fail.
  • For Bun test files, a recorded cluster's executed case count may fall only by the declared number; a shortened table and an undeclared removal are each refused at record time, proven by tests.
  • Two writers appending to the ledger ref concurrently both land, proven against local git remotes with a forced push race.
  • Every command, subcommand and flag the five skill documents name exists in the script it names, and no skill prefixes a command with rtk proxy or rtk bypass, proven by tests.
  • The test-health-push skill names no lens, smell or finding action of its own, and its config profile changes only what scale requires, proven by tests.
  • bun run lint, tsc --noEmit and bun run check:pr --base origin/main pass.

Verification

bun run test:skills, bun run lint, the typecheck and bun run check:pr --base origin/main, plus mutation receipts for the gate, the ledger compare-and-swap, the accounting and the claim race, recorded in the pull request.

Contract impact

None: repository scripts, skills and documentation. No CLI --json shape, MCP schema or package changes.

Activity

  1. added this to the 0.45.0 milestone on Nov 10, 2026
  2. added
    type: chore
    area: ci
    area: docs
    priority: p1
    on Nov 10, 2026
  3. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Delivered by #3841, squashed to main as a26e2546f9f033d124d7504fdd5de63d575b3bda.

    • Ready confirmation (run 42804713969) passed on head 9d59ed3835310bfc18031bc8d46cc8415f2b9237 against base f100cc95a4a4cd5871cd77921cdd388a962d200b.
    • The squash's parent is that base and its tree is d94019b530ed8e2819f331c0b640571bd418ce20, the tree of the merge checkout the confirmation tested.
    • The squash's own main run (42808392198) passed every job, including the post-merge categories: runtime, runtime_host, browser, layout, captures and endurance.

    Left open, as named in the pull request and out of this issue's scope: no agent has done a real audit run yet; the browser-tier path of measure and mutate is unexercised; no hosted job runs bun run test:skills; the ledger ref is created by the first real plan.

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

    area: ciarea: docspriority: p1type: chore

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions