Repository navigation
Description
Problem or Motivation
When a person or tool runs devops pr check-readiness on a valid Staging Plan Pull Request (Gate G1, such as PR #3183), the command reports false blockers. It fails with:
PR #<num> is not grounded: it closes no issue. Put Closes #<issue> in its body for the one issue it delivers.PR #<num> does not add the archived change folder openspec/archive/<date>-<change>/ of issue <issue>. Archive the change with devops openspec archive <change> before merge.
The roadmap workflow distinguishes Gate G1 (Staging Plan Pull Requests) from Gate G2 (Implementation Delivery Pull Requests). A Gate G1 pull request adds an active change folder under openspec/changes/<issue>-<slug>/ and uses Plans #<issue> in its body. It must not close its issue and must not add an archive folder.
_judge_grounding in src/devops_cli/github/merge_readiness.py assumes that every pull request into the default branch delivers an item. It calls read_closing_issues and tests delivery grounding rules on every pull request.
Proposed Solution & Architectural Design
- Distinguish Plan Pull Requests (Gate G1) from Delivery Pull Requests (Gate G2) in
assess_merge_readiness:- Detect Gate G1 by PR title prefix
docs(openspec): plan #<issue>or by changed paths that touch onlyopenspec/changes/<issue>-<slug>/.
- Detect Gate G1 by PR title prefix
- For Gate G1 pull requests:
- Do not require
Closes #<issue>. Verify that the body usesPlans #<issue>. - Do not require an archived folder. Verify that the pull request adds the active change folder
openspec/changes/<issue>-<slug>/. - Verify that the pull request touches no living spec file under
openspec/specs/.
- Do not require
- Alternatively, when issue feat(roadmap): add a plan-check command for a plan pull request #3201 adds
devops roadmap plan-check, call or delegate Gate G1 checks to that validator. - Add tests in
tests/github/test_merge_readiness.pyverifying that a valid Gate G1 plan pull request passes readiness checks without false grounding blockers.
Target Subsystem
src/devops_cli/github/merge_readiness.py, src/devops_cli/roadmap/grounding.py
Existing Tool Considered
devops pr check-readiness is the existing command. Adding Gate G1 grounding rules to it repairs false positive errors and aligns the command with docs/ROADMAP_WORKFLOW.md. Cost to build: about 5,000 tokens and 30 minutes.
Proposed design
Problem statement
The command devops pr check-readiness reports false blockers on valid Gate G1 plan pull requests. It applies delivery grounding rules that require Closes # and an archived change folder. This change adds Gate G1 detection and plan-specific checks. Delivery pull requests keep the current rules.
Acceptance criteria
Requirement: Valid Gate G1 plan is ready
A Gate G1 plan pull request SHALL pass readiness without a closing-issue or archive blocker when its title or changed folder names issue 3183, its body uses Plans #3183, and it adds files under openspec/changes/3183-add-plan-check/.
Scenario: Valid plan pull request
- WHEN The pull request title is docs(openspec): plan docs(openspec): plan #3049 Plan the review gate before the ready mark #3183, its body has Plans docs(openspec): plan #3049 Plan the review gate before the ready mark #3183, and it adds only openspec/changes/3183-add-plan-check/proposal.md and tasks.md.
- THEN The readiness verdict is ready, has no grounding blocker, and sends no closing-issues GraphQL read.
Requirement: Plan body has Plans line
A Gate G1 plan pull request MUST have exactly one Plans # line that names its issue.
Scenario: Missing Plans line
- WHEN A Gate G1 plan pull request for issue 3183 has no Plans docs(openspec): plan #3049 Plan the review gate before the ready mark #3183 line.
- THEN The readiness verdict has one grounding blocker that names the Plans # form and no blocker that requires an archived folder.
Requirement: Plan body uses no closing keyword
A Gate G1 plan pull request MUST NOT use a closing keyword for its issue.
Scenario: Plan body closes its issue
- WHEN A Gate G1 plan pull request for issue 3183 has a body line Closes docs(openspec): plan #3049 Plan the review gate before the ready mark #3183 and a Plans docs(openspec): plan #3049 Plan the review gate before the ready mark #3183 line.
- THEN The readiness verdict has one grounding blocker that names the closing keyword and no blocker that requires an archived folder.
Requirement: Plan adds active change folder
A Gate G1 plan pull request MUST add at least one file under openspec/changes/-/ for its issue.
Scenario: Plan changes no active change folder
- WHEN A Gate G1 plan pull request for issue 3183 changes only docs/notes.md.
- THEN The readiness verdict has one grounding blocker that names the missing active change folder and no blocker that requires an archived folder.
Requirement: Plan touches no living spec
A Gate G1 plan pull request MUST NOT change any path under openspec/specs/.
Scenario: Plan changes a living spec
- WHEN A Gate G1 plan pull request adds openspec/changes/3183-add-plan-check/proposal.md and modifies openspec/specs/roadmap/spec.md.
- THEN The readiness verdict has one grounding blocker that names openspec/specs/ and no blocker that requires an archived folder.
Requirement: Plan adds no archive
A Gate G1 plan pull request MUST NOT change any path under openspec/changes/archive/.
Scenario: Plan adds an archived change
- WHEN A Gate G1 plan pull request adds openspec/changes/3183-add-plan-check/proposal.md and openspec/changes/archive/2026-01-01-3183-add-plan-check/proposal.md.
- THEN The readiness verdict has one grounding blocker that names openspec/changes/archive/ and no blocker that requires an archived folder.
Requirement: Plan detected by active folder
A Gate G1 plan pull request whose title is not the plan prefix SHALL be detected when every changed path lies under one added active change folder and the body uses Plans #.
Scenario: Plan title is not the plan prefix
- WHEN A pull request titled chore: add plan adds only files under openspec/changes/3183-add-plan-check/ and its body has Plans docs(openspec): plan #3049 Plan the review gate before the ready mark #3183.
- THEN The readiness verdict is ready and has no closing-issue blocker.
Requirement: Delivery pull request keeps delivery rules
A pull request that is not a Gate G1 plan MUST still close exactly one open roadmap item and add its archived change folder.
Scenario: Delivery pull request closes no issue
- WHEN A pull request with title fix(pr): repair check-readiness changes src/devops_cli/github/merge_readiness.py and closes no issue.
- THEN The readiness verdict keeps the existing it closes no issue grounding blocker.
Existing Tool Considered
No alternatives check has run. The existing command devops pr check-readiness covers the need but lacks Gate G1 awareness. No external open, maintained tool covers this repository-specific rule. Build cost: about 5,000 tokens and 30 minutes.
Key questions
- What does _judge_grounding do today?: It applies the delivery GROUNDING_RULES to every pull request whose base holds openspec/changes/, and it reads closing issues for a pull request into the default branch. Thus a Gate G1 plan pull request fails closes_one_issue and archives_its_change. [sources: src/devops_cli/github/merge_readiness.py:432, src/devops_cli/github/merge_readiness.py:535, src/devops_cli/roadmap/grounding.py]
- How should readiness identify a Gate G1 plan pull request?: Use the title prefix docs(openspec): plan # or, when the title has no prefix, an added set of files that all lie under one active openspec/changes/-/ folder. Then require the body to use Plans # for that issue. (best practice) [sources: CONTEXT.md, docs/ROADMAP_WORKFLOW.md, src/devops_cli/github/merge_readiness.py]
- Rejected: Title prefix only. A plan pull request with an edited title would still get delivery blockers.
- Rejected: Changed paths only. A delivery pull request that edits only an active change folder could be misclassified.
- Chosen: Title prefix or active folder. The body proposes both signals, and CONTEXT.md says a staged plan closes no issue and has type docs(openspec).
- Which rules must a Gate G1 plan pull request pass?: It MUST target the default branch, use exactly one Plans # and no closing keyword for that issue, add at least one file under its active change folder, and change no path under openspec/specs/ or openspec/changes/archive/. It MUST NOT read closing issues or require an archived folder. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, CONTEXT.md, src/devops_cli/roadmap/grounding.py]
- Rejected: Reuse delivery rules with exceptions. The closing read and archive rule still need bypasses, which hides the gate.
- Chosen: Separate plan rules. Each plan failure is one blocker and no closing-issue read is needed.
- Rejected: Delegate to devops roadmap plan-check (feat(roadmap): add a plan-check command for a plan pull request #3201). That command does not exist yet, so it would block this fix.
- Where should the Gate G1 rules live?: Add a PlanGrounding fact type and plan_grounding_blockers to src/devops_cli/roadmap/grounding.py. merge_readiness.py detects the plan, reads changed files, and applies those rules. (best practice) [sources: src/devops_cli/roadmap/grounding.py, src/devops_cli/github/merge_readiness.py]
- Rejected: All logic in merge_readiness.py. It breaks the module split and makes pure rules hard to test.
- Chosen: Pure rules in roadmap/grounding.py. The module docstring says pure predicates live there and merge_readiness reads facts and applies rules.
- Rejected: New module. The rules are small and belong with the existing item grounding rules.
- Should a plan pull request that uses a closing keyword be blocked?: Yes. Gate G1 closes no issue, so readiness MUST block a Closes, Fixes or Resolves keyword for the plan issue even when Plans # is present. (best practice) [sources: CONTEXT.md, docs/ROADMAP_WORKFLOW.md]
- Chosen: Block closing keywords. CONTEXT.md says a staged plan pull request closes no issue, and GitHub would close the issue on merge.
- Rejected: Ignore closing keywords. A plan pull request with both keywords would close its issue at G1.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 2, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(pr)scope of the title gives the scope.A valid plan pull request is blocked by a false error, but a manual workaround exists and only Gate G1 PRs are affected.It removes false blockers for all plan pull requests in the roadmap workflow.The candidate scopes the change to _judge_grounding in merge_readiness.py plus tests, about 30 minutes of work.Both concern validation of plan pull requests, but the candidate fixes a false positive in the existing check-readiness command while #3201 adds a new plan-check command.devops-cli-service commentedon Nov 3, 2026
Status set to Ready at 1b3184b (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
Released in v0.48.5: https://github.com/dan-petty/devops-cli/releases/tag/v0.48.5
devops-cli-service commentedon Nov 3, 2026
Live since 2026-11-03 13:34 UTC