Skip to content

chore(cargo): adopt resolver 3 and tighten the workspace lint posture (#1836) - #1901

Merged
thiras merged 4 commits into
mainfrom
chore/1836-cargo-lint-posture
Sep 1, 2026
Merged

thiras merged 4 commits into
mainfrom
chore/1836-cargo-lint-posture

Conversation

@thiras

@thiras thiras commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Closes #1836.

Three commits, each self-contained (a lint and the fixes for it land together, or CI goes red). Kept on one branch rather than three stacked PRs because ci.yml triggers only on pull_request: branches: [main] — a stacked PR would run zero checks.

What was decided

The issue listed five findings. Two things came out of investigating them that change it as written:

Finding 1's premise is wrong. The issue says resolver "3" "changes feature-unification behavior for target-specific dependencies". That is what resolver "2" changed, and we already had it. Resolver "3"'s only difference from "2" is MSRV-aware version selection: it defaults resolver.incompatible-rust-versions to fallback. Adopted anyway — nothing resolves differently at 1.95 and Cargo.lock is byte-identical, but it stops a future cargo update pulling a dep that raised its MSRV past the pinned toolchain.

Finding 2's costs were measured, not estimated. A cargo clippy --workspace --all-targets run with every candidate lint enabled, deduped by file:line:

Lint Violations Outcome
dbg_macro / todo / unimplemented 0 deny — pure regression guards
elided_lifetimes_in_paths 16 warn, all fixed
unreachable_pub 46 warn, all fixed
print_stderr 56 deny + 5 targeted #[expect]/#[allow]
print_stdout 68 deny + one CLI crate-root allow
missing_docs 230 warn, all documented
as_conversions 561 rejected — counts casts, does not judge them

Also rejected: clippy::nursery (finding 5). redundant_pub_crate alone has ~500 candidates and is in direct tension with unreachable_pub; significant_drop_tightening has 427 lock sites and is false-positive-prone in async code. And clippy::unreachable — all 7 sites are legitimate, two of them const-eval match NonZeroU64::new(N) { Some(v) => v, None => unreachable!() } where every other escape is already denied or forbidden.

cast_possible_truncation / cast_sign_loss / cast_precision_loss go warn -> deny (finding 3) with zero new violations: CI clippy and the pre-commit hook both pass -D warnings, so all 190 casts were already fatal there. The change is that a bare local cargo clippy now agrees, and the lints can no longer be locally relaxed.

Finding 4 — dev-profile tuning, measured

The workspace's analogue of risk-iq's Argon2 case is scrypt: alloy's signer-keystore runs it on every keystore encrypt and decrypt, on the path of key_gen_e2e, the anvil-e2e journeys, and anvil_settlement_e2e. A/B on the same machine (548 crates recompiled, so the override demonstrably took effect):

baseline KDFs at opt-level = 3 delta
decdn-cli suite (441 tests) 3.787s 3.195s -16%
slowest 4 key_gen_e2e tests 3.07 / 3.04 / 3.02 / 3.00s 2.57 / 2.56 / 2.55 / 2.54s -16%
next 3 key_gen_e2e tests 1.80 / 1.72 / 1.72s 1.40 / 1.38 / 1.34s -22%

About 0.5s per keystore operation. Real and free, but it does not reproduce risk-iq's 33.9s -> 4.9s: the default-feature workspace suite is ~46s for 3110 tests and is bounded by deliberate multi-second timeout tests in client_loopback and node_origin_pull, so 0.6s is inside the noise there. Where it pays is the anvil-e2e jobs, one keygen per journey under 20- and 30-minute timeouts.

risk-iq's other two levers (debug = "line-tables-only", deps debug = false) are not adopted. They trade real debuggability for build wall-clock and interact with CI's cargo llvm-cov nextest instrumented run, so they need their own before/after numbers — a separate measurement, not a lint-posture change.

Notable per-site decisions

  • print_stderr is the awkward one. The 10 sites in common/src/config/mod.rs already carried three comments explaining eprintln! not tracing::warn! — tracing is not initialized at resolve time. They get a function-level #[expect(..., reason = ...)] reusing that rationale rather than a blanket module allow.
  • init_tracing uses #[allow], not #[expect]: its only eprintln! sits under #[cfg(not(feature = "otlp"))], so an --all-features build would find the expectation unfulfilled.
  • Attributes on a bare macro-invocation statement are silently ignored (unused attribute 'expect'), so every print expect sits on the enclosing function.
  • unreachable_pub's 46 fixes came verbatim from cargo clippy --fix; 34 are shared integration-test helper modules where pub was reflex.
  • Three entries in the recorders! macro body needed docs — it forwards $(#[$meta])*, so an undocumented entry generates an undocumented pub fn.

Verification

All four CI clippy invocations, checked by exit code rather than by grepping output:

cargo clippy --workspace --all-targets -- -D warnings                                            # 0
cargo clippy --workspace --all-targets --all-features -- -D warnings                             # 0
cargo clippy -p decdn-incentive --no-default-features -- -D warnings                             # 0
cargo clippy -p decdn-incentive --no-default-features --features buyer-store-core -- -D warnings # 0

Plus cargo fmt --all --check, RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items, cargo deny check, cargo test --doc --workspace, and the decdn-protocol public-api snapshot (158/158, snapshot unchanged — doc comments do not alter the rendered surface).

cargo nextest run --workspace -> 3110 tests run: 3110 passed, 0 skipped, matching the pre-change baseline taken on main at adab0342.

git diff Cargo.lock is empty, as predicted for the resolver change.

Out of scope either way: contracts/test/ed25519-vectors/ is a standalone crate with its own empty [workspace] table, inherits none of these lints, and is linted by no workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_017Dq8ucX9toDdyZdjDbnqBT

thiras and others added 3 commits September 2, 2026 00:22
…#1836)

Resolver 3 changes nothing about feature unification — that was resolver 2,
which the workspace already had. It defaults `resolver.incompatible-rust-versions`
to `fallback`, so cargo prefers dependency versions whose declared `rust-version`
is at or below the pinned 1.95. Cargo.lock is unchanged; the guard is against a
future `cargo update` pulling a dep that raised its MSRV past the toolchain.

New denies: `print_stdout`, `print_stderr`, `dbg_macro`, `todo`, `unimplemented`.
The last three had zero occurrences and are pure regression guards. The `decdn`
CLI allows both print lints at its crate roots because it is a terminal UI; the
production `eprintln!` sites that run before the tracing subscriber exists carry
a per-site `#[expect]` naming that reason. Every library crate and every node
handler is now unable to print.

`cast_possible_truncation` / `cast_sign_loss` / `cast_precision_loss` move from
`warn` to `deny`. Zero new violations: CI clippy and the pre-commit hook both
pass `-D warnings`, so all 190 casts were already fatal there — this only makes
a bare local `cargo clippy` agree. `as_conversions` is deliberately not enabled;
it fires on all 561 `as` casts including the widening ones.

`[profile.dev.package]` raises the keystore KDF crates to `opt-level = 3`.
`alloy`'s `signer-keystore` runs scrypt on every keystore encrypt and decrypt,
and unoptimized scrypt costs ~0.5s per operation: the `decdn-cli` suite goes
3.79s -> 3.20s (-16%), with `key_gen_e2e` itself 16-22% faster.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_017Dq8ucX9toDdyZdjDbnqBT
…1836)

`elided_lifetimes_in_paths` makes a borrowing type path say so at the call
site: `TableDefinition<'_, …>` across `channel_store`'s eleven redb table
definitions, `EvictionContext<'_>` in the cache's admission and eviction policy
traits and their impls, and `HashGroup<'_>` in `bundle_pull` — where the same
type was already spelled `HashGroup<'_>` two lines above and two lines below.

`unreachable_pub` narrows 46 items that were `pub` inside a private module to
the visibility they actually had. 34 are the shared integration-test helper
modules (`node/tests/support`, `cache/tests/util`, `cli/tests/common`), where
`pub` was reflex rather than intent; the rest are `client-pull`'s `progress`
and `ledger` internals, `common`'s `test_support`, and `load_shed`'s
egress-budget helper. No item's real reachability changes — a `pub` in a
private module was never reachable from outside the crate to begin with.

Both fixes are machine-applicable; `cargo clippy --fix` produced the
`unreachable_pub` half verbatim.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_017Dq8ucX9toDdyZdjDbnqBT
…ms (#1836)

230 public items had no doc comment. 170 were struct fields and 24 enum
variants — the shapes rustdoc renders as a bare name with nothing beside it,
which is where the gap actually cost a reader: `ResolvedConfig`'s twelve
sections, `ClientHandlerDeps`' required wiring, the `expected`/`recovered`
pairs on every signature-recovery error, and the operands in `PoolError` that
say why a node refused a voucher.

The `alloy::sol!` generated-code explosion needed no new escape hatch: it
already opts out at its twelve `mod sol_types` wrappers.

Three recorder entries in the `recorders!` macro body also gained docs — the
macro forwards `$(#[$meta])*`, so an entry without one generates an
undocumented `pub fn`.

Every comment added here is link-checked as well: the `doc` gate runs
`cargo doc --document-private-items` under `-D warnings`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_017Dq8ucX9toDdyZdjDbnqBT
Copilot AI lite review requested due to automatic review settings September 1, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are largely policy/documentation/lint-driven with scoped allowances where needed, and no concrete correctness issues were identified in the updated code paths shown.

Pull request overview

This PR updates the workspace’s Cargo + lint configuration to adopt Cargo resolver v3 (MSRV-aware resolution) and tighten the workspace lint posture (docs, visibility, printing, numeric casts), with targeted code/documentation updates across crates to satisfy the new lint set. It also tunes dev-profile optimization for keystore/KDF dependencies to speed up test-heavy workflows.

Changes:

  • Switch workspace to resolver = "3" and document the MSRV-aware fallback behavior.
  • Enable/raise workspace lints (missing_docs, unreachable_pub, elided_lifetimes_in_paths, print/todo/dbg/cast denies) and adjust code (docs, lifetimes, visibilities, per-site #[expect]/#[allow]) accordingly.
  • Optimize select crypto/KDF dependencies in dev builds (opt-level = 3) to reduce e2e/keygen test latency.
File summaries
File Description
crates/reputation/src/local.rs Add rustdoc for public config/errors and enum fields to satisfy missing_docs.
crates/protocol/src/message.rs Document public error variant fields for missing_docs.
crates/protocol/src/framing.rs Add variant docs to framing error type.
crates/node/tests/support/mod.rs Narrow visibility of test helpers and add scoped #[expect] for stderr diagnostics.
crates/node/tests/node_origin_pull.rs Add scoped #[expect] for intentional stderr diagnostics in tests.
crates/node/src/serve_economics.rs Add doc comment on MarginPolicy::new inputs/semantics.
crates/node/src/selection.rs Add docs for public fields on RankedCandidate.
crates/node/src/runtime/reload.rs Document ReloadSnapshot field semantics.
crates/node/src/runtime/eviction.rs Fix elided lifetime in EvictionContext<'_> usage and add field docs.
crates/node/src/pool_view.rs Add docs to lifecycle enum variants/fields.
crates/node/src/metrics.rs Add docs for recorder macro entries (and new probe/connection recorders).
crates/node/src/main.rs Add per-site #[expect] and rationale for process-boundary eprintln!.
crates/node/src/load_shed/state.rs Add docs for constructor semantics.
crates/node/src/load_shed/resource_pressure.rs Add docs for constructor semantics.
crates/node/src/load_shed/mod.rs Add docs for enums/trait method.
crates/node/src/load_shed/egress.rs Add docs for EWMA seeding behavior.
crates/node/src/load_shed/controller.rs Narrow helper visibility (pub(super)) and document controller construction.
crates/node/src/handlers/probe.rs Document ALPN constant and handler constructor intent.
crates/node/src/handlers/dht.rs Document ALPN constant.
crates/node/src/handlers/client/mod.rs Add extensive docs for ClientHandlerDeps fields and ALPN constant.
crates/node/src/dht/capacity_bond_registry.rs Document registry handle fields.
crates/node/src/commands/mod.rs Add scoped #[expect] for early-startup eprintln!; clarify tracing init allowances.
crates/node/src/channel_store.rs Fix elided lifetimes in TableDefinition<'_, ...> and related signatures.
crates/node/src/chain_events/shared_head.rs Add docs to trait method contract.
crates/node/src/binding_check.rs Document BindingReport field.
crates/node/src/admin.rs Document admin wiring structs/constructors.
crates/incentive/src/voucher.rs Document public struct fields and error fields.
crates/incentive/src/swap_venue.rs Document venue variants and mock venue fields/helpers.
crates/incentive/src/stream_sig.rs Document error fields.
crates/incentive/src/rate.rs Document underpayment error operands.
crates/incentive/src/probe_sig.rs Document error fields.
crates/incentive/src/lane.rs Document public error operands in PoolError.
crates/incentive/src/eth_identity.rs Add scoped #[expect] for interactive stderr prompts.
crates/incentive/src/capability.rs Document public struct fields and error operands.
crates/incentive/src/bind_sig.rs Document bad-length error field.
crates/e2e/src/chain.rs Document deployed-contract address fields.
crates/common/src/identity.rs Add doc comment for fresh_secret_key.
crates/common/src/config/resolved.rs Document resolved-config structs and enums for missing_docs.
crates/common/src/config/mod.rs Add scoped #[expect] on early-resolve functions that intentionally eprintln!.
crates/common/src/config/errors.rs Document ConfigErrorBag::new.
crates/common/src/cli/setup.rs Document flattened CLI args grouping.
crates/common/src/cli/publish.rs Document flattened CLI args grouping.
crates/common/src/cli/pool.rs Document flattened CLI args grouping.
crates/common/src/cli/node.rs Add docs for CLI enums/flattened args and subcommand fields.
crates/common/src/cli/fetch.rs Document flattened fetch args grouping.
crates/common/src/cli/config_cmd.rs Document subcommand/flattened args fields.
crates/common/src/cli/common.rs Narrow test-support helper visibility (pub(crate)).
crates/common/src/cli/bundle.rs Document subcommand/flattened args fields.
crates/client-pull/src/scheduler.rs Add scoped #[expect] for test-only stderr calibration diagnostic.
crates/client-pull/src/progress.rs Narrow internal helper types/functions to pub(crate) and fix lint expectations.
crates/client-pull/src/pacer.rs Add docs for ramp pacer fields.
crates/client-pull/src/lib.rs Document public error/struct fields to satisfy missing_docs.
crates/client-pull/src/ledger.rs Narrow constant visibility and align with unreachable_pub posture.
crates/client-pull/src/discovery.rs Document enum variant fields.
crates/cli/tests/common/mod.rs Narrow test helper visibility (pub(crate)).
crates/cli/tests/bundle_create.rs Add scoped #[expect] for skip-path stderr diagnostic.
crates/cli/src/main.rs Allow stderr at binary crate root for top-level error boundary.
crates/cli/src/lib.rs Allow stdout/stderr at CLI library crate root (terminal UI exception).
crates/cli/src/known_chains.rs Document chain-address fields.
crates/cli/src/commands/config.rs Document enum variant field.
crates/cli/src/commands/chain_ctx.rs Document resolved chain context fields.
crates/cli/src/commands/bundle_pull.rs Fix elided lifetime in Vec<HashGroup<'_>>.
crates/cache/tests/util/mod.rs Narrow test util visibility (pub(crate)).
crates/cache/src/policy/tinylfu.rs Add docs + fix EvictionContext<'_> lifetime.
crates/cache/src/policy/sketch.rs Add docs for public methods.
crates/cache/src/policy/mod.rs Add docs and fix EvictionContext<'_> in trait signature.
crates/cache/src/policy/lru.rs Add docs + fix EvictionContext<'_> lifetime.
crates/cache/src/engine.rs Add test-only helper docs for policy wiring assertions.
crates/bao-range/src/ranged_store.rs Add module docs + define RangedStoreError with documented variants.
crates/bao-range/src/lib.rs Add brief module doc for ranged_store.
crates/bao-range/src/conformance.rs Add docs for conformance factory trait and associated types.
CONTRIBUTING.md Document resolver v3 rationale and updated lint posture.
CLAUDE.md Mirror updated lint posture and contributor guidance.
CHANGELOG.md Record lint posture/resolver/profile changes in changelog.
Cargo.toml Switch to resolver 3, tighten workspace lints, and add dev-profile opt-level overrides for KDF deps.
Review details
  • Files reviewed: 75/75 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Coverage report

Total: 82.66% (was 82.66%, ● 0.00%) — 71260/86212 lines

File Coverage Lines Δ
crates/bao-range/src/conformance.rs 100.00% 229/229 ● 0.00%
crates/bao-range/src/ranged_store.rs 91.67% 11/12 ● 0.00%
crates/cache/src/engine.rs 92.91% 4718/5078 ▼ 0.06%
crates/cache/src/policy/lru.rs 98.92% 92/93 ● 0.00%
crates/cache/src/policy/sketch.rs 97.01% 325/335 ● 0.00%
crates/cache/src/policy/tinylfu.rs 99.06% 211/213 ● 0.00%
crates/cli/src/commands/bundle_pull.rs 52.12% 553/1061 ● 0.00%
crates/cli/src/commands/chain_ctx.rs 91.50% 560/612 ● 0.00%
crates/cli/src/commands/config.rs 87.08% 795/913 ● 0.00%
crates/cli/src/known_chains.rs 86.75% 72/83 ● 0.00%
crates/cli/src/main.rs 64.10% 25/39 ● 0.00%
crates/client-pull/src/discovery.rs 96.34% 789/819 ● 0.00%
crates/client-pull/src/ledger.rs 97.06% 793/817 ● 0.00%
crates/client-pull/src/lib.rs 89.66% 1743/1944 ● 0.00%
crates/client-pull/src/pacer.rs 99.06% 211/213 ● 0.00%
crates/client-pull/src/progress.rs 98.71% 153/155 ● 0.00%
crates/client-pull/src/scheduler.rs 92.66% 1325/1430 ● 0.00%
crates/common/src/cli/common.rs 81.08% 60/74 ● 0.00%
crates/common/src/cli/fetch.rs 96.22% 178/185 ● 0.00%
crates/common/src/cli/node.rs 100.00% 5/5 ● 0.00%
crates/common/src/cli/publish.rs 96.43% 27/28 ● 0.00%
crates/common/src/config/errors.rs 95.42% 146/153 ● 0.00%
crates/common/src/config/mod.rs 97.10% 6996/7205 ● 0.00%
crates/common/src/config/resolved.rs 100.00% 42/42 ● 0.00%
crates/common/src/identity.rs 88.76% 395/445 ● 0.00%
crates/e2e/src/chain.rs 13.72% 229/1669 ● 0.00%
crates/incentive/src/bind_sig.rs 87.60% 113/129 ● 0.00%
crates/incentive/src/capability.rs 98.92% 184/186 ● 0.00%
crates/incentive/src/eth_identity.rs 88.06% 317/360 ▲ +0.28%
crates/incentive/src/lane.rs 94.54% 952/1007 ● 0.00%
crates/incentive/src/probe_sig.rs 97.47% 231/237 ● 0.00%
crates/incentive/src/rate.rs 96.17% 176/183 ● 0.00%
crates/incentive/src/stream_sig.rs 97.66% 209/214 ● 0.00%
crates/incentive/src/swap_venue.rs 96.03% 339/353 ● 0.00%
crates/incentive/src/voucher.rs 99.30% 284/286 ● 0.00%
crates/node/src/admin.rs 92.53% 978/1057 ● 0.00%
crates/node/src/binding_check.rs 61.43% 43/70 ● 0.00%
crates/node/src/chain_events/shared_head.rs 93.72% 179/191 ● 0.00%
crates/node/src/channel_store.rs 88.24% 1778/2015 ● 0.00%
crates/node/src/commands/mod.rs 0.00% 0/58 ● 0.00%
crates/node/src/dht/capacity_bond_registry.rs 81.28% 686/844 ● 0.00%
crates/node/src/handlers/client/mod.rs 94.84% 2501/2637 ▼ 0.11%
crates/node/src/handlers/dht.rs 77.04% 292/379 ● 0.00%
crates/node/src/handlers/probe.rs 86.45% 287/332 ● 0.00%
crates/node/src/load_shed/controller.rs 100.00% 106/106 ● 0.00%
crates/node/src/load_shed/egress.rs 100.00% 46/46 ● 0.00%
crates/node/src/load_shed/mod.rs 100.00% 21/21 ● 0.00%
crates/node/src/load_shed/resource_pressure.rs 100.00% 102/102 ● 0.00%
crates/node/src/load_shed/state.rs 100.00% 87/87 ● 0.00%
crates/node/src/main.rs 0.00% 0/24 ● 0.00%

Showing top 50 of 59 changed files — see the workflow Step Summary for the full table.

History
Commit Total Δ vs base
4747eb4 82.66% ▼ 0.01%
56950a0 (HEAD) 82.66% ● 0.00%

…es (#1836)

Review of #1901 found ten doc comments added by the `missing_docs` commit that
state something false. Bulk-documenting 230 items is exactly where that gets
introduced, so each fix below was checked against the code, not the neighbours
it was copied from.

Wrong, now corrected:

- `ClientHandlerDeps::local_populate` described waiting on an in-flight fill.
  It is the local fs/http/s3 origin pull-through deadline (`populate_local`),
  independent of `pull_through`.
- `node_id` claimed it is echoed in signed responses. `StreamResponseBody` has
  no node-id field; the handler uses it only in `Debug`.
- `max_concurrent_streams` said "across all connections". The semaphore is
  built inside `serve(conn)`, so it is per connection.
- `eth_signer` claimed it signs lane bindings. It signs the `slash_sig` on a
  `StreamResponse`; bindings are verified, never signed.
- `receipt_sink` said "completed deliveries". One receipt per accepted
  voucher, so a delivery emits several.
- `max_blob_size_bytes` described the pull leg's received-bytes rule. The
  field it annotates is the serve gate, checked against the inspected size,
  and `0` disables it.
- `redeem_hint` invented an accrual threshold; the hint fires on every
  accepted voucher, and `None` means no settlement service is wired.
- `pull_through` / `pull_through_origin` overstated what `None` disables.
- `RateError::Underpayment`'s `paid`/`bytes` are per-voucher deltas, not
  cumulative.
- `RampPacer::floor` said "one chunk in practice". It is `PULL_WINDOW_FLOOR`
  — one chunk plus three chunk groups — and the constant's own comment plus a
  dedicated test exist to explain why one chunk deadlocks.
- `FetchArgs::common` said "shared with `decdn fetch`" on `decdn fetch`
  itself, and named output handling, which lives on a sibling field.
- `FrameError::Varint` listed "empty"; an empty buffer reads as truncated.
- `ContractAddrs`: `PublisherRegistry` holds namespace ownership, not vetting
  state; `OriginAssignment` seats operators as origins for a publisher's
  namespaces, not the inverse; ADR 026 has no `§2`.

Two lint escapes were wider than the thing they excuse:

- `init_tracing`'s `#[allow(clippy::print_stderr)]` spanned the whole
  function, including the `LogLevelSetter` closure that runs on SIGHUP long
  after `registry.init()`. Scoped to the `#[cfg(not(feature = "otlp"))]` block.
- `crates/cli/src/main.rs` took a crate-root `#![allow]` for one unconditional
  `eprintln!`. Now a function-level `#[expect]`, matching `decdn-node`'s.

`resolve_security_into`'s `#[expect]` reason claimed tracing is never
initialized at config-resolve time. It also runs from
`runtime::reload::SecuritySection::resolve` on SIGHUP, where a subscriber is
live — so its warnings reach boot stderr but not an operator's structured log
stream. Reason corrected and the gap filed as #1902.

Also: `egress_budget_bps` has one same-file caller, so it is private rather
than `pub(super)`; three docs sat after their attribute; `bao-range` had the
same module doc twice; the "twelve `mod sol_types` wrappers" claim was wrong
(ten are wrappers, the rest opt out elsewhere); and the hard-coded cast counts
are gone from `Cargo.toml` and `CHANGELOG.md` — the argument holds without
numbers nothing regenerates.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_017Dq8ucX9toDdyZdjDbnqBT
@thiras
thiras merged commit 0fa98c9 into main Sep 1, 2026
27 checks passed
@thiras
thiras deleted the chore/1836-cargo-lint-posture branch September 1, 2026 22:40
alpergundogdu added a commit that referenced this pull request Sep 2, 2026
Merge of main brought #1901's tightened lint posture (missing_docs,
unreachable_pub); the doctor submodules are private, so their items are
crate-internal, not public API.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
alpergundogdu added a commit that referenced this pull request Sep 2, 2026
* feat(cli): scaffold decdn node doctor (types, args, exit semantics)

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* feat(cli): doctor report rendering (human checklist + json)

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* feat(cli): doctor config check via resolve_config

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* feat(cli): doctor disk & cache-budget check (statvfs vs eviction high-water)

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(cli): scope useless_conversion allow for statvfs block-count width

fsblkcnt_t is u32 on macOS (u64::from is a real widening) but u64 on
64-bit Linux glibc (identity conversion), so `u64::from(stat.blocks())`
trips clippy::useless_conversion on Linux CI while staying silent on
macOS. Add a narrowly-scoped allow with a one-line justification on
each conversion; keep u64::from over `as u64` per prior guidance.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* feat(cli): doctor on-disk state check (node.secret, keystore, redb)

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(cli): doctor state checks for keystore is_file and receipt log

- Fix keystore finding to distinguish file vs non-file (Warn if exists but not regular file)
- Add receipt log check using decdn_common::config::RECEIPT_LOG_FILE constant
- Add tests for receipt log absent and present scenarios

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* feat(cli): doctor chain check (rpc, chain_id, contract code)

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(cli): redact provider/transport errors in doctor chain findings

RPC and get_code_at errors on the unreachable/DNS/TLS failure path embed
reqwest's Display, which includes the request URL (and any API key in its
path/query) verbatim. The doctor report is printed directly, not through
sanitize_err_chain, so route both error sites through it before building
the Finding detail.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* feat(cli): doctor origin check (http HEAD, fs stat, s3 shape)

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* feat(cli): doctor port bindability check

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* feat(cli): doctor live enrichment (health + metrics footprint)

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* test(cli): end-to-end decdn node doctor offline json report

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* test(cli): cover doctor state branches; live.rs skip-finding consistency

Extract pure evaluate_redb/evaluate_receipts/evaluate_keystore helpers
out of check_state (mirroring evaluate_secret) and unit-test their
branches directly. Make probe_live push a Pass "live checks skipped"
Finding when admin_url resolution or client construction fails, matching
the existing client.health()-failure Pass path. Drop the unused _dir
param from the config.rs test helper. Note in report.rs that JSON `ok`
tracks Fail-count only, not --strict.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(cli): document doctor public items; harden state stat errors, metric parse, json ok

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(cli): pub(crate) for doctor submodule items (unreachable_pub)

Merge of main brought #1901's tightened lint posture (missing_docs,
unreachable_pub); the doctor submodules are private, so their items are
crate-internal, not public API.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cargo.toml review: findings from comparing against risk-iq workspace config

2 participants