Repository navigation
test: kill the mutations that survived a green suite - #192
Merged
Merged
Conversation
fdaviddpt
pushed a commit
that referenced
this pull request
Jul 26, 2026
Review of #192. Only referenced inside a monkeypatch target string. Co-Authored-By: Max <noreply>
fdaviddpt
pushed a commit
that referenced
this pull request
Jul 26, 2026
Review of #192. Only referenced inside a monkeypatch target string. Co-Authored-By: Max <noreply>
fdaviddpt
force-pushed
the
max/kill-mutants-175
branch
from
July 26, 2026 22:33
098a6a7 to
41fa913
Compare
#175. Eight changes to the code passed 695 tests. A surviving mutant is a line the tests do not depend on — it could be wrong and nothing would say so. Each test here was written against its mutant: applied by hand, confirmed to fail, reverted. A test that does not fail against the change it describes is decoration. LRU eviction (HIGH). test_a_session_that_keeps_saving_is_not_evicted made exactly _POSITION_SLOTS saves, so the eviction loop never ran and deleting `sessions.pop(...)` passed. Overflowing the store is not enough either — the active session is re-saved last on every round, so it is present at the end whichever way the code behaves. What separates them is a burst of OTHER sessions after its last save: re-inserted it survives, keyed on first insertion it is the oldest thing there and is evicted, then resumes from 0 and re-summarizes its whole span, which is #140. TZ="" fallback (MEDIUM). The regression test compared UTC against America/Los_Angeles, which share a calendar date most of the day, so removing the `[ -n "$REMEMBER_TZ" ]` guard — the literal historical bug — passed outside roughly 17:00–24:00 PT. It now picks Pacific/Kiritimati (+14) or Pacific/Niue (-11) by the current UTC hour, so the two dates always differ, and asserts the premise before relying on it. HOME vs expanduser (MEDIUM). On POSIX expanduser reads $HOME, so swapping the order is unobservable on any platform CI runs. Mocking them apart is the only way to assert which wins; the ordering exists for Windows, where expanduser prefers USERPROFILE and would ignore a fixture that sets only HOME. The lower-severity four, in tests/test_mutation_survivors.py: the `is_skip` half of the consolidation guard (removable because every SKIP in the fixtures also failed the shape check); `split("===ARCHIVE===", 1)`'s maxsplit (memory is prose, and prose about this pipeline quotes its own delimiters); `>` vs `>=` at the prompt-size cap; and `sorted(staging_contents.items())` (fixtures had one file each, so a consolidation could narrate days in glob order). Truncation direction, listed as a HIGH survivor, is already dead — a test landed after the issue was written. Verified by flipping `raw[-max:]` to `raw[:max]` rather than assuming. Full suite 792 passed, 41 skipped. Co-Authored-By: Max <noreply>
The clock-independent zone pair assumed `date` honours IANA zone names. Git Bash on the Windows runners ships no tzdata, so every TZ= resolves to UTC, the two dates coincide, and the premise assertion fired — blaming the code for the platform's missing data. Detected and skipped with the reason instead. Caught by CI on windows-latest across all four Python versions; the fix was verified against the local suite, which is POSIX and never saw it. Co-Authored-By: Max <noreply>
Review of #192. Only referenced inside a monkeypatch target string. Co-Authored-By: Max <noreply>
fdaviddpt
force-pushed
the
max/kill-mutants-175
branch
from
July 26, 2026 22:54
41fa913 to
2ef231e
Compare
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.
Closes #175.
Eight changes to the code passed 695 tests. A surviving mutant is a line the tests do not depend on — it could be wrong and nothing would say so.
Every test here was written against its mutant: applied by hand, confirmed to make the test fail, reverted. A test that does not fail against the change it describes is decoration.
The two high-severity ones
LRU eviction.
test_a_session_that_keeps_saving_is_not_evictedmade exactly_POSITION_SLOTSsaves, so the eviction loop never ran and deletingsessions.pop(...)— the line the test exists for — passed.Overflowing the store turned out not to be enough either: the active session is re-saved last on every round, so it is present at the end whichever way the code behaves. I only found that by simulating both variants side by side. What actually separates them is a burst of other sessions after its last save — re-inserted it survives; keyed on first insertion it is the oldest thing in the store, gets evicted, resumes from 0, and re-summarizes its whole span. That is #140, reintroduced silently.
The
TZ=""fallback. The regression test compared UTC againstAmerica/Los_Angeles, which share a calendar date for most of the day — so removing the[ -n "$REMEMBER_TZ" ]guard, the literal historical bug, passed outside roughly 17:00–24:00 PT. It now picksPacific/Kiritimati(+14) orPacific/Niue(−11) based on the current UTC hour, so the two dates always differ, and it asserts that premise before relying on it.The rest
expanduser— on POSIXexpanduserreads$HOME, so swapping the order is unobservable anywhere CI runs. Mocking them apart is the only way to assert which wins. The ordering exists for Windows, whereexpanduserprefersUSERPROFILEand would ignore a fixture that sets onlyHOME.is_skiphalf of the consolidation guard — removable because every SKIP in the fixtures also failed the shape check. A response that says SKIP and carries a header would have been written into memory.split("===ARCHIVE===", 1)— memory is prose the model wrote, and prose about this pipeline quotes its own delimiters. Without the maxsplit, an archive that mentions===ARCHIVE===is cut at the mention.>vs>=at the prompt-size cap — a prompt of exactly the configured size was never exercised.sorted(staging_contents.items())— fixtures had one file each, so a consolidation could narrate days in whatever order the glob returned._POSITION_SLOTS— the existing assertion imports the constant it checks, so it holds for any value. The number is now pinned.One that was already dead
Truncation direction (
raw[-max:]vsraw[:max]) is listed as a HIGH survivor, but a test covering it landed after the issue was written. Verified by applying the flip rather than assuming —test_build_prompt_caps_oversized_extractfails. No change needed.Full suite: 792 passed, 41 skipped.