chore: remove dead code identified by audit - #366
Merged
Conversation
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]>
This was referenced Jul 18, 2026
Merged
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
Removes code the audit verified as unreferenced (reductions section). Each removal was confirmed with
grepacrosssrc/before deletion.renderIssuePage/renderLogPage— exported but referenced nowhere (dashboard is a React SPA served bymain-page.ts; not inbundle.ts)dashboard/issue-page.ts,dashboard/log-page.tsinitLinear/findCritterIssues/updateIssueStatus/… — superseded bytracker/linear.ts'sLinearTrackerlinear.ts(+ its test)BuiltinPrompt,Provider,Enrichment,Outcome(zero member refs); keepToolPreset,BuiltinPhase,ReviewDecisionenums.tsbuildReviewPromptreview-prompt.tsreadLine()instead of at module load (it ran for every subcommand)init.tsTests
src/__tests__/audit-dead-code.test.ts— asserts the deleted files are gone, removed enum members are absent (kept ones present),buildReviewPrompthonors the 3-arg form, and importinginitdoesn't leave stdin locked.Verification
typecheck clean · lint exit 0 ·
bun test842 pass / 0 fail.🤖 Generated with Claude Code