| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
m-2. `hosts` existed twice, verbatim, in `review::diff` and `review::risk`. The
duplication that matters is the other one: "did the executable part of the
recipe change" also existed twice, with *different* semantics. The risk scorer
compared everything from the first function definition onward; the diff panel
compared only the lines that name a function, so a `build()` rewritten to
`curl … | sh` under the same function names told the risk scorer "code changed,
high" and told the reviewer nothing at all — the one reader who could have
caught it. Both questions now have one answer: `urlutil::hosts` (which also
strips the `git@` from ssh URLs, so a scheme change stops crying "new source
host" wolf) and `recipe::bodies_changed`, in the module that owns the recipe.
m-4. The three review decisions each hand-built an `AuditEntry` literal, and
their `detail` shapes drifted: approve recorded the identity hash, reject
recorded only the note, withdraw only the reason — so for two of the three the
log cannot answer which candidate bytes the decision was about. `AuditEntry` is
built by `::human` / `::system` now, and reject records the identity hash it
rejected.
m-3, the four-times-copied 21-column candidate `SELECT`, was already gone: the
`CANDIDATE_COLS` constant came with moving the candidate SQL into `db/` in an
earlier commit.
Tests: the body rule is pinned at the unit level with the exact drift case
(same function names, different body), `tests/production_surface.rs` fails if
either module grows a private copy again or if an audit row is hand-built, and
the reject test reads its own audit row back and requires the identity in it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
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).
|