Compare commits

...
1 Commits
Author SHA1 Message Date
CodeWhale BotandClaude Sonnet 5.5 0d4920057b chore(engine): drop unused dev-deps, dead one-hit symbols and stale allows (CW-8027 slice 6)
Unused manifest entries (grep-verified, proven with cargo check --tests):
account-cli toml; core dev tokio; runtime dev futures-util; engine dev
cucumber, tiny_http, pretty_assertions, rio-vt, tokio-tungstenite; tui dev
pretty_assertions, rusqlite, schemars, tokio-tungstenite; repl test-support
feature. Cargo.lock regenerated offline (edges only).

Dead symbols with a single hit (the definition): core Thread::set_leaf,
ModelRegistry::is_known_for_other_provider, FleetRoleMap::contains_role,
config MODELS_DEV_API_URL / MODELS_DEV_MODELS_URL / get_raw_string /
OfferingPricing::price_per_million, telemetry NOTICE_HEADLINE,
engine auto_route_usage_source_id, paths legacy_deepseek_home_override, and
the four workflow aliases WorkflowIr/Phase/Task/Role.

Stale allow(dead_code) dropped on SidebarRowAction::PrefillCommand and
set_tail_mode; test-only mode/is_active/is_selecting moved behind cfg(test);
false GPUI sentence removed from palette rgb.rs.

Kept: DEFAULT_GOAL_MAX_STEPS (documented as retained for public runtime API).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-12 20:17:51 -08:00
22 changed files with 7 additions and 170 deletions

No files matched your search

Generated
-34
View File
@@ -907,7 +907,6 @@ dependencies = [
"serde",
"serde_json",
"tempfile",
"toml 1.1.6+spec-1.1.0",
"webbrowser",
"zeroize",
]
@@ -1150,7 +1149,6 @@ dependencies = [
"sha2 0.11.1",
"tempfile",
"thiserror 2.0.21",
"tokio",
"uuid",
]
@@ -1221,7 +1219,6 @@ dependencies = [
"codewhale-util",
"codewhale-workflow",
"codewhale-workflow-js",
"cucumber",
"dirs 7.0.0",
"encoding_rs",
"fd-lock",
@@ -1240,12 +1237,10 @@ dependencies = [
"objc2-foundation",
"parking_lot",
"portable-pty",
"pretty_assertions",
"proc-macro2",
"regex",
"reqwest",
"ring",
"rio-vt",
"rmcp",
"rusqlite",
"rustls",
@@ -1261,9 +1256,7 @@ dependencies = [
"tar",
"tempfile",
"thiserror 2.0.21",
"tiny_http",
"tokio",
"tokio-tungstenite 0.30.0",
"tokio-util",
"toml 1.1.6+spec-1.1.0",
"toml_edit 0.25.15+spec-1.1.0",
@@ -1616,7 +1609,6 @@ dependencies = [
"colored",
"dirs 7.0.0",
"fd-lock",
"futures-util",
"ignore",
"jsonwebtoken",
"libc",
@@ -1878,15 +1870,12 @@ dependencies = [
"objc2-foundation",
"parking_lot",
"portable-pty",
"pretty_assertions",
"ratatui",
"regex",
"reqwest",
"rio-vt",
"rquickjs",
"rusqlite",
"rustls",
"schemars 1.2.2",
"semver",
"serde",
"serde_json",
@@ -1896,7 +1885,6 @@ dependencies = [
"tempfile",
"tiny_http",
"tokio",
"tokio-tungstenite 0.30.0",
"tokio-util",
"toml 1.1.6+spec-1.1.0",
"toml_edit 0.25.15+spec-1.1.0",
@@ -2472,12 +2460,6 @@ dependencies = [
"unicode-xid",
]
[[package]]
name = "diff"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
[[package]]
name = "digest"
version = "0.10.7"
@@ -5679,16 +5661,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
[[package]]
name = "pretty_assertions"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d"
dependencies = [
"diff",
"yansi",
]
[[package]]
name = "prettyplease"
version = "0.2.37"
@@ -8843,12 +8815,6 @@ dependencies = [
"hashlink",
]
[[package]]
name = "yansi"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"
[[package]]
name = "yoke"
version = "0.8.3"
-1
View File
@@ -23,6 +23,5 @@ reqwest = { workspace = true, features = ["blocking"] }
serde.workspace = true
serde_json.workspace = true
tempfile.workspace = true
toml.workspace = true
webbrowser = "1.0"
zeroize = "1.8.2"
-22
View File
@@ -180,28 +180,6 @@ impl ModelRegistry {
self.models.clone()
}
/// Returns whether a selector is known only outside the selected provider.
///
/// This is rejection metadata, never route authority: callers may use it
/// to reject a clearly foreign model, but must not use the matching row to
/// select a provider or credential slot.
#[must_use]
pub fn is_known_for_other_provider(
&self,
requested: &str,
selected_provider: ProviderKind,
) -> bool {
let known_here = self
.models
.iter()
.any(|model| model.provider == selected_provider && model_matches(model, requested));
!known_here
&& self
.models
.iter()
.any(|model| model.provider != selected_provider && model_matches(model, requested))
}
/// Resolves a user-requested model name to a concrete [`ModelInfo`].
///
/// Resolution follows this priority order:
-13
View File
@@ -434,19 +434,6 @@ impl ConfigToml {
}
}
/// The unquoted contents of an extras key that holds a TOML string.
///
/// [`ConfigToml::get_value`] renders extras through `toml::Value::to_string`,
/// which re-applies TOML quoting — and switches to a single-quoted literal
/// string whenever the payload contains a `"`. A JSON blob written with
/// [`ConfigToml::set_value`] therefore comes back as `'[{"a":1}]'` and no
/// longer parses as JSON (#4727). Callers that stored structured text want
/// the payload, not its TOML rendering.
#[must_use]
pub fn get_raw_string(&self, key: &str) -> Option<&str> {
self.extras.get(key).and_then(toml::Value::as_str)
}
#[must_use]
pub fn get_display_value(&self, key: &str) -> Option<String> {
if let Some(alias) = self.root_alias_key(key) {
-4
View File
@@ -22,10 +22,6 @@ use crate::route::{
WireModelId,
};
/// Provider catalog endpoint used by Models.dev.
pub const MODELS_DEV_API_URL: &str = "https://models.dev/api.json";
/// Provider-agnostic model metadata endpoint used by Models.dev.
pub const MODELS_DEV_MODELS_URL: &str = "https://models.dev/models.json";
/// Combined `{ models, providers }` endpoint used by Models.dev.
pub const MODELS_DEV_CATALOG_URL: &str = "https://models.dev/catalog.json";
-14
View File
@@ -522,20 +522,6 @@ impl OfferingPricing {
None
}
/// Per-million price for one canonical class, when published.
#[must_use]
pub fn price_per_million(&self, class: TokenClass) -> Option<f64> {
match class {
TokenClass::Input => self.input_per_million,
TokenClass::Output => self.output_per_million,
TokenClass::CacheRead => self.cache_read_per_million,
TokenClass::CacheWrite => self.cache_write_per_million,
TokenClass::Reasoning => self.reasoning_per_million,
TokenClass::InputAudio => self.input_audio_per_million,
TokenClass::OutputAudio => self.output_audio_per_million,
}
}
/// Classes this turn actually used that carry no published price.
///
/// Non-empty means [`Self::estimate_cost`] fails closed for this usage; the
-1
View File
@@ -24,4 +24,3 @@ serde_json = { workspace = true, features = ["preserve_order"] }
[dev-dependencies]
tempfile.workspace = true
uuid.workspace = true
tokio = { workspace = true, features = ["macros", "rt", "time"] }
-4
View File
@@ -60,10 +60,6 @@ impl Thread {
pub fn leaf_id(&self) -> Option<&str> {
self.leaf_id.as_deref()
}
pub fn set_leaf(&mut self, leaf: Option<String>) {
self.leaf_id = leaf;
}
}
/// Ephemeral session within a thread (one engine lifetime / one turn's
-5
View File
@@ -203,14 +203,9 @@ codewhale-util = { path = "../util", version = "0.10.3", features = ["test-suppo
codewhale-models = { path = "../models", version = "0.10.3", features = [
"test-support",
] }
cucumber = "0.23.0"
wiremock = "0.6"
tiny_http = "0.12"
pretty_assertions = "1.4"
rio-vt = "0.5.1"
rusqlite.workspace = true
schemars = { version = "1.2.1", features = ["derive", "preserve_order"] }
tokio-tungstenite = "0.30"
[target.'cfg(unix)'.dependencies]
libc = "0.2"
-30
View File
@@ -1363,36 +1363,6 @@ fn auto_route_usage_has_reported_data(usage: &codewhale_models::Usage) -> bool {
|| usage.server_tool_use.is_some()
}
/// Stable, persistence-safe identity for one classifier response. The raw
/// provider response id is hashed with the frozen dispatch route and instant;
/// neither it nor any custom route label crosses into telemetry/persistence.
pub fn auto_route_usage_source_id(route: &EffectiveRouteEnvelope, response_id: &str) -> String {
use sha2::{Digest as _, Sha256};
let mut digest = Sha256::new();
let dispatched_at = route.dispatched_at.to_rfc3339();
for part in [
b"codewhale:auto-route-classifier:v1".as_slice(),
route.provider.as_str().as_bytes(),
route.provider_identity.as_bytes(),
route.model.as_bytes(),
route
.endpoint_fingerprint
.as_deref()
.unwrap_or_default()
.as_bytes(),
dispatched_at.as_bytes(),
response_id.as_bytes(),
] {
digest.update((part.len() as u64).to_le_bytes());
digest.update(part);
}
format!(
"auto-router:{}",
codewhale_runtime::hashing::hex_bytes(digest.finalize())
)
}
fn auto_route_attempt_from_response(
_request_route: EffectiveRouteEnvelope,
response: &MessageResponse,
+1 -2
View File
@@ -135,8 +135,7 @@ pub const MATRIX_BORDER_RGB: (u8, u8, u8) = (0, 204, 0); // #00CC00
// whale's ivory ink on both sides. This is the charcoal alternative to the
// terminal's navy "Underwater" default in 0.10.0. The
// 0.10.0 action pair uses glacial blue on charcoal and deep ocean blue on
// paper. The GPUI desktop does not paint these values: its theme is the
// separate `GPUI_*` / `GPUI_LIGHT_*` set below.
// paper.
//
// Every pair audited by `contrast::theme_contrast_violations` clears its
// floor: body roles clear 4.5:1 on all four surfaces, hint/dim and the
-10
View File
@@ -91,16 +91,6 @@ pub fn codewhale_home_is_explicit() -> bool {
path_env("CODEWHALE_HOME").is_some()
}
/// Return the legacy `DEEPSEEK_HOME` compatibility override, if configured.
///
/// New state must use [`codewhale_home`]. This resolver exists only for readers
/// whose persisted format still explicitly supports the legacy environment
/// alias.
#[must_use]
pub fn legacy_deepseek_home_override() -> Option<PathBuf> {
path_env("DEEPSEEK_HOME")
}
/// Resolve the user's platform home, preferring `HOME` before `USERPROFILE`.
///
/// The explicit environment order makes CLI, state, config, and secret paths
-3
View File
@@ -10,9 +10,6 @@ description = "Codewhale sandboxed Python REPL runtime"
[lints]
workspace = true
[features]
test-support = []
[dependencies]
codewhale-dependencies = { path = "../dependencies", version = "0.10.3" }
codewhale-runtime = { path = "../runtime", version = "0.10.3" }
-1
View File
@@ -80,7 +80,6 @@ uuid.workspace = true
wait-timeout = "0.2"
[dev-dependencies]
futures-util = "0.3"
ring = "0.17"
wiremock = "0.6"
codewhale-models = { path = "../models", version = "0.10.3", features = [
-3
View File
@@ -13,9 +13,6 @@
//! Sampling and hashing are not the same promise, and a notice that implies
//! them when neither is true is worse than no notice.
/// Headline shown above [`NOTICE_BODY`].
pub const NOTICE_HEADLINE: &str = "Codewhale usage reporting";
/// The notice itself.
///
/// Wrapped at 72 columns so it renders unchanged in the native responsive
-4
View File
@@ -197,11 +197,7 @@ codewhale-models = { path = "../models", version = "0.10.3", features = [
cucumber = "0.23.0"
wiremock = "0.6"
tiny_http = "0.12"
pretty_assertions = "1.4"
rio-vt = "0.5.1"
rusqlite.workspace = true
schemars = { version = "1.2.1", features = ["derive", "preserve_order"] }
tokio-tungstenite = "0.30"
codewhale-app-server = { path = "../app-server", version = "0.10.3", features = ["test-support"] }
[target.'cfg(unix)'.dependencies]
-1
View File
@@ -1285,7 +1285,6 @@ pub enum SidebarRowAction {
Command(String),
/// Put a destructive command in the composer instead of executing it.
/// The user confirms with Enter or cancels by editing/clearing the draft.
#[allow(dead_code)] // destructive confirm path; mouse_ui already matches it (TUI-DOG-008)
PrefillCommand(String),
/// Select the persistent Agents panel. This is deliberately a navigation
/// action rather than a modal: the Subagents summary is a group door, so
+2 -2
View File
@@ -85,7 +85,7 @@ impl BacktrackState {
/// `true` whenever the user has armed or opened backtrack. The UI uses
/// this to skip the prime hint once the overlay is up and to know
/// whether arrow keys should drive selection.
#[allow(dead_code)] // helper exposed for future UI consumers + tests.
#[cfg(test)]
#[must_use]
pub fn is_active(&self) -> bool {
!matches!(self.phase, BacktrackPhase::Inactive)
@@ -94,7 +94,7 @@ impl BacktrackState {
/// `true` only when the overlay is open and Left/Right should step
/// through prior user messages. `Primed` is intentionally excluded —
/// during the prime window arrows still scroll the transcript.
#[allow(dead_code)] // helper exposed for future UI consumers + tests.
#[cfg(test)]
#[must_use]
pub fn is_selecting(&self) -> bool {
matches!(self.phase, BacktrackPhase::Selecting { .. })
+1 -2
View File
@@ -169,7 +169,6 @@ impl LiveTranscriptOverlay {
/// Return the overlay to live-tail mode (used when backtrack is
/// confirmed or canceled). Re-arms sticky-tail so streaming resumes.
#[allow(dead_code)] // exposed for callers that retain an overlay across a backtrack cancel; current UI just pops the view.
pub fn set_tail_mode(&mut self) {
self.mode = Mode::Tail;
self.sticky_to_bottom.set(true);
@@ -177,7 +176,7 @@ impl LiveTranscriptOverlay {
}
/// For tests + UI: current mode.
#[allow(dead_code)] // currently consumed only by tests; kept public for symmetry with `set_*` setters.
#[cfg(test)]
#[must_use]
pub fn mode(&self) -> Mode {
self.mode
-7
View File
@@ -469,8 +469,6 @@ impl WorkflowPlan {
}
}
pub type WorkflowIr = WorkflowPlan;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PhasePlan {
pub name: String,
@@ -494,8 +492,6 @@ pub struct Phase {
pub tasks: Vec<Task>,
}
pub type WorkflowPhase = Phase;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "snake_case")]
pub enum FailurePolicy {
@@ -524,9 +520,6 @@ pub struct Task {
pub timeout_secs: Option<u64>,
}
pub type WorkflowTask = Task;
pub type WorkflowRole = AgentType;
/// The workflow wire's agent type. The serialized spellings are the canonical
/// Codewhale role vocabulary (founder, 2026-09-02); the pre-rename JS
/// spellings stay accepted as aliases so checked-in and saved workflows keep
-4
View File
@@ -65,10 +65,6 @@ impl FleetRoleMap {
self.roles.get(&key).map(String::as_str)
}
pub fn contains_role(&self, role: &str) -> bool {
self.get(role).is_some()
}
pub fn is_empty(&self) -> bool {
self.roles.is_empty()
}
+3 -3
View File
@@ -2,8 +2,8 @@
"_comment": "Ceiling for dead-code suppressions across crates/, counting both `#[allow(dead_code)]` and `#[expect(dead_code)]`. `total` is the sum and is the ratcheted figure. It may go down freely; raising it needs a reviewer to say why in the PR. Regenerate with: python3 scripts/check-dead-code-budget.py --update",
"_issue": "https://github.com/codewhale-hq/CodeWhale/issues/4785",
"_expect_blind_spot": "Until #6241 this gate counted only the `allow` spelling, so rewriting an allow as an expect lowered the number without removing any dead code. The ceiling was re-based to the true combined count when that was fixed; it is not a regression.",
"total": 121,
"allow_total": 89,
"total": 116,
"allow_total": 84,
"expect_total": 32,
"per_crate": {
"app-server": {
@@ -55,7 +55,7 @@
"expect": 0
},
"tui": {
"allow": 36,
"allow": 31,
"expect": 20
}
}