Repository navigation
Add byte-preserving File.Copy - #1372
Merged
Merged
Conversation
taras
marked this pull request as ready for review
November 17, 2026 02:52
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.
Why
The test-evidence workflow preserves a generated log with a UTF-8 File read and
write. An 8,639,583-byte log exceeded its 8 MiB text limit. Authors need a byte
copy for that work and for binary files.
What changes
Core provides the self-closing
<File.Copy from="…" to="…" />.It copies the exact bytes into a vacant path in an existing directory and
preserves the source. The operation is available in ordinary runs, Workflow
Workspace, and retained REPL entries. Source read and destination write
permissions and containment apply to each operand.
How it works
File.Copycalls contextualAPI.Files.copyFile. The host resolves the sourceand destination parent and copies natively, preserving an occupied final entry.
Workflow Workspace commits the bytes and outcome together. Covered REPL copies
record both operands under the existing file recorder, with mutation ownership
on the destination. An acknowledged copy restores its outcome on replay
without touching either file.
Review guide
Start with
FileCopy.test.mdand the File.Copy section of the language spec.Then trace the contextual Files operation through the native host, Workspace
transaction, and REPL recorder. Check occupied destinations, input-specific
permission denials, and replay before live observations.
How to verify it
0xFFbyte, invokes File.Copy, and compares both files with the full binaryfixture. It also checks that modifying the destination leaves the source
intact. The suite passed on Deno, Node, and Bun.
occupied destinations, replay, rollback, and operand identity. Node and Deno
typechecks, the compiled macOS filesystem contract probe, and the named
xmd syntax File.Copycheck passed.an earlier admitted mutation and retains the existing class-only diagnostic.
Scope
Ticket artifact retention is a separate follow-up.
Closes #1368.