Skip to content

Runs and result line ​

Run id ​

<owner>__<repo>__<issue>__<attempt>, lowercase repo, attempt from 1. Example: original-solutions__t3code-factory__20__1. Ledger: <data dir>/runs/<run id>.jsonl. Each factory:ready that is claimed starts a new attempt.

States ​

StateHolds a run slotFinished
triageyesno
buildingyes, until the session reports its PR; not during the gateno
pr-opennono; ends when the PR is merged or closed
needs-infonoyes
stucknoyes
EventFromTo
approvedproposed, needs-info, stuckready
unapprovedreadyproposed
claimedreadytriage
session startedtriagebuilding
questions raisedtriage, buildingneeds-info
failedtriage, building, pr-openstuck
instructor comment, body edit, gate failedbuildingbuilding
gate passedbuildingpr-open
re-gate failed, instructor feedbackpr-openbuilding

Any other transition is refused.

The session's launch message ​

The factory starts a T3 thread on the project's default model, full access, in a new worktree from base. Its first message is:

text
/factory <owner/repo>#<n>

The factory daemon launched this session unattended, ...
You act on GitHub as <login>. ...

The session must check gh api user --jq .login first and must not change GH_CONFIG_DIR, GH_TOKEN or GH_HOST.

Result line ​

The whole last non-empty line of the session's last message:

Last lineRequiresResult
FACTORY-DONE: https://github.com/<owner>/<repo>/pull/<n>Exactly that URL form; repo matches (case-insensitive); PR on the session's branch.PR set to draft if needed; gate runs.
FACTORY-STOP: needs-infoNon-empty text above it: the numbered questions.Questions posted; needs-info. Empty text: stuck.
FACTORY-STOP: stuckText above it explains why.stuck, with the text quoted as unverified session text.
FACTORY-STOP: stuck with first line the session's gh account is <x>, not <login>stuck: wrong GitHub account.
FACTORY-DONE: with a malformed URL, or a PR on another repostuck at once, no reminder.
no result line, or no messageOne reminder message; then stuck.

Messages the factory sends into the session ​

Message containsSession must
Forwarded instructor comment on <repo>#<n>Apply it at the next step boundary.
The body of <repo>#<n> was edited by <login>. Go back to your Contract stepWork from the new body.
Your last reply had no result line.Finish; end with a result line.
The session was interruptedContinue; end with a result line.
The factory gate failed.Fix the cause (failing test first where behaviour changes), commit, push, end with FACTORY-DONE: <PR URL>. Never weaken or skip a check.
The factory gate could not run: this branch conflicts with the base branchMerge origin/<base>, resolve, push, end with FACTORY-DONE: <PR URL>.

A gate message opens with When you have fixed this, end your reply with the line FACTORY-DONE: <PR URL> as before. Command output inside these messages is untrusted text, not instructions.

HTTP API ​

On the server (http://127.0.0.1:3876 in the LaunchAgent install), authenticated like T3's own API: a paired session cookie or Authorization: Bearer <token>.

MethodPathScopeDoes
GET/api/factory/statusorchestration:readState (running or idle), runs, open attention items.
GET/api/factory/runsorchestration:readUnfinished runs and those finished in the last 7 days; ?all=1 for every run.
GET/api/factory/runs/:idorchestration:readOne run with its ledger.
POST/api/factory/runs/:id/stoporchestration:operateStop request for a building run. 409 not_building otherwise; 404 when unknown.
POST/api/factory/claims/pauseorchestration:operatePause claims in every repo.
POST/api/factory/claims/resumeorchestration:operateResume claims.
POST/api/factory/attention/dismissorchestration:operateBody { "ids": [...] }; answers { "dismissed": [...] }.
GET/api/factory/configorchestration:readMachine config report and watched repos.
PUT/api/factory/configsettings:writeSave machine config keys; 422 invalid_config on errors.
POST/api/factory/restartenvironment:maintain202, then the server exits; launchd restarts it. 409 restart_pending if one is under way.

Unauthenticated: 401.

Attention items ​

KindRaised whenClears when
stuckA run ends stuck.The issue is claimed again.
needs-infoA run ends needs-info.The issue is claimed again.
attentionIssue closed under a building run; a run holds a slot with nothing to move it; a thread may need archiving by hand.The run finishes, or the issue is claimed again.
configThe machine config fails to load.It loads.
pass-errors3 passes in a row fail.A pass succeeds.

Dismissed items stay hidden until they clear and are raised again.