refactor: remove dead code, orphan modules, and two unused dependencies
−3,729 lines. Every symbol was classified per reference hit — own declaration / barrel re-export / vi.mock stub / real production caller — and only those with zero real callers are removed.
Orphan modules
| Lines | Module | Evidence |
|---|---|---|
| 148 | scheduled-tasks/components/schedule-calendar/ (11 files) | zero references repo-wide, not even a barrel line |
| 118 | terminal/components/filter-popover/ | barrel-only; FilterPopover used nowhere |
| 792 | 6 iso-marks primitives | mothership.tsx imports only the four Iso*Illustrations, which don't use these |
| 801 | 4 copilot user-input hooks | barrel line only; their six live siblings stay |
| 51 | lib/workflows/application/duplicate-workflow.ts | orphaned use case — see below |
The duplicate-workflow one is a name collision worth spelling out: lib/workflows/persistence/duplicate.ts exports a same-named duplicateWorkflow, and all 23 apparent references are to that one. Nothing imports the application path.
Dead exports
lib/compare/data/feature-catalog.ts—SIM_FEATURES, 939 lines, one unshipped feature-comparison catalog. TheSimFeaturetype,FeatureCategoryunion, andfeaturesByCategory/featuresByTaghelpers went with it; nothing else used them.createExecutionCallbacks— declaration only, zero other hits.
Stale vi.mock targets
Seven vi.mock() calls name modules that no longer exist. They are silent no-ops that make a test look protected when it isn't. Removal is provably inert: if the module doesn't exist, nothing can import it.
The clearest one is app/api/files/parse/route.test.ts, which mocks the dead @/lib/uploads/setup.server on line 106 and the real @/lib/uploads/core/setup.server on line 107.
Dependencies
three and @types/three. Zero imports anywhere; absent from every config, script, workflow, Dockerfile and chart; no peer requires them; "types": ["node"] means @types/three isn't auto-loaded. Both arrived with the speech-to-speech voice mode, since removed.
Two things deliberately NOT removed
build-chat-animation/reads as a textbook orphan, butbuild-callout.tsx:8documents it as "parked here unwired, kept for reuse." Intentional.- The copilot panel
user-input/subtree (3,334 lines) looked entirely orphaned and I staged it for deletion.bun run type-checkproved it live:home/components/user-inputimports from it. My grep had excluded importing files whose own path also containedcomponents/user-input/. Only the four hooks with zero references by name are removed.
Verification
bun run type-check — back to the 11 pre-existing errors, none new. bun run check:audits — all 33 pass. Tests: 344 across lib/workflows/executor, lib/compare, home/components/user-input, blocks/blocks/logs, lib/uploads/providers, plus the five suites whose stale mocks were removed (136) — all green.