Skip to content

feat(roadmap): the implement job runs the scoped CI before it pushes and repairs failures #3043

Description

@dan-petty

What happened

The job runs ruff, mypy and the group's verify command, pushes, and waits for the CI of the pull request. Failures that the project's own devops ci finds locally (the AST rules, hermetic test floor, docs sync, openspec gate, coverage) first appear on the pull request, which costs a push and a CI run each.

What should happen

  • Before the push, the job runs the path-scoped devops ci that a person would run (static checks, the tests of the changed code, docs and openspec gates). A failure goes back to the agent as a repair round.
  • After the push, a failed check also goes to a repair round (the "Make check pass" group exists; make it bounded and traced).

Acceptance criteria

  • A change with an ast-grep violation is repaired before the push in a replay test.
  • The scoped CI selects tests from the changed paths and the run time is stated.
  • The job pushes only a head that passed the scoped CI.
  • The count of repair rounds per group is in the trace.

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 pushes code before it runs the full scoped CI. Failures in AST rules, the test floor, docs sync, the openspec gate, or coverage first appear on the pull request. Each failure costs one push and one CI run. The job must run the path-scoped devops ci before the push and repair failures in a bounded loop. It must also bound and trace the post-push repair.

Acceptance criteria

Requirement: Pre-push repair of static violations

The implement job SHALL repair a static-analysis violation before it pushes the head.

Scenario: ast-grep violation repaired before push

  • WHEN A change introduces an ast-grep rule violation in a modified file.
  • THEN The job repairs the violation and the push does not occur until the scoped CI passes.

Requirement: Scoped test selection

The scoped CI SHALL select tests from the changed paths and state the run time in the trace.

Scenario: test selection from changed paths

  • WHEN The implement job runs the scoped CI on a change that modifies two source files.
  • THEN The test run includes only tests mapped to those two files and the trace records the run time.

Requirement: Push gate on scoped CI

The implement job SHALL push only a head that passed the scoped CI.

Scenario: push blocked on CI failure

  • WHEN The scoped CI reports a failure after a repair round.
  • THEN The job does not push the head.

Requirement: Repair round trace

The trace SHALL record the count of repair rounds for each group.

Scenario: repair count in trace

  • WHEN The job completes a group with two repair rounds.
  • THEN The trace entry for that group shows a repair round count of two.

Existing Tool Considered

No check has run. No open, maintained external tool covers this need. The devops ci command is the project's own tool for running checks. The pre-push gate and the bounded repair loop are workflow logic that the project builds in its implement job. The cost is the tokens to modify the implement job step sequence, add the repair loop, add trace fields, and write the replay test, plus the time to keep and fix that code until it matches the scoped CI behavior.

Key questions

  • What is the current step order of the implement job?: The job runs task groups, then documentation, then archive, then push, then the PR body, then watches checks, then at most one fix step, then gh pr ready. [sources: CONTEXT.md]
  • What is the bound on repair rounds per group?: At most one repair round per group, matching the existing at-most-one-fix-step pattern. (best practice) [sources: CONTEXT.md, CHANGELOG.md:264]
    • Chosen: one repair round per group. CONTEXT.md defines at most one fix step. The CHANGELOG records one repair turn for ruff and mypy. This bound keeps the loop finite and matches the existing pattern.
    • Rejected: unbounded repair loop. An unbounded loop risks infinite retries and token cost. The body requires the loop to be bounded.
    • Rejected: three repair rounds per group. No existing pattern supports three rounds. The project records one as the bound.
  • Where in the implement job flow does the pre-push CI run?: After all task groups, documentation, and archive, and before the push. (best practice) [sources: CONTEXT.md]
    • Chosen: after archive, before push. The body states the job runs scoped CI before the push. The current flow is groups, docs, archive, push. Inserting the CI step between archive and push matches the body.
    • Rejected: after each task group. Running full CI after each group adds cost. The body says the job runs it before the push, implying once after all groups.
  • How does the post-push repair work and what bounds it?: A failed CI check after the push triggers the Make check pass group. The group is bounded to one repair round and its count is recorded in the trace. (best practice) [sources: CONTEXT.md]
    • Chosen: one repair round via the Make check pass group. The body states the Make check pass group exists and must be made bounded and traced. CONTEXT.md records at most one fix step.
    • Rejected: no post-push repair. The body explicitly requires post-push repair. Removing it contradicts the requirement.

Open questions

  • What does the path-scoped devops ci select and how does it map tests to changed paths? (missing verified source)

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. The job works today; this change saves CI runs and tightens the repair loop but does not block delivery.
    • Value: Medium. It removes wasted push-and-CI cycles and gives the agent a faster repair signal before the push.
    • Effort: Medium. It needs a pre-push scoped CI step, bounded repair-round logic for every group, and trace output, plus replay tests.
    • Related: fix(roadmap): a step gets one turn to fix a ruff check or mypy failure of its own code #2795, which asks for a different change. Both add repair turns for static-check failures in the implement job, but #2795 gives one turn for ruff or mypy, while the candidate adds a pre-push scoped CI gate and bounded, traced repair rounds for all check groups.
  3. added
    priority/p2-medium
    on Nov 1, 2026
  4. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 1, 2026
  5. added a commit that references this issue on Nov 1, 2026
  6. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at aad0115 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • What does the path-scoped devops ci select and how does it map tests to changed paths? (missing verified source)
  7. added a commit that references this issue on Nov 1, 2026
  8. removed
    status/in-progress
    owner/agent
    on Nov 1, 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