Repository navigation
Description
Problem Description
A stage plan can carry a spec delta whose requirement text is longer than 500 characters. Every plan gate accepts it, and uv run devops openspec check passes, because the length warning of OpenSpec applies only to a spec, not to a change. The implement job then fails at the end of its run: uv run devops openspec archive <change> merges the delta into the spec, and openspec validate --all --strict refuses the merged spec with "Requirement text is very long (>500 characters)". The run did all its work and stops at the last step.
Case: item #3462. Its plan (PR #4435) held a MODIFIED requirement of roadmap-stage with 543 characters. The implement run (PR #4465, runner Job of 2026-11-11 02:25) finished both tasks in 55 minutes and stopped at archive with "Totals: 258 passed, 1 failed", "✗ spec/roadmap-stage", "Requirement text is very long (>500 characters)". A person shortened the text to 451 characters, and the archive then passed.
Reproduction Steps
- Write a change whose spec delta holds a requirement of more than 500 characters.
- Run
uv run devops openspec checkanduv run devops roadmap plan-check <pr>: both pass. - Run
uv run devops openspec archive <change>: the strict validation of the merged spec fails.
Expected vs Actual Behavior
Expected: the stage gates (check_proposal) refuse a requirement text of more than 500 characters, with a message that names the requirement and its length, so the planner shortens it before the plan is staged. The limit comes from OpenSpec, so the check reads it from one constant with a comment that names the OpenSpec rule.
Actual: no gate sees the length. The implement run fails at its last step and spends its tokens for nothing.
Proposed fix
Add the length rule to the stage gates for each ADDED and MODIFIED requirement of a spec delta, and to plan-check. Prefer running the OpenSpec validation of the merged spec in the gate if OpenSpec offers it for a change (see #3429), so the gate follows OpenSpec and adds no copy of its rules; if it does not, check the length in the gate with the constant. Add the #3462 delta as a golden case.
Environment Diagnostics
- DevOps CLI Version: main after PR fix(roadmap): accept a test-only group that changes a test helper #4465 (merge commit 74d358a)
- Execution Environment: the roadmap Service stage job and the implement runner Job
Related: #3429 (the implement plan gate runs the OpenSpec validation), #4503 (a failed archive validation stops with the class test), #4487 (the stop path after a failed archive).
Proposed design
Problem statement
A plan can hold a spec delta requirement longer than 500 characters. Every stage gate accepts it, and the OpenSpec check of the change passes. The implement job then fails at archive, because openspec validate --all --strict refuses the merged spec. The stage gates and plan-check must refuse the long requirement before a person stages the plan.
Acceptance criteria
Requirement: Long ADDED requirement is refused
check_proposal SHALL refuse a spec delta whose ADDED requirement text is longer than 500 characters.
Scenario: ADDED requirement of 543 characters
- WHEN A stage reply holds a spec delta with an ADDED requirement of 543 characters.
- THEN
check_proposalreturns a problem that names the requirement and its length of 543 characters.
Requirement: Long MODIFIED requirement is refused
check_proposal SHALL refuse a spec delta whose MODIFIED requirement text is longer than 500 characters.
Scenario: MODIFIED requirement of 543 characters
- WHEN A stage reply holds a spec delta with a MODIFIED requirement of 543 characters, as in the fix(roadmap): accept a test-only group that changes a test helper #3462 plan.
- THEN
check_proposalreturns a problem that names the requirement and its length of 543 characters.
Requirement: Requirement at the limit passes
The gate SHALL accept a requirement text of exactly 500 characters.
Scenario: Requirement of 500 characters
- WHEN A spec delta holds a requirement text of exactly 500 characters.
- THEN
check_proposalreturns no length problem for that requirement.
Requirement: One constant holds the limit
The 500-character limit MUST come from one module constant whose comment names the OpenSpec rule.
Scenario: Single constant
- WHEN A test searches the gate modules for the value 500.
- THEN Only the constant definition holds that value, and
plan_checkimports the constant.
Requirement: plan-check reports the same problem
uv run devops roadmap plan-check SHALL report the length problem for a change with a long requirement.
Scenario: plan-check on a long requirement
- WHEN A change folder holds a spec delta requirement of 543 characters, and the command runs on it.
- THEN The command exits non-zero and prints the requirement name and the length of 543 characters.
Requirement: #3462 is a golden case
The stage eval replay MUST hold the #3462 delta as a case that check_proposal refuses.
Scenario: Replay of the #3462 case
- WHEN
uv run devops roadmap eval stage --replayruns on the case set. - THEN The case with the 543-character requirement is listed as caught by
check_proposal.
Requirement: Replay keeps its result
uv run devops roadmap eval stage --replay MUST still exit 0 after the gate change.
Scenario: Replay regression
- WHEN The replay runs on the whole case set after the change.
- THEN The command exits 0 and refuses no good plan.
Existing Tool Considered
No alternatives check has run. OpenSpec is the open, maintained tool that owns the rule: its strict validation refuses a requirement text longer than 500 characters. OpenSpec applies that rule to a spec only. The validation of a change passes, so the gate must carry the rule. The change adds one constant and one length comparison to the spec-delta gate. It does not copy the validator. The written cost is about 2,000 tokens to build the check and its tests. It is about 500 tokens a month to keep and fix, and two hours of elapsed time.
Key questions
- Where does the length rule live so that
check_proposalandplan-checkboth apply it?: In the spec-delta gate thatcheck_proposalcalls,src/devops_cli/roadmap/stage/stage_specs.py.plan-checkruns the gates ofcheck_proposal, so it gets the rule with no second copy. (best practice) [sources: docs/roadmap/plan-recheck.md:15, docs/roadmap/plan-check.md:26, src/devops_cli/roadmap/stage/stage_specs.py]- Chosen: Spec-delta gate module.
check_proposalcalls it, andplan-checkruns the same gates, so one rule serves both paths. - Rejected:
plan_check.py. It is a second copy. The stage gate would accept the plan, and the defect would reach the implement job. - Rejected: The implement gate. It refuses the plan after the run spends its tokens. The issue asks for the refusal at staging.
- Chosen: Spec-delta gate module.
- Should the gate run the OpenSpec validation of the merged spec, or check the length with one constant?: Check the length with one constant. OpenSpec applies its 500-character rule to a spec, not to a change, so the validation of a change passes. The validation of the merged spec belongs to fix(roadmap): the implement plan gate runs the OpenSpec validation too #3429. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:327, docs/roadmap/plan-check.md:26, src/devops_cli/roadmap/stage/stage_specs.py]
- Rejected: Run the OpenSpec validation of the merged spec. OpenSpec offers no change-level validation that applies the rule. The gate would merge the delta into a spec first, and fix(roadmap): the implement plan gate runs the OpenSpec validation too #3429 owns that path.
- Chosen: Check the length in the gate with one constant. It follows the OpenSpec rule, names the defect at staging, and adds no copy of the validator.
- Rejected: Change nothing and let
archivefail. The run does all its work and stops at the last step, as the fix(roadmap): accept a test-only group that changes a test helper #3462 case shows.
- Which sections of a spec delta does the check read?: Every ADDED and MODIFIED requirement. The REMOVED and RENAMED sections hold no requirement text to measure. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:327, src/devops_cli/roadmap/stage/stage_specs.py]
- Chosen: ADDED and MODIFIED. OpenSpec measures the requirement text, and only these sections carry it.
- Rejected: All sections. The REMOVED and RENAMED sections hold no requirement text, so the check has nothing to measure.
- Rejected: ADDED only. The fix(roadmap): accept a test-only group that changes a test helper #3462 case is a MODIFIED requirement, so the defect would pass.
- Where does the 500-character limit live?: One module constant in the spec-delta gate module,
MAX_REQUIREMENT_CHARS = 500, with a comment that names the OpenSpec rule.plan_checkimports that constant. (best practice) [sources: src/devops_cli/roadmap/stage/stage_specs.py, src/devops_cli/roadmap/plan_check.py]- Chosen: One constant in the gate module. Both paths read one value, and the comment names the OpenSpec rule that sets it.
- Rejected: A literal at each site. Two copies drift, and a change of the OpenSpec rule needs two edits.
- Rejected: Read the limit from OpenSpec at runtime. The gate calls no OpenSpec command today, and a call on each reply adds a dependency and time to every stage run.
- What does the problem message state?: The name of the requirement, its character count, and the limit of 500. The planner then shortens the text before the plan is staged. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:327, src/devops_cli/roadmap/stage/stage_specs.py]
- Chosen: Name and length. The planner sees which requirement to shorten and by how much.
- Rejected: The length only. A delta can hold several requirements, so the planner cannot tell which one to shorten.
- How is the fix(roadmap): accept a test-only group that changes a test helper #3462 delta added as a golden case?: Add a case to the stage eval set with the MODIFIED requirement of
roadmap-stageat 543 characters. Mark it as caught bycheck_proposalin thespec_delta_wrongtype. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:327, tests/roadmap/stage/test_roadmap_stage_gates.py]- Chosen: A case in the stage eval set. The replay then reports the defect as caught, and the counts show the gain.
- Rejected: A unit test only. The replay counts the known defects that a gate catches, and a unit test does not change those counts.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
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.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.A real defect wastes 55 minutes of compute per occurrence but a person can shorten the text as a workaround.Prevents wasted implement runs, but the manual fix exists and the failure is visible at the end.Adding a length check to existing gate functions is a small, localized code change.Both catch OpenSpec validation issues before the implement run, but #3429 adds OpenSpec validation to the implement plan gate while this adds a length rule to the stage gates.devops-cli-service commentedon Nov 11, 2026
Status set to Ready at 5f75d25 (see proposed design in issue body).
devops-cli-service commentedon Nov 11, 2026
Released in v0.112.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.112.0
devops-cli-service commentedon Nov 11, 2026
Live since 2026-11-11 14:13 UTC