<feed xmlns='http://www.w3.org/2005/Atom'>
<title>aur-build/src/git.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>src,tests: say each thing once, in the code or not at all</title>
<updated>2026-11-22T10:44:04+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-22T10:44:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=1e1e12e7220a3fd288782ae40f0823db32acf6cb'/>
<id>1e1e12e7220a3fd288782ae40f0823db32acf6cb</id>
<content type='text'>
The repeated explanations go: sixteen copies of why a `pub` under
`test-support` has two declarations, six notes about where a test moved
from, forty-three banner comments naming the section they sit above.

The prose that stays is the prose the code cannot say — a hand-written
Debug that keeps a token out of a log line, a git pipe that would
deadlock if the write came first, an end-of-string check that has to
precede the separator skip. Enum docs in error.rs collapse to the line
that names what the type is; the argument for why it is shaped that way
is in the variants.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The repeated explanations go: sixteen copies of why a `pub` under
`test-support` has two declarations, six notes about where a test moved
from, forty-three banner comments naming the section they sit above.

The prose that stays is the prose the code cannot say — a hand-written
Debug that keeps a token out of a log line, a git pipe that would
deadlock if the write came first, an end-of-string check that has to
precede the separator skip. Enum docs in error.rs collapse to the line
that names what the type is; the argument for why it is shaped that way
is in the variants.
</pre>
</div>
</content>
</entry>
<entry>
<title>rustfmt,lints: pin the formatting, adopt the idiom lints, pay them off</title>
<updated>2026-11-22T10:36:24+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-22T10:36:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=3dc71b2f5160ef9bd46143eed0edb5d2557b58e6'/>
<id>3dc71b2f5160ef9bd46143eed0edb5d2557b58e6</id>
<content type='text'>
rustfmt.toml fixes the shape the tree is written in (120 columns, small
items kept on one line) and one canonical pass makes it the truth.

[lints.clippy] names the idiom lints worth enforcing and leaves out the
two that would add doc-comment boilerplate rather than remove it. The
tree pays them off here: write!/writeln! instead of push_str(&amp;format!()),
let-else instead of match-on-Option, borrows where a thread entry point
only reads what it owns, no `&amp;self` on a Copy state and no `self` nobody
reads.

ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and
value are now emitted by the same call instead of three.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rustfmt.toml fixes the shape the tree is written in (120 columns, small
items kept on one line) and one canonical pass makes it the truth.

[lints.clippy] names the idiom lints worth enforcing and leaves out the
two that would add doc-comment boilerplate rather than remove it. The
tree pays them off here: write!/writeln! instead of push_str(&amp;format!()),
let-else instead of match-on-Option, borrows where a thread entry point
only reads what it owns, no `&amp;self` on a Copy state and no `self` nobody
reads.

ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and
value are now emitted by the same call instead of three.
</pre>
</div>
</content>
</entry>
<entry>
<title>foundation, http: export what is used above you, and nothing else</title>
<updated>2026-11-20T18:49:22+00:00</updated>
<author>
<name>dev</name>
<email>dev@localhost</email>
</author>
<published>2026-11-20T18:49:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=6c4b4394bd8ddf28d130e87e0100349f13f6e912'/>
<id>6c4b4394bd8ddf28d130e87e0100349f13f6e912</id>
<content type='text'>
The leaf modules were the widest liars. `git` exported 19 names of which 5 were
named by nobody; `hash` exported a constant `EMPTY` that no code had ever
referenced; `time` exported a virtual clock, an `advance` and a `wrap` whose
only caller was a test that turned out not to exist. A leaf's interface is the
whole contract the rest of the crate can rely on, and these interfaces were
mostly decoration.

Nine items were genuinely dead and are gone: `hash::EMPTY`,
`git::{clone_source, count_commits, log_oneline, ls_remote_heads}`,
`recipe::is_diffable`, `pkginfo::values_of`, `time::virtual_now`, and a free
`time::advance` that had been shadowed by the `VirtualClock` method tests
actually call. Eighteen more were used only inside their own module and are now
private — `fetch`'s `Body` aside, which is the return type of a public parser
and so is part of the interface whether or not anyone writes its name.

http went 68 exported names to 27, and its last two glob re-exports
(`pub(crate) use mutations::*; use pages::*;`) are explicit lists now. That
makes the crate's glob count zero, so the allowlist in the architecture test is
empty and can stay that way.

Narrowing surfaced dead code that `pub` had been hiding, because a public item
is presumed used and never questioned: `Req::query` and `Req::body` were parsed
and stored and never read, `Res::found` had no callers, and `sse::FileBody` was
a reader nobody constructed. All four are deleted rather than re-published to
keep the warning quiet.

git 19→14, hash 8→7, recipe 11→7, urlutil 2→1, config 35→31, pkgver 18→14,
time 16→14, pkginfo 7→6, http 68→27. Crate totals: 585→516 pub, 219→115 dead,
4→0 globs.

