Skip to content

feat: match CI reviews to the exact pull request - #113

Open
Caerii wants to merge 2 commits into
prooflinedev:mainfrom
Caerii:codex/ci-review-pr-application
Open

Caerii wants to merge 2 commits into
prooflinedev:mainfrom
Caerii:codex/ci-review-pr-application

Conversation

@Caerii

@Caerii Caerii commented Nov 28, 2026

Copy link
Copy Markdown

A CI job can pass using another pull request's review when the two PRs share a head commit. In 16 local comparisons across four public PR pairs, upstream at 5dd916f selected the other PR and exited 0. The patched CLI selected the intended PR and exited 3 on its simulated serious finding.

The PRs and head SHAs came from GitHub. The Proofline responses and credentials came from local fixtures. Both sign-in paths were exercised. No hosted review or gate was run.

The full-SHA search returns the latest run at that commit. When CI knows the PR, it reads that PR's paginated history. Conflicting identity fields stop polling immediately. Pending replies can omit fields, and CI requires a match on repository, PR number, and head before reporting a result or writing SARIF. API search contract

Manual and downstream jobs can specify the PR and head explicitly.

proofline ci review --repo "$REPO" --pr "$PR_NUMBER" --commit "$PR_HEAD_SHA" --fail-on serious

GitHub Actions PR jobs use the event's PR number. An explicit --pr must agree with the PR event, and a supplied event repository must match the selected repository before authentication. Commit precedence remains --commit, COMMIT_SHA, then the event head. Commit-only jobs keep their existing lookup.

Local verification

  • Linux passed 161 tests with one ignored. Formatting, all-targets Clippy, and the dependency audit passed.
  • The native Windows release smoke checks and focused HTTP, SARIF, hook, and polling tests passed.
Replay inputs and focused tests

Each PR was the target once with a test token and once with simulated GitHub Actions OIDC.

Repository Public PRs Shared head
Next.js #102412, #102312 38791ec
Next.js #102411, #102408 f58881a
Go #82695, #82484 11be318
jq #3591, #3590 77b4f25

In the diff, wait_for_head_review handles selection and confirm_ci_subject validates the returned detail. The tests cover pagination, sparse pending replies, and slow replies at the deadline.

cargo test --locked --test http ci_review_
cargo test --locked --lib a_review_still_running_at_the_deadline_is_unavailable
cargo test --locked --lib a_deadline_used_up_before_polling_does_not_start_a_detail_read

Multiple pull requests can share a head commit. The full-SHA search
returns the latest run at that commit, which can belong to a different
PR and decide the job using the wrong review.

Search the repository-scoped PR history when the event identifies a PR.
Reject conflicting subject fields during polling and require the full
identity before reporting a result or writing SARIF. Allow sparse
pending replies to acquire their identity within the wait deadline.
Keep the existing lookup for jobs that only supply a commit.

Exercise both sign-in paths, later-page selection, pending replies, and
deadline behavior in the regression fixtures.
A manual or downstream CI job can have a default SHA from the runner
that differs from the head of the pull request being reviewed. Let the
job pass --pr with a full --commit and reuse the exact PR lookup.
Reject an explicit PR number that disagrees with the PR event.

Document the command and cover downstream selection and invalid input
at the CLI boundary.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T21:16:10.336492Z 5bbdfb4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Caerii Caerii changed the title Match CI reviews to the exact pull request feat: match CI reviews to the exact pull request Nov 28, 2026

This branch has not been deployed

No deployments
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