Skip to content

Markdown frontmatter framing

State: open/verified · Kind: module · Audience: system

  • Byte-exact Markdown frontmatter framing: splits a note into verbatim YAML and body with source offsets, and recomposes it losslessly, preserving BOM, CRLF, and fence bytes.
  • Tier-0 floor of the Markdown ecosystem — no YAML parsing, no filesystem, no dependencies beyond std — realized as a Rust crate and a pure-TypeScript peer port held identical by one shared conformance corpus.

The fleet needs comment- and byte-preserving frontmatter handling below any YAML parser or CST, in both Rust and TypeScript runtimes that cannot always reach compiled WASM (Nuxt, Astro, the browser). packages/rust/markdown-util is the reference implementation, carved out of determined-vault’s frontmatter.rs (M-6TQL, closed/done); packages/ts/markdown-util mirrors it function-for-function rather than wrapping it, and both are pinned identical by a shared conformance corpus so a framing change in either language fails the other’s suite.

  • split / compose / split_lenient over a note’s frontmatter fence, with NoteShape/Split fidelity types (BOM, open/close EOL, close-separator).
  • Tolerance for BOM, CRLF, and missing/malformed terminators — a splitter that degrades rather than throws.
  • One shared conformance corpus (packages/rust/markdown-util/tests/fixtures/conformance.json) proving Rust and TypeScript stay byte-identical.
  • A pure-TypeScript runtime deliberately independent of WASM, so it runs in Node, Nuxt, Astro, and the browser alike.
  • packages/rust/markdown-util — tier-0 reference crate, std-only.
  • packages/ts/markdown-util — peer TypeScript port, no dependencies.
  • Consumed by solutions/ontological/lib/util/frontmatter.ts, packages/ts/agent-plugin/frontmatter.ts, and vault-graph’s parse path (per M-D3KP).
  • packages/ts/markdown-util/
  • packages/rust/markdown-util/

← Back to Capabilities