Run artifact

workspace/targets/commonmark/ANALYSIS.md

Blueprint Analysis: commonmark

Commander Expectations

Crew

CrewCharge
CommanderDefines intent and decides what done means.
Team LeadConfirms epic completeness and stakeholder expectations.
Planning CrewAuthors atomic specifications and the ordered Manifest.
Shipyard CrewBuilds the tickets without synchronous Commander access.

Story List

Feature: Executable and Block Engine

IDStoryHigh-level AC
CMK-001Executable entry point, line intake, and README./commonmark is executable, reads all of stdin as UTF-8, and writes HTML to stdout. LF, CR, and CRLF are line endings. U+0000 becomes U+FFFD. README.md describes the stdin/stdout interface.
CMK-002Block parsing engine, paragraphs, and blank linesPer-line open-block matching, new block starts, and text accumulation follow the Appendix procedure. Paragraphs render as <p> with HTML escaping. Sections Paragraphs and Blank lines pass.

Feature: Leaf Blocks

IDStoryHigh-level AC
LEAF-001Thematic breaksSection Thematic breaks passes, including precedence over setext underlines and list items.
LEAF-002ATX headingsSection ATX headings passes, covering levels 1-6, closing sequences, escapes, and empty headings.
LEAF-003Setext headingsSection Setext headings passes, covering multiline content and the lazy-continuation exclusions.
LEAF-004Indented code blocksSection Indented code blocks passes, covering chunks, blank-line handling, and the paragraph-interruption rule.
LEAF-005Fenced code blocksSection Fenced code blocks passes, covering backtick and tilde fences, indentation stripping, info strings, and unclosed fences.
LEAF-006HTML blocksSection HTML blocks passes for all seven start/end condition kinds, including the rule that type 7 cannot interrupt a paragraph.
LEAF-007Link reference definitions and label matchingSection Link reference definitions passes. Definitions are extracted when a paragraph closes, the first definition wins, and labels are normalized with Unicode case fold and whitespace collapse.

Feature: Container Blocks

IDStoryHigh-level AC
CONT-001Block quotesSection Block quotes passes, including laziness and consecutiveness rules.
CONT-002List itemsSection List items passes for markers, indentation rules 1-6, empty items, start numbers, and lazy continuation.
CONT-003Lists, tight and looseSection Lists passes: same-type grouping, the one-start-number interruption rule, and tight/loose <p> rendering.
CONT-004Tabs in block-structure contextsSection Tabs passes: tabs act as a 4-column tab stop for block structure and are never expanded in content.

Feature: Inline Parsing

IDStoryHigh-level AC
INL-001Code spans and inline precedenceSections Code spans, Inlines, and Precedence pass, including backtick-string matching, line-ending and space normalization, and precedence against HTML and autolinks.
INL-002Backslash escapesSection Backslash escapes passes. Escapes are honored in text, link destinations and titles, and info strings, and are inert in code and raw HTML.
INL-003Entity and numeric character referencesSection Entity and numeric character references passes, covering the HTML5 named-entity set, decimal and hex ranges, and U+FFFD substitution.
INL-004Emphasis and strong emphasisSection Emphasis and strong emphasis passes using flanking rules and the delimiter-stack algorithm from the Appendix.
INL-005Links: inline, full, collapsed, and shortcutSection Links passes: destination and title grammar, bracket matching, no nested links, reference resolution, and URL percent-encoding.
INL-006ImagesSection Images passes, covering plain-text alt rendering and all four link forms.
INL-007AutolinksSection Autolinks passes for URI and email autolinks.
INL-008Raw inline HTMLSection Raw HTML passes for open and closing tags, comments, processing instructions, declarations, and CDATA.
INL-009Hard breaks, soft breaks, and textual contentSections Hard line breaks, Soft line breaks, and Textual content pass.

Feature: Conformance Verification

IDStoryHigh-level AC
VER-001Complete conformance suite passessh sources/full_test.sh exits 0. The unfiltered supplied suite passes with no failures or errors.

Story Guidance

Named stories planning must produce. Authoritative record: STORY_GUIDANCE.json.

None.

Surfaced Acceptance Criteria

IDStory IDCriterion
AC-001CMK-001Empty standard input produces empty standard output and exit status 0.
AC-002CMK-001Bytes on standard input that are not valid UTF-8 are decoded with U+FFFD replacement; the program exits 0 and emits no traceback.
AC-003CMK-001Standard output carries only rendered HTML; any diagnostics go to standard error.

Source Inventory

PathContent kindDispositionReason
sources/INSTRUCTIONS.mdmarkdownanalyzedreadable UTF-8
sources/cmark.pycodeanalyzedreadable UTF-8
sources/full_test.shcodeanalyzedreadable UTF-8
sources/normalize.pycodeanalyzedreadable UTF-8
sources/spec.txttextchunkedsplit into 18 bounded chunks
sources/spec_tests.pycodeanalyzedreadable UTF-8

Relationship Model

Source or groupRelationship typeRelated source or groupEvidenceDelivery implication
sources/INSTRUCTIONS.mdinstruction-to-testsources/full_test.sh"sources/full_test.sh is the single scoring entry point"; terminal story runs sh sources/full_test.shOne terminal Suite: full story carries Sea Trial st-001; all others stay scoped.
sources/full_test.shtest-kit-to-implementation./commonmarkChecks [ -x ./commonmark ], then runs spec_tests.py --program "$PWD/commonmark"The executable must exist at the application root and be directly runnable.
sources/full_test.shdependencysources/spec_tests.pyInvokes python3 sources/spec_tests.py --spec sources/spec.txt and requires 0 failed, 0 errored, 0 skippedRunner, spec, and helpers must all be staged.
sources/spec_tests.pydependencysources/cmark.pyfrom cmark import CMark; pipe_through_prog spawns the program with the Markdown on stdinProgram contract is stdin to stdout, UTF-8, exit 0.
sources/spec_tests.pyparser-to-normalizersources/normalize.pynormalize_html is applied to both expected and actual HTMLWhitespace and attribute-order differences are tolerated; tag structure is not.
sources/spec_tests.pytest-kit-to-implementationsources/spec.txtget_tests extracts examples and assigns each to its nearest preceding heading as sectionSections that own examples are the unit for scoped selectors.
sources/spec.txt (Appendix)reference-to-replacement./commonmark"follow it directly rather than reinventing the rules"The block procedure and the delimiter-stack algorithms are the design basis.

Source Roles

PathRolePlan dispositionBuild disposition
sources/INSTRUCTIONS.mdauthor intentcompassprompt-only
sources/spec.txtnormative specification and conformance test suitecontextstage
sources/spec_tests.pyconformance harnesscontextstage
sources/cmark.pytest helpercontextstage
sources/normalize.pytest helpercontextstage
sources/full_test.shconformance harnesscontextstage

Planning Instructions

Delivery Shape

The system is a single-process CLI: ./commonmark reads UTF-8 Markdown from stdin and writes HTML to stdout. The implementation has two phases.

A renderer turns the tree into HTML. The test runner compares normalized HTML, so whitespace and attribute order are not significant but tag structure, entities, and URL percent-encoding are.

Story Realization Map

All stories realize a capability inside the single executable. Evidence comes from sources/spec.txt, from the section named in the story, and from the Appendix.

StoryScope and evidence
CMK-001Capability and acceptance contract. Evidence: sources/INSTRUCTIONS.md, sources/full_test.sh, sources/cmark.py, and the spec sections "Characters and lines" and "Insecure characters".
CMK-002Capability: tree, per-line procedure, paragraph rendering. Evidence: Appendix "Phase 1: block structure"; sections Paragraphs and Blank lines.
LEAF-001 to LEAF-006One capability per same-named spec section. Each is a block start/continue/close rule plus renderer output.
LEAF-007Capability: definition parsing on paragraph close, plus the label normalization shared with INL-005 and INL-006. Evidence: sections Link reference definitions and Links ("matches").
CONT-001 to CONT-003Container capabilities: quote markers, list marker and indentation rules, laziness, list grouping, and tight/loose computation.
CONT-004Capability on the shared column-aware indentation logic. Evidence: section Tabs.
INL-001, INL-002, INL-003, INL-007, INL-008, INL-009Inline capabilities, one per same-named section. INL-003 needs the HTML5 entity table; the spec names entities.json as the authority.
INL-004, INL-005, INL-006Share one delimiter stack. INL-004 owns */_ delimiter runs and process-emphasis. INL-005 owns [/![ handling and look-for-link-or-image. INL-006 reuses INL-005.
VER-001Acceptance contract only, running sources/full_test.sh.

Test and Acceptance Strategy

StorySections
CMK-002Paragraphs, Blank lines
INL-001Code spans, Inlines, Precedence
INL-009Hard line breaks, Soft line breaks, Textual content
Remaining storiesThe same-named section

Sequencing and Dependencies

Source Conflicts and Gaps

Analysis Notes

generated: 2026-10-14 blueprint: /mnt/c/Users/barlo/projects/drydock/uat/CommonMark/runs/20261014.053711/workspace/targets/commonmark/blueprint

Quality: Ready blockers: 0 questions: 0 features: 5 stories: 23 stack: not declared display_name: not proposed short_description: A CommonMark 0.31.2 parser executable that converts Markdown on standard input to HTML on standard output.

Project type: cli. The program takes no sub-verbs, so there is no per-command help baseline to define. The only open items are the pre-filled identity confirmations.