| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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.
|