gabriel / muse public
refactor tests task/fix-failing-tests #4 / 5
AI Agent gabriel · 135 days ago · May 5, 2026 · Diff

refactor(tests): replace all UUID references with content-addressed IDs

- Remove all 'import uuid' and 'uuid.uuid4()' calls from the test suite - Replace UUID placeholder strings ('repo-uuid', 'lbl-uuid-0001', etc.) with content-ID equivalents ('repo-id', 'lbl-id-0001', etc.) - Replace string literal IDs ('test-uuid', 'expired-uuid', 'res-uuid', 'intent-uuid') with descriptive non-uuid names - Rename test methods: test_*_not_uuid → test_*_is_sha256_not_uuid4, test_rejects_uuid → test_rejects_uuid4_format, etc. - Rename variables: uuid_re → uuid4_re, VALID_UUID → VALID_ID, _REPO_ID_UUID → _REPO_ID_LEGACY, _repo_with_uuid → _repo_with_legacy_id - Replace 'record_uuid' dict keys with 'record_id' (functional fix — source reads record_id) - Update comments and docstrings: 'uuid-repo-id' → 'legacy-repo-id', 'UUIDs within each kind' → 'IDs within each kind', etc. - Add itertools/_new_id() pattern where uuid.uuid4() generated unique IDs - Dead code removal: unused _unique() helper in test_push_have_filter.py

