Conversation
gadievron
requested review from
dgeyshis,
shahar-davidson and
sounil
as code owners
September 22, 2026 00:55
Collaborator
Author
|
Status: ON HOLD — do not merge. The adversarial review (2026-09-22) found defects in this PR that need rewriting before it can merge. The specific finding is in the review record. The PR is being rewritten; the current branch and all evidence are preserved. Agent: ISSUES-TO-PR ses_f3e7372a5ffe3b2I6lP4Wm3w2d |
added 2 commits
September 22, 2026 13:55
…heckout (#665) Rewrite of the previous attempt (which used a defer-based restore inside FetchPR — a defect the adversarial review caught: the defer fired BEFORE the caller and the Python engine read the tree, making every --pr scan read the user's original checkout instead of the PR, and leaving HEAD detached). The correct fix: the PR head fetches into a unique non-branch ref (refs/openant/pr/<N>/<pid>) and checks out DETACHED. A detached checkout never blocks a re-fetch (the second --pr refusal is gone) and never leaves a branch behind (the shared-name race is gone). NO defer — the checkout persists until the caller moves the tree, which is the correct contract: 'openant scan <repo> --pr N' scans the PR tree, and 'openant scan <repo>' (no flags) naturally reads whatever tree is there. Fixes #665 Agent: ISSUES-TO-PR ses_f3e7372a5ffe3b2I6lP4Wm3w2d
…rt order (#665) F1: diff_shared.go's user-facing message and diff.go's doc comment still said 'pr-head' — now they say what actually happens (unique ref, detached checkout). F2: the os import order per gofmt. Agent: ISSUES-TO-PR ses_f3e7372a5ffe3b2I6lP4Wm3w2d
gadievron
force-pushed
the
fix/665-pr-head-unique-restore
branch
from
September 22, 2026 11:14
939960a to
d2ae711
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
FetchPRnow fetches the PR head into a unique non-branch ref (refs/openant/pr/<N>/<pid>) and checks out DETACHED. Closes #665.Why the previous attempt was wrong
The first version used a
defer-based restore insideFetchPR. The defer fired before the caller (and the Python engine) read the tree — every--prscan read the user's original checkout instead of the PR, and the "restore" left HEAD detached. Caught by the adversarial review + a real T1 dispatch; rewritten.The correct fix
refs/openant/pr/<N>/<pid>): a different ref per invocation (the PID kills the shared-name race); a non-branch ref never blocks a force-fetch (the second---prrefusal is gone).scan --pr Nscans the PR tree, andscan(no flags) naturally reads whatever tree is there.Testing
The T1 round-1 executed repro (fake
gh+ localrefs/pull/7/head):fatal: refusing to fetch into branch 'refs/heads/pr-head'(the bug)--force): all ok;ChangedFiles=[f.txt g.py]on the PR head (not the user's tree); tree content =prgo build,go vet,gofmtall clean.Known limitations
Fixes #665
Agent: ISSUES-TO-PR ses_f3e7372a5ffe3b2I6lP4Wm3w2d