<feed xmlns='http://www.w3.org/2005/Atom'>
<title>aur-build/src/sandbox/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>src,tests: retire the census commentary from the source</title>
<updated>2026-11-22T10:51:45+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-22T10:51:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=053dfbca8a4955a616e9b2c0f5a5d664c0db7aef'/>
<id>053dfbca8a4955a616e9b2c0f5a5d664c0db7aef</id>
<content type='text'>
A gated item used to carry its own defence: why it is `pub` only under
`test-support`, which census once mistook a filename for a caller, why a
wrapper is compiled out rather than deleted. The budget file already
holds those claims and the ratchet already checks them, so the source
keeps the one line that says what the item is.

The module headers stop narrating the refactor that produced them. What
survives is the wire protocol, the git pipe, the poisoned lock that must
be recovered rather than unwedged.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A gated item used to carry its own defence: why it is `pub` only under
`test-support`, which census once mistook a filename for a caller, why a
wrapper is compiled out rather than deleted. The budget file already
holds those claims and the ratchet already checks them, so the source
keeps the one line that says what the item is.

The module headers stop narrating the refactor that produced them. What
survives is the wire protocol, the git pipe, the poisoned lock that must
be recovered rather than unwedged.
</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>pipeline,sandbox,shims: thirty-two more markers the compiler was willing to take</title>
<updated>2026-11-21T19:29:41+00:00</updated>
<author>
<name>dev</name>
<email>dev@example.com</email>
</author>
<published>2026-11-21T19:29:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=bb1d533515c8f63faacb00b3ef59232cf2d4a1c5'/>
<id>bb1d533515c8f63faacb00b3ef59232cf2d4a1c5</id>
<content type='text'>
The whole `shims` module is behind `test-support`, so its thirteen `pub(crate)`
items were invisible to a release build already — but `pub(crate)` still made
each of them part of the crate's interface to every other module, and none of
them had a reader outside the file that declares it. `manifest`, `record`,
`split_version`, `valid_db_arg`, `DB_SUFFIXES` and the nine tool entry points
are now private to `src/shims/mod.rs`, which is where the shim binaries reach
them through the module's own `pub` surface.

`pipeline` went 16 -&gt; 4 and `sandbox` 16 -&gt; 9. Two refusals are worth the
sentence: `SourceIdentity` is the type of the `pub(crate)` field `Ctx::src`, and
a field may not be more reachable than its type, so making it private is the
`private_interfaces` warning rather than a legal narrowing. `provision_request`
is declared inside the private `kata_backend` module and called from the
sibling `#[cfg(test)] mod tests`, and privacy does not cross to a sibling —
E0624. Both are argued in `over_visibility.allowlist` now instead of sitting
unexplained.

`LOW` in `review` is the same sibling case one level up: it lives in the
`pub mod level` nested in risk.rs and the scorer in the parent module reads
`level::LOW`, so `pub(crate)` is the narrowest thing that reaches, given that
this crate does not admit `pub(super)`.

priv 149 -&gt; 117, overwide 21 -&gt; 0 unargued. `cargo check` clean under both
profiles with no new warnings; tests/pipeline.rs, remote_agent.rs, kata.rs,
approve.rs, shims.rs and world.rs pass (62 tests), and `cargo test --test
architecture` is 16 passed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The whole `shims` module is behind `test-support`, so its thirteen `pub(crate)`
items were invisible to a release build already — but `pub(crate)` still made
each of them part of the crate's interface to every other module, and none of
them had a reader outside the file that declares it. `manifest`, `record`,
`split_version`, `valid_db_arg`, `DB_SUFFIXES` and the nine tool entry points
are now private to `src/shims/mod.rs`, which is where the shim binaries reach
them through the module's own `pub` surface.

`pipeline` went 16 -&gt; 4 and `sandbox` 16 -&gt; 9. Two refusals are worth the
sentence: `SourceIdentity` is the type of the `pub(crate)` field `Ctx::src`, and
a field may not be more reachable than its type, so making it private is the
`private_interfaces` warning rather than a legal narrowing. `provision_request`
is declared inside the private `kata_backend` module and called from the
sibling `#[cfg(test)] mod tests`, and privacy does not cross to a sibling —
E0624. Both are argued in `over_visibility.allowlist` now instead of sitting
unexplained.

`LOW` in `review` is the same sibling case one level up: it lives in the
`pub mod level` nested in risk.rs and the scorer in the parent module reads
`level::LOW`, so `pub(crate)` is the narrowest thing that reaches, given that
this crate does not admit `pub(super)`.

priv 149 -&gt; 117, overwide 21 -&gt; 0 unargued. `cargo check` clean under both
profiles with no new warnings; tests/pipeline.rs, remote_agent.rs, kata.rs,
approve.rs, shims.rs and world.rs pass (62 tests), and `cargo test --test
architecture` is 16 passed.
</pre>
</div>
</content>
</entry>
<entry>
<title>src,sandbox,http: three more fields nobody read, and the check that missed them</title>
<updated>2026-11-21T15:50:41+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-21T15:50:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=f5d970494f77d39dadf7c7d5a6a3d70221ca2da2'/>
<id>f5d970494f77d39dadf7c7d5a6a3d70221ca2da2</id>
<content type='text'>
A field scan that printed its first thirty lines missed the rest. Three `pub`
fields were written and never read: `SandboxSpec::disk_mb`, copied off
`cfg.min_free_disk_mb` into a spec no backend consulted — the dispatcher already
checks the disk itself, so the knob stayed live and the plumbing around it was
dead; `SandboxInfo::warm`, computed three ways by three backends and read by
nobody; and `Server::handle`, a `JoinHandle` stored and never joined, which is
what detaching a thread means and so was never load-bearing. All three are gone,
their construction sites with them.

Four more are written-but-never-read on purpose and now say so where they are
declared: `Identity::upstream_pins` and `source_digests` reach the identity
digest through `canonical_json`, not through a name; `VirtualClock::_owner` is
the lease, and holding it unread is the whole mechanism; the `Ab`/`Ba` pair in
`hash`'s canonical-json test exist to be serialized.

`the_test_helpers_are_used` only looked at `pub` items, which left the blanket
`allow(dead_code)` in `tests/common` exactly as able to hide a private helper as
a public one — the objection was fair, and planting
`fn planted_private_helper_never_used()` proved it passed while a dead private
helper sat in the file. It now scans private declarations too, and fails on both
the planted function and a planted struct.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A field scan that printed its first thirty lines missed the rest. Three `pub`
fields were written and never read: `SandboxSpec::disk_mb`, copied off
`cfg.min_free_disk_mb` into a spec no backend consulted — the dispatcher already
checks the disk itself, so the knob stayed live and the plumbing around it was
dead; `SandboxInfo::warm`, computed three ways by three backends and read by
nobody; and `Server::handle`, a `JoinHandle` stored and never joined, which is
what detaching a thread means and so was never load-bearing. All three are gone,
their construction sites with them.

Four more are written-but-never-read on purpose and now say so where they are
declared: `Identity::upstream_pins` and `source_digests` reach the identity
digest through `canonical_json`, not through a name; `VirtualClock::_owner` is
the lease, and holding it unread is the whole mechanism; the `Ab`/`Ba` pair in
`hash`'s canonical-json test exist to be serialized.

`the_test_helpers_are_used` only looked at `pub` items, which left the blanket
`allow(dead_code)` in `tests/common` exactly as able to hide a private helper as
a public one — the objection was fair, and planting
`fn planted_private_helper_never_used()` proved it passed while a dead private
helper sat in the file. It now scans private declarations too, and fails on both
the planted function and a planted struct.
</pre>
</div>
</content>
</entry>
<entry>
<title>sandbox,http,review,watch: keep six more test-only types out of the release build</title>
<updated>2026-11-20T23:39:07+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-20T23:39:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=debb8af0ef0e72048b9df5fed40071745ea40c6b'/>
<id>debb8af0ef0e72048b9df5fed40071745ea40c6b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<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>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>sandbox: agent-sandbox is a backend now, and nerdctl is gone</title>
<updated>2026-11-19T15:45:38+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-19T15:45:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=8dcdce879b51b19603d8163d8a9bfb5f61ff1558'/>
<id>8dcdce879b51b19603d8163d8a9bfb5f61ff1558</id>
<content type='text'>
`sandbox_backend` was a string and `backend_for` matched it with `_ =&gt; loopback`,
so the documented Kata backend was unreachable from configuration: a hub told to
use agent-sandbox would have quietly built untrusted PKGBUILDs as its own user.
The kind now parses, validates, and produces a real `KataBackend` over
`K8sSandboxProvisioner`, with the CR's `runtimeClass`, `activeDeadlineSeconds`,
nonce, image and cluster coordinates all traced back to the config that produced
them.

