Skip to content

maintainability: a dead wire ships green, and no check exists for the class (26 wires, no registration protocol) #9540

Description

@JSONbored

Parent: #9492

Summary

src/review/issue-rag-wire.ts has zero production importers. Both real consumers import packages/loopover-engine/src/issue-rag-query directly; only the wire's own test imports the wire.

Test coverage camouflages this rather than catching it: a dead module's own test exercises it perfectly well, so it reports green while contributing nothing to the running system. Commit 39cc9583c shows this class has bitten before.

There are 26 *-wire.ts files and no registration protocol; ~18 are direct-import-only, so a forgotten import is a silently dead feature. The one real registry (src/review/feature-activation.ts:80-89, a total Record over CONVERGED_FEATURE_KEYS) is compile-time drift-proof and is the right model — but it covers only converged features.

No mechanical check exists for the class: there is no knip or ts-prune, and none of the ~15 scripts/check-*-drift.ts covers reachability.

Requirements

  1. Delete the dead wire (or wire it up, if it was meant to be used).
  2. Add a check that makes the class fail CI, not merely be noticed by a future reader.
  3. The check must not be defeated by an allowlist of individual dead files — that would defeat its own purpose. A false positive is fixed at the root (a legitimate importer root, or a declared entry point with a stated reason), never by exempting the file.

Deliverables

  • Delete src/review/issue-rag-wire.ts and its test.
  • Add scripts/check-dead-source-files.ts: every src/** file must have at least one importer outside its own test. scripts/check-import-specifiers.ts is a ready template (injectable listFiles/readFile seams, pure core, main() guard).
  • Wire it into test:ci and the CI workflow, alongside the sibling drift checks.
  • Deliberately narrow scope: no re-export chasing, no unused-export analysis. Answer only "is this file imported by anything outside its own test" — the shape that actually failed here, cheap enough to run per-PR.
  • Fix whatever the first run surfaces, at the root.

Tests

  • Both dead shapes are flagged, with distinct reasons: "only its own test imports it" and "no importer at all".
  • One production importer is enough.
  • A test that is NOT the module's own counts as a real importer (a shared helper is alive).
  • scripts/** counts as a production importer — several CLIs are the sole consumer of a live src/** module.
  • Declared entry points are never flagged.
  • Barrels keep their members alive via export ... from.
  • A specifier reaching outside src/** is ignored rather than miscounted.
  • The real repo tree is clean, so the check stays green in CI.

Expected outcome

A module that stops being reachable fails CI on the PR that orphans it, instead of sitting green for months.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.orbGittensory Orb related - maintainer self-hosting analytics.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions