Expand description
Fixup detection and parsing system with preview/apply modes
This module implements the fixup system that detects “FIXUP PLAN:” markers in review output, parses unified diff blocks, and provides preview/apply modes for safe fixup application.
§Security
All path operations use the sandboxed path types from crate::paths to prevent:
- Directory traversal attacks via
..components - Absolute path escapes
- Symlink-based escapes (configurable)
- Hardlink-based escapes (configurable)
The FixupParser uses SandboxRoot to validate all target paths before any file operations.
This ensures that diff application cannot escape the workspace root.
Structs§
- Applied
File - Result of applying a single file
- Change
Summary - Summary of changes for a single file
- Diff
Hunk - A single hunk in a unified diff
- Fixup
Parser - Main fixup parser that handles detection and parsing of fixup plans
- Fixup
Phase - Implementation of Fixup phase
- Fixup
Preview - Preview of fixup changes
- Fixup
Result - Result of applying fixup changes
- Pending
Fixups Stats - Summary of pending fixups for a spec
- Unified
Diff - A unified diff for a single file
Enums§
- Fixup
Error - Errors that can occur during fixup detection and parsing
- Fixup
Mode - Fixup execution mode
- Pending
Fixups Result - Result of attempting to determine pending fixups state
Functions§
- normalize_
line_ endings_ for_ diff - Normalize line endings to LF (FR-FIX-010, FR-FS-004, FR-FS-005)
- pending_
fixups_ for_ spec - Count pending fixups for a spec by ID
- pending_
fixups_ result_ from_ handle - Get pending fixups result from an OrchestratorHandle
- validate_
fixup_ target - Validates that a fixup target path is safe to apply patches to.