Skip to content

Audit the test suite itself — 33,296 lines of bash that has certified its own defects at least six times #502

Description

@BaseInfinity

Requested 2026-08-07. Note: a CI/CD audit already exists as #491 — this is
deliberately the other half. #491 asks whether the pipeline can see defects; this
asks whether the tests can, independent of how they are invoked.

Scale

Suites 65
Total lines of bash 33,296
Largest test-hooks.sh 3,359 · test-doc-consistency.sh 3,036 · test-workflow-triggers.sh 2,510 · test-self-update.sh 2,306

There is no unit/integration layering here — it is 33k lines of assertions guarding a
repo with no application code. That is a large enough surface to deserve its own
audit, and it has never had one.

Why now — six recorded cases where the suite certified a defect

Every one of these is from this repo's own history, not hypothetical:

  1. Two "0 failing" reports from suites that ran zero tests. timeout(1) does not
    exist on macOS, so the runner exited before executing anything and reported success.
  2. Assertions inert on Linux, green on macOS (Portable-grep audit: \` is a GNU anchor, a BSD literal — assertions can be inert on Linux while green on macOS #488). \` is a literal
    backtick to BSD grep and a start-of-buffer anchor to GNU grep, so a required-token
    check matched nothing in CI while passing locally. The suite reported 104/104.
  3. A hand-listed hook roster that silently stopped covering a hook
    test-hook-stdin-bounded.sh omitted model-effort-check.sh, which is precisely
    why the v1.94.0 stdin-hang regression shipped through the release built to fix it.
  4. Three vacuous version-marker guards, each proven hollow by review and pulled
    from v1.94.0 (Version-marker guard: three markers sat at v1.90.0 for three releases, and three attempts at a guard were each proven vacuous #493). One returned success when its extraction step was missing, so
    8 of 9 extractors were unchecked.
  5. Three detector regressions in PR fix(hooks,docs): three shipped defects, and five rounds of fixing the tests meant to catch them #497, in three consecutive rounds, each caught
    only by adversarial reviewer probing — never by CI. Two were false positives that
    blocked honest prose.
  6. A line-pinned assertion (sed -n '113p') that broke when an unrelated edit
    five lines earlier shifted the file. It asserted a line number, not a property.

The pattern is consistent: the suite is good at checking that text exists and bad at
checking that a guarantee holds.
Six times it has reported green over a live defect.

What the audit should actually ask

  • Which assertions are vacuous today? Mechanical first pass: mutate the thing each
    test claims to protect and confirm the test goes red. Any test that cannot be made to
    fail is not a test. This is the single highest-value pass and it is scriptable.
  • Which assertions are pinned to positions rather than properties? Line numbers,
    fixed offsets, exact counts that drift.
  • Which are portability traps? Portable-grep audit: \` is a GNU anchor, a BSD literal — assertions can be inert on Linux while green on macOS #488 was one instance; the audit should sweep for
    the class (BSD vs GNU grep/sed/date/stat, bash 3.2 on macOS, absent timeout).
  • Which fixtures can corrupt the real tree? At least one suite mutates cwd when
    its tmpdir creation fails under sandbox — a test that damages the repo it is testing.
  • What is untested? 33k lines of assertions is not the same as coverage. Name the
    guarantees this repo makes that nothing checks.
  • What should be deleted? Some of this is duplicative (Replace 2,443 lines of hand-rolled doc guards with declarative consistency checking #485 measures six functions
    asserting one fact). A smaller suite that fails honestly beats a larger one that does not.

Suggested method

Run it as a parallel blind dual review (Fable + Codex, neither seeing the other's
findings), which is the protocol that produced findings 3, 5 and 6 above. Feed each a
slice of the suite rather than the whole 33k lines. Prioritise by blast radius: suites
guarding hooks/ and skills/ first, since those ship.

Do not accept "the suite passes" as evidence during this audit. That is the exact
claim under investigation.

Refs #491 (CI/CD half), #488 (portability class), #493 (vacuous guards), #498
(detector fixtures), #485 (duplication).

Metadata

Metadata

Assignees

No one assigned

    Labels

    impact:repo-onlyOutside package.json files (npm pack --dry-run) — reaches only us

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions