chore(lints): activate 4 Phase-7 trait/generic/dispatch lints (Phase 7f, refs #287)#291
Merged
Conversation
…7f, refs #287) Promote 4 clippy lints to active enforcement in `Cargo.toml [workspace.lints.clippy]`: * `too_many_arguments = "deny"` (default threshold=7) * `trait_duplication_in_bounds = "deny"` * `wrong_self_convention = "deny"` * `multiple_bound_locations = "warn"` Each gets a trailing-comment cross-reference to the relevant section of `docs/architecture/code-quality/trait_policy.md` (added in Phase 7g — PR #290). The new lints are grouped under a banner comment delineating the Phase-7f cluster from the surrounding complexity / clone-family lints. `clippy.toml` gains a paragraph in the test-relaxations comment block explaining that the four new lints follow the same "prod stays strict, tests are exempt" pattern as the Phase 5 panic-family and Phase 6 clone/alloc-family lints, with cross-references to `trait_policy.md` and the `scripts/dev/trait_generic_audit.sh` audit script. Workspace clippy run before promotion: zero diagnostics from any of the 4 lints (already at default warn or allow with zero hits). This commit only changes the **lint level**; workspace remains green. Existing per-site annotations carry forward: * 19 `#[expect(clippy::too_many_arguments, reason = "…")]` sites in uffs-cli (3), uffs-core (8), uffs-daemon (1), uffs-mft (7), all already justified before the promotion. API impact: zero. Behavior change: zero. Refs: #287
This was referenced May 19, 2026
githubrobbi
added a commit
that referenced
this pull request
May 19, 2026
…-default regression guard (Phase 8e, refs #295) (#296) Post-Phase-8 audit found that `cargo check --workspace --no-default-features` (playbook §996, the second of the four required Phase 8 validations) was never run during Phase 8. Doing so reveals 6 items reachable only when feature X is on but not themselves `#[cfg(feature = "X")]`-gated. Under strict CI (`-D warnings`) all 6 would have hard-failed. Source fixes (3 surgical cfg/cfg_attr annotations, zero behavior change in default + --all-features configs): * `uffs-mcp::McpStats::{avg_tool_latency_us,to_json}` → `#[cfg(feature = "streamable-http")]` (both only called by `http.rs`'s `/status` endpoint). * `uffs-client::daemon_ctl::keepalive_send_blocking` → `#[cfg(feature = "async")]` (only called by `connect_keepalive`, itself `async`-gated in `lib.rs`). * 3 `#[expect(clippy::cognitive_complexity, …)]` in `uffs-mcp::lib.rs` + `handler/mod.rs` → `#[cfg_attr(feature = "streamable-http", expect(…))]` (the lint score only crosses threshold when streamable-http is on; the conditional expect preserves the strict check when it actually triggers without leaving an unfulfilled expect when it doesn't). Regression guard: * New `lint-ci-no-default` gate added to `scripts/ci/gates.toml`: `cargo clippy --workspace --all-targets --no-default-features --no-deps -- -D warnings`. Mirrors `lint-ci` in flag stack + strictness; differs only in `--no-default-features` vs `--all-features`. Together the pair enforces the additivity invariant. * `just lint-ci-no-default` recipe added to `just/test.just`. * `pr-fast.yml::clippy-no-default` job added (mirrors `clippy` job). * Registered in `required.needs:` + aggregator table. * Pre-push hook regenerated via `just gen-hooks` (auto from manifest). * All 4 drift detectors green: gates-drift, hooks-drift, workflow-drift, fast-drift. Documentation: * `dependency_policy.md` §2: 5-tool table → 6-tool table; new paragraph explaining the additivity invariant the pair establishes. * `dependency_policy.md` §10: 8e decisions-log row. * `trait_policy.md:193`: Phase 7f TBD → #291 (Phase 8 follow-up #1). Adherence to the 5-rule contract: * **Rule 1** (no suppression hacks): zero `#[allow]` added. All 6 fixes are minimum-correct `#[cfg]` annotations that express the actual reachability; the 3 `expect`s become conditional rather than absolute. * **Rule 2** (surgical, correct fixes): 3 source files touched with 9 attribute lines added; no logic change. * **Rule 3** (preserve behavior + contracts): default + --all-features binary surface unchanged. All API contracts preserved. * **Rule 4** (improve tests, don't dodge them): new CI gate gives the whole workspace structural feature-additivity verification it lacked. * **Rule 5** (document & commit well): this commit message + 2 policy-doc updates + 4-line decisions-log entries explain the why, the what, and the guard against regression.
githubrobbi
added a commit
that referenced
this pull request
May 19, 2026
The Phase 7g decisions-log row in `trait_policy.md:194` read 'this PR' at the time of authoring (when PR #290 was open). After PR #290 merged the placeholder needed backfilling to '#290' to match the surrounding rows (#288/#289/#291). Companion to Phase 8e (PR #296), which already backfilled the sibling 'TBD' placeholder on row 193 (Phase 7f -> #291). This 1-line edit completes the decisions-log hygiene pass for Phase 7.
6 tasks
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.
Phase 7f — promote 4 clippy lints to active enforcement under the trait/generic/dispatch policy doc landing in PR #290.
What changes
mainclippy::too_many_argumentsdeny(was defaultwarn)#[expect]sites)clippy::trait_duplication_in_boundsdeny(was defaultallow)clippy::wrong_self_conventiondeny(was defaultwarn)clippy::multiple_bound_locationswarn(was defaultwarn)Each gets a trailing-comment cross-reference to the relevant section of
docs/architecture/code-quality/trait_policy.md.Files
Cargo.toml— 4 new lint entries under a Phase-7f banner, between the existingtype_complexity(Phase 6) andlarge_enum_variantlines.clippy.toml— extends the test-relaxations comment block with a paragraph documenting the trait/generic/dispatch lint set + audit script, mirroring the existing panic/allocation policy paragraphs.Verification
cargo clippy --workspace --all-targets --message-format=short— ✅ 0 diagnostics from any of the 4 lints.lint-pre-pushpassed (163 s — includes full workspace clippy with the new lints active).3628BD817A687030E83025A8E406D32B4736D09F.Diff
API impact
Zero. No source-code change anywhere except 2 config files.
Companion PRs (Phase 7 sequence)
DirCacheExtdemotion (in CI auto-merge)trait_policy.md+ CONTRIBUTING.md7c/7d/7e are findings-only (no PRs); 7h is next (bench refresh).
Refs: #287