Skip to content

Testing-3: triage the 231 tests that pin nothing — strengthen or delete #71

Closed

Description

@abogartz

Part of #68. Blocked on #69 and #70 — the current mutant set reaches 17 of 28 test files, so a
"this test killed nothing" verdict is meaningless for the other 11 until #70 mirrors mutants against
#69's scenarios. A unit test whose claim is now covered by a scenario is also a delete candidate —
the scenario is the better witness. Triage deliberately last: with a narrow net it is far too easy to delete the only witness to
a real path.

The queue, as measured on main @ 4643ec4 (24 mutants, --repeat=3)

57 of 288 tests killed at least one mutation. Per file (killers = distinct tests in that file that
killed ≥1 mutant):

file tests expects weak asserts killers
boundaries.test.ts 14 30 0 3
capture.test.ts 17 64 0 1
command.test.ts 3 4 1 0
compaction.test.ts 10 29 1 0
concurrency.test.ts 7 21 1 6
convergence.test.ts 10 40 4 0
epoch.test.ts 10 36 1 0
frontier.test.ts 11 29 0 5
gated-injection.test.ts 10 32 1 4
init.test.ts 6 23 0 1
inject.test.ts 7 11 0 1
injection-framing.test.ts 13 35 0 1
lock.test.ts 8 19 0 6
logfmt.test.ts 9 25 0 0
path-refs.test.ts 15 20 1 1
plugin.test.ts 4 16 1 0
portable.test.ts 15 74 0 3
realrepo.test.ts 5 17 1 0
recall-dataset.test.ts 6 10 0 0
repo-scope-session.test.ts 8 18 0 1
repo-scope.test.ts 12 23 1 7
resolver.test.ts 3 11 0 0
scenarios.test.ts 12 109 4 6
status.test.ts 21 65 1 0
undo.test.ts 9 34 0 6
update-targeting.test.ts 10 53 2 0
viewer.test.ts 23 82 1 3
write-caps.test.ts 5 10 0 2

The 11 files with zero killers are mostly a statement about the mutant set, not about the tests —
e.g. logfmt.test.ts scores 0 exactly where publish-truncate survived, and status.test.ts
(21 tests) is the reporting area #70 has not mutated yet. That is the whole reason for this issue's
ordering.

Triage rule (apply per test, not per file)

Known weak spots to fix while there (all verified present)

  • test/concurrency.test.ts:89 expect(reads).toBeGreaterThan(0) — mine, and a tautology: reads
    counts loop iterations, so it is > 0 by construction regardless of what was observed. Assert the
    observation, not the loop.
  • test/scenarios.test.ts:464 expect(res.snapshot.length).toBeGreaterThan(0) — a path length, not
    content.
  • test/epoch.test.ts:147 expect(block.length).toBeGreaterThan(0); test/compaction.test.ts:202
    expect(anchor.length).toBeGreaterThan(0); test/plugin.test.ts:116
    expect(event.system.length).toBeGreaterThan(0) — existence where the contract is specific text.
  • test/status.test.ts:315 expect(s?.stats?.cumChars).toBeGreaterThan(0) — optional-chain plus
    magnitude: passes if the field is wrong, as long as it is nonzero.

