gabriel / muse public
fix patch store dev
AI Agent gabriel · 46 days ago · Apr 27, 2026 · Diff

fix(store): Phase 2 — parent existence validation in write_commit

Adds MissingParentError(ValueError) and a pre-write guard that rejects any commit whose parent_commit_id or parent2_commit_id does not exist in the local object store.

A dangling parent pointer silently truncates history traversal: walks (log, rebase, push) stop at the gap rather than reaching the true root. Catching it at write time surfaces the corruption with a clear, actionable error instead of letting the bad commit land in the store.

Guard runs before hash verification so callers receive MissingParentError specifically rather than a generic hash-mismatch ValueError.

8-test suite in test_phase2_parent_existence.py: root commits, known parents, unknown parent, unknown parent2, merge commits with both parents, data integrity, ValueError subclass.

sha256:82fa3aa298016896d7b730256d206781e05ee85bbb63ed66c22223917a4117ea sha
sha256:ced3fc0193731e1b67353d8852767abe4bea06573720ebcb0cee55be94f1f1ae 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:82fa3aa298016896d7b730256d206781e05ee85bbb63ed66c22223917a4117ea --body "your comment"