1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Filesystem mounting system for sandboxed execution.
//!
//! Provides [`MountTable`], which maps virtual paths to real host directories
//! with configurable access modes. When sandbox code calls filesystem methods
//! like `Path.read_text()`, the mount table intercepts the operation, resolves
//! the virtual path, and executes it according to the mount mode.
//!
//! This crate is HOST-side code: it performs real `std::fs` I/O and is linked
//! only by host/parent crates (`monty-pool`, the CLI, bindings). The `monty`
//! interpreter crate deliberately does not depend on it — sandboxed code can
//! only *request* filesystem operations by suspending with an
//! [`OsFunctionCall`](monty_types::OsFunctionCall), which a host holding a
//! [`MountTable`] services via [`MountTable::handle_os_call`].
//!
//! # Security
//!
//! **The monty runtime MUST NEVER read, write, or obtain any information about
//! any file or directory outside the specific directory that is mounted.**
//!
//! Enforced by the operating system, not by path arithmetic: each mount holds
//! a `cap_std::fs::Dir` opened once at mount time, and every operation is
//! performed relative to that descriptor, which refuses to resolve past its
//! own root. `path_security` only normalizes the virtual path and strips the
//! mount prefix — it is path policy, not the boundary.
//! Each mount has an aggregate memory budget, defaulting to
//! [`DEFAULT_MEMORY_USAGE_LIMIT`], for retained overlay data and results.
//!
//! # Mount Modes
//!
//! - [`MountMode::ReadWrite`] — full read/write access to the host directory
//! - [`MountMode::ReadOnly`] — reads work, writes raise `PermissionError`
//! - [`MountMode::OverlayMemory`] — reads fall through to host; writes stored in memory
pub use MountError;
pub use MountMode;
pub use ;
pub use OverlayState;