Skip to content

feat(roadmap): a new plan gate states its hits and false refusals #3498

Closed

Description

@dan-petty

Problem

Nobody states what a plan gate does over real plans before it merges. The golden set cannot show a false refusal, because it holds few good plans. So a gate can refuse many sound plans, or never fire on a true case, and only a person sees this later.

What plan-recheck judges less than the job

The stage job calls check_proposal with inputs that plan-recheck does not give. It also runs checks that plan-recheck does not run. A refusal of plan-recheck is therefore a case to review, and a plan that plan-recheck accepts can still fail the job.

  • No probes: the job refuses a feasibility that quotes no line of the premise probe. plan-recheck does not.
  • No overlaps: the job refuses a plan that omits an open pull request that changes a path the item cites. plan-recheck reads no pull request.
  • No search_evidence: the job records the hits of each negative-search literal at the staged commit. plan-recheck records no search, so the gate search judges only the created paths.
  • No plan_creates: the job refuses a path that the plan of another open item creates. plan-recheck does not read those plans.
  • No group measure: the job refuses a group above the setting roadmap.stage.step_tokens. plan-recheck measures no group.
  • No secret scan and no title check: the job refuses a plan file that holds a secret and a staging title that breaks the form. plan-recheck has no pull request.
  • No verification pass: the job asks a model to review the plan. plan-recheck calls no model.
  • A different tree: the job judges a plan on the commit that it stages. plan-recheck judges it on the default branch or on the branch that a person names.

Expected

devops roadmap plan-recheck takes the option --branch <ref>. It judges the change folders of the ref and of the default branch with the same plan reader and the same gates, and it calls no model. The output names the gate of each refusal. For the branch and for the default branch, it lists the refusals under the name of each gate. It lists the refusals that the branch adds to the default-branch result, each with its folder, its gate and its message, and each marked as a case to review. A refusal on a change folder is a case to review, not a proven false refusal. A change folder that the reader cannot read appears as not read, and the run goes on. No new command exists. A plan or a pull request that adds a gate states the refusals of that gate and a replay of the defect that it cites.

Acceptance criteria

  • A test: check_proposal gives the problems of each gate under the name of the gate, and the flat list of problems does not change.
  • A test: with --branch, the run reads each change folder of the branch and of the default branch with read_change, and it makes no model request.
  • A test: the output lists the refusals of each gate for the branch and for the default branch.
  • A test: the output names the folder, the gate and the message of each refusal that the branch adds, and it marks each one as a case to review.
  • A test: a change folder that the reader cannot read appears as not read, and the run goes on.
  • docs/ROADMAP_WORKFLOW.md and docs/roadmap/plan-check.md state the rule that a plan or a pull request that adds a gate gives this result and a replay of its cited defect, and they state what plan-recheck judges less than the job.
  • The run time of plan-recheck with --branch on origin/main is below 5 minutes.

Existing tool considered

devops roadmap plan-recheck (src/devops_cli/roadmap/plan_recheck.py), check_proposal (src/devops_cli/roadmap/stage_change.py), the plan reader read_change (src/devops_cli/roadmap/plan_read.py) and devops roadmap eval stage --replay. No outside tool runs the gates of this project. The change extends plan-recheck and adds no command. Written cost of the extension: about 50,000 tokens to build, about 5,000 tokens each year to keep and fix, and about 3 hours of elapsed time.

Moved to other issues

Dependencies

Related

Related: #3706, #3591, #3492, #3445, #3398, #3386, #3331, #3397, #3207, #3412, #3390, #3404, #3320, #3321, #3433, #3343, #3344

Proposed design

Problem statement

Nobody measures a plan gate over real plans before it merges. The golden set holds few good plans, so it cannot show a false refusal. A gate can refuse sound plans, or never fire on a true case, and only a person sees this later. The project has devops roadmap plan-recheck, which runs the gates over the change folders of the default branch with no model. It prints one sentence for each problem, names no gate, compares no branch, and labels no case to review. This change extends plan-recheck to run the gates over a branch and the default branch, print the refusals per gate, and label each new refusal as a case to review.

