Skip to content

refactor(pm): add pm/pm.cppm subsystem façade (PR-R7)#10

Merged
Sunrisepeak merged 1 commit intomainfrom
refactor/pm-r7-facade
May 8, 2026
Merged

refactor(pm): add pm/pm.cppm subsystem façade (PR-R7)#10
Sunrisepeak merged 1 commit intomainfrom
refactor/pm-r7-facade

Conversation

@Sunrisepeak
Copy link
Copy Markdown
Member

Summary

Closes the seven-PR pm subsystem refactor.
Strictly zero behavior change.

  • mcpp.pm (src/pm/pm.cppm) is the single import point for callers
    outside the subsystem (cli, build, pack). Re-exports the three
    data-type modules (dep_spec, index_spec, lock_io) but
    deliberately not the flow modules (resolver, commands,
    package_fetcher, publisher) — those remain direct-import-only,
    preserving the encapsulation gained by R1–R6.

  • No call-site migration here. Existing import mcpp.lockfile /
    import mcpp.fetcher / import mcpp.publish.xpkg_emit shims keep
    working; new code can reach the same types via import mcpp.pm.

  • prepare_dependencies (the high-level operation that should replace
    the ~250-line dep-resolution loop in cli.cppm::prepare_build) is
    intentionally left for a separate PR. Pulling it out is
    behavior-touching and doesn't belong inside the strict-move R-series.

Final pm/ subsystem layout

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)

Test plan

  • mcpp build (worktree)
  • mcpp test — 9/9 unit binaries pass
  • e2e: 02 / 09 / 12 / 23 / 27 all pass
  • Full CI green

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)
@Sunrisepeak Sunrisepeak merged commit 1564fc3 into main May 8, 2026
1 check passed
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