agentleFS
arcboxlabsarcboxlabs/arcbox/.github/copilot-instructions.md

arcbox

Copilot instructions4.3k starsChanged 4 months agoApache-2.0View on GitHub

ArcBox is a pure-Rust, high-performance container and VM runtime targeting macOS (primary) and Linux, aiming to surpass OrbStack's performance metrics. Three-tier structure: Key layers (bottom-up): Communication: Host <-> Guest via vsock and ArcBox protocol crates (arcbox-protocol, arcbox-grpc, arcbox-transport). Docker API compatibility is provided by arcbox-docker (Axum REST server + guest dockerd proxy). macOS specifics: Required for: examples, tests touching hypervisor. See arcbox.entitlements - mode_t types (e.g., libc::S_IFMT) are u16 (Linux: u32). Use u32::from() for cross-platform compatibility - No fallocate -…

  • Installs packages

Trending

Quiet since September.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 1 mentionMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 1 mentionAug 2026: 0 mentionsSep 2026: 3 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the arcboxlabs/arcbox repository that our weekly crawl found: only 6 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about arcboxlabs/arcbox

The biggest 5 of 6 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 6

Talked about on Bluesky, GitHub and Hacker News (6 times).

On GitHub · 2

The file

We split this copilot-instructions.md into the rules it gives an agent

8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All code comments MUST be in English

    line 77
  2. Very specific:

    Use thiserror for crate-specific errors (FsError, NetError, etc.)

    line 83
  3. Very specific:

    Use anyhow for application-level error propagation in CLI/API layers

    line 84
  4. Very specific:

    Every unsafe block requires a safety comment explaining invariants

    line 94
  5. Very specific:

    Cache alignment: use #[repr(C, align(64))] for hot structures

    line 110
  6. Distinctive:

    Batch operations: avoid per-descriptor overhead in VirtIO queues

    line 111
  7. Very specific:

    Test kernel images live under tests/resources/

    line 158
  8. Very specific:

    When adding files to core directories or guest/, include dual-license headers

    line 172

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

ArcBox AI Agent Instructions

ArcBox is a pure-Rust, high-performance container and VM runtime targeting macOS (primary) and Linux, aiming to surpass OrbStack's performance metrics.

Architecture Overview

Three-tier structure:

  • Core layer (common/, virt/, rpc/, runtime/, app/): MIT/Apache-2.0 licensed foundation
  • Pro layer (pro/): BSL-1.1 licensed enhanced features (smart caching, snapshots, advanced networking)
  • Guest components (guest/arcbox-agent): Runs inside VMs, cross-compiled to Linux ARM64/x86_64

Key layers (bottom-up):

abctl (CLI)
    ↓ gRPC over Unix socket
arcbox-daemon
    ↓
arcbox-core (Runtime)
    ↓
arcbox-fs / arcbox-net / arcbox-container
    ↓
arcbox-virtio (VirtIO devices) -> arcbox-vmm (VM monitor)
    ↓
arcbox-hypervisor / arcbox-vz (platform virtualization)

Communication: Host <-> Guest via vsock and ArcBox protocol crates (arcbox-protocol, arcbox-grpc, arcbox-transport). Docker API compatibility is provided by arcbox-docker (Axum REST server + guest dockerd proxy).

Critical Platform Differences

macOS specifics:

  • Uses Apple's Virtualization.framework (not KVM)
  • All VM-related binaries require code signing:
    codesign --entitlements bundle/arcbox.entitlements --force -s - arcbox-daemon
    Required for: examples, tests touching hypervisor. See arcbox.entitlements
  • mode_t types (e.g., libc::S_IFMT) are u16 (Linux: u32). Use u32::from() for cross-platform compatibility
  • No fallocate - use ftruncate instead
  • xattr APIs have different argument order than Linux

Development Workflows

Building:

cargo build -p <crate>           # Dev build specific crate
cargo build --release            # Full optimized build

Testing:

cargo test -p <crate>
cargo test -- --nocapture        # Show test output
cargo test -- --ignored          # Run privileged tests (require VM access)

