Repository navigation
Description
Problem or Motivation
The plan in PR #3260 (for #3200) copied "a bound of 40 characters" for the summary from the issue text. The real system says other things: SUMMARY_MAX_CHARS is 60 in src/devops_cli/roadmap/pull_form.py, StageProposal.summary already has max_length=SUMMARY_MAX_CHARS, and src/devops_cli/ai/tasks/roadmap_stage_change.md tells the model "at most 47 characters". The plan's spec scenario ("41 characters", "the 40-character bound") and its design ("SUMMARY_MAX_CHARS") disagree with each other and with the code. The Feasibility checked the cut titles and did not check the number.
A plan that carries a number from the issue (a bound, a count, a timeout) is a claim that the number holds in the code.
Proposed Solution & Architectural Design
- In the plan check, find a number that a requirement, a scenario or a decision gives next to a name of a constant (
SUMMARY_MAX_CHARS,..._MAX_...), and compare it with the value of that constant in the staged tree. - Refuse a plan whose number differs, and name the constant and its value.
- Ask the plan stage prompt to cite the value of each constant that the plan relies on, as the probe does for paths.
Target Subsystem
The plan check and the premise probe of devops roadmap (src/devops_cli/roadmap/stage_probe.py, stage_change.py).
Source: #3260
Proposed design
Problem statement
The plan check accepts a plan that copies a number from the issue but names a constant with a different value. PR #3260 shows the fault: a plan said 40 characters while SUMMARY_MAX_CHARS is 60. The change makes the plan check compare each such number with the constant in the staged tree and refuse a mismatch.
Acceptance criteria
Requirement: Mismatched constant claim
The plan check SHALL refuse a plan when a number beside a known integer constant in a requirement, a scenario or a decision differs from the staged value.
Scenario: Summary bound mismatch
- WHEN A spec scenario says
SUMMARY_MAX_CHARSis 40, and the staged tree setsSUMMARY_MAX_CHARS = 60. - THEN The check returns one problem that names
SUMMARY_MAX_CHARS, 40 and 60.
Requirement: Matching constant claim
The plan check SHALL accept a plan when the number beside a known integer constant equals the staged value of that constant.
Scenario: Summary bound match
- WHEN A design decision says
SUMMARY_MAX_CHARSis 60, and the staged tree setsSUMMARY_MAX_CHARS = 60. - THEN The check returns no problem about
SUMMARY_MAX_CHARS.
Requirement: Unknown constant ignored
The plan check MUST ignore a constant name that the staged tree does not define as a module-level integer constant.
Scenario: New plan constant
- WHEN A design decision names
PLAN_SUMMARY_MAX_CHARS = 47, and the staged tree does not definePLAN_SUMMARY_MAX_CHARS. - THEN The check returns no problem about
PLAN_SUMMARY_MAX_CHARS.
Requirement: Task commands not checked
The plan check MUST NOT compare a number in tasks.md with a constant.
Scenario: Task command number
- WHEN
tasks.mdholdsSUMMARY_MAX_CHARSand 40 in one command, and the staged tree setsSUMMARY_MAX_CHARS = 60. - THEN The check returns no problem about
SUMMARY_MAX_CHARS.
Requirement: Prompt cites constants
The plan stage prompt SHALL tell the model to cite the staged value of each constant that the plan relies on.
Scenario: Prompt rule
- WHEN The prompt rules test reads
src/devops_cli/ai/tasks/roadmap_stage_change.md. - THEN The text holds an instruction to cite each constant value.
Requirement: Constant values read without execution
The plan check MUST read constant values with Python AST and MUST NOT import or execute staged code.
Scenario: Non-literal assignment
- WHEN A staged module sets
SUMMARY_MAX_CHARSfrom a call, and the plan saysSUMMARY_MAX_CHARSis 40. - THEN The check returns no problem about
SUMMARY_MAX_CHARS.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library compares a number in a plan with a named Python constant. The change builds on the existing plan check and the Python ast standard library. Estimated cost: 15,000 tokens to build, 4,000 tokens per month to keep and fix, and 1 to 2 elapsed days.
Key questions
- Does the repository already hold a plan check in the staging path?: Yes.
src/devops_cli/roadmap/stage_change.pyis the plan check of the staging path. It already readsSUMMARY_MAX_CHARS. [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/pull_form.py] - What is the value of
SUMMARY_MAX_CHARSin the staged tree?:SUMMARY_MAX_CHARSis 60 insrc/devops_cli/roadmap/pull_form.py. [sources: src/devops_cli/roadmap/pull_form.py] - What does the plan stage prompt currently say about the summary bound?:
src/devops_cli/ai/tasks/roadmap_stage_change.mdtells the model "at most 47 characters". [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md] - How does the plan check obtain a constant value from the staged tree?: Parse the staged Python files with
astand read module-level integer assignments. Resolve a simple alias to another integer constant in the same module. Do not import or execute staged code. (best practice) [sources: src/devops_cli/roadmap/pull_form.py, src/devops_cli/roadmap/stage_probe.py]- Chosen: AST integer assignments. Reads values without running staged code and handles the literal form of
SUMMARY_MAX_CHARS. - Rejected: Import the staged modules. Executes untrusted plan code and can cause side effects.
- Rejected: Regex over source text. Matches comments, strings and annotated values that are not the constant.
- Chosen: AST integer assignments. Reads values without running staged code and handles the literal form of
- Which plan files does the check scan for a number beside a constant?: Scan
proposal.md,design.mdand everyspecs/**/*.mdin the change folder. Do not scantasks.md. (best practice) [sources: openspec/changes/3200-refuse-a-plan-with-placeholder-or/design.md:12, openspec/changes/3200-refuse-a-plan-with-placeholder-or/proposal.md:49]- Chosen: Proposal, design and spec deltas. The issue names requirements, scenarios and decisions, and these files hold them.
- Rejected: All change files including tasks.md. Task commands and paths carry numbers that are not claims about a constant.
- Rejected: Only spec deltas. Design decisions also name constants and bounds.
- How does the check pair a constant name with a number?: Use a sentence as the unit. A pair is a known constant name and a decimal integer in the same sentence, in either order. Compare each pair. (best practice) [sources: openspec/changes/3200-refuse-a-plan-with-placeholder-or/design.md:12, openspec/changes/3200-refuse-a-plan-with-placeholder-or/proposal.md:49]
- Chosen: Same sentence. Keeps the claim local and catches 40 characters next to
SUMMARY_MAX_CHARS. - Rejected: Same line. A wrapped Markdown sentence breaks the pair.
- Rejected: Whole file. Pairs unrelated numbers with a constant and refuses valid plans.
- Chosen: Same sentence. Keeps the claim local and catches 40 characters next to
- What does the check do when a plan names a constant that the staged tree does not define as an integer?: Skip the name. Report a problem only for a known integer constant with a nearby number that differs. (best practice) [sources: src/devops_cli/roadmap/stage_probe.py, src/devops_cli/roadmap/stage_change.py]
- Chosen: Skip unknown and non-integer constants. A new constant in a plan is not a claim about the staged value.
- Rejected: Refuse every unknown constant. A plan may introduce a new constant, and the check has no value to compare.
- Rejected: Treat a missing value as zero. A false value refuses valid plans.
- What does the plan stage prompt tell the model about constants?: Tell the model to cite the staged value of each constant that the plan relies on, with the constant name and the value, as
feasibilityquotes probe lines. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/stage_probe.py]- Chosen: Add the citation rule to the prompt. The model has the read tools, and the probe already asks it to quote paths.
- Rejected: Rely on the check alone. The model needs the rule before it writes the plan, so the reply passes on the first try.
- Rejected: Add a new constant probe command. The read tools already give the value, and a new probe expands the command budget.
- What error text does a mismatch produce?: One problem line names the constant, the number in the plan and the staged value. For example:
SUMMARY_MAX_CHARS is 60 in the staged tree, but the plan says 40. (best practice) [sources: src/devops_cli/roadmap/pull_form.py]- Chosen: Name all three values. The model can correct the number in one turn.
- Rejected: Name only the constant. The model does not know the right value.
- Rejected: Name only the staged value. The model cannot find the wrong text.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 3, 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 prevents a specific class of plan errors but does not block delivery or expose a defect.It catches a real and recurring mismatch between a plan's number and the code's constant.It needs number extraction, constant lookup in the staged tree, and a refusal path.Both work in the plan check, but 3201 adds the plan-check command while the candidate adds a specific numeric-constant-consistency check within it.devops-cli-service commentedon Nov 3, 2026
Status set to Ready at d895bae (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
Staged: branch
feat/3308-the-plan-check-compares-a-number, draft pull request #3329. 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:
check_proposal: 27987 tokensThe plan run made 3 model request(s), and used 211011 input tokens and 12483 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:
otherat rejected, alternative 5: The evidence does not reject the alternative. It says the prompt already carries a rule, yet the plan adds a new prompt rule in group 3. The reason to reject relying on the check alone is missing. Evidence: "so the prompt already carries the rule that makes a reply pass on the first try."docs(openspec): make the constant check feasible (#3308)
docs(openspec): plan #3308 check a plan number against its constant (#…
[-]feat(roadmap): the plan check compares a number in a plan with the constant it names[/-][+]feat(roadmap): check a plan number against its constant[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 69 characters, and the limit is 60. The type and the scope stay.
feat(roadmap): the plan check compares a number in a plan with the constant it namesfeat(roadmap): check a plan number against its constantfeat(roadmap): check a plan number against its constant (#3308)
feat(roadmap): check a plan number against its constant (#3308)
feat(roadmap): check a plan number against its constant (#3308)
devops-cli-service commentedon Nov 7, 2026
Released in v0.84.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.84.0
devops-cli-service commentedon Nov 7, 2026
Live since 2026-11-07 22:00 UTC
feat(roadmap): a plan that adds a gate quotes the defect (#4194)