Skip to content

fix(roadmap): the stage prompt instructs the planner to write an action for group documentation #3327

Closed as not planned

Description

@dan-petty

Problem

The stage job plans task groups for an OpenSpec change. src/devops_cli/ai/tasks/roadmap_stage_change.md defines the documentation key of groups:
documentation, the documents that the step changes, or null when it changes none;

Because the prompt asks for "the documents that the step changes", the model emits only the file path (such as docs/ROADMAP_WORKFLOW.md or src/devops_cli/ai/tasks/roadmap_stage_change.md).

_task_texts in src/devops_cli/roadmap/stage_change.py formats documentation tasks with texts.stage_task_documents:
stage_task_documents: str = "{work}, and run \{command}`\n - Verification: `uv run devops ci docs` passes"`

When group.documentation holds only a file path, the resulting task becomes:
- [ ] 6.2 docs/ROADMAP_WORKFLOW.md, and run \uv run devops docs generate --sync-readme``

This text lacks an imperative verb. It breaks rule 9 of AGENTS.md (ASD-STE100) and produces malformed tasks in plans (for example in #3283 and #3298).

Proposed change

  1. Update src/devops_cli/ai/tasks/roadmap_stage_change.md to instruct the model to provide an action starting with an imperative verb for documentation (for example "Update docs/ROADMAP_WORKFLOW.md"), or null when the step changes no document.
  2. In _task_texts or StageGroup validation in src/devops_cli/roadmap/stage_change.py, check if group.documentation starts with a repository path and no verb; prepend an action verb such as "Update" so rendered task lines always begin with an imperative verb.
  3. Add a test in tests/roadmap/test_roadmap_stage_plan.py or tests/roadmap/test_roadmap_stage_form.py asserting that rendered documentation tasks start with an imperative verb.

Acceptance criteria

  1. A test asserts that StageGroup with documentation="docs/ROADMAP_WORKFLOW.md" renders as a task with an imperative verb.
  2. A test asserts that roadmap_stage_change.md instructs the model to begin documentation with an imperative verb.
  3. All rendered task items in staged changes pass task grammar and start with an imperative verb.

Source: #3298

Proposed design

Problem statement

The stage planner can write only a file path in a group's documentation field. The renderer then writes a documentation task that starts with a path and no imperative verb. The task breaks the ASD-STE100 rule and makes malformed plans.

Acceptance criteria

Requirement: Stage prompt states the documentation action

The stage change prompt SHALL tell the model to start the documentation text with an imperative verb, to name each document that the step changes, and to write null when it changes none.

Scenario: The prompt states the documentation form

  • WHEN the stage change prompt is loaded
  • THEN the prompt says that documentation starts with an imperative verb, names the documents, and is null when the step changes no document.

Requirement: Path-only documentation renders a task with a verb

A StageGroup with a path-only documentation value MUST render a documentation task that starts with an imperative verb.

Scenario: Documentation holds only a file path

  • WHEN a StageGroup has documentation set to docs/ROADMAP_WORKFLOW.md
  • THEN the rendered tasks.md task starts with Update docs/ROADMAP_WORKFLOW.md and then runs uv run devops docs generate --sync-readme.

Requirement: Documentation action stays unchanged

The renderer MUST keep a documentation text that already starts with an imperative verb.

Scenario: Documentation holds an action

  • WHEN a StageGroup has documentation set to Document the fix in docs/TESTING.md
  • THEN the rendered task starts with Document the fix in and holds no Update Document text.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this repository-specific stage prompt and task renderer. The change builds its own code: about 2,000 tokens to build, about 500 tokens to keep and fix, and about 20 minutes of elapsed time. It deletes no internal code.

Key questions

  • What does the current prompt and renderer do with documentation?: The prompt asks for the documents that the step changes. The renderer writes {work}, and run ... directly. A path-only value has no imperative verb. [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/stage_change.py]
  • Where should the renderer add the missing imperative verb?: In _task_texts, prepend Update when the documentation text starts with a repository path: its first token contains / and no whitespace. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_plan.py, AGENTS.md]
    • Chosen: Normalize in _task_texts. The acceptance criterion gives a path-only StageGroup and expects a rendered task with a verb. The renderer is the last step before tasks.md.
    • Rejected: Reject path-only documentation in StageGroup. A rejection does not meet the criterion that a path-only group renders with a verb. It also sends the model another error.
    • Rejected: Change only the prompt. A prompt is not a check. The model can still write a path, as the issue shows.
  • How should the prompt describe the documentation key?: The prompt should say that documentation is an action that starts with an imperative verb and names each document, or null when the step changes none. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, AGENTS.md]
    • Chosen: State the action and the verb. The model needs the shape of the text, not only the files. The wording matches the renderer rule.
    • Rejected: Keep the documents-only wording. This is the current wording that produces a path-only text.
    • Rejected: Give an example only. An example alone does not state the rule.
  • Which test module should hold the renderer test?: tests/roadmap/test_roadmap_stage_plan.py, because it already renders groups through render_change and asserts task lines. (best practice) [sources: tests/roadmap/test_roadmap_stage_plan.py, tests/roadmap/test_roadmap_stage_form.py]
    • Chosen: tests/roadmap/test_roadmap_stage_plan.py. It already has the render helper and task-line assertions.
    • Rejected: tests/roadmap/test_roadmap_stage_form.py. It checks prompt examples and path forms, not the rendered task line.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 3, 2026
  2. dan-petty commented on Nov 3, 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. It produces invalid task grammar in plans but does not block a user workflow.
    • Value: Medium. Malformed task text breaks the ASD-STE100 rule and confuses the implement step, but plans still render.
    • Effort: Low. The fix is a prompt wording change, a small validation guard, and one test.
    • Related: fix(roadmap): the task renderer adds steps a plan does not need #3226, which asks for a different change. Both touch the stage_task_documents template in stage_change.py, but #3226 removes unneeded workflow bullets while this candidate adds an imperative verb to the documentation field.
  3. added
    priority/p2-medium
    on Nov 3, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 3, 2026
  5. devops-cli-service commented on Nov 3, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.

    Evidence:

    x

  7. added
    status/new
    and removed
    status/ready
    on Nov 3, 2026
  8. dan-petty commented on Nov 4, 2026

    @dan-petty
    OwnerAuthor

    This item moves into #3226. Both change the same renderer text, stage_task_documents, and #3327 is the verb half of it.

    What moved, in the section Scope from #3327 of #3226: the prompt line for documentation, the rule that a text with a verb stays unchanged, the criterion that all rendered tasks start with a verb, the tests, the examples, the cost, and the need to keep _DOCUMENTS_MARK in src/devops_cli/roadmap/plan_read.py:62 working.

    One choice changed. #3226 says Edit and #3327 says Update for a bare path. The fixed verb is Edit.

    Proof that the defect stays: src/devops_cli/lang/en/messages.py:3246 still writes {work}, and run, and src/devops_cli/roadmap/stage_change.py:788 passes the text unchanged. The stage comment of 2026-11-03T04:44Z gave the evidence x, which is no finding. This item has no change folder, no open pull request and no parent issue.

  9. removed
    status/new
    on Nov 4, 2026
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