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

chore: complete PEM removal — delete vestigial functions and update all tests

Remove all remaining references to generate_hd_keypair, load_private_key, key_path_for, load_private_key_from_pem, and key_path from production code and tests. Every caller now uses derive_hd_public_info.

Production changes: - keypair.py: deleted generate_hd_keypair, load_private_key, key_path_for, load_private_key_from_pem, _write_private_key_pem, _hostname_key, _SAFE_AGENT_ID, _key_path, _ensure_keys_dir; kept _KEYS_DIR sentinel - identity.py: deleted _check_key_file_permissions, _load_private_key_from_path - sign.py: deleted --key-path flag and key_path branch from _load_signing - auth.py: removed key_path from _RecoverJson, _RotateJson, _ShowJson, _ShowOutputJson; updated run_recover and run_rotate to keychain + HD derivation

Test changes: - test_keygen_no_bytes_copy.py: migrated to derive_hd_public_info, no isolated fixture - test_derived_key_zeroing.py: migrated to derive_hd_public_info - test_agent_signing.py: deleted TestAgentKeyPaths PEM tests, added TestKeypairDistinctness using derive_hd_public_info - test_cmd_auth_keygen_register.py: deleted PEM-based TestKeypairModule tests, kept fingerprint and distinctness tests via derive_hd_public_info - test_public_key_fingerprint.py: migrated generate_hd_keypair call - test_cmd_auth_keygen_hd.py: migrated TestGenerateHdKeypair to derive_hd_public_info - test_auth_hd_persistence.py: deleted generate_hd_keypair docstring test - test_auth_supercharge.py: removed key_path from _KeygenJson expected keys, _ShowJson tests, _human/_agent fixtures; fixed register performance/stress tests to use save_identity + keychain patch instead of generate_hd_keypair - test_cmd_sign.py: deleted test_key_path_override_loads_from_file

