land: created-file-syntax-line

Merged
AF
13h ago
+1027-46

Accepted agent delivery; branch-keyed search descriptor included.


Summary by cubic

write, edit, and apply_patch now report the first syntax-error line when they create a file that doesn't parse, telling the agent the new file was written as given. Existing files still roll back as before, and new Swift files that swiftc -parse accepts get no notice.

  • apply_patch tracks created files and checks each one's final content once after all hunks, so later hunks that fix, break, move, or delete a new file update or remove the notice and metadata.files.syntax_error_line accordingly.
  • The notice appears directly under the reply line that created the file, and broken new files are never rolled back.
  • apply_patch metadata relative paths now resolve through root aliases (Unix symlink roots and Windows short names), including for files that a hunk deleted or moved away; the Windows alias test skips volumes where 8.3 short names are disabled.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues remain.

Summary

Adds first-error-line notices when write, edit, or apply_patch creates a file that does not parse.

  • New broken files point to their first syntax-error line.
  • Patch metadata keeps deleted-file paths relative under aliased roots.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Write or patch a file] --> B{Created by this call?}
    B -- No --> C[Keep existing syntax checks and rollback]
    B -- Yes --> D[Keep the new content]
    D --> E[Read final content]
    E --> F{Parse error remains?}
    F -- No --> G[Return without a syntax notice]
    F -- Yes --> H[Return first error line and notice]

Reviews (9) · Last reviewed commit: "apply_patch alias test: skip on Windows ..." · Reviewed by Greptile