Skip to content

feat(review-by-harness): clean up review worktrees once incorporated - #291

Merged
vossiman merged 7 commits into
mainfrom
feat/review-worktree-cleanup
Nov 23, 2026
Merged

vossiman merged 7 commits into
mainfrom
feat/review-worktree-cleanup

Conversation

@vossiman

@vossiman vossiman commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • New skills/review-by-harness/cleanup.sh: removes a review's worktree, review-pr<N>-<harness> branch and refs/review-by-harness/pr<N> once findings are incorporated. --archive DIR writes a complete archive outside the checkout first (report, reviewed commit, binary-safe fix diff, new files). A fix on an open PR is kept until --discard. --prune is maintenance for merged/closed PRs only.
  • run.sh: per-PR, per-harness flock so concurrent reviews can't delete each other's worktree; a per-PR lock over the shared ref; refuses to reset over an earlier fix pass's changes (fix-started, reviewed-head).
  • dev-process-lite: archive each review into the run directory after fixes land; closeout cleans only the run's own reviews; integration-branch rule (or one review per independent PR); Cursor run ids; session name only from Claude.
  • assess-run reads the archive (it used to read the worktree that step 6 deleted) and checks every PR the Plan lists.

Evidence for the gap: the shared checkout held 11 refs/review-by-harness/prN refs for merged PRs 263 to 290 (pruned with this script).

Independent review

round harness model effort commit result
1 codex gpt-6.2-sol high d445704 14 findings (2 P1, 11 P2, 1 P3), all verified and fixed in f77aaf1
2 codex gpt-6.2-sol high c3073fb 12 findings (2 P1, 8 P2, 2 P3), all verified and fixed in ab5fca7

No third round (owner rule: at most two). Round 2 findings were local hardening, none changed the design; each fix has a bats test.

Test plan

🤖 Generated with Claude Code

vossiman and others added 7 commits November 23, 2026 00:13
run.sh left the worktree, its branch and refs/review-by-harness/pr<N>
behind after every review (ten refs from merged PRs had piled up), and
dev-process-lite said to remove the worktree without saying when, while
assess-run still read the report from inside it. cleanup.sh archives
.review-round, keeps a fix diff that is not yet on the PR branch, and
--prune clears reviews of merged or closed PRs without touching open ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne integration and Cursor run ids

run.sh force-removed review-pr<N>-<harness> on start, so two sessions
reviewing the same PR deleted each other's worktree, and a second round
silently dropped a fix pass's uncommitted diff. Both scripts now take a
per-PR, per-harness flock, and run.sh refuses to reset over a fix diff.
dev-process-lite now says how worker branches become the reviewed PR and
what a Cursor overseer names its run directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex (gpt-6.2-sol, high) found 14 issues; all verified. cleanup.sh no
longer writes inside the PR-controlled worktree, keeps the worktree when
archiving fails, archives binary-safe diffs and new files against the
reviewed commit (so a fix the harness committed counts), finds reviews from
any checkout, asks GitHub about origin's repo, deletes only the branch of a
worktree it removed, holds the ref while any run holds a lock, and runs on
Bash 3. run.sh marks a fix pass before it starts. dev-process-lite scopes
the closeout cleanup to the run's own reviews, covers independent PRs, and
asks for a session name only from Claude.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex round 2 (gpt-6.2-sol, high) at c3073fb found 12 issues; all
verified. Cleanup now leaves PR state UNKNOWN unless origin resolves to a
GitHub repo (SSH-over-443 included, REVIEW_GH_REPO to override), keeps an
older review whose reviewed commit cannot be established, touches only
worktrees run.sh made, reads worktree paths with spaces, refuses an
archive inside the worktree it removes, publishes an archive only when
complete, no longer prunes unrelated worktree registrations, holds a
per-PR lock with run.sh over the shared ref, and reports failed branch and
ref deletions. run.sh ignores PR-tracked scratch metadata. Cursor run ids
get a random suffix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vossiman
vossiman merged commit 611735c into main Nov 23, 2026
1 check passed
@vossiman
vossiman deleted the feat/review-worktree-cleanup branch November 23, 2026 00:05
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