Skip to content

feat(roadmap): a plan states the identifiers that a behavior group adds #3453

Closed

Description

@dan-petty

Problem or Motivation

The plan of #3417 (pull request #3438) detects a guard that a behavior group adds from prose. Its task 2.2 adds guard_names(group), which reads a task for an add verb, a word such as guard or check, and one backticked identifier. That rule is brittle. A task that says "introduce the check _delivery_title" misses the rule because it has no word from the rule. A sentence that names a guard but does not add it can match the rule and return an item to New for work the group does not do. A false negative lets a duplicate guard reach the step model, and a false positive returns an item for no defect.

The plan already knows the identifiers that a behavior group adds, because the model wrote the tasks and the plan reader reads their code spans. No field of the plan records the names, so the implement job must guess them from the sentence.

Proposed Solution & Architectural Design

  • Record the identifiers that a behavior group adds in a structured line of its task group, such as Adds: _delivery_title, in tasks.md. Write it in render_change and read it in plan_read and step_files.
  • Read the names in implement_run from that line, so no text rule decides the premise check.
  • Keep the check only for a behavior group, and keep the return to New with the definition line.
  • Add a test for a task that says "introduce the guard _delivery_title" and one for a sentence that names a guard without adding it. The first must return the item; the second must run the group.
  • Update the stage prompt and the plan check for the new line.

Target Subsystem

src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/plan_read.py, src/devops_cli/roadmap/step_files.py, src/devops_cli/roadmap/implement_run.py, src/devops_cli/ai/tasks/roadmap_stage_change.md

Existing Tool Considered

code_spans in src/devops_cli/roadmap/step_files.py already reads the code spans of a task, and plan_read._KIND already reads a structured line of a group. The change extends those parsers instead of building a second one. The cost is about 4,000 tokens to build and test, about 1,000 tokens to keep, and about 1 hour elapsed.

Source: #3438

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

Proposed design

Problem statement

The implement job detects a guard that a behavior group adds from a brittle prose rule. The rule reads a task for an add verb, a guard word, and one backticked identifier. It misses a task that says "introduce the guard" and matches a sentence that only names a guard. The plan already knows the identifiers a group adds, but no field records them. The change records them in a structured Adds: line in tasks.md and reads that line in the step parser, the plan reader, and the implement job.

Acceptance criteria

Requirement: A behavior group renders its added identifiers

render_change SHALL write an Adds: line with each added identifier in a code span for a behavior group that adds one or more identifiers.

Scenario: A behavior group adds a guard

  • WHEN a StageGroup of kind behavior holds adds equal to ['_delivery_title']
  • THEN the rendered tasks.md section of the group holds the line Adds: with the code span _delivery_title

Requirement: A group with no added identifier writes no line

render_change SHALL write no Adds: line for a group whose adds field is empty.

Scenario: A behavior group with no added identifier

  • WHEN a StageGroup of kind behavior holds adds equal to []
  • THEN its rendered section holds no Adds: line and read_change returns that group with adds equal to []

Requirement: The plan reader returns the added identifiers

read_change SHALL set the adds field of a StageGroup from the Adds: line of its section.

Scenario: A change folder with an Adds line

  • WHEN the tasks.md of a behavior group holds the line Adds: with the code span _delivery_title
  • THEN read_change returns that group with adds equal to ['_delivery_title']

Requirement: The task parser exposes the added identifiers

parse_task_groups SHALL expose the identifiers of an Adds: line as TaskGroup.added_names.

Scenario: A task group with two added identifiers

  • WHEN a tasks.md group holds the line Adds: with the code spans _delivery_title and _guard
  • THEN TaskGroup.added_names returns ('_delivery_title', '_guard')

Requirement: The reader refuses an Adds line with no code span

read_change SHALL raise PlanReadError for an Adds: line that holds an identifier outside a code span.

Scenario: A malformed Adds line

  • WHEN a behavior group holds the line Adds: _delivery_title with no code span
  • THEN read_change raises PlanReadError that names tasks.md

Requirement: The read-back check compares the added identifiers

read_back_problems SHALL report the adds field of a group when the files hold no Adds: line for it.

Scenario: A group whose rendered section loses the Adds line

  • WHEN a StageGroup holds adds equal to ['_delivery_title'] and its rendered section holds no Adds: line
  • THEN read_back_problems returns the problem group 1: adds

Requirement: The implement job uses only the Adds line

The implement job MUST use the Adds: line of a behavior group, and no prose rule, to decide whether an added identifier has a definition.

Scenario: A sentence names a guard without adding it

  • WHEN a behavior group task holds the sentence introduce the guard and the code span _delivery_title, and the group has no Adds: line
  • THEN the job runs the group and reports no premise failure

Requirement: An existing definition returns the item

The implement job MUST return an item to New with the definition line when an identifier in the Adds: line of a behavior group already has a definition.

Scenario: A behavior group adds an existing guard

  • WHEN a behavior group holds the line Adds: with the code span _delivery_title and _delivery_title is already defined in the checkout at the branch tip
  • THEN the job returns the item to New and the comment quotes the definition line

Requirement: The stage prompt names the Adds line

The stage prompt SHALL name the Adds: line as a field of a group and require a code span for each identifier.

Scenario: The prompt names the Adds line

  • WHEN the stage prompt file src/devops_cli/ai/tasks/roadmap_stage_change.md is read
  • THEN the text holds Adds: and requires a code span for each identifier

Existing Tool Considered

No open tool or library covers this need. The alternatives check of 2026-11-07 gave the verdict none and found no tool. The need is internal to this repository's plan format: a structured Adds: line in tasks.md, read by step_files, plan_read, and implement_run. The change extends the project's own parsers, code_spans and KIND_LINE in src/devops_cli/roadmap/step_files.py, and _READS in src/devops_cli/roadmap/plan_read.py. The written cost is about 5,000 tokens to build and test, about 1,000 tokens to keep and fix, and about 2 hours elapsed. The change deletes the prose rule that reads a task for an add verb, a guard word, and one backticked identifier.

Key questions

  • How should a plan record the identifiers that a behavior group adds?: Write one Adds: line in the section of the group in tasks.md. Put each identifier in a code span and separate them with a comma. Write no line for a group that adds no identifier. (best practice) [sources: src/devops_cli/roadmap/step_files.py, src/devops_cli/roadmap/plan_read.py, src/devops_cli/roadmap/stage/stage_change.py]
    • Chosen: An Adds line with code spans. KIND_LINE in step_files.py and _READS in plan_read.py already read a structured line of a group, and code_spans already reads the identifiers.
    • Rejected: The prose rule with an add verb. The rule misses a task that says introduce, and it matches a sentence that only names a guard.
    • Rejected: YAML front matter. The plan reader and the step parser read the text of a group, and no existing parser reads front matter.
  • Where should the Adds line be parsed?: step_files.parse_task_groups exposes the identifiers as TaskGroup.added_names, and plan_read copies them into StageGroup.adds. The implement job reads the same property of the group. (best practice) [sources: src/devops_cli/roadmap/step_files.py, src/devops_cli/roadmap/plan_read.py]
    • Chosen: One parser in step_files. parse_task_groups already reads the tasks, the code spans, and the Kind: line of a group, and both readers use it.
    • Rejected: A separate regex in the plan reader and the implement job. Two parsers can disagree about one plan.
    • Rejected: Read the names from the prose of a task. The issue records that the prose rule is brittle in both directions.
  • When should the implement job return an item to New for an added identifier?: Only when a behavior group has an Adds: line and one of its identifiers already has a definition in the checkout at the branch tip. The comment quotes the definition line. A group with no Adds: line runs normally. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py]
    • Chosen: A behavior group with an Adds line. The issue keeps the check for a behavior group and removes the prose rule.
    • Rejected: Any group, or any prose sentence. A false positive returns an item for no defect.
  • What should the stage prompt and the plan check require for the Adds line?: The stage prompt names the Adds: line and requires a code span for each identifier. read_change raises PlanReadError for a line that holds an identifier outside a code span, and the plan check reports that error. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/plan_read.py]
    • Chosen: The prompt plus a refusal in the plan reader. The reader already refuses a file that it cannot parse, and the plan check reports that file and goes on.
    • Rejected: The prompt only. A model reply can write a malformed line, and no gate catches it.
    • Rejected: A new rule in the plan check module. A second reader of the same line can disagree with the plan reader.
  • Which item must be delivered before the implement job can run this item?: fix(roadmap): a late premise return drops passed groups #5881 fixes the prose rule that returned this item to New. The runner image must hold that fix before the implement job runs this item. Until then the live rule reads the test task of this plan and returns the item again. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py]
    • Chosen: fix(roadmap): a late premise return drops passed groups #5881 goes first. The fix removes the false return for this item and for each item that names a guard in a test.
    • Rejected: A person builds the kept work by hand. The live rule still returns the next item that names a guard in a sentence, so the defect stays.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5881

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 4, 2026
  2. dan-petty commented on Nov 4, 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/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. Fixes false positives and false negatives in identifier detection, but the system functions today; not a blocking defect.
    • Value: Medium. Reduces incorrect rejections and incorrect acceptances of plan items, improving roadmap reliability.
    • Effort: Medium. Touches five files, adds a new plan line format, updates two parsers, and adds two test cases.
    • Related: feat(roadmap): the implement job re-checks a plan premise against the base #3417, which asks for a different change. Both work in the implement job's premise check, but #3417 adds the check and the candidate replaces its prose-based identifier parsing with a structured Adds line.
  3. added
    priority/p2-medium
    on Nov 4, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 4, 2026
  5. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The searches returned no usable results, so no open tool or library was found. The need is internal to this repository's own roadmap plan format: a structured Adds: line in the tasks.md of a behavior group, read by step_files, plan_read and implement_run, which the issue already scopes as an extension of the project's own parsers (code_spans, _KIND) rather than a new dependency.

    Tool: none found

    Lacks:

    • Recording the identifiers that a behavior group adds as a structured Adds: line in this project's tasks.md format
    • Reading that line in the plan reader, the step parser and the implement job instead of a prose rule
    • Returning an item to New with the definition line when an added identifier is already defined
    • Requiring a code-span identifier in the line from the stage prompt and the plan check

    Searches run:

    • python library parse structured metadata lines from markdown task lists, results: 0
    • spec-driven development tool record identifiers a change adds in tasks file, results: 0
    • markdown task list metadata parser python, results: 0
    • OpenSpec spec driven development tasks.md format, results: 0
    • markdown parser python, results: 0
    • markdown-it-py, results: 0
    • software tool detect duplicate function definition before implementing change, results: 0

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

  7. added
    owner/service
    and removed
    owner/service
    on Nov 14, 2026
  8. 34 remaining items

  9. added
    status/in-progress
    and removed
    status/blocked
    on Nov 16, 2026
  10. removed
    status/in-progress
    owner/agent
    on Nov 16, 2026
  11. devops-cli-service commented on Nov 16, 2026

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

    @devops-cli-service
    Contributor

    Live since 2026-11-16 12:30 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/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions