feat: add muse apply command — apply .patch files to working tree
Implements _parse_patch, _apply_hunk, register, and run. - Parses unified diff (with mail-format header stripping) - Handles --check (validate without writing), --json output - Rejects path traversal and .muse/ internal paths - Supports format-patch → apply round-trip - 16 tests: unit, integration, security, stress — all green
sha256:c54a29a70951ebb33f9f8d65ec9e65101402d48ce03a713cdee4572ff997a579
sha
+65
~30
symbols
sha256:aa0205711ec0dae67052ccd9e3299289d301f8219cbb16242f3e1c347fbd8e7a
snapshot
+65
symbols added
~30
symbols modified
0
dead code introduced
Semantic Changes
95 symbols
+
test_apply_check_does_not_modify_file
function
function test_apply_check_does_not_modify_file L272–281
+
test_apply_check_exits_nonzero_on_conflict
function
function test_apply_check_exits_nonzero_on_conflict L284–292
+
test_apply_hunk_preserves_surrounding_lines
function
function test_apply_hunk_preserves_surrounding_lines L191–205
+
test_apply_rejects_muse_internal_paths
function
function test_apply_rejects_muse_internal_paths L343–354
+
test_apply_rejects_path_traversal_in_patch
function
function test_apply_rejects_path_traversal_in_patch L328–340
+
test_parse_patch_extracts_file_diffs
function
function test_parse_patch_extracts_file_diffs L124–129
+
test_parse_patch_skips_mail_headers
function
function test_parse_patch_skips_mail_headers L132–144
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:c54a29a70951ebb33f9f8d65ec9e65101402d48ce03a713cdee4572ff997a579 --body "your comment"
No comments yet. Be the first to start the discussion.