Skip to content

Testing-2: the mutation sweep audits the scenarios (instrument, status classes, four audit findings) #70

Closed

Description

@abogartz

Part of #68. Reframed: the sweep is the auditor of the scenario suite, not a score to maximise.
The earlier framing ("grow to ~80 mutants") got the order wrong. #69's scenarios are the net; the
sweep exists to answer one question about them — does anything die when the invariant dies? —
which is the question the suite could not answer for #60 and the reason this epic exists.

Scope

  1. Commit scripts/test-sweep.ts (prototype in the working tree) as a developer-facing auditor:
    worktree-isolated, fails if the baseline suite is not green first, --validate requires each
    mutation to apply to exactly one site. Add sweep:test to package.json.
  2. One mutant per scenario, mirroring its invariant — not a generic operator sweep. Each scenario
    in Testing-1: acceptance scenario suite for the destructive seams — red on the pre-fix commit, green on main #69 names the guarantee it exists for; the mutant breaks exactly that guarantee. If the
    scenario does not kill it, the scenario is fiction and goes back to Testing-1: acceptance scenario suite for the destructive seams — red on the pre-fix commit, green on main #69.
  3. Mutant status classification. The sweep currently counts any non-zero bun test exit as
    killed, so a mutant that merely breaks module loading "passes" with no test responsible. Report
    Killed / Survived / Timeout / RuntimeError / CompileError, and treat CompileError as
    informational. This is the instrument's weakest point today.
  4. equivalent: true support and a canonical score that excludes equivalents from the
    denominator: today's honest number is 21/23 = 91.3%, not 87.5%, because
    restore-escapes-root is an unreachable branch, not a gap.

Carried over from the original #69 — the four findings the audit produced

These stay real work; they were always audit outputs, so they belong with the auditor:

  • publish-truncate survived. The reader-side atomicity test pins nothing: the truncate mutant
    produced 10 partial reads at 0.09 MB, 0 at 0.59 MB, 1 at 2.39 MB — racing cannot detect this.
    Deterministic discriminator, verified: publish to a target chmod 0444; a same-directory rename
    succeeds (the directory's write bit decides), a truncate-open fails EACCES and writes nothing.
  • viewer-snapshot-grammar-off survived — a gate-bypass path with no test. Plant evil.logfmt
    inside snapshots/: with the name grammar gone, restore publishes it into the store root where it
    matches *.logfmt and becomes injectable memory having passed no write gate. Also fix the
    existing containment test, which passes for the wrong reason: basename() yields a name that
    does not exist, and error() defaults to status = 400, so it cannot tell "guard rejected" from
    "file not found". Assert the rejection reason.
  • restore-escapes-root is a dead branch. Probed "..", "1-..", "../..": all die earlier
    at "snapshot not found". Keep the check, mark the mutant equivalent, and make containment
    testable honestly by extracting a pure resolveStoreTarget(root, name) with a hostile-name table
    (.., ../x, /etc/passwd, a/../../b, 1-../.., plus a legal 17-2026-10-23.logfmt).
  • snapshot-overwrite killed 2/3 runs — it only dies on a same-millisecond collision. Make it
    deterministic (drive claimSnapshot twice against a pre-claimed name) or classify it equivalent.
    A score that changes between runs is worse than an honest gap.

Explicitly dropped

The ~80-mutant ambition, and mutating areas that have no scenario or claimed invariant behind them.
A mutant nobody would have thought to write is a story about my imagination, not about the suite.

Acceptance

Activity

  1. added
    test-integrity
    on Oct 23, 2026
  2. changed the title [-]Testing-2: widen the mutant set from 24 to ~80 across the claimed contract[/-] [+]Testing-2: the mutation sweep audits the scenarios (instrument, status classes, four audit findings)[/+] on Oct 24, 2026
  3. WhollyMindless commented on Oct 25, 2026

    @WhollyMindless
    Contributor

    Claiming the sweep-instrument half of this (the scenarios it audits already landed via your #86).

    Heads-up so nobody doubles the work: scripts/test-sweep.ts arrived quietly in 6d1858b — noticed it while finishing my own version, and rather than fork the idea, my PR now upgrades that file in place, keeping its mutant ids and runner shape:

    • baseline subtraction — the shipped sweep aborts unless the clean suite is 100% green, which is every Windows machine right now (torn-read + resolver families are known-red); measure the known-red set once, count only DELTA failures as kills
    • the two catalogs merge into one 43-mutant list (the shipped 24 + the 26 I had: 5 exact-duplicate breaks deduped, 3 shared-id sites consolidated, and lock-default-fail split into two uniquely-anchored mutants because the queue path duplicated the timeout policy and made its single anchor ambiguous)
    • status classes + confirm-runs per Epic: Test integrity — every claimed invariant pinned by a test that dies without it #68 (a kill resting only on timing-sensitive evidence gets confirmed to 3 runs or reported as unstable, not credited), a calibration plant (--selftest), and an equivalent-audit that warns when an equivalent-marked mutant dies — it already caught a wrong entry in my own catalog (the Testing-2: the mutation sweep audits the scenarios (instrument, status classes, four audit findings) #70 finding-3 "dead branch" is killed by undo.test.ts; the mark is gone)

    Status table from a full 42-mutant run on current main goes in with the PR, shortly. The remaining unpinned list is the deliverable; the score is a byproduct.

  4. added 5 commits that reference this issue on Oct 26, 2026
  5. added 3 commits that reference this issue on Oct 26, 2026
  6. abogartz-opencode-self-improvement commented on Oct 26, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.14.4 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  7. added 2 commits that reference this issue on Oct 26, 2026
  8. added 2 commits that reference this issue on Oct 26, 2026
  9. abogartz-opencode-self-improvement commented on Oct 26, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.14.7 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  10. abogartz commented on Oct 27, 2026

    @abogartz
    OwnerAuthor

    Closed as completed — the instrument shipped (and the released label already said so).

    scripts/test-sweep.ts is committed with sweep:test in package.json, covering the issue's scope: worktree isolation, baseline-green gating (--baseline, --allow-baseline-failures), status classification beyond "non-zero exit" (CompileError / RuntimeError / Timeout handled distinctly from kills), equivalent support with the canonical denominator, and --confirm reruns for flaky-only kills. The per-scenario mutant list is living work tracked under #68, not this instrument issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    releasedtest-integrity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions