diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 67 |
1 files changed, 47 insertions, 20 deletions
@@ -71,28 +71,55 @@ directory is visible at the same path on both sides. Asserting it is what stops ## Layout +Each layer may name only the layers beneath it. `tests/architecture.rs` encodes +the ranks and fails the build on an upward edge, so the order below is enforced +rather than documented in hope. + ``` src/ - main.rs CLI: init, subscribe, detect, reviews, show, approve, reject, - build, rebuild, run, builds, status, packages, serve, audit, - metrics, gc, backup - config.rs one config file at <root>/config.json - db/ SQLite: migrations, model rows, queries, build state machine - mod.rs single writer actor + thread-local read-only readers - watch/ detection: scheduler, cheap/expensive polls, upstream probes, - 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 - ops.rs retention, metrics, VACUUM INTO backups - shims/ the fake toolchain that makes the pipeline testable (test-support only) -testcorpus/ the fixture packages the tests build for real -templates/ askama templates, server-rendered -static/ app.css and one vendored htmx + main.rs CLI: init, subscribe, detect, reviews, show, approve, reject, + build, rebuild, run, builds, status, packages, serve, audit, + metrics, gc, backup — argument parsing, one use-case call, + and printing; no workflow of its own + usecase/ rank 9 — the workflows both front ends run: bootstrap + (open/init/serve), detect, reviews (approve/reject/bulk), + subscriptions, builds, maintenance (gc/backup/notices) + http/ rank 10 — tiny_http server: routes, render, auth, SSE log + tail; renders use-case results, holds no workflow itself + ops.rs retention, metrics, VACUUM INTO backups + pipeline/ rank 7 — the step machine, the dispatcher + worker pool, + publishing + watch/ rank 6 — detection: scheduler, cheap/expensive polls, + upstream probes, source digests, staleness; `sources` is + the one interface the pipeline builds against + review/ rank 5 — candidates, diff panels, risk scoring, approval; + `intake::record` is the single way a candidate is recorded + shims/ the fake toolchain that makes the pipeline testable + (test-support only) + sandbox/ rank 3 — where build code runs: the backend seam, loopback, + remote agent protocol + agent binary, kata adapter + db/ rank 3 — SQLite: migrations, model rows, per-aggregate + query modules, build state machine; `mod.rs` lists its + exports explicitly, and a single writer actor owns writes + recipe.rs rank 4 — PKGBUILD and .SRCINFO parsing + config.rs rank 2 — one config file at <root>/config.json + fetch.rs, git.rs rank 2 — the two seams over the outside world + pkgver/, pkginfo.rs, hash.rs, time.rs, urlutil.rs + rank 1 — pure: vercmp and the dependency grammar, .PKGINFO + and .BUILDINFO parsing (no libalpm), sha256 and canonical + json, the clock seam, url and name shapes + error.rs rank 0 — the crate's error type; the six variants behavior + branches on carry typed payloads, not prose +testcorpus/ the fixture packages the tests build for real +templates/ askama templates, server-rendered +static/ app.css and one vendored htmx +``` + +Two tools keep this honest, and both are meant to be run, not read once: + +``` +cargo test --test architecture # ranks, no cycles, no globs, interface budgets +python3 tools/arch-census.py # the numbers, and --budget to check the ratchet ``` ## Testing without root, network, or a real chroot |
