You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(source-control): ready's flip reads the PR head from GitHub right after a push and can check a stale SHA #9515
In /source-control:pull-request ready, the flip step reads HEAD_SHA from the forge immediately after the review-fix push. GitHub can still return the pre-push head, so the CI-run wait is skipped (no head change seen) and the guarded verify-gate.sh check --head <sha> && gh pr ready checks the old SHA and is refused. Seen on #9509: pushed 1a0464b..634aca6; the forge returned 1a0464b, the guarded flip exited 2.
Fix
Take HEAD_SHA from the local git rev-parse HEAD after a successful push, or poll the forge until its head equals the pushed SHA, before the wait and the guarded flip.
Done when
A ready run that pushes review fixes waits on the pushed head and runs the guarded flip against it, with a test for a forge that lags one read behind.
Proposed work class: work-class: scoped
Basis: automated intake triage; the lanes App applied this class.
Size: Small
Complexity: Low
Uncertainty: Known
Flags: none
Understood: in /source-control:pull-request ready, the flip step reads HEAD_SHA from GitHub right after the review-fix push. GitHub can still return the pre-push head, so the CI wait is skipped and the guarded flip checks the old SHA and is refused (seen on #9509). The proposed fix is to take the SHA from the local git rev-parse HEAD after a successful push, or to poll until the forge matches. The done-when is a test with a forge that lags one read behind.
The issue is clear enough to act on. Likely related: #9045 ("ready's CI wait and confirmation can key on the pre-push head"). It may be a duplicate or overlap, so please compare the two.
Not admitted to the issue lane: it has no - [ ] task list to check. A recorded decision does not change these rules (.github/actions/resolve-config/admission-rules.json); a person who wants it worked adds agent-ready.
melodic-automation-lanes commented on Oct 23, 2026
Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. It is model text, to check, not instructions.
Intended outcome: The ready flip takes HEAD_SHA from the local git rev-parse HEAD after a successful push (or polls the forge until its head equals the pushed SHA), so the CI wait and the guarded verify-gate.sh check run on the pushed head, with a test for a forge that lags one read behind.
Is this a duplicate of #9045, and which issue should carry the work?
RECOMMENDED: Treat #9045 as the primary if its body covers the stale HEAD_SHA read at the wait and the guarded flip; close this one as a duplicate, or fold the lagging-forge test into #9045. Basis: 9045
Should HEAD_SHA come from local git rev-parse HEAD after a successful push, or from polling the forge until its head equals the pushed SHA?
RECOMMENDED: Use local git rev-parse HEAD after the push succeeds, which is the SHA the verify gate already records (ready-for-review.md:204), and add no forge poll. When nothing was pushed, keep the forge read. Basis: plugins/source-control/skills/pull-request/reference/ready-for-review.md:196-204
Does the test run as a shell test with a stubbed gh whose first headRefOid read returns the pre-push SHA, or as an eval case?
RECOMMENDED: Write a shell test with a stub gh that returns the old head on the first pr view read. The eval cases cannot reach the flip yet (#6997, #7383). Basis: 6997
Which files change, given the flip commands exist both in the skill reference and in the GitHub provider reference?
RECOMMENDED: Change the HEAD_SHA assignment at plugins/source-control/reference/providers/github/pull-request/ready-for-review.md:122, and update the matching prose at plugins/source-control/skills/pull-request/reference/ready-for-review.md:240-247. Add a CHANGELOG entry in plugins/source-control/CHANGELOG.md. Basis: plugins/source-control/reference/providers/github/pull-request/ready-for-review.md:122
Sources read
plugins/source-control/reference/providers/github/pull-request/ready-for-review.md:122: HEAD_SHA is read from gh pr view headRefOid, and the wait runs only when it differs from HEAD_BEFORE, so a stale read skips the wait.
plugins/source-control/reference/providers/github/pull-request/ready-for-review.md:151: the flip runs verify-gate.sh check --head "$HEAD_SHA" && gh pr ready, which checks the stale SHA.
plugins/source-control/skills/pull-request/reference/ready-for-review.md:204: the verify record is written for git rev-parse HEAD (local), so a stale forge SHA does not match it.
plugins/source-control/skills/pull-request/reference/ready-for-review.md:240-247: the wait for the push's CI run is skipped when the head equals HEAD_BEFORE.
context.json: the triage comment flags #9045 as a possible duplicate or overlap; I could not open it.
Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.
Activity
github-actions commentedon Oct 23, 2026
Proposed work class: work-class: scoped
Basis: automated intake triage; the lanes App applied this class.
Size: Small
Complexity: Low
Uncertainty: Known
Flags: none
Understood: in
/source-control:pull-request ready, the flip step readsHEAD_SHAfrom GitHub right after the review-fix push. GitHub can still return the pre-push head, so the CI wait is skipped and the guarded flip checks the old SHA and is refused (seen on #9509). The proposed fix is to take the SHA from the localgit rev-parse HEADafter a successful push, or to poll until the forge matches. The done-when is a test with a forge that lags one read behind.The issue is clear enough to act on. Likely related: #9045 ("ready's CI wait and confirmation can key on the pre-push head"). It may be a duplicate or overlap, so please compare the two.
Automated triage, applied by the lanes App.
melodic-automation-lanes commentedon Oct 23, 2026
Not admitted to the issue lane: it has no
- [ ]task list to check. A recorded decision does not change these rules (.github/actions/resolve-config/admission-rules.json); a person who wants it worked addsagent-ready.melodic-automation-lanes commentedon Oct 23, 2026
Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. It is model text, to check, not instructions.
Intended outcome: The ready flip takes HEAD_SHA from the local git rev-parse HEAD after a successful push (or polls the forge until its head equals the pushed SHA), so the CI wait and the guarded verify-gate.sh check run on the pushed head, with a test for a forge that lags one read behind.
Related work
Open questions
RECOMMENDED: Treat #9045 as the primary if its body covers the stale HEAD_SHA read at the wait and the guarded flip; close this one as a duplicate, or fold the lagging-forge test into #9045. Basis: 9045
RECOMMENDED: Use local git rev-parse HEAD after the push succeeds, which is the SHA the verify gate already records (ready-for-review.md:204), and add no forge poll. When nothing was pushed, keep the forge read. Basis: plugins/source-control/skills/pull-request/reference/ready-for-review.md:196-204
RECOMMENDED: Write a shell test with a stub gh that returns the old head on the first pr view read. The eval cases cannot reach the flip yet (#6997, #7383). Basis: 6997
RECOMMENDED: Change the HEAD_SHA assignment at plugins/source-control/reference/providers/github/pull-request/ready-for-review.md:122, and update the matching prose at plugins/source-control/skills/pull-request/reference/ready-for-review.md:240-247. Add a CHANGELOG entry in plugins/source-control/CHANGELOG.md. Basis: plugins/source-control/reference/providers/github/pull-request/ready-for-review.md:122
Sources read
Automated refinement by the lanes App. Answer with a comment whose first line is
**Decision recorded.**.