Repository navigation
Description
Problem Description
PR #4464 (issue #4394) added the setting roadmap.implement.step_token_ceiling. Its default is a fixed value, 16000000 (DEFAULT_ROADMAP_IMPLEMENT_STEP_TOKEN_CEILING = 2 * DEFAULT_ROADMAP_IMPLEMENT_STEP_TOKEN_BUDGET in src/devops_cli/config/defaults.py). It is not 2 times the configured step budget. The after-validator _token_settings_agree in src/devops_cli/config/settings.py refuses a ceiling below step_token_budget.
This causes two problems:
- A valid configuration from before the merge does not load now. Before feat(roadmap): extend a step budget when the run makes progress #4464,
step_token_budgethad onlyge=1. Now a person who sets onlystep_token_budgetabove 16000000 gets aValidationError. The settings do not load, so the roadmap Service and the runner do not start. - The extension is smaller than the rule gives. The live ConfigMap sets
step_token_budget: 12000000. The rule gives one extension of 50% (to 18000000), but the default ceiling cuts it to 16000000. This is +33%, not +50%.
Issue #4394, requirement "Ceiling default", asks for this behavior: "WHEN the operator sets no ceiling THEN the ceiling is 2 times the step budget". The code and the main spec (openspec/specs/roadmap-implement-step/spec.md, requirement "The ceiling of a step budget is a setting") give a fixed 16000000.
Reproduction Steps
On main at c8ed108 or later:
from devops_cli.config.settings import RoadmapImplementConfig
RoadmapImplementConfig(step_token_budget=12_000_000).step_token_ceiling # 16000000
RoadmapImplementConfig(step_token_budget=17_000_000) # ValidationErrorThe second call fails: Value error, step_token_ceiling must not be below step_token_budget. The same occurs with DEVOPS_CLI_ROADMAP_IMPLEMENT_STEP_TOKEN_BUDGET=17000000 and no ceiling.
Expected vs Actual Behavior
- Expected: when no config file and no variable sets
step_token_ceiling, the ceiling is 2 times the loadedstep_token_budget. A budget of 17000000 loads with a ceiling of 34000000. A budget of 12000000 gets the full extension to 18000000. - Expected: an explicit ceiling below the budget is still refused, and the message names
step_token_ceiling. - Actual: the ceiling is 16000000 for every budget, and a budget above 16000000 with no ceiling stops the settings load.
Proposed fix
- Make
step_token_ceilingint | Nonewith the defaultNone. ResolveNoneto 2 timesstep_token_budgetin the after-validator (or inStepBudget). Keep the refusal of an explicit ceiling below the budget. - Delete
DEFAULT_ROADMAP_IMPLEMENT_STEP_TOKEN_CEILING, or replace it with a factor constant (2), and updatetests/roadmap/test_roadmap_limit_classes.py. - Test first: a budget of 17000000 with no ceiling loads with the ceiling 34000000; a budget of 12000000 with no ceiling gives an extension to 18000000.
- Change the main spec requirement "The ceiling of a step budget is a setting", the field description,
docs/ROADMAP_WORKFLOW.md("default 16000000, twice the default budget") and the generateddocs/ENV_VARS.mdanddocs/CONFIGURATION.md.
Environment Diagnostics
main at c8ed108 (merge of #4464). Live ConfigMap value: roadmap.implement.step_token_budget: 12000000. The live value loads today, so this is not an outage. The risk is the next change of the budget above 16000000.
Logs, Traces, or Terminal Output
12000000 ok ceiling 16000000
17000000 FAIL ValidationError ['1 validation error for RoadmapImplementConfig', ' Value error, step_token_ceiling must not be below step_token_budget [type=value_error]']
Source: review finding on PR #4464 (major), checked against main.
Source: #4464
Proposed design
Problem statement
The step token ceiling has a fixed default of 16,000,000. A configured step budget above that value stops the settings load. The ceiling also cuts the one extension below the 50 percent that the rule gives. The change resolves an unset ceiling to twice the loaded step budget. It keeps the refusal of an explicit ceiling below the budget. It updates the spec, the documents and the tests.
Acceptance criteria
Requirement: Unset ceiling follows the step budget
WHEN no source sets roadmap.implement.step_token_ceiling, the settings SHALL set it to 2 times the loaded roadmap.implement.step_token_budget.
Scenario: A budget above the old fixed default
- WHEN
RoadmapImplementConfig(step_token_budget=17_000_000)is built with no ceiling - THEN
step_token_ceilingis 34_000_000 and the model validates without aValidationError.
Requirement: The default ceiling does not cut the full extension
WHEN the step budget is 12,000,000 and no source sets the ceiling, the resolved ceiling SHALL be 24,000,000, so the one extension reaches 18,000,000.
Scenario: The live budget keeps the full extension
- WHEN
RoadmapImplementConfig(step_token_budget=12_000_000)is built with no ceiling - THEN
step_token_ceilingis 24,000,000, and the extension of 50 percent ends at 18,000,000 with no cut by the ceiling.
Requirement: A budget variable alone loads
WHEN only DEVOPS_CLI_ROADMAP_IMPLEMENT_STEP_TOKEN_BUDGET is set to 17000000, the settings SHALL load with a ceiling of 34000000.
Scenario: The budget variable alone
- WHEN
DEVOPS_CLI_ROADMAP_IMPLEMENT_STEP_TOKEN_BUDGET=17000000is set and no ceiling is set - THEN
load_settings()returns a ceiling of 34000000 and raises noConfigurationError.
Requirement: An explicit ceiling below the budget is refused
The settings SHALL refuse an explicit step_token_ceiling below step_token_budget, and the error message SHALL name step_token_ceiling.
Scenario: A ceiling of 4999 with a budget of 5000
- WHEN the config sets
step_token_budgetto 5000 andstep_token_ceilingto 4999 - THEN loading the settings raises
ValidationErrorand the message namesstep_token_ceiling.
Requirement: An explicit ceiling at or above the budget is kept
The settings SHALL keep an explicit step_token_ceiling that is at or above step_token_budget.
Scenario: A ceiling of 9000 with a budget of 5000
- WHEN the config sets
step_token_budgetto 5000 andstep_token_ceilingto 9000 - THEN
step_token_ceilingis 9000.
Requirement: The factor constant replaces the fixed ceiling
The code SHALL replace DEFAULT_ROADMAP_IMPLEMENT_STEP_TOKEN_CEILING with a factor constant of 2, and the limit-class test SHALL classify the factor and list the old name as removed.
Scenario: The limit-class test reads the roadmap limits
- WHEN
tests/roadmap/test_roadmap_limit_classes.pyruns - THEN the test passes, the factor constant has a
LIMITSentry, andDEFAULT_ROADMAP_IMPLEMENT_STEP_TOKEN_CEILINGis inREMOVED.
Requirement: The spec and documents state the dynamic default
The spec and the documents SHALL state that an unset ceiling is 2 times the loaded step budget.
Scenario: The documents no longer state 16,000,000 as the default
- WHEN a documentation check reads the ceiling text of the spec and the documents
- THEN each file states twice the loaded step budget and none states a fixed default of 16,000,000 for the ceiling.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers a setting default that depends on another setting. The repository already uses pydantic-settings and pydantic validators. The change builds a small resolver and tests: about 30,000 input tokens and 8,000 output tokens to build, about 2,000 tokens each quarter to keep and fix, and about 1 hour of elapsed time.
Key questions
- Where should an unset
step_token_ceilingbe resolved?: Resolve it inRoadmapImplementConfig._token_settings_agreeto2 * step_token_budgetbefore the below-budget check. (best practice) [sources: src/devops_cli/config/settings.py:1048, src/devops_cli/config/settings.py:1198, src/devops_cli/config/defaults.py:860]- Chosen: Resolve in the model after-validator. The validator already sees both settings and can keep the explicit-ceiling check in one place.
- Rejected: Resolve in
StepBudget. It leavesRoadmapImplementConfig(...).step_token_ceilingasNone, so the settings do not show the effective ceiling. - Rejected: Keep the fixed 16,000,000 default. It fails a budget above 16,000,000 and cuts the extension for a 12,000,000 budget.
- What type and default should the setting use?: Use
Annotated[int | None, Variable()]with defaultNoneandge=1. After validation the value is an integer. (best practice) [sources: src/devops_cli/config/settings.py:1048, src/devops_cli/config/settings.py:1198]- Chosen:
int | Nonewith defaultNone. It distinguishes an unset ceiling from an explicit value, so the validator can apply the factor. - Rejected:
intwith default 16,000,000. It keeps the fixed value that the issue reports as the defect. - Rejected: A computed property with no field. It breaks
devops config set, the environment variable and the generated configuration table.
- Chosen:
- Should the code remove the fixed ceiling constant or replace it with a factor?: Replace
DEFAULT_ROADMAP_IMPLEMENT_STEP_TOKEN_CEILINGwithDEFAULT_ROADMAP_IMPLEMENT_STEP_TOKEN_CEILING_FACTOR = 2. Add the factor toLIMITSin the limit-class test with the classother. (best practice) [sources: src/devops_cli/config/defaults.py:860, tests/roadmap/test_roadmap_limit_classes.py:476]- Chosen: Replace with a factor constant. It removes the fixed ceiling and keeps the factor in one named place for the validator and the test.
- Rejected: Delete the constant and use the literal 2. It hides the factor and gives the limit-class test no name to classify.
- Rejected: Keep the fixed ceiling constant. It keeps the defect and the settings still stop above 16,000,000.
- Should an explicit ceiling below the step budget stay refused?: Yes. Resolve
Nonefirst. Then refuse an explicit ceiling belowstep_token_budgetwith a message that namesstep_token_ceiling. (best practice) [sources: src/devops_cli/config/settings.py:1198, openspec/specs/roadmap-implement-step/spec.md]- Chosen: Keep the refusal. The one extension must never lower the budget, and the existing spec requires this guard.
- Rejected: Allow a ceiling below the budget. The extension would stop before the budget and the step would stop earlier than its configured budget.
- Which files must change for the spec and generated documents?: Change
openspec/specs/roadmap-implement-step/spec.md, the field description insrc/devops_cli/config/settings.py, anddocs/ROADMAP_WORKFLOW.md. Regeneratedocs/ENV_VARS.mdanddocs/CONFIGURATION.md. [sources: openspec/specs/roadmap-implement-step/spec.md, src/devops_cli/config/settings.py:1048, docs/ROADMAP_WORKFLOW.md, docs/ENV_VARS.md, docs/CONFIGURATION.md] - Which tests must change?: Update
tests/roadmap/test_roadmap_limit_classes.pyfor the factor constant. Add settings tests for an unset ceiling, an explicit ceiling and a budget variable alone. [sources: tests/roadmap/test_roadmap_limit_classes.py:476, src/devops_cli/config/settings.py:1198]
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 valid configuration with a budget above 16000000 fails to load, but the live value loads today so this is not a current outage.The regression commit c8ed108 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.It blocks a future budget increase and gives a wrong ceiling extension, but it does not break the current live configuration.The fix is scoped: change one default, update the validator, adjust tests and docs.Both concern the step token ceiling, but #4394 adds the ceiling feature while the candidate fixes its default to be 2 times the budget instead of a fixed value.devops-cli-service commentedon Nov 11, 2026
Status set to Ready at 9087b39 (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