Problem
Several of the largest Rust files are inflated by very large inline test modules. This makes production code harder to navigate and creates unnecessary merge conflict surface.
The analysis estimated that moving tests out of seven files can reduce visible production file size by roughly 47% with no behavior change.
Candidate files
crates/tui/src/mcp.rs
crates/tui/src/config.rs
crates/config/src/lib.rs
crates/tui/src/runtime_api.rs
crates/tui/src/runtime_threads.rs
crates/tui/src/tui/history.rs
crates/tui/src/tui/app.rs
Proposed shape
Move inline #[cfg(test)] modules into adjacent test files using explicit module paths where needed, for example:
#[cfg(test)]
#[path = "mcp_tests.rs"]
mod tests;
Use the repo's existing Rust module/test conventions where they already exist.
Acceptance criteria
Notes
This is intentionally the first phase because it lowers later refactor risk and gives reviewers smaller production files before domain extraction begins.
Problem
Several of the largest Rust files are inflated by very large inline test modules. This makes production code harder to navigate and creates unnecessary merge conflict surface.
The analysis estimated that moving tests out of seven files can reduce visible production file size by roughly 47% with no behavior change.
Candidate files
crates/tui/src/mcp.rscrates/tui/src/config.rscrates/config/src/lib.rscrates/tui/src/runtime_api.rscrates/tui/src/runtime_threads.rscrates/tui/src/tui/history.rscrates/tui/src/tui/app.rsProposed shape
Move inline
#[cfg(test)]modules into adjacent test files using explicit module paths where needed, for example:Use the repo's existing Rust module/test conventions where they already exist.
Acceptance criteria
pub(crate)/#[doc(hidden)]visibility is justified in code review.cargo testpasses after the extraction.Notes
This is intentionally the first phase because it lowers later refactor risk and gives reviewers smaller production files before domain extraction begins.