Skip to content

fix(roadmap): a pending-person criterion with a comma reads back cut #5956

Open

Description

@dan-petty

Problem

The line of a pending-person criterion in ## Criteria of tasks.md is Pending person: {criterion}, {reason}. The criterion and the reason can each hold a comma, so the line has no single split. Two readers split it in two different ways:

  • plan_read._criteria splits at the first ., when the line holds one, else at the first , .
  • implement_run._parse_tasks_criteria splits at the first ,.

So a pending-person criterion that holds a comma and does not end with a full stop reads back cut: part of the criterion moves into the reason. A criterion that holds ., inside (for example e.g., ) reads back cut too. criterion_problems hides the cut with _resolved (#4023), but the read-back check of the stage job (#5851) compares the entries exactly and fails the item with plan_unreadable.

Evidence

A round trip with no model call (render_change, then read_change) of the entry {"criterion": "A person runs the steps, and records the output", "group": "pending-person", "reason": "It needs the live cluster."} gives the criterion A person runs the steps and the reason and records the output, It needs the live cluster.. read_back_problems gives criteria.

#5952 found this form during the reproduction of the stage read-back failures. The criteria of #2202, #3655 and #3671 end with a full stop, so this form did not cause those failures.

Expected behavior

  • A pending-person entry reads back with the same criterion and reason for any one-line texts.
  • plan_read and the implement step read the criteria with one reader.
  • A plan in the old line form still reads.

Acceptance criteria

  • A round-trip test of a pending-person entry whose criterion holds a comma and no final full stop gives the same entry.
  • A round-trip test of a criterion that holds e.g., gives the same entry.
  • The implement step reads the criteria of tasks.md with the reader of plan_read.

Source: #5952

Dependencies

Alternatives check of 2026-11-24: none.
Tool: none found.
Reason: Searches found only generic JSON and Markdown reference pages, no maintained library that reads one-line tasks.md criteria back unchanged. The defect is two internal splitters, so the fix belongs in the project's own reader.

Lacks:

  • One shared reader for the implement step
  • Round trip of a criterion holding a comma
  • Fallback that keeps the old line form readable

Proposed design

Problem statement

Two readers split the Pending person: {criterion}, {reason} line in tasks.md in different ways. A pending-person criterion that holds a comma and no final full stop reads back with part of the criterion in the reason. The stage read-back check then fails the item with plan_unreadable. The fix uses one reader in plan_read, a one-line JSON object for new plans, and a fallback for old plans.

Acceptance criteria

Requirement: Pending-person round trip with a comma

A pending-person criterion whose criterion text holds a comma and no final full stop SHALL read back with the same criterion and reason.

Scenario: Round trip of a comma criterion

  • WHEN a test renders and reads a pending-person entry with criterion A person runs the steps, and records the output and reason It needs the live cluster.
  • THEN the read entry holds that criterion and that reason, and read_back_problems reports no criteria problem.

Requirement: Pending-person round trip with an abbreviation

A pending-person criterion that holds e.g., SHALL read back with the same criterion and reason.

Scenario: Round trip of an abbreviation with a comma

  • WHEN a test renders and reads a pending-person entry whose criterion holds e.g.,
  • THEN the read entry holds the same criterion and reason.

Requirement: One criteria reader for the implement step

The implement step MUST read the criteria of tasks.md with the criteria reader of plan_read.

Scenario: Implement step delegates criteria parsing

  • WHEN a test patches the public criteria reader of plan_read and runs the implement step criteria parse on a tasks.md
  • THEN the patched reader receives the file and its result is the parsed criteria.

Requirement: New pending-person line encoding

render_change MUST write a pending-person criterion as one JSON object after Pending person: .

Scenario: Render a pending-person line

  • WHEN a test renders a pending-person entry whose criterion and reason each hold a comma
  • THEN the text after Pending person: parses as JSON with keys criterion and reason and the original values.

Requirement: Old pending-person line form

A tasks.md that uses the old Pending person: {criterion}, {reason} line form MUST still read.

Scenario: Read an old pending-person line

  • WHEN a test reads a tasks.md with Pending person: A person runs the steps., It needs the live cluster.
  • THEN the parsed entry holds criterion A person runs the steps. and reason It needs the live cluster.

Existing Tool Considered

The alternatives check in the issue body records verdict none and names no tool; its Lacks: list is in the issue body. The proposal uses the standard-library json module for a one-line object after Pending person: and one public plan_read.read_criteria that the implement step imports, with a fallback for the old line form. The code cost is about 1,500 tokens and 20 minutes to write, test and keep the reader and fallback.

Key questions

  • How should a Pending person: line encode a criterion and a reason that can each hold a comma?: Write one JSON object with keys criterion and reason after Pending person: . Use the standard-library json encoder and decoder, which quotes commas and preserves both fields exactly. (best practice) [sources: src/devops_cli/roadmap/plan_read.py, src/devops_cli/roadmap/implement/implement_run.py]
    • Chosen: JSON object. The standard library gives unambiguous quoting and an exact round trip with no custom escape rules.
    • Rejected: Escaped comma delimiter. It needs custom escaping and matching parsers, which adds code for the same result.
    • Rejected: Length-prefixed fields. It is unambiguous but hard to read and write by hand in tasks.md.
  • Where should the one criteria reader live, and how should the implement step use it?: Add a public read_criteria to src/devops_cli/roadmap/plan_read.py; make _criteria call it, and import it in src/devops_cli/roadmap/implement/implement_run.py. (best practice) [sources: src/devops_cli/roadmap/plan_read.py, src/devops_cli/roadmap/implement/implement_run.py, tests/roadmap/test_roadmap_plan_read.py]
    • Chosen: Public read_criteria in plan_read. It gives one reader and avoids a private cross-module import.
    • Rejected: Import _criteria directly. It couples the implement step to a private function and breaks on a rename.
    • Rejected: New module. It adds a layer for one small reader that belongs with the plan parser.
  • How should a plan in the old line form still read?: If the text after Pending person: is not a JSON object, fall back to the old split: at the first ., when present, else at the first , . (best practice) [sources: src/devops_cli/roadmap/plan_read.py, src/devops_cli/roadmap/implement/implement_run.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 16, 2026
  4. devops-cli-service commented on Nov 17, 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)

    Searches run:

    • store structured record as one line with commas escaping quoting library, results: 5
    • Python library parse line with two comma-separated fields that contain commas, unambiguous round trip, results: 5
    • markdown checklist metadata single line round trip parse escaped delimiter, results: 5
    • python csv module quoting fields containing commas documentation, results: 5
    • csv quoting QUOTE_MINIMAL python docs fields with delimiter, results: 5
    • JSON Lines one object per line round trip unambiguous serialization, results: 5
    • python-frontmatter PyPI, results: 5
    • open source library parse markdown task list criteria with metadata single reader, results: 5
    • tomli-w write inline table one line python, results: 5
    • python shlex quote split single line two values, results: 5

    Sources:

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

    @devops-cli-service
    Contributor

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

  7. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.

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/agentstatus/readytype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions