Skip to main content

Module fixup

Module fixup 

Source
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§

AppliedFile
Result of applying a single file
ChangeSummary
Summary of changes for a single file
DiffHunk
A single hunk in a unified diff
FixupParser
Main fixup parser that handles detection and parsing of fixup plans
FixupPhase
Implementation of Fixup phase
FixupPreview
Preview of fixup changes
FixupResult
Result of applying fixup changes
PendingFixupsStats
Summary of pending fixups for a spec
UnifiedDiff
A unified diff for a single file

Enums§

FixupError
Errors that can occur during fixup detection and parsing
FixupMode
Fixup execution mode
PendingFixupsResult
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.