|
| 1 | +# Test-audit campaign |
| 2 | + |
| 3 | +Campaign mode audits one subsystem's whole test surface, such as a library, |
| 4 | +service, application feature, or plugin. The value bar, retention bar, candidate |
| 5 | +evidence, and validation in [SKILL.md](SKILL.md) apply throughout. Use one coherent |
| 6 | +change or a sequence of independently reviewable changes according to the |
| 7 | +repository's delivery conventions. Each step ends on its completion criterion. |
| 8 | + |
| 9 | +## 1. Baseline |
| 10 | + |
| 11 | +Record the subsystem's test and support line counts and every test file's result |
| 12 | +at a pinned baseline revision, including the runtime and commands used. Keep |
| 13 | +baseline failures separate; they may reveal product bugs rather than stale tests. |
| 14 | +Record blocked or unavailable tests explicitly and carry those gaps into the |
| 15 | +handoff. Missing execution evidence is not evidence for deletion. |
| 16 | + |
| 17 | +Done when every in-scope test file has a recorded result or explicit blocker. |
| 18 | + |
| 19 | +## 2. Lanes and inventory |
| 20 | + |
| 21 | +Split the surface into **lanes** along production owner boundaries, not file |
| 22 | +prefixes. Include the subsystem's cases at shared boundaries and its integration, |
| 23 | +end-to-end, and live/QA scenarios where they exist. |
| 24 | + |
| 25 | +Done when every test file and scenario the subsystem owns belongs to exactly one |
| 26 | +lane, with shared ownership made explicit. |
| 27 | + |
| 28 | +## 3. Read-only ledger per lane |
| 29 | + |
| 30 | +Read every assigned test in full, including parameter tables, along with its |
| 31 | +production owners, entry points, callers, history, and CI routing. Use separate |
| 32 | +read-only agents per lane when available and authorized; otherwise work |
| 33 | +sequentially. Each test declaration goes into a written **ledger** with one mark. |
| 34 | +A parameterized test is one declaration unless its rows need different marks; |
| 35 | +then mark each row. |
| 36 | + |
| 37 | +- `R`: retain, naming the contract and the bug it catches; a retained test that |
| 38 | + only moves to a better-named file stays `R` with the move noted; |
| 39 | +- `F`: retain the contract but repair the assertion, such as a vacuous negative |
| 40 | + that passes when only one of several items is missing; |
| 41 | +- `C`: consolidate, naming the owner that absorbs the assertion first: a sibling |
| 42 | + table case, a stronger boundary suite, or the shared owner in another package; |
| 43 | +- `D`: delete, naming the proof that remains, or why no contract exists. |
| 44 | + |
| 45 | +Judge a test by its assertions, not its name. Record the candidate evidence from |
| 46 | +[SKILL.md](SKILL.md#candidate-evidence) for each proposed deletion or consolidation. |
| 47 | + |
| 48 | +Done when every declaration in the lane has a mark and supporting evidence. |
| 49 | + |
| 50 | +## 4. Layer plan per lane |
| 51 | + |
| 52 | +Treat the per-test ledger as input, not as the edit list. A second read-only pass |
| 53 | +looks for redundant layers: several suites may replay one shared helper through |
| 54 | +mocked collaborators while a stronger suite already exercises the real boundary. |
| 55 | +Name the **keeper** suite for each contract. Prefer exercising the real owner |
| 56 | +with controlled external dependencies over a mock that implements the behavior |
| 57 | +being asserted. Correct ledger errors found in this pass. |
| 58 | + |
| 59 | +Done when each lane plan names its retired files, its keeper per contract, the |
| 60 | +assertions to carry into keepers, and the test-only production seams unlocked. |
| 61 | + |
| 62 | +## 5. Cutover |
| 63 | + |
| 64 | +Edit lane by lane. Serialize changes to shared harnesses and support files |
| 65 | +through one owner. Establish keeper coverage before removing redundant tests. |
| 66 | +With each lane, remove obsolete test-only production seams it unlocks, after |
| 67 | +checking for production consumers. Register moved suites in CI routing and test |
| 68 | +inventories. Update existing size baselines if the repository uses them; do not |
| 69 | +weaken coverage or review gates to make the campaign pass. Record durable |
| 70 | +test-ownership lessons in existing subsystem guidance when useful and in scope. |
| 71 | + |
| 72 | +Done when every lane plan is applied and each lane's keepers pass, with unresolved |
| 73 | +baseline failures and blocked validation explicitly accounted for. |
| 74 | + |
| 75 | +## 6. Preservation review |
| 76 | + |
| 77 | +Before claiming completion, compare deleted coverage against the keepers by |
| 78 | +boundary group. Use independent reviewers when available and authorized; |
| 79 | +otherwise perform a separate review pass and disclose that it was not independent. |
| 80 | +Look for contracts that lost their only proof and new assertions that cannot |
| 81 | +fail, such as a rejection case the production code never reaches. |
| 82 | + |
| 83 | +For each restored contract, make one deliberate **mutation** of the production |
| 84 | +owner in an isolated checkout and confirm the keeper fails for the intended |
| 85 | +reason. Restore the source exactly afterward and rerun the passing keeper. A |
| 86 | +compile error, unrelated failure, or unreachable path does not prove detection. |
| 87 | + |
| 88 | +Done when every reported gap is restored or rejected with source evidence, and |
| 89 | +every restored contract has a caught mutation. Record any blocked proof as an |
| 90 | +outstanding gap rather than claiming preservation is verified. |
| 91 | + |
| 92 | +## 7. Product defects |
| 93 | + |
| 94 | +Investigate a baseline failure that survives into a keeper as a possible product |
| 95 | +defect. Within the authorized scope, fix it at its owner as a separate commit |
| 96 | +and prove it through the real behavior, with a **control** run that removes only |
| 97 | +the fix and demonstrates the old failure. Use the same harness for both runs. |
| 98 | +Report unrelated defects as follow-ups instead of expanding the campaign. |
| 99 | + |
| 100 | +Done when each repaired defect has a failing control and a passing candidate on |
| 101 | +the same harness, with deferred defects explicitly recorded. |
| 102 | + |
| 103 | +## 8. Reconcile and hand off |
| 104 | + |
| 105 | +Refresh from the current target branch using the repository's merge or rebase |
| 106 | +policy. When upstream modified a file the campaign deleted, inspect the new |
| 107 | +coverage and preserve every newly protected contract in an appropriate keeper; |
| 108 | +revisit the deletion if that is no longer possible. Rerun affected validation on |
| 109 | +the reconciled head, including the whole subsystem suite and applicable live |
| 110 | +proof before claiming full campaign validation. |
| 111 | + |
| 112 | +Check that review tools covered the full diff; large file lists may be truncated. |
| 113 | +Record maintainer decisions and validation limitations in the review evidence. |
| 114 | + |
| 115 | +Hand off with the [SKILL.md](SKILL.md#handoff) report, plus: |
| 116 | + |
| 117 | +- baseline and final test/support line counts, with production counted separately; |
| 118 | +- lanes, retired layers, and keepers; |
| 119 | +- preservation gaps found and their mutations; |
| 120 | +- product defects with control and candidate proof; |
| 121 | +- unresolved baseline failures, blocked checks, and deferred follow-ups. |
0 commit comments