Skip to content

Dead-code sweep: 464 #[allow(dead_code)] attributes are hiding drift #4785

Description

@Hmbown

The tree carries 464 #[allow(dead_code)] attributes across 143 files — a wall that makes the compiler structurally unable to report drift.

Measured by stripping them in place and running cargo check --workspace --all-features with and without --tests:

Count
Dead in the shipping compile 332
Dead in both compiles (delete candidates) 135
Alive only because a test references it 197
Concentration 421 of 424 in codewhale-tui; the other 17 crates are clean

Nearly all of it is the wake of two completed direction changes whose plumbing was never removed: the rebrand off deepseek-tui (shims removed in v0.9.0) and the collapse to one constitution (the layered prompt composer survived). The third such move — retiring agent_open/agent_eval lifecycle theater — is verified clean with zero live references. That is the standard the other two should be held to.

Clusters

  • cli/src/update.rs:591-680 legacy-binary handling (~90 lines of tests behind it)
  • tracked npm/deepseek-tui/ plus the CI guards policing it
  • sandbox/landlock.rs — 361 lines, self-documented dormant (create_landlock_wrapper returns the command unsandboxed)
  • protocol/src/workroom.rs — 347 lines, Phase 2 not started since June
  • a 1,153-line shadow exec-policy inside tui
  • two genuinely unused deps: clap in app-server, thiserror in lane

One rename, not a deletion

crates/cli/src/bin/codew_legacy_shim.rs is the live codew binary and its own docs call it permanent. Every sweep flags it. Rename to codew.rs.

Do NOT delete

crates/lane is load-bearing despite looking like v0.8.68 scaffolding — live call sites in work_graph/runtime.rs:9, work_graph/liveness.rs:12, tui/ui.rs:10214,10237,10248, cli/src/lib.rs:661,728,930.

context_budget.rs and prompt_zones.rs appear in the dead list but only as unused methods — the files are imported. Item-level dead ≠ file-level dead, which is exactly how prior sweeps broke the build. The AGENTS.md guardrail stands.

Detail: codewhale-ops/roadmap/V0.9.2_DEAD_CODE_AUDIT.md, raw inventories in notes/dead-code-0.9.1/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions