arcbox / xtask
AGENTS.md4.3k starsChanged 4 months agoApache-2.0View on GitHub
xtask is the repository automation hub: new developer workflows (test runners, samplers, asset staging, release tooling) belong here, not in ad-hoc shell scripts. Command shape lives in src/main.rs; design rules (when to use xshell vs std::process::Command, no script-wrapper facades) live in README.md — follow them, don't restate them. Commands today: check-layers, dev boot-assets, e2e, idle, macos dev, release {check-tool-updates,package-tarball}. This file focuses on e2e and idle, the two the HV fix campaign leans on, and on check-layers, the CI layer-rule…
Trending
Quiet since September.thin dataabout the whole repository
Who's talking about arcboxlabs/arcbox
- A Hacker News story“ArcBox: From-Scratch Container Runtime for macOS in Rust (Docker, K8s, MicroVMs)”Hacker News · Jul 20, 2026 · 3 points
- @github-trending-rs.bsky.social“🚀 Skyrocketing! 🚀 (200+ new stars) 📦 arcboxlabs / arcbox ⭐ 3,352 (+360) 🗒 Rust Run AI agents on real …”Bluesky · Sep 6, 2026
- @githubprojects.bsky.social“arcboxlabs/arcbox Agents need powerful system access. Giving them your actual machine is the uncomfortable …”Bluesky · Sep 6, 2026
- @github-trending-rs.bsky.social“🎉 Celebrating! 🎉 (500+ new stars) 📦 arcboxlabs / arcbox ⭐ 2,448 (+506) 🗒 Rust Run AI agents on real and …”Bluesky · Sep 2, 2026
- 1Password/for-open-source“Application for ArcBox”GitHub · Apr 18, 2026
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 Bluesky · 3
- Sep 6, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 arcboxlabs / arcbox ⭐ 3,352 (+360) 🗒 Rust Run AI agents on real and isolated machines — own… — @github-trending-rs.bsky.social0 likes and reposts · 1 reply
- Sep 6, 2026arcboxlabs/arcbox Agents need powerful system access. Giving them your actual machine is the uncomfortable part. ArcBox gives agents… — @githubprojects.bsky.social0 likes and reposts · 1 reply
- Sep 2, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 arcboxlabs / arcbox ⭐ 2,448 (+506) 🗒 Rust Run AI agents on real and isolated machines — own kernel,… — @github-trending-rs.bsky.social0 likes and reposts · 1 reply
On GitHub · 2
- Apr 18, 2026Application for ArcBox — 1Password/for-open-source0 reactions · 2 comments
- Mar 23, 2026feat: remove daemon plist log paths (companion to arcbox#99) — arcboxlabs/arcbox-desktop0 reactions
On Hacker News · 1
- Jul 20, 2026ArcBox: From-Scratch Container Runtime for macOS in Rust (Docker, K8s, MicroVMs)3 points
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- app/AGENTS.mdAGENTS.md
- common/AGENTS.mdAGENTS.md
- computer/AGENTS.mdAGENTS.md
- engine/AGENTS.mdAGENTS.md
- guest/AGENTS.mdAGENTS.md
- rpc/AGENTS.mdAGENTS.md
- runtime/AGENTS.mdAGENTS.md
- virt/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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
- Very specific: line 24
Every arcbox-e2e target gates its build on arcbox_e2e::env_flag("SKIP_BUILD") (tests/e2e/src/lib.rs).
- Very specific: line 55
errors: when the requested backend conflicts with a pinned one.
- Very specific: line 64
Only an explicit --backend can conflict.
- Very specific: line 86
If you add a recipe, verify the packages AND profile match the test's own cargo build line character-for-character.
- Very specific: line 125
Read the preserved dir the runner prints (test dir preserved: …): daemon log, guest logs, virtio-debug.json (captured while the VM is …
- Very specific: line 178
NOT launch anything: it requires an already-running --pid (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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.
Files
xtask — Agent Guidance
xtask is the repository automation hub: new developer workflows (test
runners, samplers, asset staging, release tooling) belong here, not in
ad-hoc shell scripts. Command shape lives in src/main.rs; design rules
(when to use xshell vs std::process::Command, no script-wrapper
facades) live in README.md — follow them, don't restate them. Commands
today: check-layers, dev boot-assets, e2e, idle, macos dev,
release {check-tool-updates,package-tarball}. This file focuses on
e2e and idle, the two the HV fix campaign leans on, and on
check-layers, the CI layer-rule gate.
xtask e2e — the SKIP_BUILD / prebuild contract
INVARIANT: a prebuild recipe in commands/e2e.rs::prebuild must reproduce
EXACTLY what the target's own build does — same packages AND same profile.
WHY: when a recipe matches, the runner sets SKIP_BUILD=1, the test skips
its own cargo build, and every repeat trusts whatever binaries already
sit in target/. A recipe that builds the wrong packages or wrong profile
makes all N repeats silently run stale/wrong binaries with no error — pure
ghost debugging.
SKIP_BUILD is a cross-crate env contract, not an xtask-internal flag.
Every arcbox-e2e target gates its build on
arcbox_e2e::env_flag("SKIP_BUILD") (tests/e2e/src/lib.rs). The runner
only exports it when prebuild returned true; the other => fallback
prints a notice and omits it, so unknown targets build themselves once.
Current recipe ↔ self-build mapping (keep both columns identical):
| test target | prebuild recipe (e2e.rs) | self-build (tests/e2e) |
boot_assets | cargo build --release -p arcbox-cli -p arcbox-daemon | boot_assets.rs::build_release_binaries (same) |
backend_matrix | same as above | build_release_binaries (same) |
hv_vmm | cargo build --release -p arcbox-e2e --bin hv_e2e | hv_vmm.rs (same) |
stats_watch | release daemon + musl arcbox-agent | stats_watch.rs (same) |
kubernetes_lb | release daemon + musl arcbox-agent | kubernetes_lb.rs (agent) + scenario.rs (daemon) |
sandbox | release cli+daemon + musl arcbox-agent/arcbox-vm-agent bins | sandbox.rs::build_binaries (same) |
egress_throughput | cargo build --release -p arcbox-daemon | scenario.rs::run_vz_scenario_with_log (same) |
docker_build | same as above | scenario.rs::run_vz_scenario_with_log (same) |
docker_build_external | same as above | scenario.rs::run_vz_scenario_with_log (same) |
virtio_debug | none (self-builds) | cargo build --release -p arcbox-daemon (RELEASE only) |
daemon_failure | none (self-builds) | cargo build -p arcbox-daemon (DEBUG) |
| anything else | none — fallback notice, no SKIP_BUILD | its own build |
Note virtio_debug and daemon_failure deliberately have NO recipe and
their profiles differ (release vs debug daemon). If you ever add a recipe
for either, it must reproduce that exact profile.
xtask e2e — --backend cannot move a pinned target
Most e2e targets hardcode ARCBOX_VM_BACKEND and stamp that backend into
their metrics, so the runner's --backend env has no effect on them. Only a
few (boot_assets, backend_matrix) actually read it. The runner therefore
errors when the requested backend conflicts with a pinned one. WHY: the
alternative is a run archived under the wrong backend's label — the same
ghost-debugging class as a mismatched SKIP_BUILD recipe, and it silently
corrupts any HV↔VZ oracle comparison read from the artifacts.
This cuts both ways: virtio_debug and hv_reboot pin hv, so
--backend vz on them is exactly as wrong as --backend hv on a vz-pinned
target. --backend both conflicts with any pin.
Only an explicit --backend can conflict. The flag carries no clap
default, because a default is indistinguishable from a typed value and would
make cargo xtask e2e --test virtio_debug bail on a backend nobody asked
for; unset adopts the target's own pin, and falls back to vz for targets that
pin nothing.
pinned_backend (commands/e2e.rs) derives this from the sources rather
than from a list, deliberately: the set changes whenever someone adds a
target, and a list goes stale exactly when a new target needs the guard
most. It scans the target's own source for a line carrying both
ARCBOX_VM_BACKEND and a "vz"/"hv" literal, then the arcbox_e2e
modules it imports — one level of indirection, which is where
scenario::run_vz_scenario* and the sandbox harness keep their pin. A
line that merely reads the variable carries no literal and is correctly
ignored. Nothing to keep in lockstep; the unit tests in that file pin the
shapes.
Extending — adding a new e2e target (lockstep set)
- The test must gate its build on
arcbox_e2e::env_flag("SKIP_BUILD"), orxtask e2ecannot prebuild it and it rebuilds every repeat. - Either add a matching arm in
commands/e2e.rs::prebuild(returntrue) or accept the self-build fallback — never a half-match. - If you add a recipe, verify the packages AND profile match the test's
own
cargo buildline character-for-character. - Nothing to do for the backend pin —
pinned_backendreads it off the sources, so a new target gets the--backendguard for free as long as it pins the way every existing one does (anARCBOX_VM_BACKENDline with a"vz"/"hv"literal, in the target or in anarcbox_e2emodule it imports).
xtask e2e — forensics linkage (fragile string/env coupling)
The per-failure preserved= column is produced by string-matching the
harness log line containing preserving test directory and splitting out
the path= token (e2e.rs::preserved_dir_from_log ↔
tests/e2e/src/boot_assets.rs:172, warn!(path=…, "preserving test
directory")). The runner also wires ARCBOX_E2E_METRICS_DIR +
ARCBOX_E2E_RUN_LABEL so the harness drops <label>.metrics.json next to
the logs (tests/e2e/src/metrics.rs). If someone rewords that log line or
renames the metrics file, xtask loses forensics silently — empty
preserved= column, missing metrics, exactly the data a race-class
failure needs. Change the harness wording and the xtask matcher together.
xtask e2e — place in the HV validation ladder
cargo xtask e2e --repeat N is the TOP (most expensive) rung, reserved for
race-class HV fixes. Exhaust the cheaper rungs first (see virt/AGENTS.md):
crate unit tests → bare probe (cargo test -p arcbox-e2e --test hv_vmm) →
daemon level (--test virtio_debug, --test boot_assets with
ARCBOX_VM_BACKEND=hv). The e2e targets are #[ignore]; the runner passes
-- --ignored --nocapture, so running them by hand WITHOUT --ignored
reports "0 tests run". --backend both runs vz THEN hv within each
iteration — VZ is the oracle: HV-only red points at the HV impl, double red
points above the hypervisor. Defaults: --test boot_assets --backend vz
--repeat 1.
Debugging: repeats behave inconsistently or run stale code
- Confirm the prebuild recipe matches the target's self-build — compare
the
prebuildarm against the test'scargo buildline (packages AND profile). A mismatch is the prime suspect;SKIP_BUILD=1then runs old binaries. - Read the preserved dir the runner prints (
test dir preserved: …): daemon log, guest logs,virtio-debug.json(captured while the VM is alive), and<label>.metrics.jsonfor phase timings. Never log-grep or sleep for readiness — that isWatchSetupStatus's job in the harness. - Empty
preserved=on a real failure means the log-string/env contract above broke, not that forensics are absent — check the harness wording. - For config-dependent HV failures, bisect with the
hv_e2eprobe knobs (ARCBOX_HV_E2E_VCPUS/MEMORY_MB/BALLOON/BOOT_ONLY=1) one dimension at a time (this is how ABX-386's "vCPU count, threshold exactly 8" was localized). Seevirt/AGENTS.md.
xtask check-layers — the layer rules live in code
cargo xtask check-layers reads cargo metadata --no-deps, builds the
graph of direct edges between workspace members, and fails on any
edge a layer rule forbids; CI runs it in the linux-engine job. The
rules and the grandfathered edges are data in
src/commands/check_layers/rules.rs (RULES, EXCEPTIONS); the
evaluator (evaluate.rs) is a pure function over a small typed graph and
is unit-tested on synthetic graphs, so a rule change comes with a test
there, not with a manifest edit. --verbose prints every member edge and
every grandfathered edge. Rules cover engine/computer (no app/, no
macOS-only crate, no arcbox-vmm / arcbox-hypervisor / VMM adapter —
engine's two edges are grandfathered until vm-stack-redesign R4), common
(no virt/engine/computer/app/guest),
arcbox-vm-proto and arcbox-vm-driver (leaf crates) and
arcbox-vm-agent (no
arcbox-computer-runtime/arcbox-snapshot/tokio/aya/fc-sdk).
- Adding a rule: append a
Rulewhosereasonnames the document that owns it (charter decision, design doc, AGENTS.md section) — the reason is what a violation prints. A rule may name a crate that does not exist yet (arcbox-fc-driver,arcbox-vm-driver); it is a no-op until the crate lands. Every dependency kind counts (normal, dev, build), only workspace members are walked, and an external crate is checked only where a rule names it (Forbidden::Crates). - Adding an exception: append an
Exceptionwith thereasonthe edge exists and the phase (until) that removes it. Exceptions are checked before the rules, so they hold as rules tighten; an exception whose edge no longer exists fails the gate — remove it with the edge. Today's two:arcbox-engine -> arcbox-vmmandarcbox-engine -> arcbox-hypervisor, both until vm-stack-redesign R4. The twoarcbox-computer-runtimeadapter edges died in R3's PR-G5, and the gate retired their exceptions in the same commit — which is the mechanism working, not an accident to imitate loosely: an exception outliving its edge fails the run. - A new top-level directory fails the gate until it is added to
Layer(graph.rs) — the rules must know every layer.
xtask idle
Computes CPU% from ps cputime deltas over the window, NOT %cpu (a
decaying average that lies on short windows) — keep it that way. It does
NOT launch anything: it requires an already-running --pid (e.g. a live
arcbox-daemon) and samples cputime/RSS over --seconds (default 30). The
verdict thresholds (cpu <0.05%, rss <150MB) are hardcoded in
commands/idle.rs and must track the root AGENTS.md performance table;
change them together.
MISS is EXPECTED today, not a regression. HV baselines sit far from target
(idle CPU 6.7% after c3004580, RSS ~0.7–1.9 GB depending on what the guest
touched, vs 0.05%/150MB). The sampler exists to measure event-driven-worker
progress toward those numbers; read MISS as "distance to go", not "you
broke it". Where the idle CPU goes (2026-09-30, sample + ps -M): ~5.6
points are the rx-inject thread's cthread_yield/semaphore_timedwait
loop, all 18 vCPU threads together ~0.1 — "tickless WFI" is not a lever,
the vCPU threads already sleep inside hv_vcpu_run.
Counters honesty (campaign metrics)
The HV broadcast counters (kick_broadcasts / unpark_broadcasts) that
R2/R3 acceptance used to read are retired and always 0 (see
virt/arcbox-vmm/AGENTS.md "Diagnostic Counters"). Judge a wake-path
change by the per-vCPU kicks_received deltas (flat in steady state), the
vsock RPC latency, and xtask idle.
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
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.

