<feed xmlns='http://www.w3.org/2005/Atom'>
<title>aur-build/.pi/.goals-pool-snapshot.json, branch ai/main</title>
<subtitle>Unnamed repository
</subtitle>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/'/>
<entry>
<title>I9: the pipeline stops trusting paths the build could have placed, plus README and the invariant index</title>
<updated>2026-11-18T10:16:12+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T10:16:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=12fb09b0ad11c0d9305d606b3b4fced8ba04d385'/>
<id>12fb09b0ad11c0d9305d606b3b4fced8ba04d385</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>ops: retention that never lies about what is on disk, metrics that cannot drift, and a backup that restores</title>
<updated>2026-11-18T10:02:04+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T10:02:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=bc63622a1a91f6e1036eb8e6824c04f922e2654e'/>
<id>bc63622a1a91f6e1036eb8e6824c04f922e2654e</id>
<content type='text'>
Three §15 features, each with a failure mode worth designing against.

**Retention** evicts the files of releases beyond the keep window and never
deletes a row. The artifact keeps its digest, size and provenance and gains a
purged_at, so the record says 'these bytes existed and were dropped at T'
instead of continuing to claim a file that is no longer there. A package, its
signature, its build log and its cached sources are evicted as one unit — a
package whose log is gone but whose bytes remain is the worst outcome: full
price, no explanation. Shared content-addressed files are reference-checked
against every *retained* release first, because two releases built from the same
source share one cached archive and aging one out must not corrupt the other.
The currently accepted release and anything still backing an in_index package are
kept regardless of how far down the list they sit: deleting the bytes the index
is pointing at is the one thing retention must never do.

**Staging sweep** derives 'abandoned' rather than guessing it: the dir's build is
terminal, or has no build row at all, and the dir is older than a grace period.
A dir whose build is running is left alone however old it looks, because a long
build is not an abandoned one.

**Metrics** are computed from live state on every scrape. There are no counters
incremented at event sites, because a counter maintained by every code path is a
counter that quietly drifts the first time a path is added; a query cannot
drift. Includes queue depth, the review-debt age histogram (not just how many
reviews are pending but how stale they are), build success rate, WAL size,
stale counts by reason and staging usage. A fresh install reports success rate
1.0 rather than NaN or 0%, so an empty system does not page anyone. Served at
GET /metrics and by 'aur-build metrics'.

**Backup** uses VACUUM INTO on the writer connection, so it cannot interleave
with a write, and refuses to overwrite an existing file — a backup that silently
replaces last week's backup is a way of losing the only copy on the day you need
it. The snapshot is then reopened and checked for schema version and approval
rows: if it does not open on its own it is a file, not a backup.

New CLI: metrics, gc [--keep N] [--dry-run], backup &lt;path&gt;.
tests/ops.rs: 9 tests. 170 tests pass, clippy clean.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Three §15 features, each with a failure mode worth designing against.

**Retention** evicts the files of releases beyond the keep window and never
deletes a row. The artifact keeps its digest, size and provenance and gains a
purged_at, so the record says 'these bytes existed and were dropped at T'
instead of continuing to claim a file that is no longer there. A package, its
signature, its build log and its cached sources are evicted as one unit — a
package whose log is gone but whose bytes remain is the worst outcome: full
price, no explanation. Shared content-addressed files are reference-checked
against every *retained* release first, because two releases built from the same
source share one cached archive and aging one out must not corrupt the other.
The currently accepted release and anything still backing an in_index package are
kept regardless of how far down the list they sit: deleting the bytes the index
is pointing at is the one thing retention must never do.

**Staging sweep** derives 'abandoned' rather than guessing it: the dir's build is
terminal, or has no build row at all, and the dir is older than a grace period.
A dir whose build is running is left alone however old it looks, because a long
build is not an abandoned one.

**Metrics** are computed from live state on every scrape. There are no counters
incremented at event sites, because a counter maintained by every code path is a
counter that quietly drifts the first time a path is added; a query cannot
drift. Includes queue depth, the review-debt age histogram (not just how many
reviews are pending but how stale they are), build success rate, WAL size,
stale counts by reason and staging usage. A fresh install reports success rate
1.0 rather than NaN or 0%, so an empty system does not page anyone. Served at
GET /metrics and by 'aur-build metrics'.

**Backup** uses VACUUM INTO on the writer connection, so it cannot interleave
with a write, and refuses to overwrite an existing file — a backup that silently
replaces last week's backup is a way of losing the only copy on the day you need
it. The snapshot is then reopened and checked for schema version and approval
rows: if it does not open on its own it is a file, not a backup.

New CLI: metrics, gc [--keep N] [--dry-run], backup &lt;path&gt;.
tests/ops.rs: 9 tests. 170 tests pass, clippy clean.
</pre>
</div>
</content>
</entry>
<entry>
<title>vercmp: three real bugs, found by comparing against pacman's own binary</title>
<updated>2026-11-18T09:44:37+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T09:44:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=5809493be2f6e47e3bbfc8a645ea0d82d5aedd82'/>
<id>5809493be2f6e47e3bbfc8a645ea0d82d5aedd82</id>
<content type='text'>
tests/versions.rs started as a hand-typed table of ALPM ordering vectors and
turned into something better: a differential test that runs the hand-written
comparator against pacman's `vercmp` over a 34-fragment cross-product (1156
pairs) of shapes that appear in real recipes. It found three bugs, all of which
would have shipped.

1. **Numeric vs alphabetic chunks were inverted.** The code had 'a numeric chunk
   is always older than an alphabetic one'. It is the opposite: 1.0.1 &gt; 1.0.a.
   The unit test asserted the wrong direction with the comment 'alpha sorts
   after numeric', so the suite was protecting the bug.

2. **Separators were ignored entirely.** They are not merely skipped. ALPM
   distinguishes an alphabetic chunk glued to the previous chunk from one after
   a separator, and the separated one is newer regardless of the letters:
   1.0 &gt; 1.0a, but 1.0 &lt; 1.0.a, and 1.0z &lt; 1.0.a. Two versions differing only in
   where the dot sits were being called equal.

3. **The end-of-string rule looked at the wrong thing.** When one side runs out,
   the decision comes from the other side's *next raw character* before any
   separator skipping: a letter there makes the exhausted string newer (the
   1.0rc1 &lt; 1.0 rule), anything else makes it older.

The rewrite is character-wise rather than a chunk pre-pass, because the
glued-or-separated distinction cannot be made after the separators have been
thrown away. Rule 3 is the kind of thing nobody can be confident about from the
spec alone, which is exactly what the oracle is for; it is skipped with a note
when pacman is not installed, and the curated table — every pair of which was
also checked against the binary — always runs.

Also: the recipe parser's epoch is now exercised end to end (an epoch added to a
PKGBUILD must land on the candidate, and 1:0.9-1 must beat 1.0-1 rather than
read as a downgrade), and the downgrade path asserts the index keeps serving the
higher version, since a downgrade is a human decision and not an automatic
rebuild.

161 tests pass, clippy clean.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tests/versions.rs started as a hand-typed table of ALPM ordering vectors and
turned into something better: a differential test that runs the hand-written
comparator against pacman's `vercmp` over a 34-fragment cross-product (1156
pairs) of shapes that appear in real recipes. It found three bugs, all of which
would have shipped.

1. **Numeric vs alphabetic chunks were inverted.** The code had 'a numeric chunk
   is always older than an alphabetic one'. It is the opposite: 1.0.1 &gt; 1.0.a.
   The unit test asserted the wrong direction with the comment 'alpha sorts
   after numeric', so the suite was protecting the bug.

2. **Separators were ignored entirely.** They are not merely skipped. ALPM
   distinguishes an alphabetic chunk glued to the previous chunk from one after
   a separator, and the separated one is newer regardless of the letters:
   1.0 &gt; 1.0a, but 1.0 &lt; 1.0.a, and 1.0z &lt; 1.0.a. Two versions differing only in
   where the dot sits were being called equal.

3. **The end-of-string rule looked at the wrong thing.** When one side runs out,
   the decision comes from the other side's *next raw character* before any
   separator skipping: a letter there makes the exhausted string newer (the
   1.0rc1 &lt; 1.0 rule), anything else makes it older.

The rewrite is character-wise rather than a chunk pre-pass, because the
glued-or-separated distinction cannot be made after the separators have been
thrown away. Rule 3 is the kind of thing nobody can be confident about from the
spec alone, which is exactly what the oracle is for; it is skipped with a note
when pacman is not installed, and the curated table — every pair of which was
also checked against the binary — always runs.

Also: the recipe parser's epoch is now exercised end to end (an epoch added to a
PKGBUILD must land on the candidate, and 1:0.9-1 must beat 1.0-1 rather than
read as a downgrade), and the downgrade path asserts the index keeps serving the
higher version, since a downgrade is a human decision and not an automatic
rebuild.

161 tests pass, clippy clean.
</pre>
</div>
</content>
</entry>
<entry>
<title>staleness: blocked builds wait properly, and the review answers §10.3 before you approve</title>
<updated>2026-11-18T09:25:13+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T09:25:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=bc543e4182d51917fe6bfa608af2c09c8b578671'/>
<id>bc543e4182d51917fe6bfa608af2c09c8b578671</id>
<content type='text'>
Three real defects, all found while writing the tests that pin §10 down:

- **requeue_blocked requeued everything blocked.** The dispatcher sweeps it
  every pass, so a build waiting on a package that has not arrived was put back
  on the queue, claimed, blocked again, and repeated — a busy loop burning a
  claim and a plan step each tick. It now only requeues a build whose every
  blocking name is actually in the index. The old pipeline test asserted the
  broken behaviour and has been rewritten to assert the correct one.

- **The review page could not warn about missing dependencies, because nothing
  ever computed them.** candidates::set_missing_deps existed and was never
  called; missing deps were discovered at plan time, i.e. after a human had
  already approved. Detection now records them with the same rule the plan step
  uses, so the reviewer sees 'the build will block until these are published'
  before deciding, and the CLI and the page agree because both read the row.

- **The dependents question was unanswered.** §10.3 asks 'approving this marks N
  packages stale'. The review page now says exactly that and names them, from
  the same derivation the Attention page uses.

tests/staleness.rs (6 tests) also pins the claims that were easy to fake:
staleness is derived on read — a schema scan asserts no column anywhere stores
it, and withdrawing a dependency flips a dependent from Outdated to Missing
without a single write to the dependent; a blocked build names its blocker on
Attention and is not counted as a failure; a dependency we stopped publishing
reads as missing rather than outdated.

dep-partner added to the corpus so blocked builds are testable end to end.
149 tests pass, clippy clean.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Three real defects, all found while writing the tests that pin §10 down:

- **requeue_blocked requeued everything blocked.** The dispatcher sweeps it
  every pass, so a build waiting on a package that has not arrived was put back
  on the queue, claimed, blocked again, and repeated — a busy loop burning a
  claim and a plan step each tick. It now only requeues a build whose every
  blocking name is actually in the index. The old pipeline test asserted the
  broken behaviour and has been rewritten to assert the correct one.

- **The review page could not warn about missing dependencies, because nothing
  ever computed them.** candidates::set_missing_deps existed and was never
  called; missing deps were discovered at plan time, i.e. after a human had
  already approved. Detection now records them with the same rule the plan step
  uses, so the reviewer sees 'the build will block until these are published'
  before deciding, and the CLI and the page agree because both read the row.

- **The dependents question was unanswered.** §10.3 asks 'approving this marks N
  packages stale'. The review page now says exactly that and names them, from
  the same derivation the Attention page uses.

tests/staleness.rs (6 tests) also pins the claims that were easy to fake:
staleness is derived on read — a schema scan asserts no column anywhere stores
it, and withdrawing a dependency flips a dependent from Outdated to Missing
without a single write to the dependent; a blocked build names its blocker on
Attention and is not counted as a failure; a dependency we stopped publishing
reads as missing rather than outdated.

dep-partner added to the corpus so blocked builds are testable end to end.
149 tests pass, clippy clean.
</pre>
</div>
</content>
</entry>
<entry>
<title>pkginfo: .PKGINFO/.BUILDINFO parsing gets a real home, and a parser bug fix (§10.1)</title>
<updated>2026-11-18T09:12:28+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T09:12:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=d9c8402180749df4452dc37febace4d933b8407d'/>
<id>d9c8402180749df4452dc37febace4d933b8407d</id>
<content type='text'>
Ingest decides what the index claims about a package and what the world
snapshot records by reading two text files out of a tar inside a zstd stream.
That code was living in src/shims — the test harness — which meant production
depended on the harness for its view of a package's own metadata. Moved to
src/pkginfo.rs, with the shim now delegating to it so the harness and the
production path cannot disagree about what a package says about itself.

Still no libalpm: tar + zstd + eighty lines of key = value parsing. Unknown keys
are ignored rather than rejected, because makepkg adds fields over time and a new
one must not stop us publishing.

**The parser had a real bug.** A .BUILDINFO installed block puts its first entry
on the same line as the key:

    installed =  glibc 2.39-1 x86_64 -
     gmp 6.3.0-1 x86_64 -

The old code skipped the header line, so the first dependency was silently
dropped from every snapshot — exactly the kind of gap that makes staleness
quietly wrong. The header line is parsed now.

tests/world.rs builds real .pkg.tar.zst files and asserts the fields come out of
the archive: repeated keys stay lists, an archive with no .PKGINFO is refused
rather than defaulted from the filename, and the world snapshot contains our own
packages and none of glibc/pacman/binutils. The empty-snapshot case for a first
build is asserted too — nothing of ours existed yet, and recording that honestly
beats inventing a world.

Split pkgbases produce one approval, one release and N index rows each with its
own artifact, asserted directly here. 143 tests pass, clippy clean.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ingest decides what the index claims about a package and what the world
snapshot records by reading two text files out of a tar inside a zstd stream.
That code was living in src/shims — the test harness — which meant production
depended on the harness for its view of a package's own metadata. Moved to
src/pkginfo.rs, with the shim now delegating to it so the harness and the
production path cannot disagree about what a package says about itself.

Still no libalpm: tar + zstd + eighty lines of key = value parsing. Unknown keys
are ignored rather than rejected, because makepkg adds fields over time and a new
one must not stop us publishing.

**The parser had a real bug.** A .BUILDINFO installed block puts its first entry
on the same line as the key:

    installed =  glibc 2.39-1 x86_64 -
     gmp 6.3.0-1 x86_64 -

The old code skipped the header line, so the first dependency was silently
dropped from every snapshot — exactly the kind of gap that makes staleness
quietly wrong. The header line is parsed now.

tests/world.rs builds real .pkg.tar.zst files and asserts the fields come out of
the archive: repeated keys stay lists, an archive with no .PKGINFO is refused
rather than defaulted from the filename, and the world snapshot contains our own
packages and none of glibc/pacman/binutils. The empty-snapshot case for a first
build is asserted too — nothing of ours existed yet, and recording that honestly
beats inventing a world.

Split pkgbases produce one approval, one release and N index rows each with its
own artifact, asserted directly here. 143 tests pass, clippy clean.
</pre>
</div>
</content>
</entry>
<entry>
<title>http: SSE log tail, htmx-refreshed builds table, vendored JS budget (§13)</title>
<updated>2026-11-18T09:01:17+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T09:01:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=4cb2f4c7b68dceaed8f7ffbd8f0db3cfbf3f1ddc'/>
<id>4cb2f4c7b68dceaed8f7ffbd8f0db3cfbf3f1ddc</id>
<content type='text'>
GET /builds/:id/log.stream serves the build log as server-sent events from a
blocking std::io::Read polled by the connection's thread — no async runtime,
no timer wheel. The pipeline appends to a plain file and never learns the
reader exists, so a viewer that hangs up, stalls or never shows up cannot slow
a build by a microsecond. The stream ends when the build reaches a terminal
state instead of holding a connection open forever, and there is a 30-minute
lifetime cap so a wedged build cannot wedge a browser tab indefinitely.

The test proves it is actually live rather than buffered: a producer thread
appends while the stream is open, and the reader must see those bytes before
the build finishes, then see the end event.

The builds table refreshes with hx-trigger="every 3s" against a fragment
endpoint, so htmx swaps one &lt;div&gt; rather than a whole document. Without
JavaScript the same HTML already contains the table — the refresh is an
enhancement, never a requirement.

Static assets are served from include_bytes!, precompressed, with the
Content-Length forced so tiny_http does not chunk a file whose size we know.

Vendoring decision, recorded in docs/DECISIONS.md: the design's '~14 KB htmx'
does not exist — released htmx is 48 KB minified. We vendor 1.9.12 unmodified
and serve the 15.6 KB gzip, and the budget is asserted on served bytes with a
bare-socket test, because an HTTP client would transparently decompress and
hide the number. htmx's SSE extension is deliberately NOT vendored: it swaps
with innerHTML and a build log is untrusted text from someone else's PKGBUILD,
so wiring it up would be an XSS hole opened to make a log scroll by itself.
The review surface still ships no JavaScript at all, asserted by grepping the
rendered page for &lt;script.

Also: styles moved out of base.html into static/app.css, and docs/DECISIONS.md
started with the decisions made so far. 138 tests pass, clippy clean.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GET /builds/:id/log.stream serves the build log as server-sent events from a
blocking std::io::Read polled by the connection's thread — no async runtime,
no timer wheel. The pipeline appends to a plain file and never learns the
reader exists, so a viewer that hangs up, stalls or never shows up cannot slow
a build by a microsecond. The stream ends when the build reaches a terminal
state instead of holding a connection open forever, and there is a 30-minute
lifetime cap so a wedged build cannot wedge a browser tab indefinitely.

The test proves it is actually live rather than buffered: a producer thread
appends while the stream is open, and the reader must see those bytes before
the build finishes, then see the end event.

The builds table refreshes with hx-trigger="every 3s" against a fragment
endpoint, so htmx swaps one &lt;div&gt; rather than a whole document. Without
JavaScript the same HTML already contains the table — the refresh is an
enhancement, never a requirement.

Static assets are served from include_bytes!, precompressed, with the
Content-Length forced so tiny_http does not chunk a file whose size we know.

Vendoring decision, recorded in docs/DECISIONS.md: the design's '~14 KB htmx'
does not exist — released htmx is 48 KB minified. We vendor 1.9.12 unmodified
and serve the 15.6 KB gzip, and the budget is asserted on served bytes with a
bare-socket test, because an HTTP client would transparently decompress and
hide the number. htmx's SSE extension is deliberately NOT vendored: it swaps
with innerHTML and a build log is untrusted text from someone else's PKGBUILD,
so wiring it up would be an XSS hole opened to make a log scroll by itself.
The review surface still ships no JavaScript at all, asserted by grepping the
rendered page for &lt;script.

Also: styles moved out of base.html into static/app.css, and docs/DECISIONS.md
started with the decisions made so far. 138 tests pass, clippy clean.
</pre>
</div>
</content>
</entry>
<entry>
<title>pipeline: a real process kill, and the failure state the UI must show (§8.4, I5)</title>
<updated>2026-11-18T08:47:27+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T08:47:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=2c5a660213ae5f9f6f12d9787c5195e2c2127e6d'/>
<id>2c5a660213ae5f9f6f12d9787c5195e2c2127e6d</id>
<content type='text'>
The crash-resume invariant was only ever simulated before: an in-process fault
hook returns an error, and an error can be caught, unwound and cleaned up by
accident. So the shims gained AUR_SHIM_KILL_PARENT — the named tool SIGKILLs
the process running the pipeline, mid-step, with no Drop and no atexit.

The test spawns the real aur-build binary, watches it die of SIGKILL inside
the build step, and then asserts the things that matter:

- the database is intact, because no transaction ever spans a build step
- the completed steps are checkpointed succeeded and the running one is
  recorded running
- after the lease expires the reaper requeues it and marks the step
  interrupted
- resuming publishes exactly one release, and the shim invocation log proves
  mkarchroot ran once, makechrootpkg twice (crash + resume, not twice per
  attempt) and repo-add once

**This found a real bug.** reap_expired only matched state='leased', but a
worker sets state='running' the moment it starts a step, so a process that
dies mid-step leaves a running row — and every real crash would have been
stranded forever. The reaper now reaps leased and running.

Also §8.4's other half, which was a comment rather than a feature: a failed
build must not leave the old version looking healthy. db::approved_but_unbuilt
finds approvals whose build failed and never published, and Attention and the
package page now say 'v2 approved, build failed, index still serving v1' with
a link to the log. Retrying is an explicit, audited POST, not something the
system does to itself.

Cancellation is asserted to be cooperative at a step boundary: a cancelled
build runs no steps, publishes nothing, and is not counted as a failure.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The crash-resume invariant was only ever simulated before: an in-process fault
hook returns an error, and an error can be caught, unwound and cleaned up by
accident. So the shims gained AUR_SHIM_KILL_PARENT — the named tool SIGKILLs
the process running the pipeline, mid-step, with no Drop and no atexit.

The test spawns the real aur-build binary, watches it die of SIGKILL inside
the build step, and then asserts the things that matter:

- the database is intact, because no transaction ever spans a build step
- the completed steps are checkpointed succeeded and the running one is
  recorded running
- after the lease expires the reaper requeues it and marks the step
  interrupted
- resuming publishes exactly one release, and the shim invocation log proves
  mkarchroot ran once, makechrootpkg twice (crash + resume, not twice per
  attempt) and repo-add once

**This found a real bug.** reap_expired only matched state='leased', but a
worker sets state='running' the moment it starts a step, so a process that
dies mid-step leaves a running row — and every real crash would have been
stranded forever. The reaper now reaps leased and running.

Also §8.4's other half, which was a comment rather than a feature: a failed
build must not leave the old version looking healthy. db::approved_but_unbuilt
finds approvals whose build failed and never published, and Attention and the
package page now say 'v2 approved, build failed, index still serving v1' with
a link to the log. Retrying is an explicit, audited POST, not something the
system does to itself.

Cancellation is asserted to be cooperative at a step boundary: a cancelled
build runs no steps, publishes nothing, and is not counted as a failure.
</pre>
</div>
</content>
</entry>
<entry>
<title>pipeline: dispatcher actor, worker pool and reaper (§8.2, §8.4)</title>
<updated>2026-11-18T08:36:39+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T08:36:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=e27e90aa82b6c878e34b94a6fa238836f497b1c3'/>
<id>e27e90aa82b6c878e34b94a6fa238836f497b1c3</id>
<content type='text'>
One dispatcher thread, N workers, one crossbeam channel between them. The
dispatcher loop is reap -&gt; cancel -&gt; claim -&gt; 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
One dispatcher thread, N workers, one crossbeam channel between them. The
dispatcher loop is reap -&gt; cancel -&gt; claim -&gt; 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>http: surfaces driven by live state — staleness, downgrades, deps, rebuild (I6)</title>
<updated>2026-11-18T08:23:14+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T08:23:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=eefbefed9cbea6b2edef65900fbe6cb6da0b48e4'/>
<id>eefbefed9cbea6b2edef65900fbe6cb6da0b48e4</id>
<content type='text'>
Attention, the package page and the builds page now answer real questions
instead of rendering empty tables:

- Attention lists outdated dependencies derived from the recorded world
  snapshots, naming the dependency that moved, what the artifact was built
  against and what the index holds now; also missing dependencies and
  downgrades (AUR offering a lower version than we serve), which is an
  announcement for a human, not a build request.
- The package page shows depends-on from the recipe we actually serve and
  needed-by from the packages whose recipes name it, plus staleness and the
  aur_commit timeline, each release linking into cgit at that exact commit.
- Builds rows carry the version they are about, in both the live and the
  recently-finished table.
- A manual rebuild reuses the approved source identity and mints no approval
  (I6); the test asserts the approval count is unchanged before and after the
  rebuild runs.
- A paused subscription is not observed at all: detection returns Paused
  without polling, so pausing a broken package stops it opening reviews.
- Staleness stays computed on read (§10.2). Nothing stores a stale flag, so
  nothing can serve a stale lie.

Also: dep-client fixture added for dependency pairs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Attention, the package page and the builds page now answer real questions
instead of rendering empty tables:

- Attention lists outdated dependencies derived from the recorded world
  snapshots, naming the dependency that moved, what the artifact was built
  against and what the index holds now; also missing dependencies and
  downgrades (AUR offering a lower version than we serve), which is an
  announcement for a human, not a build request.
- The package page shows depends-on from the recipe we actually serve and
  needed-by from the packages whose recipes name it, plus staleness and the
  aur_commit timeline, each release linking into cgit at that exact commit.
- Builds rows carry the version they are about, in both the live and the
  recently-finished table.
- A manual rebuild reuses the approved source identity and mints no approval
  (I6); the test asserts the approval count is unchanged before and after the
  rebuild runs.
- A paused subscription is not observed at all: detection returns Paused
  without polling, so pausing a broken package stops it opening reviews.
- Staleness stays computed on read (§10.2). Nothing stores a stale flag, so
  nothing can serve a stale lie.

Also: dep-client fixture added for dependency pairs.
</pre>
</div>
</content>
</entry>
<entry>
<title>review: advisory risk scoring and non-publishable change handling (§6, §5.3, I11)</title>
<updated>2026-11-18T07:29:07+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T07:29:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=04b40812f3366c71bf1c99779f880cc74b7f9efa'/>
<id>04b40812f3366c71bf1c99779f880cc74b7f9efa</id>
<content type='text'>
Every candidate is scored against the recipe the accepted release was
actually built from (release -&gt; candidate -&gt; snapshot), never against
'last seen'. Signals: SKIP on a non-VCS source, a sum changed to SKIP,
new source host, --skippgpcheck, removed validpgpkeys, new makedepends
and fetching build tools (cargo/npm/go/pip), .install scripts, weakened
options, removed checkdepends, pkgrel reset, epoch bump, downgrade, a
diff touching build()/package() bodies rather than metadata, upstream
ranges that touch a build-system file, and first introduction. Advisory
only — there is no auto-approval, so a wrong score costs attention and
never safety (§7.3).

Fixes a fixture bug the new tests exposed: digest-drift and
skip-checksum declared bare paths as sources, which parse as local
recipe files rather than remote downloads, so the drift path never
fired. They now use file:// URLs like a real remote would.

tests/notices.rs: integrity_alert is high severity and leaves no
candidate, pin_drift is informational, recipe drift under a static
version is a warning, SKIP-on-non-VCS is a high risk signal, repeated
polling of one drift is one notice, and an I11 sweep over twelve
fixtures proving a change is never silently dropped.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Every candidate is scored against the recipe the accepted release was
actually built from (release -&gt; candidate -&gt; snapshot), never against
'last seen'. Signals: SKIP on a non-VCS source, a sum changed to SKIP,
new source host, --skippgpcheck, removed validpgpkeys, new makedepends
and fetching build tools (cargo/npm/go/pip), .install scripts, weakened
options, removed checkdepends, pkgrel reset, epoch bump, downgrade, a
diff touching build()/package() bodies rather than metadata, upstream
ranges that touch a build-system file, and first introduction. Advisory
only — there is no auto-approval, so a wrong score costs attention and
never safety (§7.3).

Fixes a fixture bug the new tests exposed: digest-drift and
skip-checksum declared bare paths as sources, which parse as local
recipe files rather than remote downloads, so the drift path never
fired. They now use file:// URLs like a real remote would.

tests/notices.rs: integrity_alert is high severity and leaves no
candidate, pin_drift is informational, recipe drift under a static
version is a warning, SKIP-on-non-VCS is a high risk signal, repeated
polling of one drift is one notice, and an I11 sweep over twelve
fixtures proving a change is never silently dropped.
</pre>
</div>
</content>
</entry>
</feed>
