Repository navigation
land: created-file-syntax-line - #497
Open
aft-alfonso[bot] wants to merge 8 commits into
Open
aft-alfonso[bot] wants to merge 8 commits into
aft-alfonso[bot] wants to merge 8 commits into
Conversation
ualtinok
force-pushed
the
land/created-file-syntax-line
branch
from
October 17, 2026 22:15
5fba04c to
6d8538e
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 17, 2026
ualtinok
force-pushed
the
land/created-file-syntax-line
branch
from
October 18, 2026 01:06
bad0bc9 to
12a5a59
Compare
A file created by the call has no prior content to roll back to, so when it does not parse it is kept and the reply now ends with "Syntax check: the new file does not parse (first error near line N); it was written as given." (apply_patch: directly under that file's Created or Updated-and-moved line). The line number comes from the first ERROR/MISSING node of the same tree-sitter parse that decided syntax_valid and is carried as syntax_error_line in the response data. New Swift files are confirmed with swiftc -parse first, so a file the compiler accepts gets no line. Existing files keep the rollback reply unchanged. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
The release-input vocabulary audit treats filePath as a legacy argument name; the tool translator accepts path as the canonical spelling. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
A patch that adds a broken file and updates it in a later hunk lost the created-file syntax warning: the update saw an existing file, so metadata.files replaced syntax_error_line with None, and the text notice under the Created line kept the first hunk's error line even when the update moved it. apply_patch now tracks every path the call created (Add hunks and moves onto a new destination), dropping paths a later hunk deletes or moves away. After all hunks it checks each created file's final content once with edit::check_created_file_syntax and builds both the notice (still directly under the line that created the file, wording unchanged) and metadata.files from that check. Writes to a file created earlier in the same call go through the new edit::write_format_deferred_created, which neither rolls back nor syntax-checks: there is no pre-call content to protect, so a later hunk that breaks a new file is kept and reported instead of failing with "produced invalid syntax (rolled back)". Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Resolve the nearest existing ancestor on a comparison-local path when a deleted or moved-away file cannot be canonicalized. Preserve filePath and the absolute fallback for paths outside the project. Cover Unix symlink roots and Windows GetShortPathNameW aliases, including missing parent directories and verbatim roots. Canonicalize the created-file syntax fixture root without changing any existing assertions. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Explicitly allowlist the filePath-preservation comment and regression assertion introduced by the alias-root metadata fix. Keep the existing wire-field assertion visible to the publication vocabulary audit; do not regenerate the reviewed allowlist. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
GetShortPathNameW returns the long path when short-name creation is off on the temp volume, so there is no alias spelling to exercise; the verbatim-root case keeps its own test. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
ualtinok
force-pushed
the
land/created-file-syntax-line
branch
from
October 18, 2026 01:28
12a5a59 to
841c368
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Accepted agent delivery; branch-keyed search descriptor included.
Summary by cubic
write,edit, andapply_patchnow 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 thatswiftc -parseaccepts get no notice.apply_patchtracks 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 andmetadata.files.syntax_error_lineaccordingly.apply_patchmetadata 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.Written for commit 841c368. Summary will update on new commits.


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issue remains.Summary
Adds first-error lines for newly created files that do not parse.
Both earlier threads were manually resolved without explanation. The current code addresses both: later hunks retain final syntax details, and the Windows test skips volumes without distinct short names.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Write or format file] --> B{Created by this call?} B -->|No| C[Keep existing syntax rollback] B -->|Yes| D[Check final content] D --> E{Swift parser disagreement?} E -->|Yes| F[Confirm with swiftc] E -->|No| G{Syntax error remains?} F --> G G -->|Yes| H[Keep file and report first error line] G -->|No| I[Reply without syntax notice]Reviews (6) · Last reviewed commit: "apply_patch alias test: skip on Windows ..." · Reviewed by Greptile