Repository navigation
feat: run the first turn of a review in a throwaway worktree - #29
Merged
Merged
Conversation
`dw-mc review <pr>` is where a model runs, and the only place it does. The run happens in a worktree cut detached from the tool's own bare clone under the state directory, so what is reviewed is the pull request's head rather than whatever I have open, and the worktree goes away however the run ended. The report is kept as Markdown against the head it covers, beside the run that carries the session the follow-up turn resumes. A head with a run of its own is what takes a pull request out of Needs review run, which the sweep now reads from the run rather than carrying forward from the sweep before it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two defects a live run found. A bare clone is made with no refspec at all, so the base branch in the tool's own clone stood where it was the day the clone was made, and a review diffing against it would read every commit since as the pull request's. The fetch now brings the branch heads along with the pull request's own ref, which it names rather than reading back out of FETCH_HEAD. The report was taken from the runner's `result`, which is its last word. A repository whose own review command fans out to subagents ends on a remark about the notification that came back, and the report is the turn before that, so a run keeps every assistant turn's text and falls back to the last word only where there was nothing before it. The bell and the desktop notification ring on a run that gave up too, which is the run I most need to hear about, and the choice of runner sits in the domain rather than in the command. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
dw-mc review <pr>is where a model runs, and the only place one does. The run is started by hand, stays in the foreground, and says what it is doing while it does it.It happens in a worktree cut detached from the tool's own bare clone under the state directory, so what is read is the pull request's head rather than whatever I have open, and the worktree goes away however the run ended.
--commentis never passed (ADR 0002).sequenceDiagram participant C as dw-mc review participant G as gh participant R as state directory participant A as claude C->>G: pr view C->>R: fetch the pull ref and the branch heads, cut the worktree C->>A: /code-review <effort> in the worktree A-->>C: tools as they run, then the report and the session C->>R: the run against the head, the report beside it C->>R: take the worktree downThe run is recorded against the head it covers, with the report as Markdown beside it and the session the follow-up turn resumes. A head with a run of its own is what takes a pull request out of Needs review run, which a sweep now reads from the run rather than carrying forward from the sweep before it.
<pr>is28where one repository is registered, orowner/name#28.--effortoverrides what the repository configured. A repository configured for a runner that is not built yet is told so rather than quietly reviewed on the other one.Verified by running it
The CLI was built and run against a real pull request, with the state and configuration directories pointed at a scratch path. Two defects it found are fixed here, and both are now in
docs/v1-design.md:resultis the runner's last wordgit clone --barenorgh repo clone -- --barewritesremote.origin.fetch, so the base branch stood where it was the day of the clone and the review would read every commit since as the pull request's. The fetch brings the branch heads with the pull ref.Also verified:
--output-format stream-jsonrefuses without--verbosein print mode, and a detached worktree of the bare clone is enough for the built-in review —git merge-base HEAD mainresolves there.Left to its own ticket
path_instructionsare the second turn (Review run, second turn: structured findings #7);blockingFindingsstays 0 until then./code-review <effort>reaches the repository's own review skill, which wants a fixed point rather than an effort. That is whatreview.skilland thepromptrunner settle (Thepromptrunner on both agent CLIs #11).Closes #6
🤖 Generated with Claude Code