[email protected]
Portfolio / agent-factory

agent-factory (software-factory)

Open source under the MIT licence. View the source

An orchestration service that reviews pull requests, triages issues and dispatches fixed jobs to disposable runner boxes for a set of private git repositories.

Experimental

agent-factory (software-factory)

The problem

Agent sessions write a lot of code, so the bottleneck became deciding what is allowed to land. The factory moves that decision out of the agent and into code: the agent produces, a script judges, a gate enforces. The README is explicit that it was built for one operator's fleet and is not a turnkey product.

How it works

One Bun/TypeScript process with PostgreSQL state (Drizzle, forward-only migrations). Signed Forgejo webhooks trigger reconciliation and a 15-minute sweep is the authoritative backstop. Runners execute only allowlisted job templates that must also be enabled per repository. A PR merges only when a review pair on different model families approves the same head and the gate script agrees. A company-wide UTC-day token budget stops new work when spent.

How agent-factory (software-factory) works

Features

  • Webhook plus sweep reconciliation so a lost webhook costs latency, not correctness
  • Allowlisted runner job templates; runners cannot pick a command from repository content
  • Merge gates requiring a two-model review pair on the same head
  • Budget kill switch with no automatic reset and default-off flags on risky dispatch paths
  • Status surface: /, /status.json, /healthz, /metrics

How it was built

The first version on 2026-07-19 was a watcher that reconciled a set of repositories every 15 minutes and sent fixed validation jobs to disposable runner boxes, because AI sessions were producing more pull requests than one person could review.

It grew into a service where a small company of AI agent seats reviews pull requests and triages issues, while scripts and gates decide what may land.

Runners execute only allowlisted job templates and never choose a command from repository content. A webhook only wakes the same pass the sweep runs, so a lost delivery costs latency, not correctness.

Judgment calls such as issue type and review depth became classifiers defined as data and calibrated on a labelled corpus before they were allowed to gate. Big changes shipped as small numbered slices with rehearsed backouts.

Claude and Codex models built most of its 2,542 commits, directed by Rico, and from October the service also reviewed itself through its own agent seats.