Skip to content

ci: required review-verdict check that reads the newest Grok/Codex review - #2781

Merged
abrichr merged 4 commits into
mainfrom
claude/ci-review-verdict-gate-61a472
Nov 30, 2026
Merged

abrichr merged 4 commits into
mainfrom
claude/ci-review-verdict-gate-61a472

Conversation

@abrichr

@abrichr abrichr commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Adds review-verdict, a commit status that reads the newest Grok or Codex review. #2769 merged over a REQUEST CHANGES for its exact head, and #2756 sat in auto-merge with an open blocker. With this check required, neither can happen.

What it checks

  • A pull request that changes no path in .github/agent-safety-manifest.json passes with "no protected paths".
  • Otherwise the newest review must name the current head in Reviewed-Head: and say exactly APPROVE. The review must come from an account in .github/review-verdict.json (today only abrichr) and carry a From: Grok or From: Codex line. "APPROVE if ...", BLOCK, REQUEST CHANGES, a stale head and no review all fail.
  • From: Claude and From: Gemini comments don't count and don't mask a Grok or Codex review. A header in fenced code is ignored. A header that is quoted, inside an HTML comment or below prose can't approve, and it still blocks.
  • A review stays current across merges from main when each merge is clean (git merge-tree --write-tree reproduces its tree) and the pull request's own -U0 diff is unchanged. On feat(flow): relative postconditions, constellation wiring, and semantic whole-run pixel gates #2756 this gives the same answer Grok gave by hand: a56440d, c2d77e2 and 41573ef are equivalent. 1dd5341 resolved a conflict, so it needs a new review.
  • In the merge queue it walks the MERGE-method group chain and re-evaluates every queued pull request with its live comments.
  • Script and config always run from a checkout of main. Pull request commits are fetched as objects and never checked out. There's no pull_request_target trigger. Permissions are contents: read, pull-requests: read, statuses: write, and every action is pinned by SHA.

The full rule is in the docstring of scripts/ci/review_verdict.py.

One deviation from the brief

A REQUEST CHANGES, BLOCK or malformed review at the current head stands until the same reviewer approves. Another reviewer's later APPROVE doesn't clear it, although the brief's newest-review rule would pass that case. I added this because #2769's failure was an unresolved blocker at its exact head. The cost is that when Grok blocks and Codex approves, the pull request waits for Grok. To drop the rule, delete the loop marked # blocker stands in evaluate.

Protected paths

The manifest gains openadapt/wrap_sdk.py, openadapt/simplex_transducer.py, openadapt/transducer_*.py and packages/kernel/**. It also gains runtime/replay/**, runtime/resolver.py, runtime/worklist_copilot.py, the remaining receipt and seal modules, the verifier modules, .github/workflows/** and .github/actions/**. The old protected-safety-review validator now accepts areas beyond its six; that's a one-line change, and its tests pass.

Testing

Spoofing: what this check doesn't stop

Until Grok and Codex have GitHub App identities (rollout step 2), any session that posts as abrichr can write a "From: Grok ... APPROVE" comment, and the check passes it. The From: line labels a comment but doesn't prove who wrote it. This PR catches the accidents it was built for: merging over a REQUEST CHANGES, a stale approval, or no review. It doesn't stop a session that writes its own approval.

Verdict-fold ratchet

evaluate is a @verdict_site, using the same stdlib fallback as scripts/ci/check_windows_governed_safety.py. Its fail-open spec is in packages/flow/tests/failopen/sites/review_verdict.py, and the harness passes all 122 tests. No baseline was raised. The ratchet was also flagging folds in cohort_receipt.py, qualify_local.py, compile.py and record_oracle.py; after merging origin/main it no longer reports those files.

Expect this PR's own run to fail

The Evaluate review verdict job runs the script from main, where it doesn't exist yet, so it fails on this PR. That's expected; no need to chase it. Comment triggers start working only after merge. This pull request changes .github/workflows/**, so it needs a Codex review.

Not done here (admin steps)

docs/maintainers/review-verdict-rollout.md lists three steps an admin has to take:

  1. Add review-verdict to the required checks.
  2. Create GitHub App identities for Grok and Codex.
  3. Require one code-owner approval on protected paths, after step 2, because the founder can't approve their own pull requests.

protected-safety-review.yml isn't deleted. Once review-verdict is required, only the old workflow's author-vendor rule is missing from the new check.

A pull request that changes a protected path (.github/agent-safety-manifest.json)
gets a review-verdict commit status that passes only when the newest review
from an allowed account, with a From: Grok or From: Codex line, approves its
current head. A blocker at the current head stands until the same reviewer
approves. Reviews stay current across clean merges from main whose own diff
is unchanged. In the merge queue every queued pull request is re-evaluated.

The manifest gains the wrap SDK, the transducer, the kernel, replay and
confirmation, more receipt and seal modules, and .github/workflows/**. The
old protected-safety-review validator now accepts areas beyond its six.
…el concurrency

A Grok or Codex review whose header is quoted, inside an HTML comment or
below a line of prose can no longer be skipped: it counts as a malformed
review, so it can't approve and it blocks until its reviewer approves.
Concurrency moves to the job so a skipped comment run can't replace a
pending evaluation.
The verdict-fold ratchet counted three hand-written folds in the new script.
evaluate is now a @verdict_site (with the stdlib fallback the other CI site
uses) with a fail-open spec under packages/flow/tests/failopen/sites, and
the two non-verdict matches are gone: Outcome stores passed as a bool, and
the header check folds into the existing loop. The rollout doc says plainly
that until the App identities exist, any session posting as abrichr can
write a From: Grok approval.
@abrichr

abrichr commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: f682f55

The check does what it was built to do: a protected-path change needs a current Grok or Codex APPROVE at the exact head, and an unresolved REQUEST CHANGES or BLOCK from that reviewer stands until the same reviewer approves. A missing review, a stale head, a conditional "APPROVE if …", and a header hidden in a fence, a quote, an HTML comment or below prose all fail. A truncated file list is treated as protected. Evaluation errors fail closed and publish a failure status.

The trust model is honest about its limits, and I agree with them. The script and config always come from a checkout of main, which is the right default, and there is no pull_request_target. GitHub still takes the workflow file from the pull request, so a pull request that edits .github/workflows/review-verdict.yml can change what runs for itself. That path is protected, and code-owner review is the planned close. Until Grok and Codex have their own GitHub App identities, any session that posts as an allowed account can write a From: Grok approval. This catches accidents such as a merge over an open change request; it is not a defence against a maintainer acting in bad faith.

Expected on this PR, as the description already says: the Evaluate review verdict job fails here because it checks out main, where scripts/ci/review_verdict.py does not exist yet. Comment triggers start working only after merge. Making the check required, and the App identities, are still admin steps in the rollout doc.

Tests at this head

  • tests/test_review_verdict.py and tests/test_protected_safety_review.py: 399 passed (74 of those are the new review-verdict cases).
  • ruff check on the script, tests and fail-open site: clean.

Not run

  • actionlint, and a live workflow_dispatch or merge-queue evaluation against GitHub. I did not publish any commit status.

CI at this head

26 passed, 1 failed, and the failure is the expected bootstrap miss on main described above. I didn't merge or push anything.

@abrichr
abrichr added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 2ba29ce Nov 30, 2026
49 of 50 checks passed
@abrichr
abrichr deleted the claude/ci-review-verdict-gate-61a472 branch November 30, 2026 06:54
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