From 905cfb13f61c0112e71f7abceaec8de81b43d100 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Sat, 28 Nov 2026 10:31:54 +0100 Subject: [PATCH] control-plane, engine-host: 8 unused glob re-exports and 15 allow(unused_imports) deleted, 6 debt exceptions with them (STRA-338) The Linux compile the exceptions waited for shows eight globs that nothing uses (control-plane config, mcp, request_log, request_monitor; engine-host runtime_rpc) in the lib and the lib test build alike; the other seven allowed globs are used and lose only the attribute. --- architecture.json | 8 +------- control-plane/src/config.rs | 4 ---- control-plane/src/mcp.rs | 10 ++-------- control-plane/src/request_log.rs | 2 -- control-plane/src/request_monitor.rs | 4 +--- desktop-core/src/runtime_gateway.rs | 4 ---- desktop-core/src/runtime_rpc.rs | 7 +------ 7 files changed, 5 insertions(+), 34 deletions(-) diff --git a/architecture.json b/architecture.json index 55449369..a1d5d35a 100644 --- a/architecture.json +++ b/architecture.json @@ -271,13 +271,7 @@ {"crate": "leleka-model-format", "file": "src/gguf/resident.rs", "ratchet": "process-global", "reason": "kept: NEXT_SOURCE_ID mints the private source-owner identity after an admitted file fill; unique across the process by definition, checked exhaustion refuses rather than wraps"}, {"crate": "leleka-native-cpu-expert", "file": "src/rust_legacy.rs", "ratchet": "process-global", "reason": "kept: ORACLE, the q8-zero oracle switch of the legacy kernel (`set_oracle_q8_zero`), a test hook read by the kernel free functions that pool worker threads call with no context argument"}, {"crate": "leleka-native-cpu-expert", "file": "src/rust_weight_iq.rs", "ratchet": "process-global", "reason": "kept: pure memo of the IQ quantizer grids (one slot per grid kind, built on first use from constant tables, dropped by the release call), shared by the pool worker threads that call the quantizers as free functions; no caller can observe the cache"}, - {"crate": "leleka-obs", "file": "src/redact.rs", "ratchet": "process-global", "reason": "kept: the secret values registered for scrubbing: the logger facade is process-wide by contract (same reason as lib.rs) and `scrub` runs on every log line of every thread"}, - {"crate": "leleka-control-plane", "file": "src/config.rs", "ratchet": "allow-unused-imports", "reason": "debt: two glob re-exports of the config split that the compiler reports unused in the lib build; they stay because the lib test build of control-plane cannot be compiled on Windows (std::os::unix), so a use from a test module cannot be ruled out. Delete or narrow them on a Linux compile"}, - {"crate": "leleka-control-plane", "file": "src/mcp.rs", "ratchet": "allow-unused-imports", "reason": "debt: three glob re-exports of the mcp split that the compiler reports unused in the lib build; kept because the lib test build of control-plane cannot be compiled on Windows (std::os::unix) and a test use cannot be ruled out. Delete or narrow them on a Linux compile"}, - {"crate": "leleka-control-plane", "file": "src/request_log.rs", "ratchet": "allow-unused-imports", "reason": "debt: one glob re-export (metrics_text) that the compiler reports unused in the lib build; kept because the lib test build of control-plane cannot be compiled on Windows and a test use cannot be ruled out"}, - {"crate": "leleka-control-plane", "file": "src/request_monitor.rs", "ratchet": "allow-unused-imports", "reason": "debt: one glob re-export (record) that the compiler reports unused in the lib build; kept because the lib test build of control-plane cannot be compiled on Windows and a test use cannot be ruled out"}, - {"crate": "leleka-engine-host", "file": "src/runtime_gateway.rs", "ratchet": "allow-unused-imports", "reason": "debt: four glob re-exports of the gateway split; not checked, because leleka-engine-host needs the engine, which does not compile on Windows (STRA-390). Narrow or delete them with the compiler once it does"}, - {"crate": "leleka-engine-host", "file": "src/runtime_rpc.rs", "ratchet": "allow-unused-imports", "reason": "debt: four glob re-exports of the rpc split; not checked, because leleka-engine-host needs the engine, which does not compile on Windows (STRA-390). Narrow or delete them with the compiler once it does"} + {"crate": "leleka-obs", "file": "src/redact.rs", "ratchet": "process-global", "reason": "kept: the secret values registered for scrubbing: the logger facade is process-wide by contract (same reason as lib.rs) and `scrub` runs on every log line of every thread"} ], "source_patterns": [ {"id": "env-read", "regex": "\\benv::var(_os)?\\(", "why": "configuration must be parsed once into a Settings struct (S13), not read all over the code"}, diff --git a/control-plane/src/config.rs b/control-plane/src/config.rs index 83ad897c..cbf672ce 100644 --- a/control-plane/src/config.rs +++ b/control-plane/src/config.rs @@ -165,8 +165,4 @@ struct ControlVectorFile { mod tests; mod control_vector; -#[allow(unused_imports)] -pub use control_vector::*; mod methods; -#[allow(unused_imports)] -pub use methods::*; diff --git a/control-plane/src/mcp.rs b/control-plane/src/mcp.rs index b7cd412b..f6ddda9a 100644 --- a/control-plane/src/mcp.rs +++ b/control-plane/src/mcp.rs @@ -147,20 +147,14 @@ mod tests; mod mcp_settings_errors; use mcp_settings_errors::*; -mod stdio_transport; -#[allow(unused_imports)] -pub use stdio_transport::*; mod stdio_message_routing; +mod stdio_transport; use stdio_message_routing::*; mod http_transport; use http_transport::*; -mod transport; -#[allow(unused_imports)] -pub use transport::*; mod server; -#[allow(unused_imports)] -pub use server::*; mod tool_result_text; +mod transport; pub use tool_result_text::*; mod hub; use hub::*; diff --git a/control-plane/src/request_log.rs b/control-plane/src/request_log.rs index 795f53cc..b0047cf5 100644 --- a/control-plane/src/request_log.rs +++ b/control-plane/src/request_log.rs @@ -172,5 +172,3 @@ pub use request_context::*; mod observation; pub use observation::*; mod metrics_text; -#[allow(unused_imports)] -pub use metrics_text::*; diff --git a/control-plane/src/request_monitor.rs b/control-plane/src/request_monitor.rs index 61b23955..9170d66a 100644 --- a/control-plane/src/request_monitor.rs +++ b/control-plane/src/request_monitor.rs @@ -94,8 +94,6 @@ mod tests; mod captured_text; use captured_text::*; -mod record; -#[allow(unused_imports)] -pub use record::*; mod capture; +mod record; pub use capture::*; diff --git a/desktop-core/src/runtime_gateway.rs b/desktop-core/src/runtime_gateway.rs index b8b94d98..3d544898 100644 --- a/desktop-core/src/runtime_gateway.rs +++ b/desktop-core/src/runtime_gateway.rs @@ -81,14 +81,10 @@ struct Trace { mod tests; mod registry; -#[allow(unused_imports)] pub use registry::*; mod model_control; -#[allow(unused_imports)] pub use model_control::*; mod text_responses; -#[allow(unused_imports)] pub use text_responses::*; mod tool_responses; -#[allow(unused_imports)] pub use tool_responses::*; diff --git a/desktop-core/src/runtime_rpc.rs b/desktop-core/src/runtime_rpc.rs index 61d4beda..245de270 100644 --- a/desktop-core/src/runtime_rpc.rs +++ b/desktop-core/src/runtime_rpc.rs @@ -89,18 +89,13 @@ struct GenerationResponse { mod tests; mod server_state; -#[allow(unused_imports)] pub use server_state::*; -mod server; -#[allow(unused_imports)] -pub use server::*; mod generate_rpc; mod generation_lifecycle; mod model_rpc; +mod server; mod service; mod session_rpc; -#[allow(unused_imports)] pub use generation_lifecycle::*; mod event_to_proto; -#[allow(unused_imports)] pub use event_to_proto::*;