summaryrefslogtreecommitdiffstats
path: root/Cargo.toml
Commit message (Collapse)AuthorAgeFilesLines
* deps: drop `similar`, and stop telling cargo not to lookaur-build10 days1-6/+0
| | | | | | | | | | | | | | `[lints.cargo] unused_dependencies = "allow"` was justified by a roadmap: the warning was silenced because the dependencies it named would be needed by targets further down the line. One of them never arrived. `similar` is referenced by nothing in `src`, `tests` or `tools` — the diff is rendered by `similar`'s namesake in `review::diff` only if something calls it, and nothing does — and the mask is what kept that invisible. Both are gone, and neither profile now warns: `cargo check --all-targets --features test-support` and `cargo check --release --all-targets` are silent without the override, so the next dependency that goes unused is a warning rather than a fact nobody can see.
* docs: drop the citations the deleted docs left behindaur-build12 days1-3/+3
| | | | | | | | The §n, I-n, M-n and m-n references survived in string literals the comment strip never touched: migration SQL comments, assertion messages, runtime error text, Cargo.toml, a CSS and template note, and one corpus manifest. They named sections of files that no longer exist, so the prose stays and the citation goes.
* docs: remove the design and architecture docsaur-build12 days1-1/+1
| | | | | | | | | 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: ephemeral agent, wire protocol, and the hub's remote backendaur-build12 days1-0/+7
| | | | | | | | | | | | | | | | | | | | | | | 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: the name we publish comes from the real .PKGINFO parser, and the ↵aur-build13 days1-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shims are test-only `publish.rs::package_name` — the function that decides which package a built artifact is, and therefore what the index says — called into the test harness (`shims::read_pkginfo`) to read it. Worse, the shim module carried its own `.PKGINFO` field parser alongside the real one in `pkginfo.rs`. Two parsers that can drift is a supply-chain-shaped foot-gun in a system whose whole job is provenance: the bytes we sign and the bytes the tests believed in would be interpreted by different code, and a green shim test would not have meant the pipeline read the package the same way. There is now one parser. `package_name` uses `pkginfo::pkginfo_text` and `pkginfo::parse_pkginfo`; the shim's `repo-add` renders its `DESC` entry from the same `PkgInfo` the production code parses, so the fake tool and the real pipeline cannot disagree about what a package calls itself. The duplicate parser and the two wrapper functions are deleted, and the harness test reads its artifact with `pkginfo` too. The module itself is now test-only in the way the review asked for. `pub(crate)` was not available — the shim binaries are separate crates that link the library — so the equivalent enforcement is used instead: `shims` is compiled out unless the `test-support` feature is on, and every shim binary declares `required-features = ["test-support"]`. A production `cargo build --release` neither builds the fakes nor links their code; `cargo build --bin makepkg` says so out loud. `tests/production_surface.rs` covers the half the compiler cannot see: no module in `src/` outside the harness may name `shims::`, and the binaries must keep declaring the feature.
* db: the schema gets an owner — every statement moves into db/, and the ↵aur-build13 days1-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writer stops handing out connections Twelve modules outside `db/` contained hand-rolled SQL — 22 statements in `ops.rs`, 17 in `approve.rs`, 15 in `candidates.rs`, 11 in `publish.rs`, and a dozen more scattered through `watch`, `pipeline`, `http` — which meant the blast radius of a schema change was "any module", and `db/` was a directory rather than a boundary. The audit trail alone was defined in four places with three different detail payloads. Every statement now lives in `db/`. New modules `db::candidates` and `db::approvals` own their tables (including the 21-column candidate select, spelled once as `CANDIDATE_COLS` instead of four times); `db::queries` gains the metrics reads, the retention reads and writes, the publish writes (`insert_release_in`, `cas_accepted_release_in`, `remove_index_packages_in`), the staleness reads and the source-cache lookups; `db::builds` gains `set_release_in`. Where a mutation is a *decision* — the collapse rules, the approval gate, the publish compare-and-swap — the decision stays where it was and the statements are called through the transaction handle, so the atomicity is unchanged and only the SQL moved. `audit_in` is the in-transaction audit append, and `audit` is now a wrapper over it: a decision and its audit row commit together or not at all, which is what I10 actually claims. Enforcement is two-layered, because one layer is a lie. `Writer::call`, `tx` and `send` are `pub(crate)`, which keeps the crate's *users* out — the integration tests and the shim binaries — but `pub(crate)` is crate-wide, so on its own it would not stop `approve.rs` from writing SQL tomorrow. The layer that does is `tests/schema_ownership.rs`: it walks `src/` and fails the build if a statement literal or a rusqlite statement call appears outside `src/db/`. It was checked against a deliberate violation. The test harness still needs to construct states no typed API reaches, so the raw door exists but only under the `test-support` feature, which nothing but this crate's own dev-dependency enables; a production binary cannot see it.
* pipeline: dispatcher actor, worker pool and reaper (§8.2, §8.4)aur-build14 days1-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One dispatcher thread, N workers, one crossbeam channel between them. The dispatcher loop is reap -> cancel -> claim -> send, and the reaper runs first on every pass including the first, so 'recover from a crash' and 'notice an expired lease' are literally the same code path. There is no startup recovery routine to get wrong. - claim_batch does the SELECT and the UPDATE in one BEGIN IMMEDIATE transaction. SQLite has no SKIP LOCKED, but with exactly one writer the claim cannot race: nobody can see a row between the two statements. - Backpressure is min(max_concurrent_builds - in_flight, disk headroom), measured with statvfs. A build that cannot fit on disk stays queued instead of filling the filesystem halfway through a compile. - Retry policy (§8.4): transient failures (IO, HTTP) requeue up to max_transient_attempts; a deterministic build failure is never retried, and the release stays approved_but_unbuilt so the old version never looks healthy. Tests assert attempt==1 for build-fails and attempt==3 for a transient one. - A superseded candidate sets cancel_requested on in-flight builds; the worker stops at the step boundary rather than mid-step, which is what keeps the checkpoints honest. - Publish takes a process-wide lock so two workers cannot interleave the index rewrite. The critical section is the db file rewrite, never a build. - The deterministic build id makes re-enqueue an INSERT OR IGNORE no-op, so a careless 'rebuild that again' is harmless. tests/dispatch.rs drives the real threads: the pool takes a queued build all the way to publication, a reaped build resumes from its checkpoints without re-running makechrootpkg, and backpressure admits exactly one build per slot. Serve now starts the pool alongside the watcher and the HTTP server.
* cli: operator command line with the approval path (§7.2)aur-build14 days1-1/+1
| | | | | | | | | | | | | | | | | aur-build init/subscribe/detect/reviews/show/approve/reject/build/run/ builds/status/packages/audit. approve renders the review and then approves with the hashes it just rendered, so the CLI cannot approve a diff it did not show you; --identity/--diff reproduce the stale case explicitly and a refusal exits 2 (the web equivalent is 409). Approvals are now immutable at the schema level: migration 0006 rejects UPDATE and DELETE on the approval table, because that row is the only proof the system has of what a human actually looked at (§7.2, I10). Publishing also refuses when no approval is reachable, including the manual-rebuild path that inherits one. 10 tests, including two that drive the compiled binary end to end against a file:// AUR fixture.
* test: toolchain shims and the fake-package corpus (§16a)aur-build14 days1-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The harness that makes the rest of this developable. Six real binaries named exactly like the tools the pipeline shells out to, sharing one shim module, driven entirely by environment so no production code path is test-only: AUR_SHIM_DIR where invocations are recorded (jsonl) AUR_SHIM_MANIFEST the fixture manifest to obey AUR_SHIM_FAIL optional tool forced to fail makechrootpkg emits real .pkg.tar.zst files with .PKGINFO and .BUILDINFO (the full chroot world, which is why §10.1 filters it), makepkg answers --printsrcinfo and --vercheck for Stage B, repo-add rebuilds a gzip'd .db with %FILENAME%/%VERSION%/%SHA256SUM% DESC entries, gpg writes a detached signature, mkarchroot creates a warm root. Each one records its invocation so tests assert on what actually ran. testcorpus/ holds 17 fixtures, each a PKGBUILD plus a manifest with the scripted outcome: plain-make, with-patch, install-hooks, skip-checksum, split-pkgbase, build-fails, check-fails, missing-dep, dep-cycle, epoch-bump, pkgrel-reset, downgrade, digest-drift, pin-drift, git-sourced, git-submodules, unresolvable. The harness commits a fixture into a real git repo standing in for AUR, materialises a local upstream git repo for VCS fixtures, and swaps payload bytes for the drift cases. Config.child_env is what puts the shims on PATH for child processes, so the pipeline runs completely unmodified under test. Part of P0 (DESIGN.md §17).
* feat: SQLite schema, migrations, single writer actoraur-build14 days1-0/+5
| | | | | | | | | | | | | | | | | | | The §11 data model as four migrations, plus the §11a concurrency model: one writer thread owning the write connection (mutations arrive as closures over a crossbeam channel, so SQLITE_BUSY is not part of the design) and thread-local read-only connections under WAL. Invariants that are database guarantees rather than conventions: I7 partial unique index -> at most one pending_review per pkgbase I3 UNIQUE(pkgbase_id, identity_hash) -> no duplicate candidates I10 audit table rejects UPDATE and DELETE by trigger §16 current_accepted_release_id moves only by compare-and-swap Also: vercmp + dependency-string parsing (ALPM algorithm, no libalpm), hash helpers including recipe_hash over the whole AUR tree, the clock helper that stamps every write, and the config/root layout. Part of P0 (DESIGN.md §17).
* chore: scaffold cargo project, toolchain shim binaries, git baselineaur-build2026-11-171-0/+61
Provisions rustup + devtools from the distro package set and lays down the crate skeleton: library, CLI binary, and one binary per external tool the pipeline shells out to (mkarchroot, makechrootpkg, makepkg, repo-add, gpg, pacman) so the §16a PATH shims are real executables that cargo builds and tests can locate via CARGO_BIN_EXE_*. Part of P0 (DESIGN.md §17).