Kata shares a *backend* per configuration rather than only a listener: it routes
each dial-in by the nonce in its `Hello` into a map that belongs to it, so two
backends on one address would each see half the dial-ins and neither could
complete a rendezvous. The cache key is a digest of the distinguishing fields so
the token and bearer are not copied into a second place.

The containerd/`nerdctl` payload builder is deleted rather than left unused. It
was a second deployment shape with no provisioner, no config path and no live
tier — a builder that advertises a route the configuration refuses is worse than
no builder, because someone will eventually assume the route exists. DESIGN.md
now names one provisioning shape, which is the one that exists.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`sandbox_backend` was a string and `backend_for` matched it with `_ =&gt; loopback`,
so the documented Kata backend was unreachable from configuration: a hub told to
use agent-sandbox would have quietly built untrusted PKGBUILDs as its own user.
The kind now parses, validates, and produces a real `KataBackend` over
`K8sSandboxProvisioner`, with the CR's `runtimeClass`, `activeDeadlineSeconds`,
nonce, image and cluster coordinates all traced back to the config that produced
them.

Kata shares a *backend* per configuration rather than only a listener: it routes
each dial-in by the nonce in its `Hello` into a map that belongs to it, so two
backends on one address would each see half the dial-ins and neither could
complete a rendezvous. The cache key is a digest of the distinguishing fields so
the token and bearer are not copied into a second place.

The containerd/`nerdctl` payload builder is deleted rather than left unused. It
was a second deployment shape with no provisioner, no config path and no live
tier — a builder that advertises a route the configuration refuses is worse than
no builder, because someone will eventually assume the route exists. DESIGN.md
now names one provisioning shape, which is the one that exists.
</pre>
</div>
</content>
</entry>
<entry>
<title>sandbox: the agent listener belongs to the process, not to a build</title>
<updated>2026-11-19T15:32:44+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-19T15:32:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=ec80c312b80ba51271fff0548c6d1e293d373455'/>
<id>ec80c312b80ba51271fff0548c6d1e293d373455</id>
<content type='text'>
`Ctx::new` constructed a backend for every build, and constructing a remote
backend bound the agent listener. With a fixed `listen` — which is what any real
deployment configures, since the operator has to tell the agents where to dial —
the second concurrent build died of EADDRINUSE. A build failing for a reason
that had nothing to do with its package is the worst kind of flake: it looks like
the package's fault.

`RemoteBackend::bind` now shares one bound listener per `(address, token)` for
the life of the process, and hands each backend a clone of the dial-in queue.
That is also what `remote` already meant: an agent dials in when the operator
boots one and whichever build is waiting takes it. The token is part of the key
deliberately — two tokens cannot share a listener, and quietly reusing the first
one's would be a fail-open surprise, so the second bind is attempted and fails
loudly instead.

Backend construction moved out of `Ctx` into `sandbox::backend_for`, so "which
backend" has exactly one answer and the validation guard travels with it. Tests
cover the shared listener, the shared queue (the *second* backend takes the
dial-in), the two-token refusal, and two concurrent `Ctx`es on one address —
with an assertion that a raw second bind still fails, so the test cannot rot
into proving nothing.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`Ctx::new` constructed a backend for every build, and constructing a remote
backend bound the agent listener. With a fixed `listen` — which is what any real
deployment configures, since the operator has to tell the agents where to dial —
the second concurrent build died of EADDRINUSE. A build failing for a reason
that had nothing to do with its package is the worst kind of flake: it looks like
the package's fault.

`RemoteBackend::bind` now shares one bound listener per `(address, token)` for
the life of the process, and hands each backend a clone of the dial-in queue.
That is also what `remote` already meant: an agent dials in when the operator
boots one and whichever build is waiting takes it. The token is part of the key
deliberately — two tokens cannot share a listener, and quietly reusing the first
one's would be a fail-open surprise, so the second bind is attempted and fails
loudly instead.

Backend construction moved out of `Ctx` into `sandbox::backend_for`, so "which
backend" has exactly one answer and the validation guard travels with it. Tests
cover the shared listener, the shared queue (the *second* backend takes the
dial-in), the two-token refusal, and two concurrent `Ctx`es on one address —
with an assertion that a raw second bind still fails, so the test cannot rot
into proving nothing.
</pre>
</div>
</content>
</entry>
</feed>
