check: no library source file is unreachable from its crate root #142

Merged
dcharlot merged 2 commits from sandbox/meter-delta-read into main 2026-10-13 06:37:24 -04:00
Owner

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. Zero tests. And runtime/mod.rs does not declare it — so it has never been compiled, by anything, ever.

Why an orphan 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 — 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 × a guess, apportioned by invented fractions — energy derived from a performance proxy, which is precisely what the metering ladder exists to grade against.

Worth naming separately: the per-subsystem split. Four fields reading as four independent observations when all four are fractions of one number is precision standing in for measurement, and it invites per-subsystem conclusions nothing here could support.

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

A planted orphan must fail the check; removing it must pass. The CI step repeats that self-test on every run, so the guard cannot quietly stop gating. Exit codes were verified without a pipe — $? after | head is head's status, which is exactly how a gate stops gating unnoticed.

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.

What I deliberately did not do

energy.rs 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 get wired up or deleted is not mine to decide. 20k lines is someone's work, and the guard stops the problem growing either way.

🤖 Generated with Claude Code

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. Zero tests. And `runtime/mod.rs` does not declare it — so it has **never been compiled, by anything, ever.** ## Why an orphan 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** — 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 × a guess, apportioned by invented fractions — energy derived from a performance proxy, which is precisely what the metering ladder exists to grade against. Worth naming separately: the per-subsystem split. Four fields reading as four independent observations when all four are fractions of one number is **precision standing in for measurement**, and it invites per-subsystem conclusions nothing here could support. ## 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 A planted orphan must fail the check; removing it must pass. The CI step **repeats that self-test on every run**, so the guard cannot quietly stop gating. Exit codes were verified without a pipe — `$?` after `| head` is head's status, which is exactly how a gate stops gating unnoticed. 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. ## What I deliberately did not do `energy.rs` 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 get wired up or deleted is not mine to decide. 20k lines is someone's work, and the guard stops the problem growing either way. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
check: no library source file is unreachable from its crate root
All checks were successful
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 2m31s
standards workspaces build + test / aac-rs (pull_request) Successful in 1m12s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 54s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 39s
standards workspaces build + test / map-rs (pull_request) Successful in 35s
standards workspaces build + test / mesh-rs (pull_request) Successful in 26s
standards workspaces build + test / openpay (pull_request) Successful in 1m33s
jouleclaw public surface must stay documented / Public-surface audit (jouleclaw-rs) (pull_request) Successful in 58s
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no comparison (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no company or product (pull_request) Successful in 3s
no-vanity-metrics / No new orphan source files (pull_request) Successful in 4s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m54s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m26s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m15s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m12s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m39s
standards workspaces build + test / arl-rs (pull_request) Successful in 2m14s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 2m47s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m41s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 2m41s
standards workspaces build + test / sense-rs (pull_request) Successful in 2m34s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 4m22s
7a82d53469
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]>
dcharlot force-pushed sandbox/meter-delta-read from 7a82d53469
All checks were successful
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 2m31s
standards workspaces build + test / aac-rs (pull_request) Successful in 1m12s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 54s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 39s
standards workspaces build + test / map-rs (pull_request) Successful in 35s
standards workspaces build + test / mesh-rs (pull_request) Successful in 26s
standards workspaces build + test / openpay (pull_request) Successful in 1m33s
jouleclaw public surface must stay documented / Public-surface audit (jouleclaw-rs) (pull_request) Successful in 58s
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no comparison (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no company or product (pull_request) Successful in 3s
no-vanity-metrics / No new orphan source files (pull_request) Successful in 4s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m54s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m26s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m15s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m12s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m39s
standards workspaces build + test / arl-rs (pull_request) Successful in 2m14s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 2m47s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m41s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 2m41s
standards workspaces build + test / sense-rs (pull_request) Successful in 2m34s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 4m22s
to 0c0b66f001
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
2026-10-10 09:54:56 -04:00
Compare
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!142
No description provided.