Skip to content

docs(adr): ADR-0051 — inline metadata views in docs (metadata fenced block)#1940

Merged
os-zhuang merged 1 commit into
mainfrom
docs/adr-0051-metadata-views
Jun 16, 2026
Merged

docs(adr): ADR-0051 — inline metadata views in docs (metadata fenced block)#1940
os-zhuang merged 1 commit into
mainfrom
docs/adr-0051-metadata-views

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

Adds ADR-0051, specifying how an author embeds a live, read-only metadata view inside a doc — the ```metadata fenced block.

This concretizes a concept ADR-0046 already reserved but never gave a syntax:

  • §3.5 — derived content (field dictionaries, validation conditions, permission matrices) is a metadata view the platform renders live, never authored prose.
  • §6.7 — the anonymous guardrail already names "inline metadata views / live metadata embed".

Key decisions

  • Syntax: a ```metadata fenced block whose body is a declarative reference (type/name/object/mode/detail). Chosen over directives/MDX because a fenced block is already-legal CommonMark per §3.4 — it does not reopen the MDX/directive ban.
  • Data, not code: the body is a reference resolved by the platform's own trusted component, so it stays on the data side of the ADR-0025/§3.4 trust boundary that banned MDX. (A general objectui body could carry CEL/actions = code → deferred.)
  • One runtime: compiles 1:1 to a new read-only element:metadata_viewer SDUI component (ComponentPropsMap, embeddableInDoc). One component model, one schema, one permission path — no parallel renderer.
  • Live transclusion: rendered from current metadata at read time — change the flow, the doc's diagram changes. Two projections kept separate: authored detail (altitude) vs automatic, render-time permission projection.
  • Kernel unchanged: doc.content stays inert (§3.1); resolution is render-time only. Inherits §6.7 anonymous degradation verbatim.
  • Scope: metadata-only, phased state_machineflowpermission; object and a general ```objectui fence explicitly deferred.

Scope of this PR

Documentation only — one new file under docs/adr/. No code/spec changes; the MetadataEmbedSchema and element:metadata_viewer shapes shown are illustrative and settle in a follow-up spec PR (P1).

🤖 Generated with Claude Code

…block)

Concretizes the "inline metadata views" ADR-0046 §3.5/§6.7 already
reserved but left without a syntax. A ```metadata fenced block compiles
to a new read-only `element:metadata_viewer` SDUI component, resolved
live and permission-projected at read time.

Key decisions:
- Fenced code block (already-legal CommonMark per §3.4) over
  directives/MDX — does not reopen the trust boundary.
- Body is a declarative reference (data, not code), so it stays on the
  data side of the ADR-0025/§3.4 boundary that banned MDX.
- Compiles 1:1 to one ObjectUI component — one runtime, one schema, one
  permission path; no parallel renderer.
- Kernel unchanged: doc.content stays inert (§3.1); resolution is
  render-time only.
- Scope metadata-only, phased state_machine -> flow -> permission;
  `object` and a general `objectui` fence deferred.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 16, 2026 5:55am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant