Repository navigation
Python bindings for a general-purpose sandbox filesystem - #23
Conversation
sandfs.Workspace wraps sandfs-core through a PyO3 extension (crates/sandfs-py) built by maturin: git, host-directory and in-memory mounts, fork, diff, reads, writes with expected_version, exact-string edits, and file operations. Core errors map to built-in exceptions, plus VersionMismatch and EditFailed. Reads release the GIL so git fetches don't block other threads. The release workflow now builds abi3 wheels for Linux, macOS and Windows plus an sdist; CI installs a Rust toolchain before building the package. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011n3CeYLRrtNT8XX5NMX8iB
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011n3CeYLRrtNT8XX5NMX8iB
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b566b8fc9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The package is now only the Workspace bindings. The shell, host bridge, Python executor, policies, storage adapters, hooks, search index and CLI are dropped along with their tests, as planned in the roadmap; 0.3 stays in git history. README, AGENTS.md and the package metadata describe the three primitives instead. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011n3CeYLRrtNT8XX5NMX8iB
|
@codex review This PR now also removes the 0.3 pure-Python modules (6d4bb2f), so please review the current head. Generated by Claude Code |
…edits Add Workspace::edit_versioned to the core so the version guard is checked against the file an edit actually changes, after following a final symlink. The Python binding uses it inside py.detach, since editing an unread git file can fetch it from a remote. Workspace.move's docstring now says the destination must not exist, which is what the core does. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011n3CeYLRrtNT8XX5NMX8iB
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21403e4a9d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Writes, mkdir, symlink, remove, copy, move and mount can all resolve a symlink or list a directory from a source, and a git source may fetch from a remote, so none of them should hold the GIL. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011n3CeYLRrtNT8XX5NMX8iB
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a2537cb28
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011n3CeYLRrtNT8XX5NMX8iB
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 208171c904
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 208171c904
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
sandfs is for files of any kind, and code is one use case. The core keeps the three primitives and drops what only code needed: - Sources are open: Workspace.mount(path, source) takes DirSource, MemorySource, GitSource or any Python object with list(path) and read(path). mount_git, mount_dir and mount_files are gone. - Exact-string edits leave the core (Workspace::edit, edit_versioned, Edit, Error::EditFailed); the MCP crate builds them from read and a versioned write. - Symlinks are gone (Kind::Symlink, symlink, read_link, link following). DirSource and GitSource skip them. - stat always returns a size, reading the file once when a source left it out, so a FUSE mount can report every file's size. - The git source stays as an optional source crate. Tests: cargo test --workspace, uv run pytest (Python sources, binary files, unsized sources, skipped symlinks). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011n3CeYLRrtNT8XX5NMX8iB
"Diff" is code vocabulary, and the call returns changed files, not a patch. Workspace::diff becomes Workspace::changes in the core and the Python bindings; the core module diff.rs becomes change.rs. Tests: cargo test --workspace, uv run pytest. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011n3CeYLRrtNT8XX5NMX8iB
The release workflow publishes with PyPI trusted publishing, so every action in it is pinned to a reviewed commit instead of a moving tag. MemorySource construction now runs with the GIL released like the other source constructors, and its stub asks for the dict the binding accepts. Tests: uv run pytest, cargo test --workspace. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011n3CeYLRrtNT8XX5NMX8iB
Before: the
sandfsPython package was the 0.3 design (bash-like shell, host bridge, Python executor, adapters, policies), and the Rust core was shaped around code: git mounts as the headline, exact-string edits, symlinks,diff().After:
sandfsis a thin PyO3 binding over the Rust core, built with maturin as abi3 wheels. The core is a sandbox filesystem for files of any kind, with code as one use case. A harness mounts any data as a source, forks a workspace per attempt in O(1), and reads back which files changed.How:
crates/sandfs-py):Workspace.mount(path, source)acceptsDirSource,MemorySource,GitSource, or a Python object implementing thesandfs.Sourceprotocol (list(path) -> Iterable[DirEntry],read(path) -> bytes | str).VersionMismatch.Workspace::diffis renamedWorkspace::changes, and the modulediff.rsis nowchange.rs.Workspace::edit,edit_versioned,EditandError::EditFailed. Text edits belong in the MCP crate, built fromreadandwrite_versioned.Kind::Symlink,symlink,read_linkand link following.DirSourceandGitSourceskip symlinks.Metadata.sizeis now au64.statreads a file once when its source left the size out, so FUSE can report every size.MemorySource::insert(path, data, executable: bool).sandfs-gitsource crate.PyO3/maturin-actionfor Linux, macOS and Windows, plus an sdist and trusted publishing. Every action in the release workflow is pinned to a full commit SHA.Tests:
cargo test --workspaceanduv run pytest. The new tests cover Python sources (laziness, a cache shared across forks, errors, threads), binary files, sources that leave sizes out, and skipped symlinks.🤖 Generated with Claude Code
https://claude.ai/code/session_011n3CeYLRrtNT8XX5NMX8iB