Skip to content

chore: remove dead code identified by audit - #366

Merged
andrewklingelhofer merged 3 commits into
mainfrom
chore/audit-remove-dead-code
Jul 18, 2026
Merged

chore: remove dead code identified by audit#366
andrewklingelhofer merged 3 commits into
mainfrom
chore/audit-remove-dead-code

Conversation

@andrewklingelhofer

Copy link
Copy Markdown
Contributor

Summary

Removes code the audit verified as unreferenced (reductions section). Each removal was confirmed with grep across src/ before deletion.

Finding Change File(s)
Dead dashboard pages Delete renderIssuePage/renderLogPage — exported but referenced nowhere (dashboard is a React SPA served by main-page.ts; not in bundle.ts) dashboard/issue-page.ts, dashboard/log-page.ts
Legacy Linear API Delete the module-level initLinear/findCritterIssues/updateIssueStatus/… — superseded by tracker/linear.ts's LinearTracker linear.ts (+ its test)
Dead enums Remove BuiltinPrompt, Provider, Enrichment, Outcome (zero member refs); keep ToolPreset, BuiltinPhase, ReviewDecision enums.ts
Back-compat shim Drop the unused 2-arg duck-typing branch in buildReviewPrompt review-prompt.ts
Process-wide stdin lock Acquire the stdin reader lazily inside readLine() instead of at module load (it ran for every subcommand) init.ts

Tests

src/__tests__/audit-dead-code.test.ts — asserts the deleted files are gone, removed enum members are absent (kept ones present), buildReviewPrompt honors the 3-arg form, and importing init doesn't leave stdin locked.

Verification

typecheck clean · lint exit 0 · bun test 842 pass / 0 fail.

🤖 Generated with Claude Code

andrewklingelhofer and others added 3 commits June 15, 2026 21:47
Pure deletions/simplifications flagged in AUDIT.md (reductions):

- Delete src/dashboard/issue-page.ts and src/dashboard/log-page.ts.
  renderIssuePage/renderLogPage were exported but referenced nowhere
  (the dashboard is a React SPA served by main-page.ts). dashboard/index.ts
  never re-exported them, so no barrel change was needed.
- Delete legacy src/linear.ts (initLinear/findCritterIssues/updateIssueStatus
  module-level API) and its test, superseded by tracker/linear.ts LinearTracker.
- src/enums.ts: drop dead constants BuiltinPrompt, Provider, Enrichment, Outcome
  (zero member references). Keep ToolPreset, BuiltinPhase, ReviewDecision.
- src/review-prompt.ts: remove the back-compat duck-typing shim in
  buildReviewPrompt; no caller used the 2-arg (task, repoConfig) form.
- src/init.ts: acquire the stdin reader lazily inside readLine() and release
  it after each read, instead of locking stdin process-wide at module import
  (which ran for every subcommand).

Adds src/__tests__/audit-dead-code.test.ts pinning these removals.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Remove the trivially-passing dashboard re-export assertion (index.ts
never exported renderIssuePage/renderLogPage even on main, so it did
not guard the deletion). The existsSync checks remain as the meaningful
guards that the deleted page files are gone.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
resolvePhaseMcpConfig expands ~ via node:os homedir(); the test compared it to
process.env.HOME. Bun caches homedir() on first call and ignores later
process.env.HOME mutations, so when a sibling test changes HOME they diverge on
Linux CI and this test fails (works on macOS by execution-order luck). Assert
against the same homedir() the implementation uses.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@andrewklingelhofer
andrewklingelhofer merged commit a33840f into main Jul 18, 2026
1 check passed
@andrewklingelhofer
andrewklingelhofer deleted the chore/audit-remove-dead-code branch July 18, 2026 17:54
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