feat
patch
hdkeys
task/hash-derived-domain-integers
#1 / 1
feat(hdkeys): replace hardcoded DOMAIN_* integers with sha256-derived values
Issue #3 Phase 1. Domain indices are now computed as: domain_index(name) = sha256(name.encode())[:4] & 0x7FFFFFFF
This is the same pattern used for MUSE_PURPOSE — reproducible by anyone, no central registry, no registration-war for third-party domains.
New exports: - domain_index(name: str) -> int — compute any domain's index from its name - DOMAIN_GENERIC = domain_index('muse/generic') — repos with no domain plugin
Canonical name strings use the 'muse/<slug>' convention for first-party domains. Any third-party domain can derive its own index without coordination.
Updated tests: remove hardcoded 0/1/2/3 assertions, add snapshot tests for the concrete hash values, and add 31-bit range checks.
sha256:ef4333f9187d34a6b5fc2584bebeaca3ccf26cca08a85501ba7d9a4f16841c04
sha
sha256:0c4962ff3a3d7d8186f7c2cfdfd952d1f629bf06c1b325b3e74b5c4a3dcbad00
snapshot
← Older
Oldest on task/hash-derived-domain-integers
All commits
Newer →
Latest on task/hash-derived-domain-integers
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:ef4333f9187d34a6b5fc2584bebeaca3ccf26cca08a85501ba7d9a4f16841c04 --body "your comment"
No comments yet. Be the first to start the discussion.