gabriel / muse public
test patch auth task/supercharge-auth #1 / 1
AI Agent gabriel · 163 days ago · Apr 16, 2026 · Diff

test(auth): supercharge auth suite — 7-tier coverage, remove key_source, keychain-secure

- Remove key_source field from IdentityEntry, _load_all, _dump_identity (always HD now) - Fix n_words bug in run_keygen: actual mnemonic length, not theoretical word_count() - Add --type human|agent filter to whoami --all - Add provisioned_by, hd_path to _WhoamiJson, _ShowJson, _KeygenJson TypedDicts - Rewrite test_auth_hd_persistence to assert mnemonic NOT in TOML (keychain-secure design) - Fix mnemonic-in-TOML assertion to use regex (avoids false match on tmp-path substring) - Add test_cmd_auth_supercharged: TypedDict completeness, type filter, show fields - Fill 7-tier gaps: recover (data_integrity, stress, perf), register (stress, perf), logout (stress, perf), show (stress) — 48 new tests, 259 total passing

sha256:cc7f945f8247348bbf940d1b26eb0d766a39951fd4bbb9327a9e6e72ffb9b751 sha
+119 ~37 −28 symbols
sha256:7b25dc131721a3ca0835f017127c2c443abbff5ce3192a897f0c372667893e52 snapshot
+119
symbols added
~37
symbols modified
−28
symbols removed
0
dead code introduced
Semantic Changes 184 symbols
~ tests/test_cmd_auth_supercharged.py .py 87 symbols added
+ HOSTNAME variable variable HOSTNAME L38–38
+ HOSTNAME2 variable variable HOSTNAME2 L40–40
+ HUB variable variable HUB L37–37
+ HUB2 variable variable HUB2 L39–39
+ TestDisplayEntryProvisionedBy class class TestDisplayEntryProvisionedBy L176–218
+ test_agent_hd_path_in_json method method test_agent_hd_path_in_json L198–211
+ test_agent_provisioned_by_in_json method method test_agent_provisioned_by_in_json L177–189
+ test_human_no_provisioned_by method method test_human_no_provisioned_by L191–196
+ test_no_hd_path_absent_from_json method method test_no_hd_path_absent_from_json L213–218
+ TestKeygenJsonTypedDict class class TestKeygenJsonTypedDict L106–128
+ test_all_required_keys_present method method test_all_required_keys_present L123–128
+ test_hd_path_in_keygen_typeddict method method test_hd_path_in_keygen_typeddict L109–114
+ test_mnemonic_word_count_in_keygen_typeddict method method test_mnemonic_word_count_in_keygen_typeddict L116–121
+ TestLoadAllPerformance class class TestLoadAllPerformance L424–448
+ test_50_entries_under_200ms method method test_50_entries_under_200ms L425–448
+ TestLogoutPerformance class class TestLogoutPerformance L607–634
+ test_logout_all_50_hubs_under_100ms method method test_logout_all_50_hubs_under_100ms L608–634
+ TestLogoutStress class class TestLogoutStress L554–601
+ test_logout_all_50_hubs method method test_logout_all_50_hubs L557–601
+ TestRecoverDataIntegrity class class TestRecoverDataIntegrity L640–767
+ _patch method method _patch L648–661
+ test_different_mnemonic_different_fingerprint method method test_different_mnemonic_different_fingerprint L691–724
+ test_recover_hd_path_persisted method method test_recover_hd_path_persisted L726–746
+ test_recover_mnemonic_not_in_toml method method test_recover_mnemonic_not_in_toml L748–767
+ test_same_mnemonic_same_fingerprint method method test_same_mnemonic_same_fingerprint L663–689
+ TestRecoverPerformance class class TestRecoverPerformance L839–870
+ test_recover_under_3_seconds method method test_recover_under_3_seconds L845–870
+ TestRecoverStress class class TestRecoverStress L773–833
+ _patch method method _patch L779–792
+ test_10_recoveries_different_hubs method method test_10_recoveries_different_hubs L813–833
+ test_10_recoveries_same_fingerprint method method test_10_recoveries_same_fingerprint L794–811
+ TestRegisterPerformance class class TestRegisterPerformance L876–938
+ test_register_under_500ms method method test_register_under_500ms L879–938
+ TestRegisterStress class class TestRegisterStress L944–1009
+ test_5_register_calls_same_hub method method test_5_register_calls_same_hub L947–1009
+ TestShowJsonKeyPathAlgorithm class class TestShowJsonKeyPathAlgorithm L357–392
+ test_show_json_agent_has_provisioned_by method method test_show_json_agent_has_provisioned_by L387–392
+ test_show_json_algorithm_value_correct method method test_show_json_algorithm_value_correct L380–385
+ test_show_json_has_algorithm method method test_show_json_has_algorithm L365–370
+ test_show_json_has_key_path method method test_show_json_has_key_path L358–363
+ test_show_json_key_path_value_correct method method test_show_json_key_path_value_correct L372–378
+ TestShowJsonTypedDict class class TestShowJsonTypedDict L134–155
+ test_algorithm_in_show_typeddict method method test_algorithm_in_show_typeddict L143–145
+ test_key_path_in_show_typeddict method method test_key_path_in_show_typeddict L139–141
+ test_provisioned_by_fingerprint_in_show_typeddict method method test_provisioned_by_fingerprint_in_show_typeddict L152–155
+ test_provisioned_by_in_show_typeddict method method test_provisioned_by_in_show_typeddict L147–150
+ TestShowStress class class TestShowStress L454–548
+ test_show_50_repeated_calls_consistent method method test_show_50_repeated_calls_consistent L509–548
+ test_show_with_50_identities_returns_correct_entry method method test_show_with_50_identities_returns_correct_entry L457–507
+ TestTypeFilterSecurity class class TestTypeFilterSecurity L398–418
+ test_type_with_ansi_injection_rejected method method test_type_with_ansi_injection_rejected L399–404
+ test_type_with_newline_injection_rejected method method test_type_with_newline_injection_rejected L406–411
+ test_type_with_semicolon_rejected method method test_type_with_semicolon_rejected L413–418
+ TestWhoamiHdPath class class TestWhoamiHdPath L329–351
+ test_whoami_json_hd_entry_has_hd_path method method test_whoami_json_hd_entry_has_hd_path L330–344
+ test_whoami_json_no_hd_path_when_absent method method test_whoami_json_no_hd_path_when_absent L346–351
+ TestWhoamiJsonTypedDict class class TestWhoamiJsonTypedDict L161–170
+ test_hd_path_in_whoami_typeddict method method test_hd_path_in_whoami_typeddict L167–170
+ test_provisioned_by_in_whoami_typeddict method method test_provisioned_by_in_whoami_typeddict L162–165
+ TestWhoamiProvisionedBy class class TestWhoamiProvisionedBy L302–323
+ test_whoami_all_json_agent_has_provisioned_by method method test_whoami_all_json_agent_has_provisioned_by L317–323
+ test_whoami_json_agent_has_provisioned_by method method test_whoami_json_agent_has_provisioned_by L303–308
+ test_whoami_json_human_no_provisioned_by method method test_whoami_json_human_no_provisioned_by L310–315
+ TestWhoamiTypeFilter class class TestWhoamiTypeFilter L224–296
+ test_type_agent_includes_provisioned_by method method test_type_agent_includes_provisioned_by L289–296
+ test_type_agent_returns_only_agents method method test_type_agent_returns_only_agents L239–249
+ test_type_filter_counts_correctly method method test_type_filter_counts_correctly L276–287
+ test_type_filter_no_match_exits_nonzero method method test_type_filter_no_match_exits_nonzero L251–255
+ test_type_filter_no_match_json_exits_nonzero method method test_type_filter_no_match_json_exits_nonzero L257–260
+ test_type_human_returns_only_humans method method test_type_human_returns_only_humans L227–237
+ test_type_invalid_value_exits_nonzero method method test_type_invalid_value_exits_nonzero L262–266
+ test_type_requires_all_flag method method test_type_requires_all_flag L268–274
+ _agent function function _agent L83–91
+ _human function function _human L73–80
+ _parse_json function function _parse_json L94–100
+ cli variable variable cli L34–34
+ CliRunner import import CliRunner L31–31
+ IdentityEntry import import IdentityEntry L32–32
+ InvokeResult import import InvokeResult L31–31
+ annotations import import annotations L23–23
+ json import import json L25–25
+ pathlib import import pathlib L26–26
+ pytest import import pytest L29–29
+ save_identity import import save_identity L32–32
+ time import import time L27–27
+ repo function function repo L47–70
+ runner variable variable runner L35–35
~ muse/core/identity.py .py 1 symbol modified
~ tests/test_auth_hd_persistence.py .py 28 symbols added, 28 symbols removed, 17 symbols modified
− TestKeygenHdWritesIdentity class class TestKeygenHdWritesIdentity L184–241
− _run method method _run L187–192
− test_hd_path_written method method test_hd_path_written L209–212
− test_json_output_has_no_mnemonic_key method method test_json_output_has_no_mnemonic_key L214–224
− test_key_source_hd_written method method test_key_source_hd_written L199–202
− test_keygen_hd_force_overwrites_identity method method test_keygen_hd_force_overwrites_identity L235–241
− test_mnemonic_absent_from_json_object method method test_mnemonic_absent_from_json_object L226–233
− test_mnemonic_written method method test_mnemonic_written L204–207
− test_jbok_entry_has_no_hd_fields method method test_jbok_entry_has_no_hd_fields L151–160
− test_loads_all_hd_fields_together method method test_loads_all_hd_fields_together L139–149
− test_loads_key_source method method test_loads_key_source L115–121
− test_loads_mnemonic method method test_loads_mnemonic L123–129
− test_round_trip_hd_fields method method test_round_trip_hd_fields L162–176
− test_keygen_hd_json_mnemonic_word_count_present method method test_keygen_hd_json_mnemonic_word_count_present L384–398
− test_keygen_hd_json_no_mnemonic_key method method test_keygen_hd_json_no_mnemonic_key L368–382
− TestMnemonicTomlEscaping class class TestMnemonicTomlEscaping L331–357
− test_hd_path_prime_and_slash_preserved method method test_hd_path_prime_and_slash_preserved L346–357
− test_mnemonic_with_quotes_round_trips method method test_mnemonic_with_quotes_round_trips L332–344
− test_keygen_hd_then_load_identity_under_3s method method test_keygen_hd_then_load_identity_under_3s L454–466
− test_10_successive_registers_preserve_mnemonic method method test_10_successive_registers_preserve_mnemonic L477–496
− test_concurrent_identity_writes_do_not_corrupt method method test_concurrent_identity_writes_do_not_corrupt L498–518
− _setup_hd_keygen method method _setup_hd_keygen L252–265
− test_hd_fields_preserved_after_register method method test_hd_fields_preserved_after_register L273–282
− test_jbok_register_no_hd_fields_added method method test_jbok_register_no_hd_fields_ L306–323
− test_register_second_time_still_preserves_mnemonic method method test_register_second_time_still_preserves_mnemonic L295–304
− os import import os L27–27
− patch import import patch L32–32
− tempfile import import tempfile L29–29
+ TestDumpIdentityHdFields class class TestDumpIdentityHdFields L175–229
+ test_hd_path_round_trips method method test_hd_path_round_trips L215–229
+ test_hd_path_serialised method method test_hd_path_serialised L178–188
+ test_key_source_never_serialised method method test_key_source_never_serialised L204–213
+ test_mnemonic_never_serialised method method test_mnemonic_never_serialised L190–202
+ TestHdPathTomlEscaping class class TestHdPathTomlEscaping L428–452
+ test_handle_with_special_chars_round_trips method method test_handle_with_special_chars_round_trips L443–452
+ test_hd_path_prime_and_slash_preserved method method test_hd_path_prime_and_slash_preserved L431–441
+ TestKeygenWritesIdentity class class TestKeygenWritesIdentity L237–282
+ _run method method _run L241–246
+ test_force_overwrites_writes_hd_path method method test_force_overwrites_writes_hd_path L274–282
+ test_hd_path_written method method test_hd_path_written L253–256
+ test_key_source_not_in_toml method method test_key_source_not_in_toml L268–272
+ test_mnemonic_not_in_toml method method test_mnemonic_not_in_toml L258–266
+ test_entry_without_hd_fields_has_no_hd_keys method method test_entry_without_hd_fields_has_no_hd_keys L149–158
+ test_loads_provisioned_by method method test_loads_provisioned_by L160–167
+ test_mnemonic_not_loaded_from_toml method method test_mnemonic_not_loaded_from_toml L119–129
+ test_no_key_source_field_exists method method test_no_key_source_field_exists L139–147
+ test_keygen_json_has_mnemonic_word_count method method test_keygen_json_has_mnemonic_word_count L324–342
+ test_keygen_json_mnemonic_content_absent method method test_keygen_json_mnemonic_content_absent L308–322
+ test_keygen_json_no_mnemonic_key method method test_keygen_json_no_mnemonic_key L293–306
+ test_mnemonic_not_in_toml_after_keygen method method test_mnemonic_not_in_toml_after_keygen L344–359
+ test_keygen_then_load_identity_under_3s method method test_keygen_then_load_identity_under_3s L508–521
+ test_10_successive_registers_preserve_hd_fields method method test_10_successive_registers_preserve_hd_fields L532–551
+ test_20_successive_saves_preserve_hd_path method method test_20_successive_saves_preserve_hd_path L553–578
+ _setup_keygen method method _setup_keygen L371–379
+ test_hd_path_preserved_after_register method method test_hd_path_preserved_after_register L388–397
+ test_mnemonic_not_in_toml_after_register method method test_mnemonic_not_in_toml_after_register L399–408
~ HUB
~ tests/test_cmd_auth_keygen_register.py .py 4 symbols added, 10 symbols modified
← Older Oldest on task/supercharge-auth
All commits
Newer → Latest on task/supercharge-auth

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