summaryrefslogtreecommitdiffstats
path: root/docs/DECISIONS.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/DECISIONS.md')
-rw-r--r--docs/DECISIONS.md74
1 files changed, 74 insertions, 0 deletions
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md
index 68f1fee..2861fed 100644
--- a/docs/DECISIONS.md
+++ b/docs/DECISIONS.md
@@ -305,3 +305,77 @@ is modelled rather than crossed.
nspawn capabilities devtools expects), devtools installed, a real signing key,
`signing_key_id` set, `path_prepend` left unset so the real tools are found, then
subscribe to a real pkgbase and drive it through `aur-build serve`.
+
+## Signing moved from the build step to hub-side ingest
+
+The build step used to pass `-si<key>` through to `makepkg`, which meant
+whatever machine ran the build had to hold the signing key. That was survivable
+when the build was a chroot on the hub; it disqualifies every form of remote or
+disposable build sandbox, because a machine executing untrusted PKGBUILD code
+must never be a machine that can mint our signatures.
+
+**Choice.** The build produces unsigned bytes. `ingest` signs the exact bytes
+that entered the store, with the same key and the same code path that signs the
+database (`publish::sign_to`), and a gpg failure fails the build closed.
+`verify` no longer checks for a build-made signature — the meaningful guarantee
+moved to "ingest produced one or the build failed." The shim `makechrootpkg`
+now emits `.sig` only when `-si` is passed, like the real tool, so the suite
+cannot accidentally test a signing path the pipeline no longer has. A test
+asserts both halves: zero `-si` on any build invocation, and the signature
+ingest recorded was made over the stored artifact's bytes.
+
+**Cost.** The artifact is unsigned between build and ingest — a window that
+matters not at all here (staging is hub-local and ingest re-hashes) but must
+never be widened by moving ingest off-hub. And a rebuild of a stored artifact
+re-signs it with the *current* key, which is correct but worth knowing.
+
+## The devtools chroot is gone: the sandbox is the isolation boundary
+
+§8.3 bought isolation with `mkarchroot` + `makechrootpkg`, which costs a sudo
+requirement on the build host — and DECISIONS' own real-chroot entry records
+that stack failing inside containers anyway (`systemd-nspawn` bind-arg errors).
+Once the build runs in a disposable sandbox — a Kata VM, a throwaway container,
+the loopback harness — the chroot is scaffolding inside a boundary that already
+does the job, and I9 gets *stronger*: the untrusted build never touches the
+kernel that runs the hub.
+
+**Choice.** No `mkarchroot`, no `makechrootpkg`, no nspawn, anywhere in the
+pipeline. The build step is plain `makepkg -c -f`: no `-s` (dependencies
+arrive installed; resolving them at build time is what the pinning model
+forbids) and no `-si` (see the signing entry). The step id stays `chroot` in
+the checkpoint table — the DB does not care what the string means, and
+renaming would strand every existing checkpoint row. The devtools shims stay
+in the test tier as stand-ins for the real tools so the shim protocol itself
+remains exercised, but nothing in `src/pipeline` names them.
+
+**Cost.** The "must build in a clean chroot" folklore has a real tail: some
+PKGBUILDs assume `makechrootpkg` conventions (`$PKGDEST`, non-root builder).
+A per-build disposable VM bootstrapped from a pinned base is at least as clean
+— this is how OBS builds distro packages — but expect the tail to show up in
+the gated real-build tier, and budget for `-e` shims there.
+
+## Dependencies arrive pinned by digest via `pacman -U`, not resolved
+
+A sandbox that runs `pacman -Sy` at build time re-resolves against live mirrors
+*after* `plan()` approved a world — a path from "mirror moved since review" to
+"we built it anyway," which is exactly what the fail-closed posture forbids.
+
+**Choice.** The provisioning step (step id `chroot`) builds a **lease
+manifest**: every dependency this build needs that we publish, pinned to the
+exact version and digest of the artifact the index serves
+(`db::index_artifact`). The hub re-hashes every blob before staging it into
+the sandbox, installs with `pacman -U` — no repo DBs, no `Server=`, no mirror
+at build time — and the sandbox's own `pacman -Q` must confirm the pinned
+world landed, or the build fails closed with a dedicated `WorldMismatch`
+error class. Official packages are the base image's business: they arrive
+with the sandbox, and hub-side caching of official artifacts (which also
+solves mirror-rot and mirror etiquette) is recorded as future work, not
+pretended to.
+
+**Cost.** The lease covers only what we publish; pinning the official set
+end-to-end needs the hub's official-repo cache, which is not built. And
+`pacman -U` does no dependency resolution — an incomplete closure fails with a
+world mismatch rather than being helpfully fetched, which is correct here but
+depends on `plan()` computing the closure honestly. The shim `pacman` models
+all of this for real: `-U` refuses bytes that do not hash to the digest their
+name claims, and `-Q` reports exactly what landed.