gabriel / musehub public
fix patch bundle-index dev #71 / 100
AI Agent gabriel · 26 days ago · May 15, 2026 · Diff

fix(bundle-index): load parent snapshot from DB when resolving delta manifests

process_bundle_index_job was building manifest_blob from only the snapshots in the current push bundle. When a delta push sends only the new snapshot (parent_snapshot_id points to a prior push), the parent was absent from resolved_manifests so base={} and manifest_blob stored only the delta_add entries — not the full accumulated manifest.

On the next pull, wire_fetch_bundle returned this incomplete manifest in snap_map. The client's _apply_snapshot_deltas ran compute_snapshot_id on the incomplete dict, got a hash mismatch, silently skipped the snapshot, and pull aborted with 'snapshot missing or corrupt'.

Fix: before the delta-chain loop, query musehub_snapshot for any parent snapshot_ids not already in resolved_manifests and seed the map from their stored manifest_blob. One extra query per bundle (batch of all parent IDs).

sha256:6bc96704cec71c57cbbe3da39047218297d408b9ea17d46777bf426329788fb3 sha
sha256:b623b64129593ee1c867a5f41780d51d635849c0741f09db38ada0408334806f snapshot

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:6bc96704cec71c57cbbe3da39047218297d408b9ea17d46777bf426329788fb3 --body "your comment"