Repository navigation
Conversation
Measure the workspace under the proposed final lint configuration and fix every finding the core crate reports, so the configuration layer can be adopted without a source avalanche behind it. The bulk is `missing_const_for_fn`: 50 signatures gain `const`, plus the five helpers they transitively call. Making a mutation helper `const` required its callees (`FairnessTracker::reset`, `clear`, `set_config` and `ConnectionState::set_fairness`) to become `const` too; the cascade stops at `after_low`, which only calls into `reset`. The rest are small, behaviour-preserving idiom fixes: - `ok_or` with an eager `format!`-style allocation becomes `ok_or_else`. - `if let`/`else` selection becomes `Option::map_or`/`map_or_else` in the codec EOF builder, the scheduler waiter lookup, the panic formatter and the connection registry retain closure. - Shadowed bindings are renamed to say what they hold: `io_error`, `codec_error`, `protocol_error`, `rejected`, `prepared_shutdown`, `prepared_app`, `configured_pacing`, `total_body_len`, `expected_sequence`, `paced_writer`. - `&str::to_string()` becomes `to_owned()`, `Direction` patterns use `Self::`, and `Option<Arc<ServerError>>` uses `Arc<Self>`. - The `fetch_update` discard becomes `.ok()`, and the debug assertion in the supervisor observer gains a message. `src/testkit/slow_io.rs` and `src/testkit/support.rs` needed their use sites updated alongside the renames: the validated configuration and the paced writer handles are now driven through the names that actually hold the values. Co-Authored-By: Claude Code <noreply@anthropic.com>
The core crate was already clean under the proposed final Clippy table, but the helper crates still carried 72 findings, so the workspace as a whole could not yet adopt it. `wireframe_testing` and `wireframe-verification` now report zero findings against the same strict configuration. Most were mechanical: `const fn` where the body already qualified, `to_string` on a `&str` becomes `to_owned`, and `option_if_let_else` rewrites that read as `let`-`else` rather than `unwrap_or_else` because the success arm is itself a `Result`. The remainder were shadowed bindings. Each is renamed to say what the new value actually is (`resolved_capacity`, `declared_len`, `contender_barrier`, `startup_handle`) so the reader can tell the converted value from the parameter it came from. `record.args()` returns `&str`, so the log assertions no longer allocate a `String` per record to call `contains`. `push_benchmark_support/measurement.rs` moves to `measurement/mod.rs` to satisfy `self_named_module_files`; the sibling `measurement/` directory already held its submodules. The two `unsafe impl GlobalAlloc` blocks remain. `GlobalAlloc` members are intrinsically unsafe and `unsafe_code = "forbid"` cannot be escaped by `#[expect]` (E0453), so that conflict belongs to the lint-configuration layer, not here. Co-Authored-By: Claude Code <noreply@anthropic.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
Contributor
Reviewer's GuideThis PR completes source remediation for the core and helper-crate lint censuses: it adds the eligible const APIs, rewrites idiom and conversion cases to eliminate suppressions, restructures helper modules and tests, and introduces injectable environment lookup while intentionally leaving only the documented GlobalAlloc unsafe boundary for follow-up. Sequence diagram for injectable SERVER_ADDR lookupsequenceDiagram
participant Run as run
participant Env as DefaultEnv
participant Parser as parse_server_addr
participant Server as WireframeServer
Run->>Env: raw
Env-->>Run: Result<String, VarError>
Run->>Parser: parse_server_addr(addr)
alt lookup fails
Parser-->>Run: DEFAULT_ADDR
else configured address
Parser-->>Run: SocketAddr
end
Run->>Server: bind(SocketAddr)
Flow diagram for checked network-prefix encodingflowchart TD
Input["u64_to_bytes"] --> Convert["convert_len_to_value"]
Convert --> Endian{"Endianness"}
Endian --> Big["write_big_endian_prefix"]
Endian --> Little["write_little_endian_prefix"]
Big --> Fits["ensure_fits_prefix"]
Fits -->|fits| Encode["write_network_u64"]
Fits -->|too wide| Error["ERR_FRAME_TOO_LARGE"]
Encode --> Output["prefix bytes"]
Little --> Output
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This was referenced Oct 23, 2026
leynos
changed the base branch from
main
to
harden-lint-self-named-modules-20261022
October 23, 2026 15:29
leynos
added this pull request to stack #802
October 23, 2026 15:31
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the source-remediation half of the lint train. This layer sits on top
of #798 and clears the two remaining bodies of findings: the core crate's
missing_const_for_fn/ idiom census, and the helper crates'wireframe_testingandwireframe-verificationcensuses.It does not adopt the final lint tables. It makes the source clean enough that
adopting them cannot produce a source avalanche — which is the point of the
ordering.
Position in the stack
Review only the two commits below; everything above is #795-#798. This PR's
base is
harden-lint-self-named-modules-20261022, the #798 branch, so the diffit shows is exactly those two commits (61 files, +258/−230). It merges after
#798 into
main; it is not independently mergeable.What changed
39a548f— core crate idiom census. 57 signatures insrc/gainconst fn, taking that directory from 228 to 285, including the five helpersthe cascade reaches (
FairnessTracker::reset,clear,set_config,ConnectionState::set_fairness). The rest are small behaviour-preserving fixes:ok_orwith an eager allocation becomesok_or_else;if let/elseselectionbecomes
map_or/map_or_elsein the codec EOF builder, scheduler waiter lookup,panic formatter and connection registry; shadowed bindings are renamed to say
what they hold;
&str::to_string()becomesto_owned();Directionpatternsuse
Self::;Option<Arc<ServerError>>usesArc<Self>.4515f8f— helper-crate census. Thewireframe_testingandwireframe-verificationfindings, plus theself_named_module_filesmoves thatturn
measurement.rsintomeasurement/mod.rs.Across the two commits, 79
const fnsignatures are added and none removed.No
#[allow]is added and no suppression is introduced:git diffover thisrange adds zero
#[allow]and zero#[expect].The stack as a whole also reduces suppression. Counting every
#[expect]inthe tree,
origin/mainhas 70 and4515f8fhas 60; the ten removed aremulti-line
#[expect(attributes replaced by source that no longer needs them.The remaining suppressions are pre-existing policy exceptions (
deprecatedcompatibility helpers, poisoned-lock
unwrap_used) and are untouched here.What is deliberately still outstanding
Two files retain
unsafecode, and they are the onlyunsafecode in the tree:wireframe_testing/src/benchmark_alloc_support.rsbenches/codec_performance_alloc.rsBoth implement
unsafe impl GlobalAllocfor a counting allocator. That isunrepairable by rewriting:
GlobalAllocand theSystem::alloccalls inside itare unsafe by definition, and
unsafe_code = "forbid"admits no exemption(the
#[expect]is rejected withE0453). The other nine prose occurrences ofthe word "unsafe" in the tree are documentation.
This is escalated rather than suppressed: see #804, which recommends isolating
the impl in a small audited boundary crate, forbidding unsafe in every other
Cargo target root, and covering the boundary with Miri (which does honour a
custom global allocator). #804 also records an interim shape that reaches
forbidon 89 of 91 target roots immediately.Reviewer entrypoints
39a548ffor the core crate; start withsrc/fairness.rsandsrc/client/pool/for theconstcascade, which is the only part withtransitive effects.
4515f8ffor the helper crates.self_named_module_filesmoves are pure file moves plus one importpath each.
The renames that matter for review correctness are
prepared_shutdown,prepared_app,configured_pacing,io_error,codec_error,protocol_error,total_body_len,expected_sequenceandpaced_writer.Each replaced a shadowed binding that reassigned a value of a different type or
meaning to an existing name.
Onboarding disposition
None of the five train onboardings is implemented or claimed here. The dev-fast
build standard, CV-005, the Markdown baseline, the shared Whitaker installer and
the tidied
typos-config-builderall belong to the configuration and canonlayers. This layer only touches Rust source, and the helper crates change no
Make target, workflow or manifest.
Validation evidence
Restacked onto
origin/main=b194531, which moved three commits since thestack was first published, including
#794's toolchain bump tonightly-2026-10-22. All five layers were replayed with the user-wideweavemerge driver disabled; each rebase was verified against a driver-free
merge-treereplay rather than trusted.Two conflicts in this layer, both caused by
#794adopting a new API where thislayer had rewritten the same expression:
src/client/pool/lease.rs—#794renamedfetch_updatetotry_update.Resolution keeps this layer's intent (the update always yields
Some, so thediscarded result carries an explaining comment) on the new name.
src/server/runtime/startup.rs— the new toolchain no longer firesinteger_division_remainder_usedinsidetokio::select!, so#794deleted the#[expect]this layer had been preserving. Resolution keeps the rename anddrops the now-dead
#[expect].Both resolutions remove code rather than add it.
The local gate sequence is running on
4515f8fonnightly-2026-10-22. Thissection will carry its results before the PR leaves draft. Because this head
contains all five layers, its result is the evidence for the whole stack, and
the four PRs below point here rather than repeating a per-layer run.
Hosted, at this head.
build-testran at4515f8fand every one of its 17substantive steps passed: Format, Install Whitaker, Lint, Lint Markdown,
Spelling, Mermaid, workflow contracts, feature-gate compile checks, and Test
and Measure Coverage.
https://github.com/leynos/wireframe/actions/runs/39974035999/job/120483866980
The instrumented run executed 1207 tests, 1207 passed, 0 skipped, and the
ratchet reported 87.85% current against the committed 87.8% baseline — an
improvement of 0.05 pp, read from the job log rather than inferred from the
job conclusion.
That run is still narrower than the Make targets:
cargo llvm-cov nextest --workspacetakes default features and default targets, so there is no--all-targets, no--all-features, and no doctest pass. The local sequencebelow closes that gap.
Known baseline failures
None known at this head. The census lives in the companion ledger.
Deferred work
unsafe_code = "forbid"can apply workspace-wide #804 — theunsafe_code/GlobalAllocboundary extraction.adoption safe.
Whitaker's Make invocation still lacks
--workspace. Both belong to theenforcement layer.
References
unsafe_code = "forbid"can apply workspace-wide #804 — isolate the unsafe allocator sounsafe_code = "forbid"can applyworkspace-wide.
/home/leynos/docs/leynos-wireframe/rust-baseline/2026-10-15/train-ledger.md.e8c17f1c
🤖 Generated with Claude Code
Summary by Sourcery
Clean the core and helper crates’ remaining lint census findings so the stricter lint baselines can be adopted without source churn.
Enhancements:
Chores: