gabriel / muse public
chore BREAKING muse#38 chore/remove-deprecated-domain-migration #1 / 1
AI Agent gabriel · 9 days ago · Jul 8, 2026 · Diff

chore(muse#38): delete deprecated sequential-domain-integer migration

The index-domain migration converted pre-Phase-1 sequential domain integers (0-6, excluding 5 -- never assigned) in HD paths to the current hash-derived namespace. The only valid domains today are hash-derived. Per the workspace's No Legacy / Delete on sight rule, this migration machinery is fully removed:

- muse/core/domain_migration.py - muse/cli/commands/migrate_cmd.py (the 'muse migrate domain-integers' command -- its only subcommand; the entire top-level 'muse migrate' namespace is gone, unrelated to and not to be confused with 'muse code migrate', which is untouched) - tests/test_migrate_domain_integers.py - registration + doc references in muse/cli/app.py

Safety check before deletion: confirmed no real identity uses a legacy sequential-domain HD path -- checked ~/.muse/identity.toml (both entries use hash-derived domain 1660078172) and the registered staging identity via 'muse auth show' (same). No registration path in current code ever writes a legacy-format path, so no live identity could plausibly need this migration.

Resolved the ticket's open question: the module's own docstring already correctly stated index 5 was 'excluded' (never assigned), not removed -- the ticket's confusion was in stale summary prose elsewhere, not the code.

Verified: muse migrate now errors as an unrecognized command; muse code migrate is unaffected. 171 migrate-related tests pass; muse code test (scoped to the changed app.py) reports 27/27 passed, full coverage.

sha256:15bff0adad139dcfd2b91a6270e3f678529685b428e597b46866080b8ad190ce sha
~125 −137 symbols
sha256:ee34c1bb7a80e0107b51b9b50b30d8244021e478e366a7d71ac59a8b64811e35 snapshot
~125
symbols modified
−137
symbols removed
0
dead code introduced
Semantic Changes 262 symbols
~ muse/cli/commands/migrate_cmd.py .py 14 symbols removed
_make_hub_register_fn function function _make_hub_register_fn L66–93
_run_domain_integers function function _run_domain_integers L99–221
Callable import import Callable L54–54
EnvelopeJson import import EnvelopeJson L56–56
ExitCode import import ExitCode L57–57
Mapping import import Mapping L54–54
argparse import import argparse L50–50
json import import json L51–51
logging import import logging L52–52
make_envelope import import make_envelope L56–56
start_timer import import start_timer L58–58
sys import import sys L53–53
logger variable variable logger L60–60
register function function register L227–267
~ muse/core/domain_migration.py .py 26 symbols removed
MigrationPlan class class MigrationPlan L183–191
MigrationResult class class MigrationResult L194–202
OLD_DOMAIN_NAMES variable variable OLD_DOMAIN_NAMES L56–63
_OLD_TO_NEW variable variable _OLD_TO_NEW L65–72
_PATH_RE variable variable _PATH_RE L76–83
_parse_path function function _parse_path L85–90
build_plans function function build_plans L204–222
derive_fingerprint_at_path function function derive_fingerprint_at_path L129–159
DOMAIN_BLOCKCHAIN import import DOMAIN_BLOCKCHAIN L39–39
DOMAIN_CODE import import DOMAIN_CODE L39–39
DOMAIN_IDENTITY import import DOMAIN_IDENTITY L39–39
DOMAIN_MIDI import import DOMAIN_MIDI L39–39
DOMAIN_MUSIC import import DOMAIN_MUSIC L39–39
DOMAIN_PAYMENTS import import DOMAIN_PAYMENTS L39–39
MUSE_PURPOSE import import MUSE_PURPOSE L48–48
Mapping import import Mapping L36–36
dataclass class import dataclass L37–37
field import import field L37–37
logging import import logging L34–34
muse_path import import muse_path L39–39
re import import re L35–35
is_legacy_hd_path function function is_legacy_hd_path L96–107
logger variable variable logger L50–50
new_path_for_legacy function function new_path_for_legacy L109–127
run_migration function function run_migration L228–292
scan_for_legacy function function scan_for_legacy L165–176
~ tests/test_migrate_domain_integers.py .py 96 symbols removed
FAKE_MNEMONIC variable variable FAKE_MNEMONIC L66–69
TestCliDryRun class class TestCliDryRun L559–621
test_cli_dry_run_exits_0_with_json method method test_cli_dry_run_exits_0_with_json L560–590
test_cli_no_legacy_entries_exits_0 method method test_cli_no_legacy_entries_exits_0 L592–621
TestDataIntegrity class class TestDataIntegrity L739–855
test_already_migrated_map_returns_empty method method test_already_migrated_map_returns_empty L740–755
test_dry_run_twice_same_results method method test_dry_run_twice_same_results L839–855
test_fingerprint_format_stored_in_identity_map method method test_fingerprint_format_stored_in_identity_map L796–814
test_hd_path_updated_even_when_registration_fails method method test_hd_path_updated_even_when_registration_fails L816–837
test_partial_failure_updates_successful_entries method method test_partial_failure_updates_successful_entries L757–794
TestDeriveNewFingerprint class class TestDeriveNewFingerprint L194–229
test_fingerprint_is_sha256_prefixed method method test_fingerprint_is_sha256_prefixed L223–229
test_new_fingerprint_is_deterministic method method test_new_fingerprint_is_deterministic L204–211
test_new_fingerprint_matches_direct_derive method method test_new_fingerprint_matches_direct_derive L213–221
test_old_and_new_fingerprints_differ method method test_old_and_new_fingerprints_differ L195–202
TestDryRun class class TestDryRun L346–395
test_dry_run_does_not_mutate_identity_map method method test_dry_run_does_not_mutate_identity_map L378–395
test_dry_run_returns_plans_without_registering method method test_dry_run_returns_plans_without_registering L347–376
TestIntegration class class TestIntegration L629–674
test_migration_against_real_toml_file method method test_migration_against_real_toml_file L630–674
TestIsLegacyHdPath class class TestIsLegacyHdPath L87–123
test_agent_old_path_is_legacy method method test_agent_old_path_is_legacy L115–118
test_all_new_hash_derived_domains_are_not_legacy method method test_all_new_hash_derived_domains_are_not_legacy L101–105
test_all_old_sequential_domains_are_legacy method method test_all_old_sequential_domains_are_legacy L92–95
test_domain_0_identity_is_legacy method method test_domain_0_identity_is_legacy L88–90
test_empty_string_is_not_legacy method method test_empty_string_is_not_legacy L107–109
test_integer_7_is_not_legacy method method test_integer_7_is_not_legacy L120–123
test_new_identity_domain_is_not_legacy method method test_new_identity_domain_is_not_legacy L97–99
test_non_muse_purpose_is_not_legacy method method test_non_muse_purpose_is_not_legacy L111–113
TestLiveMigration class class TestLiveMigration L403–539
test_live_run_calls_hub_register method method test_live_run_calls_hub_register L404–424
test_live_run_result_hub_registered_false_on_failure method method test_live_run_result_hub_registered_false_on_failure L489–511
test_live_run_result_hub_registered_true_on_success method method test_live_run_result_hub_registered_true_on_success L467–487
test_live_run_skips_already_migrated_entries method method test_live_run_skips_already_migrated_entries L448–465
test_live_run_updates_fingerprint_in_identity_map method method test_live_run_updates_fingerprint_in_identity_map L426–446
test_multi_hub_migrates_all_legacy method method test_multi_hub_migrates_all_legacy L513–539
TestMigrationPlan class class TestMigrationPlan L299–338
test_build_plans_all_legacy_domains method method test_build_plans_all_legacy_domains L328–338
test_build_plans_from_identity_map method method test_build_plans_from_identity_map L315–326
test_plan_has_expected_fields method method test_plan_has_expected_fields L300–313
TestNewPathForLegacy class class TestNewPathForLegacy L131–186
test_all_old_domains_map_to_correct_new_index method method test_all_old_domains_map_to_correct_new_index L140–143
test_already_new_path_raises method method test_already_new_path_raises L174–177
test_output_is_valid_muse_path_format method method test_output_is_valid_muse_path_format L179–186
test_preserves_entity_id method method test_preserves_entity_id L151–155
test_preserves_entity_type method method test_preserves_entity_type L145–149
test_preserves_index method method test_preserves_index L163–167
test_preserves_role method method test_preserves_role L157–161
test_unknown_old_domain_raises method method test_unknown_old_domain_raises L169–172
TestPerformance class class TestPerformance L929–965
test_is_legacy_hd_path_fast_for_thousand_calls method method test_is_legacy_hd_path_fast_for_thousand_calls L953–965
test_run_migration_twenty_entries_under_ten_seconds method method test_run_migration_twenty_entries_under_ten_seconds L930–951
TestScanForLegacy class class TestScanForLegacy L237–291
test_empty_map_returns_empty method method test_empty_map_returns_empty L289–291
test_finds_legacy_human_entry method method test_finds_legacy_human_entry L238–248
test_finds_multiple_legacy_hubs method method test_finds_multiple_legacy_hubs L271–278
test_ignores_already_migrated_entry method method test_ignores_already_migrated_entry L250–259
test_ignores_entry_with_no_hd_path method method test_ignores_entry_with_no_hd_path L261–269
test_mixed_returns_only_legacy method method test_mixed_returns_only_legacy L280–287
TestSecurity class class TestSecurity L863–921
test_derive_fingerprint_invalid_path_raises method method test_derive_fingerprint_invalid_path_raises L915–921
test_domain_just_above_range_not_legacy method method test_domain_just_above_range_not_legacy L870–873
test_empty_string_not_legacy method method test_empty_string_not_legacy L900–903
test_large_domain_integer_not_legacy method method test_large_domain_integer_not_legacy L875–879
test_malformed_path_missing_hardened_marker_not_legacy method method test_malformed_path_missing_hardened_marker_not_legacy L881–886
test_non_muse_purpose_with_legacy_domain_not_flagged method method test_non_muse_purpose_with_legacy_domain_not_flagged L864–868
test_path_traversal_attempt_not_legacy method method test_path_traversal_attempt_not_legacy L910–913
test_path_with_extra_segments_not_legacy method method test_path_with_extra_segments_not_legacy L894–898
test_path_with_too_few_segments_not_legacy method method test_path_with_too_few_segments_not_legacy L888–892
test_whitespace_only_not_legacy method method test_whitespace_only_not_legacy L905–908
TestStress class class TestStress L682–731
test_dry_run_fifty_hubs_no_writes method method test_dry_run_fifty_hubs_no_writes L683–706
test_live_run_fifty_hubs_all_registered method method test_live_run_fifty_hubs_all_registered L708–731
_LEGACY_DOMAINS variable variable _LEGACY_DOMAINS L61–61
_old_path function function _old_path L76–79
_write_identity_toml function function _write_identity_toml L547–556
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
ENTITY_AGENT import import ENTITY_AGENT L41–41
ENTITY_HUMAN import import ENTITY_HUMAN L41–41
MagicMock import import MagicMock L37–37
Mapping import import Mapping L36–36
ROLE_ATTEST import import ROLE_ATTEST L41–41
ROLE_SIGN import import ROLE_SIGN L41–41
_OLD_DOMAIN_NAMES import import _OLD_DOMAIN_NAMES L55–55
annotations import import annotations L32–32
json import import json L34–34
muse_dir import import muse_dir L54–54
muse_path import import muse_path L41–41
patch import import patch L37–37
pathlib import import pathlib L35–35
pytest import import pytest L39–39
← Older Oldest on chore/remove-deprecated-domain-migration
All commits
Newer → Latest on chore/remove-deprecated-domain-migration

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