Skip to main content

Module parse

Module parse 

Source
Expand description

File -> parsed artifact: the oracle’s decided.core.markdown.parse / parse_file composition of the markdown body walk (markdown.rs) with the frontmatter envelope (frontmatter.rs), per PORT-CONTRACT.d/04 §0 and PORT-CONTRACT.d/09 §1.7.

The markdown module owns the body surfaces (sections, requirements, titles, parse budget issues) and the raw read path; this module attaches product.metadata / product.metadata_issues exactly as the oracle’s parse does:

split = split_frontmatter(text)
if split.raw is not None:
    metadata, metadata_issues = parse_frontmatter(split.raw)
elif split.unterminated:
    metadata_issues = [malformed-frontmatter "never closed"]

The unterminated case is already emitted by markdown::parse; the raw is not None case is completed here.

Structs§

Artifact
A parsed artifact: the markdown Product plus the frontmatter metadata the oracle’s Product.metadata carries.
Issue
One validation/parse finding, unified across the frontmatter, markdown, and validation subsystems. Field order mirrors the Python Issue dataclass (severity, code, message, line) — asdict emission order.

Functions§

parse_file
decided.core.markdown.parse_file(path) with metadata attached.
parse_text
decided.core.markdown.parse(text, source_path) with metadata attached.