Skip to content

refactor: sanitize 01 02 05 signals in src-tauri/src, batch 1 (refs #3172) - #3175

Closed
mblua wants to merge 24 commits into
mainfrom
refactor/3172-sanitize-rust-codebase
Closed

mblua wants to merge 24 commits into
mainfrom
refactor/3172-sanitize-rust-codebase

Conversation

@mblua

@mblua mblua commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Refs #3172

Batch 1 of the Rust sanitizing campaign: behavior-preserving fixes done in parallel by fixer rooms 30, 31, 32 and 33 on one shared branch. Targets are only partly done; the campaign continues in the next batch, which branches from this head.

Measures (src-tauri/src, base 72aa89f -> head dde98bc)

Signal Measure Before After
01 lines > 100 chars 2908 2367
02 files > 1000 lines 92 102
05 mod.rs 21 21
05 inline mod x { } 268 252
05 files with #[test] outside tests.rs / tests/ (C6) 185 181

Largest targets: config/settings.rs 44554 -> 994, phone/mailbox.rs 41542 -> 145, commands/session.rs 24596 -> 9275, commands/config.rs 16066 -> 358. Signal 02 count rose because giant files split into children that are still > 1000 lines (e.g. mailbox/tests.rs 24408); next batch keeps splitting.

Other changes

Known gate failures (vs main), to fix in the next batch

  • file_size (02): 14 files; line_length (01): 1 (mailbox/internal_delivery.rs, a test-pinned literal).
  • file_layout (05): 23 (use super::super::*; in config/settings/tests/*.rs; *_tests.rs in commands/session/).
  • tauri_edge (06): 24, global_state (08): 11, process_env (09): 1 — code moved to new files counted as new debt.

Rooms

room-30 (config/settings.rs), room-31 (phone/mailbox.rs), room-32 (commands/session.rs), room-33 (commands/config.rs).

mblua added 24 commits October 22, 2026 10:46
Move the production code of phone/mailbox.rs into 22 private submodules
under phone/mailbox/, in dependency order so sibling modules form a DAG.
mailbox.rs now only declares the children and re-exports the items that
were already pub/pub(crate). The MailboxPoller impl is split into
several impl blocks. Items, fields and methods used across the new
siblings become pub(crate). Source-scan tests read the new files.

Cycle baseline change: SCC 554acc49e7a211d1 (89 members) shrinks.
phone::mailbox and phone::terminal_snapshot leave it; the rest becomes
eb99a5c4b6de1586 (85) and fa5266e34a30725c (cli::create_agent,
cli::create_agent_matrix). No module joined any cycle.
@sonarqubecloud

Copy link
Copy Markdown

@mblua

mblua commented Oct 22, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #3178, which contains all of these commits plus the fixes for this PR's failing CI (Linux build, cognitive-complexity baseline, test-debt allowlist). Branch kept: batch 2 builds on it.

@mblua mblua closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant