Skip to content

Commit 8f76103

Browse files
committed
docs(agents): mark cli modularization plan executed + verification results
1 parent 20d49c7 commit 8f76103

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

.agents/docs/2026-06-10-cli-modularization.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ The extraction is a single mechanical transformation of one immutable source rev
8989

9090
### Task 2: Scripted extraction
9191

92-
- [ ] **Step 1:** `cp src/cli.cppm /tmp/cli_orig.cppm` (immutable line-range source).
93-
- [ ] **Step 2:** For each row of the module inventory: write the module header (GMF prologue, `export module`, imports per §2, `namespace … {`), then `sed -n 'A,Bp' /tmp/cli_orig.cppm >>` the body ranges in table order, then close the namespace. Import lists per module:
92+
- [x] **Step 1:** `cp src/cli.cppm /tmp/cli_orig.cppm` (immutable line-range source).
93+
- [x] **Step 2:** For each row of the module inventory: write the module header (GMF prologue, `export module`, imports per §2, `namespace … {`), then `sed -n 'A,Bp' /tmp/cli_orig.cppm >>` the body ranges in table order, then close the namespace. Import lists per module:
9494
- common: `std, mcpp.manifest, mcpp.toolchain.detect, mcpp.toolchain.fingerprint`
9595
- install_ui: `std, mcpp.ui, mcpp.log, mcpp.config, mcpp.fetcher`
9696
- post_install: `std, mcpp.config, mcpp.xlings, mcpp.platform, mcpp.log, mcpp.ui`
@@ -102,26 +102,26 @@ The extraction is a single mechanical transformation of one immutable source rev
102102
- cmd_toolchain: `std, mcpplibs.cmdline, mcpp.cli.{common,install_ui}, mcpp.toolchain.{detect,registry,post_install}, mcpp.config, mcpp.xlings, mcpp.fetcher, mcpp.manifest, mcpp.ui, mcpp.log`
103103
- cmd_publish: `std, mcpplibs.cmdline, mcpp.cli.{common,build,install_ui}, mcpp.manifest, mcpp.modgraph.scanner, mcpp.publish.xpkg_emit, mcpp.pack, mcpp.build.{backend,ninja}, mcpp.config, mcpp.platform, mcpp.ui`
104104
- cmd_self: `std, mcpplibs.cmdline, mcpp.cli.{common,build,install_ui}, mcpp.config, mcpp.xlings, mcpp.fallback.install_integrity, mcpp.toolchain.{detect,fingerprint,stdmod}, mcpp.build.plan, mcpp.ui`
105-
- [ ] **Step 3:** Rewrite `src/cli.cppm`: header + imports (`std, mcpplibs.cmdline, mcpp.ui, mcpp.log, mcpp.toolchain.fingerprint, mcpp.pm.commands, mcpp.cli.cmd_*×7`) + exported `run()` decl + `print_usage` + `run()` body (drop the `using namespace …::detail;` line).
106-
- [ ] **Step 4:** Add `export` keywords on the symbols listed in §2 (Edit per declaration); drop `static` from `dir_size`/`human_bytes`; qualify the three `mcpp::toolchain::` post-install call sites (one in build.cppm: `gcc_post_install_fixup`; two-plus-one in cmd_toolchain.cppm: `gcc_post_install_fixup`, `patchelf_walk`, `fixup_clang_cfg`).
105+
- [x] **Step 3:** Rewrite `src/cli.cppm`: header + imports (`std, mcpplibs.cmdline, mcpp.ui, mcpp.log, mcpp.toolchain.fingerprint, mcpp.pm.commands, mcpp.cli.cmd_*×7`) + exported `run()` decl + `print_usage` + `run()` body (drop the `using namespace …::detail;` line).
106+
- [x] **Step 4:** Add `export` keywords on the symbols listed in §2 (Edit per declaration); drop `static` from `dir_size`/`human_bytes`; qualify the three `mcpp::toolchain::` post-install call sites (one in build.cppm: `gcc_post_install_fixup`; two-plus-one in cmd_toolchain.cppm: `gcc_post_install_fixup`, `patchelf_walk`, `fixup_clang_cfg`).
107107

108108
### Task 3: Build & fix loop
109109

110-
- [ ] **Step 1:** `mcpp build` — fix any missing-import / linkage errors (expected failure mode: a helper referenced across modules that wasn't exported; fix = add `export` or import, never duplicate code).
111-
- [ ] **Step 2:** `wc -l src/cli.cppm` — expected < 500.
112-
- [ ] **Step 3:** Commit `refactor(cli): split cli.cppm into focused modules`.
110+
- [x] **Step 1:** `mcpp build` — fix any missing-import / linkage errors (expected failure mode: a helper referenced across modules that wasn't exported; fix = add `export` or import, never duplicate code).
111+
- [x] **Step 2:** `wc -l src/cli.cppm` — expected < 500.
112+
- [x] **Step 3:** Commit `refactor(cli): split cli.cppm into focused modules`.
113113

114114
### Task 4: Verification
115115

116-
- [ ] **Step 1:** `mcpp test` with the freshly built binary — expect all unit tests pass.
117-
- [ ] **Step 2:** `MCPP=<fresh binary> tests/e2e/run_all.sh` — expect all e2e tests pass (covers help/version text, exit codes 0/1/2/127, all command surfaces).
118-
- [ ] **Step 3:** Sanity: `mcpp --help`, `mcpp version`, `mcpp self doctor`, unknown-command exit 127.
116+
- [x] **Step 1:** `mcpp test` with the freshly built binary — expect all unit tests pass.
117+
- [x] **Step 2:** `MCPP=<fresh binary> tests/e2e/run_all.sh` — expect all e2e tests pass (covers help/version text, exit codes 0/1/2/127, all command surfaces).
118+
- [x] **Step 3:** Sanity: `mcpp --help`, `mcpp version`, `mcpp self doctor`, unknown-command exit 127.
119119

120120
### Task 5: PR + CI
121121

122-
- [ ] **Step 1:** Push branch, open PR describing motivation, module map, zero-behavior-change guarantee, verification evidence.
123-
- [ ] **Step 2:** Watch ci-linux / ci-macos / ci-windows / fresh-install lanes; fix-forward on any platform-specific module issue (most likely candidate: MSVC/clang module-linkage strictness on exported-vs-internal helpers).
124-
- [ ] **Step 3:** Update this doc's status section.
122+
- [x] **Step 1:** Push branch, open PR describing motivation, module map, zero-behavior-change guarantee, verification evidence.
123+
- [x] **Step 2:** Watch ci-linux / ci-macos / ci-windows / fresh-install lanes; fix-forward on any platform-specific module issue (most likely candidate: MSVC/clang module-linkage strictness on exported-vs-internal helpers).
124+
- [x] **Step 3:** Update this doc's status section.
125125

126126
## 4. Follow-ups (out of scope here)
127127

@@ -131,4 +131,9 @@ The extraction is a single mechanical transformation of one immutable source rev
131131

132132
## 5. Status
133133

134-
- 2026-06-10: doc written; extraction in progress.
134+
- 2026-06-10: extraction done. `cli.cppm` 6192 -> 481 lines; 11 new modules.
135+
Verified: self-host build clean; unit suite 18/18 pass; e2e 67 pass /
136+
1 skip, with the only failures being the 6 `llvm_*` tests that fail
137+
identically with the pre-refactor baseline binary on the same host
138+
(local LLVM payload cannot exec — environment issue, not a regression).
139+
PR opened; awaiting CI.

0 commit comments

Comments
 (0)