clippy: no workspace reports an error, and the unsafe FFI states its contract #241

Merged
dcharlot merged 1 commit from fix/clippy-sweep into main 2026-10-14 01:11:18 -04:00
Owner

Three of the seventeen workspaces could not be linted at all. A deny-level clippy lint errored in each, and clippy stops at the first erroring crate, so every lint behind it went unreported — which is also why the earlier count of this work was far too low: the number only appears once the errors are gone.

None of the ten errors was a bug. Each is fixed anyway, because an error masks the next one:

where lint resolution
jouleclaw-loader-gguf, -contract, -runtime erasing_op 0 * stride spells the shared kv head (MQA) and the (row, col) cell address, mirroring the hh * s beside it — kept, lint allowed, reason recorded
jouleclaw-backend-apple, ssm approximate_constant truncated SQRT_2/LN_2 where the constant is the point (softplus(0) = ln2) — now std::f32::consts, and exact
jouleclaw-bounded, -outlier, -tools, joule-ui-core approximate_constant 3.14 as an arbitrary test value; given a value not near pi (in -tools the decimal is the format assertion's subject, so input and expectation moved together)
jouleclaw-policy-ipc never_loop parse_args looped, but every arm returns or exits — if let says what happens
smart-byte-edv almost_swapped s.sequence = cur assigned the field to itself; update takes a document at its current sequence and bumps it, so the no-op was dead and the comment ("bump twice") described neither
jcp-schema infallible TryFrom Error = Infallible, carried to From with #[serde(from = ...)] so the wire still normalises the top of the lattice

wai-rs: 19 unsafe extern "C" entry points stated no safety contract, beside neighbours that did. Each now names what its caller must guarantee, per pointer, derived from its own signature.

Verified on the build host

  • all 17 workspaces lint with zero errors (3 could not complete before)
  • the tests of every crate whose values changed pass, including the SQRT_2 swap that alters a numeric input
  • wai-rs builds, lints and documents; origins_wire_normalizes_on_deserialize still pins the lattice normalisation

Not in this change

The remaining 2084 warnings are cosmetic — collapsible if, unnecessary blocks, doc-list indentation, needless_range_loop — and 1842 of them are in jouleclaw alone. That is a churn-versus-tidiness call across twelve workspaces with four PRs open, so it is left to the owner rather than bundled here.

🤖 Generated with Claude Code

Three of the seventeen workspaces could not be linted at all. A deny-level clippy lint errored in each, and clippy stops at the first erroring crate, so every lint behind it went unreported — which is also why the earlier count of this work was far too low: the number only appears once the errors are gone. **None of the ten errors was a bug.** Each is fixed anyway, because an error masks the next one: | where | lint | resolution | |---|---|---| | `jouleclaw-loader-gguf`, `-contract`, `-runtime` | `erasing_op` | `0 * stride` spells the shared kv head (MQA) and the (row, col) cell address, mirroring the `hh * s` beside it — kept, lint allowed, reason recorded | | `jouleclaw-backend-apple`, `ssm` | `approximate_constant` | truncated `SQRT_2`/`LN_2` where the constant is the point (`softplus(0) = ln2`) — now `std::f32::consts`, and exact | | `jouleclaw-bounded`, `-outlier`, `-tools`, `joule-ui-core` | `approximate_constant` | `3.14` as an arbitrary test value; given a value not near pi (in `-tools` the decimal is the format assertion's subject, so input and expectation moved together) | | `jouleclaw-policy-ipc` | `never_loop` | `parse_args` looped, but every arm returns or exits — `if let` says what happens | | `smart-byte-edv` | `almost_swapped` | `s.sequence = cur` assigned the field to itself; `update` takes a document at its current sequence and bumps it, so the no-op was dead and the comment ("bump twice") described neither | | `jcp-schema` | infallible `TryFrom` | `Error = Infallible`, carried to `From` with `#[serde(from = ...)]` so the wire still normalises the top of the lattice | `wai-rs`: 19 unsafe `extern "C"` entry points stated no safety contract, beside neighbours that did. Each now names what its caller must guarantee, per pointer, derived from its own signature. ### Verified on the build host - all **17** workspaces lint with **zero errors** (3 could not complete before) - the tests of every crate whose values changed pass, including the `SQRT_2` swap that alters a numeric input - `wai-rs` builds, lints and documents; `origins_wire_normalizes_on_deserialize` still pins the lattice normalisation ### Not in this change The remaining **2084** warnings are cosmetic — collapsible `if`, unnecessary blocks, doc-list indentation, `needless_range_loop` — and **1842** of them are in `jouleclaw` alone. That is a churn-versus-tidiness call across twelve workspaces with four PRs open, so it is left to the owner rather than bundled here. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
clippy: no workspace reports an error, and the unsafe FFI states its contract
All checks were successful
lockfiles / every Cargo.lock is current (pull_request) Successful in 49s
standards workspaces build + test / arl-rs (pull_request) Successful in 1m9s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m56s
standards workspaces build + test / jcp-rs (pull_request) Successful in 2m15s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 1m11s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m13s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m30s
standards workspaces build + test / sense-rs (pull_request) Successful in 1m7s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m24s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 4m7s
WAI conformance / quantum core and corpus under wasm32-wasip2 (wasmtime) (pull_request) Successful in 2m14s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 14s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 8m51s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 9s
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 2m4s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m12s
wai-pack / wai-pack · does this change touch it (pull_request) Successful in 4s
wai-web reach builds / wai-web reach · does this change touch it (pull_request) Successful in 4s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 1m12s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 2m54s
wai-pack / wai-pack · macos (pull_request) Successful in 3m51s
wai-pack / wai-pack · linux (pull_request) Successful in 1m16s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 17m27s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 22s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 3m56s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m16s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m45s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m4s
9ffef885f0
Three workspaces could not be linted at all: a deny-level clippy lint errored,
and clippy stops at the first erroring crate, so everything behind it went
unreported. None of the ten errors was a bug; each is fixed so it cannot mask
the next.

  jouleclaw-loader-gguf, jouleclaw-contract, jouleclaw-runtime: `0 * stride`
  spells the shared kv head (MQA) and the (row, col) cell address, mirroring
  the `hh * s` beside it. Kept, with the lint allowed and the reason written
  down, rather than dropping a term that documents which head is read.

  jouleclaw-backend-apple, jouleclaw-loader-gguf/ssm: a truncated SQRT_2 and
  LN_2 where the constant is what is meant -- `softplus(0) = ln2` is the
  assertion's whole point. Now `std::f32::consts`, which is also exact.

  jouleclaw-bounded, jouleclaw-outlier, jouleclaw-tools, joule-ui-core: 3.14
  as an arbitrary test value, which clippy reads as an attempt at pi. Given a
  value that is not near pi; in jouleclaw-tools the decimal is the subject of
  the format assertion, so expectation and input moved together.

  jouleclaw-policy-ipc: `parse_args` looped, but every arm returns or exits,
  so it could only ever run once. `if let` says what happens.

  smart-byte-edv: `s.sequence = cur` assigned the field to itself. `update`
  takes a document at its current sequence and bumps it, so the no-op was
  dead and the comment above it ("bump twice") described neither. Removed;
  the comment now states the mechanism the test relies on.

  jcp-schema: `Origins`'s `TryFrom<OriginsWire>` had `Error = Infallible`.
  Carried over to `From` with `#[serde(from = ...)]`, so the normalisation
  that keeps the top of the lattice single-encoded still runs on the wire --
  `origins_wire_normalizes_on_deserialize` pins it.

wai-rs: 19 unsafe `extern "C"` entry points stated no safety contract, beside
neighbours that did. Each now names what its caller must guarantee, per
pointer, from its own signature.

Verified on the build host: all 17 workspaces lint with zero errors; the tests
of every crate whose values changed pass; wai-rs builds, lints and documents.

Co-Authored-By: Claude Opus 5 <[email protected]>
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!241
No description provided.