Tehas
Tehas is The Lean Software Factory, powered by the Pi coding agent and pi-rukas. It turns a GitHub issue into a reviewed pull request without a person driving an agent session. GitHub issues are the only control plane: you label an issue, tehas works on it, and the result comes back as a pull request and comments on that issue. A human merges. Tehas never deploys and never touches production.
All inference runs on self-hosted models, on an OpenAI-compatible endpoint the operator names. The example instance uses viiwork, a flexible meshed inference platform for both home and enterprise grade hardware. This site is the operating manual of one instance.
One instance, one product
An instance is one host serving one product repository. What differs between
instances is in an instance directory: two small files, instance.env and
models.json, and optionally Pi's own settings.json. The scripts are the same everywhere.
The examples on this site come from the instance that works on tehas itself:
| Thing | Value in the example |
|---|---|
| Host | tehas-tehas, Unix user boss (ssh boss@tehas-tehas) |
| Product | tehas-app/tehas, default branch main |
| Product checkout | ~/tehas/repos/tehas |
| Platform checkout | ~/tehas/platform, pulled with a read-only deploy key |
| Settings | instances/tehas-tehas/ in this repository |
| Dashboard | http://tehas-tehas:8080 on the private network, published as https://tehas.app |
| Previews | https://uat-<pr>.tehas.app, one for each open pull request. See Previews |
| Control issue | 1 |
How an issue flows
you: write an issue with acceptance criteria
you: apply the label tehas:ready <- the authorization to spend compute
dispatcher: picks it, labels it tehas:running
pi-rukas /work cycle, in a sandbox on the host:
explore -> plan -> worktrees -> develop -> verify gates
-> adversarial loop -> commit + PR -> six-pass review
dispatcher: labels it tehas:awaiting-merge, comments the PR link,
posts pi-rukas's handoff and token usage on the PR
you: review, click through, merge
If the cycle cannot finish, or its pull request waits for more than a merge,
the issue gets needs-human-attention and one comment saying where and why it
stopped, with pi-rukas's handoff.
The six-pass review blocks a change at the severity the product's own doctrine states, and where it states none at pi-rukas's default of HIGH. Here that bar is HIGH. See Operating tehas for what a finding does and what a cycle may defer.
What runs where
| Where | Role |
|---|---|
| The host | Tehas: dispatcher, sandboxed agents, the gates and this site. One Unix user, everything under ~/tehas. |
| Model endpoint | All model inference. The host needs no GPU; it reaches the endpoint over a private network. In the example it is a viiwork mesh. |
| GitHub | The queue, the state (labels) and the results (pull requests and comments). |
What is optional
tehas needs a host, a product repository, a GitHub App (or a bot account) and any OpenAI-compatible model endpoint. Everything in this table can be left out, and the factory works the same without it.
| Part | When it applies | Without it |
|---|---|---|
| Energy use | Only when the model endpoint is a viiwork mesh, and tehas-energy.service is enabled |
The section and the meter are not on the factory floor |
| viiwork | A flexible meshed inference platform for both home and enterprise grade hardware. One possible model backend, the one the example instance uses. tehas does not require it | Use any other OpenAI-compatible endpoint |
| Work by hand | tehas dev, for a person with an account on the host; one step as root lets the account in. See Operating |
Work arrives as issues only |
| Protolab | Only if you label issues tehas:prototype. The dispatcher never acts on that label |
The Protolab is empty |
| Previews | TEHAS_PREVIEWS=on with TEHAS_DOMAIN, and a preview/Dockerfile in the product. See Previews |
A pull request is read on GitHub only |
| Search indexing | TEHAS_SITE_INDEXING=on, for an instance published on the internet |
Every page says noindex |
| Visitor analytics | TEHAS_SITE_ANALYTICS_SRC and TEHAS_SITE_ANALYTICS_NAME, for an instance that wants to count visits |
No script is loaded |
| Pixel design | TEHAS_DESIGN=pixel: the whole site in 16-bit pixel art, with the factory floor at / |
Every page is beesknees26, with the business page at / |
Start here
- Start: what to tell your coding agent to set tehas up for your repository, and what you will be asked.
- Factory floor: the factory as a game view: the live queue, the
selected work order, the running cycle's console. The front page with
TEHAS_DESIGN=pixel; the business page is the front page otherwise. - Plain dashboard: what is in line, being worked on (with its live console), waiting for you and done.
- The Lean Software Factory: what makes tehas lean.
- Pi software factory: what tehas is made of, and what it adds to running Pi by hand.
- Features: everything it does, and how far each part is proven.
- Operating tehas: submit work, pause, retry, merge.
- Commands: every script and what it prints.
- The host: layout, settings, models, the sandbox image, installing.
- Previews: a running preview of every pull request, and how the names were published on the internet.
- Bootstrap a host: preparing a fresh machine.
- A new project: installing tehas for another repository.
- Troubleshooting: when a cycle parks or a tool fails.