Repository navigation
Description
Problem
The failure ledger counts failed rounds for a whole row. One item that fails can suspend planning for the whole repository, and a round that staged an item still counts as failed. This delays the plans of all other items.
src/devops_cli/roadmap/run.py:1026: while rounds are under the limit,FailureLedger.failedalso counts a failure on another input.run.py:576:_run_stage_adaptercallsraise_for_failedafter it writes the staged items.run.py:992: the causes stay in memory, so a restart makes themunknown.
Evidence from the window 2026-11-03T15:05Z to 2026-11-04T15:05Z:
- The stage row logged 6 suspend lines, at 15:11Z, 20:18Z, 00:49Z, 02:00Z, 06:07Z and 14:55Z.
- The 06:07Z line counts 3 different items: fix(roadmap): refuse a behavior group that omits a test it changes #3414, fix(roadmap): the stage probe names the files of a cited bare name #3415 and feat(roadmap): the implement job re-checks a plan premise against the base #3417.
- The 14:55:07Z line reads
causes: unknown, unknown, RoadmapStageError. It counts feat(roadmap): the stage job refuses a task path that no group lists #3446 (13:52Z and 14:01Z, before the 14:15Z restart) and fix(roadmap): the implement job checks the test form that a task names #3451. The same round opened PR 3468 for feat(roadmap): the stage job refuses a task path that no group lists #3446 at 14:54Z. max(devops_cli_service_job_suspended{row="stage"})averages 0.1448 over 24 hours. This is an upper bound. The gauge is 1 while rounds reach the limit, butsuspendedalso needs the same input. The row ran again at 00:51Z and at 02:04Z, after the suspensions of 00:49Z and 02:00Z.- 25 ERROR lines hold
because the Service is stopping.ended_by_stop(run.py:1094-1110, fix(service): a round that ends because the Service is stopping counts as a failure and three of them suspend a row #2753) already keeps a stop out of the ledger. Only the ERROR level andresult=errorremain (src/devops_cli/server/service.py:567and:586).
A skip with no time limit is not safe. #3393 failed 5 rounds and #3404 failed 4 rounds, and both later got plans (PR 3403, PR 3409). The evaluation did not check whether their bodies changed.
Expected
The stage row uses the form of the alternatives row (#2949). A failed item is recorded in its job record with the error class and the time. The job retries the item after a set time and goes on with the other items. The row fails only when the round tried items and planned none. A failure that no item explains, such as an outage, still suspends the row. The cause survives a restart. A stop at shutdown counts as result=stopped.
Acceptance criteria
- A test: 3 rounds that fail on one item while another item stages do not suspend the row.
- A test: 3 rounds that try items and plan none suspend the row.
- A test: a failure outside any item still suspends the row.
- A test: the job record of a failed item holds the error class and the time, and the job takes the item again after the set time.
- A test:
devops roadmap explainreports an item that the job holds for this time, from the job record on GitHub. - A test: the ledger record holds the causes, and a record in the old format still loads.
- A test: a scoped update that a stop ends counts as
result=stoppedand logs no ERROR line.
Existing tool considered
The form that #2949 gave the alternatives row: src/devops_cli/roadmap/alternatives.py:926, store.py:172 and run.py:647. Also the existing FailureLedger, StageFailure and ended_by_stop. The job record must hold the item failure, because explain reads GitHub and git (src/devops_cli/commands/roadmap.py:13) and cannot read a file on the Service volume. No new tool is necessary.
Related
Related: #2949, #2753, #2754, #3069, #3393, #3404
Proposed design
Problem statement
The stage row counts a failed item against the whole repository. One failed item can suspend planning for every item. A round that staged an item still counts as a failure. This change scopes item failures to the item, records them in the job record, and retries the item after a delay. The row suspends only for a round that tried items and planned none, or for a failure outside any item.
Acceptance criteria
Requirement: Item failure stays off the row ledger
A stage item that fails MUST be recorded in the item job record and MUST NOT count as a failure of the stage row.
Scenario: One item fails while another stages
- WHEN Three stage rounds each fail on one item and stage another item.
- THEN The stage row does not suspend.
Requirement: No planned item suspends the row
The stage row MUST suspend when a round tries items and plans none.
Scenario: Three rounds plan no item
- WHEN Three stage rounds try items and plan no item.
- THEN The stage row suspends.
Requirement: Failure outside items suspends the row
A failure that no stage item explains MUST suspend the stage row.
Scenario: Outage failure
- WHEN A stage round fails with an error that no item explains.
- THEN The stage row suspends.
Requirement: Failed item records error and retry time
A failed stage item MUST store its error class and failure time in its job record and MUST become eligible again after the configured retry delay.
Scenario: Retry after the delay
- WHEN A stage item fails and the configured retry delay has not elapsed, then elapses.
- THEN The job record holds the error class and time, and the job takes the item again only after the delay.
Requirement: Explain reports held item
devops roadmap explain MUST report an item that the job holds for retry, using the job record on GitHub.
Scenario: Held item in explain output
- WHEN The job record on GitHub holds an item with a retry time.
- THEN
devops roadmap explainreports the item as held until that time.
Requirement: Ledger causes survive restart
The failure ledger MUST write its causes to its record and MUST load them after a restart.
Scenario: Reload ledger with causes
- WHEN A ledger with recorded causes is written and loaded again.
- THEN The loaded ledger holds the same causes.
Requirement: Old ledger record loads
The failure ledger MUST load a record in the old format and MUST treat its missing causes as unknown.
Scenario: Old format record
- WHEN The ledger loads a record that has no causes field.
- THEN The load succeeds and the causes are
unknown.
Requirement: Stop result is stopped
A scoped update that a Service stop ends MUST record result=stopped and MUST NOT log an ERROR line.
Scenario: Stop during scoped update
- WHEN A scoped update ends by a Service stop.
- THEN Its result is
stoppedand it logs no ERROR line.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers a per-item failure ledger inside the roadmap stage row. The change reuses the in-repo forms FailureLedger, StageFailure, ended_by_stop, and the alternatives row. The written cost to build, keep and fix this code is about 50,000 tokens and 2 engineer-days.
Key questions
- Where does an item failure live so that it survives a restart and
explaincan read it?: The job record on the issue body holds the error class and the failure time. The alternatives row already uses this form.explainreads GitHub and cannot read the Service volume. (best practice) [sources: src/devops_cli/roadmap/alternatives.py:926, src/devops_cli/roadmap/store.py:172, src/devops_cli/commands/roadmap.py:13, docs/adr/0016-labels-hold-the-roadmap-items-fields.md]- Chosen: Job record on GitHub. It survives a restart and
explaincan read it. - Rejected: File on the Service volume.
explaincannot read the Service volume. - Rejected: In-memory ledger only. A restart loses the cause.
- Chosen: Job record on GitHub. It survives a restart and
- How does the stage row decide to suspend?: The stage row counts only round-level failures in
FailureLedger. A failed item stays in its job record. The row suspends when a round tried items and planned none, or when an error outside any item occurs. (best practice) [sources: src/devops_cli/roadmap/run.py:1026, src/devops_cli/roadmap/run.py:576, src/devops_cli/roadmap/alternatives.py:926]- Chosen: Per-item failures stay out of the row ledger. One failed item then does not suspend planning for the other items.
- Rejected: Reset the row ledger after any success. A later success hides an unexplained outage.
- Rejected: Skip failed items forever. fix(roadmap): the implement job refuses a plan that fails the plan check #3393 and feat(roadmap): the plan check requires a new rule to accept its own plan #3404 failed several rounds and later got plans.
- How does the ledger keep causes across a restart?: The ledger writes a versioned record with a
causeslist. A record withoutcausesloads asunknown. (best practice) [sources: src/devops_cli/roadmap/run.py:992, src/devops_cli/roadmap/run.py:1026]- Chosen: Versioned ledger record with causes. It keeps the causes after a restart and accepts the old format.
- Rejected: Keep causes in memory only. A restart makes every cause
unknown. - Rejected: Rebuild causes from logs. The logs do not hold a reliable per-round record.
- What retry delay does a failed stage item use?: Add
roadmap.stage.item_retry_delay. Its default follows the alternatives retry delay. A failed item becomes eligible again after that delay. (best practice) [sources: src/devops_cli/roadmap/alternatives.py:926, src/devops_cli/roadmap/run.py:647]- Chosen: Dedicated stage retry setting. The stage row needs its own retry cadence and the body asks for a set time.
- Rejected: Reuse the alternatives retry setting. It couples two unrelated rows.
- Rejected: Use a fixed delay. The body asks for a set time, and the alternatives row already uses a setting.
- How does a Service stop become
result=stopped?: Callended_by_stopbefore the ledger and the result mapping. Setresult=stoppedand log no ERROR line for a scoped update that a stop ends. (best practice) [sources: src/devops_cli/roadmap/run.py:1094, src/devops_cli/server/service.py:567, src/devops_cli/server/service.py:586]- Chosen: Reuse
ended_by_stop. It already keeps a stop out of the ledger and reads the same error shapes. - Rejected: Add a second stop detector. Two detectors can disagree and add maintenance cost.
- Rejected: Keep
result=error. The body requiresresult=stoppedand no ERROR line.
- Chosen: Reuse
- Does a failed item retry in the same round?: No. The job record holds the item until the retry time. Later rounds skip the item until that time and process other items. (best practice) [sources: src/devops_cli/roadmap/alternatives.py:926, src/devops_cli/roadmap/run.py:576]
- Chosen: Retry in a later round after the delay. It stops one item from delaying the other items.
- Rejected: Retry in the same round. Repeated failure delays the other items in the round.
- Rejected: Skip the item forever. fix(roadmap): the implement job refuses a plan that fails the plan check #3393 and feat(roadmap): the plan check requires a new rule to accept its own plan #3404 later got plans.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
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.One failed item suspends all stage planning in the repository, blocking other items from getting plans.Unblocks the stage row so that one failing item no longer delays plans for every other item.The pattern from #2949 exists but the stage row has distinct code paths, a job-record store, an explain command update, and seven test cases.Both fix one-failed-item-does-not-suspend-a-row; #2949 delivered the pattern for the alternatives row, the candidate applies it to the stage row.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at 336731c (see proposed design in issue body).
devops-cli-service commentedon Nov 5, 2026
Released in v0.57.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.57.0
devops-cli-service commentedon Nov 5, 2026
Live since 2026-11-05 00:12 UTC