muse shelf read — UX fixes and files list bug
Background
muse shelf read has two problems discovered during normal development use:
Bug:
files_countandfilesare semantically inconsistent.files_countcounts files that differ from HEAD (the actual change set), butfilesdumps the entire snapshot manifest — every tracked file in the repo. On a large repo this meansfiles_count: 6with a 1000+ entryfileslist, which is actively misleading.UX: The JSON schema in the
--helpoutput for all shelf subcommands is a single dense line. It is hard to read at a glance — you have to actively parse it rather than letting your eyes scan line-by-line.Docs gap: It is not documented that
muse shelf(bare, no subcommand) is identical tomuse shelf save, or that custom names are supported (muse shelf save my-auth-refactor).
Goal
filesinmuse shelf read --jsoncontains only the files that differ from HEAD — the same set thatfiles_countcounts.- The human-readable
muse shelf readoutput shows only changed files. - JSON schema blocks in all shelf
--helpdescriptions break each key onto its own line. muse shelf --helpandmuse shelf save --helpdocument the bare-command alias and custom name support.
Phases
Phase 1 — Fix files list bug
The invariant that must hold after this phase:
len(output["files"]) + len(output["deleted"]) == output["files_count"]
- [x]
SF_01—run_read: computechanged_filesas paths whereentry["snapshot"][p] != head_manifest.get(p)(covers new files and modifications) - [x]
SF_02—run_readJSON: emitfiles=changed_filesinstead of all snapshot keys - [x]
SF_03—run_readhuman output: iteratechanged_filesinstead of all snapshot keys - [x]
SF_04— Test:files_count == len(files) + len(deleted)invariant holds when HEAD has a mix of changed, unchanged, and new files - [x]
SF_05— Test:fileslist is empty when shelf snapshot matches HEAD exactly
Phase 2 — Pretty-print help JSON schemas
- [x]
SF_06—muse shelf save --help: break JSON schema across lines (one key per line) - [x]
SF_07—muse shelf read --help: same - [x]
SF_08—muse shelf list --help: same - [x]
SF_09—muse shelf apply --help: same - [x]
SF_10—muse shelf pop --help: same - [x]
SF_11—muse shelf drop --help: same - [x]
SF_12—muse shelf diff --help: same
Phase 3 — Document bare muse shelf and custom names
- [x]
SF_13—muse shelf --help(top-level): note thatmuse shelfwith no subcommand is equivalent tomuse shelf save - [x]
SF_14—muse shelf save --help: add example showing custom name (muse shelf save my-auth-refactor -m "intent text") - [x]
SF_15—muse shelf save --help: clarify auto-name format (branch/NNN) and that custom names are looked up by exact string or integer index
Acceptance criteria
muse shelf read 0 --json | jq '.files | length'returns 6 (not 1000+) on the test shelf entrymuse shelf read --helpJSON schema block has one key per linemuse shelf --helpmentions the bare-command alias- All SF_0x tests pass
Out of scope
created_byenrichment (read username from~/.muse/identity.toml) — tracked separately; requires identity config integration- Shelf entry expiry and GC — separate concern