Test audit: remove low-value tests, repair tests that cannot fail, adopt a test authoring gate
Summary
A test audit of this repository (method: the openclaw test-audit skill: authoring gate, junk-pattern list, retention bar, full evidence per candidate) found 3 candidates with complete evidence: tests that duplicate a stronger owner test, tests that cannot fail, and test-only production seams. This issue tracks applying them as small atomic PRs, one per owner boundary, plus adopting a test authoring gate in this repository's agent instructions.
Every PR re-runs the affected tests and their keeper tests on the unedited base first. A retained test that fails on the base is treated as a product bug and fixed at its owner, never deleted. Every consolidation or repair carries a mutation proof (a deliberate break of the production owner turns the keeper red, then the owner is restored byte for byte).
Expected (ideal state)
| Property | Why |
|---|---|
| Every test protects observable behavior, a credible regression, or an independently meaningful contract | Confidence, not deletion count |
| Every junk test with complete evidence is deleted, consolidated into its named keeper, or repaired so it can fail | Low-value tests cost CI time and mislead reviewers |
| Test-only production seams unlocked by those deletions are removed | Production code whose only callers are tests is dead weight |
| Assertions that can never fail are repaired, each proven by a mutation that turns it red | A test that cannot fail proves nothing |
| Valuable tests that run in no CI job are routed into CI | Coverage that never runs is not coverage |
| The repository's agent test rules carry the authoring gate, junk-pattern list and retention bar, with conflicting older rules reconciled | New junk stops arriving |
| Test/support/production line counts and CI time are measured before and after with the same tool | The effect is stated in numbers |
Acceptance criteria
- [ ] Every audit batch for this repository merged or explicitly declined with a reason (planned batches: L1, L2, G5)
- [ ] The test authoring gate adopted in this repository's agent instructions
- [ ] BEFORE/AFTER numbers (test files, test/support/production lines, CI job times or a stated "not comparable") posted here
Audit complete for this repository. Closing with evidence.
Merged (each merge SHA read back with gh pr view --json state,mergeCommit):
- G5: undefined - 6a708ab5b6
- L2: https://github.com/code-yeongyu/lazycodex/commit/d5a2816710359390819c1f5c400e91fba78ada44 - d5a2816710
- L1: https://github.com/code-yeongyu/lazycodex/commit/5aa39081787e88e3289df7d42ecb36997d04052d - 5aa3908178
Measured (merge^1..merge for every merge):
- Test files removed: 0
- Test cases removed, net: 0
- Test LOC removed: 5
- Test LOC added for repairs and new behavior tests: 8
- Test LOC net: 3
- Production LOC removed / added: 0 / 0. The removed code was only kept alive by tests.
CI wall time: npm-ci.yml: before 17 s (median of 5 green push runs); after: not measurable yet, 1 green push run(s) since the last audit merge; web-ci.yml: before 246 s (median of 5 green push runs); after: not measurable yet, 1 green push run(s) since the last audit merge.
Preservation: every removed or folded test's contract has a remaining keeper. Each keeper went red when its production owner was mutated on merged main, and the file was restored byte-for-byte afterwards. Each repaired (F) test carries its own red mutation proof in its PR. No open gaps.
Pushed directly to main under the lead's rule, so there are no PRs. Deferred: R13, whose repair needs a production seam the gate does not allow. Pre-existing and tracked separately: #170, where the Web Deploy Lighthouse gate expects 100 and the live score is 99.