Skip to content

Commit 1564fc3

Browse files
committed
refactor(pm): add pm/pm.cppm subsystem façade (PR-R7)
Final step of the package-management subsystem refactor (see `.agents/docs/2026-05-08-pm-subsystem-architecture.md`). Strictly zero behavior change. * New module `mcpp.pm` (`src/pm/pm.cppm`) is the single import point for callers in `cli.cppm`, `build/`, `pack/`, etc. It re-exports the three pm data-type modules (`dep_spec`, `index_spec`, `lock_io`) but **deliberately not** the flow modules (`resolver`, `commands`, `package_fetcher`, `publisher`) — those stay direct-import-only so the encapsulation gained by R1–R6 is preserved. * No call-site migration in this PR. Existing `import mcpp.lockfile` / `import mcpp.fetcher` / `import mcpp.publish.xpkg_emit` shims continue to work; new code can choose `import mcpp.pm` and reach the same data types via the new façade. * `prepare_dependencies(Manifest&, Lockfile&, ...)` (the high-level operation that should replace the ~250-line dep-resolution loop in `cli.cppm::prepare_build`) is left for a separate PR — pulling it out is a non-trivial behavior-touching change that doesn't belong inside the strict-move R-series. The façade leaves a clean spot for it to land later. Verification: * `mcpp build` compiles unchanged. * `mcpp test` — 9/9 unit binaries pass. * e2e: 02 / 09 / 12 / 23 / 27 all pass. Closes the seven-PR refactor sequence. The pm subsystem is now: src/pm/ ├── pm.cppm (façade, this PR) ├── dep_spec.cppm (R1) ├── index_spec.cppm (R1 placeholder, awaits index-config) ├── lock_io.cppm (R2) ├── package_fetcher.cppm (R3) ├── resolver.cppm (R4) ├── commands.cppm (R5) └── publisher.cppm (R6)
1 parent 44e3626 commit 1564fc3

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

src/pm/pm.cppm

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// mcpp.pm — package-management subsystem façade.
2+
//
3+
// This is the single import point that callers in `cli.cppm`,
4+
// `build/`, `pack/`, etc. should use to reach pm types and high-level
5+
// operations. The internal modules (`pm.resolver`, `pm.commands`,
6+
// `pm.package_fetcher`, `pm.publisher`) stay deliberately out of the
7+
// public surface — re-exporting them would invite call sites to
8+
// reach into pm internals and undo the encapsulation gained by R1–R6.
9+
//
10+
// What this module re-exports:
11+
//
12+
// * Data types only:
13+
// - `mcpp::pm::DependencySpec` (from pm.dep_spec)
14+
// - `mcpp::pm::kDefaultNamespace` (from pm.dep_spec)
15+
// - everything currently in pm.index_spec (placeholder; the
16+
// index-config implementation will land here)
17+
// - `mcpp::pm::Lockfile` and friends (from pm.lock_io)
18+
//
19+
// Internal pm modules (resolver, package_fetcher, commands, publisher)
20+
// MUST be imported directly by callers that need them; they are
21+
// intentionally **not** re-exported here. As the call-site migration
22+
// progresses, an additional high-level operation
23+
// `prepare_dependencies(Manifest&, Lockfile&, ...)` → vector<...>
24+
// will appear here, replacing the ~250-line dependency-resolution
25+
// loop currently inlined in `cli.cppm::prepare_build`. That landing
26+
// is tracked separately so this PR stays a pure additive facade.
27+
//
28+
// See `.agents/docs/2026-05-08-pm-subsystem-architecture.md` §4.10.
29+
30+
export module mcpp.pm;
31+
32+
export import mcpp.pm.dep_spec;
33+
export import mcpp.pm.index_spec;
34+
export import mcpp.pm.lock_io;

0 commit comments

Comments
 (0)