281 passed / 0 failed, clippy -D warnings clean, release build clean,
architecture 8/8.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The leaf modules were the widest liars. `git` exported 19 names of which 5 were
named by nobody; `hash` exported a constant `EMPTY` that no code had ever
referenced; `time` exported a virtual clock, an `advance` and a `wrap` whose
only caller was a test that turned out not to exist. A leaf's interface is the
whole contract the rest of the crate can rely on, and these interfaces were
mostly decoration.

Nine items were genuinely dead and are gone: `hash::EMPTY`,
`git::{clone_source, count_commits, log_oneline, ls_remote_heads}`,
`recipe::is_diffable`, `pkginfo::values_of`, `time::virtual_now`, and a free
`time::advance` that had been shadowed by the `VirtualClock` method tests
actually call. Eighteen more were used only inside their own module and are now
private — `fetch`'s `Body` aside, which is the return type of a public parser
and so is part of the interface whether or not anyone writes its name.

http went 68 exported names to 27, and its last two glob re-exports
(`pub(crate) use mutations::*; use pages::*;`) are explicit lists now. That
makes the crate's glob count zero, so the allowlist in the architecture test is
empty and can stay that way.

Narrowing surfaced dead code that `pub` had been hiding, because a public item
is presumed used and never questioned: `Req::query` and `Req::body` were parsed
and stored and never read, `Res::found` had no callers, and `sse::FileBody` was
a reader nobody constructed. All four are deleted rather than re-published to
keep the warning quiet.

git 19→14, hash 8→7, recipe 11→7, urlutil 2→1, config 35→31, pkgver 18→14,
time 16→14, pkginfo 7→6, http 68→27. Crate totals: 585→516 pub, 219→115 dead,
4→0 globs.

281 passed / 0 failed, clippy -D warnings clean, release build clean,
architecture 8/8.
</pre>
</div>
</content>
</entry>
<entry>
<title>error: give the six variants behavior carries a shape, not a sentence</title>
<updated>2026-11-20T18:20:18+00:00</updated>
<author>
<name>dev</name>
<email>dev@localhost</email>
</author>
<published>2026-11-20T18:20:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=bbae6c8e83cf145f9af472f69591bae804d03048'/>
<id>bbae6c8e83cf145f9af472f69591bae804d03048</id>
<content type='text'>
`Error::NotFound("no repo row; run `aur-build init`")` and
`Error::NotFound("pkgbase linux")` were the same variant. One is "the install
was never initialised, every page is wrong"; the other is "that page does not
exist, answer 404". The difference lived inside a string, so the only way to
act on it was to re-parse text the same process had written moments earlier.

Six variants now carry structure:

  Missing        pkgbase / candidate / release / build / snapshot /
                 mirror path / repo row
  Refused        IllegalTransition / WrongState / PointerMoved / Other
  Guard          HashMismatch / DigestMismatch / Invariant
  WorldGap       MissingPin / Other
  PoolFull       Backend{backend} / Other
  TransientCause Upstream / Command / Other

`Refused` distinguishes the three refusals that were indistinguishable: a
transition no edge permits (caller bug), a row in the wrong state (stale
view), and the accepted pointer moving under a build (a lost race, and the
one a client may safely retry). `PoolFull::Backend` names which pool, because
a kata quota needs an operator and a local cap clears when a build exits.

`is_transient` and `is_pool_exhausted` already matched on variants rather than
strings, so they are unchanged — the typing is what lets the *next* branch be
a match instead of a `contains`.

