Skip to content

fix(docs): a check finds a code span that nested backticks break #4605

Open

Description

@dan-petty

Problem Description

A Markdown document can hold a code span that nests backticks, such as `Read `x ``. CommonMark ends the span at the first matching backtick run, so part of the rule shows as code and part as literal backticks. No required check finds this. The review of #4544 found it in docs/roadmap/stage.md and in the proposal of #4495. That pull request fixes its own text, but other spans of the same form stay on `main`.

Reproduction Steps

  1. Render docs/roadmap/stage.md line 110 and openspec/specs/roadmap-stage/spec.md lines 3975, 3979 and 4214 with markdown-it-py (MarkdownIt().renderInline(line)).
  2. Look at the <code> elements.

Expected vs Actual Behavior

Expected: a check fails when a code span ends or starts with a space because a nested backtick cut it, as markdownlint rule MD038 (no-space-in-code) does.
Actual: the spans render as <code>I read </code> and <code>decision </code>, and the checks pass.

Environment Diagnostics

origin/main 5f75d25. The repository has no Markdown linter in .pre-commit-config.yaml or .github/workflows/. The devcontainer has the DavidAnson.vscode-markdownlint editor extension only (#723).

Logs, Traces, or Terminal Output

openspec/specs/roadmap-stage/spec.md:3979: <code>I read </code>  (split span)
openspec/specs/roadmap-stage/spec.md:4214: <code>The probe line reads: The path </code>  (split span)
docs/roadmap/stage.md:110: <code>decision outcome </code>

Existing tool: markdownlint-cli2 (rule MD038) or rumdl (same rule set) covers the need. Use one with only the rules that catch broken spans, and fix the spans that it reports.

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Source: #4544

Alternatives check of 2026-11-22: covers.
Tool: rvben/rumdl (https://github.com/rvben/rumdl), NOASSERTION, last activity 2026-11-21, maintained.
Reason: Searches and the tool facts confirm rumdl ships MD038, which reports code spans whose content starts or ends with a space, exactly the symptom a nested-backtick split leaves, so one pinned dev dependency and one CI row cover the need.

Covers:

  • MD038 reports code spans with a leading or trailing space
  • Rule selection enables only MD038, leaving other rules off
  • Installs as a Python wheel, so uv pins and runs it

Lacks:

  • Automatic fix trims edge spaces but cannot rejoin a split span
  • A nested-backtick break with no edge space is not reported
  • No option to allow a deliberate trailing space in a span

Proposed design

Problem statement

CommonMark ends a code span at the first backtick run that matches its opening run. A span that nests a backtick run then renders in two parts, and a part can start or end with a space. No required check reports these spans, so they stay on main in docs/roadmap/stage.md and in the living specs. This item enables the rumdl rule MD038 in the shared rule selection that #4899 adds, sets the markdown row of devops ci to the living Markdown, and rewrites each span that the rule reports. The rule reports only a break that leaves an edge space; a padded longer-run span is the rewrite that it accepts.

Acceptance criteria

Requirement: MD038 is enabled in the shared rumdl rule selection

The .rumdl.toml rule selection that #4899 adds SHALL enable the rule MD038.

Scenario: A probe code span with a trailing space is reported

  • WHEN The live check writes the line `x ` to docs/md038-probe.md and runs uv run rumdl check docs/md038-probe.md at the repository root.
  • THEN The command exits 1 and prints a finding that names MD038 and docs/md038-probe.md, and the check deletes the file.

Requirement: The markdown row checks the living Markdown only

The markdown row of devops ci SHALL run uv run rumdl check docs openspec/specs, SHALL hold no other command, and SHALL name no path under openspec/changes.

Scenario: The row spec holds the two living Markdown roots

  • WHEN A pytest test in tests/commands/ reads get_check_spec("markdown").cmd and .also_cmds.
  • THEN The command is uv run rumdl check docs openspec/specs, also_cmds is empty, and no part of either names openspec/changes.

Requirement: The living Markdown holds no code span with an unnecessary edge space

Each code span of the Markdown under docs/ and openspec/specs/ MUST hold no unnecessary space next to its opening or its closing backticks.

Scenario: The markdown row reports no MD038 finding

  • WHEN The live check uv run devops ci --check --only markdown runs at the repository root on the archived tree.
  • THEN The command exits 0 and prints no MD038 finding.

Requirement: A deliberate edge space of a code span moves into the prose

Each code span of docs/roadmap/stage.md that names a log prefix MUST hold the prefix with no edge space, and the sentence around it MUST state in the prose that the prefix ends with a space.

Scenario: The log-prefix spans hold no edge space and the prose names the space

  • WHEN A pytest test in tests/invariants/ parses docs/roadmap/stage.md with MarkdownIt().parse and reads each code_inline token with the text token that follows it.
  • THEN The test passes. No code_inline token content starts or ends with a space, and for each code_inline token whose content is decision or decision outcome, the text token after it holds the word space.

Existing Tool Considered

rvben/rumdl (https://github.com/rvben/rumdl) is the open, maintained tool that covers the need. The alternatives check of 2026-11-22 in the issue body records the verdict covers, and the Lacks: list of its block states what the tool lacks; this item does those parts by hand. #4899 pins the tool and adds .rumdl.toml, the rvben/rumdl-pre-commit hook and the markdown row of devops ci; this item enables MD038, asserts the row scope and fixes the spans. The item builds no linter of its own.

Key questions

  • The alternatives check found that https://github.com/rvben/rumdl covers this item. Adopt the tool, or keep the item and give the reason.: Adopt rvben/rumdl and keep the item. The replies in alternatives.answers adopt the tool for this item and for feat(docs): check links and anchors of all documents with rumdl #4899, and they name feat(docs): check links and anchors of all documents with rumdl #4899 as the dependency. The check of 2026-11-22 in the issue body records the verdict covers with the rule MD038, and the Lacks: list of its block states what the tool lacks. AGENTS.md rule 3 and TL1 at docs/SERVICE_PATTERNS.md:163 take an open tool before code that the project keeps. The repository page of the tool (fetched 2026-11-25) shows a maintained project: 3,982 commits, 90 lint rules, markdownlint configuration compatibility, installable with pip, and the command rumdl check [PATHS...]. This item enables MD038 in the rule selection that feat(docs): check links and anchors of all documents with rumdl #4899 adds, asserts the paths of the markdown row and rewrites each reported span by hand. (best practice) [sources: AGENTS.md, docs/SERVICE_PATTERNS.md:163, https://github.com/rvben/rumdl]
    • Chosen: Adopt rvben/rumdl and keep the item. The replies adopt the tool, the check records covers with MD038, and AGENTS.md rule 3 and TL1 take the open tool before code that the project keeps.
    • Rejected: Adopt markdownlint-cli2 instead. The check compared it and named rvben/rumdl, and the replies adopt rvben/rumdl; a second Markdown linter adds a Node toolchain and a second config for the same rule.
    • Rejected: Keep the item with no tool. No required check reports the split spans, which is the problem of the issue.
  • Which parts of the rumdl integration does this item deliver, and which parts does feat(docs): check links and anchors of all documents with rumdl #4899 deliver?: feat(docs): check links and anchors of all documents with rumdl #4899 adds the pin, .rumdl.toml, the rvben/rumdl-pre-commit hook and the markdown row of devops ci. This item adds MD038 to the enable list of that file and rewrites each span that the rule reports. It asserts that the row checks docs and openspec/specs only, because a required row over the open change folders of other items could not pass. It adds no second row, config, hook or dependency. At this commit CHECK_ROW_NAMES at src/devops_cli/commands/ci.py:130 names the 29 rows of src/devops_cli/config/constants.py:5994 and holds no markdown row, so the row arrives with feat(docs): check links and anchors of all documents with rumdl #4899. (best practice) [sources: src/devops_cli/commands/ci.py:130, src/devops_cli/config/constants.py:5994, .pre-commit-config.yaml, pyproject.toml]
  • Which Markdown does the markdown row check?: The row checks the tracked Markdown under docs/ and openspec/specs/, and it passes no path under openspec/changes/. CONTEXT.md makes a change folder the in-repo record of one item, written and archived by the pull request that delivers it, and it makes openspec archive the only writer of a living spec. The default branch holds the open change folders of other items, so a required row over them would report spans that this pull request does not edit and could not pass. The archive copies the fixed text into the living spec, and the row checks it there. (best practice) [sources: CONTEXT.md, docs/SDLC.md, openspec/specs/ci-gate-rows/spec.md]
    • Chosen: Check docs/ and openspec/specs/ only. A change folder is another item's record, so the required row can pass only on the living Markdown.
    • Rejected: Check every tracked Markdown file. MD038 would report the change folders of other items, which this pull request does not edit, so the row would never pass.
    • Rejected: Fix the spans of the change folders in this pull request. A pull request writes and archives only its own change.
  • How does the markdown row restrict its paths: an argument of rumdl check, or an exclude in a config file?: The row passes docs and openspec/specs as path arguments of uv run rumdl check, so get_check_spec("markdown").cmd holds the scope and a pytest test asserts it offline. The project adds no exclude for the scope to .rumdl.toml and no files/exclude for it to .pre-commit-config.yaml. The row is the only consumer of the narrower file set, and a config exclude would also narrow the pre-commit hook and the editor extension. (best practice) [sources: openspec/specs/ci-gate-rows/spec.md, tests/commands/test_ci_row_commands.py, src/devops_cli/commands/ci.py:130]
    • Chosen: Path arguments of rumdl check in the row command. The scope sits in the row spec, so a pytest test asserts it offline, and the row is the only consumer of the narrower file set.
    • Rejected: An exclude in .rumdl.toml. The exclude would also narrow the pre-commit hook and the editor extension, and no test asserts the row scope from it.
    • Rejected: files/exclude of the pre-commit hook. The row would have to run pre-commit over all files, and the scope would sit in a config that no test reads.
  • How is each reported span rewritten?: A span that a nested backtick run splits takes an opening and a closing backtick run longer than each run inside it, with one padding space inside each delimiter when the content starts or ends with a backtick. The MD038 rule doc (fetched 2026-11-25) states that the specification allows one leading and one trailing space and the parser trims them, so the padded form is not reported. A deliberate trailing space moves into the prose next to the span. The change uses no automatic fix, because the fix of MD038 trims an edge space and cannot rejoin a split span. (best practice) [sources: https://github.com/DavidAnson/markdownlint/blob/main/doc/md038.md, docs/roadmap/stage.md]
    • Chosen: A longer run with one padding space, and a needed space in the prose. The longer run keeps the inner backtick literal, the padding keeps an edge backtick from joining the closing run, and the prose keeps a space that the text needs.
    • Rejected: Trim the edge space. MD038 stops reporting, and the document loses the inner backtick or the deliberate space.
    • Rejected: A backslash escape. A backslash does not escape a backtick inside a code span.
    • Rejected: An inline ignore comment. It keeps the broken form that the issue reports, where the span can be rewritten.
  • Does MD038 report each code span that a nested backtick breaks?: No. The MD038 rule doc (fetched 2026-11-25) states that the rule is triggered for code spans containing content with unnecessary space next to the beginning or ending backticks. Its note allows a single leading and trailing space together because the specification trims them to support a code span that begins or ends with a backtick, and single-space padding is preserved even when it is unnecessary. So a padded longer-run span is not reported, a single deliberate trailing space is reported, and a break that leaves no edge space is not reported. This item claims the edge-space form only. The Lacks: list of the alternatives block in the issue body records the same limit. [sources: https://github.com/DavidAnson/markdownlint/blob/main/doc/md038.md, https://github.com/rvben/rumdl]
  • How is each part proved: a row of devops ci, a pytest test of the row spec, or a pytest test that parses the document?: The markdown row of devops ci proves the rule and its file scope, because the ci-gate-rows spec makes a check of committed files that starts a program a row and not a pytest test, and ADR 0004 makes the static analysis check required. A pytest test in tests/commands/ proves the scope of the row by reading get_check_spec("markdown").cmd, the pattern that tests/commands/test_ci_row_commands.py uses for the hadolint row. A pytest test in tests/invariants/ proves the prose statement of the deliberate space, because no row reads the meaning of a sentence; tests/invariants/test_roadmap_workflow_doc.py:16 already parses a Markdown document with markdown-it-py and reads its code_inline tokens. (best practice) [sources: openspec/specs/ci-gate-rows/spec.md, docs/adr/0004-ci-is-the-authoritative-gate.md, tests/commands/test_ci_row_commands.py, tests/invariants/test_roadmap_workflow_doc.py:16, .github/workflows/ci.yml]
    • Chosen: The row for the rule, a cmd test for the scope, and a document test for the prose. The row is the check of committed files, and the two tests are offline: one reads the row spec, the other parses the document.
    • Rejected: A pytest test that runs the row on a temporary worktree. It starts rumdl on committed files from a pytest test, which the ci-gate-rows spec forbids.
    • Rejected: A pytest test that reads .rumdl.toml. A test asserts no value of a config file, and the row is the check of committed files.
    • Rejected: A second CI row for the span check. The markdown row already runs rumdl, so a second row repeats the same tool and config.
  • Does the path that the issue cites hold at this commit?: No. The roadmap-stage capability is split into sub-folders, and docs/roadmap/stage.md links openspec/specs/roadmap-stage/selection/spec.md at lines 30 and 244. The cited file openspec/specs/roadmap-stage/spec.md and its lines 3975, 3979 and 4214 do not hold. The issue cites docs/roadmap/stage.md line 110, but the two log-prefix spans are at line 177 at this commit. A split span remains at openspec/specs/roadmap-stage/trace-gate/spec.md:193, where the sentence the feasibility section says The probe line reads: The path src/x.py is a file of the staging commit.`` ends the span at the inner backtick. The criteria therefore assert the result of the markdown row and the text of `docs/roadmap/stage.md`, not a line number. The row reports each remaining span under `docs/` and `openspec/specs/`, and the pull request rewrites what it reports. [sources: docs/roadmap/stage.md:30, docs/roadmap/stage.md:177, openspec/specs/roadmap-stage/selection/spec.md, openspec/specs/roadmap-stage/trace-gate/spec.md:193]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4899

Watched files

A commit on the default branch that changes one of these files starts the next refine round.

  • .pre-commit-config.yaml
  • pyproject.toml
  • src/devops_cli/commands/ci.py

Activity

  1. added
    source/agent
    type/bug
    scope/docs
    status/new
    value/low
    effort/low
    on Nov 11, 2026
  2. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/docs. The (docs) scope of the title gives the scope.
    • Priority: P3-Low. Broken code spans in docs are a cosmetic rendering issue with no functional impact.
    • Value: Low. Users see slightly malformed code spans in documentation; no functional or security impact.
    • Effort: Low. Adding one markdownlint rule to pre-commit or CI and fixing a few spans is a small change.
    • Related: fix(roadmap): refine keeps the angle-bracket text of a code span #3504, which asks for a different change. Both concern code span content being broken, but #3504 fixes a sanitizer that deletes angle-bracket text while this adds a lint rule to detect spans split by nested backticks.
  3. added
    priority/p3-low
    on Nov 11, 2026
  4. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Scope from the design spec plan (2026-11-11)

    The design spec tracker #4735 folds its Markdown item into this issue. The project uses one Markdown linter: rumdl. This issue adds it with the rules below and fixes what it reports.

    Linter. rumdl 0.3.2 (MIT, released 2026-10-28; 0.3.3 of 2026-11-10 is less than 14 days old). It implements the markdownlint rule set. The rule pages of the rumdl docs at tag v0.3.2 show every rule that this scope needs: MD003, MD038, MD045, MD055, MD056, MD058 and MD060 (opt-in, with style = "compact"). They also show MD013 with reflow-mode = "sentence-per-line", which the one-sentence-per-line trial needs that the owner chose on 2026-11-11 (hooks review decision OD3). So the project does not add markdownlint-cli2. The trial uses the same linter and the same config file; it is not part of this scope.

    Scope.

    • Run rumdl from its pre-commit hook repository (rvben/rumdl-pre-commit) in pre-commit and in CI. Exclude CHANGELOG.md (release-please writes it).
    • Turn on MD038 (the code spans of this issue), MD003 (ATX headings), MD045 (image alt text), MD055 (leading and trailing pipes), MD056 (column count), MD058 (blank lines around tables) and MD060 with style = "compact".
    • Put the config in .rumdl.toml. Move the rule settings of .devcontainer/devcontainer.json:59-63 there, and replace the DavidAnson.vscode-markdownlint extension with the rumdl extension (rvben.rumdl), so the editor, pre-commit and CI read one config.
    • src/devops_cli/docs/generator.py writes | :--- | for text columns and | ---: | for number columns (1,596 generated rows in 52 files use |---| today; 152 hand-written rows use | :--- |), - for an empty value (in place of *None*), and Yes for a secret in place of the lock emoji (generator.py:602, 25 in ENV_VARS.md).
    • Use sentence-case headings in README.md, ARCHITECTURE.md, SECURITY.md, docs/SDLC.md, docs/ROUTINE_TASKS.md and the issue forms, with "and" in place of "&" (about 80 Title Case headings).
    • Use one check-result table, Check | Result | Link, in commands/pr.py:613-616 and github/pr_evidence.py:61-66. "Pass" replaces the check-mark emoji in review Markdown.
    • Follow the caption rules (C3, T1) of docs/DESIGN.md from feat(design): add the design tokens and their build #4738 when it exists.
    • The reformat changes many documents. Do it in one pull request at a quiet time, so that few open pull requests conflict with it.

    Acceptance criteria added.

    • rumdl reports 0 errors on tracked Markdown, CHANGELOG.md excluded.
    • grep finds 0 |---| rows and 0 lock emoji in docs/.
    • A test asserts the one check-table header in both modules.
    • The hook runs in pre-commit and in CI.

    Existing tool considered. rumdl (MIT, maintained, with a pre-commit hook repository and an editor extension). markdownlint-cli2 covers the same rules, but the project uses one linter, and rumdl also has the sentence-per-line reflow of the trial.

  5. dan-petty commented on Nov 14, 2026

    @dan-petty
    OwnerAuthor

    Cannot build as low effort in one pull request: the repository has no Markdown linter in .pre-commit-config.yaml or the CI workflows, and the devcontainer holds only the VS Code markdownlint extension. A real check needs a tool choice (markdownlint-cli2 or rumdl), a pinned version and a Node/npm or single-binary install in the devcontainer image, the CI image and any runner Job image, plus a .markdownlint config and the fixes. That is a toolchain change, not a one-file docs fix. Split it: (1) add the pinned linter with only MD038 and fix the spans it reports, (2) wire it into the docs gate and the image builds.

  6. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Alternatives check: covers

    Reason: The searches found rumdl, a maintained Rust Markdown linter that implements the markdownlint rule set, including MD038 (no-space-in-code), which is exactly the check the issue asks for: it fails when a code span ends or starts with a space because a nested backtick cut it. The design-spec reply on the issue states the project adopts rumdl as its one Markdown linter for this scope, so no ADR is contradicted.

    Tool: rvben/rumdl (https://github.com/rvben/rumdl)

    • License: NOASSERTION
    • Last activity: 2026-11-16
    • Maintained: yes

    Covers:

    • MD038 no-space-in-code: flags a code span that starts or ends with a space, the signature of a span split by nested backticks
    • Implements the markdownlint rule set, so it can be enabled with only the rules that catch broken spans
    • Ships a pre-commit hook repository (rvben/rumdl-pre-commit) and a VS Code extension, so one config can serve editor, pre-commit and CI
    • Single native binary installable via pip/uv/Cargo, so it needs no Node/npm toolchain

    Lacks:

    • It reports the broken spans; the actual edits to docs/roadmap/stage.md and openspec/specs/roadmap-stage/spec.md still have to be made (MD038 is not auto-fixed)
    • It only catches a split span when the break leaves a leading or trailing space inside the code span; a nested-backtick break that produces no such space is not reported

    Tools considered:

    Searches run:

    • rumdl markdown linter MD038 no-space-in-code, results: 5
    • markdownlint-cli2 MD038 rule code span, results: 5
    • markdownlint-cli2 github DavidAnson, results: 5
    • rumdl markdown linter github rvben, results: 5
    • rumdl markdownlint rule set compatible, results: 5
    • rumdl rules MD038 no space in code, results: 5
    • rumdl.rs markdown linter documentation, results: 5
    • "rumdl" markdown linter, results: 5
    • markdownlint-cli2 rules MD038, results: 5

    Sources:

    Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.

  7. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Owner question: See the first point of Open questions in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  8. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor

    Answer to the alternatives question of this item and of #4899: adopt rumdl (rvben/rumdl). Keep this item.

    • License: MIT (LICENSE, Cargo.toml). Maintenance: v0.3.5 of 2026-11-18, and 10 releases since 2026-09-23.
    • feat(docs): check links and anchors of all documents with rumdl #4899 adds the pin, .rumdl.toml, the rvben/rumdl-pre-commit hook and the devops ci step. This item adds its rules to the same enable list. It adds no second step.
    • This item keeps the rules and the changes of the scope comment of 2026-11-11.

    Dependencies: #4899.

  9. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

  10. devops-cli-service commented on Nov 24, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  11. dan-petty commented on Nov 24, 2026

    @dan-petty
    OwnerAuthor

    Adopt the tool: rvben/rumdl. AGENTS.md rule 3 requires using an open tool before building.

  12. devops-cli-service commented on Nov 24, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p3-lowscope/docssource/agentstatus/newtype/bugvalue/low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions