Skip to content

feat(roadmap): gate a plan that adds a StageProposal field #3328

Closed

Description

@dan-petty

Problem

StageProposal in src/devops_cli/roadmap/stage_change.py defines the model reply schema for staging plans.

test_the_top_level_keys_of_the_reply_are_the_fields_of_the_proposal in tests/roadmap/test_roadmap_stage_prompt_rules.py asserts that every field in StageProposal.model_fields matches a - \`:bullet insrc/devops_cli/ai/tasks/roadmap_stage_change.md` under "The reply has these keys and no other".

When a plan proposes adding a field to StageProposal (for example dependencies in #3252), the staging planner often adds the behavior rule but forgets the matching reply key bullet. When an agent implements the change, the prompt test fails immediately.

The stage check does not verify that plans modifying StageProposal include the prompt reply key update in their tasks.

Proposed change

  1. In src/devops_cli/roadmap/stage_eval_gates.py or stage_specs.py, add a check when a plan touches StageProposal in stage_change.py.
  2. When a plan adds a field to StageProposal, require the plan tasks to include updating src/devops_cli/ai/tasks/roadmap_stage_change.md with the new reply key bullet.
  3. Add a test in tests/roadmap/test_roadmap_stage_prompt_rules.py or test_roadmap_stage_plan.py asserting that plans adding a StageProposal field must schedule updating the prompt keys.

Acceptance criteria

  1. A test asserts that a plan adding a field to StageProposal without updating the prompt reply keys is refused with an informative message.
  2. A plan adding a field to StageProposal that specifies both the prompt key bullet and the prompt rule passes the check.

Source: #3298

Proposed design

Problem statement

The stage prompt test fails after implementation when a plan adds a field to StageProposal and forgets the matching reply-key bullet. The stage job does not check the plan for the prompt update. This change adds a deterministic gate and tests that refuse the incomplete plan at staging time.

Acceptance criteria

Requirement: Prompt key gate refuses a missing prompt update

The stage gate SHALL refuse a plan that adds a field to StageProposal and does not update the reply-key bullet in src/devops_cli/ai/tasks/roadmap_stage_change.md.

Scenario: Missing reply key

  • WHEN A plan changes src/devops_cli/roadmap/stage_change.py with a field addition to StageProposal and no group changes the prompt file.
  • THEN The gate returns a problem that names src/devops_cli/ai/tasks/roadmap_stage_change.md and the missing reply key.

Requirement: Prompt key gate accepts the prompt update

The stage gate SHALL accept a plan that adds a field to StageProposal when a group updates both the reply-key bullet and the rule in src/devops_cli/ai/tasks/roadmap_stage_change.md.

Scenario: Prompt key and rule present

  • WHEN A plan changes src/devops_cli/roadmap/stage_change.py with a field addition to StageProposal and one group updates the prompt file with the new reply key and its rule.
  • THEN The prompt-key gate returns no problem.

Requirement: Replay counts the prompt key defect

The stage replay SHALL catch a recorded prompt-key defect with the new gate.

Scenario: Recorded missing prompt key

  • WHEN A golden case holds a plan with a StageProposal field addition and no prompt update.
  • THEN The replay reports the defect as caught by the prompt-key gate.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this project-specific plan gate. The change builds its own code. The written cost is about 5,000 output tokens to build, keep and fix it, and about 1 hour of elapsed time. It deletes no internal code.

Key questions

  • Which test fails when StageProposal gains a field without a prompt reply key?: test_the_top_level_keys_of_the_reply_are_the_fields_of_the_proposal in tests/roadmap/test_roadmap_stage_prompt_rules.py compares the fields of StageProposal with the reply-key bullets in src/devops_cli/ai/tasks/roadmap_stage_change.md. [sources: tests/roadmap/test_roadmap_stage_prompt_rules.py, src/devops_cli/roadmap/stage_change.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]
  • Where should the stage job check that a StageProposal field addition updates the prompt reply keys?: Add a deterministic gate in src/devops_cli/roadmap/stage_eval_gates.py and run it in the stage gate set. (best practice) [sources: src/devops_cli/roadmap/stage_eval_gates.py, tests/roadmap/test_roadmap_stage_prompt_rules.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]
    • Chosen: New gate in stage_eval_gates.py. The stage gate set is deterministic and replayable, and the replay records a named defect.
    • Rejected: Add only to check_proposal. The golden replay would not name the defect and could miss a regression.
    • Rejected: Rely on the prompt test. The prompt test fails after implementation, not during staging.
  • How does the gate identify a plan that adds a field to StageProposal?: The gate reads a group that changes src/devops_cli/roadmap/stage_change.py and whose title, implementation, or documentation names StageProposal and the word field. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/ai/tasks/roadmap_stage_change.md, tests/roadmap/test_roadmap_stage_prompt_rules.py]
    • Chosen: Text marker in the group. The plan has no diff, so a deterministic text marker is the only offline signal.
    • Rejected: Any change to stage_change.py. It refuses validator and docstring edits that add no field.
    • Rejected: Parse a patch. The staging plan holds no patch.
  • What must the plan update in the prompt to pass the gate?: A group must change src/devops_cli/ai/tasks/roadmap_stage_change.md and its text must name the new reply key bullet and the behavior rule for that key. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, tests/roadmap/test_roadmap_stage_prompt_rules.py]
    • Rejected: Require the prompt file change only. It accepts a plan that names no reply key.
    • Chosen: Require the prompt file change and text that names the reply key and rule. It matches the prompt test and the issue.
    • Rejected: Require only the test change. The prompt test checks the prompt file, not the test.
  • Which defect type and gate name should record the prompt-key failure?: Add DefectType.PROMPT_KEY_MISSING and GateName.PROMPT_KEYS, and register one Gate that catches the new type. (best practice) [sources: src/devops_cli/roadmap/stage_eval_gates.py, src/devops_cli/roadmap/stage_eval_cases.py]
    • Chosen: New defect type and gate. The replay reports the defect by its own name.
    • Rejected: Reuse MISSING_PATH. The defect is not a missing path and the message would mislead.
    • Rejected: Reuse CRITERION_DROPPED. The defect is not an acceptance criterion.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    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/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. It prevents a recurring class of prompt-test failures but does not block current delivery.
    • Value: Medium. It removes a known source of implement-stage failures when a StageProposal field is added.
    • Effort: Medium. It requires a new check in stage_eval_gates or stage_specs plus a test in the roadmap test suite.
    • Related: test(roadmap): check the planner prompt against the project rules #3202, which asks for a different change. Both items guard the relationship between StageProposal and roadmap_stage_change.md, but #3202 checks the prompt content against other documents while the candidate checks that a plan includes a prompt update task.
  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

    Staged: branch feat/3328-the-stage-probe-checks-prompt-reply, draft pull request #3336. The pull request plans the item and closes no issue.

    The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:

    1. Add the prompt-key gate to the stage gate set: 37072 tokens
    2. Record the missing prompt key in the golden set: 24444 tokens
    3. State the prompt-key rule in the project documents: 23189 tokens

    The plan run made 2 model request(s), and used 148873 input tokens and 8490 output tokens. The model made no tool call.

    A model review of the plan found these points. They stop no draft, and a person judges them:

    • other at group 1 and group 2: A new gate and a new recorded case break existing tests of the replay that assert exact counts. No group updates those assertions. The gate totals, len(defects) == 72 and report.judged() == (64, 299) all change. The plan also adds no good case for its second eval scenario. Evidence: "GateName.CRITERIA: (False, 0),"
  7. dan-petty commented on Nov 3, 2026

    @dan-petty
    OwnerAuthor

    PR #3333 (the plan for #3320) is a concrete case. The plan adds a field to StageProposal and changes no bullet in src/devops_cli/ai/tasks/roadmap_stage_change.md. test_the_top_level_keys_of_the_reply_are_the_fields_of_the_proposal compares those bullets with StageProposal.model_fields, so the added field would fail the suite at implementation time. I corrected the plan in commit 98fe254: group 1 now changes the prompt and the prompt-rules test. This issue is the gate that should refuse the incomplete plan before a draft opens.

  8. added 2 commits that reference this issue on Nov 4, 2026
  9. added
    status/planned
    and removed
    status/ready
    on Nov 4, 2026
  10. changed the title [-]feat(roadmap): the stage probe checks prompt reply keys when StageProposal adds a field[/-] [+]feat(roadmap): gate a plan that adds a StageProposal field[/+] on Nov 6, 2026
  11. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 72 characters, and the limit is 60. The type and the scope stay.

  12. added
    status/in-progress
    and removed
    status/planned
    on Nov 8, 2026
  13. added 3 commits that reference this issue on Nov 8, 2026
    b6cacc5
    1ba265e
    d024da2
  14. removed
    status/in-progress
    on Nov 8, 2026
  15. devops-cli-service commented on Nov 8, 2026

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

    @devops-cli-service
    Contributor

    Live since 2026-11-08 15:26 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