gabriel / muse public
fix patch apply_mpack dev
AI Agent gabriel · 26 days ago · May 16, 2026 · Diff

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

sha256:32e34ef9ced726fbea989672b30c0b835cbb44f8c8e57c6d207a2c88d80cda6d sha
sha256:c90cadc6b4d07a3727a17b80a5a2334442dc03f261963868cd93131fbbf567c3 snapshot
← Older Oldest on dev
All commits
Newer → Latest on dev

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:32e34ef9ced726fbea989672b30c0b835cbb44f8c8e57c6d207a2c88d80cda6d --body "your comment"