Acceptance criteria

Requirement: Plan-recheck reads the branch and the default branch

The plan-recheck command SHALL read each change folder of the given branch and of the default branch with the plan reader, and it SHALL make no model request.

Scenario: A run reads both sides

  • WHEN A person runs devops roadmap plan-recheck on a branch that holds one change folder, and the default branch holds two change folders
  • THEN The run reads three change folders with read_change and records no model call.

Requirement: Plan-recheck prints the refusals of each gate for both sides

The plan-recheck output SHALL hold the refusals of each gate for the branch and for the default branch.

Scenario: Each side lists its refusals under the gate

  • WHEN One gate refuses one change folder on the branch and one change folder on the default branch
  • THEN The output lists both refusals under the name of that gate.

Requirement: A new refusal names its folder, gate and message

The plan-recheck output SHALL name the change folder, the gate and the message of each refusal that the branch adds to the default-branch result.

Scenario: A new refusal holds its three facts

  • WHEN A branch change folder makes one gate refuse, and the default-branch result holds no such refusal
  • THEN The output holds one line with the folder path, the gate name and the gate message.

Requirement: A new refusal is a case to review

The plan-recheck output SHALL label each refusal that the branch adds as a case to review, not as a proven false refusal.

Scenario: A new refusal carries the review label

  • WHEN The branch adds one refusal to the default-branch result
  • THEN The output marks that refusal as a case to review.

Requirement: An unreadable change folder does not stop the run

The plan-recheck run SHALL report a change folder that the reader cannot read as not read, and it SHALL continue with the other folders.

Scenario: A folder that the reader refuses

  • WHEN One change folder raises a read error and two other change folders read
  • THEN The output names the unread folder as not read and holds the results of the two other folders.

Requirement: The workflow document states the gate-evidence rule

docs/ROADMAP_WORKFLOW.md SHALL state that a plan or a pull request that adds a gate gives this result and a replay of the defect that it cites.

Scenario: The workflow document holds the rule

  • WHEN A reader searches docs/ROADMAP_WORKFLOW.md for the rule on a new gate
  • THEN The document holds the rule and names the plan-recheck command and the replay.

Existing Tool Considered

No alternatives check has run. No external tool runs the gates of this project over its change folders. The change extends the project's own devops roadmap plan-recheck in src/devops_cli/roadmap/plan_recheck.py, which already reads each change folder of the default branch and calls the stage gates with no model. Written cost: about 12,000 tokens to build the branch comparison, the gate names and the review label, about 3,000 tokens per year to keep and fix that code, and about one day of elapsed time.

Key questions

  • Should the change extend plan-recheck or add a new command?: Extend devops roadmap plan-recheck. It already reads each change folder of the default branch and calls the stage gates with no model, so the change adds a branch comparison, a gate name for each refusal and a review label. (best practice) [sources: src/devops_cli/roadmap/plan_recheck.py, src/devops_cli/commands/roadmap.py:793, src/devops_cli/roadmap/stage_change.py:593, src/devops_cli/roadmap/plan_check.py]
    • Rejected: Add a new command. It repeats the reader and the gate calls that plan-recheck already makes.
    • Chosen: Extend plan-recheck. It already reads the change folders of the default branch and calls the gates with no model.
    • Rejected: Add a git mode to the eval replay. The replay reads no git and builds a StagedTree from a file list, so it needs a new checkout path.
  • How does each refusal learn the name of its gate?: check_proposal returns each problem with the name of the gate that produced it. The command carries that name into its output. (best practice) [sources: src/devops_cli/roadmap/stage_change.py:593, src/devops_cli/roadmap/plan_check.py]
    • Chosen: Return the gate name with each problem. The gate that raises a problem is the only place that knows its name.
    • Rejected: Match the message text to a gate. The message is prose and changes, so a match would break.
    • Rejected: Run each gate on its own. The command calls check_proposal, which runs every gate in one call.
  • What makes a refusal new in the plan-recheck output?: A refusal is new when the branch run holds it and the default-branch run does not, for the same change folder. (best practice) [sources: src/devops_cli/roadmap/plan_recheck.py]
    • Chosen: Compare the branch run with the default-branch run. The body defines a new refusal against the default branch.
    • Rejected: Report every refusal of the branch. The default branch holds the same refusals, so the output would not show what changed.
  • What does read_change raise for a criterion with Group 0?: A pydantic.ValidationError, raised outside the try block of read_change. Issue fix(roadmap): a criterion of group 0 escapes the plan reader #3591 fixes the reader to raise only PlanReadError. [sources: src/devops_cli/roadmap/plan_read.py:419]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#3482, #3591

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    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/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 improves gate quality before merge but does not fix a live defect.
    • Value: Medium. It catches a bad gate before it ships, reducing silent false refusals.
    • Effort: Medium. It reuses existing readers and adds a command, tests, and one docs rule.
    • Related: feat(roadmap): a plan that adds a gate quotes the defect the gate refuses #3386, which asks for a different change. Both require a plan that adds a gate to show its effect, but #3386 asks for quoting one defect while the candidate asks for a command output that lists hits and false refusals per gate.
  3. added
    priority/p2-medium
    on Nov 4, 2026
  4. dan-petty commented on Nov 5, 2026

    @dan-petty
    OwnerAuthor

    The premise check of #3498 fails for the plan as written.

    1. The plan says that no command runs the gates over change folders. This is not true at origin/main (d254410). devops roadmap plan-recheck (feat(roadmap): one pass re-checks each merged plan against main #3492, src/devops_cli/roadmap/plan_recheck.py, src/devops_cli/commands/roadmap.py:793) reads each change folder of the default branch. It runs read_change, check_proposal and validate_change. It calls no model.

    2. A gap remains. plan-recheck reads only the default branch. It prints no refusal per gate. check_proposal returns one sentence for each problem, with no gate name (src/devops_cli/roadmap/stage_change.py:593). It has no comparison with a branch and no label for a case to review.

    3. The reader defect that the plan names is real. read_change raises pydantic.ValidationError for a criterion with Group 0, outside its try block (src/devops_cli/roadmap/plan_read.py, read_change). It was reproduced on origin/main. The defect is filed as fix(roadmap): a criterion of group 0 escapes the plan reader #3591.

    4. The plan cites line numbers that moved. check_proposal is at stage_change.py:593 and read_change is at plan_read.py:419. The plan's file list omits plan_recheck.py.

    Proposed re-scope: extend plan-recheck with a branch comparison and a gate name for each refusal, instead of adding a new command. A person decides the re-scope.

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

    @devops-cli-service
    Contributor

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

    Moved to new items: #3706.

  7. added
    owner/agent
    on Nov 6, 2026
  8. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    Answer from project standards, under the owner's instruction of 2026-11-05.

    The issue body now holds the re-scope of the premise check of 2026-11-05. The owner did not state the re-scope. It comes from the project rules named below, and a person can reverse it.

    Should the change extend plan-recheck or add a new command? Extend plan-recheck. AGENTS.md rule 3 asks for the tool that exists before new code. devops roadmap plan-recheck (#3492) already reads each change folder of the default branch and runs the plan reader, the gates and openspec validate with no model. A second command would repeat that. Code: src/devops_cli/roadmap/plan_recheck.py.

    How does a refusal learn its gate? check_gates in src/devops_cli/roadmap/stage_change.py gives the problems of check_proposal under the name of their gate (the enum ProposalGate). check_proposal joins them and returns the same list as before. A match on the text of a sentence would break when the text changes. plan-recheck adds the gates read and openspec for its other two checks.

    What makes a refusal new? The branch holds a refusal and the default branch holds none with the same folder, gate and message. The report marks each one as a case to review. It claims no proof of a false refusal.

    What does plan-recheck judge less than the job? It gives check_proposal no probes, overlaps, search_evidence or plan_creates. It does not measure the groups, scan the files for secrets or check the staging title. It calls no model. It judges a plan on the tree of the default branch or of the branch, and not on the commit that the job staged. So a plan that it accepts can still fail the job. Sources: src/devops_cli/roadmap/stage.py (_settle) and src/devops_cli/roadmap/plan_recheck.py.

    Does the run fit the 5-minute rule (AGENTS.md rule 5)? Yes. On 2026-11-06, uv run devops roadmap plan-recheck took 22 seconds over 55 folders, and --source . --branch HEAD took 33 seconds.

    Where do the other criteria go? The reader defect for a criterion of Group 0 stays in #3591, and plan-recheck catches no ValidationError. The full pass on origin/main ended with exit 0, so no folder holds that criterion today. The close of #3331 and #3397 and the decision on #3398 stay in #3706, because only a person closes an issue or decides the scope of another issue.

    The work is on the local branch feat/3498-plan-recheck-gate-compare. It is not pushed. The change folder openspec/changes/3498-plan-recheck-gate-compare/ is not archived yet.

  9. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    Answer from project standards, under the owner's instruction of 2026-11-05.

    The branch is now on origin/main at 7496693 (release 0.64.1). The rebase changed two facts of the comment above.

    Does the run fit the 5-minute rule (AGENTS.md rule 5)? Yes. On 2026-11-06, after the rebase, uv run devops roadmap plan-recheck --source . --branch HEAD took 46 seconds over 55 folders of main and 56 of the branch. The same command with no option took 44 seconds. The host is shared, so the time moves with its load: the earlier run took 33 and 22 seconds. The limit is 300 seconds.

    Does a new gate of the stage job change this plan? Yes. #3716 added the gate eval-replay (eval_replay_problems in src/devops_cli/roadmap/stage_change.py). It refuses a plan that changes stage_change.py and holds no group task that runs uv run devops roadmap eval stage --replay and states the score before and after. This change edits stage_change.py, so its plan now holds that task (task 1.3 of tasks.md). check_gates names the new gate eval-replay, and the page docs/roadmap/plan-recheck.md lists it. The replay printed Defects that a gate judges: 69 of 305 (23%) and Good plans that every gate accepts: 3 of 3 on origin/main and on the branch. The two outputs are equal, because check_proposal returns the same list as before.

    The report of --branch HEAD also shows the gate at work: 16 refusals of eval-replay on merged plans, each one a case to review. The branch adds no refusal to them.

    The work is on the local branch feat/3498-plan-recheck-gate-compare. It is not pushed.

  10. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    Answer from project standards, under the owner's instruction of 2026-11-05.

    The branch is now on origin/main at 9fc5d8f (release 0.64.2). The rebase had no conflict. It changes two numbers of the comment above.

    Does the run fit the 5-minute rule (AGENTS.md rule 5)? Yes. On 2026-11-06, uv run devops roadmap plan-recheck --source . --branch HEAD took 63 seconds of wall time. The host is shared, so the time moves with its load: earlier runs took 33 and 46 seconds. The limit is 300 seconds.

    Does the replay change? On the rebased branch, uv run devops roadmap eval stage --replay printed Defects that a gate judges: 69 of 306 (23%) and Good plans that every gate accepts: 4 of 4. The change adds no gate, so the count follows the cases that main gained.

    The narrow tests of tests/roadmap/test_roadmap_stage_gates.py, tests/roadmap/test_roadmap_plan_recheck.py and tests/commands/test_roadmap_plan_recheck_cmd.py pass. The full devops ci is not run yet. The work is on the local branch feat/3498-plan-recheck-gate-compare. It is not pushed.

  11. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 6, 2026
  12. removed
    status/in-review
    owner/agent
    on Nov 6, 2026
  13. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-06 05:30 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