Repository navigation
Description
What happened
A stop is one comment with the last error. The actions differ: a provider error should retry, a parser bug should change tier, a failing test should repair, a wrong plan should amend, a false premise should return the item, an OOM should raise memory. Today a person decides each time.
What should happen
- A classifier maps a failure (exit status, error text, tool refusal, check name) to a class:
provider,parser,test,lint,types,plan_defect,premise_false,oom,timeout,refused_tool,conflict,ci_infra. Each class has an action table: retry, change tier, repair, amend, return, raise a limit, wait for a person. - The class and action are in the trace, the stop comment and the metrics.
Acceptance criteria
- The classifier is a pure function with a table test over real log excerpts (from refactor(cli): the five functions and properties that nothing calls and that #1910 does not list leave src #2175, fix(security): the subprocess environment guard accepts LESS, which makes less run a program #2735, fix(security): the subprocess environment guard accepts the pytest and npm keys that make a child write a file #2747, feat(roadmap): stage every Ready item, implement low effort #2924).
- Each class has exactly one default action in one table.
- The stop comment names the class, the action taken and the action left.
- The metrics count failures by class.
Related: tracker for this set (filed with it), #2908 (issue workflow), #2867 (draft PR evaluator), #3005 (task kind), #3010 to #3015 (plan gates), #2919 (stuck-item metrics), #2953 (Ollama parser).
Proposed design
Problem statement
The implement job stops with one comment and the last error. A person chooses the recovery action each time. The change adds a failure classifier and one default action for each class. It records the class and action in the trace, the stop comment and the metrics.
Acceptance criteria
Requirement: Pure failure classifier
The implement job SHALL classify a failure with a pure function that maps exit status, error text, tool refusal and check name to one class.
Scenario: Provider error
- WHEN the input holds a provider error and exit status 1
- THEN the classifier returns
providerand changes no state.
Requirement: Real excerpt table test
The classifier SHALL have a table test that uses real log excerpts from issues #2175, #2735, #2747 and #2924.
Scenario: Real excerpt table
- WHEN the table test runs offline
- THEN each excerpt maps to its expected class.
Requirement: One default action per class
The action table SHALL give exactly one default action for each of the 12 failure classes.
Scenario: Complete action table
- WHEN the test reads the action table
- THEN it finds one action for each class and no class has two defaults.
Requirement: Action dispatch
The implement job SHALL take the default action that the table gives for the failure class.
Scenario: OOM raises the limit
- WHEN the classifier returns
oom - THEN the job raises the memory limit and does not retry the same limit.
Requirement: Stop comment content
The stop comment SHALL name the failure class, the action taken and the action left.
Scenario: Stop comment content
- WHEN the implement job stops on a classified failure
- THEN the comment contains the class, the action taken and the action left.
Requirement: Trace record
The trace SHALL record the failure class and the action taken.
Scenario: Trace event
- WHEN the classifier returns a class and the job takes its action
- THEN the trace holds one event with the class and the action.
Requirement: Failure metrics
The metrics SHALL count failures by class.
Scenario: Failure counter
- WHEN two failures of different classes occur
- THEN the counter shows one increment for each class label.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers this need. The failure taxonomy is specific to the implement job's classes and actions. Build cost: about 10,000 tokens to write the classifier, table and tests. Keep and fix cost: about 3,000 tokens per month. Elapsed time: about 2 days.
Key questions
- Where does the classifier live and what is its interface?: Put
classify_failure()andACTION_BY_CLASSin a new modulesrc/devops_cli/roadmap/failure.py. The function takes exit status, error text, tool refusal and check name. It returns one class and has no side effect. (best practice) [sources: CONTEXT.md]- Chosen: New pure module. It keeps the classifier testable offline and separate from the implement job.
- Rejected: Extend the implement job module. It mixes classification with job control and makes the table test harder.
- What default action does each failure class take?: The table gives one default for each class.
providerretries.parserchanges tier. The job repairstest,lintandtypes.plan_defectamends.premise_falsereturns.oomraises a limit.timeoutretries.refused_toolandconflictwait for a person.ci_infraretries. (best practice) [sources: CONTEXT.md, .github/workflows/ci.yml, src/devops_cli/k8s/doctor.py]- Chosen: One action table. It gives one default for each class and one place to change.
- Rejected: Action branches in the job. It scatters the defaults and makes the table test impossible.
- How does the classifier handle an input that matches no rule?: Return
ci_infra. The default action isretry. The job retries once, then stops and waits for a person. (best practice) [sources: CONTEXT.md]- Chosen: Map unknown input to ci_infra with one retry. It keeps the fixed class list and avoids an endless retry.
- Rejected: Add an unknown class. The body fixes the class list.
- Rejected: Stop at once. A transient infrastructure error would block the item.
- What does the stop comment contain?: The stop comment names the class, the action taken and the action left. It keeps the last error and the masked diff. (best practice) [sources: CONTEXT.md]
- Chosen: Structured stop comment. A person sees the class and the next action at once.
- Rejected: Free text stop comment. It hides the class and the action left.
- How do metrics count failures by class?: Use one counter
roadmap_implement_failures_totalwith aclasslabel. Increment it when the classifier returns a class. (best practice) [sources: CONTEXT.md]- Chosen: One counter with a class label. A label is the standard dimension for a breakdown.
- Rejected: One counter for each class. It adds 12 metric names and makes the breakdown harder.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 1, 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 is a required building block for #3053 and #3027 but does not block a release or fix a live failure.It removes the need for a person to decide each failure and makes stop comments and metrics actionable.A pure function with a table and table tests over log excerpts is bounded, but it needs integration into the trace, stop comment, and metrics paths.Both deal with classifying failures in the pipeline; #3053 builds the repair loop that consumes the classifier, while the candidate builds the classifier and action table itself.dan-petty commentedon Nov 1, 2026
The owner asks (2026-11-01) that the job identify and handle partial implementations, to fix them or iterate on them, instead of discarding them and blocking the issue. The issue #3098 holds the design: keep the pushed work, classify the state, continue from the branch with a repair step for the class, block last. It builds on this issue (repair rounds), #3054 (keep work and resume) and #3065 (failure classes).
devops-cli-service commentedon Nov 2, 2026
Status set to Ready at a9d6d9f (see proposed design in issue body).