From a0813f1110c887ef5f5d1cf438fbd0d76c574400 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 22 Sep 2026 16:42:58 +0200 Subject: [PATCH] Mutation testing moves to the ecosystem's tools; anchors become the fallback Hands and Soul measure suites with Stryker.NET, cargo-mutants, StrykerJS or mutmut scoped to the cut's diff, and triage every survivor by name. The hand-written anchor harness is demoted to code no tool reaches. Evidence in the changelog: Aetheria's 23 harnesses stranded on refactors and one anchor silently re-targeted; a Stryker spike killed everything they defended and found the splash-handedness bug they missed. Co-Authored-By: Claude Opus 5 --- SKILL.md | 40 ++++++++++++++++++--------------- references/briefs.md | 50 ++++++++++++++--------------------------- references/changelog.md | 28 +++++++++++++++++++++++ 3 files changed, 67 insertions(+), 51 deletions(-) diff --git a/SKILL.md b/SKILL.md index f85c218..24dd962 100644 --- a/SKILL.md +++ b/SKILL.md @@ -199,24 +199,28 @@ briefly, and the verification. The brief says: - **Delete before adding.** No shims, no compatibility layers the map did not name. - Small commits, each pushed, with explicit paths. See the git rules below. -- **Every operator ruling and every new rule gets a test that fails under its own - mutation.** Hands runs the mutations against the final spelling of the code and - restores afterwards. -- **The harness lives here, in `tools/eureka-mutations.ps1`,** not in whichever - repo happened to need it first. It takes `-Repo`, `-Entries`, `-Target`, - `-Test` and `-TimeoutSeconds`, so one copy serves every campaign and a fix to - it fixes all of them; it was moved out of Epiphany once a second repo started - reaching across for it. A repo whose suites cannot run under PowerShell keeps - its own runner and owes the same contract by name: a no-op control, byte-exact - restore verified by hash, a sidecar written before any write, anchors matching - exactly once, an honest exit status, and the child's output on a red control. -- **Every mutation suite is a committed script with a no-op control.** The - control rewrites the target through the same I/O path with no change and must - leave every test green; if it kills anything, the harness is broken and every - verdict from it is fiction. File I/O is byte-exact (symmetric UTF-8, line - endings preserved), anchors match exactly once, and restore is a reverse - write. This applies to Soul's harness as much as Hands': the one that faked a - kill was Soul's own inline script, and it is not on disk to be checked. +- **Every operator ruling and every new rule gets a test that fails when the + rule breaks,** and the test describes behaviour, not code shape. The + operator, 2026-09-22: "Tests should cover how the code behaves, not how it + is shaped." +- **Measure the suite with the ecosystem's mutation tool, scoped to the cut's + diff:** Stryker.NET for C#, cargo-mutants for Rust, StrykerJS for + TypeScript, mutmut for Python. The tool generates the mutants and nobody + writes an anchor. Every survivor is a finding about the tests, triaged by + name: a behavioural test is missing, a fixture is degenerate (see below), + or the mutant is equivalent and gets a one-line reason. Boundary flips on + float thresholds are equivalent by default and are not chased. The score is + not a gate; the triaged survivor list is the record, and Self commits it in + the map. Soul reruns the tool on the range rather than trusting Hands' + triage. +- **Hand-written mutation entries are the fallback, for code no tool + reaches:** editor probes, shaders, a runtime without a tool. + `tools/eureka-mutations.ps1` serves those, under its contract: a no-op + control, byte-exact restore verified by hash, anchors matching exactly + once, an honest exit status. Anchors couple the suite to the code's + spelling, strand on every refactor, and can keep matching while silently + re-targeting onto code the tests no longer run, so a campaign that falls + back says why the tool cannot reach and treats each entry as debt. - **"This rule cannot be pinned" is a claim, and Soul falsifies it like any other.** Recording an honest gap is right and beats inventing a kill, but the gap itself is a hypothesis about reachability, and it was wrong both times it diff --git a/references/briefs.md b/references/briefs.md index cdd560f..1e8e55a 100644 --- a/references/briefs.md +++ b/references/briefs.md @@ -98,16 +98,14 @@ Standing rulings: . - Gaps are filled in their owner, never with local helpers. - Delete before adding. No shims. -Every rule the spec or the operator names gets a test that fails under its own -mutation, and under two mutations, not one: a revert (delete the check) and a -loosening that keeps the check in place and weakens it (`>=` for `==`, the -first item only, the image without the batch, case-insensitive, off by one). -The revert proves the test sees the rule; only the loosening proves it sees -the rule's edge, and the loosening is what Soul would otherwise write on its -second pass. Run both against the final spelling of the code and restore -afterwards. In the report, define each mutation exactly (what line changed and -how) so Soul can rerun it; a mutation named only "C3" cannot be checked. A -loosening that survives is reported, not hidden and not deleted. +Every rule the spec or the operator names gets a behavioural test. Measure the +suite with , scoped to this cut's diff +(`--since:` or the tool's equivalent), against the final spelling of the +code. Triage every survivor in the report by name and line: killed by a new +test, killed by fixing a degenerate fixture, or equivalent with a one-line +reason. A survivor that weakens a rule and cannot be killed is reported, not +hidden. Code no tool reaches falls back to `tools/eureka-mutations.ps1`; say +why the tool cannot reach it. When a claim is "behaviour unchanged", a value captured from the new code is not evidence. Pin it with a value computed at the base commit. Detached scripts: confirm the log starts within 60 s; a script that dies on a @@ -115,10 +113,6 @@ parse error is silent otherwise. Shared build caches: record a full path list before building, not only counts, and delete exactly the new paths afterwards. Counts cannot attribute hardlinked or rewritten outputs. -A mutation that never applied is not a passing mutation. Make the script fail -loudly when its anchor does not match, and check line endings: a multi-line -anchor silently matched nothing on a CRLF tree for a whole cut, so the verdict -it reported was fiction. When a cut deletes, list every rule that had a test before and has none after. A rule that still exists in code with its only test deleted is the failure mode of subtraction; either the rule goes too, or it gets a test in the same cut. @@ -160,18 +154,9 @@ it: "I'll wait for the suite and then report" ends the turn exactly as a to-do list does. Aetheria's shield Cut 3 burned two round trips this way, the second one after being told. If a run is going, block on it in this turn or read its finished output; do not yield to say what you are about to do. -Mutations: restore with a reverse edit or run against committed code; `git -checkout` also reverts uncommitted fix code and silently invalidates the run. -The suite is a committed script under `tools/`, and its first entry is a -no-op control: rewrite the target through the same I/O path with no change -and run the suite; every test must stay green, or the harness is broken and -nothing it reports counts. Read and write bytes symmetrically (in PowerShell, -`[IO.File]::ReadAllText`/`WriteAllText` with an explicit UTF-8 encoding, never -a bare `Get-Content`/`Set-Content`; in Python, `encoding="utf-8", newline=""` -both ways). A `-Raw`-less read or a line join rewrites every line ending, and -`core.autocrlf` hides that from `git diff`. Sources carry non-ASCII literals -on purpose, so a lossy round-trip fails tests on its own and fakes a kill on -every mutation. +Mutation tools run on schemata or copies and never edit the tree; a fallback +entry through `eureka-mutations.ps1` restores by hash, and `git checkout` is +never the restore, because it also reverts uncommitted fix code. Warnings: measure from a forced rebuild and compare distinct messages; cargo replays warnings only when it actually rebuilds. Semantic properties ("exactly one call site", "this step actually runs"): @@ -264,18 +249,17 @@ Falsify specifically: - - rerun the builds, tests and captures yourself -Your own mutations obey the same harness rules as Hands': write them as a -script in , run a no-op control through it first, use byte-exact -symmetric I/O, and name the script in the report so the run can be checked. -An inline harness typed for one run is not evidence, and it is where the one -known fake kill came from. +Rerun the mutation tool on the range yourself; do not trust Hands' survivor +triage. Challenge each "equivalent" call that is not a float boundary flip: +measure it, as a mutant that changes how a thing is built can leave what it +does untouched, and one that looks cosmetic can move damage to the wrong side +of a ship. Report each finding as CONFIRMED or PLAUSIBLE, with file:line, a failure scenario and severity. Then the promises that held, one line of evidence each. Then the numbers: test counts, entries killed, path delta, script paths. Nothing else: no narrative of the pass, no reasoning about mutants -that died. Rerun Hands' loosening mutations; design your own only where a -rule has none or the loosening was weak. +that died. Name the survivors you retriaged. scope is the fix batch's diff plus one rerun of the suite. Do not re-derive the whole cut unless an diff --git a/references/changelog.md b/references/changelog.md index 76ff251..9c1a94e 100644 --- a/references/changelog.md +++ b/references/changelog.md @@ -2,6 +2,34 @@ Record each change to the skill together with the evidence that motivated it. +## 2026-09-22: mutation testing moves to the ecosystem's tools + +Evidence: Aetheria's fire-control campaign carried 23 hand-written harnesses +(5,816 lines) of literal-text anchors and substitutions. They stranded on +every refactor (`72c0109c`, Cuts 9 and 10), and at Cut 10 an anchor kept +matching exactly once while silently re-targeting from `HitProbability` onto +`Inspect`, mutating code the tests no longer ran, and it surfaced only as +unexplained survivors. Soul's audit of the +harnesses also found the tree-clean verdict restoring before it measured, and +a compile failure counted as a kill. The operator: "What is the point of those +mutation anchors? Tests should cover how the code behaves, not how it is +shaped." + +A Stryker.NET spike over one file killed every mutant the harnesses defended +and found 67 survivors they did not, among them the sign error that put splash +damage on the wrong side of a ship, which the operator had spent hours hunting +and no test defended. Three rounds of tests and fixture fixes took it to 43, all named. + +- The principle of 2026-09-15 stays: every rule has a test that fails when it + breaks. +- The committed-anchor-script mandate is replaced: Hands and Soul run the + ecosystem's tool on the cut's diff and triage survivors by name. + `eureka-mutations.ps1` is demoted to the fallback for code no tool reaches. +- Float boundary flips are equivalent by default (operator: "> to >= on float + thresholds is indeed petty"); the score is not a gate. +- The harness-hardening entries below (H1, F2, the case-blind guard, the + CRLF anchor) remain the record of why the fallback's contract is what it is. + ## 2026-09-22: verification moves off the operator's workstation Evidence: Starfire went from fine to unresponsive in seconds, and the operator