sha256:91e554b0348decd7e718215e1633ff9e9c38c298a96dbae82b1e1e00077f3498 sha
+14 ~36 −59 symbols
sha256:d800588476b210411657c8499bafda697f23e65bbc1fdf0b9d5c66f643766f70 snapshot
+14
symbols added
~36
symbols modified
−59
symbols removed
0
dead code introduced
Semantic Changes 109 symbols
~ muse/core/identity.py .py 2 symbols removed
_check_key_file_permissions function function _check_key_file_permissions L516–566
_load_private_key_from_path function function _load_private_key_from_path L569–594
~ muse/core/keypair.py .py 17 symbols removed, 2 symbols modified
_SAFE_AGENT_ID variable variable _SAFE_AGENT_ID L81–81
_ensure_keys_dir function function _ensure_keys_dir L106–112
_hostname_key function function _hostname_key L72–78
_key_path function function _key_path L84–103
_write_private_key_pem function function _write_private_key_pem L115–147
generate_hd_keypair function function generate_hd_keypair L250–312
NoEncryption import import NoEncryption L53–53
PrivateFormat import import PrivateFormat L53–53
hashlib import import hashlib L41–41
os import import os L43–43
pathlib import import pathlib L44–44
re import import re L45–45
stat import import stat L46–46
tempfile import import tempfile L47–47
key_path_for function function key_path_for L218–225
load_private_key function function load_private_key L175–201
load_private_key_from_pem function function load_private_key_from_pem L315–331
~ tests/test_agent_signing.py .py 4 symbols added, 9 symbols removed
TestAgentKeyPaths class class TestAgentKeyPaths L204–238
test_agent_key_path_uses_double_underscore method method test_agent_key_path_uses_double_underscore L210–212
test_generate_agent_keypair_creates_distinct_file method method test_generate_agent_keypair_creates_distinct_file L214–222
test_human_key_path method method test_human_key_path L205–208
test_load_private_key_agent_id_not_found_returns_none method method test_load_private_key_agent_id_not_found_returns_none L232–238
test_load_private_key_with_agent_id method method test_load_private_key_with_agent_id L224–230
generate_hd_keypair import import generate_hd_keypair L39–39
key_path_for import import key_path_for L39–39
load_private_key import import load_private_key L39–39
+ TestKeypairDistinctness class class TestKeypairDistinctness L200–209
+ test_different_seeds_produce_different_fingerprints method method test_different_seeds_produce_different_fingerprints L201–204
+ test_same_seed_produces_same_fingerprint method method test_same_seed_produces_same_fingerprint L206–209
+ derive_hd_public_info import import derive_hd_public_info L39–39
~ tests/test_auth_hd_persistence.py .py 1 symbol removed, 1 symbol modified
test_generate_hd_keypair_has_docstring method method test_generate_hd_keypair_has_docstring L474–476
~ tests/test_auth_supercharge.py .py 3 symbols removed, 10 symbols modified
test_show_json_has_key_path method method test_show_json_has_key_path L359–364
test_show_json_key_path_value_correct method method test_show_json_key_path_value_correct L373–379
test_key_path_in_show_typeddict method method test_key_path_in_show_typeddict L140–142
~ _agent
~ _human
~ tests/test_cmd_auth_keygen_hd.py .py 1 symbol added, 1 symbol removed, 6 symbols modified
~ tests/test_cmd_auth_keygen_register.py .py 1 symbol added, 10 symbols removed, 4 symbols modified
test_generate_and_load_roundtrip method method test_generate_and_load_roundtrip L91–104
test_generate_overwrites_existing_key method method test_generate_overwrites_existing_key L161–166
test_hostname_sanitisation_colon_port method method test_hostname_sanitisation_colon_port L153–159
test_key_file_permissions_0o600 method method test_key_file_permissions_0o600 L106–111
test_keys_dir_permissions_0o700 method method test_keys_dir_permissions_0o700 L113–118
test_load_nonexistent_key_returns_none method method test_load_nonexistent_key_returns_none L120–122
test_sign_verify_roundtrip method method test_sign_verify_roundtrip L124–138
_SEED_B variable variable _SEED_B L85–85
hashlib import import hashlib L14–14
stat import import stat L17–17
+ test_different_seeds_produce_different_keys method method test_different_seeds_produce_different_keys L97–100
~ tests/test_cmd_sign.py .py 1 symbol removed, 1 symbol modified
test_key_path_override_loads_from_file method method test_key_path_override_loads_from_file L511–536
~ tests/test_derived_key_zeroing.py .py 4 symbols added, 7 symbols removed, 2 symbols modified
TestGenerateHdKeypairZeroing class class TestGenerateHdKeypairZeroing L116–156
test_III1_private_bytes_zeroed_after_keygen method method test_III1_private_bytes_zeroed_after_keygen L117–136
test_III2_chain_code_zeroed_after_keygen method method test_III2_chain_code_zeroed_after_keygen L138–156
id_module import import id_module L42–42
kp_module import import kp_module L41–41
pathlib import import pathlib L36–36
isolated function function isolated L55–62
+ TestDeriveHdPublicInfoZeroing class class TestDeriveHdPublicInfoZeroing L105–141
+ test_III1_private_bytes_zeroed_after_derive method method test_III1_private_bytes_zeroed_after_derive L106–123
+ test_III2_chain_code_zeroed_after_derive method method test_III2_chain_code_zeroed_after_derive L125–141
+ derive_hd_public_info import import derive_hd_public_info L43–43
~ tests/test_keygen_no_bytes_copy.py .py 3 symbols added, 7 symbols removed
TestGenerateHdKeypairNoBytescopy class class TestGenerateHdKeypairNoBytescopy L88–115
test_II1_derived_key_zeroed_after_keygen method method test_II1_derived_key_zeroed_after_keygen L89–115
id_module import import id_module L38–38
kp_module import import kp_module L37–37
pathlib import import pathlib L30–30
pytest import import pytest L33–33
isolated function function isolated L51–58
+ TestDeriveHdPublicInfoNoBytescopy class class TestDeriveHdPublicInfoNoBytescopy L65–92
+ test_II1_derived_key_zeroed_after_derive method method test_II1_derived_key_zeroed_after_derive L66–92
+ derive_hd_public_info import import derive_hd_public_info L29–29
~ tests/test_public_key_fingerprint.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
test_generate_hd_keypair_returns_prefixed_fingerprint method method test_generate_hd_keypair_returns_prefixed_fingerprint L121–130
+ test_derive_hd_public_info_returns_prefixed_fingerprint method method test_derive_hd_public_info_returns_prefixed_fingerprint L121–128
← 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:91e554b0348decd7e718215e1633ff9e9c38c298a96dbae82b1e1e00077f3498 --body "your comment"