summaryrefslogtreecommitdiffstats
path: root/docs/DECISIONS.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/DECISIONS.md')
-rw-r--r--docs/DECISIONS.md76
1 files changed, 76 insertions, 0 deletions
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md
index c681c05..76c46c7 100644
--- a/docs/DECISIONS.md
+++ b/docs/DECISIONS.md
@@ -107,3 +107,79 @@ rewrite. A `static Mutex` around `publish()` gives the same guarantee with less
machinery; the critical section is the db file rewrite, never a build. The lock
poison is cleared deliberately: atomic publish means a panic cannot have left a
half-written db, so wedging the queue would be worse than continuing.
+
+## The pipeline refuses symlinks in the srcdir, even though a chroot should make that moot
+
+`collect` scans the build's srcdir for `*.pkg.tar.zst`, and `ingest` copies
+whatever those paths resolve to into the content-addressed store — from where
+the bytes are served from our repo and signed with our key. The paths are ours
+(the scan generates them) but their *targets* are not: a PKGBUILD that drops a
+symlink named `evil.pkg.tar.zst` pointing at the signing keyring, the database,
+or anyone's home directory would have its target copied in and published.
+
+**Choice.** `collect` rejects any entry that is a symlink, and any entry whose
+canonicalized target escapes the build's own staging directory. The build fails
+closed with the path in the message. `tests/invariants.rs::i9_a_build_cannot_smuggle_bytes_in_from_outside_its_own_staging_dir`
+acts the attack out through a shim hook rather than arguing it is unlikely.
+
+**Cost.** A legitimate build that stages a package outside its srcdir and
+symlinks it in now fails. That is a build we want to fail: it is telling us the
+recipe does something we cannot see the whole of.
+
+**Why this is not a substitute for the chroot.** I9's real enforcement is
+isolation, and that tier is gated. This is the narrower claim that the control
+plane does not *depend* on isolation for its own secrets — the layers should not
+be load-bearing on each other.
+
+## Metrics are served without a session
+
+Everything else in the UI is behind a password. `/metrics` is not, because a
+Prometheus scraper has no session to present, and the alternative — teaching the
+scraper to log in and hold a cookie — puts a credential in a monitoring config
+to protect numbers.
+
+**Choice.** `/metrics` returns counts only: queue depth, review debt and its age
+histogram, build success rate, WAL size, index size, stale counts by reason,
+staging usage. No package names, no versions, no audit detail, no paths. The
+bind address is loopback by default, which is where that is safe; anyone exposing
+it further is exposing their own choice of numbers, not their recipe history.
+
+**Cost.** A visitor on the host can see how busy the server is. If that ever
+matters, the fix is a scrape token, not a session.
+
+## Retention records a purge instead of deleting the row
+
+The schema exists so that "which bytes produced this installed package" stays
+answerable years later (§11a). Disk cannot be kept forever, so something has to
+give, and the honest option is to let the *bytes* go while the *record* stays.
+
+**Choice.** Eviction deletes the package, signature, build log and cached
+sources of releases beyond the keep window — as a unit, because a package whose
+log is gone but whose bytes remain is full price for no explanation — and sets
+`purged_at` on the release and its artifact rows. The digest and size survive, so
+the database says "these bytes existed, hashed to this, and were dropped at T"
+rather than continuing to claim a file that is no longer there. Shared
+content-addressed files are reference-checked against every *retained* release
+first: two releases built from the same source share one cached archive, and
+aging one out must not corrupt the other.
+
+**Cost.** A `purged_at` column on two tables, and a UI that has to say "bytes no
+longer held" rather than offering a download that 404s.
+
+## The real-chroot integration tier is recorded as skipped, not silently absent
+
+§16a gates the tier that needs root, network and devtools. On this host the
+tier was not run: it requires a privileged Arch chroot (`mkarchroot` over the
+real mirror database), a signing key with a real passphrase, and outbound
+network to the AUR, none of which the environment provides.
+
+**What stands in its place.** The shim tier drives the *unmodified* pipeline
+against fake tools that produce real archives, and the crash tests kill real
+processes with real signals. The parts the gated tier would exercise that the
+shims cannot: `mkarchroot`'s actual root construction, `makechrootpkg`'s
+copy-on-write snapshot semantics, GPG's passphrase handling, and the behaviour
+of a PKGBUILD that escapes its sandbox in ways a symlink does not capture.
+
+**How to run it.** Install devtools, create a signing key, set `signing_key_id`
+and leave `path_prepend` unset so the real tools are found on `PATH`, then
+subscribe to a real pkgbase and drive it through `aur-build serve`.