gabriel / muse public
patch dev
AI Agent gabriel · 148 days ago · Apr 25, 2026 · Diff

security(phase-3+4): auth keygen writes no PEM; key_path removed from schema

Add derive_hd_public_info() to keypair.py — derives Ed25519 public info in memory without writing any PEM file. Update run_keygen to call it instead of generate_hd_keypair, remove key_path from identity entries and JSON output, and remove the PEM-existence guard (no file to guard against).

Remove key_path from _KeygenJson and _AgentKeygenJson TypedDicts. The --force flag is now a no-op gate (no PEM to overwrite) but the flag is kept for backward-compat callers.

Tests updated: PEM-checking assertions replaced with no-PEM assertions; new TestKeygenPhase4NoPem (P4-1..P4-5) added and green.

sha256:2bd5f9eda173ac77b4b1532986a2f40bbc30d8f11f9305194a7e9c58e0b98b63 sha
+16 ~13 −7 symbols
sha256:6bef385a05697bdb55dac6025c21f55e40c67c0b4d78b3d433f24c728c8461f8 snapshot
+16
symbols added
~13
symbols modified
−7
symbols removed
0
dead code introduced
Semantic Changes 36 symbols
~ muse/core/keypair.py .py 1 symbol added
+ derive_hd_public_info function function derive_hd_public_info L228–245
~ tests/test_cmd_auth_keygen_hd.py .py 13 symbols added, 5 symbols removed, 8 symbols modified
test_no_force_rejects_existing method method test_no_force_rejects_existing L402–410
test_pem_permissions_600 method method test_pem_permissions_600 L297–303
test_pem_written method method test_pem_written L290–295
test_pem_loads_and_signs method method test_pem_loads_and_signs L457–471
test_pem_mode_is_600 method method test_pem_mode_is_600 L510–517
+ test_no_pem_written method method test_no_pem_written L290–297
+ test_second_keygen_succeeds_without_force method method test_second_keygen_succeeds_without_force L397–406
+ test_mnemonic_derives_and_signs method method test_mnemonic_derives_and_signs L453–476
+ test_no_pem_on_disk_after_keygen method method test_no_pem_on_disk_after_keygen L515–523
+ TestKeygenPhase4NoPem class class TestKeygenPhase4NoPem L734–809
+ test_P4_1_no_pem_written_after_keygen method method test_P4_1_no_pem_written_after_keygen L737–746
+ test_P4_2_identity_entry_has_no_key_path method method test_P4_2_identity_entry_has_no_key_path L748–762
+ test_P4_3_identity_entry_has_hd_path method method test_P4_3_identity_entry_has_hd_path L764–776
+ test_P4_4_resolve_signing_identity_works_after_keygen_and_register method method test_P4_4_resolve_signing_identity_works_after_keygen_and_register L778–799
+ test_P4_5_json_output_has_no_key_path method method test_P4_5_json_output_has_no_key_path L801–809
+ _P4_HUB variable variable _P4_HUB L717–717
+ _P4_MNEMONIC variable variable _P4_MNEMONIC L713–716
+ _p4_patch function function _p4_patch L720–731
~ tests/test_cmd_auth_keygen_register.py .py 2 symbols added, 2 symbols removed, 2 symbols modified
test_force_flag_overwrites method method test_force_flag_overwrites L191–198
test_key_file_created method method test_key_file_created L185–189
+ test_force_flag_still_succeeds method method test_force_flag_still_succeeds L191–196
+ test_no_pem_file_created method method test_no_pem_file_created L184–189
← Older Oldest on dev
All commits
Newer → Latest on dev

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:2bd5f9eda173ac77b4b1532986a2f40bbc30d8f11f9305194a7e9c58e0b98b63 --body "your comment"