Guest agent cross-compilation:

# Required once:
brew install FiloSottile/musl-cross/musl-cross
rustup target add aarch64-unknown-linux-musl

# Build agent:
cargo build -p arcbox-agent --target aarch64-unknown-linux-musl --release

Project Conventions

Comments and commits:

  • All code comments MUST be in English
  • NO Co-Authored-By lines in commits
  • Detailed inline comments expected for complex logic

Error handling:

  • Use thiserror for crate-specific errors (FsError, NetError, etc.)
  • Use anyhow for application-level error propagation in CLI/API layers

Async:

  • Tokio runtime everywhere (tokio::main, tokio::spawn)
  • Performance-critical paths use async I/O where appropriate

Unsafe usage:

  • Justified only for FFI (Darwin Virtualization), zero-copy networking, lock-free structures
  • Every unsafe block requires a safety comment explaining invariants

Performance Philosophy

Targets (vs OrbStack baselines):

MetricArcBox GoalOrbStack
Cold boot<1.5s~2s
Hot boot<500ms<1s
Idle memory<150MB~200MB
File I/O>90% native75-95%

Implementation patterns:

  1. Zero-copy datapath: arcbox-net packet-path code avoids unnecessary copies
  2. Lock-free where it matters: SPSC queue in virt/arcbox-net/src/datapath/ring.rs
  3. Cache alignment: use #[repr(C, align(64))] for hot structures
  4. Batch operations: avoid per-descriptor overhead in VirtIO queues
  5. Negative caching: arcbox-fs caches missing lookups (see virt/arcbox-fs/src/cache.rs)

Key Files & Patterns

Runtime singleton (app/arcbox-core/src/runtime.rs):

  • Central orchestrator wiring MachineManager, VmLifecycleManager, container backend, networking, and port-forward state
  • Shared managers/state are held behind Arc for async task coordination

VirtIO device pattern (virt/arcbox-virtio/src/*.rs):

  • pop_avail() to get descriptor chains from guest
  • Process I/O (zero-copy where possible)
  • push_used() to return completed descriptors

Filesystem passthrough (virt/arcbox-fs/src/passthrough.rs):

  • Maps guest paths -> host paths via inode/path tables
  • Uses platform-specific syscall branches (#[cfg(target_os = "...")])
  • Uses negative caching to avoid repeated misses

Hypervisor abstraction (virt/arcbox-hypervisor/src/traits.rs):

  • Core traits: Hypervisor, VirtualMachine, Vcpu, GuestMemory
  • Platform implementations in darwin/ (Virtualization.framework) and linux/ (KVM)

Common Pitfalls

  1. Forgetting to codesign -> "Virtualization not available" errors on macOS
  2. Using libc::S_IFMT directly -> Works on Linux, fails on macOS (cast to u32 first)
  3. Not batching virtqueue operations -> Excessive VM exits hurt performance
  4. Ignoring cache alignment -> False sharing between CPU cores
  5. Using Arc<Mutex<T>> in hot paths -> Prefer lock-free or Arc<RwLock<T>>

Debugging & Logging

Tracing levels:

RUST_LOG=debug cargo run ...          # All modules
RUST_LOG=arcbox_hypervisor=trace      # Module-specific
RUST_BACKTRACE=1                      # Enable backtraces

Test resources:

  • Test kernel images live under tests/resources/
  • Release boot assets (kernel + EROFS rootfs) are built in arcboxlabs/boot-assets

Documentation References

  • Main CLAUDE.md: project overview, architecture, commands
  • Crate-level READMEs in app/, virt/, rpc/, runtime/
  • Boot assets ownership and boundaries: docs/boot-assets.md

Licensing & Structure

  • Core (common/, virt/, rpc/, runtime/, app/) + Guest: MIT OR Apache-2.0
  • Pro (pro/): BSL-1.1 - production use requires license after 4 years
  • Enterprise (separate repos): Proprietary (desktop app, SSO, K8s integration)
  • When adding files to core directories or guest/, include dual-license headers

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.