check: no library source file is unreachable from its crate root #142
Merged
dcharlot
merged 2 commits from 2026-10-13 06:37:24 -04:00
sandbox/meter-delta-read into main 2026-10-10
jouleclaw-jcp: wire in two orphaned modules, and six tests that never ran
All checks were successful
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 7m1s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 14s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 14m24s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 8s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 25s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 48s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 1m54s
wai formal verification (integer core) / kani (pull_request) Successful in 5m55s
WAI HTTP delivery / cache rules · controls and labelled caches (pull_request) Successful in 1m6s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 1m5s
WAI neural decoders end-to-end / synthetic fixtures → Rust decode → reference (±4) (pull_request) Successful in 1m9s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m11s
wai-pack / wai-pack · does this change touch it (pull_request) Successful in 4s
wai-pack / wai-pack · linux (pull_request) Has been skipped
wai-pack / wai-pack · linux-arm64 (pull_request) Has been skipped
wai-pack / wai-pack · macos (pull_request) Has been skipped
wai-pack / wai-pack · independent verifier (Python) (pull_request) Has been skipped
wai-pack / wai-pack · the floor through a media prober (pull_request) Has been skipped
wai-pack / wai-pack · dependency licences (pull_request) Has been skipped
WAI section references / cited sections exist (pull_request) Successful in 11s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 4m34s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 2m58s
workflow hygiene / every workflow supersedes its own queue (pull_request) Successful in 4s
WAI HTTP delivery / HTTP corpus · falsification and differential (pull_request) Successful in 1h26m50s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m47s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 7m12s
wai cross-architecture byte-equality / macos-arm64 (reference) (pull_request) Successful in 28s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 10m18s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 29s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 3m15s
Rebasing the orphan-source guard over 817 commits of main found two new orphans
immediately, which is the clearest argument for the check that I could have
asked for. `jouleclaw-jcp/src/skill.rs` and `src/stack.rs` — 557 lines — are not
declared anywhere: `lib.rs` names only `mod tests`.
They were never abandoned, only never wired. Declaring them compiles clean, and
brings **six tests** alive that had never once executed:
skill::a_failing_pressure_test_blocks_registration_with_failures_on_record
skill::a_granted_skill_loads_after_passing_pressure
skill::a_tampered_document_is_a_different_audience
stack::a_tight_ceiling_keeps_cheap_queries_cheap
stack::the_default_stack_answers_behind_a_grant
stack::the_grant_is_the_budget_authority_across_walks
Those are not incidental. They assert that a tampered document resolves to a
different audience, that a grant is the budget authority across walks, and that
a failing pressure test blocks registration — tamper-detection and
grant-authority properties, written down, compiled never, run never. All 15
tests in the crate now pass.
Baselining them would have been the wrong move and is worth saying why: the
guard exists to stop growth, so pinning code that arrived *after* the baseline
would have converted it from a ratchet into a record of defeat. The baseline
stays at the original 25, all in `jouleclaw-omni`, which are a different
question — 20k lines whose disposal is the owner's call, not a two-line `mod`
declaration.
Also in this commit, from the original change: the orphan check itself, its CI
job with a self-test that fails closed, and a corrected header on
`jouleclaw-omni/runtime/energy.rs`, which documented itself as measuring energy
via IOReport while multiplying `getrusage` CPU seconds by a fixed 15 W and
apportioning the result 60/20/20 across subsystems.
Re-verified on today's main after the rebase: the self-test still fails closed
with a planted orphan and passes without one, exit codes checked without a pipe,
and the ratchet reports the pinned 25 unchanged.
Co-Authored-By: Claude Opus 5 <[email protected]>
check: no library source file is unreachable from its crate root
Going after the meters turned up a worse instance of a family this repo keeps finding. `jouleclaw-omni/src/runtime/energy.rs` documents itself as measuring "actual GPU, CPU, ANE and DRAM energy consumption in joules using Apple's IOReport framework". It does not call IOReport. The macOS path multiplies `getrusage` CPU seconds by a fixed 15 W; the other path multiplies wall-clock by 45 W; each then splits the result 60/20/20 across subsystems by constant fractions. It has **zero tests**, and `runtime/mod.rs` does not declare it — so it has never been compiled, by anything, ever. That is the strongest member of the family. A feature-gated test with no `--features` reports zero tests; a platform-gated meter on a single-platform runner compiles out; a conformance suite in `main()` gets built and never run. An orphan source file does not even type-check. It is invisible to cargo check, cargo test, clippy and every conformance suite simultaneously, and it cannot fail because nothing asks it anything. The hazard is the next reader, not the dead code. A real meter with a per-rail liveness gate already lives in the same workspace (`jouleclaw-energy`); someone who trusts this file's header and wires it in instead gets CPU-seconds times a guess, apportioned by invented fractions — energy derived from a performance proxy, which is the thing the whole metering ladder exists to grade against. So: `scripts/check-orphan-sources.py`, wired into the hygiene workflow. The per-subsystem split is worth naming separately — four fields reading as four independent observations when all four are fractions of one number is precision standing in for measurement, and it invites conclusions nothing here supports. **Measured, not estimated.** 1659 library sources checked; 25 orphans, all in `jouleclaw-omni`, 19,964 lines never compiled. Every other crate is clean. My first pass said 77 — it counted `src/bin/*.rs`, which cargo auto-discovers, so the exclusions are part of the check rather than a convenience. The baseline was then generated by the detector instead of retyped, because hand-copying it pinned 15 of 25 and the check caught the other ten. Falsified in both directions before being trusted, and the CI step repeats the self-test on every run: a planted orphan must fail the check, and removing it must pass. Exit codes verified without a pipe — `$?` after `| head` is head's status, which is how a gate silently stops gating. The baseline pins today's 25 so this does not go red on a pre-existing condition, and names what the file falsely claims. Removing an entry is the point; adding one is a regression to argue for in a commit message. `energy.rs` itself gets a corrected header and nothing else. I had added a declared `EnergyBasis` to it and reverted that: the field made the orphan stop compiling, and a broken orphan is worse than an honest one. Whether those 25 files are wired up or deleted is not mine to decide — 20k lines is someone's work, and the guard stops the problem growing either way. Co-Authored-By: Claude Opus 5 <[email protected]>