gabriel / muse public
refactor BREAKING dev
gabriel · 157 days ago · Apr 16, 2026 · Diff

refactor: purge stash — rename all instances to shelf, restore keychain files

- Rename every stash reference to shelf across all source, test, and doc files: switch.py --autostash → --autoshelf (flag, dest, variable, error messages) guard.py muse stash → muse shelf save, --autostash → --autoshelf diff.py dest='stash' → dest='shelf', stash local var → shelf prune.py, reflog.py, shelf.py, workspace.py, worktree.py, snapshot.py, repo.py (reserved op name), core/reflog.py — all comment/docstring fixes - GC tests: stash.json → shelf.json, _MAX_STASH_BYTES → _MAX_SHELF_BYTES, test JSON data updated to shelf format (snapshot key, created_at key), all test/variable names updated - workspace hardening tests: stash_count → shelf_count throughout - switch tests: autostash → autoshelf flag and assertion - All docs updated: porcelain.md, type-contracts.md, cli-tiers.md, security.md, agent-guide.md, architecture, protocol, demo, tools - Restore muse/core/keychain.py and 3 keychain test files from shelf entry [0] (were missing from disk, causing ModuleNotFoundError on import) - Delete .muse/stash.json.retired (stash entries reviewed, all superseded except keychain work which is now restored above) - Initialize .muse/shelf.json as empty []

