feat(auth): guard against accidental mnemonic destruction in keygen
--force now only overwrites the identity entry — it NEVER generates fresh entropy when a mnemonic already exists in the keychain.
To intentionally destroy the mnemonic (irreversible), both flags are required: --force --destroy-mnemonic. Neither alone is sufficient.
Adds 14 tests (I–IV) covering: - mnemonic reuse under --force - blocked destruction without double confirmation - escape hatch requires both flags - fingerprint stability under --force - fingerprint change after --destroy-mnemonic --force - keychain byte-for-byte invariants in both paths
sha256:fb90368bca8f7da71d0276fd34c2da479646b1187d899840efd6f5725334c85e
sha
+35
~3
symbols
sha256:44f0a6d4c765a50af146b56c5ef1adc1e554296b70fa238dc83a27202f3039fb
snapshot
+35
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes
38 symbols
+
test_IV1_identity_toml_fingerprint_unchanged_after_force
method
method test_IV1_identity_toml_fingerprint_unchanged_after_force L326–348
+
test_IV2_identity_toml_fingerprint_changes_after_destroy
method
method test_IV2_identity_toml_fingerprint_changes_after_destroy L350–372
+
test_IV3_keychain_mnemonic_unchanged_after_force
method
method test_IV3_keychain_mnemonic_unchanged_after_force L374–386
+
test_IV4_keychain_mnemonic_changes_after_destroy_force
method
method test_IV4_keychain_mnemonic_changes_after_destroy_force L388–402
+
test_III1_destroy_mnemonic_no_force_mentions_force
method
method test_III1_destroy_mnemonic_no_force_mentions_force L289–302
+
test_III2_force_output_never_says_destroyed
method
method test_III2_force_output_never_says_destroyed L304–317
+
test_II2_destroy_mnemonic_force_reports_generated
method
method test_II2_destroy_mnemonic_force_reports_generated L268–280
+
test_I1_no_existing_mnemonic_generates_fresh
method
method test_I1_no_existing_mnemonic_generates_fresh L133–147
+
test_I2_force_with_existing_mnemonic_reuses_it
method
method test_I2_force_with_existing_mnemonic_reuses_it L149–170
+
test_I3_destroy_mnemonic_without_force_is_blocked
method
method test_I3_destroy_mnemonic_without_force_is_blocked L172–191
+
test_I4_destroy_mnemonic_and_force_generates_fresh
method
method test_I4_destroy_mnemonic_and_force_generates_fresh L193–211
+
test_I6_destroy_mnemonic_force_fingerprint_changes
method
method test_I6_destroy_mnemonic_force_fingerprint_changes L229–245
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:fb90368bca8f7da71d0276fd34c2da479646b1187d899840efd6f5725334c85e --body "your comment"
No comments yet. Be the first to start the discussion.