Skip to content

test(roadmap): check the planner prompt against the project rules #3202

Closed

Description

@dan-petty

Problem or Motivation

The prompt of the stage planner (src/devops_cli/ai/tasks/roadmap_stage_change.md, about 9.9 KB) restates rules that other documents hold: test-first groups, the verify forms, the spec operations, the paths of tests, the cost in the existing-tool section. AGENTS.md says each rule lives in one document only. The planner does not receive AGENTS.md, CONTRIBUTING.md or docs/TESTING.md, so the copy in the prompt is the only way it learns the rules. When a rule changes in a document, the prompt can stay old. #3015 added one test of this kind: every example test path in the prompt and in openspec/config.yaml has a mirror folder. The other rules have none.

Proposed Solution & Architectural Design

  • Add tests that read the prompt and the documents and fail when they disagree on a rule that has a machine form:
    • the allowed verify forms (uv run devops, the ! git grep form) match the form check in stage_form.py, docs/TESTING.md and openspec/config.yaml;
    • the limit of the pull request body and of the summary match CONST_* values and CONTRIBUTING.md;
    • the list of paths that need no spec delta matches the gate (tests/, .github/workflows/, docs/, openspec/);
    • the name of each key in the reply matches the fields of StageProposal.
  • Where a rule can be read from one source, generate the line of the prompt from it, and test that the prompt holds the generated line. This removes the copy for that rule.
  • Do not copy whole documents into the prompt. The budget of the planner is about 65,000 tokens in the example config.

Open question for the refine step: whether the planner should receive the sections of AGENTS.md and of the documents it routes to, as the implement step does, in place of its own copy. The cost is tokens in a small window.

Target Subsystem

tests/roadmap/, src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/stage_change.py.

Existing Tool Considered

No tool compares a prompt with documents. The project already tests the prompt in two places (the example paths, and the keys). Cost to build: about 50k tokens and 3 hours. To keep: one test file, plus a change to it when a rule gains a machine form.

Related: #3015 (the example-path test), #3153.

Activity

  1. added
    type/test
    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/test. The test prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. Prevents prompt drift that causes incorrect plans, but no current failure is reported.
    • Value: Medium. Stops silent rule drift in the prompt, which produces flawed plans for every stage run.
    • Effort: Medium. The body estimates about 50k tokens and 3 hours for one test file plus a generation step.
    • Related: fix(roadmap): the stage job requires devops ci test verify commands and mirrored test paths #3015, which asks for a different change. Both concern the stage planner prompt and its rules, but #3015 enforces rules on the proposal output while the candidate tests the prompt file against the source documents.
  3. removed
    status/new
    on Nov 2, 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/mediumpriority/p2-mediumscope/roadmaptype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions