Skip to content

chore: repo-wide cleanup — dead weight, dead code, dedup, slash.ts split#33

Open
DBarr3 wants to merge 1 commit into
mainfrom
chore/repo-cleanup-audit
Open

chore: repo-wide cleanup — dead weight, dead code, dedup, slash.ts split#33
DBarr3 wants to merge 1 commit into
mainfrom
chore/repo-cleanup-audit

Conversation

@DBarr3

@DBarr3 DBarr3 commented Jul 2, 2026

Copy link
Copy Markdown
Owner

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.

  • Dead weight removed: docs/index.html (1.4MB unused bundler placeholder page), web-cloud.png, assets/ (6 files) — all confirmed zero live references.
  • Dead code removed: duplicated notYet() helper (zero callers), write-only _lastMediaPrompt state, ~12 dead imports (found via tsc --noUnusedLocals) across slash.ts/media.ts/workflow.ts.
  • Duplication consolidated: 5 near-identical fail()/errMsg() error formatters → core/errors.ts (errorMessage/fail), used by media/output/vault/workflow/github command handlers.
  • God-file split: commands/slash.ts was 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. The handleSlash switch statement stayed physically in slash.ts since test/slash_registry.test.ts parses 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 --noEmit spot-check confirms the targeted dead imports are gone
  • Confirmed zero remaining references to every deleted file (git grep)
  • test/slash_registry.test.ts (parses handleSlash's raw switch-case text) still passes after the split
  • Manual smoke test of a few /commands in a real REPL session (not run — no live API token in this environment)

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant