Run artifact

workspace/targets/commonmark/blueprint/ARCHITECTURE.md

ARCHITECTURE: CommonMark Parser

FieldValue
Version20260812 V1
DescriptionDefines the two-phase Python CommonMark parser architecture and runtime boundaries.
Depends On
Providesparser architecture, block parser boundary, inline parser boundary, renderer boundary
Consumes

Intent

CommonMark is a command-line parser that reads UTF-8 Markdown from standard input, parses block structure before inline structure, renders CommonMark 0.31.2 HTML, and writes the result to standard output.

Module Boundaries

BoundaryResponsibility
Executable entry pointReads standard input, invokes parsing and rendering, writes standard output, and reports process failures.
Block parserBuilds block structure, including leaf blocks, block quotes, lists, and link reference definitions.
Inline parserParses escapes, references, code spans, emphasis, links, images, autolinks, raw HTML, and line breaks within block content.
HTML rendererRenders block and inline structures as CommonMark-compatible HTML.
Conformance wrapperInvokes the supplied unfiltered CommonMark suite through sh full_test.sh.

The parser separates block parsing from inline parsing. Link reference definitions discovered during block parsing are available to inline parsing. The renderer consumes the completed parsed structure and does not determine block structure.

Technology Stack

Constraints

Programmatic Acceptance

=== AC architecture-boundaries ===
Intent: The implementation exposes separate block, inline, rendering, and executable boundaries.

from pathlib import Path

required = [ Path("cmark"), Path("parser"), Path("renderer"), ] assert all(path.exists() for path in required) === END AC architecture-boundaries ===

=== AC architecture-runtime-contract ===
Intent: The runtime contains the required POSIX conformance wrapper boundary.

from pathlib import Path

wrapper = Path("full_test.sh") assert wrapper.is_file() assert wrapper.read_text(encoding="utf-8").startswith("#!") === END AC architecture-runtime-contract ===

User Acceptance

Guardrails