Skip to content

refactor: sanitize Rust codebase, batch 2 (refs #3176) - #3178

Merged
mblua merged 230 commits into
mainfrom
refactor/3176-sanitize-rust-codebase
Oct 23, 2026
Merged

mblua merged 230 commits into
mainfrom
refactor/3176-sanitize-rust-codebase

Conversation

@mblua

@mblua mblua commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Refs #3176

Closes batch 2. Batch 1 and batch 2 up to 0af7621 already reached main through #3179 (merge commit e939e9c). This PR brings the rest of batch 2 (22 commits, e939e9c -> e3f7f3c), including the census update for the whole batch.

Measures (src-tauri/src)

Signal Measure main before batch 1 (6058741) after #3179 (e939e9c) this PR (e3f7f3c)
01 lines > 100 chars 2723 618 565
02 files > 1000 lines 92 78 69
02 largest file 44554 24408 24408
05 mod.rs 21 20 20
05 inline mod x { } 301 180 180
05 files with #[test] outside tests.rs / tests/ 185 144 144

Targets finished in this part

session/selection.rs (-> 440), pty/local_backend.rs (-> 884), config/injected_messages.rs (-> 636), cli/list_peers.rs (-> 608), testability/ui_automation.rs (-> 796). Half done, back to pending: config/local_config_io.rs (-> 3191), resource_monitor/registry.rs (-> 620, registry/tests.rs still 2291).

Fixes from CI in this part

  • clippy-linux: Windows-only test imports gated in config/injected_messages.rs (02e993d) and session/selection.rs (43d0eae).
  • sanitizing:file_size: no file over 1000 lines grows against main (795a13c, 87d5757, 7c235bf).
  • Census: c4_state_key_census and spawn_search_path_inventory updated for all batch 2 moves (e3f7f3c); the owner scope in c4_state_key_census now includes the owner's child modules.

Cycle baseline change

Commit Change Retired New Joined
10a2867 commands::resource_monitor and commands::window left the main cycle (selection split) 0f7d406c9c4eb3bc ecfea84a5c2c6182 none
ad68ada SCC shrink after ui_automation split none

Known open gate failures (deferred, not new debt)

  • Cognitive complexity of functions moved to new files (rust-regression*, clippy-linux, test-debt "Baseline grew"/"STALE baseline entry").
  • Gate 06 tauri_files on new child files that hold moved code (session/selection/*, testability/ui_automation/{backend_watchdog,liveness}.rs).

Rooms

room-30, room-31, room-32, room-33, room-34, room-35, room-36.

mblua added 30 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.
mblua added 19 commits October 23, 2026 02:58
@sonarqubecloud

Copy link
Copy Markdown

@mblua
mblua merged commit f6381da into main Oct 23, 2026
31 of 38 checks passed
@mblua
mblua deleted the refactor/3176-sanitize-rust-codebase branch October 23, 2026 07:42
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