Lumbridge Build

Gated · opens on November 13, 2026

Lumbridge Factory Agents build. People merge.

Lumbridge Factory turns an issue into a pull request. A coding agent builds the change in a sandbox on its own branch, and nothing is ready until CI passes on that exact commit and a second agent has reviewed it. Then a person merges. It is for teams that want agents working through a backlog without giving them the keys to main.

Lumbridge Factory
A terminal where an issue titled Send Retry-After with 429 is filed with the factory label, and three runs of factory2 tickets show the same ticket move from building with no pull request, to gating with pull request 2, to readyA terminal where an issue titled Send Retry-After with 429 is filed with the factory label, and three runs of factory2 tickets show the same ticket move from building with no pull request, to gating with pull request 2, to ready
File an issue with the factory label. The ticket goes from building, to gating on CI and review, to ready.Open full sizeOpen full size

Tour

See Factory at work.

The factory2 command

One ticket, and the policy it ran under.

show prints a ticket's branch, budget and turns. policy prints who may ask for work, the required checks and who merges. Shown in both themes.

Light
A terminal showing factory2 show for one ticket with its issue thread, branch, who asked, budget and two completed turns, then factory2 policy listing who may ask for work, the repository and its required check, the rules, the slots and who merges
Dark
A terminal showing factory2 show for one ticket with its issue thread, branch, who asked, budget and two completed turns, then factory2 policy listing who may ask for work, the repository and its required check, the rules, the slots and who merges
FIG. 1 — The factory line

01 · What it does

What Factory does today.

Issues in, pull requests out

Label an issue factory or comment /factory. Only logins on the policy’s allowed list can start work. Everyone else’s text is recorded and never acted on.

Two gates plus current main

A change is ready only when every required check is green on the head commit, a reviewer has passed that same commit, and the branch contains today’s main. A new commit starts the gates again.

A repair loop

A red check or a changes_requested review wakes the same builder session with the failing log or the findings. After three review rounds it stops and asks a person.

A sandboxed builder

Agents run as their own unix user behind a default-deny network allowlist. They hold no code host token. Their git key can push only factory/* branches, and a hook refuses reads of secrets.

Recovery, not quarantine

Kill either daemon or reboot the host. A turn still running is reattached, a finished one is collected, and a cut-off one resumes the same session with a recovery note. No comment is posted twice.

Budgets and capacity

Each ticket has a token budget and a wall-clock budget. Reaching one asks a person; it does not kill the work. Slots are held only while a turn runs, and account limits make turns wait, not fail.

02 · How it works

Two daemons, three unix users, one store.

The part that decides and the part that runs agent code are separate processes under separate users. Neither can read the other’s secrets.

  1. 2.1

    factoryd, the engine

    Polls the code host, makes tickets, schedules turns, reads the gates and posts comments. It is the only writer of a SQLite store. Every outside effect is stored first and carried out after commit with an idempotency key.

  2. 2.2

    agentd, the endpoint

    Prepares a git worktree per ticket and runs each agent turn as a fresh headless process. It keeps no ticket state. factoryd talks to it over one unix socket, and only factoryd’s user may connect.

  3. 2.3

    Builder and reviewer

    The builder reports through a small MCP tool server: report, reply, handback, recall. Its word is a claim that factoryd re-checks. The reviewer is a different session in a read-only worktree pinned to the commit.

  4. 2.4

    The policy

    One document names who may ask, each repository with its required checks and CI runner, data rules, outside-action rules, the merge policy, slots and budgets. factoryd refuses to start if a part is undecided.

FIG. 2 — Three gates on one commit

03 · Use it

Run the two daemons, then watch tickets.

Each daemon reads one JSON config. The policy is installed from factoryd.json on a new store and changed afterwards with factory2 policy.

Start a factory, add a repository, and see what needs a person
# as the factory user, then as the control user
python3 -m factory2.agentd   --config /etc/factory2/acme/agentd.json
python3 -m factory2.factoryd --config /etc/factory2/acme/factoryd.json

export FACTORY2_DB=/var/lib/acme-control/factory.sqlite3
factory2 policy add-repo acme/api --runner acme-ci --check "CI / checks (pull_request)"
factory2 policy allow gitea dana
factory2 policy slots 2

factory2 status
factory2 tickets --all
factory2 show t-ccd41800
factory2 hold t-ccd41800 --release
factory2 --json status

04 · Docs

The Factory manual.

These pages are in the repository and open with it. Until then, the Guide covers the same ground and is readable now.

  1. 01

    Design

    The domain model, a ticket’s life from accept to merge, the three gates, capacity, reliability and the security rules.

  2. 02

    agentd

    Its config file, how a turn stops, the tool hook, and a plain list of what the hook cannot stop.

  3. 03

    factoryd and agentd protocol

    The socket, every operation, turn idempotency, session ids and the eight turn outcomes.

  4. 04

    Policy and configuration

    The factoryd.json and agentd.json keys, with two complete instance examples in instances/.

  5. 05

    Installing an instance

    Step-by-step install logs with an undo beside every step: users, egress, bots, branch rules, CI runner and units.

  6. 06

    Verifying the boundary

    Scripts that prove what each user can reach and that the bot cannot push or merge main.

Read the Guide chapter: Factory and modelsRequest access to the repository

05 · Works with

One part of one system.

Not yet

  • It is Python today (standard library only, SQLite). It is not Rust yet.
  • Gitea is the only code host. GitHub is not supported yet.
  • No installer. A new instance is host scripts and an install log you adapt by hand.
  • The watchdog and the model-based router are designed, not built. Work starts only from an explicit request.
FIG. 3 — Where Factory sits in Lumbridge

Questions

Questions about Factory.

Why is the command called factory2?

It is the second version of the factory, and the command, its modules and its config paths still carry that name. The product and the repository are Lumbridge Factory. A lumbridge-factory command will replace it; until then the commands on this page are the real ones.

Which agents and models does it drive?

Claude Code today, headless, one process per turn. Builder and reviewer models are set in the policy with builder_model and reviewer_model. A Codex adapter is in the tree, but it is off by default and has not run a real turn.

What stops an agent pushing to main?

Three layers. A server-side pre-receive hook lets the factory’s bot push only factory/* branches and no tags. The branch rule on main has a merge whitelist of people. A tool hook on the agent refuses the obvious attempts before they run.

What happens when a job fails?

A red check goes back to the same builder with the log tail. A transient error is retried three times. A cut-off turn resumes with a recovery note, and five cut-offs in a row become one question to a person. A ticket never hangs silently.

Which code hosts does it support?

Gitea, including Gitea Actions for CI. The source, the comment channel and the gate reads sit behind interfaces, but only the Gitea ones are written.

What is the license, and when can I read the code?

Apache-2.0. The repository opens on November 13, 2026.

Want Factory running for your team?

Self-host it, or talk to us about setting it up with you.