Skip to content

fix(roadmap): a job record reads back after an open block #6729

Closed

Description

@dan-petty

Problem

with_record in src/devops_cli/roadmap/stores/store.py adds the record block as an HTML comment after the body. split_record reads the record only when CommonMark parses the last top-level block as an HTML block (_record_block_span, #2630). When the body ends inside an open construct, the record comment becomes part of that construct. Such a construct is a fenced code block with no closing fence, an HTML comment with no -->, or an HTML block of type 1, such as <pre>, with no end tag. Then split_record returns an empty record, and each later read of the item loses its job state.

Evidence: a script on the code of origin/main (2026-11-22), with no test helpers, writes a record with with_record and reads it with split_record:

closed fence           record read back: {'implement.stopped': 'group 1'}
open backtick fence    record read back: {}
open tilde fence       record read back: {}
open <!--              record read back: {}
open <pre>             record read back: {}

A scan of the 837 open issues on 2026-11-22 found 828 bodies with a record block, and each record reads back. So no item has the defect now. A body gets an open construct when a person edits it, or when a model writes a fence that it does not close. The review of PR #6720 found that the model text of refine can do this.

PR #6720 (#6627) adds close_open_block to src/devops_cli/roadmap/body_hash.py, and only the refine and alternatives writers call it. The store does not call it.

Expected

A job record that with_record writes reads back with split_record, also when the body leaves a construct open at its end. The text of the person keeps its rendered form.

Acceptance criteria

  • Test first: for a body that ends in an open backtick fence, an open tilde fence, an open <!-- and an open <pre>, split_record(with_record(body, block)) gives the record. The test fails on the base.
  • A test: with_record writes a body with no open construct as before, with the same text.

Dependencies

Alternatives check of 2026-11-22: none.
Tool: none found.
Reason: Searches found only general Markdown parsers, such as markdown-it-py, which parse a body but neither append a record block nor read one back; the fix belongs in the store, through the close_open_block helper from #6627.

Lacks:

  • No append or split of a job record block
  • No closing of an open fence, comment or <pre>
  • No rule that the appended comment stays a top-level block

Activity

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

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 22, 2026
  4. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • python markdown library detect unclosed fenced code block and close it, results: 5
    • CommonMark parser python find last top-level block HTML comment span, results: 5
    • "close_open_block" markdown body fence comment, results: 5
    • markdown-it-py parse unclosed fence token, results: 5
    • markdown-it-py unclosed code fence tokens python documentation, results: 5
    • python library store metadata in hidden HTML comment in markdown body, results: 5
    • mistletoe markdown parser python github, results: 5
    • markdown-it-py pypi, results: 5
    • mdformat markdown formatter unclosed code fence python, results: 5
    • append hidden metadata comment to markdown body unclosed code fence safe, results: 5

    Sources:

  5. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 22, 2026
  6. removed
    status/in-progress
    owner/agent
    on Nov 22, 2026
  7. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor
  8. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-22 19:13 UTC

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/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions