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

feat: migrate [user] out of config.toml into identity.toml

- _load_config silently drops any [user] section found in legacy files - _dump_toml never writes a [user] section; identity lives in identity.toml - set_config_value("user.*") raises ValueError with redirect to muse auth - get_config_value("user.*") reads from identity.toml for the active hub - 14 new TDD tests in test_user_identity_migration.py covering all paths - test_cmd_config_hardening.py refactored: theater removed, user.* blocking verified end-to-end, all 229 assertions pass

sha256:edd86f327550c520c67de40c103860214cbc7a7c596d29e1b6f2c4e990405241 sha
+67 ~77 −19 symbols
sha256:0b06c10252021e2c497132ca59ae724cdc7dc3ffa29ccda7ec28a01ebab18c75 snapshot
+67
symbols added
~77
symbols modified
−19
symbols removed
0
dead code introduced
Semantic Changes 163 symbols
~ tests/test_user_identity_migration.py .py 33 symbols added
+ TestCommitAuthorFromIdentity class class TestCommitAuthorFromIdentity L287–311
+ test_commit_uses_identity_handle_not_config method method test_commit_uses_identity_handle_not_config L288–311
+ TestDumpTomlNoUserSection class class TestDumpTomlNoUserSection L84–122
+ test_dump_toml_never_emits_user_section method method test_dump_toml_never_emits_user_section L85–94
+ test_dump_toml_without_user_key_is_unchanged method method test_dump_toml_without_user_key_is_unchanged L96–103
+ test_writing_config_does_not_persist_user_section method method test_writing_config_does_not_persist_user_section L105–122
+ TestGetUserConfigFromIdentity class class TestGetUserConfigFromIdentity L177–255
+ _identity_toml method method _identity_toml L178–186
+ test_get_user_handle_returns_identity_value method method test_get_user_handle_returns_identity_value L227–241
+ test_get_user_type_ignores_stale_config_value method method test_get_user_type_ignores_stale_config_value L205–225
+ test_get_user_type_none_when_no_identity method method test_get_user_type_none_when_no_identity L243–255
+ test_get_user_type_returns_identity_value method method test_get_user_type_returns_identity_value L188–203
+ TestSetUserConfigRejected class class TestSetUserConfigRejected L130–169
+ test_cli_set_user_type_exits_nonzero method method test_cli_set_user_type_exits_nonzero L152–155
+ test_cli_set_user_type_json_error_mentions_auth method method test_cli_set_user_type_json_error_mentions_auth L157–169
+ test_set_user_email_raises method method test_set_user_email_raises L145–150
+ test_set_user_handle_raises method method test_set_user_handle_raises L138–143
+ test_set_user_type_raises method method test_set_user_type_raises L131–136
+ TestStaleUserSectionIgnored class class TestStaleUserSectionIgnored L263–279
+ test_load_config_drops_user_section method method test_load_config_drops_user_section L264–279
+ _invoke function function _invoke L51–57
+ _make_repo function function _make_repo L60–67
+ _write_config function function _write_config L70–71
+ _write_identity function function _write_identity L74–76
+ CliRunner import import CliRunner L41–41
+ annotations import import annotations L31–31
+ json import import json L33–33
+ os import import os L34–34
+ patch import import patch L37–37
+ pathlib import import pathlib L35–35
+ pytest import import pytest L39–39
+ tempfile import import tempfile L36–36
+ runner variable variable runner L43–43
~ tests/test_cmd_config_hardening.py .py 34 symbols added, 19 symbols removed, 72 symbols modified
test_section_order method method test_section_order L251–262
test_set_json_get_json_consistent method method test_set_json_get_json_consistent L749–758
test_set_then_get_user method method test_set_then_get_user L709–713
test_get_existing_key_raw_value method method test_get_existing_key_raw_value L470–474
test_get_json_schema method method test_get_json_schema L476–482
test_get_user_email method method test_get_user_email L1130–1134
test_get_user_type method method test_get_user_type L1136–1140
test_read_json_schema_user method method test_read_json_schema_user L410–417
test_json_all_sections_together method method test_json_all_sections_together L937–946
test_text_key_value_format method method test_text_key_value_format L998–1002
test_text_user_section_header method method test_text_user_section_header L976–979
test_set_success_json_schema method method test_set_success_json_schema L512–520
test_set_success_stderr_message method method test_set_success_stderr_message L522–527
test_user_email_settable method method test_user_email_settable L1335–1337
test_user_name_settable method method test_user_name_settable L1331–1333
test_user_type_agent_settable method method test_user_type_agent_settable L1343–1345
test_user_type_human_settable method method test_user_type_human_settable L1339–1341
test_20_sequential_sets_no_state_corruption method method test_20_sequential_sets_no_state_corruption L1537–1544
test_8_concurrent_set_to_isolated_repos method method test_8_concurrent_set_to_isolated_repos L765–799
+ test_user_section_silently_dropped method method test_user_section_silently_dropped L425–433
+ test_user_namespace_always_blocked method method test_user_namespace_always_blocked L738–742
+ test_user_section_dropped_from_old_config method method test_user_section_dropped_from_old_config L768–776
+ test_hub_before_domain_in_section_order method method test_hub_before_domain_in_section_order L263–272
+ test_user_section_not_emitted method method test_user_section_not_emitted L253–261
+ test_set_hub_then_get method method test_set_hub_then_get L790–794
+ test_set_json_get_json_consistent_domain method method test_set_json_get_json_consistent_domain L830–839
+ test_set_user_namespace_blocked_end_to_end method method test_set_user_namespace_blocked_end_to_end L783–788
+ test_get_existing_hub_key_raw_value method method test_get_existing_hub_key_raw_value L512–516
+ test_get_json_schema_domain_key method method test_get_json_schema_domain_key L518–524
+ test_get_user_namespace_exits_nonzero method method test_get_user_namespace_exits_nonzero L549–552
+ test_get_user_email_not_set method method test_get_user_email_not_set L1253–1256
+ test_get_user_handle_not_set method method test_get_user_handle_not_set L1248–1251
+ test_get_user_type_not_set method method test_get_user_type_not_set L1258–1261
+ test_read_json_schema_no_user_section method method test_read_json_schema_no_user_section L450–459
+ test_json_no_user_section method method test_json_no_user_section L1055–1064
+ test_text_key_value_format_domain method method test_text_key_value_format_domain L1117–1121
+ test_text_no_user_section_header method method test_text_no_user_section_header L1094–1098
+ test_set_success_json_schema_domain method method test_set_success_json_schema_domain L559–567
+ test_set_success_stderr_message_domain method method test_set_success_stderr_message_domain L569–574
+ test_set_user_namespace_blocked method method test_set_user_namespace_blocked L583–586
+ test_set_user_namespace_error_mentions_auth method method test_set_user_namespace_error_mentions_auth L588–592
+ test_user_email_blocked method method test_user_email_blocked L1457–1460
+ test_user_handle_blocked method method test_user_handle_blocked L1452–1455
+ test_user_handle_blocked_error_mentions_auth method method test_user_handle_blocked_error_mentions_auth L1467–1471
+ test_user_type_blocked method method test_user_type_blocked L1462–1465
+ test_user_namespace_not_stored_on_block method method test_user_namespace_not_stored_on_block L1606–1611
+ test_20_sequential_domain_sets_no_state_corruption method method test_20_sequential_domain_sets_no_state_corruption L1669–1676
+ test_user_set_always_raises_not_written method method test_user_set_always_raises_not_written L1678–1686
+ test_user_email_raises_value_error method method test_user_email_raises_value_error L379–383
+ test_user_namespace_raises_value_error method method test_user_namespace_raises_value_error L372–377
+ test_user_type_raises_value_error method method test_user_type_raises_value_error L385–389
+ test_8_concurrent_set_domain_to_isolated_repos method method test_8_concurrent_set_domain_to_isolated_repos L846–880
+ test_8_concurrent_user_set_all_blocked method method test_8_concurrent_user_set_all_blocked L882–917
← 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:edd86f327550c520c67de40c103860214cbc7a7c596d29e1b6f2c4e990405241 --body "your comment"