Skip to content

chore(lints): activate 4 Phase-7 trait/generic/dispatch lints (Phase 7f, refs #287)#291

Merged
githubrobbi merged 2 commits into
mainfrom
chore/phase-7f-trait-lints
May 19, 2026
Merged

chore(lints): activate 4 Phase-7 trait/generic/dispatch lints (Phase 7f, refs #287)#291
githubrobbi merged 2 commits into
mainfrom
chore/phase-7f-trait-lints

Conversation

@githubrobbi
Copy link
Copy Markdown
Collaborator

Phase 7f — promote 4 clippy lints to active enforcement under the trait/generic/dispatch policy doc landing in PR #290.

What changes

Lint Level Default Diagnostics on main
clippy::too_many_arguments deny (was default warn) warn 0 (19 pre-existing #[expect] sites)
clippy::trait_duplication_in_bounds deny (was default allow) allow 0
clippy::wrong_self_convention deny (was default warn) warn 0
clippy::multiple_bound_locations warn (was default warn) warn 0

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 existing type_complexity (Phase 6) and large_enum_variant lines.
  • 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.
  • Pre-push gate: ✅ lint-pre-push passed (163 s — includes full workspace clippy with the new lints active).
  • Commit signed: 3628BD817A687030E83025A8E406D32B4736D09F.

Diff

 Cargo.toml  |  7 ++++++- (4 new lints + 1 trailing-comment ref on type_complexity)
 clippy.toml | 10 ++++++++++
 2 files changed, 21 insertions(+), 6 deletions(-)

API impact

Zero. No source-code change anywhere except 2 config files.

Companion PRs (Phase 7 sequence)

7c/7d/7e are findings-only (no PRs); 7h is next (bench refresh).

Refs: #287

…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
@githubrobbi githubrobbi enabled auto-merge (squash) May 19, 2026 17:17
@githubrobbi githubrobbi merged commit 9a0e1be into main May 19, 2026
27 checks passed
@githubrobbi githubrobbi deleted the chore/phase-7f-trait-lints branch May 19, 2026 17:31
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.
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.

1 participant