Skip to content

fix(repair): rebuild reconciliation on remote head for unrelated histories - #716

Merged
steipete merged 3 commits into
mainfrom
fix/reconcile-unrelated-history
Jul 20, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/reconcile-unrelated-history

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Third and final fix for the apply/close pipeline outage. After #714, prod run 29732302720 showed the ledger publish succeeding but "Apply close proposals" still dying: Git publish failure: phase=checkpoint ... git merge-base exited 1 — the reconciliation checkpoint's merge-base recovery ladder (deepen → unshallow, 374s in the log) exhausted and the local state history is genuinely unrelated to the remote branch head (orphaned local root after 30h of crashed publishes).

Changes (src/repair/git-publish.ts):

  • mergeBaseWithShallowRecovery returns base: null only for confirmed-unrelated, fully hydrated histories; non-1 errors, failed hydration, and still-shallow states keep throwing.
  • The reconciliation caller rebuilds directly on the remote head for no-base: bounded publications replay only their delta (tuple arbitration against the publication's real parent); unbounded rebuilds fail closed. The preparation caller resets unrelated state to the remote head.
  • Root checkpoints (no parent commit) use a written empty-tree object as the baseline instead of crashing on <root>^ (autoreview-caught edge, two follow-up commits).

Validation: build/lint/format green; git-publish suite 46/47 (the miss is the documented CI-token-only server-merge fixture); new tests cover unrelated preparation, orphaned checkpoint publishing, overlap arbitration, old-history non-resurrection, non-1 errors, and hydration failures; commit-mode autoreview clean (0.99 on final commit).

@steipete
steipete merged commit 846b73c into main Jul 20, 2026
9 checks passed
@steipete
steipete deleted the fix/reconcile-unrelated-history branch July 20, 2026 11:29
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
…ories (openclaw#716)

* fix(repair): rebuild reconciliation on remote head for unrelated histories

* fix(repair): use empty-tree baseline for root reconciliation checkpoints

* fix(repair): write the empty-tree object for root checkpoint baselines
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.

1 participant