Skip to content

fix(repair): build ledger trees with --missing for remote-known objects - #714

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

steipete merged 1 commit into
mainfrom
fix/ledger-mktree-missing

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Second (root-cause) fix for the apply/close pipeline outage. #712's recovery ladder fired in prod ("Recovering 1 unavailable Git object(s)") but the publish still failed — arbitrary blob SHAs are not reliably fetchable from GitHub, so no fetch strategy can materialize the missing objects.

Root cause: the immutable-ledger tree rebuild reuses unchanged entries from the fetched remote branch tree; a shallow/partial state checkout may not hold those blobs locally, and plain git mktree refuses trees referencing absent objects — even though the push never needs to send them (the remote already has them, by definition).

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

  • Ledger trees are now built with git mktree --missing. Safety: entries we add or modify are batch-verified locally via cat-file --batch-check (cached per source commit) and fail closed with a named error if absent — only remote-known unchanged entries may be locally missing.
  • The no-common-ancestor defer in reconciliationChangesOverlap (the checkpoint-phase path that threw in run 29724509329) now applies on merge-base exit 1 unconditionally, not only for shallow checkouts; other fatal git errors still throw.

Validation: build/lint/format green; git-publish suite 44/45 — the one failure is the documented CI-token-only server-merge fixture (fails identically on pristine main locally; passes on CI). Autoreview clean ("patch is correct", 0.9).

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