Skip to content

fix: recover PR preparation after committed merge conflicts - #148063

Merged
fuller-stack-dev merged 2 commits into
mainfrom
fix/pr-committed-merge-transition-58bb
Sep 14, 2026
Merged

fuller-stack-dev merged 2 commits into
mainfrom
fix/pr-committed-merge-transition-58bb

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Related: #132180, #144431

What Problem This Solves

Fixes native PR preparation refusing to leave a clean checkout after a resolved merge has been committed.

User Impact

Maintainers can continue review and preparation without manually clearing Git conflict metadata. This changes maintainer tooling only.

Why This Change Was Made

Git keeps the resolved conflict stages in its index after a merge commit. The transition validator currently rejects every such record. The repair accepts records only when their stages match the source's latest first-parent merge and unique merge base, and their current index entry matches the committed source. Hidden flags, uncommitted edits, foreign stages and ambiguous ancestry still refuse recovery.

The existing native restore path owns the transition. No bypass or metadata-clearing command is added.

Evidence

  • Two real-Git committed-merge cases fail against the unchanged validator, then pass with the repair. Four uncommitted/foreign-state refusal controls pass and preserve index bytes.
  • The candidate validator accepts the retained fix(nodes): reduce completion delays and clarify execution outcomes #132180 index with all 124 records tied to its 42 committed merge paths. This was read-only; index bytes, transition journal and operation evidence stayed unchanged.
  • Three selected existing native controls pass: interrupted transition recovery, intent-to-add refusal and foreign resolve-undo refusal. The other 85 cases were excluded by the filter, not counted as passing. Existing containment tests are unchanged.
  • Required resulting-head CI remains pending. The separate six Bash5 workflow cases belong to fix(nodes): reduce completion delays and clarify execution outcomes #132180 and are not claimed here.
  • All required changed checks passed across the retained initial run and focused continuations. Initial aggregate failed on required braces, which are corrected; it is not relabelled green. Final-byte independent review passed with no P0–P2 findings. No runtime, installed app or native worker was launched.

@clawsweeper

clawsweeper Bot commented Sep 14, 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.

@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 14, 2026 07:37
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@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 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 4:08 AM ET / 08:08 UTC.

ClawSweeper review

What this changes

The PR allows PR preparation to recover from committed merge conflicts by validating retained Git conflict records against committed history, and adds acceptance and preservation tests.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused repair: current main still rejects committed conflict metadata, and the earlier merged recovery work does not handle this case. No blocking introduced defect was found.

Priority: P2
Reviewed head: 5181f62d5bd8b1aa5760caae57895d7ae6cef227

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful Git-backed regression coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its recorded real-Git cases and retained-index probe exercise the changed validator, but do not claim a complete native preparation run; no material principal-authorization change activates an additional proof gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its recorded real-Git cases and retained-index probe exercise the changed validator, but do not claim a complete native preparation run; no material principal-authorization change activates an additional proof gate.
Evidence reviewed 8 items Current main still has the reported refusal: The fetched main validator rejects every nonempty resolve-undo record set at line 132; it has no exception for a committed merge.
Bounded exception in the introduced patch: The exception requires a two-parent latest first-parent merge, one merge base, matching retained stages, and an index entry equal to the committed source. Every accepted path enters the existing working-file inspection.
Existing recovery owner remains authoritative: The shell caller validates endpoints, rejects unmerged and ignored-overlap state, invokes the validator, then uses the existing read-tree and native restore sequence. The PR does not change journal storage, operation locking, checkout containment, or remote merge authorization.
Findings None None.
Security None None.

How this fits together

OpenClaw's PR tooling validates checkout state before replaying a journaled Git transition. The validator compares committed trees, index entries, and working files so preparation can proceed without overwriting unrelated work.

flowchart TD
  A[Journaled source and target] --> C[Transition validator]
  B[Git index and working files] --> C
  D[Committed merge history] --> C
  C --> E{State matches known trees?}
  E -->|Yes| F[Existing native Git recovery]
  E -->|No| G[Refuse and preserve state]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +100, Other +47. Total +147 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 100 0 +100
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 51 4 +47
Total 2 151 4 +147

Review metrics

None.

Technical review

Best possible solution:

Keep committed-conflict admission inside the existing transition validator, preserving refusal of unknown state and the single native recovery path.

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

Yes, from source: retained resolve-undo entries after a committed conflict resolution necessarily hit current main's blanket rejection. The PR supplies real-Git regression cases; this review did not execute them.

Is this the best way to solve the issue?

Yes. The patch narrows the existing admission check while reusing committed-tree comparison and native recovery, avoiding a bypass or a competing repair mechanism.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 069710f909f0.

Labels

Label changes:

  • add P2: This fixes a concrete PR-preparation failure with a limited maintainer-tooling blast radius.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its recorded real-Git cases and retained-index probe exercise the changed validator, but do not claim a complete native preparation run; no material principal-authorization change activates an additional proof gate.

Label justifications:

  • P2: This fixes a concrete PR-preparation failure with a limited maintainer-tooling blast radius.
  • 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 MEMBER-authored PR is exempt from the external-contributor proof gate. Its recorded real-Git cases and retained-index probe exercise the changed validator, but do not claim a complete native preparation run; no material principal-authorization change activates an additional proof gate.

Evidence

