gabriel / muse public
fix patch fix/ls-remote-docstring-format-drift #1 / 1
AI Agent gabriel · 1 hour ago · Sep 12, 2026 · Diff

fix: ls_remote.py docstring claimed a --format flag and JSON-default output that don't exist

Discovered while fixing musehub's 'muse plumbing <verb>' doc drift and checking muse ls-remote -h for real: the module docstring claimed 'Output (JSON, default)' and documented an '--format text' flag. Neither is true -- the real, only flags are --json/-j (boolean); default output is tab-delimited text, JSON only with --json. The 'unknown --format' exit code documentation was equally stale.

Also found the same fiction baked into tests/test_cmd_ls_remote.py: test_format_error_to_stderr and test_no_traceback_on_bad_format passed '--format xml'/'--format bad' and asserted nonzero exit + stderr output -- which is true, but only because argparse rejects '--format' as an unrecognized argument before the command's own logic ever runs. Deleted both -- there's no format-value validation left to test since --json is a boolean, not a choice flag. TestSecurity's two ANSI-stripping tests had the same bug: '--format text' made argparse reject the invocation before ever reaching the branch-printing code they claim to exercise, so they were passing without testing anything. Fixed by invoking with no flag at all (text is the real default) -- confirmed still passing against the actual sanitize_display() call path this time.

Tests: full tests/test_cmd_ls_remote.py + tests/test_ls_remote_supercharge.py sweep: 70 passed (72 - 2 deleted).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

sha256:8470fce45bed2f87c008e5dd4be8c21cdb39a57ad327511a182b5c4013f18b69 sha
~5 −2 symbols
2 changed · 1185 in snapshot files
sha256:518801b4a709cf0f3054a174e2021e7926f95657d09dc27c618e3074573ec1c7 snapshot
~5
symbols modified
−2
symbols removed
2
files changed
1185
files in snapshot
0
dead code introduced
Semantic Changes 7 symbols
~ muse/cli/commands/ls_remote.py .py 1 symbol modified
~ run
~ tests/test_cmd_ls_remote.py .py 2 symbols removed, 4 symbols modified
test_format_error_to_stderr method method test_format_error_to_stderr L251–255
test_no_traceback_on_bad_format method method test_no_traceback_on_bad_format L266–269
Files Changed
~2
1185 in snapshot
← Older Oldest on fix/ls-remote-docstring-format-drift
All commits
Newer → Latest on fix/ls-remote-docstring-format-drift

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