summaryrefslogtreecommitdiffstats
path: root/README.md
Commit message (Collapse)AuthorAgeFilesLines
* release build,readme: the gate that only the release build can seeai/mainaur-build8 days1-0/+16
| | | | | | | | | | | | | | `--all-targets` pulls `test-support` in through the dev-dependency, so every check so far compiled `ReleaseState`, `Writer` and `json_or` as `pub`. Without that feature they are crate-internal, and the tree was not clean there: a wildcard import had been expanded into names the release build never compiles, and `ReleaseState::as_str` took a reference to a one-byte Copy value that clippy only complains about once the type is not exported. Both imports are gated with the code that needs them, and the README now lists the three commands that hold the shape — including the release-mode clippy run that found this.
* readme: say that pub(crate) is not automatically the narrow statedev10 days1-0/+15
| | | | | | | | | | | | | | | | | | | | | The constraints section already told the truth about `pub` — an item with no outside reader is a hole, allowed only by name and only with a reason — and said nothing about the step below it, which is the one this pass just walked. Added beside it: what over-wide means, that it is budgeted the same way, the three compiler facts that actually force a `pub(crate)` to stay (a field cannot out-reach its type, privacy does not reach up to a parent or across to a sibling, and `pub(super)` is not a form this crate admits), and the warning that the count is a grep while the verdict is the compiler's, asked under both profiles. The ratchet was checked rather than assumed. Re-widening `ops::sweep_staging` from private back to `pub(crate)` — a change that compiles clean under both profiles and breaks nothing at all — makes `arch-census --budget` exit 1 with `ops.overwide: 1 > 0 accepted` and `ops.sweep_staging is over-wide and unargued`, and makes `cargo test --test architecture` fail 3 tests including `interfaces_stay_within_budget` and `the_over_visibility_budget_matches_the_code`. Reverting it returns the suite to green. A ratchet that only fails on paper is not a ratchet.
* tests,tools: hold the dead-code zero in the ratchet, and prove the checks biteaur-build10 days1-2/+5
| | | | | | | | | | | | | | | | | | | | | | `dead_code.deadonly` is 0 for all 28 modules and the allowlist names the 18 items that stay `pub` by decision, so the remaining question is whether the ratchet can be broken quietly. Three tests close that. `the_dead_code_budget_matches_the_code` refuses a budget that contradicts itself: `modules.<m>.deadonly` is what `interfaces_stay_within_budget` reads and `dead_code.deadonly.<m>` is what `tools/arch-census.py --budget` reads, and both must equal the census — an edit to one alone is how a widening enters unnoticed. `the_dead_code_allowlist_names_real_items` refuses an entry whose item the module no longer declares, which is the permission that lets a deleted item return. `the_budget_writers_preserve_each_other` runs both writers against a copy of the file and fails if either erases the section it does not own, or rewrites the hand-written allowlist — the failure mode two tools sharing one file were always going to have. Each was checked by breaking it on purpose: a raised budget, a stale allowlist key, and a writer that drops the allowlist all fail loudly and pass again when reverted. README now says `--list-dead` exists and that a kept item is allowed by name in the budget file, because a ratchet nobody can inspect is not a ratchet.
* docs: record the test-surface movement in the census report and READMEaur-build11 days1-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The census report gets a second movement next to the first. The numbers: pub 505 -> 484, dead 105 -> 84, test-only 72 -> 48, pub(crate) 109 -> 119, globs still zero. Two budget increases are recorded rather than smoothed over, because both are consequences of narrowing and a reader is entitled to know which numbers moved the wrong way and why: - sandbox.deadonly 0 -> 2. `Provisioner` and `ProvisionRequest` are named by nobody outside sandbox but cannot be narrowed: LocalAgentProvisioner is pub because two fixture tests construct it, and Rust forbids a public type implementing a private trait or taking a private parameter. - db.deadonly 8 -> 9. Five state enums each have a `can_transition`. Three went private with their tests; ReleaseState's and SubscriptionState's are consulted by nothing at all, so the name slid from test-only to dead-only instead of disappearing. Both carry a NOTE already. `largest` went 603 -> 673 because eleven config tests moved into src/config.rs. It is reported and not budgeted: a line ceiling that counts a module and its tests together would penalise the exact act this goal was for. README's Testing section was stale in a way only a test move exposes — it named `versions::vercmp_matches_the_system_oracle`, a test that does not exist under that name in either location — and said nothing about where a test belongs. Both fixed, with the reason stated: a test outside a module can only reach what the module exports, so a fixture-free test in tests/ is a door held open by a test.
* docs: record the census, and make the README describe the tree that existsdev11 days1-20/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The census report gets its after-table, and the README's Layout gets rewritten — it had drifted into fiction, listing `db/queries.rs`'s successors as "queries" and omitting `usecase`, `error`, `hash`, `time`, `urlutil`, `git`, `fetch` and `recipe` entirely. It now states the ranks and says plainly that they are enforced by `tests/architecture.rs`, not kept in hope, and names the two commands that keep it true. This commit also carries the last of the narrowing that fell out of writing the report, because writing it meant actually reading the numbers: - `watch::upstream::resolve` looked test-only and was not — the tests contain an unrelated local function of the same name, which the census matches as a word. It is crate-internal and now says so. - `read_tree` closed with it. Its two integration tests were testing the module's own batching behaviour from outside, so they moved inside as unit tests with a throwaway git repo, which is where a test about one `ls-tree` and one `cat-file --batch` belongs. They lost nothing: the empty-blob and NUL-byte assertions came across verbatim, plus one the old test never made — binary blobs are still listed, just not read. - `Assessment::is_high`, `Tree::get`, `approve::current_accepted` and `diff::full_recipe_text` were dead once their callers closed, and are gone. - `set_risk_for_tests` is gone too. The bulk-refusal test needed a candidate marked high-risk, and the honest way to get one was for the fixture to write the row — `Env::execute` — rather than the library growing a public setter that exists only so a test can pass. That was the last budget above baseline apart from `error.pub`. `error.pub` stays at 21 against a baseline of 15, and the report says why: the six payload enums are constructed in four modules and matched in `error`, so they are interface. `error.dead` is 0. Final: 281 passed / 0 failed across 36 binaries (baseline 273), clippy -D warnings clean, release clean, census within budget.
* tests: declare the layer map, and ratchet every interface widthdev11 days1-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Four greps in tests/layers.rs were the entire enforcement. They could say that db had stopped naming http; they could not say what the architecture is, could not place a new module, and said nothing about the twenty-odd modules nobody had tripped over yet. tests/architecture.rs declares the whole map instead. Every module in src/ gets a rank with the reason it sits there, and a module may name only modules ranked strictly below it — one rule, every module, cycles impossible by construction rather than by luck. The census says the graph already satisfies it, so the map is a description of what is true, not an aspiration the suite immediately fails on. The same file holds the interface budgets, because a boundary is only as strong as what it refuses to let you export: per module, how many pub items it hands out and how many of them nothing outside the module names. Budgets live in architecture-budget.json and move one way. A number that grows fails; a number that got smaller without being written back also fails, which is what stops a won gain from quietly becoming the new ceiling. Each rule was probed rather than trusted: naming http from db fails with `db (rank 3) names http (rank 9)`, tightening db.pub to 200 fails with `db.pub: 226 > 200`, and leaving a stale budget fails with `db.deadonly: budget 99, actual 36`. tests/layers.rs is deleted, not weakened. Three of its four rules are rank consequences now (db, review, recipe all sit below everything they were forbidden to name); the fourth, watch -> shims, was already covered by production_surface.rs, which greps every non-shim file for shims:: and would catch it in any module, not just watch. The census definition now lives in two languages, so the test checks them against each other the way the vercmp oracle checks the hand-written comparator: without python3 the note prints and the suite moves on. 277 passed / 0 failed (273 + 8 new - 4 subsumed), clippy -D warnings clean.
* docs: remove the design and architecture docsaur-build12 days1-14/+7
| | | | | | | | | DESIGN.md, ARCH_REVIEW.md, docs/DECISIONS.md and docs/INVARIANTS.md are gone, along with the references that pointed at them: the README links and layout entry, the §/I-n citations README carried from the design doc, the Cargo.toml shim comment, and the DESIGN.md citation in the first migration's SQL. Nothing read these files at build or test time; 267 tests pass unchanged.
* sandbox: the kata lease path publishes a real package, and the config says ↵aur-build12 days1-0/+33
| | | | | | | | | | | | | | | | | | | | what it means The end-to-end claim of the seam, tested as one thing: `plain-make` detected, approved, built and published through `KataBackend` + `LocalAgentProvisioner` — a real `sandbox-agent` process, a real nonce-matched rendezvous, real frames — with a VM being the only thing this host cannot provide. The index ends up serving the package, the agent's output reaches the same log the SSE tail reads, and the shim saw exactly one `makepkg`. Documented where the project records such things: the enum and the refusal of an unwired kind, the shared listener and the shared Kata backend, and the `shared_workspace` assertion as a guard rather than a fix — the workspace sync is still the unimplemented thing it was, and the config now says so at startup instead of letting `makepkg` discover it. Also reaped two unreaped `sandbox-agent` children in the remote tests, which was the last clippy warning in the tree; `--all-targets` is now silent.
* publish: repo-add decides the database filenameaur-build12 days1-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Publishing renders the index before the DB commits and renames it into place after, so a crash between the two leaves the old index serving (I4). The way that was written did it at `<db>.tar.gz.tmp` beside the live file — a filename real repo-add refuses, because its database argument has to be a name pacman would accept. Every publish test passed; the first real package anyone tried to publish died at the last step with the release already committed. `render_db` now renders into a scratch directory under the served directory, under the name a consumer will download. Same filesystem, so the rename is still the atomic swap, and the live database is never the file repo-add is writing into. `publish`, `reconcile` and `withdraw_package` all had the bug and all share the helper now; `reconcile` sweeps scratch directories a crash left behind. `run_repo_add` drops `-s` too: repo-add would sign into scratch space that is about to be deleted, and `publish::sign` already signs the renamed file. The reason 238 tests missed this is that the shim would write the database anywhere it was told. It now enforces the accepted set — measured against `repo-add (pacman) 7.1.0`, not read out of its docs — with the real tool's wording and exit status, and a gated test re-derives the set against the installed tool, in the shape of the vercmp oracle. A shim that is more permissive than its tool is not a test of the tool.
* docs: the sandbox decisions, recorded where decisions get recordedaur-build12 days1-9/+26
| | | | | | | | | | | | | | | | | | | | | 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.
* docs: the review's decisions, and the invariants that hold themaur-build13 days1-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The structural findings are only durable if they are written down as rules with the test that enforces each one, so: `docs/INVARIANTS.md` gains a second table. The first one is the twelve numbered invariants from DESIGN.md §2 — claims about what the system does. The new one is about how the code is allowed to be shaped: SQL has one owner, a version is formatted in one place, the dependency arrows point one way, the state machines are the ones the transition table defines, the production binary carries no test scaffolding, the served index has one lock, `canonical_json` is canonical in fact, the session id is the credential, and a pinned clock pins everything derived from it. Each row names the test that fails if the shape regresses. `docs/DECISIONS.md` gains the decisions the review turned into code — the session id as the credential, `db/` as a boundary that does not hand out connections, a stale review and a broken database being different answers, shims compiled out of production, states as enums with compare-and-swap writes, unreadable rows failing the query, and only momentary I/O counting as transient. Two existing entries were amended rather than added to: the publisher lock (there is now one, and the second one that used to sit inside it is gone) and the test hooks (they are a gated submodule now, not fields on the production config). `README.md` says where the shims live and that none of them exist in a plain `cargo build`.
* I9: the pipeline stops trusting paths the build could have placed, plus ↵aur-build14 days1-0/+156
README and the invariant index Three things. **A real hole, closed.** `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 generated by our own scan, but their *targets* are not: a PKGBUILD that drops a symlink called `evil.pkg.tar.zst` pointing at the signing keyring, the database, or anyone's home directory would have its target copied in, published and signed by us. The chroot is supposed to be the layer that prevents that, and the chroot tier is gated — but two protection layers must not be load-bearing on each other, and the control plane should not depend on isolation for the safety of its own secrets. `collect` now rejects symlinks and rejects anything whose canonicalized target escapes the build's own staging directory, failing the build closed with the path in the message. `i9_a_build_cannot_smuggle_bytes_in_from_outside_its_own_staging_dir` acts the attack out — the shim plants a symlink to the database file — and asserts the build fails, the store is byte-for-byte untouched, and nothing publishes. This is the last §2 invariant that had no named test; docs/INVARIANTS.md says plainly which part of I9 this covers and which part belongs to the gated chroot tier. **README.md**, written for the person who has to operate this at 3am: the rule everything else follows, the quick start, the layout, how the shim harness makes the whole pipeline testable without root or network, the ops commands, the route table, and the §14 constraints stated as the hard edges they are. **docs/INVARIANTS.md**, mapping I1-I12 to the named tests that hold them, with corroborating tests listed, and an explicit note on the two invariants enforced by the schema (the partial unique index for I7, the append-only triggers for I10/I7) so a future code path cannot forget them. Also recorded in DECISIONS.md: metrics served without a session and why, retention recording a purge instead of deleting the row, and the real-chroot tier being explicitly skipped with what stands in for it and how to actually run it. .gitignore already covered .pi/ but the goal-tracker files were tracked from before the rule existed; untracked now so they stop appearing in every diff.