gabriel / muse public
refactor BREAKING dev
AI Agent gabriel · 162 days ago · Apr 17, 2026 · Diff

refactor: canonicalize all long IDs through long_id() helper

Replace every bare string concatenation 'sha256:' + x and f-string f'sha256:{x}' with long_id(x) across production code and test files.

- Added long_id() helper to muse/core/_types.py with algo and strip params - Updated 12 production modules: snapshot, object_store, stat_cache, workdir, patch_record, hub_trust, code/plugin, rebase, range_diff, verify_pack, bundle, shelf, reflog, maintenance, format_patch, apply_patch, count_objects, prune, hash_object, verify_object, ls_tree, name_rev - Updated 85+ test files with long_id() calls and proper imports - Fixed test_rebase_supercharge.py TestShortId to import short_id from _types instead of non-existent _short_id from rebase module

sha256:9bcb403b0377d44b72f6336fafcd2ae3b3ca44200e9bb5d58db43f3da0d671a7 sha
+112 ~417 −127 symbols
sha256:fb28d1bef384e6aa8e6a2056945c0f300bf9a30a4e952d9ce2c6f8734c79972e snapshot
+112
symbols added
~417
symbols modified
−127
symbols removed
0
dead code introduced
Semantic Changes 656 symbols
~ muse/cli/commands/apply_patch.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L67–67
~ run
~ muse/cli/commands/bundle.py .py 1 symbol added, 3 symbols modified
+ long_id import import long_id L71–71
~ muse/cli/commands/count_objects.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L69–69
~ run
~ muse/cli/commands/format_patch.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L134–134
~ run
~ muse/cli/commands/hash_object.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L41–41
~ muse/cli/commands/ls_tree.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L103–103
~ muse/cli/commands/maintenance.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L110–110
~ muse/cli/commands/name_rev.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L111–111
~ muse/cli/commands/prune.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L85–85
~ muse/cli/commands/range_diff.py .py 1 symbol added, 5 symbols modified
+ long_id import import long_id L103–103
~ muse/cli/commands/rebase.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L76–76
~ muse/cli/commands/reflog.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L86–86
~ run
~ muse/cli/commands/shelf.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L85–85
~ muse/cli/commands/verify_object.py .py 1 symbol added, 3 symbols modified
+ long_id import import long_id L78–78
~ muse/cli/commands/verify_pack.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L93–93
~ run
~ muse/core/_types.py .py 1 symbol added, 1 symbol modified
+ long_id function function long_id L82–106
~ muse/core/hub_trust.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L51–51
~ muse/core/object_store.py .py 1 symbol added, 5 symbols modified
+ long_id import import long_id L55–55
~ muse/core/patch_record.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L60–60
~ muse/core/snapshot.py .py 1 symbol added, 4 symbols modified
+ long_id import import long_id L61–61
~ muse/core/stat_cache.py .py 1 symbol added, 3 symbols modified
+ long_id import import long_id L81–81
~ muse/core/workdir.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L19–19
~ muse/plugins/code/plugin.py .py 1 symbol added, 4 symbols modified
+ long_id import import long_id L104–104
~ merge
~ tests/test_archive_command.py .py 1 symbol added, 3 symbols modified
+ long_id import import long_id L39–39
~ tests/test_cli_inspect.py .py 1 symbol added, 6 symbols modified
~ tests/test_cli_stream_push.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L33–33
~ tests/test_cmd_apply_patch.py .py 1 symbol added, 3 symbols modified
+ long_id import import long_id L23–23
~ tests/test_cmd_archive.py .py 1 symbol added, 3 symbols modified
~ tests/test_cmd_archive_hardening.py .py 1 symbol added, 3 symbols modified
~ tests/test_cmd_blame.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L57–57
~ tests/test_cmd_bundle.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L22–22
~ tests/test_cmd_bundle_hardening.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L35–35
~ tests/test_cmd_bundle_supercharged.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L77–77
~ tests/test_cmd_cat.py .py 1 symbol added, 2 symbols modified
~ tests/test_cmd_cat_supercharged.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L35–35
~ tests/test_cmd_check.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L89–89
~ tests/test_cmd_cherry_pick.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L19–19
~ tests/test_cmd_clean.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L19–19
~ _sha
~ tests/test_cmd_clean_hardening.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L34–34
~ _sha
~ tests/test_cmd_content_grep.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L24–24
~ _sha
~ tests/test_cmd_content_grep_hardening.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L35–35
~ _sha
~ tests/test_cmd_core_cat.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L34–34
~ tests/test_cmd_count_objects.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L27–27
~ _sha
~ tests/test_cmd_describe.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L23–23
~ _sha
~ tests/test_cmd_describe_hardening.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L33–33
~ _sha
~ tests/test_cmd_format_patch.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L24–24
~ tests/test_cmd_integration.py .py 1 symbol added, 3 symbols modified
+ long_id import import long_id L32–32
~ tests/test_cmd_ls_files.py .py 1 symbol added, 4 symbols modified
+ long_id import import long_id L22–22
~ _oid
~ tests/test_cmd_ls_remote.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L24–24
~ tests/test_cmd_ls_tree.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L30–30
~ _sha
~ tests/test_cmd_maintenance.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L29–29
~ _sha
~ tests/test_cmd_merge.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L20–20
~ tests/test_cmd_merge_dry_run.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L21–21
~ tests/test_cmd_merge_tree.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L33–33
~ _sha
~ tests/test_cmd_mv.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L26–26
~ _sha
~ tests/test_cmd_name_rev.py .py 97 symbols removed
− TestBranchesFilter class class TestBranchesFilter L402–439
− test_branches_filter_finds_matching method method test_branches_filter_finds_matching L413–421
− test_branches_filter_hierarchical method method test_branches_filter_hierarchical L433–439
− test_branches_filter_restricts_bfs method method test_branches_filter_restricts_bfs L403–411
− test_branches_glob_pattern method method test_branches_glob_pattern L423–431
− TestBuildNameMap class class TestBuildNameMap L201–279
− test_branch_pattern_filter method method test_branch_pattern_filter L248–255
− test_early_exit_when_all_targets_found method method test_early_exit_when_all_targets_found L272–279
− test_empty_heads_dir method method test_empty_heads_dir L202–204
− test_hierarchical_branch_discovered method method test_hierarchical_branch_discovered L221–227
− test_invalid_ref_id_skipped method method test_invalid_ref_id_skipped L240–246
− test_max_walk_ceiling method method test_max_walk_ceiling L257–270
− test_parent_commit_distance_one method method test_parent_commit_distance_one L213–219
− test_symlink_ref_skipped method method test_symlink_ref_skipped L229–238
− test_tip_commit_distance_zero method method test_tip_commit_distance_zero L206–211
− TestMaxWalk class class TestMaxWalk L534–564
− test_json_shorthand method method test_json_shorthand L558–564
− test_max_walk_limits_bfs method method test_max_walk_limits_bfs L535–549
− test_max_walk_zero_errors method method test_max_walk_zero_errors L551–556
− TestNameRevEntrySchema class class TestNameRevEntrySchema L135–146
− test_ambiguous_field_present method method test_ambiguous_field_present L145–146
− test_input_field_present method method test_input_field_present L141–143
− test_required_fields method method test_required_fields L136–139
− TestPrefixResolution class class TestPrefixResolution L352–394
− test_ambiguous_prefix_marked method method test_ambiguous_prefix_marked L374–386
− test_four_char_prefix_resolves method method test_four_char_prefix_resolves L362–372
− test_non_hex_input_rejected method method test_non_hex_input_rejected L388–394
− test_short_prefix_resolves method method test_short_prefix_resolves L353–360
− TestResolution class class TestResolution L287–344
− test_grandparent_named_tilde_two method method test_grandparent_named_tilde_two L309–317
− test_input_field_preserves_original method method test_input_field_preserves_original L337–344
− test_multiple_commit_ids method method test_multiple_commit_ids L329–335
− test_parent_commit_named_tilde_one method method test_parent_commit_named_tilde_one L300–307
− test_tip_commit_distance_zero method method test_tip_commit_distance_zero L288–298
− test_undefined_commit method method test_undefined_commit L319–327
− TestResolvePrefix class class TestResolvePrefix L154–193
− _map method method _map L155–161
− test_empty_map method method test_empty_map L190–193
− test_exact_match method method test_exact_match L163–168
− test_no_match_returns_none method method test_no_match_returns_none L184–188
− test_short_prefix_ambiguous method method test_short_prefix_ambiguous L177–182
− test_short_prefix_unique method method test_short_prefix_unique L170–175
− TestSecurity class class TestSecurity L572–638
− test_ansi_in_branch_name_sanitized_text method method test_ansi_in_branch_name_sanitized_text L581–590
− test_format_error_goes_to_stderr method method test_format_error_goes_to_stderr L592–598
− test_no_args_error_goes_to_stderr method method test_no_args_error_goes_to_stderr L600–604
− test_no_repo_exits_cleanly method method test_no_repo_exits_cleanly L630–638
− test_no_traceback_on_bad_format method method test_no_traceback_on_bad_format L606–611
− test_no_traceback_on_non_hex method method test_no_traceback_on_non_hex L613–617
− test_non_hex_input_rejected method method test_non_hex_input_rejected L573–579
− test_symlink_ref_skipped method method test_symlink_ref_skipped L619–628
− TestStdinMode class class TestStdinMode L447–484
− test_stdin_combined_with_positional method method test_stdin_combined_with_positional L471–478
− test_stdin_empty_with_no_positional_errors method method test_stdin_empty_with_no_positional_errors L480–484
− test_stdin_reads_commit_ids method method test_stdin_reads_commit_ids L448–455
− test_stdin_skips_blank_lines method method test_stdin_skips_blank_lines L457–462
− test_stdin_skips_comments method method test_stdin_skips_comments L464–469
− TestStress class class TestStress L646–696
− test_10_branch_repo method method test_10_branch_repo L663–674
− test_200_sequential_calls method method test_200_sequential_calls L676–682
− test_50_commit_chain method method test_50_commit_chain L647–661
− test_stdin_50_commit_ids method method test_stdin_50_commit_ids L684–696
− TestTextOutput class class TestTextOutput L492–526
− test_ambiguous_shown_in_text method method test_ambiguous_shown_in_text L516–526
− test_custom_undefined_string method method test_custom_undefined_string L508–514
− test_name_only_omits_cid method method test_name_only_omits_cid L500–506
− test_text_format_contains_cid method method test_text_format_contains_cid L493–498
− _AMBIG_MSG_1 variable variable _AMBIG_MSG_1 L116–116
− _AMBIG_MSG_2 variable variable _AMBIG_MSG_2 L117–117
− _AMBIG_PREFIX variable variable _AMBIG_PREFIX L118–118
− _CommitInfoMap variable variable _CommitInfoMap L22–22
− _commit function function _commit L84–111
− _env function function _env L67–68
− _init_repo function function _init_repo L54–64
− _nr function function _nr L121–127
− _sha function function _sha L50–51
− _snap function function _snap L71–81
− cli variable variable cli L41–41
− CliRunner import import CliRunner L30–30
− CommitRecord import import CommitRecord L38–38
− InvokeResult import import InvokeResult L30–30
− Manifest import import Manifest L39–39
− SnapshotRecord import import SnapshotRecord L38–38
− _NameRevEntry import import _NameRevEntry L32–32
− _build_name_map import import _build_name_map L32–32
− _resolve_prefix import import _resolve_prefix L32–32
− annotations import import annotations L20–20
− compute_commit_id import import compute_commit_id L37–37
− compute_snapshot_id import import compute_snapshot_id L37–37
− datetime import import datetime L24–24
− hashlib import import hashlib L25–25
− io import import io L26–26
− json import import json L27–27
− pathlib import import pathlib L28–28
− write_commit import import write_commit L38–38
− write_snapshot import import write_snapshot L38–38
− runner variable variable runner L42–42
~ tests/test_cmd_read_commit.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L20–20
~ tests/test_cmd_read_snapshot.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L20–20
~ tests/test_cmd_restore.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L28–28
~ _sha
~ tests/test_cmd_restore_supercharge.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L30–30
~ _sha
− TestAllObjectsInStoreAfterCommit class class TestAllObjectsInStoreAfterCommit L116–232
− test_commit_does_not_leave_partial_state_on_apply_manifest_failure method method test_commit_does_not_leave_partial_state_on_apply_manifest_failure L212–232
− test_first_commit_stores_all_objects method method test_first_commit_stores_all_objects L117–127
− test_parent_objects_missing_rewritten_on_next_commit method method test_parent_objects_missing_rewritten_on_next_commit L163–210
− test_second_commit_stores_all_objects method method test_second_commit_stores_all_objects L129–140
− test_unchanged_file_object_present_after_second_commit method method test_unchanged_file_object_present_after_second_commit L142–161
− TestApplyManifestAfterCommit class class TestApplyManifestAfterCommit L316–342
− test_apply_manifest_does_not_raise_after_commit method method test_apply_manifest_does_not_raise_after_commit L317–327
− test_apply_manifest_does_not_raise_when_parent_objects_were_missing method method test_apply_manifest_does_not_raise_when_parent_objects_were_missing L329–342
− TestCheckoutAfterCommit class class TestCheckoutAfterCommit L244–305
− test_checkout_after_commit_with_missing_parent_objects method method test_checkout_after_commit_with_missing_parent_objects L245–276
− test_checkout_back_and_forth_after_multi_commit_session method method test_checkout_back_and_forth_after_multi_commit_session L278–305
− _commit function function _commit L56–57
− _delete_all_objects function function _delete_all_objects L78–92
− _head_snapshot_manifest function function _head_snapshot_manifest L66–75
− _init_repo function function _init_repo L60–63
− _invoke function function _invoke L47–53
− CliRunner import import CliRunner L30–30
− annotations import import annotations L23–23
− get_head_commit_id import import get_head_commit_id L32–32
− has_object import import has_object L31–31
− object_path import import object_path L31–31
− os import import os L25–25
− pathlib import import pathlib L26–26
− pytest import import pytest L28–28
− read_commit import import read_commit L32–32
− read_current_branch import import read_current_branch L32–32
− read_snapshot import import read_snapshot L32–32
− repo function function repo L101–105
− runner variable variable runner L39–39
~ tests/test_core_merge_engine.py .py 1 symbol added, 3 symbols modified
+ long_id import import long_id L15–15
~ tests/test_hash_object_canonical.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L25–25
~ tests/test_log_supercharge.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L24–24
~ tests/test_ls_files_supercharge.py .py 1 symbol added, 4 symbols modified
~ tests/test_ls_remote_supercharge.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L25–25
~ tests/test_ls_tree_supercharge.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L27–27
~ _sha
~ tests/test_maintenance_supercharge.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L25–25
~ _sha
~ tests/test_merge_data_integrity.py .py 1 symbol added, 3 symbols modified
+ long_id import import long_id L44–44
~ _h
~ tests/test_merge_supercharge.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L25–25
~ _sha
~ tests/test_merge_tree_supercharge.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L26–26
~ _sha
~ tests/test_mpack_bundle.py .py 1 symbol added, 3 symbols modified
+ long_id import import long_id L30–30
~ _sha
~ tests/test_mpack_cmd_pack_unpack.py .py 1 symbol added, 3 symbols modified
~ tests/test_mpack_cmd_verify.py .py 1 symbol added, 3 symbols modified
+ long_id import import long_id L31–31
~ _sha
~ tests/test_mpack_core.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L20–20
~ tests/test_mpack_perf.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L27–27
~ _sha
~ tests/test_mpack_perf_ops.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L49–49
~ tests/test_mpack_snapshot_integrity.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L33–33
~ _sha
~ tests/test_mv_supercharge.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L24–24
~ _sha
~ tests/test_pack_objects_supercharge.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L33–33
~ tests/test_patch_id_supercharge.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L45–45
~ _oid
~ tests/test_phase1_cohen_action_labels.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L24–24
~ _oid
~ tests/test_phase2_or_set_symbol_independence.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L38–38
~ _oid
~ tests/test_phase3_weave_union_docs.py .py 1 symbol added, 3 symbols modified
~ tests/test_prune_supercharge.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L55–55
~ _oid
~ tests/test_push_have_filter.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L61–61
~ _sha
~ tests/test_range_diff_supercharge.py .py 1 symbol added, 6 symbols modified
~ tests/test_rebase_missing_snapshot_guard.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L42–42
~ tests/test_security_branch_ref_injection.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L47–47
~ tests/test_security_object_store_poisoning.py .py 1 symbol added, 4 symbols modified
~ tests/test_stress_merge_regression.py .py 1 symbol added, 3 symbols modified
+ long_id import import long_id L46–46
~ _h
← 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:9bcb403b0377d44b72f6336fafcd2ae3b3ca44200e9bb5d58db43f3da0d671a7 --body "your comment"