Skip to content

fix(review): run-local parallel PR FETCH_HEAD race - #814

Merged
mergify[bot] merged 1 commit into
mainfrom
cursor/review-runlocal-race
Oct 9, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
cursor/review-runlocal-race

Conversation

@Cuarroc

@Cuarroc Cuarroc commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Parallele lokale Reviews im selben Checkout haben sich gegenseitig den PR-Kopf überschrieben. Jeder Lauf holt den PR-Kopf jetzt in eine eigene Ref und schreibt die Head-SHA in den Prompt. Damit prüft jeder parallele Lauf wirklich seinen eigenen Diff.

Report

Package: REVIEW-RUNLOCAL-RACE
Model: Cursor auto
Base: origin/main @ 3395c5852335849f6342020a4350b3132fd8649d
Head: 6728653f92457f0f9fc039ec03b1a0086e309c87
Tier: B (script only; no seam/runtime)
Files: scripts/review/run-local.sh, scripts/test-review-local.sh (exclusive)

What changed

  • PR mode no longer uses shared FETCH_HEAD. It fetches into refs/pa-review/pr-<n> (+pull/<n>/head:refs/pa-review/pr-<n>) and rev-parses that ref.
  • Prompt header gains a Head: <sha> line so a reader can bind the review to the candidate.
  • Regression in scripts/test-review-local.sh: a deterministic git wrapper overwrites FETCH_HEAD after a bare pull/N/head fetch; with the private-ref fix, PR 7 and PR 8 each keep their own diff and Head SHA.

Evidence

Check Command Exit
RED (test only, before fix) bash scripts/test-review-local.sh 1 (FEHLER parallel PR FETCH_HEAD race)
GREEN (self-test) bash scripts/test-review-local.sh 0
red-first bash scripts/ci/red-first.sh 0 (base red/missing ok-line; head green)
prepush bash scripts/ci/gates.sh lane prepush 0
push verify git ls-remote origin cursor/review-runlocal-race 6728653f92457f0f9fc039ec03b1a0086e309c87

Trailer: Test-First: scripts/test-review-local.sh::parallel PR fetches keep distinct diffs (no shared FETCH_HEAD)

Architecture drift

No new findings; no allowlist change.

NICHT ABGEDECKT

  • Linux does not compile/run #[cfg(windows)] tests; Windows lane verdict comes from the Mergify merge queue.
  • Real multi-process race against a live remote was not measured beyond the deterministic FETCH_HEAD overwrite simulation and the existing fake-origin harness.

Review

Review: ausstehend (Stufe B); pending Root dispatch.

Made with Cursor

Root-Abnahme (2026-10-09, head 6728653)

ID Quelle Schwere Befund Disposition
R814-G1 GLM 5.2 (Zhipu), local Ollama (run sequentially; prompt lists exactly scripts/review/run-local.sh, scripts/test-review-local.sh) low run-local.sh:257: refs/pa-review/pr-<N> refs are never pruned follow-up (housekeeping, no correctness effect); not blocking
R814-G2 GLM low test-review-local.sh:490-496: the race-injection wrapper only fires for bare pull/N/head fetches; it guards the FETCH_HEAD regression, not a different shared ref accepted as stated limitation; the test is a valid red→green regression for the observed defect

Verdict: GLM approve. Tier B needs one reviewer outside the author family; the author is Cursor auto (family not exposed), GLM/Zhipu is not a Cursor auto pool family. Bound to head 6728653. Origin of the defect: Root observation 2026-10-09 ~04:50 (three parallel runs for #809/#811/#813 all reviewed the #813 diff).

NICHT ABGEDECKT (Root): no real concurrent run against GitHub in this review; the Windows Git-Bash path of run-local.sh is covered only by the merge-queue Windows lane.

Concurrent run-local.sh runs in one checkout overwrote FETCH_HEAD, so each
prompt could review the wrong PR. Fetch into refs/pa-review/pr-<n> and record
Head: in the prompt.

Test-First: scripts/test-review-local.sh::parallel PR fetches keep distinct diffs (no shared FETCH_HEAD)
Co-authored-by: Cursor <cursoragent@cursor.com>
@Cuarroc
Cuarroc marked this pull request as ready for review October 9, 2026 03:21
@Cuarroc Cuarroc added the review-ok Pipeline: review disposition complete, no open high finding label Oct 9, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T03:26:27.427841Z 6728653 Draft marked ready
ℹ️ 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.

@mergify mergify Bot added the queued label Oct 9, 2026
@mergify
mergify Bot merged commit 847b363 into main Oct 9, 2026
17 checks passed
@mergify
mergify Bot deleted the cursor/review-runlocal-race branch October 9, 2026 03:44
@mergify

mergify Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 14 minutes 42 seconds in the queue, including 14 minutes 27 seconds running CI.

Required conditions to merge
  • check-success = gates (linux)
  • check-success = gates (windows)
  • check-success = red-first
  • github-review-approved [🛡 GitHub repository ruleset rule main-pr-required-checks]
  • label != do-not-merge
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-success = @github-actions/gates (linux)
    • check-neutral = @github-actions/gates (linux)
    • check-skipped = @github-actions/gates (linux)
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-success = @github-actions/gates (windows)
    • check-neutral = @github-actions/gates (windows)
    • check-skipped = @github-actions/gates (windows)
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-success = @github-actions/red-first
    • check-neutral = @github-actions/red-first
    • check-skipped = @github-actions/red-first
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-neutral = @mergify/Mergify Merge Protections
    • check-skipped = @mergify/Mergify Merge Protections
    • check-success = @mergify/Mergify Merge Protections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-ok Pipeline: review disposition complete, no open high finding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant