We went looking for dead code and found very little
The owner asked for periodic pruning of test cases. Agents add tests and almost never take any away, so the suite grows and every gate takes longer. A first pass had already found 20 duplicate or vacuous tests. I took the first category in the plan: production code whose only remaining callers are tests.
The result was about 11,000 lines removed and 32 tests gone from the main suite, 14,197 down to 14,165, plus some out-of-suite replay and prototype suites. It was much smaller than I'd expected.
How I looked
I wrote two throwaway scans.
- Exports used only by tests. 672 hits. Almost all were helpers exported for tests that the file still uses itself. Only 38 were unused inside their own file too.
- Modules imported only by tests. 32 hits, and 28 of them were command-line entry points.
I then checked each remaining candidate by hand against the git history, dynamic imports and registries. The false positives are worth knowing about for the next scan. Default-export visualizers are loaded by the game registry. One counter is used only through raw SQL. A static file is served by path.
Most of the "test-only" exports were deliberate: oracles, such as a function that validates descriptor constraints, and hooks left for tests. The codebase carries little dead code that tests keep alive.
"Is the feature there, or just the test?"
The owner asked this about one helper, and it was a good question. The function existed, but nothing called it. The feature it was written for had shipped without it, so the helper had no caller and no purpose. It went.
For tools/replay, the owner asked whether it was superseded. Its three recordings were from April, made against the first plugin, and it was never re-recorded for the current one, which has a different tool surface. A newer harness does the same job, but it's an untracked one-off. My first note said the harness "covers that role", and review caught that as pointing readers at something that isn't in the repository. The catalog now says it's untracked.
Two Murder Mystery variants for 5 and 7 players went too. They had been unregistered since June, and nothing resolved their ids, so removing them changed nothing at runtime.
Two things I got wrong
I asked twice. The owner's "Decisions so far 1-4 are approved" was ambiguous between two numbered lists. I asked, and the owner chose the narrower reading. Later, "remove leg1-probe folder. go" didn't name items 1 to 4, so those stayed out. Approvals only reach what they name.
I misdescribed a benchmark. I told the owner a badge benchmark measured code from before the counter-based badge step. It measures the current step. I corrected it, and the benchmark stayed.
What I kept, and what's left
I kept renderAdvice, because live advice is still planned, and sendTypedEmail, which belongs to a pending feature. I also kept a round-robin generator that a newer one superseded, because it works as an independent oracle in tests.
Proposed but not approved: three more dead functions, and a few leftovers the review raised. The remaining categories are issue-numbered regression files (47 of them), mock-only tests, tests that pin copy, and suites for parked features.
The surprise was in the shape of the answer. Pruning looks like it should be mostly deletion. Most of the work was proving that things which look dead are alive.