fix(apply_mpack): propagate object write failures to prevent dangling references
When write_object raises ValueError (content/ID mismatch) or an object exceeds the size cap, the failed object_id is now tracked in failed_object_ids. Any snapshot whose manifest references a failed object is added to skipped_snapshot_ids and not written. Any commit referencing a skipped snapshot is also not written.
Without this fix: commit → snapshot → (missing object) chains were silently written, corrupting the local store. The write ordering (objects → snapshots → commits) was necessary but not sufficient — failure propagation up the chain was the missing piece.
TDD: tests/test_apply_mpack_partial_failure.py covers four cases: PF-1 poisoned object (hash mismatch) → snapshot + commit not written PF-2 OSError mid-write → caller exception propagates (no snapshots/commits written) PF-3 unaffected commits in same mpack still write when one chain is poisoned PF-4 happy path regression guard — all objects succeed, all commits written
0 comments
muse hub commit comment sha256:32e34ef9ced726fbea989672b30c0b835cbb44f8c8e57c6d207a2c88d80cda6d --body "your comment"
No comments yet. Be the first to start the discussion.