fix: recover from corrupt snapshot manifest_blob on read
Staging gabriel/muse clone failed because 4 snapshots were stored by a legacy push version (2026-05-27/28) with an empty manifest_blob that no longer reproduces its snapshot_id. The serving path trusted the corrupt cache, the client's hash check failed, the commit was dropped, and every descendant failed 'parent not in mpack' — empty working tree.
Harden the serving path to be self-healing (repair-on-read): - _cached_manifest_reproduces(): validate a cached manifest against its snapshot_id (stored/derived/empty dirs). - _reconstruct_manifest_validated(): walk the parent chain, validate each cached manifest, SKIP corrupt caches (treat as delta-only), apply deltas forward from the nearest intact ancestor. Unlike _reconstruct_manifest, a corrupt blob no longer terminates the walk. - _snap_row_to_wire_s3(): validate the fast-path cache; reconstruct via the validated walker when the cache is absent OR corrupt.
Current push code was proven correct (does NOT reproduce the corruption) — this is a legacy-data defense. Also fixes a stale comment in wire_push_unpack_mpack that claimed delta-only snapshots are 'backfilled by the mpack.index job'; they are not — they are reconstructed on-demand from the delta chain.
Tests (integration, localhost): serve-corrupt recovery (RED->GREEN) + push guard for delta-only external parents. 15/15 existing fetch/serving tests still pass.
Semantic Changes
50 symbols
0 comments
muse hub commit comment sha256:c00aa21d4054a2ab58d31aa5a1a1c4ca8d4a6bdc8a0bf03f7523b545889ae58f --body "your comment"
No comments yet. Be the first to start the discussion.