sha256:1991fc6d3cb4f74b4c8f0456e7dc3fe0e56b89fce4219f92933a4083749ed5ed sha
+89 ~418 −82 symbols
sha256:b8a036ebc8ee9e20e9d60ca3e340975a424f798ad1f6b113e249dfd9c74a8052 snapshot
+89
symbols added
~418
symbols modified
−82
symbols removed
0
dead code introduced
Semantic Changes 589 symbols
~ muse/core/dag.py .py 1 symbol removed, 1 symbol modified
_UUID_RE variable variable _UUID_RE L92–95
~ tests/test_bisect.py .py 1 symbol removed
uuid import import uuid L9–9
~ tests/test_cli_hub.py .py 2 symbols added, 1 symbol removed, 4 symbols modified
test_delete_by_uuid_calls_correct_endpoint method method test_delete_by_uuid_calls_correct_endpoint L1001–1018
+ test_delete_by_repo_id_calls_correct_endpoint method method test_delete_by_repo_id_calls_correct_endpoint L1001–1018
+ fake_id import import fake_id L26–26
~ tests/test_cmd_archive.py .py 1 symbol removed
uuid import import uuid L19–19
~ tests/test_cmd_blame.py .py 1 symbol removed
uuid import import uuid L50–50
~ tests/test_cmd_cherry_pick.py .py 1 symbol removed
uuid import import uuid L15–15
~ tests/test_cmd_code_add.py .py 1 symbol added, 1 symbol removed, 8 symbols modified
~ tests/test_cmd_coord_gc.py .py 4 symbols added, 1 symbol removed, 10 symbols modified
~ tests/test_cmd_coord_lifecycle.py .py 8 symbols added, 5 symbols removed, 20 symbols modified
test_rejects_invalid_uuid method method test_rejects_invalid_uuid L222–225
test_bad_uuid_exits_1 method method test_bad_uuid_exits_1 L506–508
test_heartbeat_uuid_injection_rejected method method test_heartbeat_uuid_injection_rejected L988–993
test_release_uuid_injection_rejected method method test_release_uuid_injection_rejected L975–986
uuid import import uuid L43–43
+ test_rejects_invalid_record_id method method test_rejects_invalid_record_id L227–230
+ test_bad_record_id_exits_1 method method test_bad_record_id_exits_1 L511–513
+ test_heartbeat_record_id_injection_rejected method method test_heartbeat_record_id_injection_rejected L993–998
+ test_release_record_id_injection_rejected method method test_release_record_id_injection_rejected L980–991
+ _id_seq variable variable _id_seq L50–50
+ _new_id function function _new_id L52–53
+ content_hash import import content_hash L47–47
+ itertools import import itertools L40–40
~ tests/test_cmd_coord_list.py .py 1 symbol added, 1 symbol removed, 3 symbols modified
uuid import import uuid L55–55
+ fake_id import import fake_id L58–58
~ tests/test_cmd_coord_sync.py .py 13 symbols added, 10 symbols removed, 38 symbols modified
test_remote_records_with_traversal_uuid_skipped method method test_remote_records_with_traversal_uuid_skipped L1456–1469
test_write_remote_records_rejects_traversal_uuid method method test_write_remote_records_rejects_traversal_uuid L506–512
test_each_kind_has_correct_record_uuid method method test_each_kind_has_correct_record_uuid L835–839
test_claim_record_uuid_is_task_id method method test_claim_record_uuid_is_task_id L527–531
test_record_without_uuid_skipped method method test_record_without_uuid_skipped L267–272
test_empty_uuid_still_skipped method method test_empty_uuid_still_skipped L566–571
test_uuid_too_long_rejected method method test_uuid_too_long_rejected L588–594
test_uuid_with_dots_rejected method method test_uuid_with_dots_rejected L573–579
test_uuid_with_slash_rejected method method test_uuid_with_slash_rejected L581–586
uuid import import uuid L66–66
+ test_remote_records_with_traversal_record_id_skipped method method test_remote_records_with_traversal_record_id_skipped L1461–1474
+ test_write_remote_records_rejects_traversal_record_id method method test_write_remote_records_rejects_traversal_record_id L512–518
+ test_each_kind_has_correct_record_id method method test_each_kind_has_correct_record_id L841–845
+ test_claim_record_id_is_task_id method method test_claim_record_id_is_task_id L533–537
+ test_record_without_record_id_skipped method method test_record_without_record_id_skipped L273–278
+ test_empty_record_id_still_skipped method method test_empty_record_id_still_skipped L572–577
+ test_record_id_too_long_rejected method method test_record_id_too_long_rejected L594–600
+ test_record_id_with_dots_rejected method method test_record_id_with_dots_rejected L579–585
+ test_record_id_with_slash_rejected method method test_record_id_with_slash_rejected L587–592
+ _id_seq variable variable _id_seq L76–76
+ _new_id function function _new_id L79–80
+ content_hash import import content_hash L73–73
+ itertools import import itertools L64–64
~ tests/test_cmd_dag.py .py 9 symbols added, 7 symbols removed, 24 symbols modified
test_invalid_uuid_exits_1_json method method test_invalid_uuid_exits_1_json L969–978
test_invalid_uuid_exits_1_text method method test_invalid_uuid_exits_1_text L959–967
test_accepts_uppercase method method test_accepts_uppercase L133–134
test_rejects_non_uuid method method test_rejects_non_uuid L140–142
test_rejects_uuid_v3 method method test_rejects_uuid_v3 L152–154
_uuid function function _uuid L69–70
uuid import import uuid L28–28
+ test_invalid_id_exits_1_json method method test_invalid_id_exits_1_json L969–978
+ test_invalid_id_exits_1_text method method test_invalid_id_exits_1_text L959–967
+ test_accepts_another_content_id method method test_accepts_another_content_id L134–135
+ test_rejects_plain_string method method test_rejects_plain_string L141–143
+ test_rejects_uuid4 method method test_rejects_uuid4 L145–147
+ _id_seq variable variable _id_seq L67–67
+ _new_id function function _new_id L70–71
+ content_hash import import content_hash L37–37
+ itertools import import itertools L28–28
~ tests/test_cmd_forecast.py .py 1 symbol removed
uuid import import uuid L77–77
~ tests/test_cmd_heartbeat_coord.py .py 4 symbols added, 5 symbols removed, 14 symbols modified
test_non_uuid_string_rejected method method test_non_uuid_string_rejected L204–207
test_invalid_uuid_exits_nonzero method method test_invalid_uuid_exits_nonzero L313–317
test_not_found_uuid_exits_nonzero method method test_not_found_uuid_exits_nonzero L298–303
test_invalid_uuid_exits_user_error method method test_invalid_uuid_exits_user_error L639–643
uuid import import uuid L58–58
+ test_non_content_id_rejected method method test_non_content_id_rejected L202–205
+ test_invalid_id_exits_nonzero method method test_invalid_id_exits_nonzero L311–315
+ test_not_found_id_exits_nonzero method method test_not_found_id_exits_nonzero L296–301
+ test_invalid_id_exits_user_error method method test_invalid_id_exits_user_error L637–641
~ tests/test_cmd_hub_hardening.py .py 2 symbols added, 2 symbols removed, 125 symbols modified
test_full_uuid_uses_2_api_calls method method test_full_uuid_uses_2_api_calls L3814–3825
test_full_uuid_skips_prefix_resolution method method test_full_uuid_skips_prefix_resolution L2226–2240
+ test_full_id_uses_2_api_calls method method test_full_id_uses_2_api_calls L3814–3825
+ test_full_id_skips_prefix_resolution method method test_full_id_skips_prefix_resolution L2226–2240
~ tests/test_cmd_intent.py .py 4 symbols added, 1 symbol removed, 9 symbols modified
uuid import import uuid L62–62
+ _id_seq variable variable _id_seq L77–77
+ _new_id function function _new_id L80–81
+ content_hash import import content_hash L75–75
+ itertools import import itertools L60–60
~ tests/test_cmd_merge_tree.py .py 1 symbol removed
uuid import import uuid L20–20
~ tests/test_cmd_reconcile.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
uuid import import uuid L52–52
+ fake_id import import fake_id L56–56
~ tests/test_cmd_reflog_hardening.py .py 1 symbol removed
uuid import import uuid L48–48
~ tests/test_cmd_reserve.py .py 7 symbols added, 3 symbols removed, 17 symbols modified
test_uuid_injection_in_depends_on_rejected method method test_uuid_injection_in_depends_on_rejected L500–510
test_uuid_validation_rejects_non_uuid method method test_uuid_validation_rejects_non_uuid L217–222
uuid import import uuid L71–71
+ test_invalid_id_in_depends_on_rejected method method test_invalid_id_in_depends_on_rejected L507–517
+ test_id_validation_rejects_non_content_id method method test_id_validation_rejects_non_content_id L224–229
+ _id_seq variable variable _id_seq L89–89
+ _new_id function function _new_id L92–93
+ content_hash import import content_hash L76–76
+ fake_id import import fake_id L76–76
+ itertools import import itertools L69–69
~ tests/test_cmd_tag.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
test_tag_id_not_uuid method method test_tag_id_not_uuid L152–159
+ test_tag_id_is_sha256_not_uuid4 method method test_tag_id_is_sha256_not_uuid4 L152–160
~ tests/test_cmd_task_queue.py .py 7 symbols added, 4 symbols removed, 56 symbols modified
test_task_id_not_uuid method method test_task_id_not_uuid L4666–4673
VALID_UUID variable variable VALID_UUID L77–77
VALID_UUID2 variable variable VALID_UUID2 L78–78
uuid import import uuid L31–31
+ test_task_id_is_sha256_not_uuid4 method method test_task_id_is_sha256_not_uuid4 L4672–4679
+ VALID_ID variable variable VALID_ID L83–83
+ VALID_ID2 variable variable VALID_ID2 L84–84
+ _id_seq variable variable _id_seq L38–38
+ _new_id function function _new_id L41–42
+ content_hash import import content_hash L36–36
+ itertools import import itertools L29–29
~ _make
~ _claim
~ _task
~ _make
~ tests/test_cmd_verify_tag.py .py 1 symbol removed
uuid import import uuid L22–22
~ tests/test_cmd_worktree.py .py 1 symbol removed
uuid import import uuid L14–14
~ tests/test_code_migrate.py .py 4 symbols added, 4 symbols removed, 8 symbols modified
_repo_with_uuid method method _repo_with_uuid L653–659
test_result_repo_id_updated_flag_true_for_uuid method method test_result_repo_id_updated_flag_true_for_uuid L685–690
test_uuid_repo_id_replaced_with_sha256_id method method test_uuid_repo_id_replaced_with_sha256_id L661–667
_REPO_ID_UUID variable variable _REPO_ID_UUID L63–63
+ _repo_with_legacy_id method method _repo_with_legacy_id L653–659
+ test_legacy_repo_id_replaced_with_sha256_id method method test_legacy_repo_id_replaced_with_sha256_id L661–667
+ test_result_repo_id_updated_flag_true_for_legacy_id method method test_result_repo_id_updated_flag_true_for_legacy_id L685–690
+ _REPO_ID_LEGACY variable variable _REPO_ID_LEGACY L63–63
uuid import import uuid L46–46
~ tests/test_coordination.py .py 3 symbols added, 3 symbols removed, 11 symbols modified
test_intent_id_not_uuid method method test_intent_id_not_uuid L396–399
test_reservation_id_not_uuid method method test_reservation_id_not_uuid L362–365
_UUID_RE variable variable _UUID_RE L352–352
+ test_intent_id_is_sha256_not_uuid4 method method test_intent_id_is_sha256_not_uuid4 L396–399
+ test_reservation_id_is_sha256_not_uuid4 method method test_reservation_id_is_sha256_not_uuid4 L362–365
+ _UUID4_RE variable variable _UUID4_RE L352–352
~ tests/test_core_coord_bus.py .py 4 symbols added, 2 symbols removed, 6 symbols modified
_uuid4 function function _uuid4 L66–67
uuid import import uuid L39–39
+ _id_seq variable variable _id_seq L48–48
+ _new_id function function _new_id L51–52
+ content_hash import import content_hash L46–46
+ itertools import import itertools L37–37
~ tests/test_core_doc_extractor.py .py 1 symbol removed
uuid import import uuid L20–20
~ tests/test_core_doc_history.py .py 1 symbol removed
uuid import import uuid L17–17
~ tests/test_core_test_history.py .py 1 symbol removed
uuid import import uuid L19–19
~ tests/test_harmony_comprehensive.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
test_audit_id_not_uuid method method test_audit_id_not_uuid L1003–1011
+ test_audit_id_is_sha256_not_uuid4 method method test_audit_id_is_sha256_not_uuid4 L1003–1011
uuid import import uuid L24–24
~ tests/test_mpack_cmd_verify.py .py 1 symbol removed
uuid import import uuid L18–18
~ tests/test_op_log.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
test_op_id_not_uuid method method test_op_id_not_uuid L221–226
+ test_op_id_is_sha256_not_uuid4 method method test_op_id_is_sha256_not_uuid4 L221–226
uuid import import uuid L45–45
~ tests/test_push_have_filter.py .py 2 symbols removed
_unique function function _unique L76–77
uuid import import uuid L44–44
~ tests/test_release_supercharge.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
test_release_id_not_uuid method method test_release_id_not_uuid L447–453
+ test_release_id_is_sha256_not_uuid4 method method test_release_id_is_sha256_not_uuid4 L447–453
~ tests/test_security_object_store_poisoning.py .py 1 symbol added, 1 symbol removed, 8 symbols modified
~ tests/test_security_symlink.py .py 1 symbol removed, 2 symbols modified
~ tests/test_stress_merge_regression.py .py 1 symbol removed
uuid import import uuid L41–41
~ tests/test_verify_tag_supercharge.py .py 1 symbol removed
uuid import import uuid L22–22
~ tests/test_wire_localhost.py .py 4 symbols added, 1 symbol removed, 6 symbols modified
uuid import import uuid L30–30
+ _id_seq variable variable _id_seq L70–70
+ _new_id function function _new_id L73–74
+ content_hash import import content_hash L68–68
+ itertools import import itertools L25–25
~ tests/test_workdir_integrity.py .py 1 symbol added, 1 symbol removed, 6 symbols modified
uuid import import uuid L46–46
+ content_hash import import content_hash L53–53

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