Skip to content

feat: Add per-run tmpdir wipe and read-only fixture snapshots - #8

Open
ThomasHartDev wants to merge 2 commits into
mainfrom
thomas/feat/ephemeral-fs
Open

feat: Add per-run tmpdir wipe and read-only fixture snapshots#8
ThomasHartDev wants to merge 2 commits into
mainfrom
thomas/feat/ephemeral-fs

Conversation

@ThomasHartDev

Copy link
Copy Markdown
Owner

Each opted-in run gets a private mkdtemp workdir injected as workdir, optional host fixtures snapshotted (content-copied) into the workspace as read-only files, and a guaranteed wipe when the result settles (ok, error, timeout, or throw). ephemeralFs works on both run and runInWorker; createEphemeralWorkspace / withEphemeralWorkspace cover standalone use.

Symlink safety: host paths that are symbolic links, and directory trees that contain any symlink, are rejected with FixturePathError. Default fs.cp would preserve links and let a guest with fs allowed mutate host files through a recreated link under workdir. Mounts are content snapshots, not live mounts; host paths are never re-opened via links under the workspace.

Fixture keys that try to escape the root (including keys that normalize to .) are rejected before join. Linux hosts best-effort set the immutable bit; without it, mode-bit RO is advisory for same-uid guests (documented in README).

Closes #7

Give each opted-in sandbox run a private workdir via mkdtemp, mount
optional host fixtures as read-only copies, and always dispose the tree
when the run settles so side effects cannot leak across runs.
fs.cp preserved host-pointing symlinks, so guest writes could mutate host
files. Reject symlink hosts/trees, post-copy scan, regression tests, and
accurate README (snapshots, not live mounts).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Per-run ephemeral workdir and read-only fixture mounts

1 participant