Repository navigation
ci: required review-verdict check that reads the newest Grok/Codex review - #2781
Conversation
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.
Independent adversarial review: APPROVEFrom: Grok The check does what it was built to do: a protected-path change needs a current Grok or Codex The trust model is honest about its limits, and I agree with them. The script and config always come from a checkout of Expected on this PR, as the description already says: the Tests at this head
Not run
CI at this head26 passed, 1 failed, and the failure is the expected bootstrap miss on |
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
.github/agent-safety-manifest.jsonpasses with "no protected paths".Reviewed-Head:and say exactlyAPPROVE. The review must come from an account in.github/review-verdict.json(today onlyabrichr) and carry aFrom: GrokorFrom: Codexline. "APPROVE if ...", BLOCK, REQUEST CHANGES, a stale head and no review all fail.From: ClaudeandFrom: Geminicomments 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.git merge-tree --write-treereproduces its tree) and the pull request's own-U0diff 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.main. Pull request commits are fetched as objects and never checked out. There's nopull_request_targettrigger. Permissions arecontents: 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 standsinevaluate.Protected paths
The manifest gains
openadapt/wrap_sdk.py,openadapt/simplex_transducer.py,openadapt/transducer_*.pyandpackages/kernel/**. It also gainsruntime/replay/**,runtime/resolver.py,runtime/worklist_copilot.py, the remaining receipt and seal modules, the verifier modules,.github/workflows/**and.github/actions/**. The oldprotected-safety-reviewvalidator now accepts areas beyond its six; that's a one-line change, and its tests pass.Testing
tests/test_review_verdict.py: 74 tests. They use real comment bodies from feat(flow): relative postconditions, constellation wiring, and semantic whole-run pixel gates #2756, feat(flow): add interactive worklist draft-to-commit co-pilot runner #2769, feat(hooks): check a coding agent's writes to declared systems of record #2411 and fix(form-tx): see forms in iframes and open shadow roots #2440 and cover stale head, conditional approve, REQUEST CHANGES then APPROVE, no review, hidden and misplaced headers, and native App reviews. The merge-from-main, conflict, hand-edit and merge-queue tests build real git repositories.test_protected_safety_review.pyandtest_attestation.pypass, andruff check,ruff format --checkandactionlintare clean.--filter=blob:noneclone, which is what the runner has.Spoofing: what this check doesn't stop
Until Grok and Codex have GitHub App identities (rollout step 2), any session that posts as
abrichrcan write a "From: Grok ... APPROVE" comment, and the check passes it. TheFrom: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
evaluateis a@verdict_site, using the same stdlib fallback asscripts/ci/check_windows_governed_safety.py. Its fail-open spec is inpackages/flow/tests/failopen/sites/review_verdict.py, and the harness passes all 122 tests. No baseline was raised. The ratchet was also flagging folds incohort_receipt.py,qualify_local.py,compile.pyandrecord_oracle.py; after mergingorigin/mainit no longer reports those files.Expect this PR's own run to fail
The
Evaluate review verdictjob runs the script frommain, 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.mdlists three steps an admin has to take:review-verdictto the required checks.protected-safety-review.ymlisn't deleted. Oncereview-verdictis required, only the old workflow's author-vendor rule is missing from the new check.