From 2ed254f5487613e00dae4ee15dc63500c4edcce2 Mon Sep 17 00:00:00 2001 From: aur-build Date: Fri, 20 Nov 2026 21:22:56 +0000 Subject: docs: record the test-surface movement in the census report and README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The census report gets a second movement next to the first. The numbers: pub 505 -> 484, dead 105 -> 84, test-only 72 -> 48, pub(crate) 109 -> 119, globs still zero. Two budget increases are recorded rather than smoothed over, because both are consequences of narrowing and a reader is entitled to know which numbers moved the wrong way and why: - sandbox.deadonly 0 -> 2. `Provisioner` and `ProvisionRequest` are named by nobody outside sandbox but 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. - db.deadonly 8 -> 9. Five state enums each have a `can_transition`. Three went private with their tests; ReleaseState's and SubscriptionState's are consulted by nothing at all, so the name slid from test-only to dead-only instead of disappearing. Both carry a NOTE already. `largest` went 603 -> 673 because eleven config tests moved into src/config.rs. It is reported and not budgeted: a line ceiling that counts a module and its tests together would penalise the exact act this goal was for. README's Testing section was stale in a way only a test move exposes — it named `versions::vercmp_matches_the_system_oracle`, a test that does not exist under that name in either location — and said nothing about where a test belongs. Both fixed, with the reason stated: a test outside a module can only reach what the module exports, so a fixture-free test in tests/ is a door held open by a test. --- tools/arch-census.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'tools') diff --git a/tools/arch-census.md b/tools/arch-census.md index 9dc52ae..ce0647c 100644 --- a/tools/arch-census.md +++ b/tools/arch-census.md @@ -153,3 +153,58 @@ are again return types, not orphans. Every other budget in `tests/architecture-budget.json` is at or below its task-1 value, and the ratchet test fails on any increase. + +--- + +## Second movement: the test surface + +The first movement closed interfaces by deleting exports nothing reached. The +second closed them by moving tests home, because a test that sits outside a +module can only reach what the module exports — so every fixture-free test in +`tests/` was quietly holding a door open. + +| | pub | dead | dead-only | pub(crate) | glob | largest file | +|---|---|---|---|---|---|---| +| after the first movement | 505 | 105 | 33 | 109 | 0 | 603 src/shims/mod.rs | +| after the second | 484 | 84 | 36 | 119 | 0 | 673 src/config.rs | + +`pub` fell 505 → 484 and test-only items fell 72 → 48. The 48 that remain are +not an oversight: `tools/test-surface.md` gives each one a disposition and a +reason, and 33 of them are `residue` — items production needs inside their own +module *and* a fixture-bound integration test needs from outside, which Rust +cannot express as anything other than `pub` because it has no test-conditional +visibility. + +`dead-only` rose 33 → 36, and both increases are consequences of narrowing +rather than of anything being forgotten: + +- **sandbox 0 → 2.** `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. Narrowing + them means narrowing that provisioner, which means those tests stop + constructing it. +- **db 8 → 9.** Five state enums each have a `can_transition`. Three became + private when their tests moved into the module; the other two — + `ReleaseState` and `SubscriptionState` — are consulted by nothing at all, so + the name moved from test-only to dead-only rather than disappearing. Both + carry a NOTE saying they are dead tables for machines nothing enforces. + +`pub(crate)` rose 109 → 119 for the same reason it rose before: closing an +interface raises that count, which is why it is reported and not budgeted. + +The largest file is now `src/config.rs` at 673 lines, up from 603. It grew +because eleven config parsing tests moved into it, not because the module grew +more capable. `largest` is reported and not budgeted for exactly that reason — +counting lines across a module and its tests measures the wrong thing, and a +ceiling on it would discourage moving tests home, which is the whole movement. + +### What the ratchet now also holds + +`tests/architecture.rs` gained `the_test_surface_is_disposed_of`, which runs +`tools/test-surface.py` and fails if any test-only item lacks a hand-written +disposition reason, or if any disposition count exceeds +`tests/architecture-budget.json`. `tools/arch-census.py --write-budget` now +preserves the `test_surface` section instead of erasing it: two tools writing +one file must not delete each other's axis, or the ratchet quietly stops +checking one of them. -- cgit v1.2.3