Skip to content

[playbook-phase-8e] Feature additivity regression guard + 6 cfg-gating fixes #295

@githubrobbi

Description

@githubrobbi

Context

Post-Phase-8 audit (issue #195 CLOSED) discovered the additivity property documented by docs/architecture/code-quality/dependency_policy.md is not actually verified by the CI gates — both pre-push and pr-fast.yml exclusively run --all-features configurations.

Running cargo check --workspace --no-default-features (which the playbook §996 explicitly mandates and which phase_8_implementation_plan.md §2 criterion implies via cargo tree -e features documentation) reveals 6 distinct warnings strict CI (-D warnings) would reject:

# Site Issue When
1 crates/uffs-mcp/src/stats.rs:90 McpStats::avg_tool_latency_us dead code streamable-http off
2 crates/uffs-mcp/src/stats.rs:100 McpStats::to_json dead code streamable-http off
3 crates/uffs-client/src/daemon_ctl.rs:186 keepalive_send_blocking dead code async off
4 crates/uffs-mcp/src/lib.rs:230 #[expect(cognitive_complexity)] unfulfilled streamable-http off
5 crates/uffs-mcp/src/handler/mod.rs:324 #[expect(cognitive_complexity)] unfulfilled streamable-http off
6 crates/uffs-mcp/src/handler/mod.rs:364 #[expect(cognitive_complexity)] unfulfilled streamable-http off

All 6 are root-cause feature-additivity gaps: items reachable only when feature X is on were not themselves cfg(feature = X)-gated.

Fix scope (single Phase 8e PR)

  1. Source (3 surgical cfg / cfg_attr annotations):
    • uffs-mcp::McpStats::{avg_tool_latency_us,to_json}#[cfg(feature = \"streamable-http\")].
    • uffs-client::daemon_ctl::keepalive_send_blocking#[cfg(feature = \"async\")].
    • 3 #[expect(cognitive_complexity)]#[cfg_attr(feature = \"streamable-http\", expect(...))] (preserves the lint check when it actually triggers; no blanket allow).
  2. Regression guard: add cargo check --workspace --no-default-features --all-targets --locked to pre-push (scripts/hooks/_lint_pre_push.sh) + pr-fast.yml::sanity.
  3. Doc: trait_policy.md:193 TBD → chore(lints): activate 4 Phase-7 trait/generic/dispatch lints (Phase 7f, refs #287) #291; dependency_policy.md §2 (new gate) + §10 (decisions-log row for 8e).

Rule-1 adherence

Zero #[allow] / blanket #[expect] added. All 6 sites get the minimum-correct #[cfg] annotation that expresses the actual reachability.

Companion to: #195 (Phase 8 closeout).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingplaybookWorld-class Rust workspace refactor playbook phase trackingrefactorRefactor work tracked by the world_class_rust_workspace_refactor_playbook

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions