Repository navigation
Description
Problem
A new runner image clears each stop that the Service set, whatever the cause (stop_clear.py, rule digest). The docstring says Never a loop. But 15 release commits came in the window 2026-11-03T15:05Z to 2026-11-04T15:05Z, so the rule acts as a loop. The clears put old items first again, and new items wait. priority_order (stage.py:462) sorts by priority, then by the lowest number.
- devops-cli has 36 digest clears and 0 retry clears. 11 are on test(review): use PATH stand-ins for scanner tests #2116.
- 22 Jobs followed a digest clear (test(review): use PATH stand-ins for scanner tests #2116: 11, fix(ai): Guard urlsplit in cost report for unparseable backend #2462: 6, fix(k8s): List helm repo and upgrade in deploy-stack dry-run #2469: 3, fix(k8s): key claim table by chart version #2519: 2), with 0 passes. They used about half of the input tokens (52.85M of 105.76M in the 39 stop comments) and about 11.3 of 18.4 Job hours.
- From 15:16Z to 07:08Z, 21 Jobs went to these 4 items.
- With one image from 05:33Z to 13:33Z, 15 new items ran from 07:19Z, and 1 delivered (fix(output): the network table colors a safe low-risk reference red #2646). After 17 clears from 13:33Z to 13:43Z, the next 4 Jobs went to old items.
- 53 Jobs ran on other repositories (dotfiles 41, dreamscaper 12). fix(install): Stop linking ~/.gitconfig to the tracked file dotfiles#2 holds 129 comments, with 15 clears in the window.
Caveat: the token share is sound. The hour share and the throughput claim are confounded with the GPU period before about 03:00Z. The mean reply of qwen3-coder:30b was 396 s and 362 s in the 2 h buckets to 03:05Z, then 5.7 to 17.3 s. Jobs of 125 to 161 minutes occur only before 03:00Z, and the digest Jobs at 18:02Z and 20:40Z alone take 5.2 of the 11.3 h. The one-image period held 19 Jobs. At those Job times, 8 hours hold about 3. So faster replies explain part of that result.
After 11-03T17:42Z no commit changed the shell policy or the step prompt: #3359 changed the policy at 17:15Z and #3361 changed the prompt at 17:42Z. No commit in the window changed the gateway route. So after the first image with those commits, a clear could not fix a cause in those files. Other code on the failure path did change (#3361, #3366).
Expected
A clear by digest runs only for a stop whose class has the action retry. A setting limits the attempts for each item and for each class. ci_infra gets this limit now, because lost tests are ci_infra today and that class has the action retry. Inside one priority, the next round takes an item with no attempt before a retried item.
No rule reads the files that an image changed. The Service holds only digests, and no image.revision label exists, so no map from a digest to commits exists.
This amends a default recorded in #2908 and delivered by #2912.
Acceptance criteria
- A test: a new digest alone does not clear a stop of class
plan_defect,refused_tool,premise_falseortest. - A test:
implement: retrystill clears such a stop. - A test: a stop at the attempt limit stays until
implement: retry, also for classci_infra. - A test: inside one priority, a round takes the new item before the retried item.
- A test: a round takes a retried item of a higher priority before a new item of a lower priority.
- A test: a clear writes at most one comment for each item in a day.
k8s/README.mdstep 16 anddocs/ROADMAP_WORKFLOW.mdstate the rule.git grep "Never a loop" src/devops_cli/roadmap/stop_clear.pyfinds nothing.
Existing tool considered
Project code covers the need: _new_digest, is_service_stop, ACTION_BY_CLASS, priority_order and the record key implement.failure.
Dependencies
- fix(roadmap): a stop carries a typed class and the failed check #3476: this rule reads the stop class, so the class must be reliable first.
Related
Related: #3053, #3098, #3066, #2967, #2908, #2912
Proposed design
Problem statement
The digest-clear rule clears every stop when a new runner image rolls out. It loops on old items and spends tokens and hours on causes that the image cannot fix. The change limits a digest clear to stop classes with the action retry, adds attempt limits, orders new items before retried items within a priority, and caps clear comments.
Acceptance criteria
Requirement: Digest clear uses retry classes
The Service SHALL clear a stop by digest only when the stop class has the action retry.
Scenario: Non-retry class
- WHEN A new runner image rolls out and the stop class is
plan_defect,refused_tool,premise_falseortest. - THEN The Service leaves the item Blocked and clears no stop.
Requirement: Digest clear for retry class
The Service SHALL clear a stop by digest when the stop class has the action retry and the attempt limits allow a clear.
Scenario: Retry class under the limit
- WHEN A new runner image rolls out and the stop class is
provider,timeoutorci_infra, and the item and class counts are below their limits. - THEN The Service clears the stop one time and records the class and digest.
Requirement: Explicit retry clears any stop
A trusted implement: retry comment MUST clear a stop of any class.
Scenario: Retry comment on non-retry class
- WHEN A trusted person comments
implement: retryafter the stop comment for classplan_defect,refused_tool,premise_falseortest. - THEN The next implement round clears the stop and sets the item Ready or Planned.
Requirement: Class attempt limit holds stop
The Service MUST leave a stop Blocked when the class digest-clear count reaches its setting.
Scenario: Class attempt limit reached
- WHEN A stop of class
ci_infrahas reached the class digest-clear limit and a new runner image rolls out. - THEN The Service leaves the stop Blocked until a trusted
implement: retrycomment.
Requirement: Item attempt limit holds stop
The Service MUST refuse a digest clear when the item digest-clear count reaches its setting.
Scenario: Item attempt limit reached
- WHEN An item has reached the item digest-clear limit and a stop of a retry class has a new runner image.
- THEN The Service leaves the stop Blocked until a trusted
implement: retrycomment.
Requirement: New item before retried item
Within one priority, the implement round MUST take an item with no digest-clear attempt before an item with a digest-clear attempt.
Scenario: Same priority order
- WHEN Two items of the same priority are eligible, and one has a digest-clear attempt and the other has none.
- THEN The round takes the item with no attempt first.
Requirement: Higher priority retried item first
The implement round MUST take a retried item of a higher priority before a new item of a lower priority.
Scenario: Priority beats attempt state
- WHEN A retried item has a higher priority than a new item of a lower priority.
- THEN The round takes the retried higher-priority item first.
Requirement: One clear comment per day
A digest clear MUST write at most one comment for an item in a 24-hour window.
Scenario: Second clear in one day
- WHEN The Service clears the same item a second time within 24 hours.
- THEN The Service writes no second clear comment and records the clear in the job record.
Requirement: Documentation states the rule
k8s/README.md step 16 and docs/ROADMAP_WORKFLOW.md SHALL state the class-action rule, the attempt limits, the comment cap and the order.
Scenario: Documentation check
- WHEN A reader opens step 16 or the stop and retry path.
- THEN The text states that only retry classes clear by digest, the limits, and the order within a priority.
Requirement: Docstring text removed
The file src/devops_cli/roadmap/stop_clear.py MUST NOT contain the text Never a loop.
Scenario: Grep check
- WHEN A developer runs
git grep "Never a loop" src/devops_cli/roadmap/stop_clear.py. - THEN The command finds no match.
Requirement: No image file inspection
The digest-clear rule MUST NOT inspect the files that a runner image changed.
Scenario: Only digests available
- WHEN The Service compares the old and new runner image digests.
- THEN The rule uses the stop class and the attempt record and reads no image content.
Existing Tool Considered
No alternatives check has run. The need is covered by existing project code: _new_digest and is_service_stop in src/devops_cli/roadmap/stop_clear.py, ACTION_BY_CLASS in src/devops_cli/roadmap/failure.py, priority_order in src/devops_cli/roadmap/stage.py:462, and the implement.failure record key. The change extends this code and adds no external tool. No new tool is built, so no token or elapsed-time build cost applies.
Key questions
- Which stop classes may a digest clear clear?: Only the classes whose action is
retry:provider,timeoutandci_infra. A trustedimplement: retrycomment still clears any class. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/roadmap/failure.py, src/devops_cli/roadmap/stop_clear.py]- Rejected: All stop classes. It recreates the loop because a new image cannot fix a plan, premise or tool refusal.
- Chosen: Classes with action retry. The action table already states whether a new attempt can help.
- Rejected: Explicit allowlist in stop_clear.py. It duplicates ACTION_BY_CLASS and can drift from the failure table.
- What limit applies to digest clears?: Use a per-class limit of 1 and a per-item limit of 3. Both limits are settings. Each retry class gets one automatic clear, and an item can spend one clear on each retry class. (best practice) [sources: k8s/README.md, docs/ROADMAP_WORKFLOW.md]
- Chosen: Per-class limit 1 and per-item limit 3. It bounds the loop and still lets each retry class recover one time.
- Rejected: Single limit of 1 for all. It can block a second retry class that a new image could fix.
- Rejected: No limit. It keeps the loop that the issue reports.
- How does the job record track digest clears?: Record a list in
implement.digest_clears. Each entry holds the class, the image digest and the time. The item total is the list length, and the class total is the count of entries for that class. (best practice) [sources: docs/ROADMAP_WORKFLOW.md]- Chosen: List of clear entries. It gives the counts and an audit trail of each class and digest.
- Rejected: Two counters only. It loses the class and digest history that a later round needs to explain the limit.
- How does
priority_orderplace a retried item?: Sort by priority first, then by whether the item has a digest-clear attempt with no attempt first, then by issue number. (best practice) [sources: src/devops_cli/roadmap/stage.py:462, docs/ROADMAP_WORKFLOW.md]- Chosen: Priority first, then attempt state, then number. It keeps priority as the first rule and takes new items before retried items inside one priority.
- Rejected: Attempt state before priority. It would take a lower-priority new item before a higher-priority retried item.
- Rejected: Issue number only. It keeps the old-item bias that the issue reports.
- How does the Service avoid more than one clear comment per day?: Record
implement.digest_clear_commented_atin the job record. Write the comment only when the time is absent or older than 24 hours, then set the time to now. The clear still records its attempt. (best practice) [sources: k8s/README.md, docs/ROADMAP_WORKFLOW.md]- Chosen: Record the comment time. It costs no request and survives a restart.
- Rejected: Search issue comments for a marker. It costs a request for each clear and is fragile.
- Does the rule inspect the files that a runner image changed?: No. The Service holds only image digests and no
image.revisionlabel, so it cannot map a digest to commits. The rule uses the stop class and the attempt record. [sources: k8s/README.md, src/devops_cli/roadmap/stop_clear.py] - Which documents must change for this rule?: Update
k8s/README.mdstep 16 anddocs/ROADMAP_WORKFLOW.md. Remove the textNever a loopfrom thestop_clear.pydocstring. [sources: k8s/README.md, docs/ROADMAP_WORKFLOW.md, src/devops_cli/roadmap/stop_clear.py]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 4, 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.Documented waste of 22 Jobs and half of input tokens from clears that cannot fix the cause.Stops the loop of unproductive clears and lets new items run instead of old ones.The code has the needed helpers; the change is a rule edit plus attempt-limit setting and ordering tweak.#2912 established that a new runner image clears a stop once; the candidate restricts that clear to stops whose class has the retry action.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at 46cf288 (see proposed design in issue body).
devops-cli-service commentedon Nov 4, 2026
The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.
Evidence:
placeholder
devops-cli-service commentedon Nov 4, 2026
Released in v0.56.3: https://github.com/dan-petty/devops-cli/releases/tag/v0.56.3
devops-cli-service commentedon Nov 4, 2026
Live since 2026-11-04 22:29 UTC