mutation-proof-harnesslisted
Install: claude install-skill damson/hard-won-skills
# Mutation proof harness
`prove-the-check-can-fail` says an assertion never watched to fail is
decoration. This is the loop that watches, for more than one guard at a time.
The reason it is a script and not a habit: hand-driving it produces two failure
modes that both **look like success**. A test filter matching nothing reports a
pass. A mutation that edits the file without changing behaviour reports a pass.
Both are silent, so the tally reads the same either way.
## Procedure
### 1. Commit first
`git checkout -- <file>` restores from the **index**, not from HEAD. So work
that was staged but never committed survives the restore and stays staged, and
step 6's clean-tree check then reads as a failed restore when nothing failed;
work that was never staged is simply gone. Commit or stash pending work before
mutating anything, and the question does not arise.
### 2. Define the two things the rest depends on
One command that runs the suite filtered to a single test name, and the list of
names. Everything below is written against these two.
```bash
W=/abs/path/to/worktree # absolute: cwd resets between calls
cd "$W" || exit 1
pass=0; bad=0
# The one line to adapt per project. Must exit non-zero when the test fails.
# Use the repo's own pinned test command. A bare `npx <runner>` resolves from
# the registry when no local binary exists, which downloads and executes a
# package this script never chose.
run_filter () { (cd "$W/scripts" && npm test --silent -- -