gabriel / muse public
fix diff fix/diff-hash-prefix #1 / 1
gabriel · 60 days ago · Apr 16, 2026 · Diff

fix(diff): _hash_file must return sha256: prefix to match content IDs

_read_blob falls back to reading a working-tree file from disk when its object is not yet in the store. It verifies the content matches by comparing _hash_file(path) == content_id.

content_id is produced by StatCache.get_cached() which returns 'sha256:' + hexdigest. _hash_file was returning bare hexdigest — so the comparison always failed, leaving target_trees empty for every modified working-tree file.

Result: muse diff showed 0 added symbols and all base symbols as 'removed', confusing agents into thinking large chunks of code were deleted when they were only modified.

Fix: prepend 'sha256:' in _hash_file to match the canonical format.

sha256:73881434ce04fa4250b82add03426ba298c0a494fb7e852cc166490e1d37a235 sha
sha256:320db6e5e7148f5515ad8f460d18d176bd2a7f3170c3862caa4f1ddb465e0e36 snapshot
← Older Oldest on fix/diff-hash-prefix
All commits
Newer → Latest on fix/diff-hash-prefix

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:73881434ce04fa4250b82add03426ba298c0a494fb7e852cc166490e1d37a235 --body "your comment"