Skip to content

fix(admission): shared review-disposition verifier for merge-ready and final eligibility (#8157) - #12503

Closed
EffortlessSteven wants to merge 1 commit into
mainfrom
cursor/8157-review-disposition-verifier-ac7f
Closed

EffortlessSteven wants to merge 1 commit into
mainfrom
cursor/8157-review-disposition-verifier-ac7f

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Governing issue or accepted claim: #8157

Acceptance delta (one sentence): The eight #8157 narrative false-positive controls refuse at both merge-ready admission and final eligibility while exact positive, wrong-head, and CHANGES_REQUESTED controls keep their intended results via one shared verifier.

Advances #8157

Change

  • .github/actions/pr-candidate-admission/review_disposition.py + review_source_gate.sh: shared verifier (column-zero markers, disposition: lines, fenced-block masking, native review reducer).
  • action.yml, .github/workflows/routed-rust.yml: request-time gate + final eligibility recheck.
  • tools/repo-policy/tests/review_disposition_admission.rs, policy allowlists, changelog fragment.

Remainder (stays open): #4985 evidence record, #8172 HTML parsing, execute=true oracle, refusal matrix, APPROVED-after-negative-COMMENT policy.

Proof (agent bc-294373f3, head 4ed9588): verifier self-test, cargo test -p repo-policy --test review_disposition_admission, check-workflows, clippy pass; precommit blocked by main E0061 (#12466).

Draft: touches the merge gate workflow (routed-rust.yml); hold until #12466/#12496 land. Opened on behalf of the Cursor cloud agent (its PR tool was unavailable).

…8157)

Add a shared Python disposition verifier and gate script consumed from
immutable base-trusted admission on merge-ready request and again at final
eligibility. Narrative, quoted, and superseded prose no longer satisfy
attestation; explicit disposition fields and column-zero markers remain valid.

Advances #8157.

Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 149 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 3834c645-1294-4b80-afd8-4de26d6a972c
Commits

Reviewing files that changed from the base of the PR and between 4aeec54 and 4ed9588.

Files selected for processing: 8
  • .github/actions/pr-candidate-admission/action.yml
  • .github/actions/pr-candidate-admission/review_disposition.py
  • .github/actions/pr-candidate-admission/review_source_gate.sh
  • .github/workflows/routed-rust.yml
  • changelog.d/8157-review-disposition-verifier.md
  • policy/non-rust-allowlist.toml
  • policy/workflow_allowlist.txt
  • tools/repo-policy/tests/review_disposition_admission.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Copy link
Copy Markdown
Member Author

Disposition at head 4ed9588 vs main a31e411: still valid (#8157 open, main still has the narrative-token jq predicate), merges cleanly with main, and its stated hold (#12466/#12496) is cleared (both merged 2026-11-02). It is nevertheless not landable as built: a bootstrap defect.

For pull_request events the trusted admission bundle is the PR base SHA (routed-rust.yml "Verify trusted admission bundle"). This PR adds review_disposition.py and review_source_gate.sh to that verification loop, but they do not exist at the base SHA, so git rev-parse $TRUSTED_ADMISSION_SHA:$path fails and the step refuses; the request-time gate and the final-eligibility fetch (contents/...?ref=$base) would fail the same way. The PR cannot qualify itself, and merging it unqualified is not an option.

Unblocking work (a workflow/Rust-build change I cannot iterate here): split into two landings. (1) Land the verifier, shell script, Rust test, allowlist rows and the self-test hook only, with no routed-rust.yml wiring and no new bundle-loop names; (2) a follow-up wires request-time and final-eligibility use after the files exist on main. Also change the && chaining in action.yml's self-test into its own line so a failure is not masked. Same limit is documented in #12486 (a PR changing admission is judged by the old code). No Steven decision needed beyond that restructure; #12703 rerun-admission design may touch the same final-eligibility block, so coordinate before step 2.


Generated by Claude Code

author=$(jq -r '.user.login' <<<"$pr")
fi
reviews=$(gh api --paginate "repos/$repository/pulls/$pr_number/reviews?per_page=100")
jq -cs '.[0]' <<<"$reviews" | python3 "$trusted_root/.github/actions/pr-candidate-admission/review_disposition.py" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gh api --paginate prints each page as a separate JSON array. jq -cs '.[0]' slurps them into an array of arrays and keeps only the first page, so every review beyond the first 100 is dropped. Reviews come back oldest-first, so the newest ones are lost. A later CHANGES_REQUESTED, a superseding negative COMMENT, or a newer APPROVED can be missed, and the gate can admit or refuse on stale data. Merge all pages instead:

jq -cs 'add // []' <<<"$reviews" | python3 ...
Suggested change
jq -cs '.[0]' <<<"$reviews" | python3 "$trusted_root/.github/actions/pr-candidate-admission/review_disposition.py" \
jq -cs 'add // []' <<<"$reviews" | python3 "$trusted_root/.github/actions/pr-candidate-admission/review_disposition.py" \

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

EffortlessSteven added a commit that referenced this pull request Nov 3, 2026
…ng (#8157) (#12809)

* feat(admission): add shared review-disposition verifier and test (#8157)

First landing of the split of #12503: verifier script, repo-policy test,
process allowlist and changelog fragment. No workflow wiring; that follows
once these files exist on main so the base-SHA trusted bundle contains them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmppWYJxfu8vmR6jBq8

* fix(admission): harden review-disposition verifier per review of record (#8157)

Require the whole first line to be the marker, refuse contradicting
disposition/readiness text on any later line (indented, quoted, bold),
refuse unclosed fences and HTML comments, require trusted
author_association, tie-break on review id. Test asserts exit code 1 plus
the refusal line, uses stdin, and covers the paginated gh path.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmppWYJxfu8vmR6jBq8

* fix(admission): bound gh read with a timeout and refuse on read failure (#8157)

Addresses CodeRabbit finding on 7c50f64: subprocess.run had no timeout
and gh failures surfaced as a traceback instead of a refusal line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmppWYJxfu8vmR6jBq8

* fix(admission): keep reviews from deleted accounts as distinct identities (#8157)

A CHANGES_REQUESTED review with user: null was dropped by the per-login
reducer, letting another reviewer's APPROVED admit. Key such reviews by id.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmppWYJxfu8vmR6jBq8

---------

Co-authored-by: Claude <noreply@anthropic.com>

Copy link
Copy Markdown
Member Author

Closing as superseded by a split of the same claim, so each half could be reviewed and qualified separately (the wiring half edits the admission code that judges the PR, so it had to follow the verifier on main):

The shell wrapper (review_source_gate.sh) was dropped: the gh read is folded into the Python verifier, which avoids a new non-Rust retention rule. Remaining #8157 acceptance is tracked on that issue and on #12835.


Generated by Claude Code

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.

2 participants