gabriel / muse public
fix patch task/fix-commit-id-formula #1 / 2
AI Agent gabriel · 111 days ago · May 21, 2026 · Diff

fix: restore typed-object ID formula for commits and snapshots; use unified object store

compute_commit_id and compute_snapshot_id were using blob_id(canonical) = sha256(canonical), but all stored objects use the typed-object formula sha256('<type> <size>\0' + canonical). This caused _verify_commit_id and _verify_snapshot_id to always fail after migration.

- compute_commit_id: sha256('commit <size>\0' + canonical_identity_bytes) - compute_snapshot_id: sha256('snapshot <size>\0' + canonical_identity_bytes) - commit_path / snapshot_path: delegate to object_path (unified store) - write_commit / write_snapshot: write '<type> <size>\0<json>' to object store - read_commit / read_snapshot / read_snapshot_result: parse header+json format

sha256:90c649ace756253d7e82371ca9e2fd3143c7a85d33f47f9a4d5f0331ae4834ca sha
+219 symbols
sha256:79e1e062816b8e7783a6832155691554ed26ddd09998c426d7b68b2917d714d1 snapshot
+219
symbols added
0
dead code introduced
Semantic Changes 219 symbols
+ muse
~ muse/core/snapshot.py .py 31 symbols added
+ _ALWAYS_PRUNE_DIRS variable variable _ALWAYS_PRUNE_DIRS L66–84
+ _BUILTIN_SECRET_PATTERNS variable variable _BUILTIN_SECRET_PATTERNS L94–108
+ _SEP variable variable _SEP L165–165
+ _build_filename_filter function function _build_filename_filter L110–140
+ build_snapshot_manifest function function build_snapshot_manifest L167–172
+ commit_identity_bytes function function commit_identity_bytes L459–488
+ compute_commit_id function function compute_commit_id L491–515
+ compute_snapshot_id function function compute_snapshot_id L339–350
+ detect_directory_renames function function detect_directory_renames L352–399
+ diff_workdir_vs_snapshot function function diff_workdir_vs_snapshot L401–457
+ directories_from_manifest function function directories_from_manifest L174–195
+ Manifest import import Manifest L57–57
+ _repo_json_path import import _repo_json_path L58–58
+ _stat import import _stat L55–55
+ blob_id import import blob_id L57–57
+ fnmatch import import fnmatch L51–51
+ hash_file import import hash_file L57–57
+ is_ignored import import is_ignored L59–59
+ load_cache import import load_cache L60–60
+ load_force_track_paths import import load_force_track_paths L59–59
+ load_ignore_config import import load_ignore_config L59–59
+ load_json_file import import load_json_file L57–57
+ os import import os L52–52
+ pathlib import import pathlib L53–53
+ re import import re L54–54
+ resolve_patterns import import resolve_patterns L59–59
+ split_id import import split_id L57–57
+ load_ignore_patterns function function load_ignore_patterns L142–163
+ snapshot_identity_bytes function function snapshot_identity_bytes L314–336
+ walk_workdir function function walk_workdir L273–312
+ walk_workdir_with_dirs function function walk_workdir_with_dirs L197–271
~ muse/core/store.py .py 188 symbols added
+ CommitDict class class CommitDict L854–911
+ CommitReadCorrupt class class CommitReadCorrupt L1740–1743
+ CommitReadNotFound class class CommitReadNotFound L1737–1738
+ CommitReadOk class class CommitReadOk L1733–1735
+ CommitRecord class class CommitRecord L941–1125
+ from_dict method method from_dict L1079–1125
+ from_msgpack method method from_msgpack L1008–1076
+ to_dict method method to_dict L978–1005
+ DetachedHead class class DetachedHead L771–775
+ HeadState variable variable HeadState L777–777
+ MAX_MSGPACK_BYTES variable variable MAX_MSGPACK_BYTES L125–125
+ MAX_PACK_MSGPACK_BYTES variable variable MAX_PACK_MSGPACK_BYTES L130–130
+ MissingParentError class class MissingParentError L387–395
+ RefConflictError class class RefConflictError L382–385
+ ReleaseDict class class ReleaseDict L724–741
+ ReleaseRecord class class ReleaseRecord L1295–1403
+ from_dict method method from_dict L1380–1403
+ from_msgpack method method from_msgpack L1352–1377
+ to_dict method method to_dict L1331–1349
+ SnapshotDict class class SnapshotDict L913–921
+ SnapshotReadCorrupt class class SnapshotReadCorrupt L2232–2235
+ SnapshotReadNotFound class class SnapshotReadNotFound L2229–2230
+ SnapshotReadOk class class SnapshotReadOk L2225–2227
+ SnapshotRecord class class SnapshotRecord L1128–1202
+ from_dict method method from_dict L1185–1202
+ from_msgpack method method from_msgpack L1159–1182
+ to_dict method method to_dict L1148–1156
+ SymbolicHead class class SymbolicHead L765–769
+ TagDict class class TagDict L923–934
+ TagRecord class class TagRecord L1214–1284
+ from_dict method method from_dict L1265–1284
+ from_msgpack method method from_msgpack L1243–1262
+ to_dict method method to_dict L1229–1240
+ WalkResult class class WalkResult L2065–2075
+ _COMMITS_DIR variable variable _COMMITS_DIR L669–669
+ _MSGPACK_MAX_ARRAY_LEN variable variable _MSGPACK_MAX_ARRAY_LEN L142–142
+ _MSGPACK_MAX_BIN_LEN variable variable _MSGPACK_MAX_BIN_LEN L140–140
+ _MSGPACK_MAX_BIN_LEN_PACK variable variable _MSGPACK_MAX_BIN_LEN_PACK L141–141
+ _MSGPACK_MAX_MAP_LEN variable variable _MSGPACK_MAX_MAP_LEN L143–143
+ _MSGPACK_MAX_STR_LEN variable variable _MSGPACK_MAX_STR_LEN L139–139
+ _RELEASES_DIR variable variable _RELEASES_DIR L672–672
+ _SENTINEL variable variable _SENTINEL L137–137
+ _SNAPSHOTS_DIR variable variable _SNAPSHOTS_DIR L670–670
+ _SNAPSHOT_SCHEMA_VERSION variable variable _SNAPSHOT_SCHEMA_VERSION L678–678
+ _TAGS_DIR variable variable _TAGS_DIR L671–671
+ _ZSTD_COMPRESS_THRESHOLD variable variable _ZSTD_COMPRESS_THRESHOLD L688–688
+ _ZSTD_MAGIC variable variable _ZSTD_MAGIC L683–683
+ _as_structured_delta function function _as_structured_delta L258–267
+ _find_commit_by_prefix function function _find_commit_by_prefix L1960–1977
+ _float_val function function _float_val L240–256
+ _int_val function function _int_val L201–210
+ _known_commits_dirs variable variable _known_commits_dirs L1513–1513
+ _parse_changelog_entries function function _parse_changelog_entries L303–330
+ _parse_semver_tag function function _parse_semver_tag L284–301
+ _read_msgpack function function _read_msgpack L631–653
+ _read_msgpack_dict function function _read_msgpack_dict L655–667
+ _resolve_branch_commit_id function function _resolve_branch_commit_id L1995–2015
+ _sem_ver_bump_val function function _sem_ver_bump_val L269–282
+ _str_dict function function _str_dict L231–238
+ _str_list function function _str_list L222–229
+ _str_or_none function function _str_or_none L212–220
+ _str_val function function _str_val L190–199
+ _validated_store_parents variable variable _validated_store_parents L471–471
+ _verify_commit_id function function _verify_commit_id L1625–1671
+ _verify_snapshot_id function function _verify_snapshot_id L1673–1702
+ _write_msgpack_atomic function function _write_msgpack_atomic L473–534
+ _zstd_compress function function _zstd_compress L690–704
+ build_changelog function function build_changelog L2572–2604
+ commit_exists function function commit_exists L1501–1509
+ commit_path function function commit_path L1405–1413
+ commit_read_is_corrupt function function commit_read_is_corrupt L1757–1761
+ commit_read_is_not_found function function commit_read_is_not_found L1751–1755
+ commit_read_is_ok function function commit_read_is_ok L1745–1749
+ compute_release_id function function compute_release_id L1286–1292
+ compute_tag_id function function compute_tag_id L1204–1211
+ delete_release function function delete_release L2558–2570
+ delete_shelf_entry function function delete_shelf_entry L2402–2421
+ delete_tag function function delete_tag L2452–2459
+ find_commits_by_prefix function function find_commits_by_prefix L1979–1993
+ get_all_branch_heads function function get_all_branch_heads L1868–1880
+ get_all_commits function function get_all_commits L2047–2063
+ get_all_tags function function get_all_tags L2461–2477
+ get_commit_snapshot_manifest function function get_commit_snapshot_manifest L2273–2289
+ get_commits_for_branch function function get_commits_for_branch L2017–2045
+ get_head_commit_id function function get_head_commit_id L1827–1831
+ get_head_snapshot_id function function get_head_snapshot_id L1882–1893
+ get_head_snapshot_manifest function function get_head_snapshot_manifest L2291–2301
+ get_release_for_tag function function get_release_for_tag L2512–2523
+ get_tag_by_name function function get_tag_by_name L2479–2486
+ get_tags_for_commit function function get_tags_for_commit L2434–2450
+ ApiChangeSummary import import ApiChangeSummary L96–96
+ BranchHeads import import BranchHeads L160–160
+ ChangelogEntry import import ChangelogEntry L96–96
+ FileHotspot import import FileHotspot L96–96
+ JsonValue import import JsonValue L160–160
+ LanguageStat import import LanguageStat L96–96
+ Literal import import Literal L84–84
+ MUSE_DIR import import MUSE_DIR L160–160
+ Manifest import import Manifest L160–160
+ Metadata import import Metadata L160–160
+ MsgpackDict import import MsgpackDict L160–160
+ MsgpackValue import import MsgpackValue L160–160
+ RefactorEventSummary import import RefactorEventSummary L96–96
+ ReleaseChannel import import ReleaseChannel L96–96
+ SemVerBump import import SemVerBump L112–112
+ SemVerTag import import SemVerTag L96–96
+ SemanticReleaseReport import import SemanticReleaseReport L96–96
+ StructuredDelta import import StructuredDelta L86–86
+ SymbolKindCount import import SymbolKindCount L96–96
+ TypeGuard import import TypeGuard L84–84
+ TypedDict import import TypedDict L84–84
+ _CHANNEL_MAP import import _CHANNEL_MAP L96–96
+ _ChannelMap import import _ChannelMap L96–96
+ _commits_dir import import _commits_dir L172–172
+ _head_path import import _head_path L172–172
+ _heads_dir import import _heads_dir L172–172
+ _json import import _json L73–73
+ _object_path import import _object_path L87–87
+ _ref_path import import _ref_path L172–172
+ _releases_dir import import _releases_dir L172–172
+ _remotes_dir import import _remotes_dir L172–172
+ _repo_json_path import import _repo_json_path L172–172
+ _shelf_dir import import _shelf_dir L172–172
+ _snapshots_dir import import _snapshots_dir L172–172
+ _tags_dir import import _tags_dir L172–172
+ assert_not_symlink import import assert_not_symlink L89–89
+ compute_commit_id import import compute_commit_id L88–88
+ compute_snapshot_id import import compute_snapshot_id L88–88
+ content_hash import import content_hash L160–160
+ dataclass class import dataclass L82–82
+ datetime import import datetime L70–70
+ errno import import errno L71–71
+ fcntl import import fcntl L72–72
+ field import import field L82–82
+ iter_branch_refs import import iter_branch_refs L184–184
+ logging import import logging L74–74
+ long_id import import long_id L160–160
+ msgpack import import msgpack L81–81
+ os import import os L75–75
+ parse_semver import import parse_semver L96–96
+ pathlib import import pathlib L76–76
+ re import import re L77–77
+ read_ref import import read_ref L184–184
+ sanitize_glob_prefix import import sanitize_glob_prefix L89–89
+ semver_channel import import semver_channel L96–96
+ semver_to_str import import semver_to_str L96–96
+ short_id import import short_id L160–160
+ split_id import import split_id L112–112
+ sys import import sys L78–78
+ tempfile import import tempfile L79–79
+ validate_branch_name import import validate_branch_name L89–89
+ validate_ref_id import import validate_ref_id L89–89
+ validate_repo_id import import validate_repo_id L89–89
+ list_releases function function list_releases L2525–2556
+ list_shelf_entries function function list_shelf_entries L2370–2400
+ logger variable variable logger L114–114
+ overwrite_commit function function overwrite_commit L1789–1805
+ read_commit function function read_commit L1704–1731
+ read_commit_result function function read_commit_result L1763–1787
+ read_current_branch function function read_current_branch L809–822
+ read_head function function read_head L779–807
+ read_msgpack_file function function read_msgpack_file L592–629
+ read_release function function read_release L2499–2510
+ read_shelf_entry function function read_shelf_entry L2342–2368
+ read_snapshot function function read_snapshot L2197–2223
+ read_snapshot_result function function read_snapshot_result L2249–2271
+ release_path function function release_path L1476–1495
+ resolve_any_ref function function resolve_any_ref L1833–1866
+ resolve_commit_ref function function resolve_commit_ref L1895–1958
+ safe_unpackb function function safe_unpackb L536–590
+ shelf_entry_path function function shelf_entry_path L1425–1451
+ snapshot_path function function snapshot_path L1415–1423
+ snapshot_read_is_corrupt function function snapshot_read_is_corrupt L2243–2247
+ snapshot_read_is_ok function function snapshot_read_is_ok L2237–2241
+ tag_path function function tag_path L1453–1474
+ update_commit_metadata function function update_commit_metadata L1807–1825
+ walk_commits_between function function walk_commits_between L2077–2104
+ walk_commits_between_result function function walk_commits_between_result L2106–2147
+ write_branch_ref function function write_branch_ref L397–466
+ write_commit function function write_commit L1515–1623
+ write_head_branch function function write_head_branch L824–834
+ write_head_commit function function write_head_commit L836–848
+ write_release function function write_release L2492–2497
+ write_shelf_entry function function write_shelf_entry L2308–2340
+ write_snapshot function function write_snapshot L2153–2195
+ write_tag function function write_tag L2427–2432
+ write_text_atomic function function write_text_atomic L336–380
+ zstd_decompress_if_needed function function zstd_decompress_if_needed L706–722

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:90c649ace756253d7e82371ca9e2fd3143c7a85d33f47f9a4d5f0331ae4834ca --body "your comment"