summaryrefslogtreecommitdiffstats
path: root/src/sandbox/mod.rs
Commit message (Collapse)AuthorAgeFilesLines
* sandbox: kata backend — ad-hoc TTL sandboxes over the agent protocolaur-build12 days1-0/+1
| | | | | | | | | | | | | | | | | | | | | | | The kata lease path is composition, not a new protocol: acquire mints a rendezvous nonce, asks a Provisioner for a sandbox pointed at this hub, and leases only the dial-in whose hello carries that nonce back. A box that never dials in is a TTL expiry — the same vocabulary every other failure here speaks (I5) — and a stray box that greets with a nonce nobody ordered is dropped unread, never leased. Two payload shapes are constructed as pure, unit-tested functions because both are real targets: an agent-sandbox-style Kubernetes CR (runtimeClass kata, activeDeadlineSeconds so the orchestrator enforces the TTL even if the hub dies) and a nerdctl/containerd argv for hosts without a cluster. The K8s provisioner is real ureq code exercised only by the gated live tier, which skips with a printed note wherever /dev/kvm or AUR_KATA_API is absent — the recorded-skip convention, not a silent pass. The rendezvous and TTL logic runs for real on any machine via LocalAgentProvisioner: a real sandbox-agent process, real frames, real nonce matching, no VM. That is the same honesty as the loopback backend — the interface is under test, not a mock of it.
* sandbox: ephemeral agent, wire protocol, and the hub's remote backendaur-build12 days1-0/+3
| | | | | | | | | | | | | | | | | | | | | | | The seam from the previous commits only had one body. This adds the other one: a sandbox-agent binary that dials the hub (outbound rendezvous — the hub never needs a route into an untrusted box), serves Run/Put/Get frames over length-prefixed JSON, streams the child's stdout/stderr as they fill, and dies — taking its child with it — when the connection drops or its TTL expires. The TTL watchdog is the backstop under every leak: hub crash, partition, a forgotten destroy. Hub side, RemoteBackend implements the same SandboxBackend: acquire waits for a dial-in and verifies the shared token and profile before a lease exists; a vanished sandbox fails the step, which is already the shape of an expired lease (I5), so the remote path adds no new failure vocabulary. Run frames carry the hub's child environment, so the §16a shim protocol reaches remote children exactly as local ones — which is what makes the end-to-end test honest: a real build, real frames, real log streaming into the SSE-tailed file, no root and no container. Workspace sync over the wire is deliberately not here: Run carries a hub-side cwd, honest for loopback-shaped deployments and this test tier, and the module says so rather than pretending.
* pipeline: replace the devtools chroot with pinned pacman -U provisioningaur-build12 days1-0/+5
| | | | | | | | | | | | | | | | | | | | | | | The chroot step existed to run mkarchroot/makechrootpkg, whose sudo requirement was the whole reason a build had to run on the hub under root-adjacent rules. The sandbox model makes the chroot redundant: the sandbox boots from a base that already carries the official packages, and step 2 now provisions it with a lease manifest instead — every dependency we publish, pinned to the exact version and digest of the artifact the index serves. The hub re-hashes every blob before staging it, installs with pacman -U (no -Sy, no live resolution, no mirror at build time), and the sandbox's own pacman -Q must confirm the pinned world landed before a build may start. A byte that hashes differently, or a world that drifted, fails closed. The build step is now plain makepkg -c -f: no -s (dependencies arrive installed; resolving at build time is what the pinning model forbids) and no -si (ingest signs). mkarchroot/makechrootpkg are gone from the pipeline and the config; their shims stay as stand-ins for the real devtools so the shim protocol itself remains exercised. The shim pacman grew a real fake installed-database: -U refuses bytes that do not hash to the digest their name claims, -Q reports what landed, so the world check is a test and not a no-op.
* sandbox: the seam between the pipeline and where build code runsaur-build13 days1-0/+131
The step machine spawned its own subprocesses, which quietly made "build code runs on this machine, inside a devtools chroot, under §14's sudo rules" a pipeline fact rather than a deployment fact. Every build subprocess now goes through SandboxBackend: acquire a lease, run argv shaped commands (never a shell string), move content-addressed blobs, destroy. The loopback backend is today's behavior wearing the interface - same child_env shim protocol, same captured output - which is why the shim suite passes untouched: a step that cannot tell loopback from a remote sandbox is the property under test.