Skip to content

feat(review): say when a review is still running, and refuse to submit until it is not - #23

Merged
fiddur merged 1 commit into
developfrom
review-progress
Aug 21, 2026
Merged

feat(review): say when a review is still running, and refuse to submit until it is not#23
fiddur merged 1 commit into
developfrom
review-progress

Conversation

@fiddur

@fiddur fiddur commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

A reader cannot tell "nothing found" from "not finished looking". This happened for real today:
on admin3#671 the browser opened at setup, the findings arrived five minutes later, and the pull
request had already been approved in between.

An agent now declares the run. agent review-start [--note] and agent review-done, kept in a
review_runs table so existing databases migrate by simply gaining it — the schema here is
create-only, with no ALTER path. While a run is open:

  • the diff page carries a loud banner with the count of findings so far, the note, and how long it has been going
  • the forge dialog disables submission and says why

An unfinished run follows the session when a commit moves HEAD, so committing mid-review does not
silently clear the warning. review-done is required even when nothing was found, or the guard stays
up — the skill says so explicitly.

Three ways a tab could quietly show a stale review, all found while chasing "the previous
comments were hidden on update":

  • carrying threads into a new session (fix(session): keep open findings when HEAD moves #17) left a tab asking about the old id, which truthfully answered "0 threads". Session ids now resolve server-side, following a superseded session to the one that took its threads, and ?session= is optional — the client should not be the authority on session identity
  • /api/info never refetched, so a tab kept a dead session id indefinitely and would have filed new comments against it, invisible. It polls every 5s
  • the staleness fingerprint hashed only the diffstat, which counts lines without reading them, so a commit that rewrites the same number of lines produced an identical fingerprint and no refresh banner. It now includes the head commit — there is a test that commits one\ntwoone\nTWO and asserts the fingerprint changes

And PR mode no longer dies on a merged pull request. gh pr checkout can only check out a branch,
and merging usually deletes it — fatal: couldn't find remote ref refs/heads/DEV-25255, which is
exactly what happened when #671 merged mid-session. It falls back to refs/pull/<n>/head, verified
against that real merged PR.

Written test-first throughout: the guard test was red on "submit is refused while a review runs" and
green on "allowed once finished" before the implementation existed. 283 tests pass.

Stacked on #22.

🤖 Generated with Claude Code

https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs

…t until it is not

A reader cannot tell "nothing found" from "not finished looking". On a real review here the
findings arrived five minutes after the browser opened, and the pull request had already been
approved by then.

An agent now declares the run: `agent review-start [--note]` and `agent review-done`, kept in
a review_runs table so existing databases migrate by creating it. While a run is open the diff
page carries a loud banner with the finding count so far, and the forge dialog disables
submission and says why. An unfinished run follows the session when a commit moves HEAD, so
committing mid-review does not silently clear the warning.

Also fixes three ways a tab could quietly show a stale review:

- carrying threads into a new session left a tab asking about the old one, which truthfully
  answered "no threads". Session ids are now resolved server-side, following a superseded
  session to the one that took its threads, and the parameter is optional.
- /api/info never refetched, so a tab kept a dead session id and would have filed new comments
  against it. It polls.
- the staleness fingerprint hashed only the diffstat, which counts lines without reading them,
  so a commit rewriting the same number of lines looked identical. It includes the head commit.

And PR mode no longer fails on a merged pull request: gh can only check out a branch, which is
usually deleted on merge, so it falls back to refs/pull/<n>/head.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
@fiddur
fiddur changed the base branch from attention to develop August 21, 2026 13:36
@fiddur
fiddur marked this pull request as ready for review August 21, 2026 13:36
@fiddur
fiddur merged commit ba39028 into develop Aug 21, 2026
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