Skip to content

feat(roadmap): a fix-checks step fixes a failed check #5023

Closed

Description

@dan-petty

Problem or Motivation

Fix rounds run only inside the runner Job, before the ready mark (implement_run.py:1639 _checks, :1665 _repair_after_push, :1696 _fix). When the Job ends, no job fixes the pull request. The classes test, lint and types have the action REPAIR (failure.py:120-122), but no job takes it. A plan draft with a failing check stays a draft (stage_ready.py:138-140, #3387). Each fix round uses a model, also for a lint or lock failure that a tool can fix.

Proposed Solution & Architectural Design

steps/fix_checks.py runs one round for each call.

  1. Read the failed log (failed_log) and class it.
  2. Tier 1, no model: ruff check --fix and ruff format on the changed paths, devops docs generate or uv lock, as the check needs. Then run the check again.
  3. Tier 2, model: run_fix_step (implement_step.py:2196), only when the log names a path of the plan scope (fix(roadmap): confine repair fix turns to the plan files #4028, outside_plan) and the fixable check passes (feat(roadmap): add the soft-cap and fix-check chain to decision points #4847 when it merges).
  4. Push with the push step. A plan draft gets the stage plan repair, scoped to its change folder (feat(roadmap): Stage items whose draft plan fails the check #3387 folds here). A ci_infra failure gets one comment and WAIT, because the App cannot run a check again (owner decision O2).

Bounds: bot pull requests only; stop on an owner/* label or on a head that is not the judged head; soft cap 3 rounds for each pull request (roadmap.implement.repair_rounds), one more while the error count falls (#4861), hard cap 5; at most 3 heads for each pull request.

Record keys fix_checks.key (:), .rounds, .errors, .result. The runner Job calls the step in its repair loop.

CLI devops roadmap step fix-checks --pull N. After this item, #3577, #4861, #4859 and #4847 change only this module.

Start after verdict-step, because both change implement_run.py:1639-1715. Timeouts: log 60 s < fixers 300 s < model request 1200 s < model step 1800 s; checks 1800 s; push 300 s.

Cost: about 1.5M tokens and 1 agent-day to build; at run time at most 4M tokens for each round.

Target Subsystem

Roadmap steps (src/devops_cli/roadmap/steps/), the implement repair loop and the stage plan repair.

Existing Tool Considered

ruff (check --fix, format), devops docs generate and uv lock fix tier 1 failures with no model.

Acceptance Criteria

  • Tests: tier 1 fixes a lint failure with 0 model requests; a log outside the plan scope stops with 0 model requests; a moved head returns skipped; the caps hold.
  • The implement repair tests stay green.
  • A dry-run test sees 0 requests.

Dependencies

Source: #5014

Owner decision 2026-11-13

The approved pipeline split (tracker #5482, Phase 3): fix-checks is due only on a checked head that merges cleanly and has a completed, failed required check on that same head, with no claim. A ci_infra failure gets no unit; its rerun waits for O2. Mode plan for 1 week, then the O5 caps.

  • Live proof: after the merge and the release, the step runs as the App in mode plan on the open bot PRs with a failed required check. A comment gives the result lines.

Alternatives check of 2026-11-15: in-use.
The repository already uses this tool.
Tool: astral-sh/ruff (https://github.com/astral-sh/ruff), MIT, last activity 2026-11-15, maintained.

Activity

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

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. dan-petty commented on Nov 14, 2026

    @dan-petty
    OwnerAuthor

    Evidence for this item from shepherd cycles 51 and 52 (2026-11-14): the implement fix step stopped with outside_plan twice in 24 h. In both cases the failed check had its cause in a path that the plan did not name, and an agent fixed the plan by hand.

    In both cases the step that this item asks for would add the missing path to the plan, record the reason, and run the fix again. That removes a stop that a person or an agent must clear. Implement is at 1/4 (6 h) and 4/10 (24 h), and outside_plan is its top failure class.

  6. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: The searches found no general tool that repairs failed required checks on a pull request end to end; the only concrete fit is ruff, which the issue itself already names, and it covers the tier-1 lint/format fixing with no model request. The tiered rounds, log classification, repair caps, plan-stage repair and the push step are project-specific and remain to be built.

    The repository already uses this tool.

    Tool: astral-sh/ruff (https://github.com/astral-sh/ruff)

    • License: MIT
    • Last activity: 2026-11-15
    • Maintained: yes

    Covers:

    • ruff check --fix repairs many lint failures on the changed paths with no model request (tier 1)
    • ruff format fixes formatting-only failures with no model request
    • A re-run of the check after the fixer shows whether tier 1 was enough

    Lacks:

    • No model tier for failures that no fixer handles, such as a cause in a path the plan scope does not name (outside_plan)
    • No classification of the failed log, no fix-round records and no soft/hard round or head caps
    • No push step, no plan-draft stage repair and no ci_infra comment-and-wait path
    • Does not regenerate documents (devops docs generate) or lock files (uv lock), which are separate tier-1 tools
    • Does not decide when to run on a bot pull request, nor stop on an owner/* label or a moved head

    Tools considered:

    Searches run:

    • tool that automatically fixes failing CI checks lint autofix pull request, results: 5
    • ruff check --fix ruff format auto-fix lint failures without a model, results: 5
    • open source bot that repairs failed required checks on a pull request, results: 5

    Sources:

    Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.

  7. dan-petty commented on Nov 16, 2026

    @dan-petty
    OwnerAuthor

    Owner direction 2026-11-16 for every new job that is split out of the plan or implement job: the job uses openrouter/deepseek/deepseek-v4.1-flash-1017 until its roadmap job result grade reaches 80%. Then it gets a trial on local/qwen3.8:27b.

    For this item: give the new step its own model setting ai.tasks.<step> (a new field of AITasksConfig), set to openrouter/deepseek/deepseek-v4.1-flash-1017. Do not read the setting of another job (analysis, triage, implement or stage), so that a model change of one job never moves another job.

  8. 3 remaining items

  9. added
    status/in-review
    and removed
    status/new
    on Nov 16, 2026
  10. removed
    status/in-review
    owner/agent
    on Nov 16, 2026
  11. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor
  12. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-16 12:30 UTC

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/highpriority/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