Repository navigation
Description
Problem
Refine records only the failures that the item caused (RefineFailure.item_caused, #1526). A timeout or a dropped stream says nothing about the item, so refine records nothing. It takes the same item again in every round while the cause lasts. Refine has no time mark.
Intake keeps what it decided in IntakeRecord (intake.py, waiting). A candidate whose placement raised is decided again after the fresh ones (IntakeRecord.after, run.py _run_intake_adapter). Each repeat costs a triage call and an embedding call. Intake keeps no class or count for the failure.
Expected
Use CLASS_BY_EXCEPTION, RETRY_AFTER and StepName. They come from two issues: #4056 and #4060. Add the StepName members that these rows use: investigate for refine and place for intake.
Refine.
- Add the keys
refine.failed_at,refine.failed_stepandrefine.failed_classtoRefineRecordKey. - Write them in the existing failure marks (
_failure_marks). Write them also for a failure that the item did not cause. - The selection leaves the item out until
failed_at + RETRY_AFTER[class]. - A success clears the three keys, as it clears
refine.failuretoday.
Intake.
- Keep the failure in
IntakeRecord, not in the item record. Add a fieldfailed: dict[int, Failed]with the class, the count and the time of the last failure. - A candidate with a recorded class waits for
RETRY_AFTER[class]. So the next round makes no triage or embedding call for it. - The count lives only in
IntakeRecord. - The record file stays readable when the new field is absent. The default is an empty dict.
The change adds no request. The refine marks ride on the existing marks write. Update the failure rows of docs/ROADMAP_WORKFLOW.md.
Acceptance criteria
-
uv run pytest tests/roadmap/refine/test_roadmap_refine_failure_class.py- a timeout in refine records class, step and time. The next round skips the item until the time passes. A success clears the keys. -
uv run pytest tests/roadmap/intake/test_roadmap_intake_failure_class.py -k repeated_failure- the second round makes no triage call for a candidate with a recorded class. The count is inIntakeRecordonly. -
uv run pytest tests/roadmap/intake/test_roadmap_intake_failure_class.py -k old_record- anIntakeRecordfile from before this change loads and keeps its candidates. -
uv run pytest tests/roadmap/intake/test_roadmap_intake_failure_class.py -k no_item_mark- the item record gets no mark for an intake failure.
Every command above fails on the unchanged code. The pull request cites the fail-to-pass run (devops ci fail-to-pass --base <ref>).
Feasibility
I read these files at origin/main: refine.py (RefineFailure, _failure_marks, _record_failure), intake.py (IntakeRecord, Waiting, _Run, apply_intake) and run.py (_run_intake_adapter, read_intake_record). I did not run the code.
The existing behavior for a failure that the item did not cause is a deliberate design (#1526). This change keeps the rule that the item is not marked as at fault. It adds a wait only. The alternatives row keeps its own roadmap.alternatives.retry_days and is not part of this issue.
Existing tool considered
IntakeRecord, the refine marks and the tables of the two issues named above. No library is needed.
Cost
Build: about 70k tokens and 3.5 h. Keep: about 3k tokens per quarter. Fix: about 15k tokens and 1 h.
Related
Part of #3027. #3650. Depends on the issue #4060. Order: after that issue (both change failure.py, run.py and ROADMAP_WORKFLOW.md).
Proposed design
Problem statement
Refine and intake lose the failure class and the wait time. Refine retries an item every round while a timeout or dropped stream lasts. Intake decides a failed candidate again after the fresh ones and pays a triage call and an embedding call each time. The change records the failure class, step and time in the existing records and uses RETRY_AFTER to wait.
Acceptance criteria
Requirement: Refine failure keys
Refine SHALL write refine.failed_at, refine.failed_step and refine.failed_class for every refine failure, including a failure that the item did not cause.
Scenario: Timeout records class step and time
- WHEN A refine call raises a timeout for an item.
- THEN The item record holds a class from
CLASS_BY_EXCEPTION, the stepinvestigate, and a failure time, and it holds no item-caused mark.
Requirement: Refine wait
Refine selection SHALL leave an item out until refine.failed_at + RETRY_AFTER[refine.failed_class] has passed.
Scenario: Next round skips item until wait ends
- WHEN An item has a refine failure mark and the current time is before its wait ends.
- THEN The refine selection returns no item for that issue, and it returns the item after the wait ends.
Requirement: Refine success clears
A successful refine SHALL clear refine.failed_at, refine.failed_step and refine.failed_class as it clears refine.failure.
Scenario: Success clears failure keys
- WHEN A refine run succeeds for an item that has the three failure keys.
- THEN The written item record has no
refine.failed_at,refine.failed_steporrefine.failed_class.
Requirement: Intake failure field
IntakeRecord SHALL hold failed: dict[int, Failed] with the class, count and time of the last intake failure for each candidate.
Scenario: Intake failure recorded in record
- WHEN An intake placement raises an error for a candidate.
- THEN The
IntakeRecordholds onefailedentry for that issue with the class, count and time.
Requirement: Intake wait
Intake SHALL leave a candidate with a recorded failure class out until RETRY_AFTER[class] has passed and SHALL make no triage or embedding call for it.
Scenario: Second round makes no triage call
- WHEN A candidate has a recorded failure class and the wait has not passed.
- THEN The next intake round makes no triage call and no embedding call for that candidate.
Requirement: Intake count location
The intake failure count SHALL live only in IntakeRecord and SHALL write no mark to the item record.
Scenario: No item mark for intake failure
- WHEN An intake placement fails for a candidate.
- THEN The item record contains no intake failure mark and the count is only in
IntakeRecord.failed.
Requirement: Old record loads
An IntakeRecord file from before this change SHALL load with an empty failed dict and SHALL keep its candidates.
Scenario: Old record loads
- WHEN An
IntakeRecordJSON file has nofailedfield. - THEN The loaded record has
failed == {}and the same candidate entries.
Requirement: Step names
StepName SHALL include investigate for refine and place for intake.
Scenario: Step names exist
- WHEN Refine or intake writes a failure step.
- THEN The value is
investigatefor refine andplacefor intake.
Requirement: Workflow docs
The failure rows of docs/ROADMAP_WORKFLOW.md SHALL describe the refine and intake failure classes and waits.
Scenario: Docs name the waits
- WHEN A reader opens the failure rows of
docs/ROADMAP_WORKFLOW.md. - THEN The rows name
refine.failed_*,IntakeRecord.failed,investigate,place, and theRETRY_AFTERwaits.
Requirement: No new request
The change SHALL add no GitHub request, and the refine failure keys SHALL ride on the existing marks write.
Scenario: Refine marks write once
- WHEN A refine failure is recorded for an item.
- THEN The refine run writes the three keys in the existing marks write and makes no additional GitHub request.
Requirement: Fail-to-pass evidence
The pull request SHALL cite a fail-to-pass run for the new tests.
Scenario: Pull request cites fail-to-pass
- WHEN The pull request is opened.
- THEN Its body cites
devops ci fail-to-pass --base <ref>and the run shows the new tests failing on the base.
Existing Tool Considered
No alternatives check has run. No open, maintained library covers internal roadmap record fields. The change extends existing code. Cost: about 70k tokens and 3.5 h to build, about 3k tokens per quarter to keep, and about 15k tokens and 1 h to fix.
Key questions
- Are the shared failure symbols and the wait table already in the repository?: Yes. The archived feat(roadmap): record the failure class and step of a stage item #4056 change adds
CLASS_BY_EXCEPTION,failure_class_ofandStepName. The archived feat(roadmap): stage retry time follows the failure class #4060 change addsRETRY_AFTER, anddocs/roadmap/stage.mdcites both. [sources: src/devops_cli/roadmap/failure.py, openspec/changes/archive/2026-11-08-4056-record-the-failure-class-and-step/specs/roadmap-failure-taxonomy/spec.md, openspec/changes/archive/2026-11-08-4060-stage-retry-time-follows-the-failure-class/design.md, docs/roadmap/stage.md] - Does this issue still wait on feat(roadmap): stage retry time follows the failure class #4060?: No. The feat(roadmap): stage retry time follows the failure class #4060 change is archived at the commit, so the order is satisfied. The issue has no open dependency. [sources: openspec/changes/archive/2026-11-08-4060-stage-retry-time-follows-the-failure-class/design.md, docs/roadmap/stage.md]
- Which failure taxonomy and wait table should the new refine and intake waits use?: Use the existing
CLASS_BY_EXCEPTIONandRETRY_AFTERfromsrc/devops_cli/roadmap/failure.py, and addStepNamemembersinvestigateandplace. (best practice) [sources: src/devops_cli/roadmap/failure.py, docs/roadmap/stage.md, openspec/changes/archive/2026-11-08-4056-record-the-failure-class-and-step/specs/roadmap-failure-taxonomy/spec.md, openspec/changes/archive/2026-11-08-4060-stage-retry-time-follows-the-failure-class/design.md]- Chosen: Reuse the shared taxonomy and wait table. It keeps one class map and one wait table, as stage uses.
- Rejected: Add separate refine and intake tables. It duplicates classes and waits and lets the rows diverge.
- Rejected: Hard-code waits in each row. It loses the shared table and the test that keys match
CLASS_BY_EXCEPTION.
- Where should intake keep a failure class and count?: In
IntakeRecord.failedas a dict from issue number to aFailedvalue with class, count and time. (best practice) [sources: src/devops_cli/roadmap/intake/intake.py, src/devops_cli/roadmap/run.py, docs/ROADMAP_WORKFLOW.md]- Chosen: IntakeRecord field. The record already owns intake state and survives rounds.
- Rejected: Item record mark. An intake failure is not caused by the item, and the issue forbids it.
- Rejected: Separate failure file. It adds a second state file and a second write.
- How should an old
IntakeRecordwithoutfailedload?: Load it withfailedset to an empty dict, and keep every candidate entry. (best practice) [sources: src/devops_cli/roadmap/intake/intake.py, src/devops_cli/roadmap/run.py]- Chosen: Default to an empty dict. The record file stays readable and no migration is needed.
- Rejected: Require the field. It breaks records written before this change.
- Rejected: Rewrite the file on load. It adds a write and can race another lane.
- Should a refine failure that the item did not cause mark the item as at fault?: No. Write the three wait keys and no item-caused mark, so fix(roadmap): refine records an item whose model call failed or whose body would exceed the size limit, so it waits for a body change instead of being retried every poll #1526 stays in force. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py, openspec/changes/archive/2026-11-04-3478-a-placeholder-reply-of-a-model/design.md]
- Chosen: Record a wait without fault. It stops the repeat without settling the item as a defect.
- Rejected: Mark the item as at fault. It would settle an item for a model or network fault.
- Which
StepNamemembers do refine and intake need?: Addinvestigatefor refine andplacefor intake. (best practice) [sources: src/devops_cli/roadmap/failure.py, src/devops_cli/roadmap/refine/refine.py, src/devops_cli/roadmap/intake/intake.py]- Chosen: Add investigate and place. They name the row that failed in the shared failure record.
- Rejected: Reuse plan and apply. Those names describe stage steps and would misreport the row.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 7, 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 wasted triage and embedding calls but does not block correctness or security.It saves repeated API calls and stops pointless re-processing of failed items.The body estimates about 3.5 hours of build work across refine, intake, and docs.Both record a failure class and step for a roadmap item, but #4056 targets the stage item record while the candidate targets the refine record and IntakeRecord.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at 3181b22 (see proposed design in issue body).
devops-cli-service commentedon Nov 8, 2026
Released in v0.92.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.92.0
devops-cli-service commentedon Nov 8, 2026
Live since 2026-11-08 17:35 UTC