refactor(surface): delete five stranded module groups and their suites - #647
Conversation
0.145.3 tiered the root barrel to consumer-imported symbols and documented front doors. Twelve modules lost their last export path in that pass and kept their source files. Each one is unreachable from all 28 build entry points, so none has shipped in dist for three published versions, and the only importer each retains is its own test. Deleted with their tests: reviewer, analyst/knowledge-capture, multi-toolchain-layer, dual-agent-bench, workspace-inspector, golden-matcher, ui-finding, slo, adapters/langchain, judge-runner, cost-report, worker-driver-seed. The public export surface does not move: a build of the parent commit and a build of this commit both declare 3,447 export entries, and the two lists are identical. dist loses 753 bytes, all of it doc-comment text that named a deleted symbol. Four doc comments named a deleted symbol and now describe the surviving behaviour instead: multi-layer-verifier (twice), fuzz/types, contract/self-improve, plus the docs/feature-guide feature map. fuzz/explorer-cost asserts the ledger total directly rather than through the deleted cost-report projection. Evidence for the deletion: 106 canonical checkouts under ~/code, 98 after deduplicating by origin remote, each fetched and grepped at refs/remotes/origin/HEAD on word boundaries. 84 clean, 12 hits, 1 self, 0 unresolved failures. Eleven of the twelve hits define the name locally or import it from their own module. The twelfth, starter-foundry, imports runAssertions, WorkspaceAssertion and WorkspaceSnapshot from this package while declaring no dependency on it, and has been incompatible since 0.145.3 removed them from dist. Eleven published dependent tarballs at current latest were extracted and grepped with 0 extract failures; starter-foundry is the only hit.
Version locked across package.json, clients/python/pyproject.toml, clients/python/src/agent_eval_rpc/__init__.py and clients/python/uv.lock. The analyst dependency-lock digest is repinned because all four manifests it covers moved. The implementation digest does not move: the deletion touched no file in the analyst benchmark manifest.
Each module fails four checks: no exports-map entry, zero non-test src importers, zero external importers in tests/scripts/examples, zero fleet importers in agent-runtime. The knowledge test now imports the concrete modules because the two-line barrel is gone. Suite before: 374 files passed, 5278 tests, exit 0. Suite after: 369 files passed, 5222 tests, exit 0. tsc --noEmit: exit 0.
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — 7ec89628
This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
This approval is provisional. It rests on the audit running. If the audit cannot run — for example the CLI bridge rejects it — this approval is dismissed rather than left standing, so an unrun check never reads as a passing one.
tangletools · auto-approval · reason: drewstone_author · 2026-08-18T21:24:43Z
tangletools
left a comment
There was a problem hiding this comment.
🟡 Value Audit — sound-with-nits
| Verdict | sound-with-nits |
| Coverage | 2 of 2 lenses (value, usefulness) |
| Concerns | 2 (2 weak-concern) |
| Heuristic | 0.0s |
| Duplication | 0.0s |
| Interrogation | 267.9s (2 bridge agents) |
| Total | 267.9s |
💰 Value — sound-with-nits
Deletes five verifiably-stranded module groups (2,484 lines, no exports-map entry, zero src importers) with their suites; a clean dead-code subtraction in the grain of the repo's ongoing surface-debris campaign, leaving one stale doc behind.
- What it does: Commit 7ec8962 removes src/prm/* (5 files + src/prm/inference.test.ts + tests/prm.test.ts), src/registry.ts (ScenarioRegistry), src/auto-pr.ts, src/adapters/otel.ts, and the two-line src/knowledge/index.ts barrel, plus their suites (15 files, 2,484 lines). tests/knowledge-readiness.test.ts now imports the concrete knowledge/readiness and knowledge/types modules. The sibling version-bump commit (34
- Goals it achieves: Shrink maintenance surface by deleting code no consumer can reach: every group fails the exports map (verified: no ./prm, ./registry, ./auto-pr, ./adapters/otel, or ./knowledge entry in package.json), has zero non-test src importers (verified by grep on the pre-deletion tree), and has a live counterpart where needed — campaign/auto-pr.ts (imported via './auto-pr' in src/campaign/index.ts:35 and ru
- Assessment: Good change on its merits. I independently reproduced the safety checks rather than trusting the PR body: (1) exports map contains none of the five paths; (2) pre-deletion-tree greps for importers of each module return only the deleted suites themselves — the apparent '../auto-pr' and './auto-pr' hits resolve to the live src/campaign/auto-pr.ts, and 'trace/otel' hits are the separate live src/trac
- Better / existing approach: none — this is the right approach. Deletion is correct for unreachable modules; exporting or repointing them would add surface for code no consumer uses. I searched for existing equivalents of each deleted capability and confirmed the live twins (src/campaign/auto-pr.ts, src/analyst/registry.ts, src/contract/intake/otel-spans.ts, src/trace/otel.ts) already cover every live use.
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 5
- Bridge warning: opencode/kimi-for-coding/k2p7: opencode: opencode error
🎯 Usefulness — sound-with-nits
Deletes 2,484 lines of provably stranded surface (five module groups, none in the exports map, zero src importers) with live counterparts intact and typecheck plus the touched test green.
- Integration: Verified reachable-surface removal, not capability removal. All five groups are absent from the 28-entry package.json exports map (nothing external can resolve them) and zero non-test importers remain: grep of src/tests/scripts/examples for 'prm', root 'registry', root 'auto-pr', 'adapters/otel', and the knowledge barrel found only imports resolving to the live counterparts (src/analyst/kinds/cont
- Fit with existing patterns: Fits the codebase's established deletion campaign exactly: parent #643 (commit 357bbf9) deleted twelve stranded modules, this removes five more of the same kind, and CHANGELOG.md records the pattern. The change follows the repo's lean-substrate doctrine by removing stranded originals where a live, exported, in-use counterpart exists (campaign/auto-pr, analyst/registry, adapters/http, knowledge/rea
- Real-world viability: Pure deletion of unreachable code with no runtime behavior change; the only executable risk is dangling references, and tsc exit 0 plus the modified test passing rule that out. The deleted otel bridge's error handling and edge cases are moot since no consumer existed or could exist (it would throw ERR_PACKAGE_PATH_NOT_EXPORTED from npm, as the doc itself stated). Git history retains all deleted co
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 2
🎯 Usefulness Audit
🟡 docs/adapters-observability.md still describes the deleted otel bridge as existing in source [integration] ``
docs/adapters-observability.md:44-63 says 'A bridge exists in source but is not published: createOtelBridge (src/adapters/otel.ts)' and includes a usage snippet. This PR deletes that file, so the section now describes code that no longer exists anywhere. Per repo CLAUDE.md ('Update the doc closest to the change'), trim or rewrite that TraceAI note in this PR; the rest of the doc is unaffected. Does not gate shipping.
💰 Value Audit
🟡 docs/adapters-observability.md still documents the deleted otel bridge [maintenance] ``
docs/adapters-observability.md:45 names 'src/adapters/otel.ts' and line 57 shows 'import { createOtelBridge from .../adapters/otel'' — the module this PR deletes. The doc already admitted (line 49) the export path never resolved, but now the source file itself is gone; a reader gets a 150-line walkthrough of nothing. Also src/campaign/provenance.ts:19,771 comment references '/adapters/otel'. Delete or rewrite the doc (and reword the two comments) in this PR or its follow-up; does not gate shippi
What this audit checks
It judges the change on its merits — not whether it was tasked out in an issue. Unticketed, fast-moving work is fine; the question is whether the change is good and whether a better or existing approach should be used instead.
| Pass | What it asks |
|---|---|
| Heuristic | Vague title? Whitespace-only or cruft-bearing diff? (content signals only) |
| Duplication | Do added function/class names already exist elsewhere in the repo? |
| Value Audit | What does it do? What goal does it achieve? Is it good? Better architecture or already-exists? |
| Usefulness Audit | Does it integrate and fit? Will it hold up in real use and actually get used? |
Findings are concerns, not blocks — the human reviewer decides what to do with them.
tangletools
left a comment
There was a problem hiding this comment.
🟢 Value Audit — sound
| Verdict | sound |
| Coverage | 1 of 2 lenses (usefulness) |
| Concerns | 1 (1 weak-concern) |
| Heuristic | 0.0s |
| Duplication | 0.0s |
| Interrogation | 211.0s (2 bridge agents) |
| Total | 211.0s |
⚠️ Partial audit — the verdict covers only usefulness. value: cli-bridge admission rejected (queue saturated). Treat the missing lens as unexamined, not as clear.
💰 Value — error
value agent never ran: the CLI bridge refused admission (no model was started).
- Model: opencode/deepseek/deepseek-v4-pro
- Bridge attempts: 4
- Bridge error: opencode/kimi-for-coding/k2p7: Bridge returned 503: bridge at capacity (queue_timeout, lane=reserved): active=20/20 queued=5/48 — no model was started
🎯 Usefulness — sound
Deletes 2,484 lines of verified-unreachable surface (five module groups plus their suites) with zero public-API change, correctly rewiring the one test that touched the knowledge barrel; every stranded claim was independently re-verified.
- Integration: Deletion-only change; nothing reachable depended on any deleted module. Verified no exports-map entry exists for any of the five groups before or after (package.json exports list), zero src/tests/scripts/examples importers (word-boundary grep on 7ec8962^), and the live counterparts are confirmed in use: src/analyst/registry.ts (re-exported via ./analyst), src/campaign/auto-pr.ts (used by src/campa
- Fit with existing patterns: Directly in the established grain: this is the second pass of the same cleanup pattern #643 set (commit 64ee404 deleted twelve modules stranded by the barrel tiering; this deletes five more of the same class, per the growth-autopsy census). It follows the repo's substrate doctrine (no dead surface, exports map is the contract) and reduces the duplicate canonical-JSON encoder count from five to the
- Real-world viability: Pure deletion of unreachable code with typecheck green and the touched test green carries no runtime risk: no caller exists to hit an error path. The PR's before/after suite numbers (374->369 files, 5278->5222 tests, 0 FAIL) are consistent with what this sandbox could partially verify (3083 passed, 0 related failures). Deleted-with-history means the OTel bridge design is recoverable if the hosted
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 1
🎯 Usefulness Audit
🟡 docs/adapters-observability.md still documents the deleted OTel bridge as existing in source [problem-fit] ``
docs/adapters-observability.md:44-63 says 'A bridge exists in source but is not published: createOtelBridge (src/adapters/otel.ts)' and includes an import snippet plus a status note scoped to 'As of 0.140.x'. After this PR the file no longer exists, so the paragraph's premise is false. The doc already framed the code as unreachable, so no user is broken, but CLAUDE.md's rule ('update the doc closest to the change') says this paragraph should have been updated or removed in the same commit. Fix:
What this audit checks
It judges the change on its merits — not whether it was tasked out in an issue. Unticketed, fast-moving work is fine; the question is whether the change is good and whether a better or existing approach should be used instead.
| Pass | What it asks |
|---|---|
| Heuristic | Vague title? Whitespace-only or cruft-bearing diff? (content signals only) |
| Duplication | Do added function/class names already exist elsewhere in the repo? |
| Value Audit | What does it do? What goal does it achieve? Is it good? Better architecture or already-exists? |
| Usefulness Audit | Does it integrate and fit? Will it hold up in real use and actually get used? |
Findings are concerns, not blocks — the human reviewer decides what to do with them.
✅ No Blockers —
|
tangletools
left a comment
There was a problem hiding this comment.
✅ Approved — 6 non-blocking findings — 7ec89628
Full multi-shot audit completed 8/8 planned shots over 12 changed files. Global verifier still owns final merge decision.
Full immutable report for this review: trace
Summary comment for this run: full summary
tangletools · 2026-08-18T21:42:19Z · immutable trace
✅ No Blockers —
|
Deletes five stranded module groups and their suites: 14 files, 2,482 lines, zero public-API change.
Builds on #643 (branched from its head). The diff shows only this PR's deletions once #643 merges.
What is deleted and why each is safe
Every module here fails the same four checks. None is in the package
exportsmap, so no external consumer can resolve it.src/prm/*(5 files + own suite)./prmexport. Zero src importers (word-boundary grep). Onlytests/prm.test.ts+src/prm/inference.test.tsimport it. Zero hits foragent-eval/prmin agent-runtime src+bench.src/registry.ts(ScenarioRegistry)src/analyst/registry.tsis a different, live module and stays. Onlytests/registry.test.tsimports it.src/auto-pr.tssrc/campaign/auto-pr.ts(exported via./campaign, used byrun-improvement-loop.ts). The root copy is the stranded original.src/adapters/otel.tssrc/adapters/http.tsstays —examples/distributed-driver/*imports it.src/knowledge/index.tsknowledge/readiness.tsandknowledge/types.tsstay — the root barrel re-exports them.src/prm/builtin-rubrics.tsalso carried the fifth divergent canonical-JSON encoder; #646 tracks the four live ones.Proof
tsc --noEmit: exit 0 after deletion.Part of the growth-autopsy census; the full duplicate table and root causes are in the autopsy report.