Spec Studio

Inline code is content, never markup

spec:carrier.inline-code-spansBusiness Rule · storyready floor ready

Packs: pack:self-hosting-v1

Design: no design entries · no pinned declarations · no decisions

Findings: no errors, no warnings

specs/carrier/inline-code-spans.sdp.md

No open questions and no blocking questions; implementation binding present, verifier binding present, and expected-outcome oracle present.

CommonMark lets a code span cross a line ending inside a paragraph, lets a backslash escape a backtick, and lets an HTML tag that opens before a backtick pair win over the span. The Protocol reads all three cases the other way. A span is a pair of equal backtick runs on one line, and nothing else changes that, so an author or an agent can tell by eye what a span shields, every location reads a span the same way, and a carrier that validates today stays valid. The cost is that a CommonMark renderer may show these rare constructs differently from how the Protocol reads them.

Intent
problem
Authors need to write type parameters inside code spans without the raw-HTML guard forcing a private bracket notation that cannot be pasted into source.
outcome
Let a code span carry any literal text, angle brackets included, while raw HTML outside code spans stays refused.
Rule

The matrix uses matched and unmatched backtick runs of one, two, and three backticks, multiple spans, literal tags and comment delimiters inside spans, exposed HTML before and after spans, closing tags, declarations, processing instructions, and ordinary angle-bracket comparisons. It includes Use <T title=`value>., Use </T`>., and Use <img alt="`">. as refused tag bodies with an unmatched backtick, and Use <!-`x`-> here. as accepted text whose matched span separates the comment delimiter. It also includes Use \`<b>\` here., whose backslashes escape nothing, and Use <a title="`">x` here., whose tag closes inside a matched span, as accepted text.

Paragraph probes run in narrative, section-description and Pack-framing locations; the list-entry location uses only the single-line matrix. The paragraph probes split a single-backtick pair across two lines. One puts Use `Promise<T>. on the first line and Close here`. on the second; another puts Open here `. first and Use Promise<T>`. second. Neither pair shields HTML. A third puts Open here `. first and Use `Promise<T>`. second, so the pair on the second line shields that line despite the unmatched run on the first.

rule.literalSpan line 18 · specs/carrier/inline-code-spans.sdp.md:18
A code span is literal content. The raw-HTML refusal never reads inside one, whether the span sits in a Spec's narrative, a section description, a list entry, or a Pack's framing prose.

spec:carrier.inline-code-spans.description · enabled, spec:carrier.inline-code-spans.list · enabled, spec:carrier.inline-code-spans.narrative · enabled, spec:carrier.inline-code-spans.pack · enabled

rule.lineScoped line 19 · specs/carrier/inline-code-spans.sdp.md:19
A code span opens at a backtick run and closes at the next run of the same length on that same line. Both runs must sit on one line, even inside a paragraph whose next line holds the closing run. An unmatched run is ordinary text and shields nothing.

spec:carrier.inline-code-spans.description · enabled, spec:carrier.inline-code-spans.list · enabled, spec:carrier.inline-code-spans.narrative · enabled, spec:carrier.inline-code-spans.pack · enabled

rule.noEscape line 20 · specs/carrier/inline-code-spans.sdp.md:20
A backslash does not escape a backtick: every backtick run counts when spans are matched, so a backtick written after a backslash still opens or closes a span.

spec:carrier.inline-code-spans.description · enabled, spec:carrier.inline-code-spans.list · enabled, spec:carrier.inline-code-spans.narrative · enabled, spec:carrier.inline-code-spans.pack · enabled

rule.spanBeforeTag line 21 · specs/carrier/inline-code-spans.sdp.md:21
Spans are matched before the raw-HTML test reads what is left of the line, so a tag that opens before a span and closes inside it is no tag, while a tag that opens before a span and closes after it is still refused.

spec:carrier.inline-code-spans.description · enabled, spec:carrier.inline-code-spans.list · enabled, spec:carrier.inline-code-spans.narrative · enabled, spec:carrier.inline-code-spans.pack · enabled

rule.rawHtmlRefused line 22 · specs/carrier/inline-code-spans.sdp.md:22
Raw HTML outside a code span is refused as extract/invalid-markdown-structure with the message raw HTML is unsupported.

spec:carrier.inline-code-spans.description · enabled, spec:carrier.inline-code-spans.list · enabled, spec:carrier.inline-code-spans.narrative · enabled, spec:carrier.inline-code-spans.pack · enabled

rule.storedAsAuthored line 23 · specs/carrier/inline-code-spans.sdp.md:23
The graph stores the line as authored, backticks included. Each projection renders it through the encoding its own Spec requires for that field.

no example exercises it

0 unkeyed rules.

Verifying examples

Code spans in section descriptions are literal · spec:carrier.inline-code-spans.description · ready floor ready

Executable Spec

Given the code-span matrix in {location: "description"}
When the extractor reifies the probes
Then matched spans preserve {accepted: 15} carriers and exposed HTML refuses {refused: 20} carriers

Open example

Code spans in list entries are literal · spec:carrier.inline-code-spans.list · ready floor ready

Executable Spec

Given the code-span matrix in {location: "list"}
When the extractor reifies the probes
Then matched spans preserve {accepted: 14} carriers and exposed HTML refuses {refused: 18} carriers

Open example

Code spans in a Spec narrative are literal · spec:carrier.inline-code-spans.narrative · ready floor ready

Executable Spec

Given the code-span matrix in {location: "narrative"}
When the extractor reifies the probes
Then matched spans preserve {accepted: 15} carriers and exposed HTML refuses {refused: 20} carriers

Open example

Code spans in Pack framing are literal · spec:carrier.inline-code-spans.pack · ready floor ready

Executable Spec

Given the code-span matrix in {location: "pack"}
When the extractor reifies the probes
Then matched spans preserve {accepted: 15} carriers and exposed HTML refuses {refused: 20} carriers

Open example

Example space

Given the code-span matrix in {location:string}
When the extractor reifies the probes
Then matched spans preserve {accepted:number} carriers and exposed HTML refuses {refused:number} carriers
Verification

Verifier bindings

  • spec:carrier.inline-code-spans.description · Code spans in section descriptions are literal · declared · example enabled · specs/carrier/inline-code-spans.description.sdp.md

    External run evidence from test/self-hosting-inline-code.test.ts

    Test anchors: test:protocol.inline-code-spans.description, test:protocol.inline-code-spans.list, test:protocol.inline-code-spans.narrative, test:protocol.inline-code-spans.pack. Specs verified by those bindings: spec:carrier.inline-code-spans, spec:carrier.inline-code-spans.description, spec:carrier.inline-code-spans.list, spec:carrier.inline-code-spans.narrative, spec:carrier.inline-code-spans.pack.

    Run 1: external run evidence from vitest 4.1.10

    Build: CI 380 · Branch: feature/roadmap-and-slices-v0 · Commit: 34909918bf0be0e849959644401797191cae379f · Start: 2026-10-22T17:40:31.456Z · Stop: 2026-10-22T17:42:16.171Z

    NameSuiteResultDuration
    executes the bound example against a fresh worldCode spans in a Spec narrative are literal (spec:carrier.inline-code-spans.narrative)passed63.42 ms
    executes the bound example against a fresh worldCode spans in section descriptions are literal (spec:carrier.inline-code-spans.description)passed21.18 ms
    executes the bound example against a fresh worldCode spans in list entries are literal (spec:carrier.inline-code-spans.list)passed31.9 ms
    executes the bound example against a fresh worldCode spans in Pack framing are literal (spec:carrier.inline-code-spans.pack)passed20.55 ms
  • spec:carrier.inline-code-spans.list · Code spans in list entries are literal · declared · example enabled · specs/carrier/inline-code-spans.list.sdp.md
  • spec:carrier.inline-code-spans.narrative · Code spans in a Spec narrative are literal · declared · example enabled · specs/carrier/inline-code-spans.narrative.sdp.md
  • spec:carrier.inline-code-spans.pack · Code spans in Pack framing are literal · declared · example enabled · specs/carrier/inline-code-spans.pack.sdp.md

Example space

  • location · string · declared by the code-span matrix in {location}

Bound points

Oracle binding: present · oracle:protocol.inline-code-spans · test/self-hosting-inline-code.test.ts:74

Coverage

location: "description" · spec:carrier.inline-code-spans.description; "list" · spec:carrier.inline-code-spans.list; "narrative" · spec:carrier.inline-code-spans.narrative; "pack" · spec:carrier.inline-code-spans.pack · not enumerable

Unbound

  • location: None
Design view

Requirement drawing

Requirement drawing for spec:carrier.inline-code-spans
The diagram as text
  • spec:carrier.inline-code-spans: Inline code is content, never markup · declared Spec
  • spec:carrier.inline-code-spans.description: Code spans in section descriptions are literal · declared Spec
  • spec:carrier.inline-code-spans.list: Code spans in list entries are literal · declared Spec
  • spec:carrier.inline-code-spans.narrative: Code spans in a Spec narrative are literal · declared Spec
  • spec:carrier.inline-code-spans.pack: Code spans in Pack framing are literal · declared Spec
  • spec:carrier.markdown-body-grammar: The Markdown body accepts one closed form per section · declared Spec
  • impl:protocol.inline-code-spans: scans raw HTML outside matched code spans · anchored code · src/extract/markdown-inline-code.ts:4
  • oracle:protocol.inline-code-spans: expected inline code outcome by authored location · anchored oracle binding · test/self-hosting-inline-code.test.ts:74
  • test:protocol.inline-code-spans.description: verifies inline code in section descriptions · anchored test binding · binding present · test/self-hosting-inline-code.test.ts:219
  • test:protocol.inline-code-spans.list: verifies inline code in list entries · anchored test binding · binding present · test/self-hosting-inline-code.test.ts:227
  • test:protocol.inline-code-spans.narrative: verifies inline code in Spec narrative · anchored test binding · binding present · test/self-hosting-inline-code.test.ts:211
  • test:protocol.inline-code-spans.pack: verifies inline code in Pack framing · anchored test binding · binding present · test/self-hosting-inline-code.test.ts:235
  • spec:carrier.inline-code-spans refines spec:carrier.markdown-body-grammar · declared
  • spec:carrier.inline-code-spans.description refines spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.description verifies spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.list refines spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.list verifies spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.narrative refines spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.narrative verifies spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.pack refines spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.pack verifies spec:carrier.inline-code-spans · declared
  • impl:protocol.inline-code-spans satisfies spec:carrier.inline-code-spans · anchored
  • oracle:protocol.inline-code-spans models spec:carrier.inline-code-spans · anchored
  • test:protocol.inline-code-spans.description verifies spec:carrier.inline-code-spans.description · anchored
  • test:protocol.inline-code-spans.list verifies spec:carrier.inline-code-spans.list · anchored
  • test:protocol.inline-code-spans.narrative verifies spec:carrier.inline-code-spans.narrative · anchored
  • test:protocol.inline-code-spans.pack verifies spec:carrier.inline-code-spans.pack · anchored
Mermaid source

Copyable source; the Studio draws static SVG.

Preferred syntax: requirementDiagram. Chosen syntax: flowchart TB because models, folds require exact labels unavailable in requirement syntax.

Decisions

No decision record named.

Runtime
  • component:protocol.extract · the carrier and source pipeline · src/extract/index.ts:192 · layer application · context protocol

    Uses

    • component:protocol.graph · the one graph and its semantic decisions · src/graph/schema.ts:34 · layer domain · context protocol
    • component:protocol.model · the authored contracts and stable ids · src/model/anchors.ts:100 · layer domain · context protocol
    • component:protocol.notation · the leaf step codec · src/notation/slots.ts:261 · layer domain · context protocol
    • component:protocol.validate · one finding currency and ordered checks · src/validate/validators.ts:72 · layer domain · context protocol
  • impl:protocol.inline-code-spans · scans raw HTML outside matched code spans · src/extract/markdown-inline-code.ts:4

    Component: component:protocol.extract · the carrier and source pipeline · src/extract/index.ts:192 · layer application · context protocol

    Uses

    None.

Runtime observation: not tracked.

Evidence

Runtime observation: not tracked.

Build attestations: not tracked.

Deployments: not tracked.

Bills of materials: not tracked.

Impact
Relations of spec:carrier.inline-code-spans
  • E3: verifies · declared (4 unit edges)
The diagram as text
  • spec:carrier.inline-code-spans: Inline code is content, never markup
  • spec:carrier.inline-code-spans.description: Code spans in section descriptions are literal
  • spec:carrier.inline-code-spans.list: Code spans in list entries are literal
  • spec:carrier.inline-code-spans.narrative: Code spans in a Spec narrative are literal
  • spec:carrier.inline-code-spans.pack: Code spans in Pack framing are literal
  • spec:carrier.markdown-body-grammar: The Markdown body accepts one closed form per section
  • spec:carrier.markdown-parser: The Markdown parser reifies the ruled subset
  • spec:extraction.contract-declarations: Pinned declarations give an adopter a derived module to typecheck
  • spec:carrier.inline-code-spans refines spec:carrier.markdown-body-grammar · declared
  • spec:carrier.markdown-parser constrainedBy spec:carrier.inline-code-spans · declared
  • spec:extraction.contract-declarations dependsOn spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.description refines spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.list refines spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.narrative refines spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.pack refines spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.description verifies spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.list verifies spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.narrative verifies spec:carrier.inline-code-spans · declared
  • spec:carrier.inline-code-spans.pack verifies spec:carrier.inline-code-spans · declared
Mermaid source

Copyable source; the Studio draws static SVG.

Preferred syntax: flowchart. Chosen syntax: labelled flowchart, preserving exact relations, claims and folds.

Rests on

Rested on by

Distance 1

Distance 2

Distance 3

Distance 4

Distance 5

Distance 6

Distance 7

Distance 8

Distance 9

Relations

Relation and directionOther endClaimReasonExercised keys
refines · outgoingThe Markdown body accepts one closed form per section
spec:carrier.markdown-body-grammar · resolves
declaredNoneNone
constrainedBy · incomingThe Markdown parser reifies the ruled subset
spec:carrier.markdown-parser · resolves
declaredNoneNone
dependsOn · incomingPinned declarations give an adopter a derived module to typecheck
spec:extraction.contract-declarations · resolves
declaredNoneNone
refines · incomingCode spans in section descriptions are literal
spec:carrier.inline-code-spans.description · resolves
declaredNoneNone
refines · incomingCode spans in list entries are literal
spec:carrier.inline-code-spans.list · resolves
declaredNoneNone
refines · incomingCode spans in a Spec narrative are literal
spec:carrier.inline-code-spans.narrative · resolves
declaredNoneNone
refines · incomingCode spans in Pack framing are literal
spec:carrier.inline-code-spans.pack · resolves
declaredNoneNone
verifies · incomingCode spans in section descriptions are literal
spec:carrier.inline-code-spans.description · resolves
declaredNoneliteralSpan, lineScoped, noEscape, spanBeforeTag, rawHtmlRefused
verifies · incomingCode spans in list entries are literal
spec:carrier.inline-code-spans.list · resolves
declaredNoneliteralSpan, lineScoped, noEscape, spanBeforeTag, rawHtmlRefused
verifies · incomingCode spans in a Spec narrative are literal
spec:carrier.inline-code-spans.narrative · resolves
declaredNoneliteralSpan, lineScoped, noEscape, spanBeforeTag, rawHtmlRefused
verifies · incomingCode spans in Pack framing are literal
spec:carrier.inline-code-spans.pack · resolves
declaredNoneliteralSpan, lineScoped, noEscape, spanBeforeTag, rawHtmlRefused

Bindings

Implementation binding: present

  • impl:protocol.inline-code-spans · scans raw HTML outside matched code spans · src/extract/markdown-inline-code.ts:4 · role codec · component component:protocol.extract · layer application · context protocol

Design reference: none

Verifier binding: present

Expected-outcome oracle: present

  • oracle:protocol.inline-code-spans · expected inline code outcome by authored location · test/self-hosting-inline-code.test.ts:74

Runtime observation: not tracked.

Run results: not recorded in the graph.

Findings

None.

Composing (0)

Composing needs the script.