Compass
Reference

Document format reference

This page records the current deterministic document boundaries. A file can be discoverable without having a structural extractor; consumers should inspect…

Document format reference

This page records the current deterministic document boundaries. A file can be discoverable without having a structural extractor; consumers should inspect the graph producer and diagnostics rather than infer support from an extension alone.

Markdown

ConstructCurrent behaviorProvenance
ATX / Setext headingsHeading node, hierarchy, slug, optional explicit IDexact node range
Paragraphs and inline textParagraph blockexact node range
Lists and task itemsList/list-item blocks; task_checked when presentcontains + exact ranges
Block quotes and thematic breaksStructural blockexact node range
Fenced / indented codeCode block; fenced info string becomes languageexact node range
Pipe tablesTable, header, row, and cell blocksnested contains edges
Reference definitionsDefinition block and definition relationshipdefinition range
Inline/reference/autolinksLink relationship with link_kindlink-site range
FootnotesBounded definition nodes and reference relationshipsexact definition/reference ranges
WikilinksLocal link evidence with link_kind: "wikilink"link-site range
MDX / Quarto extensionsBounded other blocks; no executionexact source range
ImagesIgnored as document relationshipsno fetch or edge
FrontmatterBounded document_metadata maproot metadata; body offsets unchanged
Malformed syntaxRecovered evidence plus bounded diagnosticextraction quality extension

Markdown is parsed from the caller-supplied bytes with statically linked Tree-sitter block and inline grammars. Supported source extensions are .md, .markdown, .mdx, .qmd, and .skill.

Stable fields

Document and block nodes retain the common graph fields id, label, file_type, document_kind, source_file, _origin, start_byte, end_byte, start_line, end_line, column_start, and column_end where applicable. Markdown-specific root extensions include:

  • markdown_block_count;
  • markdown_link_count;
  • markdown_diagnostics;
  • markdown_unresolved_links;
  • markdown_external_links.
  • markdown_footnote_count and markdown_other_count.

These fields are extensible graph attributes. Consumers must preserve unknown attributes and must not parse stable IDs as path components.

Frontmatter limits

  • opening and closing delimiters must be whole lines within 64 KiB;
  • at most 256 metadata keys and 256 scalar-array items are published;
  • individual metadata keys and strings are capped at 16 KiB;
  • nested mappings, YAML tags/aliases, and non-scalar arrays are diagnosed and omitted rather than projected as arbitrary graph data.

External links are recorded as evidence but never fetched. Same-file fragments resolve only to a unique heading slug or explicit ID. Ambiguous and missing fragments are explicit unresolved evidence. Unsupported local suffixes and missing document targets do not create invented nodes.

HTML

ConstructCurrent behaviorProvenance
Title and headingsTitle metadata/node; h1h6 heading nodes with levelsexact element range
main/article/section/navLandmark nodes in source orderexact element range
Paragraphs, lists/items, block quotesSemantic nodes and contains edgesexact element range
pre/codePreformatted/code nodes; visible text excludes scriptsexact element range
Tables, rows, cellsTable hierarchy including th/tdexact element range
Anchors and resource linkshref/rel attributes plus local/external evidencelink element range
meta, canonical, baseBounded root metadata and link evidenceelement/link range
Entities and whitespaceDecoded visible text; block order preservedsource-backed node ranges
script, style, template, noscriptEntire subtree skippedno graph node or link
Malformed markupTree-sitter recovery plus bounded diagnosticsrecovery/root range

HTML uses the exact pinned tree-sitter-html binding and the source-driven Engine::extract_source API. URL ingestion calls the same compass_languages::normalize_html renderer. Relative URLs are resolved lexically against the validated source/base URL, never fetched.

Discovery versus structural extraction

FormatDiscovery classificationStructural extractor in this release
HTML / HTMdocumentstructural Tree-sitter adapter and shared ingestion renderer
DOCXdocument/mediamedia conversion surface; no native block graph
PPTXnot a general local document adapternot yet
RTFnot a general local document adapternot yet
XLSXdocument/mediamedia conversion surface; no native block graph
TXT / RSTdocumentgeneric/document fallback only

This distinction keeps product claims honest: future office and rich-text work must add bounded parsing, exact or explicitly normalized locators, security tests, and cache/version contracts before it becomes graph evidence.

On this page