feat: supercharge muse code patch for agents
- Add -j alias for --json (consistent with narrative/other commands) - Add exit_code + duration_ms to JSON envelope (_PatchJson TypedDict) - Add symbols_preserved to JSON (was only in human text, now in JSON too) - Add _PatchJson TypedDict with full field docstrings as formal output schema - Auto-reindent replacement body to match original symbol's indentation (agents write unindented code; patch now handles methods/nested scopes) - Expand docstrings on _locate_symbol, _read_new_body, register(), run()
TDD: 32 new tests in tests/test_patch_supercharge.py — all green. Existing 34 tests in test_cmd_patch.py — still green.
sha256:1ab52cf90c7d7f1433b267240a7fe9ddb703d7f18ad0aacddc488a9ce51ab4fd
sha
+55
~4
symbols
sha256:37060d0ee4f416366700857f525b36991f14cedab10adc4333931418c14b8d46
snapshot
+55
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes
59 symbols
+
test_empty_body_does_not_corrupt_file
method
method test_empty_body_does_not_corrupt_file L446–456
+
test_symbols_preserved_present_on_dry_run
method
method test_symbols_preserved_present_on_dry_run L208–216
+
test_symbols_preserved_present_on_live_patch
method
method test_symbols_preserved_present_on_live_patch L188–195
+
test_patch_json_has_symbols_preserved
method
method test_patch_json_has_symbols_preserved L263–266
+
test_patch_method_leaves_sibling_method_intact
method
method test_patch_method_leaves_sibling_method_intact L395–406
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:1ab52cf90c7d7f1433b267240a7fe9ddb703d7f18ad0aacddc488a9ce51ab4fd --body "your comment"
No comments yet. Be the first to start the discussion.