No test assertion was edited. Where a message is load-bearing the Display was
written to reproduce it: `recipe_hash mismatch: approved X, materialized Y`,
`no release 4`, `illegal candidate transition approved → rejected`, `sandbox
world is missing plain-make-1.0-1 after installing the lease set` and kata's
`never dialed in` all come out of the new types byte-identical. Five messages
did change wording, none asserted anywhere:

  release N is X, not published: nothing to withdraw
    -&gt; release N is X, not published          (Refused::WrongState's shape)
  illegal candidate transition a → b for review 7
    -&gt; ... for candidate 7                   (it is a candidate id; "review"
                                              was misleading)
  no candidate 7 to resolve -&gt; candidate 7   (Missing::Candidate's shape)
  lease artifact n-v: store bytes hash to A but the index says B
    -&gt; source n-v hashed to A but the candidate recorded B  (shares
       Guard::DigestMismatch with the source-cache check)
  vcs_cache clone URL: err -&gt; upstream: vcs_cache clone URL: err
                                              (TransientCause::Upstream tag)

error.pub 15-&gt;21 is the six payload enums, which is the point of the task
rather than a widening to apologise for. watch.dead/test each rose by one for
a subtler reason: `watch::upstream::resolve` looked live only because an
unrelated db message ended "... to resolve", and rewording that string removed
the phantom mention. The census now documents that a clean count is not always
an answer, since mentions are matched over raw source including string
literals.

281 passed / 0 failed (277 plus four new typing tests in src/error.rs), clippy
-D warnings clean, release build clean.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`Error::NotFound("no repo row; run `aur-build init`")` and
`Error::NotFound("pkgbase linux")` were the same variant. One is "the install
was never initialised, every page is wrong"; the other is "that page does not
exist, answer 404". The difference lived inside a string, so the only way to
act on it was to re-parse text the same process had written moments earlier.

Six variants now carry structure:

  Missing        pkgbase / candidate / release / build / snapshot /
                 mirror path / repo row
  Refused        IllegalTransition / WrongState / PointerMoved / Other
  Guard          HashMismatch / DigestMismatch / Invariant
  WorldGap       MissingPin / Other
  PoolFull       Backend{backend} / Other
  TransientCause Upstream / Command / Other

`Refused` distinguishes the three refusals that were indistinguishable: a
transition no edge permits (caller bug), a row in the wrong state (stale
view), and the accepted pointer moving under a build (a lost race, and the
one a client may safely retry). `PoolFull::Backend` names which pool, because
a kata quota needs an operator and a local cap clears when a build exits.

`is_transient` and `is_pool_exhausted` already matched on variants rather than
strings, so they are unchanged — the typing is what lets the *next* branch be
a match instead of a `contains`.

No test assertion was edited. Where a message is load-bearing the Display was
written to reproduce it: `recipe_hash mismatch: approved X, materialized Y`,
`no release 4`, `illegal candidate transition approved → rejected`, `sandbox
world is missing plain-make-1.0-1 after installing the lease set` and kata's
`never dialed in` all come out of the new types byte-identical. Five messages
did change wording, none asserted anywhere:

  release N is X, not published: nothing to withdraw
    -&gt; release N is X, not published          (Refused::WrongState's shape)
  illegal candidate transition a → b for review 7
    -&gt; ... for candidate 7                   (it is a candidate id; "review"
                                              was misleading)
  no candidate 7 to resolve -&gt; candidate 7   (Missing::Candidate's shape)
  lease artifact n-v: store bytes hash to A but the index says B
    -&gt; source n-v hashed to A but the candidate recorded B  (shares
       Guard::DigestMismatch with the source-cache check)
  vcs_cache clone URL: err -&gt; upstream: vcs_cache clone URL: err
                                              (TransientCause::Upstream tag)

error.pub 15-&gt;21 is the six payload enums, which is the point of the task
rather than a widening to apologise for. watch.dead/test each rose by one for
a subtler reason: `watch::upstream::resolve` looked live only because an
unrelated db message ended "... to resolve", and rewording that string removed
the phantom mention. The census now documents that a clean count is not always
an answer, since mentions are matched over raw source including string
literals.

281 passed / 0 failed (277 plus four new typing tests in src/error.rs), clippy
-D warnings clean, release build clean.
</pre>
</div>
</content>
</entry>
<entry>
<title>git: read a tree with one cat-file --batch instead of one process per file</title>
<updated>2026-11-19T19:38:09+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-19T19:38:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=e0960212c1499c76cc4abc8b2112baea97ecf1b4'/>
<id>e0960212c1499c76cc4abc8b2112baea97ecf1b4</id>
<content type='text'>
read_tree cost a cat-file -e, an ls-tree and a cat-file blob per file, so
the number of processes a detection paid for scaled with how many files a
recipe ships. One ls-tree plus one batch read is now constant, and a commit
that is gone from the mirror surfaces from ls-tree itself - still fail
closed, still the same message.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
read_tree cost a cat-file -e, an ls-tree and a cat-file blob per file, so
the number of processes a detection paid for scaled with how many files a
recipe ships. One ls-tree plus one batch read is now constant, and a commit
that is gone from the mirror surfaces from ls-tree itself - still fail
closed, still the same message.
</pre>
</div>
</content>
</entry>
<entry>
<title>comments: keep only what the code cannot show</title>
<updated>2026-11-19T17:33:17+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-19T17:33:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=4304b0f336ddba7b4ec6780795059ff2066d105b'/>
<id>4304b0f336ddba7b4ec6780795059ff2066d105b</id>
<content type='text'>
Stripped every comment that described what an item does, documented its
arguments or fields, or cited the design docs (§n, I-n, m-n, decision n).
2247 comments down to 83.

What survives: the section dividers that segment the large modules, the
secret-handling warnings, the agent wire-frame directions, and the few notes
without which the code they attach to reads as redundant, reorderable, or
unsound.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Stripped every comment that described what an item does, documented its
arguments or fields, or cited the design docs (§n, I-n, m-n, decision n).
2247 comments down to 83.

What survives: the section dividers that segment the large modules, the
secret-handling warnings, the agent wire-frame directions, and the few notes
without which the code they attach to reads as redundant, reorderable, or
unsound.
</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>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>
