Repository navigation
Description
Problem or Motivation
roadmap_stage_change.md(21,108 characters) restates about 8 of the 14 rules ofopenspec/config.yaml("at least 50 characters", "offline", "a shim or a legacy mode",skip_specsand others). The stage never reads that file.tests/roadmap/stage/test_roadmap_stage_prompt_rules.pyholds 54 tests with 52in promptchecks that keep the text in step.openspec instructions <artifact> --json(pinned 1.14.3) returns the context (935 characters) and the rules (4, 4, 1 and 5 for proposal, specs, design and tasks).src/devops_cli/openspec/gate.py:91-106already runs this probe.- With owner decision 3 (2026-11-11), all 6 other repositories get their own
openspec/config.yaml. The stage must read the rules of each repository, not the rules of devops-cli.
Proposed Solution & Architectural Design
- The stage request gets a "Rules of this repository" section, built from the context and the rules of
openspec instructions proposal|specs|design|tasks --jsonat the staged commit. - The stage prompt keeps the reply schema and the generic plan rules. Remove the restated config rules from it.
- Remove the prompt-rule tests that check the restated text together with the text.
Target Subsystem
SDLC, Git & PR Governance (src/devops_cli/roadmap/stage/).
Existing Tool Considered
The OpenSpec CLI gives the rules of a repository with openspec instructions --json. No other tool is necessary. Cost: about 60 lines, about 200,000 tokens and 3 hours to build.
Acceptance Criteria
-
uv run devops roadmap eval stage --replaygives a score that is not lower (both numbers in the pull request). - A test: the stage request for a scratch repository with its own
config.yamlholds the context line of that repository and none of devops-cli. - The character count of
roadmap_stage_change.mdgoes down. - A search for each of the 5 shared phrases finds it in
openspec/config.yamland not in the prompt.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Source: #4627
Alternatives check of 2026-11-26: in-use.
The repository already uses this tool.
Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec), MIT, last activity 2026-11-25, maintained.
Reason: Searches found no better alternative, and OpenSpec already supplies each repository's context and per-artifact planning rules through its instructions command, so only the stage-request wiring and prompt cleanup remain.
Covers:
- Returns repository context and rules for proposal, specs, design and tasks
- Reads each repository's own openspec/config.yaml
- Same probe already run in src/devops_cli/openspec/gate.py
- Merges defaults so the stage need not parse config itself
Lacks:
- No "Rules of this repository" section in the stage request
- Does not remove the restated rules from the stage prompt
- Does not delete the prompt-rule config checks
- Pinned 1.14.3 output shape must be checked against newer releases
Proposed design
Problem statement
The stage prompt restates about 8 of the 14 planning rules of openspec/config.yaml. The stage job never reads that file. With owner decision 3, each of the 6 other repositories gets its own openspec/config.yaml, so the stage must read the rules of each repository. The change wires the existing OpenSpec instructions probe into the stage request and removes the restated rules and their prompt-rule checks. The item waits on #6521, #4629 and #4633.
Acceptance criteria
Requirement: Stage request carries staged repository rules
The stage job SHALL add a Rules of this repository section from the staged commit's openspec instructions proposal|specs|design|tasks --json context and rules.
Scenario: Scratch repository config
- WHEN A test builds the stage request for a scratch repository whose
openspec/config.yamlholds a context line of its own. - THEN The request holds that context line and holds no context line of devops-cli.
Requirement: Probe reads the staged commit
The stage job MUST run the OpenSpec instructions probe on the staged commit through the same probe that src/devops_cli/openspec/gate.py runs.
Scenario: Working tree differs from staged commit
- WHEN A test sets a working-tree context line and a different staged-commit context line, then builds the stage request.
- THEN The request holds the staged-commit context line and holds no working-tree context line.
Requirement: Prompt keeps reply schema and generic plan rules
The stage prompt SHALL keep the reply schema and each plan rule that no openspec/config.yaml rule holds.
Scenario: Prompt-rule module
- WHEN A person runs
uv run devops ci test tests/roadmap/stage/test_roadmap_stage_prompt_rules.py. - THEN The run passes, and the module still asserts the reply keys of
StageProposaland thePENDING_PERSONvalue.
Requirement: Prompt restates no config rule
The stage prompt src/devops_cli/ai/tasks/roadmap_stage_change.md SHALL hold no phrase that the base commit's tests/roadmap/stage/test_roadmap_stage_prompt_rules.py pairs with openspec/config.yaml.
Scenario: Search each shared phrase
- WHEN A check runs
! git grep -n '<phrase>' src/devops_cli/ai/tasks/roadmap_stage_change.mdfor each phrase in the_CONFIGpairs at the base commit. - THEN Each command exits 0.
Requirement: Prompt-rule test drops config checks
The prompt-rule test module SHALL read no openspec/config.yaml and SHALL pass.
Scenario: Module runs and search finds no config read
- WHEN A check runs
uv run devops ci test tests/roadmap/stage/test_roadmap_stage_prompt_rules.pyand! git grep -n '_CONFIG' tests/roadmap/stage/test_roadmap_stage_prompt_rules.py. - THEN Both commands exit 0.
Requirement: Prompt character count falls
The character count of src/devops_cli/ai/tasks/roadmap_stage_change.md MUST be below 21108.
Scenario: Character count of the prompt
- WHEN A test counts the characters of the prompt.
- THEN The count is below 21108.
Requirement: Eval replay score does not fall
The stage eval replay score SHALL not be lower than the score of the base commit.
Scenario: Replay of the stage eval
- WHEN A person runs
uv run devops roadmap eval stage --replayon the change. - THEN The score is at least the score of the base commit, and the pull request body gives both scores.
Requirement: OpenSpec JSON shape is checked
The stage job SHALL parse the openspec instructions --json output shape of the pinned 1.14.3 release and a newer release fixture.
Scenario: Pinned and newer fixtures
- WHEN A test parses a 1.14.3 fixture and a newer release fixture through the stage adapter.
- THEN The adapter returns the context and the rules of each artifact for both fixtures.
Existing Tool Considered
OpenSpec (Fission-AI/OpenSpec) is in use. The alternatives check in the issue body gives the Covers and Lacks lists. The proposal uses the same probe that src/devops_cli/openspec/gate.py already runs, adds a test for a scratch repository, and adds a fixture test for the pinned 1.14.3 --json shape. The item builds no new tool.
Key questions
- How does the stage request get the planning rules of the staged repository?: Run the existing OpenSpec probe
openspec instructions proposal|specs|design|tasks --jsonat the staged commit throughsrc/devops_cli/openspec/gate.py, and build theRules of this repositorysection from its context and rules. (best practice) [sources: src/devops_cli/openspec/gate.py:91-106, openspec/config.yaml, src/devops_cli/roadmap/stage/stage_change.py]- Chosen: OpenSpec CLI probe. The tool merges the context and the rules of the repository, and
src/devops_cli/openspec/gate.pyalready runs the probe. - Rejected: Parse
openspec/config.yamlin the stage job. It copies the merge and default logic of the tool, and it drifts when the tool changes its schema. - Rejected: Keep the restated rules in the prompt. It gives devops-cli's rules to the 6 other repositories, which get their own config.
- Chosen: OpenSpec CLI probe. The tool merges the context and the rules of the repository, and
- Which artifacts' rules does the section carry?: The four artifacts that
openspec/config.yamlholds rules for: proposal, specs, design and tasks, with the context of the repository. [sources: openspec/config.yaml] - Does the change keep the prompt-rule checks whose document is not
openspec/config.yaml?: Yes. Remove only the checks that pair a phrase withopenspec/config.yaml, and keep the checks for the reply schema and the other documents. (best practice) [sources: tests/roadmap/stage/test_roadmap_stage_prompt_rules.py, openspec/config.yaml]- Chosen: Remove only the config pairs. The issue names the restated config rules, and the prompt keeps the phrases of the other documents.
- Rejected: Remove the whole module. It also holds the reply-schema and plan-form checks that no config rule covers.
- Rejected: Keep the config pairs and read the config in the test. The prompt no longer holds the text, so an
in promptcheck cannot pass.
- Where does the stage request put the rules section?: Before the reply schema and after the problem statement, so the planner reads the rules of the repository before the format of its reply. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md]
- Chosen: Before the reply schema. The planner reads the rules of the repository before the format of its reply.
- Rejected: After the reply schema. The format then sits between the rules and the reply, and the model weighs the format first.
- Rejected: At the end of the request. A rule at the end sits far from the reply, and the order of the prompt gains nothing.
- How does the change check the pinned
openspec instructions --jsonoutput shape?: Add a test with a fixture of the 1.14.3--jsonoutput and a fixture of a newer release, and parse both through the same adapter that the stage request uses. (best practice) [sources: src/devops_cli/openspec/gate.py:91-106, openspec/config.yaml]- Chosen: Pinned and newer fixture tests. The issue pins 1.14.3, and fixtures prove both shapes without a network or a live CLI.
- Rejected: Trust the installed CLI. A newer CLI can change the shape, and the test then fails late.
- Rejected: Parse
openspec/config.yamldirectly. It copies the merge and default logic of the tool.
- Which prompt-rule checks pair a phrase with
openspec/config.yaml?: The checks that use the module-level_CONFIGvalue, which readsopenspec/config.yamlat line 53. [sources: tests/roadmap/stage/test_roadmap_stage_prompt_rules.py:53]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 11, 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 rule duplication across repositories but does not block a release or fix a defect.It stops the stage prompt from drifting out of sync with per-repository openspec rules.The body estimates about 60 lines and 3 hours of work.Both work on roadmap_stage_change.md and its prompt-rule tests, but #3202 added tests to keep restated text in sync while the candidate removes the restated text and reads rules from openspec.devops-cli-service commentedon Nov 14, 2026
Alternatives check: in-use
Reason: The searches found no competing tool, and the issue's own "Existing Tool Considered" points at the OpenSpec CLI, whose
openspec instructions <artifact> --jsonalready returns a repository's context and its per-artifact rules (proposal, specs, design, tasks) fromopenspec/config.yaml, which is exactly the need. The project already runs that probe insrc/devops_cli/openspec/gate.pyand adopted OpenSpec in ADR 0010, so the tool is in use and nothing else is required.The repository already uses this tool.
Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec)
Covers:
openspec instructions proposal|specs|design|tasks --jsonreturns the context and the rules of the repository the command runs inopenspec/config.yaml, not only devops-clisrc/devops_cli/openspec/gate.py:91-106already doesroadmap_stage_change.mdwithout losing themLacks:
roadmap eval stage --replayscore, lower character count, the scratch-repository test) are outside the toolinstructions --jsonoutput shape must be checked against the pinned versionTools considered:
Searches run:
Sources:
Checked on 2026-11-13. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 14, 2026
Refine cannot set this item to Ready at 0410772 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 1812dd2 (see proposed design in issue body).
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.