Skip to content

fix(release): tolerate pulls API lag after the fence's acknowledged push - #8397

Merged
bokelley merged 3 commits into
mainfrom
bokelley/fence-pr-head-lag
Oct 22, 2026
Merged

bokelley merged 3 commits into
mainfrom
bokelley/fence-pr-head-lag

Conversation

@bokelley

@bokelley bokelley commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two of the last four release runs on main quarantined the 3.3.0-beta.0 Version Packages transaction (#7897) with "Release PR changed or left Draft", although nothing had changed it. Run 39711033914 shows the race:

04:19:40.96 push-result  acknowledged:true observed:2b9a9d7…
04:19:41.55 quarantine   "Release PR changed or left Draft"   ← pulls API still reports 4fe5bdf (prior)
04:19:48.56 draft-verified pr:7897 head:2b9a9d7…              ← API converged ~7s later, after rollback

Run 39644947514 (17:34 UTC Oct 21) failed the same way.

Fix: the post-push verifyPR(candidate) becomes awaitPushedPR(candidate). It re-reads only while the PR is the same one (number and node id), still Draft, and still reporting the prior head. It reads at most 10 times, one second apart. Any other mismatch (another head, left Draft, a different PR), or a lag past the bound, goes through verifyPR and quarantines exactly as before. The pre-push check and the finalize checks are unchanged.

Tests:

  • pr-head-lag: the API serves the prior head for 2 reads. The push now completes and finalizes as complete. This test fails without the fence change.
  • pr-head-lag-forever: the transaction still quarantines and the prior ref is restored.
  • All 74 tests/changesets-fence.test.cjs tests pass.

RELEASING.md documents the bounded poll. There's no changeset, because the changeset scope check doesn't treat the fence as protocol surface.

Merging this also triggers the next release run for 3.3.0-beta.0.

🤖 Generated with Claude Code


Open workspace in Conductor

bokelley and others added 2 commits October 22, 2026 04:26
Two of four release runs on main quarantined the 3.3.0-beta.0 Version
Packages transaction (#7897) because the PR read ~0.6s after an acknowledged
push still showed the prior head; the API reported the pushed head seconds
later. The post-push check now polls (10 x 1s) only while the same PR, still
Draft, reports the prior head. Any other mismatch, or a longer lag, fails and
quarantines exactly as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…uring lag

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Oct 22, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ladon verdict: Approve

Approve — clean fix to the changeset fence script.

Checked:

  • verifyPR(candidate) → awaitPushedPR(candidate) tolerates only the specific benign pulls-API lag documented on adcp#7897 (same PR number+node_id, still Draft, head still at state.prior, bounded to 10 one-second polls) — scripts/fence-changesets.cjs:40-63. Any other shape or lag past the bound falls through to verifyPR and quarantines as before; fail-closed preserved.
  • openPR reads stay bounded (60s each); the push's 10-min mutation bound covers the added ~10s poll; lag-forever quarantines and restores the prior ref (test at tests/changesets-fence.test.cjs:132).
  • fence-changesets.cjs is not in PROTOCOL_SCOPED_PATHS, so no changeset is required. No schema/docs/dist surface touched.

No Critical/High/Medium findings. Not a protocol/breaking-class change. gated_paths is false; high_risk is false; no author-team gate. Falls through to row 9.

aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Oct 22, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ladon verdict: Approve

Approve — tooling/release-script refinement, no blocking or medium findings.

This is a subsequent pass on a 2-file refinement. scripts/fence-changesets.cjs:12 swaps the pr-head-lag console.log for save({ event: "pr-head-lag", attempt }), moving the lag event into the durable state artifact; save still logs to stdout so the existing stdout assertion holds. Tests add a pr-head-lag-ready fault and a case asserting a Ready transition during pulls-API lag quarantines immediately with zero pr-head-lag events — traced and correct (awaitPushedPR requires pr.draft to keep polling, so a Ready flip falls through to verifyPR and throws). Bounded polling (10×1s) sits inside the already-bounded push path.

Changed files are release/CI tooling and tests only — no static/schemas/source/**, docs/reference/**, dist/**, migrations, or protocol surface touched; schema↔docs, changeset-scope, oneOf, and artifact-immutability gates are not implicated. high_risk false, gated_paths false, no no-auto-approve team match. Prior decision was approve; current run surfaces no critical/high/medium findings. Falls through to row 9.

Comment thread tests/changesets-fence.test.cjs Fixed
@bokelley
bokelley merged commit 8f4ab4a into main Oct 22, 2026
31 checks passed
@bokelley
bokelley deleted the bokelley/fence-pr-head-lag branch October 22, 2026 04:59
bokelley added a commit that referenced this pull request Nov 12, 2026
…ush (#8397) (#8959)

* fix(release): tolerate pulls API lag after the fence's acknowledged push

Two of four release runs on main quarantined the 3.3.0-beta.0 Version
Packages transaction (#7897) because the PR read ~0.6s after an acknowledged
push still showed the prior head; the API reported the pushed head seconds
later. The post-push check now polls (10 x 1s) only while the same PR, still
Draft, reports the prior head. Any other mismatch, or a longer lag, fails and
quarantines exactly as before.



* fix(release): record fence PR-head lag as a state event; test Ready during lag



* test(release): lagging pulls stub reads without a check-then-use race



---------


(cherry picked from commit 8f4ab4a)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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