Embedded peer content
Status: open/planned · Kind: module · Audience: system
Summary
Section titled “Summary”- Mermaid, JSON Canvas, and future embedded formats are opaque tagged payload spans in the core — losslessly preserved, never modeled in the markdown AST enum — with typed parsing delegated to sibling crates through the contract’s leaf extension point.
- JSON Canvas is the governance model: an independently versioned peer spec referenced from markdown, not a grammar extension.
- Specialized editors and parsers over these sections attach at this seam later.
Statement
Section titled “Statement”The fleet embeds structured non-markdown content — mermaid diagrams, JSON Canvas,
.base queries, future DSLs — and needs typed handling without uglifying the core Rust
API. The core sees a fenced block or embed as a tagged span: language/type tag plus raw
bytes, preserved like any token run. A sibling crate registered against that tag (via
the contract plane’s BlockKind/LeafSpec extension point) parses, validates, and
types the payload, emitting the same Finding shape as every other plane. Adding a
format is a new crate and a registration, never a core change.
What it provides
Section titled “What it provides”- Opaque payload spans with tag + raw bytes + position, lossless under C-N6RH-lossless-roundtrip-io.
- A registration seam for payload validators/parsers keyed by tag.
- First sibling crates:
jsoncanvas(exists inrust-markdown, 55+ tests — relocates to the ecosystem home), mermaid syntax validation (future). - Peer-file awareness:
.canvasand.basefiles as vault citizens in C-T9GW-vault-model-and-transforms and C-V5JD-vault-query-and-index.
Deliberately last in sequencing — the user’s corollary requirement. The seam ships with the contract plane; the sibling crates accrete on demand.