Repository navigation
fix: finish administrative completion after merge recovery - #140992
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 12:51 PM ET / 16:51 UTC. ClawSweeper reviewWhat this changesAdds 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 Review scores
Verification
How this fits togetherOpenClaw’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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +189, Docs +17, Other +89. Total +295 across 7 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
e9c78ba to
2abefcb
Compare
|
Merged via squash.
|
…140992) * fix: finish administrative completion after merge recovery * test: assert posted merge method at completion boundary
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-runcorrectly 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 defaultmerge-runreconciliation 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
mergedadmin 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 Bashheredoc_write → writestack. 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
9aab449a1e38c146bda6f25b25fcc71e6e5eb9f0ascomplete, retainingb515bab12b799f45ad7838f54f5a7f1781375e13as 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.