Repository navigation
Description
Problem
The cost check of the stage job refuses a plan that gives its cost. It accepts a time only as a number of hours or minutes in digits. A plan that states the time in days or weeks, or with a number word, gets the problem "builds_own is true, and existing_tool gives no cost".
Rule 3 of AGENTS.md asks for "tokens to build, keep and fix it, and elapsed time". _TIME_COST in src/devops_cli/roadmap/stage/stage_change.py reads \d+ (hours|minutes) only. Work of a day or more is natural to state in days.
Evidence: a live stage run on item #3599 with the live stage model (deepseek-v4.1-flash-1017), 2026-11-09. The first reply was refused with: "builds_own is true, and existing_tool gives no cost. Write the tokens to build the code (for example 80k tokens) and the time (for example 4 hours)." Its existing_tool held: "Written cost: about 45k tokens to build, about 8k tokens each month to keep and fix, and about two days of elapsed time." The cost is there. The second reply used "16 hours" and passed this check. The Service logs of the stage job show the same problem for 8 failures in 7 days (#3451, #3398, #4004, #4028, #3742, #4043).
Expected
existing_toolstates the time as a number of minutes, hours, days or weeks, with a digit or with a number word from one to twelve (a,an).- A text with no count of tokens, or with no count of time, is still refused.
Acceptance criteria
-
uv run devops ci test tests/roadmap/stage/test_roadmap_stage_cost_units.pypasses. It fails on the base. -
uv run devops roadmap eval stage --replaykeeps its result: every gate refuses what it must refuse, and 5 of 5 good plans pass.
Existing tool considered
No library reads an amount of work. The change adds units and a short list of number words to one pattern. Cost: about 10 000 tokens to build, 2 000 to keep, and 30 minutes.
Proposed design
Problem statement
The cost check of the stage job refuses a plan that states its time in days or weeks, or with a number word. _TIME_COST in src/devops_cli/roadmap/stage/stage_change.py reads only digits with hours or minutes. A plan that says "about two days of elapsed time" gets the problem "builds_own is true, and existing_tool gives no cost", and the stage job wastes a model call on a retry. The job logged 8 such failures in 7 days.
Acceptance criteria
Requirement: Time in days or weeks
The cost check of content_problems SHALL accept a time given as a number of minutes, hours, days or weeks.
Scenario: A time in days
- WHEN A plan has
builds_owntrue and anexisting_tooltext with "45k tokens" and "3 days". - THEN
content_problemsreturns no cost problem for the plan.
Requirement: Time with a number word
The cost check of content_problems SHALL accept a time given with a number word from one to twelve, or with the article a or an.
Scenario: A time with a number word
- WHEN A plan has
builds_owntrue and anexisting_tooltext with "about 45k tokens" and "about two days of elapsed time". - THEN
content_problemsreturns no cost problem for the plan.
Requirement: Article as the count
The cost check of content_problems SHALL accept a or an as the count of a time unit.
Scenario: A time with an article
- WHEN A plan has
builds_owntrue and anexisting_tooltext with "10k tokens" and "an hour". - THEN
content_problemsreturns no cost problem for the plan.
Requirement: A missing time is refused
The cost check of content_problems MUST refuse an existing_tool text that has no count of time.
Scenario: Tokens with no time
- WHEN A plan has
builds_owntrue and anexisting_tooltext with "45k tokens" and no time. - THEN
content_problemsreturns the problem thatstage_problem_no_coststates.
Requirement: A missing token count is refused
The cost check of content_problems MUST refuse an existing_tool text that has no count of tokens.
Scenario: Time with no tokens
- WHEN A plan has
builds_owntrue and anexisting_tooltext with "two days" and no count of tokens. - THEN
content_problemsreturns the problem thatstage_problem_no_coststates.
Requirement: A unit word alone is refused
The cost check of content_problems MUST refuse a time unit that has no count before it.
Scenario: Unit with no count
- WHEN A plan has
builds_owntrue and anexisting_tooltext with "45k tokens" and "days of work". - THEN
content_problemsreturns the problem thatstage_problem_no_coststates.
Existing Tool Considered
No open library reads an amount of work in a free text, and the check is one regular expression. The change adds the units days and weeks and a short list of number words to _TIME_COST. Written cost: about 10 000 tokens to build, 2 000 tokens to keep and fix, and 30 minutes of elapsed time.
Key questions
- Which units and number words does the time pattern accept?: It accepts minutes, hours, days and weeks, singular or plural. The count is a digit string as before, or one of the words one to twelve, or the article
aoran. A bare unit word with no count stays refused. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:124]- Chosen: Extend
_TIME_COSTwith units and number words. It is a small change in one pattern, and it matches the Expected section of the issue. - Rejected: Parse the time with a natural-language library. It adds a dependency and risks wrong matches, for a check that needs only a short list of words.
- Rejected: Drop the time check. Rule 3 of
AGENTS.mdasks for the elapsed time, and the issue asks to keep the refusal.
- Chosen: Extend
- Which code uses
_TIME_COST?: Onlycontent_problemsinsrc/devops_cli/roadmap/stage/stage_change.pyreads it, so the change touches one module. The stage eval replay judges plans through the same function. [sources: src/devops_cli/roadmap/stage/stage_change.py:1616] - Does the change need a measure of the stage job with the replay?: Yes.
stage_change.pyis a trigger path of the replay. A task of the plan runsuv run devops roadmap eval stage --replayand states the score before and after the change. [sources: src/devops_cli/roadmap/stage/stage_change.py, AGENTS.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 9, 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.The defect causes 8 stage-job failures in 7 days and blocks valid plans that state time in days.It removes a repeated refusal of valid plans, but the work can be done in hours instead of days.The change adds units and a short word list to one regex pattern, estimated at 30 minutes.Both touch roadmap cost tracking, but #3066 adds daily and per-repo token budgets while the candidate fixes a time-unit regex in the stage cost check.devops-cli-service commentedon Nov 10, 2026
Status set to Ready at 6c1a629 (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
Released in v0.103.3: https://github.com/dan-petty/devops-cli/releases/tag/v0.103.3
devops-cli-service commentedon Nov 10, 2026
Live since 2026-11-10 01:54 UTC