Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

docs(test-audit): lane C retirement, deletion and mutation evidence

garrytan679c3638cb3b
diff --git a/docs/test-audit/2026-10-04/implementation/lane-c.md b/docs/test-audit/2026-10-04/implementation/lane-c.md
new file mode 100644
index 0000000000..3bb84a6951
--- /dev/null
+++ b/docs/test-audit/2026-10-04/implementation/lane-c.md
@@ -0,0 +1,82 @@
+# Lane C: claimed coverage made real, evals, dead code (GBRA-47 W6 + W7)
+
+Evidence for every test retirement (docs/TESTING.md "Retiring a test"), every
+deletion, and the discriminating mutation of every new regression test or
+guard in lane C. Probe edits were reverted after each run.
+
+## Retirements and deletions
+
+| Deleted / changed | Evidence case | Probe edit or reachability proof | Result | Surviving owner | Owner result |
+|---|---|---|---|---|---|
+| `test/eval-contradictions-fixture-redact.test.ts` with `src/core/eval-contradictions/fixture-redact.ts` and `scripts/build-contradictions-fixture.ts` | Intentionally abandoned contract | `git grep eval-contradictions/fixture-redact`: only the script (deleted with it), the orphan guard's permitted row and the test. The fixture it built (`test/fixtures/contradictions-eval-gold.jsonl`) was never committed; the script no longer typechecked. No docs, skills or `--help` promise it. | no runtime caller | none needed | n/a |
+| `scripts/check-exports-count.sh` (guard) | Retained contract, stronger owner | `package.json`: remove the `./pglite-lock` export | guard rc=1 | `test/public-exports.test.ts` (exact `EXPECTED_EXPORTS` match, catches additions and renames too) | fails 4 of 52 |
+| `scripts/check-pagetype-exhaustive.sh` (guard) | Vacuous | `PageType` is `string` since v0.38 (`src/core/types.ts`), so an exhaustive switch over it cannot exist; 0 `switch (x.type)` sites among `PageType` importers | guard could never fail | n/a (TypeScript narrowing on closed unions is the remaining tool) | n/a |
+| `src/core/chunkers/semantic.ts`, `chunkers/llm.ts`, `search/keyword.ts`, `search/vector.ts` | Intentionally abandoned (hard orphans) | no importer in src/, test/, scripts/, evals/; not in package.json `exports` (28 subpaths; search exports are hybrid, expansion, evidence-delivery); no hit in `test/fixtures/goldens/` (export-surface golden), `recipes/` or `templates/` | orphan guard now 0 allowlisted | `search/hybrid` owns keyword and vector retrieval | n/a |
+| `src/core/postgres-engine/forward-reference-bootstrap.ts` (facade) | Retained contract, import repointed | one importer, `test/e2e/postgres-bootstrap.test.ts`, now imports `src/core/engine-sql/bootstrap.ts` | n/a | `test/e2e/postgres-bootstrap.test.ts` | 13/13 pass against pgvector |
+| `_resetJsonGuardForTests`, `_resetLockBusyLogCacheForTest` | Dead seams | `git grep -w`: definitions only | n/a | n/a | n/a |
+| `scripts/fix-v0.11.0.sh`, `spike-bun-vm-timeout.ts`, `smoke-test-mcp.ts`, `bench-grandfather-5530.ts` | Finished one-offs | references: a ledger string literal in two tests (fixture data, kept), the redos-guard header (rewritten to current behavior), the refactor-wave-1 checklist (dated design record) | n/a | `test/redos-hardening.test.ts` pins that node:vm is gone | pass |
+| `evals/skillopt-judge`, `evals/skillopt-reflect` | Abandoned (E2) | no reader in src/, test/, scripts/, CI; both failed every fixture (no gateway) | n/a | n/a | n/a |
+| `evals/embedding-provider-eval.json` | Privacy (E4, D-11: no history rewrite) | zero readers; it named a real person | `check-fixture-privacy` failed on it once evals/ entered its scope | `check-fixture-privacy.sh` (evals/ + docs/test-audit/) | passes after deletion |
+| `test/benchmark-search-quality.ts` | Broken, owned elsewhere (E5) | hard-coded 1536-d vectors; exits 100 on the 1024-d default | n/a | BrainBench CI gate (`scripts/ci-brainbench-gate.sh`) | n/a |
+| `test/fixtures/brainstorm-eval.jsonl`; `setLiteral`, `doctorSourceFiles`, `normalizeSqlText` | Unreferenced | `git grep -w`: definitions only / no reader | n/a | n/a | n/a |
+| `.gbrain-evals/eval-results.jsonl` | D-7 | gitignored and `git rm --cached`; the `--record` modes keep appending locally | n/a | n/a | n/a |
+
+## New tests and guards: discriminating mutations
+
+| Test / guard | Probe edit | Observed failure |
+|---|---|---|
+| `scripts/check-test-env-opt-ins.ts` (D7) | run on the pre-rename tree | 12 dead gates named: the compile smoke, 6x `GBRAIN_SKIP_SUBPROCESS_TESTS`, `GBRAIN_SKIP_LAUNCHD_E2E`, `GBRAIN_REQUIRE_LAUNCHD`, `GBRAIN_REQUIRE_COMPILE`, `GBRAIN_BASH32_REQUIRE`, `GBRAIN_ENFORCE_E5_BUDGET` |
+| `test/operator-env-preload.test.ts` › "renamed test opt-in ... stops the run" | delete the RENAMED loop in the preload | exit 0 instead of 2, no rename line |
+| `test/scripts/check-bash32.test.ts` › "refuses the pre-rename GBRAIN_BASH32_REQUIRE" | delete the old-name check in `check-bash32.sh` | exit 0 instead of 2 |
+| compile smoke (`binary-self-update-compiled.serial`) | was gated off | now 1 pass (0.6s) instead of 0 pass 1 skip |
+| `check-bash32.test.ts` real-parser cases | `GBRAIN_TEST_BASH32_REQUIRE=1` | 3 cases execute (were skipped under the stripped old name) |
+| `bun run test:agent-voice` (D10) | add `'put_page'` to `READ_ONLY_OPS` in `recipes/agent-voice/code/tools.mjs` | 3 failures in `tools-allowlist.test.mjs` |
+| `check:jsonb-params` over the real tree (F1) | append an `executeRaw('... $1::jsonb', [JSON.stringify(x)])` to `src/core/sql-query.ts` | rc=1 naming `src/core/sql-query.ts:159` |
+| `check:image-decoders` (F2) | `avif_dec.wasm` -> `avif_dec_missing.wasm` in the smoketest import | rc=1 with the bun build error and Why/Fix (was a silent rc=1) |
+| `check-skill-refs` stale allowlist (F10) | allowlist a clean file | `[stale-allowlist]` failure; the real tree's `skills/setup/SKILL.md` entry was stale |
+| guard self-test fixtures (F9): fixture-privacy (bad, bad-evals, bad-test-audit), no-pii-in-agent-voice (bad, bad-path), skill-brain-first, batch-audit-site, gateway-routed (bad, bad-import), source-scope-onboard, trailing-newline | each bad tree | each guard exits non-zero; good trees pass; self-test 31 guards in 15s |
+| scripts/ in typecheck (F3) | the tree before the fixes | 9 errors in 4 scripts |
+| `test/docs-repo-paths.test.ts` (T7.3) | append a `scripts/check-exports-count.sh` reference to CONTRIBUTING.md | "CONTRIBUTING.md:621 names scripts/check-exports-count.sh, which does not exist" |
+| `scripts/bench-graph-quality.ts` (V-10) | the pre-rewrite benchmark | 4 thresholds failed (link recall 0.500, precision 0.682, type accuracy 0.600, relational recall 0.400) on stale ground truth; after the rewrite all pass |
+
+## Evals sub-lane (E1, E3, E8, E10)
+
+| Test | Probe edit | Observed failure |
+|---|---|---|
+| eval-takes-bootstrap-harness › "classified and written" | `run-case.ts`: drop the `.md` write | `the extractor skipped the page (mirror_unavailable)` |
+| same | `corpus.jsonl`: first case type -> `person` | `selected 0 pages; the case page must be the only eligible one` |
+| eval-takes-bootstrap › "replay --max N" | `harness.mjs`: score against the full corpus | expected 0, received 1 |
+| eval-takes-bootstrap › "per-variant and per-archetype" | `scorer.ts`: `v.pass = v.matched === v.expected` | fails |
+| eval-run-all-outcome › "failed brainbench ... exit 1" | `eval-run-all.ts`: `return 0` | expected 1, received 0 |
+| eval-run-all › "explicit --suites ... eval_suite_unwired" | remove `if (unwired) throw unwired` | expected 1, received 0 |
+| takes-quality runner.serial › "unpriced ... without a cap warns and runs" | always throw for unpriced models | fails |
+| runner.serial › "canonically priced ... under a cap"; pricing › "every canonically priced model"; model-pricing drift guard | canonical lookup only for the old 6 ids | all three fail |
+| boundaries › "--budget-usd with unknown model -> no_pricing"; runner.serial › "unpriced ... under a user cap refuses" | remove the under-cap refusal | both fail |
+
+| Changed test | Case | Surviving owner | Owner result under the probe |
+|---|---|---|---|
+| pricing › "retired gemini-1.5-pro is no longer in the allowlist" | Abandoned (E10: every canonically priced model is gateable) | pricing › "every canonically priced model is budget-gateable" | passes |
+| pricing › "throws PricingNotFoundError on unknown"; estimateCost "throws on unknown" | Retained contract moved to the runner (refuse under a cap) | boundaries › "--budget-usd with unknown model -> no_pricing"; runner.serial › "unpriced ... under a user cap refuses" | both fail when the refusal is removed |
+| pricing › "error message names the model AND points to the file" | Abandoned (pointed at the deleted allowlist) | pricing › "no_pricing refusal whose fix registers the rate" | n/a |
+| pricing › "MODEL_PRICING table: finite positive rates" | Vacuous (table deleted) | `model-pricing.test.ts` › "every entry has finite positive rates" | n/a |
+
+## Takes-bootstrap graduation run (D-6)
+
+2026-10-04, `anthropic:claude-haiku-4-5`, all 123 variants of 41 archetypes,
+estimate $0.23 under a hard $1 cap, actual $0.0935. Verdict: **not
+graduated**; the autopilot tier stays `manual_only`.
+
+| Kind | Expected / matched | Predicted / precise | Precision | Recall |
+|---|---|---|---|---|
+| fact | 42 / 32 | 70 / 50 | 0.714 | 0.762 |
+| take | 33 / 32 | 47 / 42 | 0.894 | 0.970 |
+| bet | 24 / 18 | 33 / 18 | 0.545 | 0.750 |
+| hunch | 18 / 12 | 16 / 12 | 0.750 | 0.667 |
+
+75 of 123 variants pass; overall precision 0.735, recall 0.803; 0 malformed;
+3 forbid violations (press claims attributed to the page holder). Misses
+split between classifier defects (bio facts, quotes and panel attributions
+return no claims; press attribution leaks; one strong take typed as a bet)
+and incomplete archetype labels (valid unlabeled claims count as imprecise).
+Next: complete the labels per archetype, then fix bio-fact recall and
+press-claim attribution, then rerun.