Repository navigation
refactor(cli): the preamble and the exit code, once each - #94
Merged
Merged
Conversation
Nine commands opened by reading the configuration file, resolving the pull request against the repositories it registers and merging the settings for that repository. Asking those three questions in one place is what keeps the answers the same: which repositories are registered decides what a bare `28` may name, and a command reading the file its own way could resolve a different pull request from the one beside it. The CLI's error vocabulary lived inside the sweep, which twelve commands imported for nothing else. It has a file of its own, and the two tag lists that repeat verbatim are named there rather than spelled out at both ends. `allowed` and `fixable` were `refuse` written again, and `currentRun` sat in one command for another to import. Both move to where they belong. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dominikwozniak
force-pushed
the
refactor/85-preamble-and-exit
branch
from
September 18, 2026 07:35
98d4319 to
06d6a43
Compare
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.
Nine commands open by reading the configuration file, resolving the pull request against the repositories it registers, and merging the settings for that repository. Asking those three questions in one place is what keeps the answers the same: which repositories are registered decides what a bare
28may name, so a command reading the file its own way could resolve a different pull request from the one beside it. The CLI's error vocabulary had the matching problem from the other end —userFacingandasUserErrorlived insidesrc/cli/sweep.ts, which twelve commands imported for nothing else.What changes
src/cli/pr.ts—forPr(pr)answers with the repository, the number, the settings and the launcher.currentRunmoves here too, besideswept: both read local state and both answer with a sentence, anddw-mc fixno longer imports it fromdw-mc findings.src/cli/exit.ts— new, and holdsuserFacing,asUserError, and the two tag lists that repeat verbatim:userFacingAndGitfor a command that runs git,userFacingAndSessionfor one that cuts a worktree and opens an agent in it.sweep.tsgoes back to being the sweep.src/cli/resolve.ts,src/cli/fix.ts—allowedandfixablewererefusewritten out again, down to the error and the field. Both callrefuse.src/cli/comments.ts— caught["ConfigMalformed", ...userFacing], andConfigMalformedis already the first ofuserFacing.Test plan
pnpm check— pass (51 files, 695 tests)pr.tsandexit.ts, neither of which has a test file of its own.Risk
A command resolving the wrong pull request, or exiting with a stack where it used to print a sentence. Both are what the command tests read, and they are unchanged.
dw-mc initkeeps its own tag list, which is genuinely its own: it catchesGhUnauthenticatedand does not catchGhReadFailed.Closes #85
🤖 Generated with Claude Code