From 43a2bfaaac60bc378135ad90c46c9d42777aeb1e Mon Sep 17 00:00:00 2001 From: aur-build Date: Thu, 19 Nov 2026 12:11:32 +0000 Subject: docs: the sandbox decisions, recorded where decisions get recorded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DECISIONS.md gains the three entries this work turned on: signing moved hub-side to ingest (the build machine must never hold the key), the devtools chroot is gone (the sandbox is the isolation boundary, and I9 gets stronger with it), and dependencies arrive pinned by digest via pacman -U rather than being resolved at build time. Each states the pressure, the choice, and the cost — including the costs: the unsigned window between build and ingest, the makechrootpkg-convention PKGBUILD tail to hunt in the gated tier, and the official-package pinning that is honestly still future work. DESIGN.md's step table and §8.3 now describe what the code does, and a new §8a documents the sandbox-backend seam: loopback, remote, kata, and the TTL as the guarantee under every leak. INVARIANTS.md's I9 note moves from 'enforced by the chroot' to 'enforced by the sandbox' — the pipeline's own hygiene test still pins what it always pinned. The README's testing section names the new shim surface and the two new test tiers, and the gated-tier list reflects the kata live tier in place of the retired real-chroot one. --- README.md | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index f84ee4e..1ee56e3 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ src/ source digests, staleness derivation review/ candidates, diff panels, risk scoring, approval pipeline/ the step machine, the dispatcher + worker pool, publishing + sandbox/ where build code runs: the backend seam, loopback, remote + agent protocol + agent binary, kata adapter, failure fakes pkgver/ vercmp and the dependency-string grammar pkginfo.rs .PKGINFO / .BUILDINFO parsing (no libalpm) http/ tiny_http server: routes, render, auth, SSE log tail @@ -71,13 +73,17 @@ docs/ DECISIONS.md, INVARIANTS.md `cargo test` runs the whole thing on an ordinary user account. Two mechanisms make that possible (§16a): -* **PATH shims.** `src/bin/` contains `makepkg`, `makechrootpkg`, `mkarchroot`, - `repo-add`, `gpg` and `pacman`. Pointing `path_prepend` at the directory cargo - built them into makes the *unmodified* pipeline drive a fake toolchain: it - still runs real subprocesses, still reads their stdout and exit codes, still - gets real `.pkg.tar.zst` files with real `.PKGINFO` and `.BUILDINFO` inside - them, and still signs them with a fake key. The step machine cannot tell it is - not in a chroot, which is the point. +* **PATH shims.** `src/bin/` contains `makepkg`, `pacman`, `repo-add` and + `gpg` — the tools the pipeline actually shells out to now that builds run + in provisioned sandboxes — plus `mkarchroot` and `makechrootpkg`, kept as + stand-ins for the real devtools so the shim protocol itself stays + exercised. Pointing `path_prepend` at the directory cargo built them into + makes the *unmodified* pipeline drive a fake toolchain: it still runs real + subprocesses, still reads their stdout and exit codes, still gets real + `.pkg.tar.zst` files with real `.PKGINFO` and `.BUILDINFO` inside them, + and the fake `pacman -U` refuses bytes that do not hash to the digest + their name claims. The step machine cannot tell it is not in a sandbox, + which is the point. * **The fixture corpus.** `testcorpus/` holds ~20 synthetic packages, each with a `PKGBUILD` and a manifest describing what the shims should emit: a split pkgbase, a build that fails, a recipe whose payload drifts under a `SKIP` @@ -90,6 +96,15 @@ process mid-step, and a separate test spawns the compiled binary and kills *it*, then asserts a fresh process resumes from the step checkpoints with no duplicate work and the old index still byte-identical. +The sandbox seam (§8a of the design) is tested the same way — the interface is +executed, not mocked: `tests/remote_agent.rs` drives a **full build over the +real agent protocol** (frames, rendezvous, log streaming, blob round-trip, +bad-token refusal) against the shims on a loopback socket, and +`tests/failure_modes.rs` runs a `FakeBackend` that breaks sandboxes on +purpose: dies mid-run (lease expiry → reaper → requeue), TTL bites mid-build, +pool at quota (the build blocks on `sandbox-pool`, it does not fail), and a +sandbox whose `pacman -Q` lies (fail-closed world mismatch). + All of it is behind a `test-support` feature, which `cargo test` turns on through its dev-dependency on this crate and `cargo build` does not turn on at all: the shim binaries are not built, the `TestHooks` type has no fields, and the @@ -101,8 +116,10 @@ than failing: * `versions::vercmp_matches_the_system_oracle` needs pacman's `vercmp` on `PATH` and compares the hand-written comparator against it over ~1100 pairs. -* The real-chroot tier needs root, network and devtools. It is recorded as - skipped in `docs/DECISIONS.md` rather than silently absent. +* The live kata tier needs `/dev/kvm` and a cluster (`AUR_KATA_API`); the kata + rendezvous and TTL logic itself runs everywhere via a real `sandbox-agent` + process with no VM. The old real-chroot tier retired with devtools; what it + caught is recorded in `docs/DECISIONS.md` rather than silently absent. ## Operations -- cgit v1.2.3