From 92742f0e5d336547d8d72464e2df0ff1c4f2d337 Mon Sep 17 00:00:00 2001 From: aur-build Date: Sat, 21 Nov 2026 14:21:43 +0000 Subject: tests,tools: hold the dead-code zero in the ratchet, and prove the checks bite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `dead_code.deadonly` is 0 for all 28 modules and the allowlist names the 18 items that stay `pub` by decision, so the remaining question is whether the ratchet can be broken quietly. Three tests close that. `the_dead_code_budget_matches_the_code` refuses a budget that contradicts itself: `modules..deadonly` is what `interfaces_stay_within_budget` reads and `dead_code.deadonly.` is what `tools/arch-census.py --budget` reads, and both must equal the census — an edit to one alone is how a widening enters unnoticed. `the_dead_code_allowlist_names_real_items` refuses an entry whose item the module no longer declares, which is the permission that lets a deleted item return. `the_budget_writers_preserve_each_other` runs both writers against a copy of the file and fails if either erases the section it does not own, or rewrites the hand-written allowlist — the failure mode two tools sharing one file were always going to have. Each was checked by breaking it on purpose: a raised budget, a stale allowlist key, and a writer that drops the allowlist all fail loudly and pass again when reverted. README now says `--list-dead` exists and that a kept item is allowed by name in the budget file, because a ratchet nobody can inspect is not a ratchet. --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 18e256c..5fb41b1 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ Two tools keep this honest, and both are meant to be run, not read once: ``` cargo test --test architecture # ranks, no cycles, no globs, interface budgets -python3 tools/arch-census.py # the numbers, and --budget to check the ratchet +python3 tools/arch-census.py # the numbers; --list-dead names them, --budget checks the ratchet ``` ## Testing without root, network, or a real chroot @@ -256,4 +256,7 @@ These are not suggestions: items it hands out, and how many of them nothing outside the module ever names. Budgets may only shrink — a number that grows fails the suite, and a number that quietly got smaller has to be written back at the lower value. - `tools/arch-census.py` prints the same numbers for a human to read. + `tools/arch-census.py` prints the same numbers for a human to read, and + `--list-dead` names every item behind them. A `pub` item that stays `pub` + without an outside reader is allowed only by name, in the same budget file, + with the reason beside it. -- cgit v1.2.3