docs(skills): refactor-protocol — two more ways a mutation battery misleads - #518
Merged
Conversation
…sleads A harness that chains its steps on success throws away its own cleanup at the moment the cleanup matters, and a green mutation only ever speaks for the one site it touched.
This was referenced Aug 10, 2026
JArmandoAnaya
added a commit
that referenced
this pull request
Aug 21, 2026
…sleads (#518) A harness that chains its steps on success throws away its own cleanup at the moment the cleanup matters, and a green mutation only ever speaks for the one site it touched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mutation verification has earned its place in
refactor-protocolseveral times over, and two more of its failure modes have now cost real time. Both are recorded here, in the skill's own voice, beside the three ways a mutation harness already lies.The harness must not share a failure path with the tests it runs
This joins the existing list, which grows from three ways to four. A mutation is expected to make a command fail, so a battery that chains its steps on success discards its own cleanup at exactly the moment the cleanup matters. The recorded case ran
mutate && run && revertwith the test output piped throughhead:headcloses the pipe, the runner takes SIGPIPE,pipefailmakes the whole pipeline non-zero, and the&&short-circuits before the revert ever runs. Four of eight reverts silently never executed, the mutations stacked in the tree, and the next run's red read like a broken implementation rather than a broken harness.The rules the entry states: every step is its own unconditional statement rather than a link in an
&&chain; the harness asserts a clean tree before each case and refuses to continue on a dirty one; an empty recorded patch fails loudly instead of passing as a no-op; and test output goes to a file you grep afterwards rather than through anything that can close a pipe underneath the runner.The first entry in the list — commit the work before the first mutation — gains the same episode as a second example, because it is what made the stacked tree recoverable: with the finished work on a commit, six accumulated mutations cost one
git reset --hard HEADand nothing else. That rule was written for a directory-wide revert eating uncommitted work; it turns out to cover the opposite accident too.A green mutation is a claim about one spelling, not about the rule
This is a new top-level entry rather than a fourth item in that list, because it is not a way the harness lies — it is a way a correct harness's green result gets read wrong. A guard enforced at more than one site survives any single-site mutation with the suite still green, and the conclusion that reads as honest at that point (this rule is unverifiable, or that test is redundant) is exactly wrong.
The recorded case is a cool-down scrub whose cutoff scoping lived at two sites — a
grepdeciding whether to rewrite the file at all, and anawkrule deciding which line to remove, both matching the same cutoff. Two single-site mutations came back green before mutating both together finally went red; stopping at the first green would have reported a guard verified that no test could see. The rule: before declaring a rule unverifiable or a test redundant, iterate spellings and mutate every site that enforces the rule.Sources
Both entries were written from the primary records rather than from a summary. The pipe trap is the harness note in #514's body; the multi-site case is the first finding of the 2026-08-10 overnight report, whose Task 2 shipped as #507. The dispatch that requested this amendment placed the multi-site case in that report's Task 4 — the report itself puts it in Task 2, and the entry follows the report.
Test plan
The diff is one markdown file and there is no automated gate over skill prose, so the full staged check ran to prove the amendment breaks nothing rather than to exercise it.
pytest— architecture, cli, examples, formats, inference, jobs, mcp, packaging, scripts, test_versioning.py0pytest tests/kernel0pytest tests/server0ruff check .0ruff format --check .0mypy src/visionset0lint-imports0check.sh frontend0check.sh generatedopenapi.jsonor the generated client0check.sh browser0The pytest stages are split by test directory derived from
ls tests/at run time, per the protocol's own staging rule; every directory it listed is covered above.This PR closes no issue. cf. #360, #362, #507, #514.