Skip to content

Commit e4826b2

Browse files
wmaddenclaude
andcommitted
docs(target-contributed-psl-blocks): declarative SPI respec
Reshapes the project from a function-based PSL-block SPI to a declarative one: an extension describes a block as data (keyword, name, typed parameters ref/value/option/list) and the framework owns one generic parser/validator/printer. Rewrites spec.md + plan.md (four-slice composition), banners ADR 126 (superseded function SPI; full rewrite is the close-out slice), and banners the superseded #718 dispatch plan. Docs only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Will Madden <madden@prisma.io>
1 parent f8e89b3 commit e4826b2

4 files changed

Lines changed: 247 additions & 226 deletions

File tree

docs/architecture docs/adrs/ADR 126 - PSL top-level block SPI.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# ADR 126 — PSL top-level block SPI
22

3+
> **⚠️ Under revision (2026-06) — the function SPI below is superseded by a declarative descriptor.**
4+
>
5+
> This ADR records a `parseFn` / `validateFn` / `emitFn` *function* SPI: each extension ships imperative code to parse and emit its block. That shape is being replaced. The decision now is that an extension **describes** a top-level block as data — its keyword, name, and typed parameters (`ref` / `value` / `option` / `list`) — and the framework owns **one generic parser / validator / printer** that interprets any declared block. No extension-supplied parse/print code runs.
6+
>
7+
> Why: the PSL grammar is closed and uniform, so a block's structure can be described as data and validated/analysed without executing extension code; the function SPI re-implements parsing the framework already does and can't be inspected from its data. `value` rides the existing codec/type system (same rails as field types and `@default`); `option` is an authoring-time parameter constraint, **not** a domain or persistence enum (enums-as-domain is a separate project — PR #748).
8+
>
9+
> The authoritative current design is `projects/target-contributed-psl-blocks/spec.md`. This ADR is rewritten against the as-shipped substrate in the project's close-out slice (TML-2806). Treat the sections below as historical until then.
10+
311
## Context
412

513
We want third-party packs to add first-class domain constructs to PSL, such as `pg.view`, `pg.materializedView`, or `pg.enumType`. Today PSL does not allow external authors to register new top-level blocks or define new block-level attributes. Without an extension SPI, every new database concept forces a core change, which conflicts with our thin-core, fat-targets approach.

0 commit comments

Comments
 (0)