Phase 3. Workspaces
| Field | Value |
|---|---|
| MEP | MEP-57 §Phases · Phase 3 |
| Status | NOT STARTED |
| Started | — |
| Landed | — |
| Tracking issue | — |
| Tracking PR | — |
Gate
TestPhase3Workspaces: every workspace fixture in tests/pkgsystem/workspace/ resolves cross-member imports without registry calls; [workspace.dependencies] inheritance produces the expected effective dep set per member.
Pass criteria:
- Member glob expansion.
[workspace] members = ["packages/*", "tools/cli"]resolves to the on-disk member set, withexclude = [...]honoured. The set is computed viafilepath.Glob(literal-glob) and explicit-paths; the result is sorted by path. - Cross-member import short-circuit. A member importing
@my/parser(another member's published name) resolves to the on-disk source underpackages/parser/; no registry call is made; the lockfile recordssource = { kind = "workspace", path = "packages/parser" }. - Inheritance. A member declaring
dep = { workspace = true }reads the version range from[workspace.dependencies]and produces the same effectiveDepstruct as if the member had restated the range inline. - Target propagation.
[workspace.targets] default = ["typescript", "python"]is the default[targets]set for any member without its own[targets]block. - CLI.
mochi workspace lslists members;mochi workspace add <path>appends tomembers;mochi workspace remove <name>removes by name. Modifications go through the canonical writer. - Umbrella-only detection. A directory with
mochi.workspace.tomland no[package]table is treated as an umbrella (no package compiled at the root); amochi.tomlwith[workspace]is treated as a combined member-and-root.