Skip to content

fix(repair): recover unavailable state objects in ledger publish - #712

Merged
steipete merged 1 commit into
mainfrom
fix/state-ledger-missing-objects
Jul 20, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/state-ledger-missing-objects

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Restores the apply/close pipeline, down since 2026-07-19 ~23:30Z.

Every "Apply default ClawSweeper closures" run failed publishing the immutable apply-proof ledger to clawsweeper-state: fatal: entry '<hash>.json' object <sha> is unavailable — the shallow state checkout (preserved by #708) holds tree entries whose blobs were never fetched, so the ledger tree rebuild references locally-missing objects and the push dies, aborting the apply before any closes. The latest runs additionally hit an unguarded throwing git merge-base in the prepare phase (the sibling of the site #711 guarded).

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

  • Ledger publish now recovers unavailable objects once per publish: targeted git fetch <remote> <sha>, then --refetch, then --deepen=1, then --unshallow as last resort; rebuilds the ledger commit and retries the push. Happy path stays shallow (fix(publish): preserve shallow state fetches #708 preserved).
  • mergeBaseWithShallowRecovery guards the prepare/overlap/reconcile merge-base sites — shallow no-common-ancestry defers to the remote-head rebuild; genuinely unrelated histories still fail closed. Sweep-status/comment-router sites keep their exceptional throwing behavior.

Validation: build/lint/format green; focused regressions 5/5; full git-publish suite 42/42 excluding the documented CI-token-only server-merge fixture (fails identically on pristine main locally; passes on CI); autoreview clean.

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