jouleclaw-energy: Implausible says what it now means, and a lint CI could not see #353
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/jouleclaw-energy-doc-links"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three things in one crate, all found by reading
cargo docandclippyoutput that no CI step reads.1.
CounterLiveness::Implausibleunderstated itself — my omission#341 made the GPU plausibility bound two-sided, so the variant is now produced for a counter that accrues far less than its board's telemetry says it drew, as well as for one running faster than the board can draw. Its doc comment still described only the fast direction.
That is the defect family this crate keeps surfacing — documentation asserting something narrower than the code does — and here I introduced it. The doc now names both arms, and says which one matters at an energy ceiling: a counter reading low would otherwise be graded as hardware and then spend a budget it is not measuring, while a counter running fast fails safe.
2. A clippy error CI structurally could not see
cargo clippy -p jouleclaw-energywith no features fails-D warningsonvec_init_then_pushatmeter.rs:266.CI's clippy step lints this crate as
--features ioreportonly. With any meter feature on,detect_meterhas several pushes and the lint does not fire. With none, every hardware meter iscfg-ed out and the estimator's push is the only one left — so the default build is a different program, and a lint pass that never compiles it cannot speak for it.The lint is right for that configuration and wrong as a rewrite: with features on, collapsing to
vec![..]would be incorrect. So it is allowed at the function with the reason written down, rather than restructured to satisfy one cfg at the others' expense.3. The blind spot itself
standards-build.ymlnow lints the default build ofjouleclaw-energybeside the featured one, so this class cannot hide there again.Same shape as
check-tests-in-cicatching a test no job runs: a check that compiles one configuration says nothing about the others. Verified both ways — clippy exits 0 with and withoutioreport, and 70 tests pass.What is deliberately not touched
De-linking
plausible_gpu_counter(apub(crate)item, so not linkable from public docs) removes one of this crate's ninecargo docwarnings — the only one inside text this PR corrects.The other eight stay. They link private or platform-gated items in
process.rs, which is#[cfg(target_os = "macos")], and inrapl.rs— so which of them appear depends on the target.cargo docis not part of this workspace's CI gate, and rewriting another author's docs across a cfg boundary from a host that sees only one side of it is how a fix becomes a regression on the other. They are reported here with the cause instead, so the next person gets the context rather than the surprise.How the lint was actually found
Not by a sweep. I ran
clippywithout features while checking something else, and anechoin my own command masked the non-zero exit — so I nearly recorded it as clean. Worth writing down:cmd | grep ...; echo okprintsokregardless, because the status belongs to theecho.🤖 Generated with Claude Code