Skip to content

fix(roadmap): the criteria readers read the alternatives block #6626

Done

Description

@dan-petty

Problem Description

acceptance_criteria in src/devops_cli/roadmap/stage/stage_criteria.py keeps a criteria list open up to the next heading. It removes only the refine block from the body, not the alternatives block. Thus the Covers and Lacks list items of an alternatives block that follows a person's Acceptance criteria list become acceptance criteria of the item.

The stage job uses these lists in criterion_problems (stage_change.py). It refuses a plan that does not map the Lacks lines as criteria. The lists also go to check_completeness (stage_ready.py, watch_row.py) and to implement_run.py. implement_step.issue_inputs reads section_text after _without_comments, so the text of the alternatives block also goes into the last section of the person's text.

#6613 fixes the same defect in _section_tokens of refine.py (the Dependencies and Key questions readers). It does not change these readers.

Reproduction Steps

  1. Read the open items read-only with GitHubRoadmapStore("dan-petty/devops-cli").open_items().
  2. For each item, compare acceptance_criteria(body) with acceptance_criteria(without_alternatives(body)).

Expected vs Actual Behavior

Expected: the two lists are the same, because the alternatives block holds no criterion of a person.

Actual, on 2026-11-21: 6 of 816 open items give a longer list with the alternatives block: #4141 (+8), #5542 (+3), #5922 (+7), #6342 (+6), #6469 (+3) and #6523 (+3). An example from #6523 is the Lacks line "No tool compares a stored rules version with the current one".

Proposed fix

End a section at a job block marker (CONST_ROADMAP_REFINE_*_MARKER, CONST_ROADMAP_ALTERNATIVES_*_MARKER) in acceptance_criteria and in the section_text readers, or let them read without_alternatives(body). Use the same rule as _JOB_BLOCK_MARKERS in refine.py (#6613).

Source

Source: #6624

Alternatives check of 2026-11-21: none.
Tool: none found.
Reason: Searches found only general Markdown parsers and documentation; none knows the project's job-block marker constants or the acceptance_criteria and section_text readers, so no library covers this internal fix.

Lacks:

  • No awareness of the project's job-block marker constants
  • No acceptance-criteria or section_text reader semantics
  • No replacement for reading without_alternatives(body)

Proposed design

Problem statement

The stage acceptance criteria reader continues a person's list through an alternatives block. Covers and Lacks items then become criteria, and the stage job refuses a plan that does not map them. The implement section reader also puts the alternatives text into the person's last section. The fix ends both readers at the job block markers.

Acceptance criteria

Requirement: Stage criteria stop at alternatives marker

The acceptance_criteria reader in stage_criteria.py SHALL end an open acceptance-criteria section at a job block start marker.

Scenario: Alternatives block follows a person's criteria list

  • WHEN acceptance_criteria(body) reads a body with First criterion and Second criterion under Acceptance criteria, then <!-- devops-roadmap-alternatives:start --> and a Lacks: item.
  • THEN The result is ['First criterion', 'Second criterion'] and holds no Lacks: item.

Requirement: Stage check ignores alternatives lines

The stage criterion check SHALL NOT require a plan to map a Covers or Lacks line from the alternatives block.

Scenario: Plan maps only the person's criteria

  • WHEN criterion_problems runs on a body with one person criterion and an alternatives block that holds a Lacks: item, and the plan maps only the person criterion.
  • THEN criterion_problems returns no problem that names the Lacks: item.

Requirement: Implement section text stops at job markers

The implement-step section reader SHALL end the person's section text at each job block start marker.

Scenario: Job blocks follow the last person section

  • WHEN implement_step.issue_inputs reads a body whose last person section is followed by the refine start marker and by the alternatives start marker.
  • THEN The section text for that issue holds no text from either job block.

Requirement: Person criteria still read with no job block

The acceptance_criteria reader SHALL return every top-level item under a person's Acceptance criteria heading when the body holds no job block.

Scenario: Body has only a person's criteria list

  • WHEN acceptance_criteria(body) reads a body with an Acceptance criteria heading and two top-level items, and no job block marker.
  • THEN The result holds both items in source order.

Existing Tool Considered

The alternatives check of 2026-11-21 returned none; the block in the issue body names no tool. The project builds the fix itself: one marker rule in two readers, about 2,000 build tokens, about 1,000 tokens per later fix, and about 2 hours elapsed.

Key questions

  • How should the stage and implement readers find the end of a person's section?: End the section at the job block start markers, using the same marker set as _section_tokens in refine.py. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:1175, src/devops_cli/roadmap/refine/refine.py:1223, src/devops_cli/roadmap/stage/stage_criteria.py:231]
    • Chosen: Reuse the job-block marker boundary from refine.py. fix(roadmap): an alternatives block names no blocker of an item #6613 already applies this boundary to the Dependencies and Key questions readers, so one rule keeps the readers aligned.
    • Rejected: Strip the alternatives block from the body before parsing. A global strip duplicates boundary logic and does not help a section reader stop at each job block marker.
    • Rejected: Match only the alternatives heading. The alternatives block is an HTML comment pair, not a heading, so heading matching misses the marker.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor
    • Related: fix(roadmap): an alternatives block names no blocker of an item #6613, which asks for a different change. Both stop a section reader at the alternatives block marker; #6613 fixes Dependencies and Key questions readers in refine.py, the candidate fixes acceptance_criteria and section_text readers in stage_criteria.py and implement_step.py.
  2. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/low
    priority/p2-medium
    on Nov 21, 2026
  3. devops-cli-service commented on Nov 21, 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 (9)

    Tools considered:

    Searches run:

    • markdown-it-py tokenize html comment blocks and list items, results: 5
    • python library split markdown document into sections by heading and list items, results: 5
    • markdown-it-py GitHub Python markdown parser, results: 5
    • Python parse GitHub issue body checklist markdown sections library, results: 5
    • markdown-it-py PyPI package, results: 5
    • python markdown section extraction package pypi headings lists, results: 5
    • marko markdown parser Python package, results: 5
    • markdown-it-py, results: 5
    • "split markdown" by headings python package section parser, results: 5

    Sources:

  4. added
    status/ready
    and removed
    status/new
    on Nov 22, 2026
  5. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  6. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 25, 2026
  7. removed
    status/in-review
    owner/agent
    on Nov 25, 2026
  8. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor
  9. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 07:43 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