Skip to content

fix(pr): keep workflow handoffs stable during concurrent fetches - #205904

Merged
vincentkoc merged 2 commits into
mainfrom
fix/pr-workflow-selection-handoff
Nov 26, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/pr-workflow-selection-handoff

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

A concurrent fetch can advance origin/main after native PR tooling captures its workflow selection. The supervised child then rejects the unchanged selected code before locked qualification, interrupting correction preparation and recovery.

User Impact

Maintainers can continue a captured workflow across normal shared fetches. Fresh official-main authentication, the complete executing-source comparison, and exact successor and review identities remain enforced. This changes maintainer tooling only.

Why This Change Was Made

The descriptor reader uses its held source as the checkpoint for admission, recovery and successor validation. It still requires direct, readable canonical tracking and selected-source ancestry. The existing operation-lock owner still fetches and authenticates fresh main, verifies the complete executing closure and selects its producer.

The CI repair also restores completed test fixtures as one unit: files plus their execution environment. Reused setups previously retained hooks pointing to deleted fixture directories. First-admission setup now creates its binding through the native owner before consumers read it.

Related: #199006 addresses broader baseline-proof equivalence; it does not replace this repair across all three descriptor readers.

Production delta: +14/-5 (net +9), for the shared canonical-ref validator and captured checkpoint. Tests: +176/-12. The CI follow-up changes tests only.

Evidence

  • Signed candidate: baac12330086d42d2155fd49bb1a2bdd12638028; frozen base: d4cdcfc70cf5165142c233f2e501a91d523e89f3.
  • The original native operation refused after shared tracking advanced during the held-descriptor handoff, before operation-lock/private-main qualification. Its selected source and retained binding were unchanged.
  • Ordinary commit hooks, targeted formatting, shell syntax and diff whitespace checks passed. Independent source review and fresh P0–P3 autoreview cover the complete candidate: no actionable findings.
  • The prior exact-head CI run exposed missing fixture binding setup and execution-environment leakage. Those failures are repaired here; the old run is not passing proof.
  • Exact-head CI passed on baac12330086d42d2155fd49bb1a2bdd12638028: all 60 jobs settled without failures; required openclaw/ci-gate passed. Direct Bun results: current-workflow recovery 38/38, workflow successor 77/77, auto-replacement 58/58, prior-CI recovery 21/21, main-drift 66/66, auto-recovery 35/35, and source closure 1/1. Wrapper tests: 131 passed/3 skipped. All four new handoff cases explicitly passed.
  • Added cases cover same-closure tracking advancement, late invalid canonical refs, strict successor destination rejection after fresh-main qualification, and restoration of execution controls through a real durable workflow outcome. The successor fixture runs actual supervisor/reentry/lock order; the recovery fixture exercises handoff under its existing held lock.
  • Exact-head ClawSweeper review is PASS with no findings. No source change followed that review.

Rank-up move dispositions

  1. Native handoff and exact successor rejection: addressed by the passing actual-entrypoint successor test and admission/recovery reader cases. The successor case preserves supervisor/reentry/lock/private-main order; exact destination mismatches still refuse after fresh-main qualification. The recovery fixture retains its existing held-lock setup. The original observed native refusal confirms the reported pre-lock symptom; it is not presented as a passing test.
  2. Base failures, head passes and substantive CI: the exact candidate's complete affected and sibling suites passed as listed above. A separate baseline-red suite was not run: the qualified launcher refused its tooling dependency mismatch before allocation, and no loader bypass was used. That optional comparison is explicitly unclaimed. The observed source-bound failure, real-entrypoint regression coverage, strict negative cases, source review and exact-head CI provide the landing evidence.

The production owner changes only descriptor consumption of captured authority. Fresh official-main ancestry and full executing-closure authentication, exact successor/review identities, lease/custody checks and failure visibility remain unchanged. The fixture follow-up restores its authoritative completed state at the lifecycle owner; no production workaround was added.

@vincentkoc vincentkoc self-assigned this Nov 26, 2026
@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Nov 26, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 26, 2026
@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR preserves captured workflow selections across concurrent fetches and restores execution environments when reusing test fixtures.

Example: During current-workflow admission for PR 123, origin/main advances to an equal-tree descendant after selection is captured.

  • Before: The descriptor reader rejects the captured source before locked qualification.
  • After: The reader accepts the captured checkpoint, and locked qualification independently authenticates fresh main before proceeding.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and source-consistent, but required behavioral proof is absent and the repaired fixtures lack a demonstrated passing run.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Maintainers can lose an otherwise valid preparation or recovery operation when another fetch advances shared main tracking during supervision.
Reason: The maintainer-authored direction restores documented workflow continuity through a small change to the existing owner.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a source-visible workflow handoff failure still present on main, and this review found no discrete code defect.

Reviewed head: baac12330086d42d2155fd49bb1a2bdd12638028

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Show successful native handoff continuation across a concurrent fetch and rejection of an advanced exact successor destination, together with base-red/head-green regression results; redact credentials and non-public endpoints.
Agent review details

How this fits together

The native PR wrapper carries selected tooling through supervision, then authenticates its complete source under the operation lock before admitting preparation, recovery, or landing work.

flowchart TD
A[Maintainer command] --> B[Capture workflow selection]
B --> C[Held descriptor]
C --> D[Supervised reader]
D --> E[Operation lock]
E --> F[Authenticate fresh main]
F --> G[Verify source and request identities]
G --> H[Execute admitted operation]
Loading

Technical review

Best possible solution:

Keep the captured descriptor checkpoint stable and let the existing locked qualification owner authenticate fresh main and enforce exact successor identities.

Do we have a high-confidence way to reproduce the issue?

Current main compares a captured workflow source with mutable origin/main during descriptor reentry, so a concurrent advancement rejects unchanged selected code before fresh locked qualification; this review executed no target code.

Is this the best way to solve the issue?

The patch fixes the comparison at its existing owner, updates all three affected readers, and preserves fresh source authentication and exact successor checks without adding persisted state or a competing admission path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 88b3ba0fd4e6.

Provenance checked

  • Captured workflow selection keeps the original intent (c821108: Retain authenticated workflow identity across maintainer commands and carry selection through a private descriptor.)
  • Current-main recovery and admission changes intended behavior with a stated reason (649f269: Allow explicit recovery through freshly authenticated official-main tooling while preserving the retained binding and historical evidence; later admission and successor changes reused this boundary.)
  • Exact workflow succession keeps the original intent (a5d55e1: Continue reviewed corrections with repaired official-main tooling while preserving exact source, review, publication, and operation-lock identities.)
  • Completed fixture reuse keeps the original intent (076d84e: Reuse completed recovery setups at their original absolute paths so retained Git worktree links and evidence remain valid.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced production hunks use selection.source as the descriptor-read checkpoint for successor, admission, and recovery while retaining canonical tracking validation and selected-source ancestry. (scripts/pr:546, baac12330086)
  • Current main retains the failure path: Main's descriptor readers still compare the held selection against mutable origin/main through requireSuccessor, requireAdmission, and requireRecovery. (scripts/pr:546, 88b3ba0fd4e6)
  • Fresh qualification remains authoritative: admit_pr_workflow_binding fetches operation-owned main, verifies the complete executing source, checks lock ownership, and revalidates the exact successor request before admission. (scripts/pr:850, baac12330086)
  • Fixture repair: Completed setup reuse now restores captured execution controls alongside files; first-admission setup creates its retained binding through workflow-admit before consumers read it. (test/scripts/pr-merge-outcome.test-support.ts:99, baac12330086)
  • Proof and current-head checks: The complete PR body explicitly reports no runtime pass and no baseline-red suite run; REST checks for the pinned head still showed substantive runtime jobs in progress. (baac12330086)
  • Related work remains distinct: fix(pr): retain equivalent reviewed workflows for baseline proof #199006 adds reviewed-workflow equivalence for proof-baseline admission; its scripts/pr patch retains ordinary requireAdmission(selection.source), so it does not replace this repair across the descriptor readers. (scripts/pr, 281a12b932b7)

Likely related people:

  • Vincent Koc: Raw commit 71ae98c adds scripts/pr:244 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 71ae98c377fb; files: scripts/pr)
  • Jason (Json): Raw commit 649f269 adds scripts/pr:199 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 649f269e4471; files: scripts/pr)
  • Dallin Romney: Raw commit 47ad508 adds scripts/pr:537 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 47ad50865b71; files: scripts/pr)

PR surface

Tests +164, Other +9. Total +173 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 176 12 +164
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 14 5 +9
Total 4 190 17 +173

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test changes Production +14/-5; tests and test support +176/-12 The production change stays within the existing wrapper owner; test growth covers distinct handoff modes, canonical-ref faults, exact successor rejection, and fixture restoration.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide the native handoff and exact successor-rejection evidence described in the proof assessment.
  • Demonstrate intended base failures and head passes, and complete substantive current-head CI.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-26T10:46:04.880Z sha 53ccf4c :: needs maintainer review before merge. :: none

Reviewed November 26, 2026, 6:11 AM ET / 11:11 UTC (Revision 2).

@vincentkoc
vincentkoc marked this pull request as ready for review November 26, 2026 10:47
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review current head baac12330086d42d2155fd49bb1a2bdd12638028. The CI-discovered fixture binding and execution-environment leaks are repaired; production handoff guards are unchanged. The PR body records the current proof and pending exact-head CI.

@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc merged commit d62da75 into main Nov 26, 2026
118 checks passed
@vincentkoc
vincentkoc deleted the fix/pr-workflow-selection-handoff branch November 26, 2026 11:37
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
…nclaw#205904)

* fix(pr): preserve captured workflow selection across handoff

* test(pr): restore complete workflow fixture state
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…5904)

* fix(pr): preserve captured workflow selection across handoff

* test(pr): restore complete workflow fixture state

(cherry picked from commit d62da75)

Companion audit: Apply ordered eaeea67 before d62da75. 83fc727, 0f27d5e, b5023a7, f75bd91 and 712db11 cover independent tooling refresh, cleanup, and reset-fork fixtures; 0dc0187 is separately selected as row 57.

Release adaptation: Restore the approved proof handoff and make its existing cache restore execution state alongside files, without importing unrelated maintenance fixture APIs.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant