refactor: address clawpatch findings#24
Merged
Merged
Conversation
bin/worktree-add imports ../dist/cli.js, but dist/ is gitignored and absent in a fresh checkout, so dropping the rebuild made pnpm start fail with ERR_MODULE_NOT_FOUND. Restoring the rebuild also avoids running stale dist output.
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
Remediates the open
clawpatchmaintainability/perf findings and refreshes dev dependencies. Each finding was fixed with a focused manual change and committed as a verified batch.One perf finding — making
startskip the rebuild — was reverted after review.bin/worktree-addimports../dist/cli.js, which is gitignored and absent in a clean checkout, so dropping the rebuild madepnpm startfail withERR_MODULE_NOT_FOUNDand could run staledist/output.startkeeps runningpnpm run rebuild && node bin/worktree-add, so this PR no longer touches that script.Findings addressed
src/cli.ts.description()now readspackageJson.descriptioninstead of a duplicated string.globToRegExptests moved fromsrc/cli.test.tstosrc/worktree/file-patterns.test.ts, next to the module they exercise.get-status-loggerwrapper — the one-line resolver is gone; call sites default inline withoptions.logger ?? fallbackStatusLogger.Promise.allSettled→Promise.all, keeping only the narrowtry/catcharoundopen(); dropped the test that enshrined the broad swallow. Realistic app-launch failures are still caught inline and logged, so the worktree survives;Promise.allonly propagates genuinely unexpected errors instead of silently swallowing them.fetchRemoteBranch;resolveWorktreeContextalready refuses before it runs.promptRefusalLinessource (byte-identical output, verified by the existing tests).mockGitRepositoryscenario helper; dropped the exact call-count/order assertion.Dependencies
@types/node25.9.3,fta-check1.5.4,oxlint-config-j4k2.7.4,semantic-release25.0.5.@typescript/native-previewleft on itsbetatag (thebetadist-tag still points to20260421.2;20260614.1lives on the separatelatestchannel).oxlint-config-j4k.Notes
.clawpatch/to.gitignore(under "Local artifacts", alongside.codex/) so the tool's state directory isn't tracked and the pre-commitformat:checkdoesn't scan it.Verification
pnpm startverified: withdist/removed it rebuildsdist/cli.jsand the bin loads successfully.