Repository navigation
Description
Problem or Motivation
The review of a plan pull request is manual. In one session, 23 plan pull requests were reviewed by hand, with the checklist rewritten in each prompt. The checklist drifted: one version told reviewers to flag the tuicr line in tasks.md, which openspec/config.yaml allows, and three review comments needed a correction. Most of the checks are mechanical: a path exists at the commit, a requirement name is new or exists, an operation is ADDED or MODIFIED, a new test sits in the mirror folder, a verify command has the right form, the title has at most 60 characters. The stage job runs most of these gates on its own reply, and a person or an agent cannot run them on a pull request that already exists.
Proposed Solution & Architectural Design
- Add
devops roadmap plan-check <pull-request>. It reads the change folder at the head of the pull request and runs the same gates as the stage job (check_proposalandvalidate_change) on it, without a model. It also runs the checks of the pull request itself: the title form, the body length,Plans #<issue>orCloses #<issue>, and the state of theSemantic PR titlecheck. - It prints each problem with the file and the rule, in the same words as the messages of the stage job, and it exits 1 when it finds one.
- It adds checks the gates do not run on a reply: a base spec that moved since the plan (a
MODIFIEDrequirement whose text changed), and an issue that the plan depends on that is open. --jsonprints the problems for an agent.--dry-runprints the requests.- A plan-review skill (or sub-agent definition) can then call this command and add only the judgement parts: the premise check against the code and the scope. The mechanical part has one source.
Open questions for the refine step: how to rebuild the StageProposal from a change folder on disk (the gates read the model's reply, not the files), and whether the command belongs in roadmap or in openspec.
Target Subsystem
src/devops_cli/commands/roadmap.py (or the new command files from the structure issues), src/devops_cli/roadmap/stage_validate.py, src/devops_cli/roadmap/stage_change.py.
Existing Tool Considered
openspec validate --strict checks the shape of a change, and the project already runs it in stage_validate.py. It does not check paths against the commit, the mirror folder or the pull request title. Cost to build: about 120k tokens and 6 hours. To keep: the gates are shared with the stage job, so it adds one reader and one command.
Related: #3013, #3015, #3017, #3019 (the gates), #3153.
Proposed design
Problem statement
Plan pull request reviews are manual. The checklist changes between prompts, so reviewers miss mechanical defects. The stage job runs the gates on a model reply, but no command runs them on a pull request that already exists. This change adds a plan-check command that runs the same gates and the pull request checks without a model.
Acceptance criteria
Requirement: Plan-check reads the pull request head
The devops roadmap plan-check command SHALL read the change folder from the head commit of the named pull request.
Scenario: The head commit supplies the change folder
- WHEN the pull request head holds
openspec/changes/3201-plan-check/and the base does not - THEN the command reads
proposal.md,tasks.mdand the spec deltas from the head commit.
Requirement: Plan reader round-trips a change folder
The plan reader SHALL build a StageProposal from the files of a change folder that gives the same gate inputs as the proposal that render_change wrote.
Scenario: A rendered change reads back
- WHEN
render_changewrites a valid proposal with groups, specs and criteria - THEN the reader gives a
StageProposalwhosegroups,specs,criteriaandskip_specsequal the original.
Requirement: Plan-check runs the stage gates without a model
The command MUST run check_proposal and validate_change on the change folder without a model client.
Scenario: The gates run with no model
- WHEN the command checks a valid plan
- THEN the test records calls to
check_proposalandvalidate_changeand no call to a model client.
Requirement: Plan-check reports a stage problem
The command SHALL print each problem with its file, its rule and the message that the stage job uses, and exit 1 when it finds one.
Scenario: A missing path gives the stage message
- WHEN a group changes
src/devops_cli/roadmap/missing.pythat the head tree does not hold - THEN stdout holds the path and the missing-path message, and the exit code is 1.
Requirement: Plan-check checks the title
The command SHALL report a problem when the pull request title is not docs(openspec): plan # or when its summary is longer than SUMMARY_MAX_CHARS.
Scenario: A wrong title is reported
- WHEN the pull request title is
feat(roadmap): add plan-check - THEN the output names the title rule and the exit code is 1.
Requirement: Plan-check checks the body
The command SHALL report a problem when the pull request body is longer than BODY_MAX_CHARS, lacks Plans #, or holds Closes #.
Scenario: A missing plan reference is reported
- WHEN the pull request body holds no
Plans #line - THEN the output names the body rule and the exit code is 1.
Requirement: Plan-check reads the Semantic PR title check
The command MUST report the Semantic PR title check as a problem unless its conclusion is success.
Scenario: A failed Semantic PR title check is reported
- WHEN the pull request has a
Semantic PR titlecheck with conclusionfailure - THEN the output names the check and the exit code is 1.
Requirement: Plan-check reports a moved base spec
The command SHALL report each MODIFIED requirement whose text in the base spec at the plan commit differs from the text at the pull request base.
Scenario: A changed base requirement is reported
- WHEN the base spec at the plan commit holds
The job SHALL stage one item.and the pull request base holdsThe job SHALL stage two items.for the same requirement - THEN the output names the capability and the requirement, and the exit code is 1.
Requirement: Plan-check prints JSON
The --json option SHALL print the problems as a JSON array of objects with path, rule and message.
Scenario: JSON output parses
- WHEN the command finds one problem and runs with
--json - THEN stdout parses as a JSON array with one object that has
path,ruleandmessage.
Requirement: Plan-check dry run makes no request
The --dry-run option MUST print the GitHub requests and make none.
Scenario: Dry run lists requests
- WHEN the command runs with
--dry-run - THEN the output lists each request and the test records no GitHub API call.
Existing Tool Considered
No alternatives check has run. The issue names openspec validate --strict; it checks the shape of a change only. It lacks checks for a path at the commit, the mirror folder, the pull request title and body, the Semantic PR title check and a moved base spec. The issue gives the cost to build as about 120k tokens and 6 hours; to keep, one reader and one command share the stage gates.
Key questions
- Where does the plan-check command belong?: It belongs in
devops roadmapasplan-check. It reads a roadmap plan pull request and calls the roadmap stage gates.devops openspecstays the OpenSpec tool gate. (best practice) [sources: src/devops_cli/commands/roadmap.py, src/devops_cli/roadmap/stage_validate.py, openspec/config.yaml]- Chosen: roadmap command. It reads a roadmap plan pull request and shares the stage gates.
- Rejected: openspec command.
openspecchecks the OpenSpec tree and does not read a pull request. - Rejected: separate pull request command. It would duplicate the roadmap store and the pull request form code.
- How does the command build the stage input from the change folder?: It reads the change folder into a
StageProposalwith a new reader, then callscheck_proposalandvalidate_changeunchanged. Round-trip tests prove thatrender_changeoutput reads back to the same gate inputs. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_validate.py, docs/ROADMAP_WORKFLOW.md]- Chosen: Read into StageProposal. It reuses the existing gates and one reader; round-trip tests bound the file format.
- Rejected: Change the gates to read raw files. It splits each gate into two paths and doubles the checks.
- Rejected: Store plan.json at stage time. Existing plan pull requests have no plan.json, so the command cannot check them.
- How does the command find the change folder?: It takes the one
openspec/changes/-/folder whose issue number is the issue in the pull request body. It reports a problem when zero or more than one folder match. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/stage_change.py]- Chosen: Match the issue number. The change folder name carries the issue number.
- Rejected: Take the first folder. A pull request can hold more than one change folder by mistake.
- Rejected: Read the path from the body. The body format does not name the folder.
- How does the command detect a base spec that moved since the plan?: It compares the base spec at the parent of the commit that added the change folder with the base spec at the pull request base, for each
MODIFIEDrequirement. It reports a changed or missing text. (best practice) [sources: src/devops_cli/roadmap/stage_validate.py, src/devops_cli/roadmap/stage_change.py]- Chosen: Compare plan parent with pull request base. It measures movement since the plan was written.
- Rejected: Compare pull request base with pull request head. The head holds the change delta, not the base spec.
- Rejected: Run no check. The issue asks for this check.
- Does a missing
Semantic PR titlecheck fail plan-check?: Yes. TheSemantic PR titlecheck is required onmain, so a plan pull request with no successful check is not ready. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md]- Chosen: Report missing and failing. The check is required before merge.
- Rejected: Report only failing. A missing check cannot pass the gate.
- Rejected: Ignore the check. The issue asks for the check state.
- Which issue reference does a plan pull request need in its body?: It needs
Plans #. The command reportsCloses #as a problem because a plan pull request closes no issue. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/stage_change.py]- Chosen: Require Plans #. CONTEXT says a plan pull request closes no issue, and the stage body writes
Plans. - Rejected: Accept Plans or Closes.
Closeswould close the issue when the plan merges. - Rejected: Require no reference. The plan must link its issue.
- Chosen: Require Plans #. CONTEXT says a plan pull request closes no issue, and the stage body writes
- What title and body limits apply to a plan pull request?: The title is
docs(openspec): plan #with a summary of at mostSUMMARY_MAX_CHARScharacters. The body is at mostBODY_MAX_CHARScharacters. [sources: src/devops_cli/roadmap/stage_change.py] - How does the command report problems to a person and to an agent?: It prints one line for each problem with the file, the rule and the message. It exits 1 when it finds one.
--jsonprints objects withpath,ruleandmessage. (best practice) [sources: src/devops_cli/commands/roadmap.py, src/devops_cli/roadmap/stage_change.py]- Chosen: Human lines and JSON. A person reads the lines and an agent reads the JSON.
- Rejected: JSON only. A person needs a readable line in the terminal.
- Rejected: Human lines only. The issue asks for
--jsonfor an agent.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 2, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It removes manual review of mechanical checks but does not block a release or fix a defect.It saves reviewer time on 23+ plan pull requests per session by automating the mechanical checks.It needs a new command, a disk-based change-folder reader, reuse of existing gates, new checks, and CLI flags; the body estimates about 6 hours.Both use the same mechanical gates on a plan, but #3153 adds model-based verification inside the stage job while the candidate adds a CLI command that runs those gates on an already-opened plan pull request.devops-cli-service commentedon Nov 2, 2026
Status set to Ready at 24ef67a (see proposed design in issue body).
Moved to new items: #3224.
devops-cli-service commentedon Nov 2, 2026
Staged: branch
feat/3201-add-a-plan-check-command-for, draft pull request #3261. 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:
The plan run made 3 model request(s), and used 231264 input tokens and 18243 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:
criterion_droppedat plan (spec delta and groups 1-3): The issue asks for a check on an open issue that the plan depends on. No requirement, scenario or task in the plan covers it, and the plan does not say why it leaves the check out. Evidence: "a base spec that moved since the plan (aMODIFIEDrequirement whose text changed), and an issue that the plan depends on that is open."dan-petty commentedon Nov 2, 2026
Another case for the plan-check command, from the plan fix of #3194 (2026-11-02): the repository invariant
tests/invariants/test_committed_addresses.pyis not run on a staged plan. A plan that wrote the example address10.1.2.3was staged, and only CI caught it (Tests & Coveragered on the first push of the fix). The plan-check command should run the invariants that read text files (committed addresses, private hosts, secret patterns, ASD-STE100 style) over the change folder, so a plan with a private example fails at staging and not in CI.Generated by Claude Code
docs(openspec): plan #3201 add a plan-check command for a plan pull r…
docs(openspec): fix plan #3201 to read a checkout and report unreadab…
docs(openspec): plan #3201 add a plan-check command for a plan pull r…
devops-cli-service commentedon Nov 4, 2026
Released in v0.54.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.54.0
devops-cli-service commentedon Nov 4, 2026
Live since 2026-11-04 04:48 UTC