gabriel / muse public
feat patch task/migrate-domain-integers #1 / 1
AI Agent gabriel · 137 days ago · May 1, 2026 · Diff

feat: muse migrate domain-integers — Phase 4 of issue #3 (TDD, 45 tests green)

- muse/core/domain_migration.py: is_legacy_hd_path, new_path_for_legacy, derive_fingerprint_at_path, scan_for_legacy, build_plans, run_migration - muse/cli/commands/migrate_cmd.py: muse migrate domain-integers --dry-run/--json - tests/test_migrate_domain_integers.py: 45 tests covering detection, mapping, key re-derivation, scanning, dry-run, live migration, multi-hub, CLI smoke - app.py: register muse migrate as top-level namespace

sha256:0dfc0a7c95059bbd3b19b58f4e2a970b36ba64e31b36df5cacce71dc7988fec5 sha
+110 ~121 symbols
sha256:87df778b9b77effd0260903528d2f75506f2166b10e7f200740270ef7106677f snapshot
+110
symbols added
~121
symbols modified
0
dead code introduced
Semantic Changes 231 symbols
~ muse/cli/commands/migrate_cmd.py .py 14 symbols added
+ _make_hub_register_fn function function _make_hub_register_fn L70–97
+ _run_domain_integers function function _run_domain_integers L105–227
+ Any import import Any L56–56
+ EnvelopeJson import import EnvelopeJson L58–58
+ ExitCode import import ExitCode L59–59
+ annotations import import annotations L50–50
+ argparse import import argparse L52–52
+ json import import json L53–53
+ logging import import logging L54–54
+ make_envelope import import make_envelope L58–58
+ start_timer import import start_timer L60–60
+ sys import import sys L55–55
+ logger variable variable logger L62–62
+ register function function register L235–275
~ muse/core/domain_migration.py .py 27 symbols added
+ MigrationPlan class class MigrationPlan L196–204
+ MigrationResult class class MigrationResult L208–216
+ OLD_DOMAIN_NAMES variable variable OLD_DOMAIN_NAMES L58–66
+ _OLD_TO_NEW variable variable _OLD_TO_NEW L68–76
+ _PATH_RE variable variable _PATH_RE L80–87
+ _parse_path function function _parse_path L90–95
+ build_plans function function build_plans L219–237
+ derive_fingerprint_at_path function function derive_fingerprint_at_path L138–168
+ DOMAIN_BLOCKCHAIN import import DOMAIN_BLOCKCHAIN L40–40
+ DOMAIN_CODE import import DOMAIN_CODE L40–40
+ DOMAIN_IDENTITY import import DOMAIN_IDENTITY L40–40
+ DOMAIN_MIDI import import DOMAIN_MIDI L40–40
+ DOMAIN_MUSIC import import DOMAIN_MUSIC L40–40
+ DOMAIN_PAYMENTS import import DOMAIN_PAYMENTS L40–40
+ DOMAIN_PROSE import import DOMAIN_PROSE L40–40
+ MUSE_PURPOSE import import MUSE_PURPOSE L50–50
+ annotations import import annotations L34–34
+ dataclass class import dataclass L38–38
+ field import import field L38–38
+ logging import import logging L36–36
+ muse_path import import muse_path L40–40
+ re import import re L37–37
+ is_legacy_hd_path function function is_legacy_hd_path L103–114
+ logger variable variable logger L52–52
+ new_path_for_legacy function function new_path_for_legacy L117–135
+ run_migration function function run_migration L245–309
+ scan_for_legacy function function scan_for_legacy L176–187
~ tests/test_migrate_domain_integers.py .py 68 symbols added
+ FAKE_MNEMONIC variable variable FAKE_MNEMONIC L59–62
+ TestCliDryRun class class TestCliDryRun L553–615
+ test_cli_dry_run_exits_0_with_json method method test_cli_dry_run_exits_0_with_json L554–584
+ test_cli_no_legacy_entries_exits_0 method method test_cli_no_legacy_entries_exits_0 L586–615
+ TestDeriveNewFingerprint class class TestDeriveNewFingerprint L188–223
+ test_fingerprint_is_sha256_prefixed method method test_fingerprint_is_sha256_prefixed L217–223
+ test_new_fingerprint_is_deterministic method method test_new_fingerprint_is_deterministic L198–205
+ test_new_fingerprint_matches_direct_derive method method test_new_fingerprint_matches_direct_derive L207–215
+ test_old_and_new_fingerprints_differ method method test_old_and_new_fingerprints_differ L189–196
+ TestDryRun class class TestDryRun L340–389
+ test_dry_run_does_not_mutate_identity_map method method test_dry_run_does_not_mutate_identity_map L372–389
+ test_dry_run_returns_plans_without_registering method method test_dry_run_returns_plans_without_registering L341–370
+ TestIsLegacyHdPath class class TestIsLegacyHdPath L80–116
+ test_agent_old_path_is_legacy method method test_agent_old_path_is_legacy L108–111
+ test_all_new_hash_derived_domains_are_not_legacy method method test_all_new_hash_derived_domains_are_not_legacy L94–98
+ test_all_old_sequential_domains_are_legacy method method test_all_old_sequential_domains_are_legacy L85–88
+ test_domain_0_identity_is_legacy method method test_domain_0_identity_is_legacy L81–83
+ test_empty_string_is_not_legacy method method test_empty_string_is_not_legacy L100–102
+ test_integer_7_is_not_legacy method method test_integer_7_is_not_legacy L113–116
+ test_new_identity_domain_is_not_legacy method method test_new_identity_domain_is_not_legacy L90–92
+ test_non_muse_purpose_is_not_legacy method method test_non_muse_purpose_is_not_legacy L104–106
+ TestLiveMigration class class TestLiveMigration L397–533
+ test_live_run_calls_hub_register method method test_live_run_calls_hub_register L398–418
+ test_live_run_result_hub_registered_false_on_failure method method test_live_run_result_hub_registered_false_on_failure L483–505
+ test_live_run_result_hub_registered_true_on_success method method test_live_run_result_hub_registered_true_on_success L461–481
+ test_live_run_skips_already_migrated_entries method method test_live_run_skips_already_migrated_entries L442–459
+ test_live_run_updates_fingerprint_in_identity_map method method test_live_run_updates_fingerprint_in_identity_map L420–440
+ test_multi_hub_migrates_all_legacy method method test_multi_hub_migrates_all_legacy L507–533
+ TestMigrationPlan class class TestMigrationPlan L293–332
+ test_build_plans_all_seven_legacy_domains method method test_build_plans_all_seven_legacy_domains L322–332
+ test_build_plans_from_identity_map method method test_build_plans_from_identity_map L309–320
+ test_plan_has_expected_fields method method test_plan_has_expected_fields L294–307
+ TestNewPathForLegacy class class TestNewPathForLegacy L124–180
+ test_all_old_domains_map_to_correct_new_index method method test_all_old_domains_map_to_correct_new_index L134–137
+ test_already_new_path_raises method method test_already_new_path_raises L168–171
+ test_output_is_valid_muse_path_format method method test_output_is_valid_muse_path_format L173–180
+ test_preserves_entity_id method method test_preserves_entity_id L145–149
+ test_preserves_entity_type method method test_preserves_entity_type L139–143
+ test_preserves_index method method test_preserves_index L157–161
+ test_preserves_role method method test_preserves_role L151–155
+ test_unknown_old_domain_raises method method test_unknown_old_domain_raises L163–166
+ TestScanForLegacy class class TestScanForLegacy L231–285
+ test_empty_map_returns_empty method method test_empty_map_returns_empty L283–285
+ test_finds_legacy_human_entry method method test_finds_legacy_human_entry L232–242
+ test_finds_multiple_legacy_hubs method method test_finds_multiple_legacy_hubs L265–272
+ test_ignores_already_migrated_entry method method test_ignores_already_migrated_entry L244–253
+ test_ignores_entry_with_no_hd_path method method test_ignores_entry_with_no_hd_path L255–263
+ test_mixed_returns_only_legacy method method test_mixed_returns_only_legacy L274–281
+ _old_path function function _old_path L69–72
+ _write_identity_toml function function _write_identity_toml L541–550
+ DOMAIN_BLOCKCHAIN import import DOMAIN_BLOCKCHAIN L41–41
+ DOMAIN_CODE import import DOMAIN_CODE L41–41
+ DOMAIN_IDENTITY import import DOMAIN_IDENTITY L41–41
+ DOMAIN_MIDI import import DOMAIN_MIDI L41–41
+ DOMAIN_MUSIC import import DOMAIN_MUSIC L41–41
+ DOMAIN_PAYMENTS import import DOMAIN_PAYMENTS L41–41
+ DOMAIN_PROSE import import DOMAIN_PROSE L41–41
+ ENTITY_AGENT import import ENTITY_AGENT L41–41
+ ENTITY_HUMAN import import ENTITY_HUMAN L41–41
+ MagicMock import import MagicMock L37–37
+ ROLE_ATTEST import import ROLE_ATTEST L41–41
+ ROLE_SIGN import import ROLE_SIGN L41–41
+ annotations import import annotations L33–33
+ json import import json L35–35
+ muse_path import import muse_path L41–41
+ patch import import patch L37–37
+ pathlib import import pathlib L36–36
+ pytest import import pytest L39–39
← Older Oldest on task/migrate-domain-integers
All commits
Newer → Latest on task/migrate-domain-integers

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