|
5 | 5 |
|
6 | 6 | ## At a glance |
7 | 7 |
|
8 | | -Four slices: one **foundation slice** (slice 0) that makes M:N a validatable contract shape and surfaces the shared `through` descriptor, then a **three-way parallel fan-out** — read, filter, write — each consuming slice 0's hand-off and independent of the others. |
| 8 | +**Runtime core (slices 0–3, complete):** one **foundation slice** (slice 0) makes M:N a validatable contract shape and surfaces the shared `through` descriptor, then a **three-way parallel fan-out** — read, filter, write — each consuming slice 0's hand-off. |
| 9 | + |
| 10 | +**Follow-on (slices 4–6, added 2026-06-02):** demo examples + authoring-surface completeness — SQLite demo examples (done), PSL M:N authoring (a framework gap surfaced while adding the demos), and PG demo examples (blocked by the PSL work). See [§ Follow-on slices](#follow-on-slices--authoring-completeness--demos). |
9 | 11 |
|
10 | 12 | ## Composition |
11 | 13 |
|
@@ -45,3 +47,28 @@ Four slices: one **foundation slice** (slice 0) that makes M:N a validatable con |
45 | 47 | ## Sequencing rationale |
46 | 48 |
|
47 | 49 | Slice 0 is a hard gate, not a stylistic choice: until the contract validates an M:N relation and the resolver surfaces `through`, slices 1–3 have no validatable integration fixture to test against and nothing to read `through` from. Once slice 0 lands, the three consumers touch disjoint files (`query-plan-select.ts` / `model-accessor.ts` / `mutation-executor.ts`) and share only the read-only `ResolvedRelation.through` field — no write-write contention — so they parallelise cleanly. They are sequenced after 0 purely by data dependency, not by reviewer pacing. |
| 50 | + |
| 51 | +## Follow-on slices — authoring completeness + demos |
| 52 | + |
| 53 | +Added 2026-06-02 after the runtime core (0–3) shipped: while adding M:N **demo examples** we found the navigable M:N API is authorable **only via the TS contract builder** (`rel.manyToMany`), not PSL — so the PG demo (PSL-emitted) can't yet show it. These slices close that gap. Each is its own slice spec under `slices/`. |
| 54 | + |
| 55 | +- **Slice `04-sqlite-demo-examples`** — Linear: [TML-2790](https://linear.app/prisma-company/issue/TML-2790) — **DONE.** |
| 56 | + - **Outcome:** the SQLite demo (`examples/prisma-next-demo-sqlite`, TS-authored) demonstrates the full M:N API: `Post ↔ Tag` via `PostTag`, with include / `some`/`none`/`every` filter / nested `connect`/`disconnect`/`create` ORM modules + CLI commands + seed, smoke-tested end-to-end. |
| 57 | + - **Builds on:** slices 0–3 (the runtime M:N feature). |
| 58 | + - **Hands to:** a worked reference for the M:N ORM API (the PG demo, slice 6, mirrors it once unblocked). |
| 59 | + |
| 60 | +- **Slice `05-psl-many-to-many-authoring`** — Linear: [TML-2794](https://linear.app/prisma-company/issue/TML-2794) — **planned.** |
| 61 | + - **Outcome:** PSL can author a navigable M:N relation — the interpreter lowers a junction (explicit `@@id([a,b])` join model and/or implicit `Tag[]` list) to `cardinality:'N:M'` + a `through` descriptor, parity with the TS builder. |
| 62 | + - **Builds on:** slice 0's contract `through` shape (the lowering target). |
| 63 | + - **Hands to:** PSL-authored M:N → unblocks the PG demo (slice 6). |
| 64 | + - **Focus:** `packages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.ts` (today emits only `N:1`/`1:N`) + the PSL→RelationNode lowering; recognise/collapse the junction into a `through` relation. **Likely large — re-check slice-INVEST at pickup; may warrant promotion to its own project.** |
| 65 | + |
| 66 | +- **Slice `06-pg-demo-examples`** — Linear: [TML-2795](https://linear.app/prisma-company/issue/TML-2795) — **planned, blocked by slice 5.** |
| 67 | + - **Outcome:** the PG demo (`examples/prisma-next-demo`) demonstrates the M:N API (mirroring slice 4), AND its pre-existing dual-mode contract drift (stale TS source / missing TS-builder discriminator authoring) is reconciled. |
| 68 | + - **Builds on:** slice 5 (PSL M:N authoring — the PG demo emits from PSL); slice 4 (the example shape to mirror). |
| 69 | + - **Hands to:** M:N demonstrated in both demos; dual-mode green. |
| 70 | + - **Focus:** add `Post ↔ Tag` M:N to the PSL source + example modules/CLI/seed/tests; resolve dual-mode (`test:dual-mode` is currently red on the TS leg — fix the TS source or drop it). The dual-mode-drift half is independent of slice 5 and can start first. |
| 71 | + |
| 72 | +### Sequencing (follow-on) |
| 73 | + |
| 74 | +Slice 4 (done) and the **dual-mode-drift half of slice 6** are independent and could have run anytime after the core. Slice 5 (PSL authoring) gates the **M:N-examples half of slice 6**. Note this pushes the project to **7 slices** — past the 1–4 sweet spot; slice 5 in particular is framework-scoped and may be better promoted to its own project at pickup (flagged above). |
0 commit comments