Open History to see the last commit
1# Mutant gap hunt
2
3**Use when:** a recent refactor, a suspicious green oracle, or an open review
4question leaves doubt that the tests would reject a plausible wrong behavior.
5One carefully chosen mutant can answer a useful question; a campaign is optional.
6
7**Inputs:** the changed code and commits that shaped it, the claimed law and its
8authority, the primary oracle's contract prose and stated limits, its
9coverage-map row, open review questions, and the public observation that could
10distinguish a mistake. Keep test bodies and assertions out of the design brief.
11
12## Operation
13
141. **Design plausible mistakes before reading the tests.** Start with semantic,
15 type-plausible edits near the changed boundaries: a lost operand, wrong
16 prior value, premature clear, duplicated event, changed ordering, or skipped
17 callback. Turn each open review question into a candidate. If code is called
18 dead, try removing it. In a larger hunt, spread candidates across the
19 affected files and boundaries rather than clustering where edits are easy.
20 Hand-write candidates at boundaries a designer may miss, such as receipt
21 wrappers, lazy getters, and caches. If a separate designer is authorized,
22 keep the current assertions out of its brief. Otherwise draft the candidates
23 before inspecting those assertions and label the design as self-generated.
242. **Make each edit replayable.** Record `{ id, file, old, new, desc }`; require
25 `old` to occur exactly once at the pinned revision and `new` to parse. Change
26 one decision per mutant; a compound kill does not identify which part the
27 comparison rejected. Run each candidate in an isolated checkout against an
28 unchanged, pinned baseline, then restore the checkout exactly. Use `main`
29 when measuring what the existing suite catches; use a PR revision when
30 challenging its new coverage. Do not combine those kill claims. A full-suite
31 kill can locate an existing witness, but a crash outside the comparison,
32 timeout, setup error, or unreached edit is not a kill there. Record that
33 distinction, not a mutation score. Re-run carried-over survivors when the
34 baseline revision moves.
353. **Interrogate every survivor.** Find a legal public history and checkpoint
36 where baseline and mutant predict different observations, or name the
37 invariant that makes them equivalent. If the observations differ but the
38 contract permits both, record a **permitted difference** with its contract
39 source; it is no oracle gap. If that freedom seems undesirable, take the
40 question to law discovery or adversarial review at the suitability level.
41 Grade an equivalence claim at a named revision: equivalent by invariant,
42 equivalent only on instrumented reached histories with a positive control,
43 or evidence-limited and unresolved. The last is not an equivalence verdict.
44 Check all relevant entry paths, including reentry and environment-specific
45 branches; one unreachable path does not establish general equivalence. Probe
46 the nearest unusual legal history before accepting an unreachability claim.
47 Treat earlier guesses as hints. Assert the distinguishing premise, then run
48 the same focused probe on both revisions. A confirming probe for a test gap
49 passes on the unchanged baseline and fails on the mutant at the intended
50 assertion. If the contract instead predicts the mutant's result, record
51 baseline RED and mutant GREEN, then investigate a product bug rather than
52 calling it a test gap. Remove any temporary in-repository probe and show
53 clean git status in its checkout.
544. **Repair the oracle chain, when authorized.** Locate the missing law, model
55 rule, history action, production path, recorder, or assertion. Extend the
56 primary owner where it can express the distinction. Show that the extension
57 rejects the motivating mutant and a nearby plausible wrong design without
58 rejecting a legal alternative. For a bug on the baseline, demonstrate the
59 production RED before its repair. Update the coverage map when the owner's
60 reach or limits change. For a claimed oracle repair, follow
61 [ORC-012](../oracle-rubric.md#orc-012-review-evidence): at closeout,
62 verdict-critical evidence outside the executable oracle belongs in a
63 versioned review record tied to the exact reviewed head. This card also asks
64 the record to name the executable revision of every campaign, witness, and
65 review-fix run behind its claims.
66
67**Return:** each chosen mutant's pinned revision, exact edit, observed run
68outcome using [ORC-006's categories](../oracle-rubric.md#orc-006-checker-calibration),
69public distinction or scoped equivalence argument, and disposition: oracle gap,
70product bug, permitted difference, equivalence at a stated grade, or unresolved.
71Keep raw run logs and result tables task-local unless the task explicitly asks
72to publish them; this does not replace ORC-012's review record when an oracle is
73repaired. Permitted difference is a survivor disposition, not a seventh run
74outcome.
75
76**Control:** public observations such as Collection reads, events, transaction
77states, or query results decide product claims. Check that the probe reaches
78the path and premise it names. A green suite does not prove equivalence; a
79surviving mutant does not automatically prove a gap. Use a positive control
80when instrumentation reports that a branch was never reached. Recheck types
81after a commit hook or other tool rewrites code.
82
83**Distortion:** mutants chosen to satisfy existing tests, syntax failures
84counted as semantic kills, private-state differences treated as product bugs,
85an oracle extension that accepts the motivating mutant at the relevant cut, a
86negative witness that accepts any failure, or equivalence checked in one build
87mode while another mode can observe the change.
88
89**Stop when:** each selected mutant has an executed distinction, a contract-cited
90permitted difference, a revision-scoped equivalence argument, or an explicit
91unresolved experiment. Do not infer broad coverage from a kill count.
92
93The collection-state hunts that inspired this card used larger campaigns.
94Their candidate counts and archival format are examples, not requirements.