Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e1b88f4
Add devlayer rename and defaults design and plan
anoek Nov 13, 2026
88daf13
Rename sandbox to devlayer (user-facing)
anoek Nov 13, 2026
0a1520d
Rename internal sandbox identifiers to layer/devlayer
anoek Nov 13, 2026
92ffd73
Replace --name with --join
anoek Nov 13, 2026
4e2b8c1
Default to host networking
anoek Nov 13, 2026
841419b
Make audio binds part of the default binds
anoek Nov 13, 2026
ded4846
Add default LLM tool binds and --no-default-llm-binds
anoek Nov 13, 2026
7be4cac
Bind the current directory by default; add --no-bind-cwd
anoek Nov 13, 2026
af2152f
Default to a new layer; make --last directory-aware; actions default …
anoek Nov 13, 2026
8535ea9
Whole-layer status/diff by default; accept/reject require a pattern
anoek Nov 13, 2026
03fec1a
Fix review findings: / refusal only on layer start, plain-path binds,…
anoek Nov 13, 2026
980a39e
Keep the cwd bind on in layer selection tests
anoek Nov 13, 2026
d3b0f77
Fix sandbox->layer rename slips: cgroup path in limits test, stale na…
anoek Nov 13, 2026
47ee3cf
Make tail the OOM killer's first choice in the memory limit test
anoek Nov 13, 2026
8fa7f99
Add layer auto-shutdown design
anoek Nov 13, 2026
9246451
Add layer auto-shutdown plan
anoek Nov 13, 2026
7ead605
Supervise layer PID 1 and clean up when it exits
anoek Nov 13, 2026
96ff3ef
Reap orphans in layers and shut layers down when idle
anoek Nov 13, 2026
6e886ed
Record PID 1's idle loop in coverage, cover supervisor cleanup paths,…
anoek Nov 13, 2026
f485b29
clean out plans and specs
anoek Nov 14, 2026
dd68c47
Give concurrent new launches their own layers, keep layers up while a…
anoek Nov 14, 2026
998644e
Add CI spelling exceptions, report output when the audio bind test fails
anoek Nov 14, 2026
91b3063
Run coverage on Ubuntu 24.04, whose sudo honors -E
anoek Nov 14, 2026
40752c0
Refuse to bind the home directory into a layer unless asked for with …
anoek Nov 14, 2026
f438e97
Share lock, pid and data bind path helpers, exit safely on SIGTERM, t…
anoek Nov 14, 2026
39768e1
Doc update
anoek Nov 14, 2026
827ad5f
Don't follow symlinks in the storage directory, only trust a pid file…
anoek Nov 14, 2026
9794feb
Pass test environment to sudo explicitly, so tests work with sudo-rs;…
anoek Nov 14, 2026
bdced3d
Wait for the supervisor to unmount in the idle shutdown test
anoek Nov 14, 2026
28e67cc
Simplify config resolution and layer start, fix review findings
anoek Nov 15, 2026
341861e
Make head an OOM victim before devlayer in the memory limit test
anoek Nov 15, 2026
edd71ec
Name the mount point when lstat of a scanned mount fails
anoek Nov 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# 96.0 as opposed to 100% because on github and within our full-test
# ubuntu vm we seem to be unable to get some profraw data for the
# code that writes the llvm profile dump data at the end of setting
# up a sandbox (but the code is definitely run), as well as a
# up a layer (but the code is definitely run), as well as a
# pre-kill signal handling bit of code in exec, that is also
# definitely run, but the output is not captured.
#
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
/dist
/build

dev_sandbox.sh
dev_devlayer.sh
.aider*
callgrind.out.*
cachegrind.out.*
perf.data*
perf.data*
superpowers/
22 changes: 11 additions & 11 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ code in this repository.

## Project Overview

Sandbox is a Linux containerization tool that creates lightweight copy-on-write
devlayer is a Linux containerization tool that creates lightweight copy-on-write
views of the system for safely running semi-trusted programs. It uses OverlayFS
to track file changes and allows selective acceptance of modifications.

Expand Down Expand Up @@ -36,26 +36,26 @@ to track file changes and allows selective acceptance of modifications.

### Installation

- `make install` - Install sandbox locally
- `make uninstall` - Remove installed sandbox
- `make install` - Install devlayer locally
- `make uninstall` - Remove installed devlayer

## Architecture

### Core Components

- **src/main.rs** - Entry point and CLI handling
- **src/actions/** - Implementation of sandbox actions (accept, reject, status, etc.)
- **src/actions/** - Implementation of layer actions (accept, reject, status, etc.)
- **src/config/** - Configuration parsing and management (CLI args, env vars, config files)
- **src/container/** - Core containerization logic using Linux namespaces
- **src/filesystem/** - OverlayFS management and file operations
- **src/utils/** - Utility functions and helpers

### Key Concepts

1. **Sandboxes** - Named containers with isolated filesystems
1. **Layers** - Named containers with isolated filesystems
2. **OverlayFS** - Used to create copy-on-write views of the host filesystem
3. **Namespaces** - Linux namespaces for process and network isolation
4. **Storage Directory** - Default ~/.sandboxes/ stores sandbox data
4. **Storage Directory** - Default ~/.devlayer/ stores layer data

### Testing Strategy

Expand All @@ -68,15 +68,15 @@ to track file changes and allows selective acceptance of modifications.
2. **Config Loading Order** (most to least specific):

- CLI arguments
- Environment variables (SANDBOX\_\*)
- .sandbox.conf/.sandbox.toml in current and parent directories
- ~/.config/sandbox/config.(conf|toml)
- /etc/sandbox.(conf|toml)
- Environment variables (DEVLAYER\_\*)
- .devlayer.conf/.devlayer.toml in current and parent directories
- ~/.config/devlayer/config.(conf|toml)
- /etc/devlayer.(conf|toml)

3. **File Operations**: When working with file accept/reject operations, be aware of OverlayFS limitations regarding concurrent modifications to upper/lower filesystems.

4. **Coverage Requirements**: All PRs must maintain very high test coverage. Use `make coverage-check` to verify.

5. **Cross-Platform**: Supports x86_64 and aarch64 architectures with both GNU and musl libc variants.

6. **New tests**: New tests should be added to the `tests/` directory with a filename prefixed with `ai_test_`. Most tests should use the default name provided by the SandboxManager, if you provide a name, it needs to be prefixed with `sandbox-coverage`.
6. **New tests**: New tests should be added to the `tests/` directory with a filename prefixed with `ai_test_`. Most tests should use the default name provided by the LayerManager, if you provide a name, it needs to be prefixed with `devlayer-coverage`.
46 changes: 23 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "sandbox"
name = "devlayer"
version = "0.4.0-dev"
edition = "2024"
include = ["src/**", "Cargo.toml", "clippy.toml", "*.lock", "tests/**", "Makefile"]

[[bin]]
name = "sandbox"
name = "devlayer"
path = "src/main.rs"

[lib]
name = "sandbox"
name = "devlayer"
path = "src/lib.rs"

[lints.rust]
Expand Down
Loading