Skip to content
Toolkit

ADR-0067 — A block type ships its own descriptor

  • Status: Accepted
  • Date: 2026-08-27
  • Deciders: Repository owner, track 003 phase 03
  • Follows: ADR-0030 (identity vocabularies are generated packages, runtime data is served, no dynamic code loading), ADR-0055 (the descriptor is the crosswalk; derived addresses are served), ADR-0056 (the parity gate takes a case or a render spec), ADR-0057 (the render path is React; the label is served)

Context

Phase 02 closed with 79 of 85 arms drawn from the render spec. Everything a block needs at render time is now served except one thing:

what a block needswhere it comes from
its display labelserved — type_name (ADR-0057)
its settings formserved — BlockTypeInfo.Fields
a derived addressserved — embed_url (ADR-0055)
how it drawscompiled — packages/block-model/blocks.json

So a block type registered in block_types.go today appears in the palette, collects its settings, arrives labelled, and then draws as a generic link, because nothing tells the renderer which shape it is. That single compiled file is what stands between the registry and phase 03's outcome: a new block type registered server-side appears and renders with zero apps/web changes.

The tempting fix — ship the whole crosswalk from the server, or generate it into Go — solves the wrong half. The 85 types the crosswalk describes are already in the build that renders them; re-serving them adds a copy to keep in step for no gain. The types that need serving are the ones the build has never heard of.

Decision

A registry entry may carry its own render spec, and a served spec wins. BlockTypeInfo gains an optional RenderSpec — kit_type, props, style — which ships beside the block on the public payload (like type_name and embed_url) and on the block-types catalogue the editor already caches, so canvas preview stays what a visitor sees. renderFromSpec reads the served descriptor when there is one and packages/block-model when there is not.

Served wins because a block type is defined server-side. The compiled crosswalk is the account of the 85 types that predate serving, not a rival authority over types registered after it.

This is data, not code. The render kinds stay compiled and closed. A served spec selects among them by kit type; one naming a kit type no kind implements is declined exactly as an unmigrated arm is, and the generic-link fallback stands. Nothing is loaded, fetched or evaluated, so ADR-0030's "no dynamic code loading" holds — what a served spec can express is bounded by the parseBinding grammar and the kinds already shipped.

Both parity gates widen the way ADR-0056 widened the first one. check:block-model's B1 and check:block-registry's R1 accept a registered type that has no descriptor and no case when its entry serves a spec. Without that, the gates would fail the exact thing this ADR enables.

The demonstration is a demonstration, not an assertion. The claim is proven at the seam from both sides: a Go handler test registers a type the crosswalk has never described and reads its spec off the payload; a frontend test feeds that payload shape to the renderer and gets a drawn block with the served label. Neither side is allowed to assert the other's behaviour.

Consequences

  • A new block type ships in one Go change: registry entry, fields, render spec. No frontend deploy, and no apps/web diff.
  • What such a type can draw is bounded by the kinds already compiled. A type wanting a shape no kind implements still needs a frontend change — and that is the honest boundary, not a limitation to paper over: the frontend owns how Cardsite looks.
  • Two descriptors can now describe one type, with the served one winning. That is deliberate precedence, not drift: the compiled crosswalk stays the record for the 85, and check:block-model keeps holding it to them.
  • A served spec is untrusted-shaped input to the render path in the same sense the settings blob already is: it selects a kind and supplies bindings, both of which the frontend validates before drawing.
  • Phase 03 has its mechanism and its proof at the seam. Closing the phase wants the same demonstration against a running stack — one page, one new type, one render — which is the next item, not this one.

Source: docs/decisions/0067-a-block-type-ships-its-own-descriptor.md

Library