Skip to content

feat: add the autofix factory - #3

Merged
justinwilkin merged 4 commits into
mainfrom
feat/autofix-factory
Oct 26, 2026
Merged

justinwilkin merged 4 commits into
mainfrom
feat/autofix-factory

Conversation

@justinwilkin

Copy link
Copy Markdown
Member

Adds factories/autofix, a factory of four agents that finds, verifies and fixes problems in one GitHub repository and hands a person the pull request.

Changes

  • factories/autofix: The platform repository (tenant autofix, models) and the factory repository (GitHub App connection, webhook source, build environment, maintainer role, four agents, eight triggers).
    • bug-hunter files issues each morning. bug-verifier labels each new issue. coder fixes verified issues and opens a pull request. code-reviewer reviews it.
    • Reviews, failed CI and comments route back to coder with a decision model, joining its open run when there is one.
    • Gate A (fix-verified) is on. Gate B (fix-assigned), where a person assigns the issue, is commented out.
  • Quickstart: make example offers autofix and checks its placeholders. make credentials creates its GitHub App key and webhook secrets. glauth gains two autofix users. The OpenRouter provider serves systemone, typesafe/jev-1.14 and anthropic/claude-sonnet-5.5.
  • Multi-tenant fix: on-mention routed with openai/gpt-6-luna, a chat model. Routing needs a decision model, so it now uses typesafe/jev-1-14.

Testing

  • make validate passes for all eight kustomizations.
  • Ran the factory on the quickstart against a private sandbox repository with four planted bugs:
    • hunt-daily fired and bug-hunter filed three issues.
    • bug-verifier verified all three with a severity.
    • coder opened three pull requests, each with a test that failed before the fix. CI passed.
    • code-reviewer reviewed them, and coder-on-review routed each review to coder with typesafe/jev-1-14.
  • At 500m CPU per sandbox, a coder run went from label to pull request in about a minute.

Routed triggers call the systemone API, which serves decision models only.
openai/gpt-6-luna is a chat model. Route with typesafe/jev-1-14 on OpenRouter.
Four agents find, verify, fix and review problems in one GitHub repository.
Review feedback, failed CI and comments route back to the coder, joining its
open run when there is one.
Add autofix to make example with its checks, credentials and users. Serve
decision models and Claude Sonnet 5.5 from the OpenRouter provider, and
validate the factory in CI.
@runkora

runkora Bot commented Oct 26, 2026

Copy link
Copy Markdown

Visual Walkthrough

This change adds the autofix factory: four agents and the triggers that start them, which hunt, verify and fix issues and review the resulting pull requests.

Issue hunt, verify and fix

Issues move from the daily hunt through verification to a fix run by the coder.

flowchart TB
    subgraph hunting[Hunt]
        hunt[hunt-daily trigger]
        hunter[bug-hunter agent]
    end
    subgraph verifying[Verify]
        verifyT[verify-new-issue trigger]
        verifier[bug-verifier agent]
    end
    subgraph fixing[Fix]
        fixT[fix-verified trigger]
        coder[coder agent]
    end
    issue[GitHub issue]
    labeled[Issue labeled verified]
    closed[Issue closed or asks for info]
    hunt --> hunter
    hunter -->|files up to 3 issues| issue
    issue --> verifyT
    verifyT --> verifier
    verifier -->|labels verified| labeled
    verifier -->|other outcomes| closed
    labeled --> fixT
    fixT --> coder
    classDef added fill:#1f883d,stroke:#1a7f37,stroke-width:2px,color:#ffffff
    classDef changed fill:#bf8700,stroke:#9a6700,stroke-width:2px,color:#ffffff
    classDef removed fill:#cf222e,stroke:#a40e26,stroke-width:2px,stroke-dasharray:5,color:#ffffff
    classDef context fill:transparent,stroke:#8c959f,stroke-width:1px,stroke-dasharray:3,color:#8c959f
    linkStyle default stroke:#8c959f,stroke-width:2px
    class hunt,hunter,verifyT,verifier,fixT,coder added
    class issue,labeled,closed context
    style hunting fill:transparent,stroke:#8c959f
    style verifying fill:transparent,stroke:#8c959f
    style fixing fill:transparent,stroke:#8c959f
Loading

Legend: green = added, amber = changed, red = removed, dashed grey = context

Node Code Symbols
hunt-daily trigger hunt-daily.yaml hunt-daily
bug-hunter agent bug-hunter.yaml bug-hunter
verify-new-issue trigger verify-new-issue.yaml verify-new-issue
bug-verifier agent bug-verifier.yaml bug-verifier
fix-verified trigger fix-verified.yaml fix-verified
coder agent coder.yaml coder
Pull request review loop

The coder's pull request returns to the coder through review, failed CI and comments.

sequenceDiagram
    participant C as Coder agent
    participant G as GitHub pull request
    participant T as Factory triggers
    participant R as Code reviewer agent
    C->>G: open pull request
    G->>T: pull_request opened
    T->>R: start review
    R->>G: post review, state commented
    opt third review, problems remain
        R->>G: add needs-human label
    end
    G->>T: review submitted
    T->>C: resume on review
    alt CI fails on branch
        G->>T: workflow run failed
        T->>C: fix failed CI
    else person comments
        G->>T: issue comment created
        T->>C: act on comment
    end
    C->>G: push fix to branch
    opt third push still failing
        C->>G: summary, add needs-human label
    end
Loading
Node Code Symbols
Coder agent coder.yaml coder
Factory triggers review-pr.yaml review-pr, coder-on-review, coder-on-ci
Code reviewer agent code-reviewer.yaml code-reviewer

@runkora runkora Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Walkthrough

Adds the factories/autofix factory with four agents, eight triggers and a platform repository. Extends the quickstart with autofix credentials and users, and fixes multi-tenant on-mention routing.

Severity Finding Location
medium Restrict who can start the verifier factories/autofix/factory/triggers/verify-new-issue.yaml:11
medium Bound the coder and reviewer loop factories/autofix/factory/triggers/coder-on-review.yaml:63
medium Allow a separate key for the autofix App quickstart/Makefile:189

Minor points: the README says triggers/ has "One file per stage" but holds eight triggers. The check-example comment in quickstart/Makefile omits autofix. The coder and reviewer prompts both apply needs-human with separate counts.

Review effort: High
Risk: Medium, new agents with write access driven by webhooks
Coverage: 37 of 37 files reviewed

Where to focus

Area Why it needs a person
factories/autofix/factory/triggers Decide who may start the verifier and coder.
factories/autofix/factory/agents Confirm the loop limits and needs-human ownership.
quickstart/Makefile Confirm one App key is correct for both examples.

Lower risk

Area Why
factories/autofix/platform/models Model definitions copied from the multi-tenant example.
README.md and multi-tenant/README.md Documentation index changes.
Changes by area
Area Files Change
factories/autofix/factory 19 Agents, triggers, connection, source, role, environment
factories/autofix/platform 9 Tenant and six models
multi-tenant 4 New routing model and trigger fix
quickstart 6 Autofix credentials, users, provider models
root 2 Makefile and README entries
Checked

Platform models and tenant, kustomization resource lists, glauth users.

Comment thread quickstart/Makefile Resolved
@justinwilkin
justinwilkin merged commit 977d600 into main Oct 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants