Skip to content

fix(roadmap): parse pending-person criteria with commas in plan reader #4023

Description

@dan-petty

Problem Description

The plan reader splits pending person criteria with .partition(", "). When an acceptance criterion contains a comma, the reader splits the criterion at the first comma.

The parsed criterion is cut short. The remainder of the criterion moves to the reason string. The check criterion_problems then fails because the parsed text does not match the issue.

Reproduction Steps

  1. Add an acceptance criterion that contains a comma to an issue.
  2. Write the criterion in tasks.md as - Pending person: <criterion>, <reason>.
  3. Run devops roadmap plan-check <number>.
  4. Inspect the reported problems.

Expected vs Actual Behavior

Expected: The plan reader parses the full criterion text.

Actual: The plan reader cuts the criterion at the first comma and fails validation.

Environment Diagnostics

  • DevOps CLI Version: 0.82.0
  • Python Version: 3.14.10
  • OS & Architecture: Linux x86_64
  • Execution Environment: DevContainer

Logs, Traces, or Terminal Output

The issue lists the acceptance criterion "...", and `criteria` has no entry with this text. Add an entry that copies the text, with the number of the group that delivers it or pending-person and a reason.

Proposed design

Problem statement

The plan reader cuts a pending-person acceptance criterion at the first comma. A criterion that contains a comma then fails criterion_problems, and devops roadmap plan-check reports a false problem. The fix parses the full criterion text.

Acceptance criteria

Requirement: Comma in criterion

The plan reader SHALL parse the full criterion text of a pending-person line when the criterion contains one or more commas.

Scenario: Criterion with one comma

  • WHEN A tasks.md line reads - Pending person: Add the label, keep the title, because the label is missing and the issue lists Add the label, keep the title as an acceptance criterion.
  • THEN The parsed criterion equals Add the label, keep the title and the parsed reason equals because the label is missing.

Requirement: Comma in reason

The plan reader SHALL keep the full criterion text when the reason contains a comma.

Scenario: Reason with one comma

  • WHEN A tasks.md line reads - Pending person: Add the label, because the label is missing, and the title is short and the issue lists Add the label as an acceptance criterion.
  • THEN The parsed criterion equals Add the label and the parsed reason equals because the label is missing, and the title is short.

Requirement: Unmatched criterion

The plan reader MUST report a problem when no acceptance criterion matches the text of a pending-person line.

Scenario: No matching criterion

  • WHEN A tasks.md line reads - Pending person: Unknown text, because the text is absent and the issue lists no acceptance criterion Unknown text.
  • THEN criterion_problems returns an entry that names the line, and the reader accepts no truncated criterion.

Requirement: No comma in criterion

The plan reader SHALL parse a pending-person line with no comma in the criterion as before.

Scenario: Criterion without a comma

  • WHEN A tasks.md line reads - Pending person: Add the label, because the label is missing and the issue lists Add the label as an acceptance criterion.
  • THEN The parsed criterion equals Add the label and the parsed reason equals because the label is missing.

Requirement: Longest criterion match

The plan reader SHALL select the longest acceptance criterion that matches a pending-person line when more than one criterion matches.

Scenario: Two criteria share a prefix

  • WHEN The issue lists Add the label and Add the label, keep the title, and a line reads - Pending person: Add the label, keep the title, because the label is missing.
  • THEN The parsed criterion equals Add the label, keep the title.

Existing Tool Considered

No alternatives check has run. No open tool or library covers this repository-specific - Pending person: line format. Python's str.partition and str.rsplit cannot tell a comma in the criterion from a comma in the reason. The change edits one parser function and its tests. It costs about 600 tokens to build and test, about 100 tokens per year to keep, and about 30 minutes of work.

Key questions

  • Which code checks the parsed criterion against the issue?: criterion_problems in src/devops_cli/roadmap/stage/stage_criteria.py compares each parsed criterion with the issue's acceptance criteria. [sources: src/devops_cli/roadmap/stage/stage_criteria.py]
  • Which tests cover the plan reader and the plan check command?: tests/roadmap/test_roadmap_plan_read.py covers the plan reader, and tests/roadmap/test_roadmap_plan_check.py covers the plan check command. [sources: tests/roadmap/test_roadmap_plan_read.py, tests/roadmap/test_roadmap_plan_check.py]
  • How should the plan reader separate the criterion from the reason when both may contain commas?: Match the line against the issue's acceptance criteria. Split at the comma-space that leaves a criterion equal to one of them. Choose the longest criterion when more than one matches. Report a problem when no criterion matches. (best practice) [sources: src/devops_cli/roadmap/stage/stage_criteria.py, tests/roadmap/test_roadmap_plan_read.py]
    • Rejected: First comma-space (current). Cuts a criterion that contains a comma.
    • Rejected: Last comma-space. Cuts a reason that contains a comma.
    • Chosen: Match the issue's acceptance criteria. Uses the known criterion text to resolve commas in both fields.
    • Rejected: Change the separator. Breaks existing tasks.md files and needs a migration.
  • What should the plan reader do when no acceptance criterion matches?: Report a criterion_problems entry that names the line and the unmatched text. Do not accept a truncated criterion. (best practice) [sources: src/devops_cli/roadmap/stage/stage_criteria.py]
    • Rejected: Accept the first comma-space split. Keeps the false pass that the issue reports.
    • Chosen: Report the line as a problem. Makes the mismatch visible and prevents a cut criterion.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-10: none.
Tool: none found.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 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/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. A valid plan fails validation when a criterion contains a comma, blocking normal workflow.
    • Value: Medium. Any acceptance criterion with a comma triggers the bug, which is common in natural language.
    • Effort: Low. The fix replaces a single .partition call with a correct split in one location.
    • Related: fix(roadmap): a criterion of group 0 escapes the plan reader #3591, which asks for a different change. Both fix parsing bugs in the plan reader, but #3591 fixes a Group 0 escape while this fixes comma splitting of pending-person criteria.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 8, 2026
  5. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at e74866d (see proposed design in issue body).

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

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The one search found no tool or library for this need. The bug is in a parser for the repository's own - Pending person: <criterion>, <reason> line format. The fix is to match each line against the issue's known criteria, and that is a small change to one function. Python's str.partition and str.rsplit cannot do it.

    Tool: none found

    Lacks:

    • No open tool parses the repository-specific - Pending person: tasks.md line format
    • No tool splits a line by matching it against the issue's known acceptance criteria

    Searches run:

    • parse "criterion, reason" line split comma ambiguity match known list longest prefix Python, results: 5

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

  7. added
    status/in-progress
    and removed
    status/ready
    on Nov 14, 2026
  8. added
    status/in-review
    and removed
    status/in-progress
    on Nov 14, 2026
  9. removed
    status/in-review
    on Nov 14, 2026
  10. added a commit that references this issue on Nov 14, 2026
  11. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor
  12. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 15:02 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