Skip to content

fix(roadmap): the stage plan cites an open change's proposal as evidence #3465

Closed

Description

@dan-petty

Problem or Motivation

The plan of PR #3439 (for #3422) proves its premise with another open change's proposal, and not with the staged source. Its ## Feasibility says: "read_file on src/devops_cli/roadmap/stage_paths.py shows class StagedTree ... with a callers method that reads that checkout with git grep; the change folder openspec/changes/3307-the-plan-check-names-a-caller/proposal.md states it: 'StagedTree.read keeps the checkout, and StagedTree.callers returns the files of the commit that call a function, found with git grep.'"

#3307 is an open, unimplemented plan: it is in openspec/changes/3307-the-plan-check-names-a-caller/, and its only commits are docs(openspec): plan #3307 .... class StagedTree in src/devops_cli/roadmap/stage_paths.py:76 holds a list of tracked files; it has no callers method, and read returns that list and keeps no checkout. The #3439 plan copied the false premise from #3307's proposal and cited that proposal as read_file evidence. The stage gates accepted it, the service opened it as a draft plan, and a person then marked it plan/needs-fix.

The stage prompt src/devops_cli/ai/tasks/roadmap_stage_change.md lets a plan prove a premise with any text. It does not say that only the staged source is evidence, so a plan can cite another plan's proposal and pass.

Proposed Solution & Architectural Design

  1. Add a rule to the stage prompt src/devops_cli/ai/tasks/roadmap_stage_change.md: a ## Feasibility line proves its claim with the source at the staged commit (a read_file of the code, or a symbol the code defines), and never with the proposal.md or design.md of a change that is not in openspec/archive/.
  2. Refuse in check_proposal in src/devops_cli/roadmap/stage_change.py a feasibility line that cites openspec/changes/<other>/proposal.md or design.md for a change that is not archived, because that text is a claim and not code.
  3. Add a test in tests/roadmap/test_roadmap_stage_content.py and tests/roadmap/test_roadmap_stage_prompt_rules.py for the rule.

Target Subsystem

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

Existing Tool Considered

The change extends the existing check_proposal text scan and the stage prompt; it adds no dependency. It builds about 3k tokens, costs about 0.5k tokens per year to keep and fix, and takes about half a day of elapsed time. It deletes no internal code.

Complements #3407, which refuses a class claim that quotes no code span. This change stops the service from treating another open plan as evidence in the first place.

Source: #3439

Alternatives check of 2026-11-07: partly.
Tool: vale-cli/vale (https://github.com/vale-cli/vale), MIT, last activity 2026-11-06, maintained.

Proposed design

Problem statement

The stage prompt lets a plan prove a premise with any text. The plan of PR #3439 cited another open change's proposal as evidence, and the gates accepted it. This change adds a prompt rule and a plan-check rule. A Feasibility line must cite the source at the staged commit. It must not cite the proposal or design of a change that is not archived.

Acceptance criteria

Requirement: Prompt rule names the staged source

The stage prompt SHALL state that a Feasibility line proves its claim with the source at the staged commit, and never with the proposal or design of a change that is not archived.

Scenario: The prompt states the evidence rule

  • WHEN A test reads src/devops_cli/ai/tasks/roadmap_stage_change.md.
  • THEN The text holds a rule that a Feasibility line cites the staged source and no unarchived change's proposal.md or design.md.

Requirement: Open change's proposal is refused

The plan check MUST refuse a feasibility line that cites proposal.md or design.md under openspec/changes/ when the path is not under openspec/changes/archive/.

Scenario: A feasibility line cites another open change's proposal

  • WHEN proposal_evidence_problems reads the feasibility line openspec/changes/3307-the-plan-check-names-a-caller/proposal.md states the method.
  • THEN It returns one problem that names the cited path and the rule.

Requirement: Archived change's proposal is accepted

The plan check MUST accept a feasibility line that cites the proposal.md or design.md of a change under openspec/changes/archive/.

Scenario: A feasibility line cites an archived change's design

  • WHEN proposal_evidence_problems reads the feasibility line openspec/changes/archive/1234-old-change/design.md records the choice.
  • THEN It returns an empty list.

Requirement: Staged symbol is accepted

The plan check MUST accept a feasibility line that cites a symbol that the staged code defines.

Scenario: A feasibility line cites a symbol of the staged source

  • WHEN proposal_evidence_problems reads the feasibility line src/devops_cli/roadmap/stage/stage_change.py:def check_proposal.
  • THEN It returns an empty list.

Requirement: The gate reports the rule's problem

content_problems MUST report the problems of proposal_evidence_problems.

Scenario: A reply cites an open change's proposal

  • WHEN content_problems judges a StageProposal whose feasibility cites openspec/changes/3307-the-plan-check-names-a-caller/proposal.md.
  • THEN The returned problems hold the text of the rule.

Requirement: The plan passes its own rule

The test of the change SHALL build the plan's own StageProposal and assert that content_problems returns no problem for it.

Scenario: The plan's own feasibility cites only the staged source

  • WHEN The test builds the plan's own StageProposal from this change.
  • THEN content_problems returns an empty list.

Existing Tool Considered

Vale (https://github.com/vale-cli/vale, MIT, last activity 2026-11-06, maintained) partly covers the refusal. A custom regex rule can refuse a Feasibility line that cites openspec/changes/<change>/proposal.md or design.md. The openspec/changes/ path already limits the refusal to changes that are not archived. Vale lacks a structured read of the ## Feasibility lines that check_proposal parses. It cannot report the offending line to the stage gate. It adds no rule to the stage prompt. It cannot tell whether a claim is backed by the source at the staged commit. It reads the working tree, not the staged commit. OpenSpec validate --strict reads no proposal prose, and ADR 0010 rejected a forked schema with a feasibility artifact. The change builds its own check code: about 3k tokens to build, about 0.5k tokens per year to keep and fix, and about half a day of elapsed time. It deletes no internal code.

Key questions

  • Which path shows that a change is archived?: A change is archived when its folder is under openspec/changes/archive/. A folder under openspec/changes/ with no archive/ segment is open. (best practice) [sources: CONTEXT.md]
    • Chosen: openspec/changes/archive/. The project glossary says the pull request archives the change into openspec/changes/archive/.
    • Rejected: openspec/archive/. The issue body and the alternatives comment name it, but the project glossary does not.
  • Where does the refusal run?: In proposal_evidence_problems, a new function in src/devops_cli/roadmap/stage/stage_change.py that content_problems calls. The gate already reads the feasibility lines of each reply. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:2358, docs/ROADMAP_WORKFLOW.md:342]
    • Chosen: A rule in stage_change.py. The gate parses the feasibility lines and reports each problem to the stage job.
    • Rejected: A Vale rule in CI. Vale reads the working tree, not the staged commit, and reports no line to the stage gate.
  • Which paths hold the stage gate and its tests?: The gate is src/devops_cli/roadmap/stage/stage_change.py. The tests are tests/roadmap/stage/test_roadmap_stage_content.py and tests/roadmap/stage/test_roadmap_stage_prompt_rules.py. The paths in the issue lack the stage/ folder. [sources: src/devops_cli/roadmap/stage/stage_change.py:2358, tests/roadmap/stage/test_roadmap_stage_content.py, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py]
  • Does the rule apply to the plan's own change folder?: Yes. The rule refuses a citation of any proposal.md or design.md under openspec/changes/ that is not under openspec/changes/archive/, the plan's own folder included. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/stage/stage_change.py:2358]
    • Chosen: Every unarchived change folder. The proposal of the plan is a claim too, and one rule covers both cases.
    • Rejected: Another change's folder only. It needs a second condition and leaves the own proposal as evidence.
  • Does Vale replace the plan-check rule?: No. Vale partly covers the refusal with a custom regex rule. It cannot report the offending line to the stage gate and reads no staged commit. The plan check keeps the rule, and the prompt states it. (best practice) [sources: docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]
    • Chosen: Keep the rule in content_problems. The gate reads the feasibility lines on each reply, and the prompt states the rule.
    • Rejected: Adopt Vale alone. Vale cannot tell whether a claim is backed by the staged source, and it feeds no stage gate.

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 4, 2026
  2. dan-petty commented on Nov 4, 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. A validation gap a human caught; no data loss or security risk, but it weakens pipeline trust.
    • Value: Medium. Prevents a class of false plans from passing the stage gate without human review.
    • Effort: Low. One prompt rule, one guard in check_proposal, and two test cases; the candidate estimates half a day.
    • Related: fix(roadmap): Check a class claim against the staged source #3407, which asks for a different change. Both add feasibility checks to the stage plan, but #3407 verifies a class claim has a real code span while the candidate refuses a citation of another open change's proposal.md or design.md.
  3. added
    priority/p2-medium
    on Nov 4, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 4, 2026
  5. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

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

  6. devops-cli-service commented on Nov 4, 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

  7. added
    status/new
    and removed
    status/ready
    on Nov 4, 2026
  8. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at d254410 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • The proposal has no problem statement, no acceptance criterion with its requirement, scenario, WHEN and THEN, or no answer to the existing-tool question. State the problem, the requirements with their scenarios, and the open tool that covers the need or the cost of building it.
  9. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Reason: The web searches returned only connection timeouts, so the judgement rests on the repository and package facts I read: Vale is an open, maintained prose linter, and OpenSpec and spec-kit are the other candidates. Vale's custom regex rules can refuse a Feasibility line that cites another change's proposal.md or design.md, and the openspec/changes/ versus openspec/archive/ paths already separate open changes from archived ones, so it covers the refusal part. It cannot verify that a claim is proved by the source at the staged commit, nor feed the stage gate, so the prompt rule and the source-as-evidence requirement stay with the issue's own change.

    Tool: vale-cli/vale (https://github.com/vale-cli/vale)

    • License: MIT
    • Last activity: 2026-11-06
    • Maintained: yes

    Covers:

    • A custom regex rule in a maintained prose linter can refuse a Feasibility line that cites openspec/changes/<change>/proposal.md or design.md.
    • Because archived changes move to openspec/archive/, a rule keyed on the openspec/changes/ path already limits the refusal to changes that are not archived.
    • It runs over the repository's markdown in CI, so the refusal does not depend on the stage prompt alone.
    • No new bespoke parser is needed for the pattern part of the check.

    Lacks:

    • It cannot tell whether a Feasibility claim is backed by the source at the staged commit, or by a symbol that the code defines; it only matches text.
    • It has no structured read of the ## Feasibility lines that check_proposal parses, so it cannot report the offending line to the stage gate.
    • It adds no rule to src/devops_cli/ai/tasks/roadmap_stage_change.md, so the planner still is not told that only the staged source is evidence.
    • It reads the working tree, not the staged commit, so the archive-status and path conditions are those of the checkout it runs in.
    • The project's own spec layer, OpenSpec, reads no proposal prose in validate --strict, and ADR 0010 rejected a forked schema with a feasibility artifact, so neither OpenSpec nor a spec-kit style analyze step supplies the check.

    Tools considered:

    Searches run:

    • Vale prose linter custom rule scoped to heading section flag citation, results: 0
    • OpenSpec validate --strict proposal.md design.md prose validation, results: 0
    • OpenSpec validate proposal change strict, results: 0
    • Vale prose linter rule heading scope, results: 0
    • spec-driven development proposal validation tool, results: 0
    • OpenSpec validate --strict prose checks, results: 0
    • vale lint markdown, results: 0
    • openspec cli, results: 0
    • vale errata-ai documentation styles rules, results: 0
    • prose linter check markdown document claims cite source code, results: 0

    Sources:

    Checked on 2026-11-07. A person decides what this means for the item. The check changes no label and closes no issue.

  10. added
    status/ready
    and removed
    status/new
    on Nov 13, 2026
  11. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

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

  12. added
    status/in-review
    and removed
    status/ready
    on Nov 14, 2026
  13. removed
    status/in-review
    on Nov 14, 2026
  14. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor
  15. 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