Skip to content

feat(roadmap): a failure taxonomy, and one action for each class #3065

Closed

Description

@dan-petty

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

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 provider and 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() and ACTION_BY_CLASS in a new module src/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. provider retries. parser changes tier. The job repairs test, lint and types. plan_defect amends. premise_false returns. oom raises a limit. timeout retries. refused_tool and conflict wait for a person. ci_infra retries. (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 is retry. 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_total with a class label. 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

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 1, 2026
  2. dan-petty commented on Nov 1, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It is a required building block for #3053 and #3027 but does not block a release or fix a live failure.
    • Value: Medium. It removes the need for a person to decide each failure and makes stop comments and metrics actionable.
    • Effort: Medium. 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.
    • Related: feat(roadmap): every step repairs before it gives up, in bounded rounds #3053, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Nov 1, 2026
  4. dan-petty commented on Nov 1, 2026

    @dan-petty
    OwnerAuthor

    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).

  5. added
    status/ready
    and removed
    status/new
    on Nov 2, 2026
  6. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at a9d6d9f (see proposed design in issue body).

  7. removed
    status/ready
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions