{"id":"c5ffe742-7a11-421d-a3d9-8f85aa630f06","slug":"test-pruning-campaign","kind":"skill","name":"Test-pruning campaign","summary":"Campaign mode prunes one subsystem's whole test surface in one PR: one core area such as packages/eve/src/execution , one tier slice such as the dev server scenario suites, or one package such as pack","owner":"vercel","repoUrl":"https://github.com/vercel/eve/blob/HEAD/.agents/skills/test-audit/CAMPAIGN.md","license":"Apache-2.0","licenseTier":"permissive","trust":"official","stars":5558,"match":null,"fewStars":false,"format":"instructions","createdAt":null,"addedAt":"2026-10-14T11:01:27.897Z","logoUrl":"https://avatars.githubusercontent.com/u/14985020?v=4","linkOnly":false,"collection":{"name":"eve","repo":"vercel/eve"},"skillPath":".agents/skills/test-audit/CAMPAIGN.md","categories":["developer-tools","cloud-infra","files-documents"],"tags":["agent","framework","harness","javascript","markdown","typescript","vercel","sandbox","gemini-antigravity"],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-14T11:01:27.896Z","sample":false,"url":"https://conduits.dev/tools/test-pruning-campaign","language":"TypeScript","transports":[],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"> Campaign mode prunes one subsystem's whole test surface in one PR: one core area such as packages/eve/src/execution , one tier slice such as the dev server scenario suites, or one package such as packages/eve code . The value bar, retention bar, candidate evidence, and validation in [SKILL.md](SKILL\n\n# Test-pruning campaign\n\nCampaign mode prunes one subsystem's whole test surface in one PR: one core\narea such as `packages/eve/src/execution`, one tier slice such as the\ndev-server scenario suites, or one package such as `packages/eve-code`. The\nvalue bar, retention bar, candidate evidence, and validation in\n[SKILL.md](SKILL.md) apply to every lane. This file adds the order of work and\nthe lessons of a full campaign. Each step ends on its completion criterion; do\nnot start the next step early.\n\n## 1. Baseline\n\nRecord the subsystem's test and support line counts, every test file's\npass/fail state, and per-file and per-test durations (JSON reporter) at a\npinned `main` SHA. Keep baseline failures in their own list: they are often\nreal product bugs, not stale tests.\n\nDone when every in-scope test file has a recorded baseline result.\n\n## 2. Lanes and inventory\n\nSplit the surface into **lanes** along production owner boundaries, not file\nprefixes. For example: session entry, workflow tools, tasks, client streaming,\ndev-server host, compiler, and build output. Include the subsystem's cases at\nshared core boundaries, its scenario suites, and its `e2e/` fixture evals.\n\nDone when every test file and e2e eval the subsystem owns belongs to exactly\none lane.\n\n## 3. Read-only ledger per lane\n\nGive each lane to its own read-only agent. The agent reads every assigned test\nin full, including parameter tables. It also reads the production owners and\ntheir entry points, callers, history, and CI routing. Each test declaration\ngoes into a written **ledger** with one mark. An `it.each` is one declaration\nunless its rows need different marks; then mark each row.\n\n- `R`: retain, naming the contract and the bug it catches; a retained test that\n  only moves to a better-named file or a cheaper tier stays `R` with the move\n  noted;\n- `F`: retain the contract but repair the assertion, such as a vacuous negative\n  that passes when only one of several items is missing;\n- `C`: consolidate, naming the owner that absorbs the assertion first: a sibling\n  table case, a stronger boundary suite, or the shared owner in another package;\n- `D`: delete, naming the proof that remains, or why no contract exists.\n\nJudge a test by its assertions, not its name. A test named for terminating a\nchild can assert only that the child never completed.\n\nDone when every declaration in the lane has a mark and an evidence line.\n\n## 4. Layer plan per lane\n\nTreat the per-test ledger as input, not as the edit list. A second read-only\npass, starting from the ledger, looks for the redundant **layer**: for example,\nan older scenario suite whose every case was later re-covered, more strongly,\nby newer chaos or connection suites. Name the **keeper** suite for each\ncontract. Prefer the real transport boundary with a fake network over a mocked\ncollaborator, and the cheapest tier that still reaches that boundary. Correct\nany ledger errors this pass finds.\n\nDone when each lane plan names its retired files, its keeper per contract, the\nassertions to carry into keepers, and the test-only production seams unlocked.\n\n## 5. Cutover\n\nEdit lane by lane. Serialize changes to shared harnesses and support files\n(`packages/eve/test/scenarios/dev-server-harness.ts`,\n`packages/eve/test/scenarios/dev-server-descriptors.ts`,\n`packages/eve/test/_helpers/`, `packages/eve/src/internal/testing/`) through\none owner. With each lane, remove the test-only production seams it\nunlocks: injection parameters, getters, reset exports, and indirection layers.\nUpdate CI routing when suites move tiers. Shrink `pnpm guard:invariants`\nbaselines when files disappear; baselines may only shrink. Put durable\ntest-ownership rules in the relevant `AGENTS.md`, drawn from mistakes this\ncampaign actually found.\n\nDone when every lane plan is applied and each lane's keepers pass.\n\n## 6. Preservation review\n\nBefore claiming completion, have independent reviewers compare deleted\ncoverage against the keepers, one reviewer per boundary group. They look for\ncontracts that lost their only proof. They also look for new assertions that\ncannot fail, such as a rejection row the production code never reaches.\n\nFor each restored contract, make one deliberate **mutation** of the production\nowner and confirm the keeper goes red. Then restore the source byte for byte.\n\nDone when every reported gap is restored or rejected with source evidence, and\nevery restored contract has a caught mutation.\n\n## 7. Product defects\n\nA baseline failure that survives into a keeper is a bug report. Fix it at its\nowner as a separate commit with a changeset, and prove it through the real user\nflow, with a **control** run that reverts the fix and shows the old behavior.\nRecord unrelated product discrepancies you find as follow-ups instead of fixing\nthem in the campaign.\n\nDone when each repaired defect has a failing control and a passing candidate\non the same harness.\n\n## 8. Reconcile and hand off\n\nCampaigns outlive many `main` commits. Merge `main` rather than rebasing a\nlong, many-commit campaign. When `main` modified a file the campaign deleted,\nkeep the deletion. Port the new contract into the keeper instead, and confirm\nevery new regression `main` added still has a home. Rerun the whole subsystem\nsuite on the merged head.\n\nExpect review tooling to see a truncated file list on a diff this large.\n\nHand off with the [SKILL.md](SKILL.md) report, plus:\n\n- baseline and final test/support line counts, with production counted separately;\n- baseline and final tier wall times;\n- lanes, retired layers, and keepers;\n- preservation gaps found and their mutations;\n- product defects with control and candidate proof."}