Skip to content

chore(tui): drop the blanket dead_code allow in five modules - #6943

Open
Lstarsky0 wants to merge 1 commit into
codewhale-hq:mainfrom
Lstarsky0:chore/drop-test-only-dead-code-blankets
Open

Lstarsky0 wants to merge 1 commit into
codewhale-hq:mainfrom
Lstarsky0:chore/drop-test-only-dead-code-blankets

Conversation

@Lstarsky0

Copy link
Copy Markdown
Contributor

What and why

A slice of #5587. I took the #![allow(dead_code)] off five modules and let cargo check -p codewhale-tui --all-targets show what each one was covering:

  • worker_profile.rs: nothing. The allow was stale.
  • model_profile.rs: FactProvenance::LegacyModelHeuristics has had no constructor since 5cf09da moved model_profile() off model_registry::lookup, so it is deleted. Four predicates (supports_image_input, has_large_context, prefers_full_tool_surface, suitable_for_broad_fleet_worker) are only called from the module's tests and are now #[cfg(test)].
  • tui/git_status.rs: chrome_label and chrome_ink lost their last caller when 07a95e5 deleted the underwater header widget. Only their tests use them now, so #[cfg(test)].
  • fleet/roster.rs: load_with_personal_dir and shadowed_for are test seams. #[cfg(test)].
  • fleet/task_spec.rs: record_verification_receipt is only called from its test. #[cfg(test)], along with the FleetLedger import.

None of these files has items that are only reached from cfg(unix) or cfg(windows) code, so Windows sees the same result as macOS. llm_client/mock.rs looked stale too but isn't: tests/support pulls it into the integration crate by #[path], and that crate never uses FauxStep::Error or push_error. I left it alone.

Main measures 252 against a ceiling of 258. With this change it is 247, and the budget file is regenerated with --update.

Issue

Refs #5587

How I tested it

  • cargo check -p codewhale-tui --all-targets and cargo clippy -p codewhale-tui --all-targets --all-features with CI's flags: clean. cargo fmt --all -- --check: clean.
  • cargo nextest run -p codewhale-palette -p codewhale-runtime -p codewhale-tui --lib: 15623 passed, 47 failed. The 87 tests in the five touched modules all pass. The 47 failures are exactly the ones current main fails on my machine (most need an extension-host Node version I don't have).
  • check-dead-code-budget.py passes. check-blocking-calls-budget.py fails, but it fails the same way on current main (one new std::fs site in crates/tui/src/oauth.rs), and this change doesn't touch it.
  • Since this is all about what rustc considers dead, I also checked it on CI's toolchains, together with the stale-allow slice I'm sending next (dropping allows only ever adds warnings, so a clean run with both covers this one alone): cargo +1.99.0 clippy --workspace --all-targets --all-features with CI's flags, cargo +1.99.0 fmt --check, cargo +1.99.0 check --workspace --lib --bins, and the MSRV job's cargo +1.89.0 check --workspace. All clean.

No new tests; nothing here changes behaviour.

Checklist

  • One focused change, rebased on current main
  • cargo fmt --all passes, and tests cover new or changed behavior
  • If this adds or changes a user-facing feature, I updated its docs and its row in docs/features.toml (cargo test -p codewhale-tui --test feature_registry checks it) — n/a

Refs codewhale-hq#5587

Removed `#![allow(dead_code)]` from worker_profile.rs, model_profile.rs,
tui/git_status.rs, fleet/roster.rs and fleet/task_spec.rs, then let
`cargo check -p codewhale-tui --all-targets` (warnings are denied) say what
each one was hiding:

- worker_profile.rs: nothing. The allow and its "consumers are wired in a
  follow-up" note were stale.
- model_profile.rs: `FactProvenance::LegacyModelHeuristics` has had no
  constructor since 5cf09da moved `model_profile()` off
  `model_registry::lookup`, so it is deleted. `supports_image_input`,
  `has_large_context`, `prefers_full_tool_surface` and
  `suitable_for_broad_fleet_worker` are only called from this module's
  tests and are now `#[cfg(test)]`.
- git_status.rs: `chrome_label` and `chrome_ink` lost their last caller when
  07a95e5 deleted the underwater header widget. Their own tests are all
  that is left, so `#[cfg(test)]`.
- roster.rs: `load_with_personal_dir` and `shadowed_for` are only used by
  the roster tests and fleet/tests/roster_shadow_and_trust.rs.
  `#[cfg(test)]`.
- task_spec.rs: `record_verification_receipt` is only called from its test.
  `#[cfg(test)]`, together with the `FleetLedger` import it was the last
  non-test user of.

Nothing in these five files is reached only from `cfg(unix)` or
`cfg(windows)` code, so the Windows build sees the same result as macOS.
llm_client/mock.rs keeps its allow: tests/support pulls it into the
integration crate by `#[path]`, and that crate never uses
`FauxStep::Error` or `push_error`.

Budget: main measures 252 against a ceiling of 258. This change makes it
247, and `check-dead-code-budget.py --update` writes that.
@Lstarsky0
Lstarsky0 requested a review from Hmbown as a code owner October 9, 2026 11:00

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added the contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm label Oct 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants