Skip to content

fix: finish administrative completion after merge recovery - #140992

Merged
steipete merged 2 commits into
mainfrom
codex/qa2-27-merge-completion-20260907
Sep 7, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/qa2-27-merge-completion-20260907

Conversation

@steipete

@steipete steipete commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Related: #140662

Additional instructions

This branch is in the main repository and remains editable by maintainers.

What Problem This Solves

Fixes an issue where maintainers recovering a confirmed native merge could be left with a permanently pending completion comment and receipt, even after ownership-checked cleanup. Repeating merge-run correctly reconciles the merge but offers no supported way to finish that administrative work.

Why This Change Was Made

Add scripts/pr merge-complete <PR> <OUTCOME_OID> --confirmed-operator-completion, bound to the exact current receipt. Reuse native historical merge validation, compare-and-swap record updates, and one shared comment owner while leaving default merge-run reconciliation unchanged.

The command verifies cleanup absence and never dispatches a merge or deletes resources. A first POST records intent before sending; uncertain comments remain lookup-only. It checks only PR-owned local aliases, preserving unrelated branches with the remote source name. A merged admin receipt remains blocked until its original landing audit is established; marker text cannot substitute for that audit.

User Impact

Maintainers can finish a confirmed merge through an explicit, supported command without hand-editing retained records or risking duplicate merge/comment requests. This is administrative tooling maintenance, with no OpenClaw runtime, configuration, or receipt-schema change.

Evidence

Before the latest main refresh, the finalizer change passed 18 focused real-Git/fake-GitHub completion, normal-flow, and CLI parsing cases, plus the exact hosted normal-merge case. Coverage includes missing first comment after cleanup, idempotence, consumed/stale OIDs, lost and rejected POST responses, ambiguous markers, recreated resources, unrelated local branch preservation, and admin-audit provenance. The missing operation and both ownership corrections have recorded before/after failing regressions.

check:changed, the actual owning root test type graph, full-file lint/format checks, Bash syntax, and independent P2 review pass. The test-only CI correction passed eight focused cases, actual owning type/lint gates, and explicit P2 review. The latest refresh onto main preserves both merge owners and outcome tests byte-for-byte and integrates current wrapper dependency/payload-file changes. Its actual type/lint and explicit P2 review pass. The refreshed local run passed all 11 new completion cases, all four normal method/body cases, and three other normal-flow cases. It remains incomplete: two existing reconciliation cases reached the fixture’s unchanged 20-second subprocess limit, and the wrapper parser fixture stalled with a sampled Bash heredoc_write → write stack. The owned stalled process groups were stopped and reaped; no assertion, timeout, or shell changes were made.

The earlier full real-Git outcome matrix passed 254 cases on the initial implementation; final corrections received the focused final-source proof above. The broader local wrapper run is incomplete, after repeated Bash 5.3.15 trust-selection prelude stalls. Those samples are retained as a separate follow-up; no archive-fault assertion, wrapper guard, or runtime version was changed. Full hosted wrapper and outcome coverage must pass on the exact PR head before landing. After this repair landed, one trusted canonical invocation completed #140662 at 2026-09-07T17:49:44Z. The original native alias was verified from its creation reflog and retained review/preparation provenance, then removed with exact-SHA compare-and-swap. The finalizer recorded receipt 9aab449a1e38c146bda6f25b25fcc71e6e5eb9f0 as complete, retaining b515bab12b799f45ad7838f54f5a7f1781375e13 as ancestry, posted the completion comment exactly once, and dispatched zero merges.

The first head’s CI run failed in two test jobs. The wrapper shard passed 737 tests with one failure and two skips: an old assertion still required the comment-renderer literal in merge.sh. The correction removes that source-location assertion and verifies actual posted method text in the existing normal and delayed-completion cases, preserving method and pinned-head guards. A separate profiling shard passed 367 tests but the first main-help case (--help --unknown-profile-test-option) timed out after 120 seconds. Its owner, dependencies, configuration, and lockfile are identical to the actual CI parent, and the remaining three help cases passed. The next CI run passed the wrapper job but timed out in a different unchanged profiling case (rejects main --pool before evaluating config). Independent investigation subsequently reproduced a Node 24 profiling-startup hang; this branch now contains the upstream repair #141131. No CI retry or timeout change was used. Fresh full CI on the refreshed head is required; prior red results are not treated as passes.

Production/tooling: +138/−49 lines (net +89), including a net 31-line reduction in normal merge handling through shared ownership. Tests: +199/−10 (net +189). Documentation: +17.

@clawsweeper

clawsweeper Bot commented Sep 7, 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: M maintainer Maintainer-authored PR labels Sep 7, 2026
@steipete
steipete marked this pull request as ready for review September 7, 2026 07:51
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 12:51 PM ET / 16:51 UTC.

ClawSweeper review

What this changes

Adds an explicit command to finish a recovered merge’s comment and receipt after verifying cleanup, sharing comment handling with normal merges.

Merge readiness

✅ Ready for maintainer review

This remains useful: current main leaves recovered merges administratively pending, and neither related merged PR supplies this operation. No blocking introduced defect was found. Maintainer authorship and the protected label also preclude cleanup closure.

