| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Five http items were being counted as test-pinned on the strength of a
string alone, and are now `pub(crate)`:
render::Attention the word appears in crash.rs inside a message
Res::html "text/html" is a content type, not a call
Res::redirect "redirect" appears in an assertion message
routes::logout "/logout" is a route path
routes::route "mutating route" appears in an assertion message
Nothing in the test tier calls any of them; each carries a comment saying
so, because "the census said a test needed this" is not a reason and will
be re-asked by the next person to read the line.
`config::TestHooks` was already half-gated — the `hooks` field and the
`Default` line that fills it are both behind `test-support` — while the
type and its impl were not, so a release binary compiled a struct it
could never construct, read, or deserialize. Now gated whole.
The live kata tier moved into `src/sandbox/kata.rs`. It is not a fixture
test: it records its own absence without /dev/kvm or AUR_KATA_API, the
same way the vercmp live tier does. It was the only thing outside the
module naming `K8sSandboxProvisioner` field by field, so that struct is
`pub(crate)` now too.
One correction to the table, and it is the kind of correction a heuristic
deserves: `http::cookie` and `http::login` were classified `move-test`
because their tests contain no harness keyword. They do — `Web::` starts a
real HTTP listener, and a test that talks to one is not a unit test
however little code it holds. The detector now knows that, and both items
are residue, which is what they always were.
http: 27 pub -> 22 pub. Test-only items across the crate: 52 -> 46.
Suite: 284 passed, 0 failed, 0 ignored. Clippy clean.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Six db items are now gated behind `test-support`, each with a comment
saying what it is for and why production never calls it:
builds::claim production leases a batch; `claim_batch` is
what the dispatcher runs
settings::set_setting the readers are used, the setter is not
Writer::shutdown the server runs until the process ends
snapshots::snapshot_by_commit
world::world_members production writes world snapshots, never
reads one back member by member
invariants::unapproved_index_entries
gated, not relocated: reading it needs this
module's private helpers, and widening those
to let a test out would be the wrong trade
Gating them exposed three things they were the only user of, and each is
gated with them rather than left compiling into a binary that cannot reach
it: `Msg::Shutdown` and its loop arm, and `model::json_or`.
`arch-census.py --write-budget` also stopped erasing the `test_surface`
section — two writers of one file must not delete each other's axis, or
the ratchet quietly stops checking it.
`steps::touch` is deleted, not narrowed. Nothing called it — not
production, not a test. The census had credited it to `tests/shims.rs`,
where the word appears inside a string.
In sandbox, two tests moved into `src/sandbox/kata.rs`: the container
record a lease provisions, and the TTL expiry of a sandbox that never
dials in. Neither builds a fixture. `KataBackend::shared_for`,
`provision_request`, `sandbox_cr` and `K8sSandboxProvisioner::for_config`
are `pub(crate)` as a result.
`KataBackend::reclaim` is deleted — same story as `touch`. It forwarded to
`self.provisioner.reclaim`, which the reaping site already calls itself,
and the TTL test the census credited it for implements the *trait's*
`reclaim` on a null provisioner. Same word, different function.
Two honest costs, both recorded rather than smoothed over:
- `Provisioner` and `ProvisionRequest` are now named by nobody outside
`sandbox`, yet cannot be narrowed: `LocalAgentProvisioner` is `pub`
because two fixture tests construct it, and Rust forbids a public type
implementing a private trait or taking a private parameter type.
`sandbox.deadonly` therefore rises 0 → 2, with the reason here as the
ratchet demands.
- `agent_sandbox_config()` now exists in both `tests/kata.rs` and
`src/sandbox/kata.rs`. Three of that file's remaining tests still need
it, and a test helper cannot be shared across the crate boundary without
making it public again.
sandbox: 27 pub / 15 dead -> 22 pub / 10 dead.
Suite: 284 passed, 0 failed, 0 ignored. Clippy clean.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The census could say which `pub` items nothing outside their module
names, and which of those a test names. It could not say what to do about
them, because the two questions that actually decide it are ones a
raw-source name match cannot answer:
Does a test *call* it, or merely mention it inside a string?
Does production code *inside* the declaring module call it?
`tools/test-surface.py` asks both, and `tools/test-surface.md` records the
answer for all 61 items. Four dispositions, each with a hand-written
reason kept in `tools/test-surface-reasons.json`:
gate (9) production never calls it; a test does
move-test (9) the test that names it builds no fixture, so it is a
unit test in the wrong file
narrow (6) no test calls it at all — census false positives, the
name appears only inside a string literal
residue (34) stays pub, and the honest column
`residue` needs saying out loud. Rust has no test-conditional visibility:
no attribute makes an item `pub` under one feature and `pub(crate)` under
another, and `pub use` cannot re-export a `pub(crate)` item. An item that
production needs *inside* its own module and a fixture-bound integration
test needs from outside cannot be narrowed without breaking one side or
the other. That is not a gap in this analysis; it is a gap in the language,
and the way to close those 34 rows is to change the tests — move them into
the module, or exercise the behaviour through the module's real entry
point — not to invent a visibility that does not exist.
So the column is ratcheted rather than wished away.
`the_test_surface_is_disposed_of` fails if any row lacks a hand-written
reason, and if any count — including `gate_pending`, items decided to be
gated but not yet gated — exceeds its budget. It can only shrink.
Two census limitations surfaced and are now written down rather than
silently trusted: "module" means the top-level directory, so an item used
only from a sibling file in the same module reads as dead; and mentions
are matched over raw source, so a string counts as a reference. Six items
were being counted as test-pinned on the strength of a string alone.
No source file is edited here. This is the decision record the next
commits apply.
Suite: 284 passed, 0 failed. Release build: zero warnings.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ten tests in tests/versions.rs were unit tests of pkgver wearing an
integration test's clothing: the comparison vectors, the chunk rule, the
epoch rules, the dependency grammar, the constraint checks, the recorded
oracle. None of them touched a database or a fixture. They were written
against the crate's public API because that was the only way to reach
them from outside, and that single fact — that a test had to import a
name to exercise it — is what had been keeping five items public:
vercmp_string, Dep, DepOp, Dep::satisfied_by, split_full_version
All five are private now. `vercmp_string` is called by `vercmp` and by
nothing else; `Dep` and `DepOp` are the internals of `dep_names`, which
*is* used in production; `satisfied_by` and `Dep::name` are used only by
this module's tests, so they are gated rather than merely private, and
`cargo check --release` without the test-support feature compiles clean,
which is the proof that nothing production needs them was left behind.
The oracle test now resolves testcorpus/ through CARGO_MANIFEST_DIR
rather than the harness helper, so it no longer depends on the working
directory. The live pacman differential came with it and stays gated on
AUR_LIVE_VERCMP, recording its absence the same way.
What remains in tests/versions.rs is two tests that genuinely need the
harness: they build a package, publish it, and move its upstream.
pkgver: 14 pub / 5 test-only -> 8 pub / 0 test-only.
Suite: 281 passed, 0 failed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The census report gets its after-table, and the README's Layout gets rewritten
— it had drifted into fiction, listing `db/queries.rs`'s successors as "queries"
and omitting `usecase`, `error`, `hash`, `time`, `urlutil`, `git`, `fetch` and
`recipe` entirely. It now states the ranks and says plainly that they are
enforced by `tests/architecture.rs`, not kept in hope, and names the two
commands that keep it true.
This commit also carries the last of the narrowing that fell out of writing the
report, because writing it meant actually reading the numbers:
- `watch::upstream::resolve` looked test-only and was not — the tests contain an
unrelated local function of the same name, which the census matches as a word.
It is crate-internal and now says so.
- `read_tree` closed with it. Its two integration tests were testing the module's
own batching behaviour from outside, so they moved inside as unit tests with a
throwaway git repo, which is where a test about one `ls-tree` and one
`cat-file --batch` belongs. They lost nothing: the empty-blob and NUL-byte
assertions came across verbatim, plus one the old test never made — binary
blobs are still listed, just not read.
- `Assessment::is_high`, `Tree::get`, `approve::current_accepted` and
`diff::full_recipe_text` were dead once their callers closed, and are gone.
- `set_risk_for_tests` is gone too. The bulk-refusal test needed a candidate
marked high-risk, and the honest way to get one was for the fixture to write
the row — `Env::execute` — rather than the library growing a public setter
that exists only so a test can pass. That was the last budget above baseline
apart from `error.pub`.
`error.pub` stays at 21 against a baseline of 15, and the report says why: the
six payload enums are constructed in four modules and matched in `error`, so
they are interface. `error.dead` is 0.
Final: 281 passed / 0 failed across 36 binaries (baseline 273), clippy
-D warnings clean, release clean, census within budget.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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
-> release N is X, not published (Refused::WrongState's shape)
illegal candidate transition a → b for review 7
-> ... for candidate 7 (it is a candidate id; "review"
was misleading)
no candidate 7 to resolve -> candidate 7 (Missing::Candidate's shape)
lease artifact n-v: store bytes hash to A but the index says B
-> source n-v hashed to A but the candidate recorded B (shares
Guard::DigestMismatch with the source-cache check)
vcs_cache clone URL: err -> upstream: vcs_cache clone URL: err
(TransientCause::Upstream tag)
error.pub 15->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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`watch::detect` was performing review's write protocol by hand: look up the
accepted release, upsert the candidate, assess the risk, store the risk, work
out the missing dependencies, store those. Six calls that only make sense in
that order, issued from a module whose job is noticing that an upstream moved.
Get the order wrong and nothing complains — the candidate just quietly has no
risk score, and the reviewer approves it without one.
`review::intake::record` is the protocol now. The watcher hands over what it
observed and review decides what it means. `missing_deps` moved with it: it
computes a risk signal, which is a review question that happened to be living
in the watcher.
`accepted_for` was not a review question either. It reads a pointer column off
the pkgbase row, so it is now `db::accepted_release_for` — the watcher asks
persistence what is currently accepted, rather than asking review as a favour.
With intake owning the write path, three things became internal and closed:
`upsert_candidate`, `risk::assess`, and the risk/missing-deps column setters.
`approve::approval_for` was a pass-through to db that only the pipeline called;
it is gone, and the pipeline now asks `review::reads::{candidate, approval}` —
two named facts instead of a re-export of review's storage layout.
The budget rose in two places and both are moves, not growth: db.pub 201->202
is `accepted_release_for` arriving from review, and review.test 4->5 is
`set_risk_for_tests`, the one place a fixture still needs to force a score.
review.pub itself is unchanged at 29 — four names added, four removed.
`priv` was also dropped from the budget keys. Counting `pub(crate)` items
against a ceiling was backwards: closing an interface raises that number, so a
budget that punishes it punishes the work. The Rust test never checked it.
277 passed / 0 failed, clippy -D warnings clean, and every detect, approve and
staleness assertion intact.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
db handed out 226 items and 36 of them were named by nobody at all — not by
the crate, not by the tests. Making them private is the whole of this commit,
but the interesting part is what the compiler said afterwards.
Twenty-five closed cleanly. Eleven did not, and they are the ones worth
writing down: AuditRow, NoticeRow, PackageRow, Subscription, StepRow,
Unbuilt, OpenReview, ReviewSubject, Migration, Writer, predecessors. None is
named outside db, yet none can be made private, because a public query
returns them and callers bind them with `let` and call methods on them.
They are load-bearing and invisible to a name search. So the census's `dead`
count means "the name is never written outside the module", which is a lead
rather than a verdict, and the census now says so: the way to find out which
flagged items are real is to privatize them and let rustc answer. Those
eleven are budgeted with that reason, not zeroed to make a number look good.
Nineteen items turned out to be dead code rather than merely unexported —
set_release, set_candidate, set_pkgbase, set_profile, set_kind,
current_state, index_pkgbase_drift, wal_stats, call_for_tests, put_notice,
is_ours, list_pkgbases, set_unpinable, artifact_id_by_digest_in,
subscription_poll_interval, the four never-emitted notice kinds, and
StateEnum::as_str, which the impl_state_enum macro was required to define
for all five enums while nothing called it through the trait. Privatizing
is what proved they were unused; leaving them private-but-present would have
just hidden dead code behind a narrower address.
Ten items became pub(crate): the Writer actor's call/tx/send surface,
Readers, the StateEnum trait, json_or, predecessors, DEFAULT_SETTINGS.
`Db.readers` was named nowhere outside db, so the field closed with the type.
db: 226 pub / 36 dead-only -> 201 pub / 11 dead-only. 277 passed / 0 failed,
clippy -D warnings clean, schema_ownership and architecture green.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Four greps in tests/layers.rs were the entire enforcement. They could say
that db had stopped naming http; they could not say what the architecture
is, could not place a new module, and said nothing about the twenty-odd
modules nobody had tripped over yet.
tests/architecture.rs declares the whole map instead. Every module in src/
gets a rank with the reason it sits there, and a module may name only
modules ranked strictly below it — one rule, every module, cycles
impossible by construction rather than by luck. The census says the graph
already satisfies it, so the map is a description of what is true, not an
aspiration the suite immediately fails on.
The same file holds the interface budgets, because a boundary is only as
strong as what it refuses to let you export: per module, how many pub items
it hands out and how many of them nothing outside the module names. Budgets
live in architecture-budget.json and move one way. A number that grows
fails; a number that got smaller without being written back also fails,
which is what stops a won gain from quietly becoming the new ceiling.
Each rule was probed rather than trusted: naming http from db fails with
`db (rank 3) names http (rank 9)`, tightening db.pub to 200 fails with
`db.pub: 226 > 200`, and leaving a stale budget fails with
`db.deadonly: budget 99, actual 36`.
tests/layers.rs is deleted, not weakened. Three of its four rules are rank
consequences now (db, review, recipe all sit below everything they were
forbidden to name); the fourth, watch -> shims, was already covered by
production_surface.rs, which greps every non-shim file for shims:: and
would catch it in any module, not just watch.
The census definition now lives in two languages, so the test checks them
against each other the way the vercmp oracle checks the hand-written
comparator: without python3 the note prints and the suite moves on.
277 passed / 0 failed (273 + 8 new - 4 subsumed), clippy -D warnings clean.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An interface is only as narrow as the items a module hands out, and nobody
had counted them: 585 pub items across 27 modules, 146 of which nothing
outside their own module ever names. That is not an interface, it is a hole
in the module boundary, and every one of them is a thing a later refactor
cannot change without a grep across the crate.
The census counts pub items per module, how many of them are dead, how many
of those a test does name (the integration tests are separate crates, so a
name only they use is genuinely pub and the honest thing is to count it
rather than pretend it is private), the glob re-exports that flatten a
namespace, and the crate:: edge set between modules.
The edge set is already acyclic, which is the useful surprise: a layer map
can be declared over the graph as it stands rather than after breaking
something. It also says where the width is — db hands out 226 items, http 68
of which 54 are dead — so the work has an order.
Baseline for all of it: 273 tests passing, clippy -D warnings clean, release
build clean.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
137.9s and 7,017 execs became 121.3s and 4,616, with the 1,090 vercmp spawns
gone entirely. Short of the 105s and 3,500 target: what is left is fsync on the
scratch filesystem and the mirror clone/fetch cluster, neither of which these
four changes were allowed to touch.
|
| |
|
|
|
| |
Sandbox::default was a hand-written derivable_impl, and copy_tree borrowed an
owned PathBuf.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
The differential against pacman's vercmp is the suite's second biggest
process cost, and its verdicts are a function of two strings plus the pacman
that produced them. They are recorded in testcorpus/vercmp-oracle.tsv now and
compared in process on every run, antisymmetry of the table included. The live
differential is still there - AUR_LIVE_VERCMP=1 runs it and says so when it is
not run.
|
| | |
|
|
|
The suite spends most of its time waiting, so wall time alone hides what
actually changes when the harness improves. This records wall, descendant
cpu, and a successful-execve census (PATH probes excluded) in one run, and
appends a row to tools/suite-cost.md.
|