<feed xmlns='http://www.w3.org/2005/Atom'>
<title>aur-build/src/watch/mod.rs, branch ai/main</title>
<subtitle>Unnamed repository
</subtitle>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/'/>
<entry>
<title>sandbox: keep `Exit` out of the release build</title>
<updated>2026-11-20T23:38:01+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-20T23:38:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=c295510e2bb0ee61234536c832dad87a45977fc8'/>
<id>c295510e2bb0ee61234536c832dad87a45977fc8</id>
<content type='text'>
`Exit` is the result of running a command in a sandbox. `pipeline` consumes it
through `Sandbox::run` — `.success()`, `.stderr` — without ever writing the name,
which is why the census called it dead outside `sandbox`.

The type now lives in a private `mod exit` and reaches the world through an
alias that is `pub` only under `test-support` and `pub(crate)` otherwise. A
`pub` definition inside a private module is not a nameable path from outside,
but it is visible enough to appear in a public trait signature, which is what
makes this possible where a plain `pub(crate) struct` is not.

Verified with an external crate: naming `aur_build::sandbox::Exit` in a release
build is `error[E0603]: struct Exit is private`; with `test-support` it compiles.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`Exit` is the result of running a command in a sandbox. `pipeline` consumes it
through `Sandbox::run` — `.success()`, `.stderr` — without ever writing the name,
which is why the census called it dead outside `sandbox`.

The type now lives in a private `mod exit` and reaches the world through an
alias that is `pub` only under `test-support` and `pub(crate)` otherwise. A
`pub` definition inside a private module is not a nameable path from outside,
but it is visible enough to appear in a public trait signature, which is what
makes this possible where a plain `pub(crate) struct` is not.

Verified with an external crate: naming `aur_build::sandbox::Exit` in a release
build is `error[E0603]: struct Exit is private`; with `test-support` it compiles.
</pre>
</div>
</content>
</entry>
<entry>
<title>docs: record the census, and make the README describe the tree that exists</title>
<updated>2026-11-20T19:03:01+00:00</updated>
<author>
<name>dev</name>
<email>dev@localhost</email>
</author>
<published>2026-11-20T19:03:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=e6c3a02229994a9e007d8e6618add778e1ec021c'/>
<id>e6c3a02229994a9e007d8e6618add778e1ec021c</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>watch: one source interface, and the fail-closed check lives with the source</title>
<updated>2026-11-20T17:55:31+00:00</updated>
<author>
<name>dev</name>
<email>dev@localhost</email>
</author>
<published>2026-11-20T17:55:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=466f6f7e223f56670feabb0737cf97f708aa45f2'/>
<id>466f6f7e223f56670feabb0737cf97f708aa45f2</id>
<content type='text'>
The step machine reached into two of watch's internals and reassembled the
rules itself: `mirror::read_tree` then `Tree::recipe_hash` to re-derive the
hash a reviewer approved, and `digests::cached_path` then
`digests::download_and_cache` then its own comparison to check a payload.
The comparison is the part that must never be skipped, and it was sitting in
whichever step happened to want a file — a step could have forgotten it and
nothing would have noticed.

`watch::sources` is the interface now: what a tree hashes to, and a guarantee
that a cached source is the bytes its name claims. `verify_cached` owns the
fail-closed test and its message verbatim. `download_and_cache` and
`cached_path` are `pub(crate)` again, so the cache layout is watch's business
again; `watch/mod.rs` no longer re-exports them.

`src/pipeline` now names exactly one watch path.

Detection is untouched by construction — no git-invoking function changed —
and the census agrees: 264 successful git execs on the detect binary before
and after. (An initial reading of 1320 vs 264 was PATH-probe ENOENTs from a
differing shell PATH, not git work; counted with suite-cost.py's own rule of
successful execve only, the two runs are identical.)

watch.pub 31-&gt;30. `read_tree` moved into the test-only column: the pipeline
stopped naming it, and what remains are watch's own calls plus the two tests
that exercise its one-batch-read contract directly.

277 passed / 0 failed, clippy -D warnings clean.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The step machine reached into two of watch's internals and reassembled the
rules itself: `mirror::read_tree` then `Tree::recipe_hash` to re-derive the
hash a reviewer approved, and `digests::cached_path` then
`digests::download_and_cache` then its own comparison to check a payload.
The comparison is the part that must never be skipped, and it was sitting in
whichever step happened to want a file — a step could have forgotten it and
nothing would have noticed.

`watch::sources` is the interface now: what a tree hashes to, and a guarantee
that a cached source is the bytes its name claims. `verify_cached` owns the
fail-closed test and its message verbatim. `download_and_cache` and
`cached_path` are `pub(crate)` again, so the cache layout is watch's business
again; `watch/mod.rs` no longer re-exports them.

`src/pipeline` now names exactly one watch path.

Detection is untouched by construction — no git-invoking function changed —
and the census agrees: 264 successful git execs on the detect binary before
and after. (An initial reading of 1320 vs 264 was PATH-probe ENOENTs from a
differing shell PATH, not git work; counted with suite-cost.py's own rule of
successful execve only, the two runs are identical.)

watch.pub 31-&gt;30. `read_tree` moved into the test-only column: the pipeline
stopped naming it, and what remains are watch's own calls plus the two tests
that exercise its one-batch-read contract directly.

277 passed / 0 failed, clippy -D warnings clean.
</pre>
</div>
</content>
</entry>
<entry>
<title>comments: say why, not what</title>
<updated>2026-11-19T17:09:59+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-19T17:09:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=e757979f1a2afdbe7146066345bb9acd19d3b151'/>
<id>e757979f1a2afdbe7146066345bb9acd19d3b151</id>
<content type='text'>
Every module-level `//!` header is gone, and the comments that remained
either re-explained the line below them or had grown into paragraphs.

Density went from one comment line per 6.7 lines of code to one per 10.
827 insertions against 2194 deletions across 86 files.

What survived: the invariants (I1-I12), the design cross-references into
DESIGN.md, and the notes recording a bug that was found and fixed — those
are the comments that carry weight, because they answer a question the
code cannot answer about itself. What did not: restating a function
signature in prose, and narration of the statement underneath.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Every module-level `//!` header is gone, and the comments that remained
either re-explained the line below them or had grown into paragraphs.

Density went from one comment line per 6.7 lines of code to one per 10.
827 insertions against 2194 deletions across 86 files.

What survived: the invariants (I1-I12), the design cross-references into
DESIGN.md, and the notes recording a bug that was found and fixed — those
are the comments that carry weight, because they answer a question the
code cannot answer about itself. What did not: restating a function
signature in prose, and narration of the statement underneath.
</pre>
</div>
</content>
</entry>
<entry>
<title>db, watch: two upward edges removed, and the layering is now a test</title>
<updated>2026-11-18T16:13:30+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T16:13:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=f8370b48f3e4464a1454d0ff7af1819b5448c619'/>
<id>f8370b48f3e4464a1454d0ff7af1819b5448c619</id>
<content type='text'>
M-6. `db::stage_b_cache_get` and `db::stage_b_recent` returned
`watch::upstream::StageB`, so the persistence layer could not be read without
the VCS watcher, and the table's row shape was defined by whatever the watcher
happened to find convenient. The row is `db::model::StageBCacheRow` now —
epoch, pkgver, pkgrel, pins — and `watch::upstream` converts at its own
boundary. The two types are deliberately not the same one: `StageB` carries
`cached`, and "was this answer a cache hit?" is a fact about the resolution
that just happened, not a column.

M-7. `review::risk` called `watch::digests::skip_on_non_vcs` while
`watch::detect` called into `review::candidates`, a cycle between two sibling
domains. Whether a recipe declines to verify its own sources is a question about
the recipe, so `skip_on_non_vcs` — with `SKIP`, `declared_sums` and
`is_hex_digest`, which it needed and which the watcher had no business owning —
moved to `recipe.rs`, a leaf both sides may look down at. `watch::digests` keeps
its use of them for digest resolution; the re-export is gone.

`tests/layers.rs` enforces the direction from now on: `src/db` names no module
above itself, `src/review` does not name `watch`, `src/watch` does not name
`pipeline` or `http`, and `recipe.rs` names nothing at all. Each rule failed
before this commit and each failure message prints the exact file and line of
the offending edge, so the next reasonable-looking commit cannot reintroduce
one quietly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
M-6. `db::stage_b_cache_get` and `db::stage_b_recent` returned
`watch::upstream::StageB`, so the persistence layer could not be read without
the VCS watcher, and the table's row shape was defined by whatever the watcher
happened to find convenient. The row is `db::model::StageBCacheRow` now —
epoch, pkgver, pkgrel, pins — and `watch::upstream` converts at its own
boundary. The two types are deliberately not the same one: `StageB` carries
`cached`, and "was this answer a cache hit?" is a fact about the resolution
that just happened, not a column.

M-7. `review::risk` called `watch::digests::skip_on_non_vcs` while
`watch::detect` called into `review::candidates`, a cycle between two sibling
domains. Whether a recipe declines to verify its own sources is a question about
the recipe, so `skip_on_non_vcs` — with `SKIP`, `declared_sums` and
`is_hex_digest`, which it needed and which the watcher had no business owning —
moved to `recipe.rs`, a leaf both sides may look down at. `watch::digests` keeps
its use of them for digest resolution; the re-export is gone.

`tests/layers.rs` enforces the direction from now on: `src/db` names no module
above itself, `src/review` does not name `watch`, `src/watch` does not name
`pipeline` or `http`, and `recipe.rs` names nothing at all. Each rule failed
before this commit and each failure message prints the exact file and line of
the offending edge, so the next reasonable-looking commit cannot reintroduce
one quietly.
</pre>
</div>
</content>
</entry>
<entry>
<title>http: the review surface — server-rendered, no JavaScript required (§12, §13)</title>
<updated>2026-11-18T08:06:39+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T08:06:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=a6b652985f40cf022d6c522415c36fad13bc663d'/>
<id>a6b652985f40cf022d6c522415c36fad13bc663d</id>
<content type='text'>
tiny_http, thread-per-connection, askama templates. Every §13 surface is
server-rendered HTML that works with scripts switched off: Inbox, review
detail with the full panel set, Builds, Attention, Index, Subscriptions,
Ops/audit, Settings.

The parts that are easy to get wrong:

- Handlers read through thread-local READ-ONLY connections. They cannot
  take the write lock even by accident, so a slow page render never blocks
  the build pipeline's writer. tests/http.rs asserts this by trying to
  write through a read connection and requiring failure.
- Every POST requires a CSRF token derived from the session id. Logout
  drops the session, which invalidates every form still open in a browser.
- Approve carries identity_hash AND diff_digest (§7.1a). If either has
  moved, the approval is refused with 409 and the page re-renders the
  review AS IT IS NOW — never a silent retarget onto the newer state.
- Bulk approve refuses high-risk items unless each one is individually
  confirmed by id. Bulk is per-item, never 'approve everything forever'.
- Reject requires a note; it is re-openable, not a deletion.
- Optional password gate; anonymous visitors are redirected to /login.

Also: the index page states the pacman conf snippet including
'SigLevel = Required DatabaseOptional', because a repo consumers ignore the
signature is a repo that gets MITM'd.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tiny_http, thread-per-connection, askama templates. Every §13 surface is
server-rendered HTML that works with scripts switched off: Inbox, review
detail with the full panel set, Builds, Attention, Index, Subscriptions,
Ops/audit, Settings.

The parts that are easy to get wrong:

- Handlers read through thread-local READ-ONLY connections. They cannot
  take the write lock even by accident, so a slow page render never blocks
  the build pipeline's writer. tests/http.rs asserts this by trying to
  write through a read connection and requiring failure.
- Every POST requires a CSRF token derived from the session id. Logout
  drops the session, which invalidates every form still open in a browser.
- Approve carries identity_hash AND diff_digest (§7.1a). If either has
  moved, the approval is refused with 409 and the page re-renders the
  review AS IT IS NOW — never a silent retarget onto the newer state.
- Bulk approve refuses high-risk items unless each one is individually
  confirmed by id. Bulk is per-item, never 'approve everything forever'.
- Reject requires a note; it is re-openable, not a deletion.
- Optional password gate; anonymous visitors are redirected to /login.

Also: the index page states the pacman conf snippet including
'SigLevel = Required DatabaseOptional', because a repo consumers ignore the
signature is a repo that gets MITM'd.
</pre>
</div>
</content>
</entry>
<entry>
<title>watch: two-stage VCS watcher — ls-remote probe, pkgver() resolution, pin capture (§5.2)</title>
<updated>2026-11-18T07:16:36+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T07:16:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=0b3cb443e70b46ec61455255c3ddfc2a26997613'/>
<id>0b3cb443e70b46ec61455255c3ddfc2a26997613</id>
<content type='text'>
Stage A probes every VCS source in source=() with git ls-remote,
respecting #commit/#tag/#branch fragments, and returns one UpstreamPin
per source. If the tip set equals the accepted release's pins, nothing
can have changed and Stage B never runs — the common case costs one
round trip per source and no clone. svn/hg have no cheap universal probe,
so they are reported as unprobed and force Stage B rather than being
silently treated as unchanged.

Stage B runs only on movement: it fetches into a persistent vcs_cache
(rather than re-cloning a multi-gigabyte upstream daily), runs makepkg
--vercheck, and captures the pins from the clone it already has. Results
are cached on (pkgbase, recipe_hash, upstream_tip) with a per-pkgbase
cooldown, and a process-wide slot cap bounds concurrent resolutions.
The resolved epoch:pkgver-pkgrel plus the pins go into identity_hash, so
a different commit is a different thing to approve.

Also fixes a misclassification the new path exposed: a VCS source's
digest is its pin, so upstream movement showed up as an integrity_alert.
Integrity events are now restricted to fixed downloads; VCS movement
under a frozen pkgver is pin_drift, as §5.2 specifies.

New fixtures git-multi (two upstreams) and git-tagged (#tag pin). 10
tests in tests/vcs.rs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Stage A probes every VCS source in source=() with git ls-remote,
respecting #commit/#tag/#branch fragments, and returns one UpstreamPin
per source. If the tip set equals the accepted release's pins, nothing
can have changed and Stage B never runs — the common case costs one
round trip per source and no clone. svn/hg have no cheap universal probe,
so they are reported as unprobed and force Stage B rather than being
silently treated as unchanged.

Stage B runs only on movement: it fetches into a persistent vcs_cache
(rather than re-cloning a multi-gigabyte upstream daily), runs makepkg
--vercheck, and captures the pins from the clone it already has. Results
are cached on (pkgbase, recipe_hash, upstream_tip) with a per-pkgbase
cooldown, and a process-wide slot cap bounds concurrent resolutions.
The resolved epoch:pkgver-pkgrel plus the pins go into identity_hash, so
a different commit is a different thing to approve.

Also fixes a misclassification the new path exposed: a VCS source's
digest is its pin, so upstream movement showed up as an integrity_alert.
Integrity events are now restricted to fixed downloads; VCS movement
under a frozen pkgver is pin_drift, as §5.2 specifies.

New fixtures git-multi (two upstreams) and git-tagged (#tag pin). 10
tests in tests/vcs.rs.
</pre>
</div>
</content>
</entry>
<entry>
<title>feat: AUR mirror watcher, recipe parsing, candidate creation</title>
<updated>2026-11-17T21:19:35+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-17T21:19:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=f586d11f6a1711145ba4804787217a1bab58751d'/>
<id>f586d11f6a1711145ba4804787217a1bab58751d</id>
<content type='text'>
The detection path (§5.1, §5.1a, §5.3, §7.1):

  * git helpers, all subprocess git in one auditable place. Mirrors are
    cloned with --mirror and polled with git ls-remote, fetching only when
    the tip actually moved; --no-prune keeps history we may need forever.
  * .SRCINFO parsing (authoritative) with a PKGBUILD fallback, and
    source=() parsing that keeps VCS kind, #commit/#tag/#branch refs and
    the filename:: form.
  * recipe_hash over the whole snapshot tree, so a shipped patch is part
    of the recipe and cannot change silently.
  * source digest resolution: declared checksums are trusted-as-declared
    (makepkg enforces them, no bandwidth), local files are hashed from the
    mirror, and SKIP sources are downloaded and stream-hashed into the
    content-addressed source cache. Detection always re-fetches SKIP
    sources — answering from our own cache would defeat drift detection.
  * candidate creation with base = current_accepted_release, collapse in
    place while unviewed, supersede only once a human has looked, and a
    previously rejected identity is not re-raised.
  * non-publishable change handling (I11): unchanged version string means
    no review, but never silence — recipe drift and pin drift become
    notices, and a changed digest on a remote source with an unchanged
    version becomes a high-severity integrity_alert.

Also vercmp + dep-string parsing with the ALPM test vectors, and the
approval record with optimistic concurrency (§7.1a) that the CLI and web
layers will both call.

16 detection tests against real file:// git fixtures, incl. I2 across
three unattended detections and I11 for all three drift kinds.

Part of P0 (DESIGN.md §17).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The detection path (§5.1, §5.1a, §5.3, §7.1):

  * git helpers, all subprocess git in one auditable place. Mirrors are
    cloned with --mirror and polled with git ls-remote, fetching only when
    the tip actually moved; --no-prune keeps history we may need forever.
  * .SRCINFO parsing (authoritative) with a PKGBUILD fallback, and
    source=() parsing that keeps VCS kind, #commit/#tag/#branch refs and
    the filename:: form.
  * recipe_hash over the whole snapshot tree, so a shipped patch is part
    of the recipe and cannot change silently.
  * source digest resolution: declared checksums are trusted-as-declared
    (makepkg enforces them, no bandwidth), local files are hashed from the
    mirror, and SKIP sources are downloaded and stream-hashed into the
    content-addressed source cache. Detection always re-fetches SKIP
    sources — answering from our own cache would defeat drift detection.
  * candidate creation with base = current_accepted_release, collapse in
    place while unviewed, supersede only once a human has looked, and a
    previously rejected identity is not re-raised.
  * non-publishable change handling (I11): unchanged version string means
    no review, but never silence — recipe drift and pin drift become
    notices, and a changed digest on a remote source with an unchanged
    version becomes a high-severity integrity_alert.

Also vercmp + dep-string parsing with the ALPM test vectors, and the
approval record with optimistic concurrency (§7.1a) that the CLI and web
layers will both call.

16 detection tests against real file:// git fixtures, incl. I2 across
three unattended detections and I11 for all three drift kinds.

Part of P0 (DESIGN.md §17).
</pre>
</div>
</content>
</entry>
</feed>