Priority: P2
Reviewed head: 2abefcbd94325112f2684258af5c5b05115c130d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with shared ownership and meaningful failure-path coverage; no blocking introduced defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its reported completion scenarios exercise production shell owners with real Git and fake GitHub; live completion remains unclaimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its reported completion scenarios exercise production shell owners with real Git and fake GitHub; live completion remains unclaimed.
Evidence reviewed 8 items Current main still lacks completion: Current-main merge_outcome_resume reconciles historical merges and reports completion pending without providing a finalizer. The main wrapper has merge-run and merge-recover but no merge-complete.
Latest-release comparison: The latest release, pinned merge base, and fetched main all reference outcome-owner blob 29fdd63eb95b984783e20c69ef04300fdda69cf1, which lacks the new completion operation.
Completion safeguards: The finalizer checks the supplied current receipt OID, revalidates the historical merge, refuses remaining cleanup resources, blocks first admin-route comments, and rechecks observations before recording completion. It contains no merge dispatch or resource deletion.
Findings None None.
Security None None.

How this fits together

OpenClaw’s native PR tooling records merge outcomes independently of disposable worktrees. The completion command combines that retained receipt with current GitHub and branch observations to finish administrative bookkeeping.

flowchart TD
  A[Operator confirmation and receipt ID] --> B[Trusted PR wrapper and operation lock]
  B --> C[Validate retained merge against GitHub]
  C --> D[Verify cleanup absence]
  D --> E[Find existing comment or attempt first POST]
  E --> F[Recheck cleanup and remote facts]
  F --> G[Record completed receipt]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +189, Docs +17, Other +89. Total +295 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 199 10 +189
Docs 2 17 0 +17
Config 0 0 0 0
Generated 0 0 0 0
Other 3 138 49 +89
Total 7 354 59 +295

Review metrics

Metric Value Why it matters
Operator command surface 1 command added with exact receipt ID and explicit confirmation Administrative finalization is opt-in; ordinary merge recovery retains its reconciliation-only behavior.

Technical review

Best possible solution:

Keep completion explicit and receipt-bound, preserving historical validation, one-attempt comments, and operator-owned cleanup.

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

Yes, from source: recovery of a confirmed merge can only report pending completion, even after cleanup. The production path was inspected but not executed in this read-only review.

Is this the best way to solve the issue?

Yes. An explicit finalizer reuses the existing receipt and comment owners without making ordinary reconciliation repeat side effects or delete resources.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8dde3559a551.

Labels

Label justifications:

  • P2: Repairs a bounded maintainer workflow that leaves confirmed merges administratively pending.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its reported completion scenarios exercise production shell owners with real Git and fake GitHub; live completion remains unclaimed.

Evidence

What I checked:

  • Current main still lacks completion: Current-main merge_outcome_resume reconciles historical merges and reports completion pending without providing a finalizer. The main wrapper has merge-run and merge-recover but no merge-complete. (scripts/pr-lib/merge-outcome.sh:251, 8dde3559a551)
  • Latest-release comparison: The latest release, pinned merge base, and fetched main all reference outcome-owner blob 29fdd63eb95b984783e20c69ef04300fdda69cf1, which lacks the new completion operation. (scripts/pr-lib/merge-outcome.sh, 3928bad9badf)
  • Completion safeguards: The finalizer checks the supplied current receipt OID, revalidates the historical merge, refuses remaining cleanup resources, blocks first admin-route comments, and rechecks observations before recording completion. It contains no merge dispatch or resource deletion. (scripts/pr-lib/merge-outcome.sh:323, 2abefcbd9432)
  • Comment and wrapper ownership: Comment intent is committed through the existing compare-and-swap writer before POST; uncertain attempts remain lookup-only. Landing classification gives the new command existing trusted-wrapper selection and per-PR supervision. (scripts/pr:23, 2abefcbd9432)
  • Focused boundary coverage: Introduced tests cover completion, consumed OIDs, rejected/lost POST responses, unrelated local branches, missing admin audit, recreated resources, ambiguous markers, and normal merge-method comment text. They execute production shell owners with real Git and fake GitHub responses; this review did not execute them. (test/scripts/pr-merge-outcome.test.ts:610, 2abefcbd9432)
  • Captured proof and re-review context: The supplied body reports focused completion and normal-flow passes, explicitly discloses incomplete broader local runs, and states that live completion has not been invoked. Previous completed review projections contain no findings or published rank-up moves. The earlier reviewed SHA was unavailable locally, so byte-for-byte continuity was not independently established. (2abefcbd9432)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-07T07:57:39.888Z sha 2241cd6 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-07T08:34:55.318Z sha e9c78ba :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/qa2-27-merge-completion-20260907 branch from e9c78ba to 2abefcb Compare September 7, 2026 16:44
@steipete
steipete merged commit c79ad26 into main Sep 7, 2026
132 checks passed
@steipete
steipete deleted the codex/qa2-27-merge-completion-20260907 branch September 7, 2026 17:42
@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
…140992)

* fix: finish administrative completion after merge recovery

* test: assert posted merge method at completion boundary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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