Files
alkhttp/tasks/infra/review-002-cov13-dead-code.md

2.3 KiB

id, name, status, depends_on, scope, risk, impact, level, tags
id name status depends_on scope risk impact level tags
review-002-cov13-dead-code Delete dead accessors and FromRef impls — resolve_bearer wire-or-delete decision (COV-13) completed
single low component implementation
infra
review-002
coverage

Description

Review 002 COV-13: code confirmed dead by the coverage pass (every binary, zero hits, nothing extracts these types) — delete rather than test:

  • server/state.rs:75-83 — both FromRef impls (Arc<OperationRegistry>, Arc<dyn IdentityProvider>): no route extracts these types (the middleware takes state directly)
  • gateway/dispatch.rs:74-76, 79-81identity_provider() accessor (dead) and resolve_bearer() accessor — the latter's doc promises an auth hook the middleware never calls (spec/code drift): decide wire-or-delete (if the hook concept matters for a future assembly- layer story, wire it into bearer_auth_middleware/ws_bearer_auth; otherwise delete)
  • websocket/upgrade.rs:145-147FromRef<SessionState> for Arc<OperationRegistry> (dead extractor)
  • to_mcp.rsPRJ-24's dead search_filter parameter is owned by review-002-projection-truthfulness; only handle it here if that task did not

Acceptance Criteria

  • All dead items deleted (or resolve_bearer wired, with the doc claim made true, if the hook decision says wire)
  • cargo build + full test matrix green — the deletions prove nothing referenced them (coverage claim verified)
  • cargo test, cargo clippy --all-targets -- -D warnings, cargo fmt --check pass

References

  • docs/reviews/002-post-remediation-review.md (Part G', COV-13)
  • src/server/state.rs:75-83, src/gateway/dispatch.rs:74-81, src/websocket/upgrade.rs:145-147
  • tasks/infra/review-002-cov-deployment-knobs.md (the coverage pass's live-code work — separate from this dead-code sweep)

Notes

Small, zero-risk deletion sweep. Good pairing with any other session's warm-up. If the resolve_bearer hook-decision feels non-obvious (needs an ADR or design note), default to delete — dead code with an aspirational doc claim is worse than no hook; a real hook can be added when a concrete assembly-layer need exists.

Summary

Merge note: resolved alongside mcp-batch-cap (invoke_count accessor kept, identity_provider/resolve_bearer deleted single-arg constructor).