gabriel / muse public
Closed #38 Enhancement
filed by gabriel human · 75 days ago

Remove deprecated index-domain migration (domain_migration.py + muse migrate domain-integers)

0 Anchors
Blast radius
Churn 30d
0 Proposals

Remove the deprecated index-domain migration (domain_migration.py + muse migrate domain-integers)

Summary

The index-domain migration converts pre-Phase-1 sequential domain integers (0,1,2,3,4,6) in HD paths to the hash-derived namespace. Sequential index domains are fully deprecated — the only valid, idiomatic domains are the hash-derived namespace integers (Identity 1660078172, Payments 284229149, Code 678195575, Mist 915186137, Music 1755707987, MIDI 1444628350, Prose 1658731548, Blockchain 1556829714, Generic 2023564266). Per the workspace "No Legacy / Delete on sight" rule, this migration machinery should be removed entirely.

Scope to delete (self-contained — nothing else in the codebase imports it)

  • muse/core/domain_migration.py
  • muse/cli/commands/migrate_cmd.py — the muse migrate domain-integers command. Verify it has no other subcommands; remove its registration in muse/cli/app.py (import ~L188, register ~L542).
  • tests/test_migrate_domain_integers.py
  • Any docs / --help text referencing muse migrate domain-integers.

Safety check BEFORE deletion

  • Confirm no real identities / hub registrations remain on old sequential paths (e.g. ~/.muse/identity.toml, staging registrations). If any exist, run the migration once and re-register, then delete. If none exist (pre-launch scaffolding), delete directly.

Open question to resolve during removal

  • The OLD_DOMAIN_NAMES / _OLD_TO_NEW maps have a gap at index 5 (they hold 0,1,2,3,4,6). The module docstring prose says "all 7 / 0–6" but the concrete enumeration lists only 6. Confirm index 5 was genuinely never a domain (vs a removed one) so the historical record is accurate before the code is deleted.

Context (why deferred, not done now)

Surfaced during the rc13 ship-out. The tests asserted 7 legacy domains (range(7), all_seven_legacy_domains) but the code maps only 6 — index 5 was never assigned (blockchain took 6). Rather than rabbit-hole on a deprecated path under ship pressure, the tests were patched to derive the legacy set from OLD_DOMAIN_NAMES (the code's source of truth) so they pass honestly against the real 6-domain mapping. This ticket tracks the real fix: removing the deprecated index-domain migration entirely.

Activity1
gabriel opened this issue 75 days ago
gabriel 54 days ago

Deleted on branch chore/remove-deprecated-domain-migration, commit 15bff0ad.

Safety check: confirmed no real identity uses a legacy sequential-domain HD path — ~/.muse/identity.toml's two entries both use hash-derived domain 1660078172, matching muse auth show's registered staging identity. No current code path ever writes a legacy-format path, so nothing could plausibly depend on this migration existing.

Open question resolved: the module's own docstring already correctly said index 5 was "excluded" (never assigned) — the ticket's confusion traced to stale summary prose elsewhere, not the code itself. No further archaeology needed.

Deleted: muse/core/domain_migration.py, muse/cli/commands/migrate_cmd.py (the entire top-level muse migrate namespace — its only subcommand was domain-integers), tests/test_migrate_domain_integers.py, and the registration/doc references in app.py. muse code migrate (a completely different command) is untouched.

Verified: muse migrate now correctly errors as unrecognized; muse code migrate --help still works. 171 migrate-related tests pass; muse code test scoped to the changed app.py reports 27/27, full coverage.

Not yet merged — bundling with a couple other small tickets tonight.

closed this issue 54 days ago