Skip to content

feat(certification): mutation survivors carry the edit that produced them - #326

Merged
IanFrelinger merged 2 commits into
masterfrom
feat/mutation-survivor-detail
Aug 16, 2026
Merged

feat(certification): mutation survivors carry the edit that produced them#326
IanFrelinger merged 2 commits into
masterfrom
feat/mutation-survivor-detail

Conversation

@IanFrelinger

Copy link
Copy Markdown
Owner

Follows #325. The gate reported a surviving mutant by id alone — mutate-int-literal-41 — which names an operator and a line and nothing else. That locates a survivor; it does not let you judge one.

The two causes of escape_rate > 0 need opposite responses. A weak witness wants more cases. An equivalent mutant — a rewrite that cannot change behaviour on any input — wants none, because no case can kill it and the candidate may be perfectly correct. Ledger S5 hit the second twice on semver-parse across two campaigns, and telling the cases apart meant decoding the recorded candidate by hand both times.

Change

Every AstMutation now carries a MutationSite (line, column, original text, mutated text, trimmed source line). BrickMutationEngine threads the survivors' sites onto MutationTestResult.Survivors, and CertificationGate spells them out in the rejection reason:

Mutation escape check failed: escape_rate=0.04, survivors=[mutate-int-literal-41]; mutate-int-literal-41 (line 41, col 13): 0 -> 2 in: if (version.Length > 0)

That line is all the adjudication needed for both S5 cases.

What does not change

  • The verdict. Equivalence is undecidable, so EscapeRate > 0 still rejects and a human adjudicates. This is deliberately a reporting change only — a threshold that admits an equivalent mutant admits a real escape of the same rate.
  • Mutant ids keep their exact {kind}-{line} format, so anything keying on them is untouched.
  • The repair channel.RepairFeedback still renders survivors as locations only, gated by IncludeMutantLocations. Whether the proposer should see the mutant diff is a separate policy question (it is data about the candidate's own text, never the witness — but that decision is worth its own PR and measurement).

Tests

  • AstMutationEngineTests.CollectMutations_CarriesTheEditThatProducedEachMutant — the S5 shape: asserts the int-literal mutant reports 0 -> 2 on if (version.Length > 0) and that the id still encodes the site's line.
  • AstMutationEngineTests.MutationSurvivor_Describe_NamesLocationAndEdit.
  • Existing gate-teeth, generation-safety, repair-feedback and damage-resolver dogfood suites: 33/33 locally; Nexo.Kernel.sln builds clean.

…them
A surviving mutant was reported by id alone - 'mutate-int-literal-41' - which
names an operator and a line and nothing else. That is enough to locate a survivor
and not enough to judge it. The two causes of escape_rate > 0 need opposite
responses: a weak witness wants more cases; an EQUIVALENT MUTANT (a rewrite that
cannot change behaviour on any input) wants none, because no case can kill it and
the candidate may be perfectly correct. Ledger S5 hit the second twice on
semver-parse across two campaigns, and telling the cases apart meant decoding the
recorded candidate by hand both times.
Every AstMutation now carries a MutationSite: line, column, the original text, the
mutated text, and the trimmed source line. BrickMutationEngine threads the sites of
the survivors onto MutationTestResult.Survivors, and CertificationGate spells them
out in the rejection reason:
... survivors=[mutate-int-literal-41]; mutate-int-literal-41 (line 41, col 13):
0 -> 2 in: if (version.Length > 0)
The verdict is deliberately unchanged. Equivalence is undecidable, so the gate still
rejects on EscapeRate > 0 and a human adjudicates; this makes that adjudication a
glance instead of an investigation. Mutant ids keep their exact format, so nothing
that keys on them moves.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cursor

cursorBot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@IanFrelinger
IanFrelinger merged commit 8acdc22 into masterAug 16, 2026
7 checks passed
@IanFrelinger
IanFrelinger deleted the feat/mutation-survivor-detail branch August 16, 2026 23:36
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@IanFrelinger@PlzTouchGrass