gabriel / muse public
feat patch task/wire-hash-occurrence #1 / 1
AI Agent gabriel · 139 days ago · Apr 25, 2026 · Diff

feat: wire hash_occurrence index into clones and find-symbol

- clones --tier exact: filters manifest to candidate files from index (O(K) parses instead of O(N) when clone files << total files) - find-symbol --body-hash: new flag for O(1) body-hash lookup using hash_occurrence index; falls back to full snapshot scan when absent - 7 new clones index acceleration tests - 9 new find-symbol --body-hash tests (mutually exclusive with --hash/--name, length validation, index vs scan path parity)

sha256:bbc40c1a14e1d2b9a0f9f46e425804f73f8adccc4f2e42438f595d1ab13e2daf sha
+30 ~8 symbols
sha256:dd5e4275e3b6b93c01dd3584c9c4a458a26deec4128b22290addbdd762e320c3 snapshot
+30
symbols added
~8
symbols modified
0
dead code introduced
Semantic Changes 38 symbols
~ muse/cli/commands/clones.py .py 3 symbols added, 1 symbol modified
+ _candidate_files_from_index function function _candidate_files_from_index L283–302
+ HashOccurrenceIndex import import HashOccurrenceIndex L86–86
+ load_hash_occurrence import import load_hash_occurrence L86–86
~ run
~ muse/cli/commands/find_symbol.py .py 5 symbols added, 7 symbols modified
+ _search_by_body_hash_from_index function function _search_by_body_hash_from_index L296–307
+ _search_by_body_hash_from_snapshot function function _search_by_body_hash_from_snapshot L310–330
+ HashOccurrenceIndex import import HashOccurrenceIndex L102–102
+ load_hash_occurrence import import load_hash_occurrence L102–102
+ read_current_branch import import read_current_branch L105–105
~ run
~ tests/test_cmd_clones.py .py 9 symbols added
+ TestClonesIndexAcceleration class class TestClonesIndexAcceleration L893–966
+ _index_path method method _index_path L896–897
+ test_both_tiers_with_index method method test_both_tiers_with_index L961–966
+ test_commit_flag_bypasses_index method method test_commit_flag_bypasses_index L924–930
+ test_exact_clones_with_index_match_live_scan method method test_exact_clones_with_index_match_live_scan L899–914
+ test_index_accelerated_respects_file_filter method method test_index_accelerated_respects_file_filter L932–940
+ test_index_accelerated_respects_min_cluster method method test_index_accelerated_respects_min_cluster L942–951
+ test_near_clones_with_index_still_found method method test_near_clones_with_index_still_found L953–959
+ test_no_index_falls_back_to_full_scan method method test_no_index_falls_back_to_full_scan L916–922
~ tests/test_cmd_find_symbol.py .py 13 symbols added
+ TestFindSymbolBodyHash class class TestFindSymbolBodyHash L542–689
+ _get_clone_body_hash method method _get_clone_body_hash L548–556
+ _index_path method method _index_path L545–546
+ clone_repo method method clone_repo L559–569
+ test_body_hash_and_hash_mutually_exclusive method method test_body_hash_and_hash_mutually_exclusive L577–583
+ test_body_hash_and_name_mutually_exclusive method method test_body_hash_and_name_mutually_exclusive L585–592
+ test_body_hash_falls_back_to_scan_without_index method method test_body_hash_falls_back_to_scan_without_index L623–636
+ test_body_hash_finds_exact_clone_addresses_with_index method method test_body_hash_finds_exact_clone_addresses_with_index L605–621
+ test_body_hash_json_schema method method test_body_hash_json_schema L638–651
+ test_body_hash_not_found_exits_zero_empty_results method method test_body_hash_not_found_exits_zero_empty_results L594–603
+ test_body_hash_result_has_address_field method method test_body_hash_result_has_address_field L653–665
+ test_body_hash_results_match_index_and_scan method method test_body_hash_results_match_index_and_scan L667–689
+ test_body_hash_too_short_exits_nonzero method method test_body_hash_too_short_exits_nonzero L571–575
← Older Oldest on task/wire-hash-occurrence
All commits
Newer → Latest on task/wire-hash-occurrence

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