fix(diff): use PatchOp.file_change for file-level sigil — not child op counts
The renderer inferred file status from child op direction: a PatchOp whose children were all DeleteOps was classified as 'D' (deleted), even when the file still existed in the working tree. This misled agents into treating a modified file that lost all its symbols as a deleted file.
Root cause: build_diff_ops knew which path bucket each file came from (added / removed / modified) but discarded that information, forcing the renderer to guess from children. _classify_patch_op and _op_category encoded this broken heuristic.
Fix: - Add file_change: NotRequired['added' | 'deleted' | 'modified'] to PatchOp - build_diff_ops sets file_change from the path bucket at construction time - _patch() forwards file_change to the PatchOp it wraps - _print_structured_delta reads op.get('file_change', 'modified') directly - JSON categorizer reads file_change instead of calling _op_category - Delete _classify_patch_op and _op_category (dead code) - Delete TestClassifyPatchOp and TestOpCategory (tested deleted functions) - Add 17 new tests covering the four cases (added/deleted/modified/renamed) at both unit and integration level
0 comments
muse hub commit comment sha256:6aea7eaff3fd7a8d67ac602837a94e1724aed5e9140f201bc2770088d0c6d47d --body "your comment"
No comments yet. Be the first to start the discussion.