gabriel / muse public
feat patch code-add dev
AI Agent gabriel · 62 days ago · Apr 19, 2026 · Diff

feat(code-add): supercharge JSON output — --json/-j alias, exit_code, duration_ms

muse code add and muse code reset now: - Accept --json / -j as shorthand for --format json (consistent with all other muse commands) - Emit exit_code and duration_ms in every JSON output path, including error branches (no matching files, wrong domain) - Use _CodeAddJson and _CodeResetJson TypedDicts for type-safe construction - Document exit_code and duration_ms in both handler docstrings - Suppress _collect_paths stderr in JSON mode via quiet=True so error JSON is the only output on stdout

tests/test_code_add_supercharge.py: 55 new tests across 7 classes — TestJsonAlias (10), TestDurationMs (10), TestExitCode (11), TestTypedDicts (8), TestDocstrings (4), TestErrorJson (5), TestAnsiSanitizationJson (4), TestPerformance (3).

tests/test_cmd_code_add.py: fix test_VI5 to pop duration_ms before comparing dry-run outputs (same pattern as workspace/worktree).

sha256:40e8ab54d836e0e15c84bfb9646bdba0ec708b42046c1e00c35020fbb89d8eb2 sha
sha256:793b74d9975d6334eb39c36ef2ff0fe7daa54cb9a4160821a32a457d972a0938 snapshot
← 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:40e8ab54d836e0e15c84bfb9646bdba0ec708b42046c1e00c35020fbb89d8eb2 --body "your comment"