11# Cleanup Rollout Plan
22
3- This document is the working plan for finishing the Surge maintainability
4- cleanup after the first refactor wave. It tracks what has already landed, what
5- is in flight, and what still needs to be split before the file-size baseline
6- can be retired.
7-
8- ## Objectives
9-
10- - Keep ` main ` green throughout the cleanup campaign.
11- - Land one scoped PR at a time from a fresh worktree.
12- - Use GitHub ` Squash and merge ` for every cleanup PR.
13- - Delete the local branch and remove the local worktree after each merge.
14- - Wait for the merged-` main ` CI run to finish green before starting the next PR.
15- - Reduce oversized Rust source files below the ` 600 ` production-line target so
16- [ ` maintainability-baseline.txt ` ] ( ./maintainability-baseline.txt ) can be
17- removed.
3+ This document records the first Surge maintainability cleanup wave. The campaign
4+ is complete: the oversized Rust source backlog is gone, the baseline ledger is
5+ empty, and the maintainability guardrail is now blocking in CI.
6+
7+ ## Final Status
8+
9+ - ` main ` stayed green throughout the campaign.
10+ - Each cleanup PR landed as one scoped branch and merged with GitHub ` Squash and merge ` .
11+ - The Rust source backlog is below the ` 600 ` production-line target.
12+ - [ ` maintainability-baseline.txt ` ] ( ./maintainability-baseline.txt ) is empty and
13+ available only for future reviewed exceptions.
14+ - The maintainability check is now blocking rather than advisory.
1815
1916## Completed Phases
2017
21- These PRs are already merged :
18+ These PRs landed during the campaign :
2219
2320- ` #51 ` ` ci: add maintainability guardrails `
2421- ` #52 ` ` refactor(cli): split install selection and manifest resolution helpers `
@@ -44,57 +41,20 @@ These PRs are already merged:
4441- ` #72 ` ` refactor(installer-ui): split app rendering helpers `
4542- ` #74 ` ` refactor(core): split delta module helpers `
4643- ` #75 ` ` refactor(cli): split remote install helpers `
44+ - ` #76 ` ` refactor(cli): split install root orchestration `
4745
48- ## Active Phase
49-
50- ### ` refactor/cli-install-root-phase-2 `
51-
52- Current goal:
53-
54- - split [ ` crates/surge-cli/src/commands/install/mod.rs ` ] ( ../../crates/surge-cli/src/commands/install/mod.rs )
55- into:
56- - ` install/mod.rs `
57- - ` install/local.rs `
58- - ` install/runtime.rs `
59- - ` install/progress.rs `
60-
61- Current checkpoint:
62-
63- - the local workflow, runtime helpers, and progress helpers have been extracted into leaf modules
64- - the root module now owns type definitions, install selection, and high-level orchestration only
65- - targeted compile of ` surge-cli ` passes
66- - focused ` surge-cli ` install tests pass
67- - focused ` surge-cli ` clippy passes
68- - the final maintainability baseline entry has been removed
69- - the full pre-push suite is the remaining branch gate
70-
71- Exit criteria:
72-
73- - ` cargo test -p surge-cli commands::install:: ` passes
74- - ` cargo clippy -p surge-cli --all-targets --all-features -- -D warnings -W clippy::pedantic ` passes
75- - ` ./scripts/check-maintainability.sh ` reports the file below the target so the
76- install baseline entry can be removed
77- - the full pre-push suite passes
78- - the PR is merged with squash, local cleanup is done, and merged-` main ` CI is green
79-
80- ## Remaining First-Wave PRs
81-
82- These are the remaining planned PRs after the current install-root split lands.
83-
84- ### 1. ` refactor/maintainability-phase-2 `
85-
86- - switch maintainability enforcement from advisory-only to blocking for the
87- remaining Rust source tree
88- - remove stale baseline entries that have been burned down
89- - keep any still-deferred files explicitly listed until they are actually split
46+ ## Ongoing Rules
9047
91- ## Remaining Second-Wave File Splits
48+ Future maintainability work should continue using the same rollout rules:
9249
93- No second-wave file splits remain once the current branch lands.
50+ - keep ` main ` green throughout the change
51+ - land one scoped PR at a time from a fresh worktree
52+ - use GitHub ` Squash and merge `
53+ - wait for the merged-` main ` CI run to finish green before starting the next PR
9454
9555## Execution Rules
9656
97- Every cleanup PR follows the same loop:
57+ When a future hotspot needs a focused cleanup PR, follow the same loop:
9858
99591 . Pull the latest ` main ` .
100602 . Create a fresh branch and worktree for one scoped PR only.
@@ -107,7 +67,7 @@ Every cleanup PR follows the same loop:
107679 . Pull the squashed result back onto local ` main ` .
1086810 . Delete the merged local branch and remove the temporary worktree.
1096911 . Wait for the merged-` main ` CI run to finish green.
110- 12 . Start the next PR from a new clean worktree.
70+ 12 . Start the next PR from a new clean worktree if more cleanup remains .
11171
11272## Validation Gates
11373
@@ -135,12 +95,11 @@ During active development, run focused checks first:
13595
13696## Completion Criteria
13797
138- The cleanup campaign is complete when all of the following are true:
98+ The first-wave campaign closed because all of the following are now true:
13999
140100- no Rust source file in ` crates/*/src ` exceeds ` 600 ` production lines unless
141101 it is explicitly accepted debt
142- - [ ` maintainability-baseline.txt ` ] ( ./maintainability-baseline.txt ) is empty or removed
102+ - [ ` maintainability-baseline.txt ` ] ( ./maintainability-baseline.txt ) is empty
143103- the maintainability check is blocking rather than advisory
144- - the module roots for install, restore, pack, update, shortcuts, manifest, delta, and
145- FFI surfaces are orchestration-first rather than monolithic
146- - each merged PR has been cleaned up locally with no stale worktrees left behind
104+ - the module roots for install, restore, pack, update, shortcuts, manifest,
105+ delta, and FFI surfaces are orchestration-first rather than monolithic
0 commit comments