Skip to content

feat(review): bind acceptance to a verified checkpoint sha - #100

Merged
satyaborg merged 3 commits into
mainfrom
feat/sha-bound-acceptance
Aug 17, 2026
Merged

feat(review): bind acceptance to a verified checkpoint sha#100
satyaborg merged 3 commits into
mainfrom
feat/sha-bound-acceptance

Conversation

@satyaborg

Copy link
Copy Markdown
Owner

Why

An ACCEPT verdict was not tied to anything. Nothing recorded which commit the reviewer actually saw, so a commit landing between the review brief and the verdict silently inherited an approval it never earned. Draft PRs were also opened and then left draft forever, with no gate between "the reviewer said yes" and "a human should look at this".

What

  • An accepted verdict now binds to the exact commit the reviewer was given. Any commit in between ends the run as head-drift instead of accepted.
  • The review brief names the checkpoint and tells the reviewer not to commit, amend, or push.
  • Accepted runs with a PR pass a final verification gate, then the draft is lifted.

How

REVIEWED_HEAD is captured immediately before the reviewer starts and compared against HEAD when the verdict comes back. Only a verdict that survives that comparison sets ACCEPTED_HEAD.

final_verification then checks four things against that same SHA: local head matches, the worktree holds no uncommitted task changes, the remote PR head matches, and required checks are green. Pending, failing, or absent-with-a-lookup-error checks are not green. Only when all four pass does gh pr ready run.

Two result lines are added to the run summary: Accepted and Readiness.

Proof

  • bash scripts/devloop_test.sh: passes, except a pre-existing nightshift digest failure caused by the suite writing to a hardcoded /tmp path that this sandbox denies. That failure reproduces unchanged on main.
  • New coverage for all eight added functions, including drift detection, worktree preservation, stale local head, mismatched remote head, pending checks, absent checks, dirty worktree, and gh lookup failure.

Scope

  • Included: checkpoint capture, drift detection, final verification, undraft, README PR row.
  • Not included: the PR comment format and stacked PRs, which follow in the two stacked PRs on top of this one.

Stack

  • Position: 1 of 3
  • Base: main
  • Followed by: feat/living-review-status

An ACCEPT verdict now binds to the exact commit the reviewer saw. Any commit
landing between the review brief and the verdict invalidates acceptance and
ends the run as head-drift instead of accepted.

Accepted runs with a PR then pass a final verification gate before the draft
is lifted: local head equals the accepted checkpoint, the worktree holds no
uncommitted task changes, the remote PR head matches, and required checks are
green for that same sha. Only then does the PR become ready for human review.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 17, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
⚠️ Deployment skipped
View logs
devloop fbce89f Aug 17 2026, 07:34 AM

The fake gh now answers headRefOid, statusCheckRollup, and pr ready, so the
accept loop exercises final verification instead of stopping at the draft PR.
Asserts an accepted run is marked ready and an unclear run is not.
shellcheck flagged SC2016 on the single-quoted $all binding. The same
classification works by piping the array directly, so the query needs no
variable and no suppression comment.
@satyaborg satyaborg self-assigned this Aug 17, 2026
@satyaborg
satyaborg merged commit 5e63a79 into main Aug 17, 2026
3 checks passed
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