Skip to content

fix(roadmap): the task renderer adds steps a plan does not need #3226

Closed

Description

@dan-petty

What happened

Two parts of the task renderer add text to a plan that the plan does not need. They were found while fixing plan pull request #3157 (plan for #2670, a change of SECURITY.md only).

  1. tasks_text (src/devops_cli/roadmap/stage_change.py:569) ends every tasks.md with a ## Workflow follow-up section and the bullet "Pending a person: review the diff in tuicr (tuicr -r ..HEAD)." openspec/config.yaml allows that bullet only for a change that alters code. A plan for a documents-only change gets it too.
  2. stage_task_documents (src/devops_cli/lang/en/messages.py:2990) writes the documents of a group into a task with a forced step to run devops docs generate --sync-readme, for any group with documentation, whether or not a command, option or message changes. The model filled {work} with a bare path, and the task read "SECURITY.md, run uv run devops docs generate --sync-readme, and verify ...", which has no verb for the document.

What should happen

  • The tuicr bullet is added only when a group of the plan changes a path under src/.
  • The docs-regeneration step is added only for a group that changes a command, an option or a message (a path under src/devops_cli/commands/ or src/devops_cli/lang/), and the task names the document with a verb ("Edit SECURITY.md: ...").
  • The model's documentation text is checked for a verb, or the template builds the sentence from the path and a fixed verb, so a bare path cannot reach the task.

Source

Fixing the plan of #3157; the agent's notes (pr3157.md, rows 2 and 6). Related: #3200 (content gate), #3210 (prompt tests).

Scope from #3327

The prompt asks for "the documents that the step changes" (line 16 of src/devops_cli/ai/tasks/roadmap_stage_change.md), so the model writes a path. stage_task_documents (src/devops_cli/lang/en/messages.py:3246) writes {work}, and run ..., and _task_texts (stage_change.py:788) passes the text unchanged. The task then reads "docs/ROADMAP_WORKFLOW.md, and run uv run devops docs generate --sync-readme", with no verb. This breaks rule 9 of AGENTS.md. Plan pull requests #3283 and #3298 show it.

Add to this issue:

  1. Prompt. A prompt line says that documentation starts with an imperative verb, names each document, and is null when the step changes no document.
  2. Renderer. The renderer gives a verb to a text that starts with a path. The fixed verb is Edit, as the design of this issue says, and it replaces Update of fix(roadmap): the stage prompt instructs the planner to write an action for group documentation #3327. A root document has no slash, so a test on / in the first word is not enough: SECURITY.md must also get the verb.
  3. No double verb. The renderer keeps a text that already starts with a verb. Document the fix in docs/TESTING.md (tests/roadmap/test_roadmap_stage_plan.py:726) stays as written, with no Edit Document.
  4. Prompt only is not enough. A prompt is not a check, so the renderer rule stays.
  5. Criterion. All rendered tasks in a staged change pass the task grammar and start with an imperative verb.
  6. Tests. Add a test for a path-only group, a test for a text that starts with a verb, and a test for the prompt line.
  7. Second reader. _DOCUMENTS_MARK (src/devops_cli/roadmap/plan_read.py:62, used at line 253) derives from the same template. It must still match the new template.

Evidence: 5 of 6 documentation fields in tests/fixtures/roadmap_eval/stage/*/plan.json start with a path. openspec/changes/3204-scaffold-a-command-and-a-test/tasks.md:9 starts with a path. openspec/changes/3308-the-plan-check-compares-a-number/tasks.md:43 and task 2.3 of openspec/changes/3433-refuse-a-plan-group-that-only/tasks.md have no action. Merged plan text is weak evidence, because dan-petty commits corrected several plans before their merge.

The line numbers in this issue moved: messages.py:2990 is now messages.py:3246, and stage_change.py:569 is now stage_change.py:835.

Cost of this part: about 2,000 tokens to build, about 500 tokens to keep and fix, and about 20 minutes elapsed.

Proposed design

Problem statement

The task renderer adds a tuicr review bullet to every plan. It also adds a documentation regeneration step to every documentation group and can render a bare path as a task. This change makes both additions conditional and makes a document task start with an imperative verb.

Acceptance criteria

Requirement: Tuicr bullet only for source changes

The task renderer SHALL add the tuicr review bullet only when at least one task group changes a path under src/.

Scenario: Documents-only plan omits tuicr bullet

  • WHEN A plan has task groups that change no path under src/.
  • THEN The rendered tasks.md contains no Pending a person: review the diff in tuicr bullet.

Requirement: Empty workflow follow-up section omitted

The task renderer SHALL omit the ## Workflow follow-up section when it has no bullet to write.

Scenario: No follow-up bullet leaves no section

  • WHEN A plan has no workflow follow-up bullet.
  • THEN The rendered tasks.md contains no ## Workflow follow-up heading.

Requirement: Tuicr bullet for source change

The task renderer SHALL add the tuicr review bullet when at least one task group changes a path under src/.

Scenario: Source change gets tuicr bullet

  • WHEN A plan has one group that changes src/devops_cli/roadmap/stage_change.py.
  • THEN The rendered tasks.md contains the tuicr review bullet.

Requirement: Docs regeneration only for CLI changes

The task renderer SHALL add the devops docs generate --sync-readme step only to a documentation group that changes a path under src/devops_cli/commands/ or src/devops_cli/lang/.

Scenario: Security document group omits docs generation

  • WHEN A documentation group changes only SECURITY.md.
  • THEN The generated task contains no uv run devops docs generate --sync-readme step.

Requirement: Docs regeneration for command or message change

The task renderer SHALL add the devops docs generate --sync-readme step to a documentation group that changes a path under src/devops_cli/commands/ or src/devops_cli/lang/.

Scenario: Command change keeps docs generation

  • WHEN A documentation group changes src/devops_cli/commands/roadmap.py.
  • THEN The generated task contains uv run devops docs generate --sync-readme.

Requirement: Document task starts with Edit for a path

The task renderer MUST prepend the fixed verb Edit to a documentation text that starts with a path.

Scenario: Root document path gets the Edit verb

  • WHEN A documentation group supplies the document text SECURITY.md.
  • THEN The rendered task starts with Edit and names SECURITY.md.

Requirement: Document task keeps an existing verb

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

Scenario: Existing verb has no double verb

  • WHEN A documentation group supplies the text Document the fix in docs/TESTING.md.
  • THEN The rendered task starts with Document and does not contain Edit Document.

Requirement: Documentation prompt names the verb rule

The stage prompt SHALL state that the documentation field starts with an imperative verb, names each document, and is null when the step changes no document.

Scenario: Prompt states the documentation rule

  • WHEN A test reads the stage prompt file.
  • THEN The prompt text states the imperative verb rule, the document naming rule, and the null rule.

Requirement: Rendered tasks start with an imperative verb

Every rendered task in a staged change SHALL start with an imperative verb and pass the task grammar.

Scenario: Rendered document task passes task grammar

  • WHEN A staged change renders a group with a path-only documentation text.
  • THEN Every rendered task starts with an imperative verb and passes the task grammar.

Requirement: Document mark still matches

The plan reader SHALL still find _DOCUMENTS_MARK in the rendered document task after the template change.

Scenario: Document mark matches the new template

  • WHEN A documentation task renders from the new template.
  • THEN _DOCUMENTS_MARK is present in the task text and the partition returns the document work.

Existing Tool Considered

No alternatives check has run. No open, maintained tool covers this need: the change edits project-specific task templates in src/devops_cli/roadmap/stage_change.py and src/devops_cli/lang/en/messages.py. The change builds no replacement library. The written cost is about 2,000 tokens to build, about 500 tokens to keep and fix, and about 20 minutes elapsed.

Key questions

  • Does openspec/config.yaml allow the tuicr review bullet only for a change that alters code?: Yes. The tasks rule says that a change that alters code may end with the tuicr review bullet. [sources: openspec/config.yaml]
  • How should the renderer prevent a bare path in a documentation task?: Use the template to prepend the fixed verb Edit when the first word is a path: it contains / or names a file with an extension. Keep a text that starts with an imperative verb unchanged. This replaces the Update verb of fix(roadmap): the stage prompt instructs the planner to write an action for group documentation #3327. (best practice) [sources: src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_plan.py, openspec/config.yaml, AGENTS.md]
    • Chosen: Template with fixed verb Edit and path test. It gives a deterministic task, handles a root document such as SECURITY.md, and keeps a text that already starts with a verb.
    • Rejected: Validate model text for a verb. A natural-language check is fragile and can accept a bad sentence.
    • Rejected: Prompt-only instruction. A prompt cannot guarantee that the rendered task has a verb.
    • Rejected: Test only for / in the first word. A root document has no slash, so SECURITY.md would not get the verb.
  • Should the renderer keep a documentation text that already starts with an imperative verb?: Yes. The renderer keeps the text unchanged, so Document the fix in docs/TESTING.md stays as written and no Edit Document appears. (best practice) [sources: tests/roadmap/test_roadmap_stage_plan.py, src/devops_cli/roadmap/stage_change.py, src/devops_cli/lang/en/messages.py]
    • Chosen: Keep the existing verb. It avoids a double verb and preserves a correct task text.
    • Rejected: Always prepend Edit. It produces Edit Document and breaks the task grammar.
  • Which documentation groups get the docs regeneration step?: Only a documentation group that changes a path under src/devops_cli/commands/ or src/devops_cli/lang/ gets the step. (best practice) [sources: openspec/config.yaml, src/devops_cli/roadmap/stage_change.py, src/devops_cli/lang/en/messages.py]
    • Chosen: Command, option or message path. These paths change the CLI reference or user-facing messages, so the generated documentation changes.
    • Rejected: Any documentation group. A documents-only change does not change generated CLI documentation.
    • Rejected: Any path under src/. Most source changes do not change a command, an option or a message.
  • Which plans get the tuicr review bullet?: A plan gets the bullet when at least one task group changes a path under src/. (best practice) [sources: openspec/config.yaml, src/devops_cli/roadmap/stage_change.py]
    • Chosen: Any source path. The bullet is for code review, and any source change is code.
    • Rejected: Every plan. A documents-only plan has no code diff for tuicr.
    • Rejected: Only behavior groups. A refactor or a test change under src/ still needs code review.
  • Should the stage prompt alone enforce the verb rule?: No. The prompt states the rule, and the renderer rule stays as the check. A prompt is not a check. (best practice) [sources: AGENTS.md, src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/stage_change.py]
    • Chosen: Prompt line and renderer rule. The renderer enforces the rule even when the model text starts with a path.
    • Rejected: Prompt only. A prompt cannot guarantee that the rendered task has a verb.
  • How does _DOCUMENTS_MARK keep matching the new document template?: _DOCUMENTS_MARK derives from MESSAGES.roadmap.stage_task_documents. Keep the fixed text that it formats in the new template, so the plan reader still partitions the rendered task. [sources: src/devops_cli/roadmap/plan_read.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

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

Activity

  1. added
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 2, 2026
  2. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    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. The renderer emits steps and malformed task text that confuse implement agents, but the plans still complete.
    • Value: Medium. Correct task text reduces agent errors and rework on documents-only plans.
    • Effort: Medium. Two functions need conditional logic and a verb check, plus tests for the new branches.
    • Related: fix(roadmap): the stage job plans a failing test for groups that change no code with behavior #3005, which asks for a different change. Both fix the stage job adding steps that a non-code group does not need, but #3005 removes the failing-test task while the candidate removes the tuicr bullet and the docs-regeneration step.
  3. added
    priority/p2-medium
    status/ready
    and removed
    status/new
    on Nov 2, 2026
  4. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

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

  5. devops-cli-service commented on Nov 2, 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:

    placeholder

  6. added
    status/new
    status/ready
    and removed
    status/ready
    status/new
    on Nov 2, 2026
  7. 12 remaining items

  8. added 8 commits that reference this issue on Nov 5, 2026
  9. added
    status/in-review
    and removed
    status/ready
    on Nov 5, 2026
  10. removed
    status/in-review
    owner/agent
    on Nov 5, 2026
  11. devops-cli-service commented on Nov 5, 2026

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

    @devops-cli-service
    Contributor

    Live since 2026-11-05 14:22 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/roadmaptype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions