chore: repo-wide cleanup — dead weight, dead code, dedup, slash.ts split#33
Open
DBarr3 wants to merge 1 commit into
Open
chore: repo-wide cleanup — dead weight, dead code, dedup, slash.ts split#33DBarr3 wants to merge 1 commit into
DBarr3 wants to merge 1 commit into
Conversation
Full-repo audit (3 parallel surveys of core/, ui/, commands/) followed by a bounded, verified cleanup pass: - Remove orphaned dead weight: docs/index.html (1.4MB unused bundler placeholder), web-cloud.png, assets/ (6 unreferenced files) - Remove dead code: duplicated notYet() helper (vault.ts/workflow.ts, zero callers), write-only _lastMediaPrompt state, ~12 dead imports found via tsc --noUnusedLocals across slash.ts/media.ts/workflow.ts - Consolidate 5 near-identical fail()/errMsg() error-formatters into core/errors.ts (errorMessage/fail), used by media/output/vault/workflow/ github command handlers - Split commands/slash.ts (1807 lines, over the repo's ~800-line convention) into a thin dispatcher + 7 concern files (context, git-tools, codegen, hud, vault-workflow, orchestra, media) — no logic changes, verbatim moves, registry↔switch sync test still passes Verified clean build + full test suite (468/468) before and after every batch. Independent adversarial review (novice-reviewer subagent) scored organization 7/10, quality 9/10, labeling 7/10, efficiency 8/10 and found 4 concrete doc/cleanup gaps — all addressed in this commit. Full change log: cleaningnotes.md Source-of-truth map + prioritized backlog of what was found but deliberately not touched: scource.md Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full-repo audit (3 parallel surveys of
src/core/,src/ui/,src/commands/) followed by a bounded, verified cleanup pass — not a rewrite. Every change is either a verbatim move or a mechanical dedup; no behavior changes.docs/index.html(1.4MB unused bundler placeholder page),web-cloud.png,assets/(6 files) — all confirmed zero live references.notYet()helper (zero callers), write-only_lastMediaPromptstate, ~12 dead imports (found viatsc --noUnusedLocals) acrossslash.ts/media.ts/workflow.ts.fail()/errMsg()error formatters →core/errors.ts(errorMessage/fail), used bymedia/output/vault/workflow/githubcommand handlers.commands/slash.tswas 1807 lines (repo's own convention caps files at ~800). Split into a thin dispatcher (522 lines) + 7 concern files (slash_context,slash_git_tools,slash_codegen,slash_hud,slash_vault_workflow,slash_orchestra,slash_media), largest at 303 lines. ThehandleSlashswitch statement stayed physically inslash.tssincetest/slash_registry.test.tsparses its raw source text to verify registry↔switch sync.Docs added:
scource.md— source-of-truth map: repo structure, canonical-terms glossary, what was fixed, and a precise file:line backlog of what was found but deliberately left alone (and why).cleaningnotes.md— full change log, cross-referenced to scource.md.Independent verification: an adversarial "novice reviewer" subagent (fresh context, told to actively hunt for problems) fact-checked every claim in the two docs against the actual code, then scored the result — Organization 7/10, Quality 9/10, Labeling 7/10, Efficiency 8/10 — and found 4 concrete gaps (missing rows in the ownership table, an off-by-3 line-count claim, unused imports left in already-open files, an undocumented case alias). All 4 are fixed in this PR.
Test plan
npm run build— clean, 0 errors (tsc --strict)npm test— 468/468 pass (re-verified after every batch of changes and again after the post-review fixes)tsc --noUnusedLocals --noUnusedParameters --noEmitspot-check confirms the targeted dead imports are gonegit grep)test/slash_registry.test.ts(parseshandleSlash's raw switch-case text) still passes after the split/commandsin a real REPL session (not run — no live API token in this environment)🤖 Generated with Claude Code