Skip to content

fix(drill): the stale-decision mutant changes behaviour instead of crashing - #94

Merged
alexeybe1kin merged 1 commit into
mainfrom
fix/mutation-stale-read
Nov 13, 2026
Merged

alexeybe1kin merged 1 commit into
mainfrom
fix/mutation-stale-read

Conversation

@alexeybe1kin

Copy link
Copy Markdown
Collaborator

Hunt finding toolgate-5 F1 (re-verified on main, mutation_check.py:96): the "stale decision overwrites consumption" mutant's replacement called get("request", ...) inside toolgate/core/approvals.py, which imports only _conn, _now, _row. The mutant raised NameError, the test failed for that reason, and the drill printed "Caught". It proved nothing about test_late_decision_cannot_restore_a_consumed_token.

Change:

  • The mutant now does a real stale read: it reads the request row in a separate connection, outside the BEGIN IMMEDIATE write transaction, then decides on it.
  • The drill reports BROKEN MUTANT and fails when a mutant's test output contains NameError, ImportError, SyntaxError or IndentationError, so a crash can no longer pass as a catch.

Evidence: the full drill ran locally, exit 0. "Caught: stale decision overwrites consumption" now comes from the behaviour, and no mutant is reported broken. Two tests in test_mutation_check.py (a crashing mutant is reported broken; the stale mutant reads the row itself) fail on main and pass here. Ruff ok.

…ashing

Its replacement called control_plane.get from approvals.py, which does not import it, so the
test failed on NameError and the drill printed "Caught" without proving that a stale read is
detected (toolgate-5 F1). The mutant now reads the row outside the write transaction, and the
drill fails as BROKEN MUTANT whenever a mutant's run shows NameError, ImportError or SyntaxError.
@alexeybe1kin
alexeybe1kin merged commit 7b5f98c into main Nov 13, 2026
4 checks passed
@alexeybe1kin
alexeybe1kin deleted the fix/mutation-stale-read branch November 13, 2026 09:21
Sign up for free to 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.

1 participant