fix(refs): CAS guard on write_branch_ref prevents concurrent commit orphaning
write_branch_ref gains an optional expected_id parameter. When provided, the write is protected by an flock-serialised read-check-write so two concurrent callers with the same expected_id cannot both pass the check before either rename lands. Raises RefConflictError on mismatch.
commit passes parent_id as expected_id so any concurrent advance of the branch between the parent-read and the ref-write is caught and surfaced as a retryable error rather than silently orphaning a commit.
Added RefConflictError to muse.core.store and _SENTINEL sentinel for distinguishing 'no expected_id provided' from 'assert no prior ref'.
10-test regression suite in test_commit_concurrent_ref_safety.py covering CAS unit behaviour, commit branch-moved detection, and concurrent thread serialisation.
0 comments
muse hub commit comment sha256:4096fc35c279dc5d153c84708ab9a3dc64d85b81be564636239935f468fcce47 --body "your comment"
No comments yet. Be the first to start the discussion.