Phase 0. Spec freeze and skeleton trees
| Field | Value |
|---|---|
| MEP | MEP-45 §Phases · Phase 0 |
| Status | IN PROGRESS |
| Started | 2026-05-22 (GMT+7) |
| Landed | — |
| Tracking issue | #22066 |
| Tracking PR | #22067 |
Gate
This MEP merged on main; transpiler3/c/{aotir,lower,emit,build,toolchain/zig,runtime/{include,src}}/doc.go compile clean and report zero tests; tests/transpiler3/c/ exists with a README.md; implementation tracking pages for every phase exist under /docs/implementation/0045/; sidebar entries visible on the website.
Goal-alignment audit
The user-facing goal of MEP-45 is "ship a Mochi program as a single native binary on every tier-1 triple". Phase 0 does not move that goal directly; it is paperwork that costs one PR and unlocks every later phase. Specifically, after Phase 0 a contributor can answer four questions without reading the MEP end-to-end: (1) which Go package owns each pipeline stage (the doc.go tree), (2) where fixtures live and how they are named (tests/transpiler3/c/README.md), (3) which phase is responsible for which language surface (the §Phases table in MEP-45), and (4) where the per-phase rolling status lives (the tracking pages under /docs/implementation/0045/). Without those four anchors, every later phase repeats the same orientation cost. Aligns.
Sub-phases
| # | Scope | Status | Commit | PR |
|---|---|---|---|---|
| 0.0 | MEP-45 merged with refactored framing, §Phases section, implementation tracking docs, sidebar wiring | IN PROGRESS | — | #22067 |
| 0.1 | transpiler3/c/{aotir,lower,emit,build,toolchain/zig,runtime/{include,src}}/doc.go compile clean | IN PROGRESS | — | #22067 |
| 0.2 | tests/transpiler3/c/README.md documents fixture layout and naming convention | IN PROGRESS | — | #22067 |
Decisions made
- Eight
doc.gofiles, not one. Each subpackage gets its own godoc-style narrative so thatgo doc mochi/transpiler3/c/loweris a useful first page for a contributor. The roottranspiler3/c/doc.gocarries only the pipeline diagram and cross-references. runtime/include/doc.goandruntime/src/doc.goexist even though those dirs hold only C. Keeping them as Go packages meansgo vet ./transpiler3/c/...walks the subtree without erroring andgo docsurfaces the runtime layout next to the Go packages.- Fixture directory layout is phase-grouped.
tests/transpiler3/c/fixtures/<phase-area>/<fixture-name>/puts hello next to other Phase 1 fixtures, match next to other Phase 4 fixtures, and so on. The phase ownership is visible in the path; no extra registry file required. - Per-target expected output uses
expect.<triple>.txtoverrides. Phase 11 needs cross-target output flexibility for rare cases (byte order, native int width). The harness picks the most-specificexpect.*.txtmatch; defaultexpect.txtcovers everything else.
Deferred work
- Per-phase substrate vendoring (BDWGC, mimalloc, minicoro, cwisstable, yyjson, libcurl, utf8proc / simdutf) is documented in
runtime/doc.gobut not yet imported. Each phase pulls in the substrate piece it needs (Phase 3 for cwisstable, Phase 9 for minicoro, Phase 14 for libcurl, ...). transpiler3/c/toolchain/zig/manifest.goSHA-256 pins are deferred to Phase 1.3, when the download path lands.
Closeout notes
Fill in after gate goes green.