Skip to content

feat(fs): add generic filesystem namespaces#2174

Merged
chaliy merged 1 commit into
mainfrom
codex/namespace-fs
Jul 17, 2026
Merged

feat(fs): add generic filesystem namespaces#2174
chaliy merged 1 commit into
mainfrom
codex/namespace-fs

Conversation

@chaliy

@chaliy chaliy commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What changed

Add NamespaceFs, a generic static filesystem namespace that composes arbitrary FileSystem subtrees behind visible targets. The builder supports source-root rebasing, per-mount read-only/read-write access, deterministic nested precedence, synthetic ancestors, consistent metadata/listing behavior, safe cross-mount copy, and typed cross-device rename rejection.

Includes runnable generic sandbox and rebasing examples, Rustdoc guide/API examples, public filesystem docs, VFS specification updates, and TM-ESC-031 threat-model coverage.

Why

Embedders need one bounded filesystem tree assembled from independent sources for build sandboxes, tests, plugin hosts, serverless functions, CI, and shell sessions without introducing agent-specific paths or lifecycle abstractions.

Before / After

Before: MountableFs could mount only source roots, exposed a fallback root tree, and emulated cross-mount rename with non-atomic copy-delete.

After, verified by smoke runs:

$ cargo run -p bashkit --example namespace_sandbox --no-default-features
fn main() {}
build, cache, and tmp are writable; src is read-only

$ cargo run -p bashkit --example namespace_rebase --no-default-features
pub fn answer() -> u8 { 42 }
nested writable override created schema.rs

Behavioral/security coverage: 11 namespace tests pass, including rebasing, synthetic mount listing, metadata parity, normalization, TM-ESC-031 traversal/read-only bypass resistance, same- and cross-mount operations, and symlink preservation.

Risk

  • Medium: new public VFS composition API and path-routing logic.
  • Existing filesystem implementations and MountableFs behavior are unchanged.
  • Cross-mount rename deliberately returns ErrorKind::CrossesDevices; directory/FIFO cross-mount copy returns ErrorKind::Unsupported.

Validation

  • just pre-pr
  • just test
  • cargo bench -p bashkit --bench parallel_execution --no-default-features
  • both new examples smoke-run
  • Rustdoc examples compile

Checklist

  • Tests added or updated
  • Backward compatibility considered

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 1157d56 Commit Preview URL

Branch Preview URL
Jul 17 2026, 03:30 AM

@chaliy
chaliy merged commit fec3872 into main Jul 17, 2026
40 checks passed
@chaliy
chaliy deleted the codex/namespace-fs branch July 17, 2026 03:41
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.

1 participant