Skip to content

fix(roadmap): read a record below a block a person opens #6785

Closed

Description

@dan-petty

Problem

split_record in src/devops_cli/roadmap/stores/store.py reads the job record only when CommonMark parses the last top-level block of the body as an HTML block (_record_block_span). A job writes the record at the end of the body. Suppose that a person later edits the body on GitHub and opens a fenced code block, a <pre> block or a comment above the record, and does not close it. Then the record comment is part of that open block, and split_record returns an empty record. The item loses its job state: the hashes of refine and alternatives, and each stop of implement.

#6729 fixes only the write side: with_record closes a block that the body leaves open. #6736 makes the job block readers end an open block at the job blocks at its end. Neither change makes split_record read a record that a later edit of a person puts inside an open block.

Evidence: a script on the code of origin/main (979c9dc, 2026-11-22) writes a record with with_record, adds an open block in the text of the person, and reads the record with split_record:

job write reads back:          {'Status': 'Ready', 'implement.stopped': 'group 1'}
fence opened in the middle     record read back: {}
<pre> opened in the middle     record read back: {}
comment opened in the middle   record read back: {}

The live check of #6729 on 2026-11-22 found that all 834 open bodies read back their record. So no item has the defect now.

Expected

A record that a job wrote reads back after a person opens a block above it. The next write closes the block of the person before the record, so GitHub does not show the record as code.

Acceptance criteria

  • Test first: for a written body where a person then opens a backtick fence, a tilde fence, a <pre> block or a comment above the record, split_record gives the record. The test fails on the base.
  • Test first: the next record write gives a body whose record CommonMark parses as the last HTML block.

Dependencies

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. dan-petty commented on Nov 22, 2026

    @dan-petty
    OwnerAuthor

    The review of #6800 found one more case for this issue. Suppose a person opens a fence above the refine block and the record. split_record then reads no record (this issue). Since #6800, the next record write closes the fence before the refine block. The old record is then a top-level comment one block above the new record, with the full record syntax. It is hidden, but it looks like a real record block, and its keys are lost.

    The fix of this issue should read the old record in that case, so that no stale copy stays in the body.

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

    @devops-cli-service
    Contributor

    Live since 2026-11-23 04:05 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