Skip to content

fix(roadmap): co-locate prompt updates with schema enum changes #4063

Description

@dan-petty

Problem

When the stage planner generates task groups for a schema enum addition or change, it can place the schema definition change in one group and the prompt document updates in a later group.

In issue #3251, the stage planner created five groups:

  1. "Add the manifest kind to the schema and its render" (added GroupKind.MANIFEST to stage_change.py)
  2. "Refuse an other group that changes a case path"
  3. "Refuse a manifest verify that runs no case"
  4. "Name the manifest kind in the planner prompts" (updated roadmap_stage_change.md)
  5. "Replay the hand-written plan of docs(openspec): plan #2950 Add alternatives coverage metrics and alert #3173"

However, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py asserts that GroupKind and roadmap_stage_change.md stay synchronized (test_the_prompt_and_the_document_keep_the_same_phrase_of_a_rule).
Because Group 1 added the enum value without updating the prompt document, Group 1 failed the test suite in isolation. This broke the implement step and stopped incremental commits.

Expected

The stage planner prompts or stage validation must co-locate schema enum changes with their corresponding prompt document updates in the same group. When a plan changes an enum or constant checked by an invariant test against a prompt or documentation file, both the code definition and the prompt updates must be in the same task group.

Acceptance criteria

  • The stage planner prompt in roadmap_stage_change.md instructs the model to put prompt updates in the same group as the schema enum or constant changes that they describe.
  • The stage group validation or prompt test checks that schema enum modifications co-locate with prompt updates.

Feasibility

The stage planner prompt in src/devops_cli/ai/tasks/roadmap_stage_change.md and src/devops_cli/roadmap/stage/ owns group formation rules.
Adding an explicit co-location instruction to the prompt prevents split groupings that break invariant tests.

Existing tool considered

None. This is an internal stage planning rule in DevOps CLI.

Cost

Build: about 15k tokens and 0.5 hours. Keep: 0 cost. Fix: about 2k tokens and 0.1 hours.

Related

Found during evaluation of #3251 / PR #3981. Related to #3210.

Proposed design

Problem statement

The stage planner can put a schema enum or constant change in one task group and the prompt update it requires in a later group. Then an invariant test fails in the first group and stops incremental commits. The change makes the planner co-locate those changes and adds a prompt-rule test.

Acceptance criteria

Requirement: Co-locate schema and prompt changes

The stage planner prompt SHALL instruct the model to put a prompt document update in the same task group as the schema enum or constant change that the update describes.

Scenario: A plan changes a schema enum with a prompt update

  • WHEN A plan changes an enum or a constant that an invariant test compares with a prompt document.
  • THEN The prompt tells the model to put the prompt document update in the same group as that enum or constant change.

Requirement: Pin the co-location rule with a test

The prompt-rule test SHALL fail when roadmap_stage_change.md omits the co-location rule.

Scenario: The co-location sentence is removed

  • WHEN The co-location sentence is removed from roadmap_stage_change.md.
  • THEN tests/roadmap/stage/test_roadmap_stage_prompt_rules.py fails and names the missing rule.

Existing Tool Considered

No alternatives check has run. No open, maintained tool covers this internal stage-planner rule. The project builds its own prompt and test at about 15k tokens and 0.5 hours to build, 2k tokens and 0.1 hours to fix, and no keep cost.

Key questions

  • Where does the co-location rule belong?: Put the rule in src/devops_cli/ai/tasks/roadmap_stage_change.md. The planner reads this prompt. Add a matching assertion in tests/roadmap/stage/test_roadmap_stage_prompt_rules.py. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py]
    • Chosen: Prompt rule with a prompt-rule test. The planner reads the prompt, and the test fails when a later edit removes the rule.
    • Rejected: Stage validator only. The validator reads paths and text, so it cannot tell which prompt sentence describes an enum or constant change.
    • Rejected: Prompt rule only. No test fails when the rule is removed.
  • Which test module and test name pin the new rule?: Add test_the_stage_prompt_requires_prompt_updates_in_the_same_group_as_schema_changes to tests/roadmap/stage/test_roadmap_stage_prompt_rules.py. (best practice) [sources: tests/roadmap/stage/test_roadmap_stage_prompt_rules.py]
    • Chosen: New test in the existing prompt-rule module. The module already reads roadmap_stage_change.md and checks its rules.
    • Rejected: Add the sentence to _SHARED. _SHARED holds phrases that a document and the prompt both keep, and this rule has no second document.
    • Rejected: Add a new test module. A new module adds no value for one prompt rule.
  • Should the stage validator reject a split group?: No. The check sees paths and text, not the semantic link between an enum value and its prompt sentence. The prompt rule and its test are the reliable fix. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]
    • Chosen: Prompt rule and prompt-rule test. The rule is a planning instruction, and the prompt test can pin it.
    • Rejected: Validator rule in check_proposal. The validator cannot infer the matching prompt sentence from the group paths and text.
  • Which test compares GroupKind with the planner prompt?: test_the_prompts_name_the_kinds_of_a_group_as_the_enum_does in tests/roadmap/stage/test_roadmap_stage_prompt_rules.py compares each GroupKind value with the prompt. [sources: tests/roadmap/stage/test_roadmap_stage_prompt_rules.py]

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. The bug breaks the implement step and incremental commits for any enum addition that has a prompt invariant test.
    • Value: Medium. It unblocks a recurring workflow pattern where schema enums and prompt docs must change together.
    • Effort: Low. The body estimates about 0.5 hours to add a prompt instruction and a validation check.
    • Related: feat(roadmap): gate a plan that adds a StageProposal field #3328, which asks for a different change. Both keep schema definitions and prompt documentation synchronized, but #3328 gates plans that add a StageProposal field while the candidate co-locates enum changes with prompt updates in the same group.
  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 b9c88de (see proposed design in issue body).

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

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: One search found no tool for this need. The need is a rule in the project's own stage-planner prompt, plus a test that pins it. It is not a general capability that an outside library supplies, so the issue's "no existing tool" assessment stands.

    Tool: none found

    Lacks:

    • No open tool encodes this project's stage-planner grouping rule
    • No tool links a schema enum change to the prompt sentence that describes it

    Searches run:

    • check that code enum and documentation or prompt file change together in same commit tool, 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. removed
    status/ready
    on Nov 14, 2026
  8. added a commit that references this issue on Nov 14, 2026
  9. 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