What I checked:

  • Current main still has the reported refusal: The fetched main validator rejects every nonempty resolve-undo record set at line 132; it has no exception for a committed merge. (scripts/pr-lib/review-transition-state.mjs:132, 069710f909f0)
  • Bounded exception in the introduced patch: The exception requires a two-parent latest first-parent merge, one merge base, matching retained stages, and an index entry equal to the committed source. Every accepted path enters the existing working-file inspection. (scripts/pr-lib/review-transition-state.mjs:39, 5181f62d5bd8)
  • Existing recovery owner remains authoritative: The shell caller validates endpoints, rejects unmerged and ignored-overlap state, invokes the validator, then uses the existing read-tree and native restore sequence. The PR does not change journal storage, operation locking, checkout containment, or remote merge authorization. (scripts/pr-lib/worktree.sh:113, 5181f62d5bd8)
  • Focused regression and preservation coverage: The complete new test file exercises real Git merges, acceptance immediately after commit and after a follow-up commit, and refusal of working-tree edits, staged edits, assume-unchanged flags, and foreign undo records. Each validator invocation checks index-byte preservation. Tests were inspected, not executed in this read-only review. (test/scripts/pr-review-transition-state.test.ts:44, 5181f62d5bd8)
  • Captured operational evidence: The supplied PR body reports two fail-before/pass-after real-Git cases, four preservation controls, and read-only acceptance of 124 retained records across 42 committed paths from fix(nodes): reduce completion delays and clarify execution outcomes #132180. It explicitly limits the claim to validator acceptance and selected controls, without claiming a complete preparation run. (5181f62d5bd8)
  • Earlier recovery history and routing: The validator's existing source lines trace to commit 4cb2023, associated with merged fix(pr): recover partially written review transitions #144431. Raw commit records identify parent 458f998; the validator path is absent from that parent. GitHub commit metadata maps the author to steipete. That earlier PR explicitly retained blanket resolve-undo refusal. (scripts/pr-lib/review-transition-state.mjs:159, 4cb202363d3a)

Likely related people:

  • Peter Steinberger: Raw commit 4cb2023 adds scripts/pr-lib/review-transition-state.mjs:112 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4cb202363d3a; files: scripts/pr-lib/review-transition-state.mjs)

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.

@fuller-stack-dev
fuller-stack-dev merged commit d02935e into main Sep 14, 2026
83 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/pr-committed-merge-transition-58bb branch September 14, 2026 08:32
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 14, 2026
* commit 'a08cdc50bc049074ed7ad2db9e18e0ed3f5415ec': (81 commits)
  perf: reuse stateless plugin scope defaults (#148080)
  fix(gateway): flush slow-consumer 1008 close frame before terminating socket (#147707)
  fix: keep model catalogs loading during other session updates (#147878)
  fix: show queued external chat messages and their source (#147848)
  refactor(chat): share math label configuration (#148073)
  perf(ui): trim eager debug overlay icon payload (#147954)
  improve(logbook): sample batch frame metadata in SQLite (#147999)
  fix(ui): dismiss suggested task cards without waiting (#148021)
  fix(maturity): cover governance, interoperability, fleet, and state (#143528)
  chore(ui): restore core lint and startup budget checks (#148010)
  fix: chat startup loads unnecessary session setup text (#147973)
  perf: speed up fresh cloud worker activation (#147945)
  fix: recover PR preparation after committed merge conflicts (#148063)
  test(plugins): isolate ClawHub Docker fixture identity (#148074)
  fix(release): acknowledge ClawHub risk on moving installs (#148041)
  fix: restore context reads for installed official Discord and Slack plugins (#143341)
  fix: identify source capsule filesystem failures (#147778)
  fix(linux): keep Quick Chat widgets bound to their Gateway (#146049)
  refactor(infra): consolidate update campaign reset ownership (#146555)
  refactor: simplify Gateway health response parsing (#147834)
  ...
vincentkoc added a commit to nvtoroy/openclaw that referenced this pull request Sep 15, 2026
* commit '7d485aa2e89af7fdbd09e8ed0489b06d250b07e3':
  test(scripts): check the configurable ClawHub sweep spec
  fix: show queued external chat messages and their source (openclaw#147848)
  refactor(chat): share math label configuration (openclaw#148073)
  perf(ui): trim eager debug overlay icon payload (openclaw#147954)
  improve(logbook): sample batch frame metadata in SQLite (openclaw#147999)
  fix(ui): dismiss suggested task cards without waiting (openclaw#148021)
  fix(maturity): cover governance, interoperability, fleet, and state (openclaw#143528)
  chore(ui): restore core lint and startup budget checks (openclaw#148010)
  fix: chat startup loads unnecessary session setup text (openclaw#147973)
  perf: speed up fresh cloud worker activation (openclaw#147945)
  fix: recover PR preparation after committed merge conflicts (openclaw#148063)
  test(plugins): isolate ClawHub Docker fixture identity (openclaw#148074)
  fix(release): acknowledge ClawHub risk on moving installs (openclaw#148041)
  fix: restore context reads for installed official Discord and Slack plugins (openclaw#143341)
  fix: identify source capsule filesystem failures (openclaw#147778)
  fix(linux): keep Quick Chat widgets bound to their Gateway (openclaw#146049)
  refactor(infra): consolidate update campaign reset ownership (openclaw#146555)
  refactor: simplify Gateway health response parsing (openclaw#147834)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
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: S 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