sha256:e47b8e801cf8c8bc665cb322897841201fdb35e8e11f4a378089b4dfe43353d1 sha
+117 ~88 −19 symbols
sha256:4261caec18a4fcc293ead14899b3687dc2048795796295f689bddaf31a912fb3 snapshot
+117
symbols added
~88
symbols modified
−19
symbols removed
0
dead code introduced
Semantic Changes 224 symbols
~ muse/core/keychain.py .py 10 symbols added
+ _SERVICE variable variable _SERVICE L43–43
+ _username function function _username L46–56
+ delete function function delete L122–143
+ annotations import import annotations L36–36
+ logging import import logging L38–38
+ os import import os L39–39
+ is_available function function is_available L59–77
+ load function function load L103–119
+ logger variable variable logger L41–41
+ store function function store L80–100
~ tests/test_agent_key_fd.py .py 25 symbols added
+ TestErrorHandlingIII class class TestErrorHandlingIII L239–311
+ test_III1_invalid_fd_falls_through method method test_III1_invalid_fd_falls_through L240–249
+ test_III2_wrong_byte_count_falls_through method method test_III2_wrong_byte_count_falls_through L251–269
+ test_III3_muse_agent_hd_seed_not_recognised method method test_III3_muse_agent_hd_seed_not_recognised L271–290
+ test_III4_muse_agent_key_not_recognised method method test_III4_muse_agent_key_not_recognised L292–311
+ TestFdInjectionI class class TestFdInjectionI L74–183
+ test_I1_fd_returns_signing_identity method method test_I1_fd_returns_signing_identity L75–94
+ test_I2_deterministic_key_from_same_seed method method test_I2_deterministic_key_from_same_seed L96–125
+ test_I3_fd_closed_after_read method method test_I3_fd_closed_after_read L127–141
+ test_I4_muse_agent_handle_sets_handle method method test_I4_muse_agent_handle_sets_handle L143–162
+ test_I5_default_handle_is_agent method method test_I5_default_handle_is_agent L164–183
+ TestPriorityII class class TestPriorityII L191–231
+ test_II1_fd_takes_priority_over_identity_store method method test_II1_fd_takes_priority_over_identity_store L192–217
+ test_II2_falls_through_to_identity_store_when_unset method method test_II2_falls_through_to_identity_store_when_unset L219–231
+ TestSecurityIV class class TestSecurityIV L319–371
+ test_IV1_sub_seed_not_in_environ method method test_IV1_sub_seed_not_in_environ L320–340
+ test_IV2_different_seeds_different_keys method method test_IV2_different_seeds_different_keys L342–371
+ _TEST_MNEMONIC variable variable _TEST_MNEMONIC L47–50
+ _make_sub_seed function function _make_sub_seed L53–58
+ _pipe_with_seed function function _pipe_with_seed L61–66
+ Ed25519PrivateKey import import Ed25519PrivateKey L45–45
+ annotations import import annotations L39–39
+ os import import os L41–41
+ pathlib import import pathlib L42–42
+ pytest import import pytest L44–44
~ tests/test_auth_mnemonic_input.py .py 28 symbols added
+ TestCliInterfaceII class class TestCliInterfaceII L166–219
+ test_II1_mnemonic_flag_rejected method method test_II1_mnemonic_flag_rejected L167–180
+ test_II2_mnemonic_fd_accepted method method test_II2_mnemonic_fd_accepted L182–204
+ test_II3_stdin_pipe_accepted method method test_II3_stdin_pipe_accepted L206–219
+ TestReadMnemonicSecurelyI class class TestReadMnemonicSecurelyI L96–158
+ test_I1_fd_reads_and_closes method method test_I1_fd_reads_and_closes L97–110
+ test_I2_stdin_non_tty_reads_line method method test_I2_stdin_non_tty_reads_line L112–121
+ test_I3_tty_calls_getpass method method test_I3_tty_calls_getpass L123–137
+ test_I4_invalid_fd_exits method method test_I4_invalid_fd_exits L139–146
+ test_I5_empty_input_exits method method test_I5_empty_input_exits L148–158
+ TestSecurityInvariantsIII class class TestSecurityInvariantsIII L227–272
+ test_III1_mnemonic_not_in_stdout method method test_III1_mnemonic_not_in_stdout L228–249
+ test_III2_args_has_no_mnemonic_attribute method method test_III2_args_has_no_mnemonic_attribute L251–272
+ _TEST_HUB variable variable _TEST_HUB L43–43
+ _TEST_MNEMONIC variable variable _TEST_MNEMONIC L44–47
+ cli variable variable cli L40–40
+ CliRunner import import CliRunner L38–38
+ annotations import import annotations L29–29
+ io import import io L31–31
+ os import import os L32–32
+ pathlib import import pathlib L34–34
+ pytest import import pytest L36–36
+ sys import import sys L33–33
+ isolated_identity function function isolated_identity L56–61
+ isolated_keys function function isolated_keys L65–69
+ keychain_disabled function function keychain_disabled L87–88
+ repo_with_hub function function repo_with_hub L73–83
+ runner variable variable runner L41–41
~ tests/test_core_keychain.py .py 35 symbols added
+ TestIdentityNoMnemonicII class class TestIdentityNoMnemonicII L174–253
+ test_II1_save_stores_mnemonic_in_keychain method method test_II1_save_stores_mnemonic_in_keychain L175–193
+ test_II2_toml_has_no_mnemonic_key method method test_II2_toml_has_no_mnemonic_key L195–214
+ test_II3_load_retrieves_mnemonic_from_keychain method method test_II3_load_retrieves_mnemonic_from_keychain L216–234
+ test_II4_toml_has_no_key_source_field method method test_II4_toml_has_no_key_source_field L236–253
+ TestKeychainApiI class class TestKeychainApiI L131–166
+ test_I1_store_load_roundtrip method method test_I1_store_load_roundtrip L132–137
+ test_I2_load_missing_returns_none method method test_I2_load_missing_returns_none L139–143
+ test_I3_delete_removes_entry method method test_I3_delete_removes_entry L145–151
+ test_I4_delete_missing_returns_false method method test_I4_delete_missing_returns_false L153–157
+ test_I5_disabled_backend_not_available method method test_I5_disabled_backend_not_available L159–166
+ TestKeychainDisabledIV class class TestKeychainDisabledIV L326–361
+ test_IV1_is_available_false method method test_IV1_is_available_false L327–332
+ test_IV2_store_returns_false method method test_IV2_store_returns_false L334–339
+ test_IV3_load_returns_none method method test_IV3_load_returns_none L341–346
+ test_IV4_keygen_succeeds_without_keychain method method test_IV4_keygen_succeeds_without_keychain L348–361
+ TestKeygenUsesKeychainIII class class TestKeygenUsesKeychainIII L261–318
+ test_III1_keygen_json_stdout_no_mnemonic method method test_III1_keygen_json_stdout_no_mnemonic L262–281
+ test_III2_keygen_toml_has_no_mnemonic method method test_III2_keygen_toml_has_no_mnemonic L283–300
+ test_III3_keychain_holds_mnemonic_after_keygen method method test_III3_keychain_holds_mnemonic_after_keygen L302–318
+ _TEST_HOSTNAME variable variable _TEST_HOSTNAME L52–52
+ _TEST_HUB variable variable _TEST_HUB L51–51
+ _TEST_MNEMONIC variable variable _TEST_MNEMONIC L53–56
+ cli variable variable cli L48–48
+ CliRunner import import CliRunner L46–46
+ annotations import import annotations L33–33
+ json import import json L35–35
+ os import import os L36–36
+ pathlib import import pathlib L37–37
+ pytest import import pytest L39–39
+ isolated_identity function function isolated_identity L96–101
+ isolated_keys function function isolated_keys L105–109
+ keychain_in_memory function function keychain_in_memory L65–92
+ repo_with_hub function function repo_with_hub L113–123
+ runner variable variable runner L49–49
~ README.md .md 2 symbols modified
~ docs/architecture/muse-e2e-demo.md .md 2 symbols added, 2 symbols removed, 4 symbols modified
Step 9 — Stash and Restore section Step 9 — Stash and Restore L239–254
code[bash]@L243 variable variable code[bash]@L243 L243–251
+ Step 9 — Shelf and Restore section Step 9 — Shelf and Restore L239–254
+ code[bash]@L243 variable variable code[bash]@L243 L243–251
~ docs/reference/porcelain.md .md 4 symbols added, 4 symbols removed, 7 symbols modified
stash — shelve and restore changes section stash — shelve and restore changes L592–643
code@L594 variable variable code@L594 L594–601
table@L604 section table@L604 L604–612
table@L615 section table@L615 L615–618
+ shelf — shelve and restore changes section shelf — shelve and restore changes L592–643
+ code@L594 variable variable code@L594 L594–601
+ table@L604 section table@L604 L604–612
+ table@L615 section table@L615 L615–618
~ docs/reference/type-contracts.md .md 2 symbols added, 2 symbols removed, 6 symbols modified
py` section StashEntry — `muse/cli/commands/stash.py` L2680–2696
table@L2686 section table@L2686 L2686–2694
+ py` section ShelfEntry — `muse/cli/commands/shelf.py` L2680–2696
+ table@L2686 section table@L2686 L2686–2694
~ py`
~ py`
~ muse/cli/commands/diff.py .py 2 symbols modified
~ muse/cli/commands/reflog.py .py 1 symbol modified
~ run
~ muse/cli/commands/shelf.py .py 1 symbol modified
~ muse/cli/commands/switch.py .py 2 symbols modified
~ muse/cli/guard.py .py 1 symbol modified
~ muse/core/repo.py .py 1 symbol modified
~ muse/core/snapshot.py .py 1 symbol modified
~ tests/test_cmd_gc_hardening.py .py 6 symbols added, 6 symbols removed, 2 symbols modified
test_malformed_stash_json_skipped method method test_malformed_stash_json_skipped L358–364
test_stash_oversized_file_skipped method method test_stash_oversized_file_skipped L338–356
test_stash_symlink_skipped method method test_stash_symlink_skipped L318–336
test_valid_stash_objects_marked_reachable method method test_valid_stash_objects_marked_reachable L366–377
test_gc_after_stash_preserves_stash_objects method method test_gc_after_stash_preserves_stash_objects L541–556
test_gc_with_corrupt_stash_json_succeeds method method test_gc_with_corrupt_stash_json_succeeds L558–566
+ test_malformed_shelf_json_skipped method method test_malformed_shelf_json_skipped L358–364
+ test_shelf_oversized_file_skipped method method test_shelf_oversized_file_skipped L338–356
+ test_shelf_symlink_skipped method method test_shelf_symlink_skipped L318–336
+ test_valid_shelf_objects_marked_reachable method method test_valid_shelf_objects_marked_reachable L366–377
+ test_gc_after_shelf_save_preserves_shelf_objects method method test_gc_after_shelf_save_preserves_shelf_objects L541–556
+ test_gc_with_corrupt_shelf_json_succeeds method method test_gc_with_corrupt_shelf_json_succeeds L558–566
~ tests/test_cmd_switch.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
test_autostash_flag method method test_autostash_flag L114–116
+ test_autoshelf_flag method method test_autoshelf_flag L114–116
~ tests/test_core_gc.py .py 2 symbols added, 2 symbols removed
test_gc_collects_objects_not_in_stash function function test_gc_collects_objects_not_in_stash L190–207
test_gc_preserves_stash_objects function function test_gc_preserves_stash_objects L161–187
+ test_gc_collects_objects_not_on_shelf function function test_gc_collects_objects_not_on_shelf L190–207
+ test_gc_preserves_shelf_objects function function test_gc_preserves_shelf_objects L161–187
~ tests/test_gc_full.py .py 2 symbols added, 2 symbols removed, 2 symbols modified
test_stash_blobs_included method method test_stash_blobs_included L360–371
test_stash_blobs_protected_under_full method method test_stash_blobs_protected_under_full L767–781
+ test_shelf_blobs_included method method test_shelf_blobs_included L360–371
+ test_shelf_blobs_protected_under_full method method test_shelf_blobs_protected_under_full L767–781
~ tools/demo.py .py 1 symbol modified
~ act5
~ tools/render_html.py .py 1 symbol modified
~ tools/render_midi_demo.py .py 1 symbol modified
~ _HTML
← 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:e47b8e801cf8c8bc665cb322897841201fdb35e8e11f4a378089b4dfe43353d1 --body "your comment"