Weak assertions are a small share of the suite (23 of ~921 expect( calls), so this is a cleanup
pass, not the substance. The substance is dependence.

Acceptance

Activity

  1. added
    test-integrity
    on Oct 23, 2026
  2. WhollyMindless commented on Oct 26, 2026

    @WhollyMindless
    Contributor

    Claiming, with the method stated up front so the 231 can be rebuilt from measurement rather than re-guessing.

    Plan: the #110 sweep already records which files died per mutant; the first step of this issue is teaching the instrument (one-line addition, post-#110-merge) to record the (file, test) pair instead. Then a test that appears in ZERO kill-sets across the catalog is a candidate here, and the issue's fork applies per candidate: name the invariant it would catch and give it a real kill (strengthen), or it goes (delete).

    Preview from the existing sweep table, file-granularity and honestly caveated: 23 of 43 test files kill at least one of the 43 catalog mutants; 20 never kill one — files like logfmt.test.ts and resolver.test.ts are on that list, which shows exactly why this is a triage and not a delete pass: their invariants simply aren't in the mutant catalog yet. The per-test matrix (and your 231 number reconciled against it) is the first artifact I'll post here.

    Dependency, stated so nobody waits on me by surprise: the matrix needs #110's instrument merged to run against — I'll start the moment it lands, and the triage itself will keep its diffs out of whatever #112/#113 touch to keep you unconflicted.

  3. WhollyMindless commented on Oct 26, 2026

    @WhollyMindless
    Contributor

    Fold-in note (from #124's approval): this PR will also carry a one-line comment fix at test/capture-sid-race.test.ts:183 as a drive-by. The control test's comment claims "NOTHING ever calls setCurrent" in that flow — false counterfactual: captureSession binds setCurrent itself (src/index.ts:1195) before any awaits, which is exactly why the unfixed control passes by coincidence. abogartz flagged it as a non-blocking nit on #124; the fix (commit be34470, branch fix/evidence-sid-threading on the fork) missed the merge by seconds when #124 landed at 45cadaa, so main still carries the old wording. Comment-only, no behavior change — folded here rather than a dedicated PR.

  4. added
    severity:medium
    on Oct 30, 2026
  5. abogartz commented on Oct 30, 2026

    @abogartz
    OwnerAuthor

    Severity triage 2026-10-30 — severity:medium, and unblocked (its stated blockers are closed)

    Board correction worth recording: this ticket's body says "Blocked on #69 and #70". Both are now CLOSED — scripts/test-sweep.ts is committed to main and wired as bun run sweep:test in package.json. Nothing blocks this anymore.

    Marked medium rather than high because it is a cleanup pass over test value, not a defect, and the body's own numbers support that (23 of ~921 expect( calls are weak-shaped — "this is a cleanup pass, not the substance"). But it stays above low because the state it describes is actively misleading: 231 of 288 tests never observed a broken invariant, and the file table will be re-read as evidence about the tests when it is mostly a statement about the mutant set.

    The four known weak spots in the body are still present and are the cheap, uncontroversial part — test/concurrency.test.ts:89 (expect(reads).toBeGreaterThan(0), a tautology on loop iterations), test/scenarios.test.ts:464, the toBeGreaterThan(0) existence-checks in epoch/compaction/plugin, and test/status.test.ts:315 (cumChars optional-chain-plus-magnitude).

    Given #70 is merged, the triage rule as written can now be applied honestly — and your caution about deleting the sole witness is the constraint that should govern the PR, one verdict per file.

  6. WhollyMindless commented on Oct 30, 2026

    @WhollyMindless
    Contributor

    Reaffirming our earlier claim now that the blockers are closed. Starting after #13 with the known weak assertions, then reconciling the current sweep evidence and recording per-file keep/strengthen/delete decisions. I will preserve sole witnesses, distinguish unmodeled invariants from ineffective tests, and report any remaining coverage explicitly rather than treating the old 231 count as current. Please redirect if another contributor has taken this on.

  7. WhollyMindless commented on Oct 30, 2026

    @WhollyMindless
    Contributor

    Queue update: #13 first, then #38 (quarantine), then this test-integrity pass. Our claim here remains active; recording the order so nobody expects the broad triage to land before the higher-priority quarantine work.

  8. WhollyMindless commented on Oct 31, 2026

    @WhollyMindless
    Contributor

    Tracking the non-blocking accounting follow-up from #190's approval review: the Windows ACL fixture explicitly logs [acl-fixture] {"event":"not-exercised","reason":"acl-deny-failed"} or "denial-not-effective", but its early return still counts as a Bun pass. A sweep/triage run should treat that fixture as a declared capability skip rather than crediting it as exercised.

    #195 already changes the sweep output parser and triage tooling, so #190 is staying focused on fixture diagnostics rather than introducing a competing parser change. This accounting item remains open; the logging alone does not fix it.

    Suggested acceptance for the parser follow-up: fixtures for each bailout reason plus a genuinely exercised ACL run; associate the marker with this test rather than unrelated concurrent test output; adjust pass/skip accounting without changing the total test count or subtracting an unrelated failed test. Preserve the raw runner counts separately if useful. No historical sweep score is being revised here.

  9. added a commit that references this issue on Oct 31, 2026
  10. abogartz-opencode-self-improvement commented on Oct 31, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.15.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

    releasedseverity:mediumtest-integrity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions