Added
- CLI: Added
-c/--clipboardflag to input directly from the system clipboard.
Changed
- Logging: Improved debug and trace logging. Reduced log spam during parsing, elevated key file I/O operations to
debuglevel, and added detailedtracelogs to the smart indentation algorithm (usingescape_debugto visualize tabs vs. spaces). Also added visibility intoparse_autoformat detection and fallback behavior. - Diagnostics: Significantly enhanced the anonymization of debug reports (
-vvvv). The report generator now actively redacts the input file path, target directory, current working directory, and user home directory from the entire report, including the full trace log, file contents, and error messages. - Diagnostics: The discrepancy check failure output in the debug report (
-vvvv) now includes a unified diff between the original input patch and the regenerated patch to make differences easier to spot. The full patch contents are now placed inside a collapsible<details>block to reduce visual clutter. - Diagnostics: Improved the discrepancy check to normalize patches before comparison. It now ignores context lines, hunk headers, +/- interleaving, and self-replacements, significantly reducing noise and eliminating false positives caused by structural differences.
Security
- Path Validation: Fixed a vulnerability in
ensure_path_is_safewhere a dangling symlink could bypass the path traversal check and allow arbitrary file creation outside the target directory. The validation now correctly detects dangling symlinks usingsymlink_metadata.
Fixed
- CLI: Fixed a critical bug where
--dry-runwould incorrectly create parent directories on the filesystem. The path safety check now performs symlink resolution without requiring intermediate directory creation. - CLI/API: Fixed an issue where the preview diff generated during a dry run (
PatchResult::diff) contained hardcoded"a"and"b"file headers instead of the actual target file paths. - Patch Application: Fixed a bug where the trailing newline status could be handled incorrectly if a patch contained out-of-order hunks that modified the end of the file before modifying earlier lines.