gabriel / muse public
feat patch #56 task/version-tags-phase0-label-rename #7 / 7
AI Agent gabriel · 70 days ago · Jun 28, 2026 · Diff

feat(#56): Phase 1 — core version_tags data model (VT_01–VT_12)

- muse/core/version_tags.py: ParsedSemVer (SemVerTag), semver_key, VersionTagRecord, compute_version_tag_id, _validate_version_tag_name, version_tag_path, write/read/list/delete_version_tag - tests/test_core_version_tags.py: 86 tests, all green

sha256:cdaa6b1f3bd3c381386cafe20610db334a4f97ae63044b233ba47e5c80defeeb sha
+124 symbols
sha256:2c35fcb6f74af1bca623835a5d3117d13ac3723101c71606a5f14957233ba9f9 snapshot
+124
symbols added
0
dead code introduced
Semantic Changes 124 symbols
~ muse/core/version_tags.py .py 33 symbols added
+ VersionTagDict class class VersionTagDict L177–187
+ VersionTagRecord class class VersionTagRecord L209–277
+ from_dict method method from_dict L239–277
+ to_dict method method to_dict L225–236
+ _MAX_VERSION_TAG_LEN variable variable _MAX_VERSION_TAG_LEN L64–64
+ _VERSION_TAGS_SUBDIR variable variable _VERSION_TAGS_SUBDIR L67–67
+ _validate_version_tag_name function function _validate_version_tag_name L95–125
+ compute_version_tag_id function function compute_version_tag_id L194–201
+ delete_version_tag function function delete_version_tag L335–345
+ MsgpackDict import import MsgpackDict L55–55
+ SemVerTag import import SemVerTag L54–54
+ TypedDict import import TypedDict L49–49
+ _int_val import import _int_val L53–53
+ _json import import _json L44–44
+ _str_val import import _str_val L53–53
+ _write_json_atomic import import _write_json_atomic L51–51
+ annotations import import annotations L41–41
+ content_hash import import content_hash L55–55
+ dataclass class import dataclass L48–48
+ datetime import import datetime L43–43
+ field import import field L48–48
+ logging import import logging L45–45
+ muse_dir import import muse_dir L52–52
+ parse_semver import import parse_semver L54–54
+ pathlib import import pathlib L46–46
+ re import import re L47–47
+ list_version_tags function function list_version_tags L311–332
+ logger variable variable logger L57–57
+ read_version_tag function function read_version_tag L298–308
+ semver_key function function semver_key L132–170
+ version_tag_path function function version_tag_path L78–88
+ version_tags_dir function function version_tags_dir L73–75
+ write_version_tag function function write_version_tag L284–295
~ tests/test_core_version_tags.py .py 91 symbols added
+ TestVT01ParsedSemVerShape class class TestVT01ParsedSemVerShape L50–71
+ test_build_not_none method method test_build_not_none L66–71
+ test_pre_not_none method method test_pre_not_none L60–64
+ test_stable_fields method method test_stable_fields L51–58
+ TestVT02ParseSemverValid class class TestVT02ParseSemverValid L78–105
+ test_requires_v_prefix_via_validate method method test_requires_v_prefix_via_validate L101–105
+ test_valid_versions method method test_valid_versions L95–99
+ TestVT03ParseSemverInvalid class class TestVT03ParseSemverInvalid L112–150
+ test_control_char_rejected method method test_control_char_rejected L147–150
+ test_empty_string method method test_empty_string L132–135
+ test_invalid_via_validate method method test_invalid_via_validate L127–130
+ test_too_long method method test_too_long L137–140
+ test_whitespace_rejected method method test_whitespace_rejected L142–145
+ TestVT04SemverKeyOrdering class class TestVT04SemverKeyOrdering L157–229
+ _sort method method _sort L162–166
+ _sv method method _sv L158–160
+ test_alpha_numbered method method test_alpha_numbered L219–221
+ test_beta_beats_alpha method method test_beta_beats_alpha L176–178
+ test_beta_numbered method method test_beta_numbered L213–217
+ test_build_metadata_ignored method method test_build_metadata_ignored L223–229
+ test_full_precedence_chain method method test_full_precedence_chain L192–211
+ test_higher_major_wins method method test_higher_major_wins L184–186
+ test_higher_minor_wins method method test_higher_minor_wins L188–190
+ test_higher_rc_beats_lower method method test_higher_rc_beats_lower L180–182
+ test_rc_beats_beta method method test_rc_beats_beta L172–174
+ test_stable_beats_rc method method test_stable_beats_rc L168–170
+ TestVT05VersionTagRecordRoundTrip class class TestVT05VersionTagRecordRoundTrip L236–335
+ _make_record method method _make_record L237–251
+ test_default_message_is_empty_string method method test_default_message_is_empty_string L321–335
+ test_from_dict_bad_created_at_falls_back method method test_from_dict_bad_created_at_falls_back L303–319
+ test_from_dict_missing_semver_falls_back method method test_from_dict_missing_semver_falls_back L287–301
+ test_from_dict_round_trip method method test_from_dict_round_trip L275–285
+ test_semver_nested_in_dict method method test_semver_nested_in_dict L265–273
+ test_to_dict_has_all_fields method method test_to_dict_has_all_fields L253–263
+ TestVT06ComputeVersionTagId class class TestVT06ComputeVersionTagId L342–369
+ test_deterministic method method test_deterministic L343–348
+ test_different_repos_different_ids method method test_different_repos_different_ids L357–363
+ test_different_tags_different_ids method method test_different_tags_different_ids L350–355
+ test_returns_sha256_prefixed method method test_returns_sha256_prefixed L365–369
+ TestVT07ValidateVersionTagName class class TestVT07ValidateVersionTagName L376–426
+ test_rejects_dotdot method method test_rejects_dotdot L418–421
+ test_rejects_empty method method test_rejects_empty L398–401
+ test_rejects_no_v_prefix method method test_rejects_no_v_prefix L393–396
+ test_rejects_non_semver method method test_rejects_non_semver L423–426
+ test_rejects_slash method method test_rejects_slash L413–416
+ test_rejects_too_long method method test_rejects_too_long L403–406
+ test_rejects_whitespace method method test_rejects_whitespace L408–411
+ test_valid_alpha method method test_valid_alpha L389–391
+ test_valid_beta method method test_valid_beta L385–387
+ test_valid_rc method method test_valid_rc L381–383
+ test_valid_stable method method test_valid_stable L377–379
+ TestVT08VersionTagPath class class TestVT08VersionTagPath L433–458
+ test_correct_path method method test_correct_path L434–440
+ test_rejects_dotdot method method test_rejects_dotdot L442–446
+ test_rejects_null_byte method method test_rejects_null_byte L454–458
+ test_rejects_slash method method test_rejects_slash L448–452
+ TestVT09WriteVersionTag class class TestVT09WriteVersionTag L465–526
+ _make_record method method _make_record L466–479
+ test_creates_dir_on_first_write method method test_creates_dir_on_first_write L481–486
+ test_file_is_valid_json method method test_file_is_valid_json L496–503
+ test_file_written method method test_file_written L488–494
+ test_second_write_overwrites method method test_second_write_overwrites L505–526
+ TestVT10ReadVersionTag class class TestVT10ReadVersionTag L533–570
+ _write_tag method method _write_tag L534–545
+ test_raises_on_corrupt_json method method test_raises_on_corrupt_json L562–570
+ test_reads_existing_record method method test_reads_existing_record L552–560
+ test_returns_none_when_missing method method test_returns_none_when_missing L547–550
+ TestVT11ListVersionTags class class TestVT11ListVersionTags L577–624
+ _write method method _write L578–588
+ test_empty_dir_returns_empty_list method method test_empty_dir_returns_empty_list L590–593
+ test_no_version_tags_dir_returns_empty method method test_no_version_tags_dir_returns_empty L595–598
+ test_non_json_files_skipped method method test_non_json_files_skipped L617–624
+ test_single_tag method method test_single_tag L600–606
+ test_sorted_semver_descending method method test_sorted_semver_descending L608–615
+ TestVT12DeleteVersionTag class class TestVT12DeleteVersionTag L631–689
+ _write method method _write L632–642
+ test_file_removed_after_delete method method test_file_removed_after_delete L655–660
+ test_idempotent_second_delete method method test_idempotent_second_delete L662–667
+ test_returns_false_when_not_found method method test_returns_false_when_not_found L650–653
+ test_returns_true_when_deleted method method test_returns_true_when_deleted L644–648
+ test_storage_round_trip method method test_storage_round_trip L669–689
+ _make_root function function _make_root L36–39
+ _utc function function _utc L42–43
+ SemVerTag import import SemVerTag L27–27
+ annotations import import annotations L19–19
+ content_hash import import content_hash L28–28
+ datetime import import datetime L21–21
+ json import import json L22–22
+ muse_dir import import muse_dir L29–29
+ pathlib import import pathlib L23–23
+ pytest import import pytest L25–25

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