Part of the WebMEM Protocol
Location: /specification/sdt/yaml-in-html/header/
Last Updated: 2025-07-28
Overview
The SDT Fragment Header is a required YAML block placed at the top of every YAML-in-HTML memory fragment. It declares the class, scope, entity, glossary alignment, and digest grouping that govern how the fragment is retrieved, cited, and trusted.
These header values must be mirrored in the outer <template> tag’s data-* attributes to enable AI discoverability, DOM scanning, and export tooling.
Canonical YAML Header Fields
| Field | Required | Description |
|---|---|---|
data-sdt-class |
✅ | Fragment type (e.g., DataFragment) |
entity |
✅ | Real-world subject of the fragment (e.g., plan:H5521-290-0) |
digest |
✅ | Digest collection ID this fragment belongs to |
glossary_scope |
⚠️ Recommended | Term namespace for glossary alignment |
fragment_scope |
✅ | Semantic publishing scope (e.g., semantic-digest) |
Canonical HTML Attribute Equivalents
These data-* attributes must appear on the outer <template> tag and match their YAML equivalents exactly.
| Attribute | YAML Equivalent | Required | Purpose |
|---|---|---|---|
data-sdt-class |
data-sdt-class: |
✅ | Fragment type |
data-entity |
entity: |
✅ | Entity identifier |
data-digest |
digest: |
✅ | Digest ID |
data-glossary-scope |
glossary_scope: |
⚠️ | Glossary alignment context |
data-fragment-scope |
fragment_scope: |
✅ | Publishing or memory layer |
data-type="text/yaml" |
— | ✅ | Format declaration for YAML parsing |
data-visibility-fragment |
— | ✅ | Declares the fragment as AI-visible |
Example: YAML Fragment Header
data-sdt-class: DataFragment
entity: plan:H5521-290-0
digest: 2025-cms-ma-mapd-plan
glossary_scope: cms_landscape
fragment_scope: semantic-digest
Example: Equivalent HTML Fragment
<template
id="fragment-h5521-290-0-primary-care"
data-visibility-fragment
data-type="text/yaml"
data-sdt-class="DataFragment"
data-entity="plan:H5521-290-0"
data-digest="2025-cms-ma-mapd-plan"
data-glossary-scope="cms_landscape"
data-fragment-scope="semantic-digest">
Implementation Rule
If
data-*attributes are provided on the<template>tag, they must exactly match the values in the YAML Fragment Header.
The outer tag assists with detection. The YAML header governs memory alignment, glossary resolution, and trust scoring.