What tehas does
Tehas turns GitHub issues into reviewed pull requests, using the Pi coding agent and pi-rukas on self-hosted models. A person writes the issue, applies one label, and later reviews and merges. Everything in between is tehas.
It is a set of shell scripts, a few Rust programs and a few containers on one
host. The queue lives in GitHub labels. The host's own records are in the state
store, ~/tehas/state/tehas.db, and locks, logs and container files stay plain
files under ~/tehas. 365 days of measurements are kept in a second SQLite
file, see Analytics.
Each feature below says how far it has been proven. "Verified" means it was run on a tehas host and the result checked. Rows with a date were checked on the example instance. Rows without one were checked on another instance, before settings moved into an instance directory. "Tested" or "covered by the tests" means only the tests: nobody has seen it on a host. A feature still being built is off in every release, and its status says so first.
Queue and dispatch
| Feature | Detail | Status |
|---|---|---|
| GitHub issues as the only control plane | Labels are the state machine: tehas:ready, tehas:running, tehas:awaiting-merge, needs-human-attention |
Verified |
| Authorization by label | A cycle starts only if tehas:ready was applied by an allowlisted account, and the text has not been changed by anyone else since. A tehas:ready applied by the bot or anyone else is taken off the issue, said once on the issue, and logged. The one exception is the bot's own label on a plan with no open points, on the record state/plan-start/<issue>.json the poll wrote for that one issue: the start is credited to the allowlisted person whose tehas:plan the label events name, not the millwright, the record binds the title and text, and it starts one cycle. tehas:plan is checked the same way before a planning session starts, and taken off the same way. A ticked box or a reply counts only from an allowlisted account, and only on the question whose comment id the host has on record: a park's question on the state store, which a start, a tehas:plan session and tehas stop take off, so one tick starts one cycle. A record that cannot be read neither counts a tick nor undoes one |
The labeller check is verified. Taking a tehas:ready or a tehas:plan that came from another account off the issue, the rule about changed text, the checks of tehas:plan, a tick and a reply are tested, not yet seen on a host. The start on a plan's record is tested, not yet seen on a host |
| Accounts by user id | install.sh and tehas update record the GitHub user id of each login of TEHAS_ALLOWED_LABELERS and the millwright in state/account-ids, and a label, retry tick, planning answer or comment counts only when its account carries the recorded id. A login that does not resolve, or whose id changed, stops both with 78; tehas update --accept-id <login> records a new id. See Accounts by user id |
Covered by the shell and Rust tests, not yet seen on a host |
| Open issues only | A closed issue is never taken, and a pull request is never taken, open, merged or closed. The poll asks GitHub what a number is before it marks an issue tehas:running; tehasbot cycle asks again before a label, a comment or a container, and exits 65. A closed issue that still carries a factory label is not counted in line or as being worked on. An issue that an open pull request closes is not taken: its tehas:ready comes off with a comment naming the pull request. The hold reads the open pull requests' own descriptions too, so a pull request into a branch other than the default one, whose body says Closes #N, holds its issue as a linked one does. The description is text nobody has reviewed, from any author: what it can do is hold an issue back, never start one |
Tested, not yet seen on a host |
| Closed issues lose state labels | Once a poll, after the rest of it, console tidy run takes tehas:running, tehas:awaiting-merge, tehas:question, tehas:planning, tehas:refreshing, tehas:blocked, tehas:ready, tehas:plan and tehas:refine off closed issues, with one search of up to 100 issues and a 60-second timeout, and gives tehas:shipped to the ones of them a merged pull request closed, from one further read of the same poll that names those issues by number, bounded the same way. The console makes the searches and the edits itself (console/ops/src/tidy.rs). tehas:shipped, needs-human-attention and the labels a person chooses stay. An open issue is never touched, nor a closed one whose cycle still holds its lock, nor the control issue. A dry run says what it would remove. A failed search is logged and the poll goes on; a closer read that failed is logged as one line for the poll, not one per issue |
Tested, not yet seen on a host |
| Polling | A systemd user timer runs one poll two minutes after the previous one ended. A poll is a few GitHub calls and no model call | Verified |
| Poll interval and wake | TEHAS_POLL_SECS (30 to 3600, default 120) sets how often the timer polls, through a drop-in that tehas setup and tehas update write, or remove at the default, before they restart the timer. tehas dispatch --soon writes state/dispatch.again and returns, so tehas-dispatch.path starts a poll now, or after the one that runs |
Covered by the tests, not yet seen on a host |
| Poll cost | Each poll that holds the lock records its wall time, its CPU time from bash's times, its own gh calls and the writes of the host shim's write log by kind, and whether it started a cycle, in the state store (schema 8), and tehas status shows the last poll and the sums of the last hour on a poll line; tehas api --json carries the same figures under poll. console/dispatch/tests/dispatch_idle_cost.rs pins what a poll that starts nothing may cost: 0 writes and fewer processes than a ceiling written in the test, counted on a host with 500 lock files, 50 shipped issues and 5 blocked ones. See What a poll costs |
Built, not proven: covered by the store's tests and the dispatcher's tests with GitHub and the shim log stubbed. Not yet seen on a host |
| GitHub App identity | With TEHAS_GITHUB_APP_ID, the factory acts as a GitHub App, made by tehas setup --new-app or taken with --app-id and --app-key-file; the installation and the bot's login are looked up: tehasbot github-token makes and renews its hour-long installation token, the host's gh and git use it through ~/tehas/shim, and the host's own commands use it. No container holds it: a cycle gets a second token from the app, narrowed to the product repository with Issues read, from ~/tehas/state/github-cycle (#1814), its issue writes going through the host's relay, which refuses labels and <!-- tehas: markers, and a planning turn or session one of the same body from ~/tehas/state/github-session. A token in GH_TOKEN or GH_CYCLE_TOKEN is refused |
Tested. Seen on the tehas-tehas host on 2026-10-24 (v0.10.6): --check reached the repository, a poll ran and relabelled as tehas-app-bot[bot], and in a throwaway copy of the sandbox image gh and git ls-remote worked from the mounted token. A cycle pushing past its first hour is not yet seen. The narrowed cycle token (#1814), the relay and the setup wizard are not yet seen on a host |
| Two commands | tehas is what a person types (dispatch, work, plan, dev, index, update, labels, status, top, pause, resume); tehasbot is what the units run. The scripts behind them are in |
|
~/tehas/libexec, which holds the three bash scripts of the platform repository (dev-login, setup and update) and the Rust programs install.sh builds; every other command is a verb of one of those programs. install.sh removes the one-file-per-command layout that came before |
Covered by the shell tests. Installed on the tehas-tehas host, where tehas update ran on 2026-10-15; the other commands are not recorded here as seen |
|
| Ticket concurrency | At most TEHAS_MAX_CYCLES cycles side by side, the host's CPUs minus one by default, each in its own unit, container and workspace. A ceiling: the slice's room decides below it, and at most TEHAS_SLICE_CONTAINERS containers are in the slice, four by default. Issues of the start order first (see tehas order), then lowest issue number |
Seen on the tehas-tehas host, 2026-10-11, on the version before the slice. At 1: a poll started a cycle through its unit, and the cycle ended with its lock released. At 2: two cycles ran side by side, the second container with half the CPUs and memory of that version's budget, and stopping that cycle's unit ended it in 14 seconds with the container removed, the lock released and the issue labelled needs-human-attention. Not yet seen: two cycles that both ran to their end. The default of CPUs minus one is tested, not yet seen on a host |
| Stalled cycles | A cycle none of whose logs change for TEHAS_WORK_STALL seconds, an hour by default, is stopped as stalled and parked, with how long nothing moved and at which step |
Covered by the shell tests, not yet seen on a host |
| Frozen cycles | tehas freeze <issue> pauses a running cycle's container, and tehas checks neither its stall nor its time limit until tehas thaw <issue>, which moves that limit forward by the time it was frozen. The runner's deadline and the unit's 8-hour stop are wall-clock time and still count while it is frozen |
Covered by the Rust tests and the shell tests, not yet seen on a host |
| The report in Rust | A cycle's report is tehas-cycle cycle's own, in its process: the same writes in the same order as the bash report it replaced, every GitHub write through the action journal while the store records them, and the poll leaves the open rows of a cycle whose lock is held. The bash report and its shadow are gone. See The report in Rust |
Not proven: 299 fixture cases traced from the bash cycle tests, one or more of every arm, and the shell tests of the cycle all run on it; an awaiting-human-merge handoff by a fixture only, as none occurred in 154 cycles. Owed on a host: a merged, a handoff and a parked end, each with the right labels and comment |
| The dispatcher in Rust | Every poll runs as tehas-dispatch poll, and each GitHub write goes through the state store's action journal. console run only checks the settings and the checkout and hands over; the bash poll is gone and TEHAS_DISPATCHER=bash is exit 78. See The dispatcher in Rust |
Proven on tehas-tehas: its poll since 2026-10-27 08:11Z (its first 11.5 hours, to 19:44Z: about 440 polls, 16 cycle starts, 8 planning turns, 2 stops, no ERROR line; the idle polls' median 9.6 s CPU, 28.6 s wall and no writes). Every dispatch shell test runs against it, and the journal's settling is covered by the Rust tests |
| The forge | tehas_core::forge, a library: one trait in tehas terms over an issue - its labels, the newest event of one label, who applied a label, and a label put on or taken off - with a GitHub adapter that backs each term with labels, reads an issue's events with --paginate, and runs gh through a runner of its own that holds the program and gives one call a bound. The approval term reads applications alone, so a label taken off answers the state term and never who approved. console label, the Protolab pass, tehas prototype file and tehas resume's read of the control issue call it, and its runner bounds the gh calls of console tidy run and console ids |
Covered by the Rust tests that hand the adapter fixtures instead of gh, and by the tests of its callers. Not recorded here as seen on a host |
| Retry after a provider outage | A cycle whose result says its failure is of kind provider is said as parked by a provider outage. That is the cycle's own word, so the park is recorded under its cap and waits for a person. A park an earlier version recorded as provider-outage is started again once, without a tick, when the model endpoint answers, on the word of the account that started the cycle that parked; any start of the issue and tehas stop spend it |
Covered by the shell tests, not yet seen on a host |
| GitHub's bad minutes | A GitHub read of the poll, tehasbot status or the poll's tidy that fails with a 5xx, a bare 403 or its bound is tried once more. One that still fails names gh's error, and goes on the record of the last ten minutes that health counts (checks.github, a warning from three). tehasbot status keeps the part of its snapshot that read fed and says it is stale |
Covered by the Rust and shell tests, not yet seen on a host |
| A sandbox that cannot push | A start whose push check is refused leaves state/push-fault.json. While it stands the poll starts no cycle and logs holding: the sandbox cannot push: <git's line> (<login>) once; running cycles, planning turns and refreshes are not held. tehas status prints a push line and tehasbot health fails with it. Once the file is ten minutes old the poll runs a start's dry-run push itself, with the App's cycle token, in a fresh copy of the checkout and with no cycle spent, and only while it could start a cycle: a pass takes the file off and the queue starts, a refusal writes the fault fresh. See Limits that hold work back |
Covered by the Rust tests of the poll's reads and actions and by console/dispatch/tests/dispatch_queue.rs. Not yet seen on a host |
| A write that may have reached GitHub | A GitHub write of a poll or of a cycle's report that timed out or got a 5xx is kept in the action journal as unknown and not sent again blindly. A poll reads GitHub for it first, a comment by its text and a label by name: found, it is done; not found, it is sent once; a read that fails leaves the row open and sends nothing that poll. A cycle's report reads it back itself before its next try and leaves a row it cannot read to the first poll after the cycle. So a comment GitHub took is not posted twice, and a park question is not followed by a plain park comment. Since store schema 16. See The dispatcher in Rust |
Covered by the Rust tests of the journal, of the poll's settling and of the report, and by the shell tests of the cycle. Not yet seen on a host |
| Full slots | A new pi-rukas commit runs at full concurrency from its first cycle. Each poll stops a running cycle whose issue is closed, or whose pull request (the bot's, on the issue's own branch feature/issue-N, opened since the cycle began) is merged or closed, and fills its slot on the same poll. A cycle that ends starts a poll at once, also when a poll is running then (tehas-dispatch.path). A poll that starts fewer cycles than there are free slots and issues waiting logs the one reason on every such poll, and tehas status shows it |
Covered by the shell tests. Seen on tehas-tehas: a cycle that ended started a poll 5 s later, and its slot was filled 31 s after it ended; with tehas-dispatch.path on, a cycle that ended while a poll ran got the next poll 4 to 18 s later, four times on 2026-10-16 and 17, and the poll stopped #261 as its issue is closed on 2026-10-16. A stop for a merged or closed pull request has not been seen |
| Product contract check | tehas check-product checks the product checkout against the contract (origin, origin/HEAD, AGENTS.md, a gate in .pi/verify-cmd, a product model the instance lists) and lists the installs a cycle runs, and with --sandbox runs the installs in its clone and the gates in a worktree of it, in the image; tehas status and install.sh --check show its last result. tehas init-product proposes the missing files, with a guessed gate, in a pull request the bot opens |
Covered by the shell tests. Built, not yet run on a host |
| Pause switch | Two switches, either enough: the flag ~/tehas/state/pause.json that tehas pause writes on the host and tehas resume removes, and tehas:pause on the control issue, which anyone who may label applies and only an account in TEHAS_ALLOWED_LABELERS lifts. A running cycle finishes. The control issue is never worked on: a tehas:ready, a tehas:plan or a retry tick on it starts nothing, whatever account applied it, the poll changes no label of it and logs one line, and it is not counted in line |
Tested against a stub GitHub. Not yet seen on a host, and not proven that a cycle finishes while the factory is paused |
| All hands | tehas:all-hands on the control issue, applied by an allowed account, is reported in tehas status, its JSON and the dashboard. It changes nothing in the factory; one applied by anyone else is ignored and said once |
Covered by the tests, not yet seen on a host |
| Limit and drain | tehas limit caps the cycles running at once and may hold planning, until it expires or is cleared; one that expired or cannot be read holds every start. tehas drain sets a limit of nothing new and waits for the running cycles. Running cycles are never stopped |
Covered by the tests, not yet seen on a host |
| History and export | tehas history lists what ended, oldest first in the order the state store wrote it, one line per cycle and per planning turn with kind telling them apart, after a cursor, for a program; it reads the state store and writes nothing. Each line has a cursor of its own, and a line written after a read is listed by the next read even when it ended in the same second; a cursor of v0.13 is still read. tehas export copies a cycle's result, logs, transcripts and Protolab page into a directory, every text file through the console's mask |
Covered by the tests, not yet seen on a host |
| State move | tehas state pack - writes a stopped factory's state/, repos/, live/ and mcp/ as one tar on standard output, without the live token, with the store taken from a copy the store made of itself, behind a manifest of the release and the schema; tehas state unpack - reads it and replaces them after checking the release, the schema, every link and the store in a directory beside the home. pack refuses while a cycle, a planning turn or a tehas-* unit is active, --rehearse does not and marks the tar, which unpack takes only with --rehearse; unpack starts no unit. tehas api lists the feature state-move. tehas state check [--json] prints the store's schema, integrity and rows of each table, read only, and tehas api lists the feature state-check. tehas state copy --to <file> [--json] writes a copy of the store at one moment to a new file while cycles run, naming its schema and rows, and tehas api lists the feature state-copy. tehas state load --from <file> [--json] fills a drained factory's new or empty store from such a copy in one transaction, bringing an older schema forward and refusing a newer one, a store with history and a copy that does not check, and tehas api lists the feature state-load |
Covered by the tests, not yet seen on a host |
| Red branch | With TEHAS_BRANCH_CHECK set, each poll asks GitHub once for that check on the branch's head commit. While it failed, no cycle, retry or refresh starts and the poll says holding: main is red at <sha>, which tehas status shows. Running cycles and planning turns go on. Pending, missing or unreadable holds nothing |
Covered by the shell tests, not yet seen on a host |
| Review backpressure | No new cycle while the issues that await merge and the running cycles together reach TEHAS_MAX_AWAITING, TEHAS_MAX_CYCLES plus 2 by default |
Covered by the dispatcher's fixtures and the shell tests. Not yet seen to hold on a host |
| Model endpoint check | The queue is held, not burned, while the model endpoint does not list the configured model. See No resources below | Built after a real failure. The hold is covered by the shell tests, not yet seen on a host |
| Backup model endpoint | A provider in models.json may name a backupBaseUrl serving the same models. A cycle starts on the backup when the main endpoint does not answer or does not offer a model; each endpoint has its own token from ~/.config/tehas/env |
Tested with fake endpoints only |
| The model proxy of outsource | Part of outsource, a feature still being built: a release refuses TEHAS_OUTSOURCE=on. With the feature on, tehas-proxy listens on TEHAS_OUTSOURCE_PROXY_ADDR and is the one way a contractor's cycle reaches the factory's model: it answers a job's token, forwards only the model paths a cycle needs, passes a streamed reply through as the endpoint sends it, gives a busy endpoint's answer back as it is, counts requests per contractor and per job, and never logs a body. The endpoint's token figures are read of each answer but not kept until #2277. The factory's model key stays on the factory; the contractor's container is given a models.json whose baseUrl is the proxy and whose apiKey is the job's model token. The job token, the contractor program's, is refused on the model paths. Off: no listener, no port, nothing in tehas status. See outsource |
Still being built, planned for 1.1: covered by the Rust tests of console/proxy against a stub endpoint. It reads the contractors and the jobs from the state store; a job's token is issued when a contractor takes the job over the job channel. install.sh installs it, with its unit tehas-outsource-proxy.service, only while the feature is on, which test/install_outsource_test.sh covers. It has not run on a host |
| Choosing the driver | Part of lean, a feature still being built: a release refuses TEHAS_LEAN=on and TEHAS_DRIVER=lean with 78, lists lean in flags as false, refuses tehas work --driver lean with 78, and a start that would run lean (tehas:lean, or a retry, outage retry or refresh of a lean start) starts nothing, takes the label that asked off and says why once; classic never runs in its place, and tehas:classic and an unlabelled start run classic. With the feature on: tehas:lean from an allowlisted account, read from the label events, binds driver lean in the start's approval record; no driver means classic. It starts nothing itself, and from any other account nothing starts and the poll says why once, as when another account takes an allowed account's label off. A retry runs the driver of the start it follows; with the label off the next start is classic. TEHAS_DRIVER=lean runs a start with no driver label on lean when the issue's text holds a pi-spec v1 block and on classic when it does not, and the poll logs which and why; tehas:classic and tehas:lean from an allowlisted account then each choose for one issue, read the same way, and an issue with both labels starts nothing. A lean start takes needs-human-attention off with its other labels. A new lean start also needs one pi-spec v1 block of valid JSON in the issue's text, and with none the poll starts nothing, takes tehas:ready off and says why once; classic is asked nothing of the block, and a plan written over an issue holds the block pi-rukas assembled for it, or else keeps the block the issue had. The poll asks the block of the queue's copy of the body and the cycle reads the issue again, so a body the two read differently is paid for with a start and a park rather than this pre-check. A lean start runs pi-rukas-headless work-lean in the same container as classic work; tehas work <issue> --driver lean does so by hand. An image that cannot run it, a pi-rukas before v0.14.47 or a lean restart or refresh, is 78 and the cycle is parked with what to do; classic never runs in its place. See Choosing the driver |
Still being built, planned for 1.1. Seen once on a factory on 2026-11-17, before lean was a feature, where tehas:lean then tehas:ready from an allowlisted account bound driver lean and the start ran work-lean. tehas:classic, a retry and the refusals are covered by tests only, and so are the refusals while the feature is off |
| The lean driver | Part of lean, still being built: off in every release until a host proves its happy path. With the feature on, a lean start runs pi-rukas-headless work-lean <issue> --timeout <minutes> --json from the issue's pi-spec v1 block, with .pi/work.json at the run's base deciding whether lean merges. tehasbot cycle reads its schema-5 result: landed (exit 0) takes the cycle's labels off, a green pull request lean calls ready (exit 10) goes to tehas:awaiting-merge, a draft, a red run or no pull request (exit 10) parks with lean's reason, and not ready (exit 11) parks with the rules the block failed. One comment, the driver named in it. What an issue and a repository need: The spec block lean needs and .pi/work.json |
Still being built, planned for 1.1. Seen once on a factory on 2026-11-17, on pi-rukas v0.14.84: work-lean ran, tehasbot cycle read its schema-5 result of exit 11 and parked the issue with one comment that named driver lean and the rule lean gave, no test runner configured (.pi/work.json verify.test). The repository had no .pi/work.json. Landed, a ready pull request and a park with a pull request are covered by tests only |
| Retry | tehas:ready from an allowlisted account starts a fresh cycle on a stopped issue, and on one that awaits a merge; tehas's labels of the earlier outcome go with the start, and needs-human-attention goes through the cycle's --restart, which pi-rukas answers by taking it off. Applied while the cycle runs, it waits for that cycle to end. The stopped cycle's workspace is kept beside the new one as <name>-<issue>.before-retry |
A retry with needs-human-attention removed by hand first is verified, and the kept workspace was seen on the tehas-tehas host, 2026-10-11. The retry by the one label, on a stopped issue or one that awaits a merge, and the wait behind a running cycle are tested, not yet seen on a host |
| The pull request of a stopped cycle | tehas-cycle finish <issue> --home <dir> --repo <owner/name> --default <branch> --reason <text> takes the branch of a kept workspace, fetches it into a repository of its own, rebases it onto the default branch there, pushes finish/issue-<issue> and opens a draft pull request that closes the issue and says its gate did not pass. The workspace is read and never written, its branch never moves, and that repository and the body file go on every path. It refuses a branch of nothing, a tree of uncommitted work, a name already on the remote, an issue that has an open pull request of the factory's own (on a branch of the repository, opened by the bot or an allowed labeller), and a rebase that conflicts. The poll runs it on an ask: a comment that starts with <!-- tehas:millwright issue=<n> action=finish --> and the reason, then tehas:finish from an allowed labeller or from the millwright within its grant; the label comes off and the issue is told the URL or why not. See finishing a stopped cycle and The pull request of a stopped cycle |
Built, not proven: covered by 37 Rust tests of console/cycle on real git repositories with a stub gh, and by one run through the host's own git that pushes the branch and reads back the draft's words. No git runs in the workspace; cases plant hooks and git configuration that names programs and another remote in the workspace and check that none runs and the push goes to the named repository. The poll's step is covered by the Rust tests of console/dispatch/src/finish and by console/dispatch/tests/dispatch_finish_ask.rs with tehas-cycle stubbed. Not yet run against GitHub |
| A cycle that GitHub failed at its end | The report records which of the push, the pull request and the handoff comment failed, in state/cycles/<issue>.end-failed.json, and whether the failure was GitHub's (5xx, 429, a rate limit, a timeout, a connection error) or the request's own 4xx. A push or a pull request is known only from the cycle's own result, so the record says the host did not see it fail and the poll finishes nothing on it. For one the host saw fail on GitHub's side the poll runs tehas-cycle finish itself, at most 3 tries at least 10 minutes apart within an hour, then tells the issue once that it waits for tehas:finish. tehas status lists it. See a cycle whose push or pull request GitHub failed |
Built, not proven: covered by the Rust tests of console/core/src/end_fault.rs, console/cycle/src/end_failed.rs and console/dispatch/src/auto_finish.rs, by console/cycle/tests/cycle_end_failed.rs with gh stubbed, and by console/dispatch/tests/dispatch_auto_finish.rs with gh and tehas-cycle stubbed. Not yet seen on a host |
| Admission by room in the slice | The dispatcher starts a cycle only while tehas.slice has room for one more TEHAS_CYCLE_RESERVE, holds fewer than the TEHAS_SLICE_CONTAINERS containers whose ceilings fit it, and is not under full memory pressure while more than half of it is promised. Every container in the slice counts at its reserve or its use, whichever is more. A slice that is missing or cannot be read holds cycles and planning turns, with one line in the log |
Tested, not yet seen on a host |
| A cycle that left no report | A poll finds an open issue marked tehas:running with no cycle behind it on the host, labels it needs-human-attention and says so on the issue. It starts nothing |
Tested, not yet seen on a host |
| An epic is never started | An issue whose sub_issues_summary says it has open sub-issues is a plan, not a change: tehas:ready comes off it with one comment naming the count and asking for a label on a sub-issue, a retry ticked on one starts nothing, and the log says so. The field is read from the issue call the poll already makes, so a GitHub without sub-issues, or an answer without the field or whose counts are not numbers, starts as any other issue. A tehas:plan session on an epic is allowed |
Tested, not yet seen on a host |
| The epic marker labels an epic | An open issue whose title starts with the word epic (any case, after at most one opening bracket, then :, a closing bracket or a space) gets the epic label at the next poll. tehas only adds it; a removal by any account but the bot's is final, read from the label events, which are read whole when the page holds none of the label. The label decides nothing: the dispatcher and the epics panel still read sub-issue links. tehasbot health warns, in checks.epics, about an open issue labelled epic with no sub-issues |
Covered by the dispatcher's fixtures and the Rust and shell tests. Not yet seen on a host |
| Planning on an issue | tehas:plan from an allowlisted account starts a planning session. Each turn is one run of pi-rukas's headless planner (pi-rukas-headless plan, pi-rukas v0.14.0 or later, features.planTurns) and ends in the planner's text in one comment and a comment of its own for the boxes, which holds nothing of the text: the planner's questions, or a drafted plan with its open points and two boxes: Update this issue, which writes the plan as shown onto the issue as its title and text, ends the session and says the text it replaced, folded, with no container run; and File as a new issue, which files it as shown. In a tehas:plan session from an allowlisted person, a plan with no open points needs no box: tehas writes it onto the issue as Update this issue does, ends the session and starts a cycle, unless the manual lists a reason to ask. Every session's brief ends with the issue brief, lib/issue-brief.md. A ticked box or a reply from an allowlisted account continues it. Every turn works on the session's first commit, with the approved text and pi-rukas's record of the session carried between turns, in a directory beside its workspace. The session itself is on the state store: one write per change, and a turn's end the store would not take is posted by a later poll, once. The ceiling of a turn, 7200 seconds, is the host manual's time limits. A turn runs as its own unit, tehas-plan-<issue>.service, which holds state/plan-<issue>.json.lock while it runs: the poll that starts it returns at once, a later poll starts no second turn, the turn's end asks for a poll that posts its outcome, and tehas status shows it with a plan line |
Built, not proven: the headless turn, the confirm, the update of the issue and the session carry are covered by the shell tests with the runner stubbed. The start of a plan with no open points is covered by the tests of the dispatcher with GitHub stubbed. No headless planning session has run on a host yet. The earlier Pi RPC path was seen on a host on 2026-10-14 (issue 109) and is gone |
| Refining a request | tehas:refine from an allowlisted account starts a planning session whose brief adds lib/refine-brief.md after the issue's text: read the code, then plan one issue a single /work cycle finishes, with exact paths, named test files and later parts listed. A confirm files that part and ends the session: the filed issue says Replaces #<n> and is a sub-issue of the original, which says Replaced by #<m> and is closed with tehas:replaced, or kept open with tehas:refined when later parts remain; the label again plans the next |
Built, not proven: covered by the shell tests. No refining session has run on a host |
| A parked cycle is refined | A cycle that parks at explore as intent-park with underspecified or too-large is refined once on the next poll, on the word of the account whose tehas:ready or retry started it: the state store lists such parks (park-show --refine) and spends each once. Not when the factory is paused, a person has labelled, answered, ticked or edited the issue since, the issue had a planning session or was filed by one, or the cycle was run by hand or by the millwright. An automatic session that runs out of turns or is lost ends with needs-human-attention |
Built, not proven: covered by the store's tests and the shell tests with GitHub and the planner stubbed. No automatic refine has run on a host |
| Retry by a tick | The comment of a cycle that stopped has up to three boxes. Either retry box, ticked by an allowlisted account on a parked issue, starts a fresh cycle in a new workspace: Retry with the issue and all its comments gives it what allowed accounts that may write said on the issue and its pull requests up to the tick, and Retry with the issue text only the title and body alone. The comments box is offered only when the sandbox image lists issueComments or carries the issue-comments polyfill. The old labels, Retry from a clean start and Retry from the issue alone, still count on comments posted before. A second develop timeout on the same text has only Leave it parked |
Tested. The comment with its boxes was seen on the tehas-tehas host, 2026-10-11, with two boxes; the new boxes and a tick have not been |
| A develop timeout's note | A cycle parked at child-timeout:develop writes a note of the attempt into the issue's body for the next cycle: the steps and their times, the gate, what was left in the workspace, the files the plan named. A second timeout on the same text writes nothing and offers no retry, and names tehas:plan. See When a cycle stops |
Covered by the shell tests and the cycle's Rust tests; not yet seen on a host |
| Reporting | Start and outcome comments on the issue; token usage per agent role on the pull request | Issue comments verified. The usage on the pull request is not recorded here as seen on a host |
The work cycle
| Feature | Detail | Status |
|---|---|---|
| Headless pi-rukas | The container runs pi-rukas's one-shot runner, pi-rukas-headless work <issue> --json; the outcome is its result and its exit status, the console reads its stable NDJSON kinds. tehas reads result schema 5 only. Before a cycle the image is asked --capabilities, and a contract version, flag or PI_ENSEMBLE_* input it does not list, a role among them, stops the cycle with 78. sandbox/build.sh asks the base the same before it builds, and builds nothing on a base whose contract tehas work cannot use |
Covered by the shell tests. The v0.12.80 runner was run by hand in a throwaway container on 2026-10-15 with no model: --capabilities answered, and work ended in a handoff with exit 10, a schema 3 result and NDJSON progress. Seen in cycles on tehas-tehas from 2026-10-16: schema 3 results with exits 10, 11 and 20, and handoffs that named their pull requests. The runner of pi-rukas main at 316134e, the first on schema 4, was run by hand the same way on 2026-10-18: a schema 4 result with exit 10. No cycle on a schema 4 image has been seen on a host yet, nor a refusal for a contract the image does not list. The v0.14.0 runner, the first on schema 5, has not been run yet |
| One comment per handoff | The runner is given PI_ENSEMBLE_HANDOFF_CHANNEL=host: pi-rukas posts no handoff and applies no label, and tehasbot cycle posts its handoff in the one comment of the park, or with the usage on the pull request. tehas:awaiting-merge only for the cap awaiting-human-merge with no review held on its round cap and no needs-human-attention on the issue; any other handoff with a pull request is parked and names the cap. A parked issue restarts with --restart, and nothing in tehas removes needs-human-attention |
Covered by the shell tests, against the v0.12.80 result fixture. Not yet seen on a host |
| Cycle deadline | The runner is given PI_ENSEMBLE_CYCLE_DEADLINE, the handoff allowance, 8 minutes, given as PI_ENSEMBLE_HANDOFF_TIMEOUT_MS, before the end of TEHAS_WORK_TIMEOUT: every step is bounded by it, no step starts after it, and the cycle parks with the cap deadline |
Covered by the shell tests. Not yet seen on a host |
| Time limit cap | A cycle that ends at TEHAS_WORK_TIMEOUT with no cap from the runner, whether the runner stopped itself or tehas stopped its container, is timeout and goes on record with tehas's cap wall-clock, the step it was in and a capReason |
Covered by the shell tests. Not yet seen on a host |
| Runner never started | A container tehas work watched to its end that wrote no result and not one line of its stream never reached the driver's first event. It leaves its own exit status in state/cycles/<issue>.nostart, and the cycle goes on record with tehas's cap runner-never-started, the step no-step and a capReason naming that status. A container this command stopped, killed outright, or ended at the time limit leaves no such note, and one whose exit is 0 is no note |
Covered by the shell tests. Not yet seen on a host |
| Signal cap | A cycle whose container tehas work stopped on a TERM, INT or HUP, with no cap from the runner and no tehas stop, goes on record with tehas's cap signal and a capReason naming the signal and the step. A run of the gate it cut short is closed in the stream with a verify-aborted line, and the console says so |
Covered by the shell tests. Not yet seen on a host |
| Gate runs per container | The runner is given PI_ENSEMBLE_VERIFY_CONCURRENCY from the container's share of the CPUs and memory ceiling |
Covered by the shell tests. Not yet seen on a host |
| A child's bound | The runner is given PI_ENSEMBLE_SPAWN_TIMEOUT_MS from the instance's TEHAS_CHILD_TIMEOUT, whose default the settings table of the tools page states. A child nothing else ended is bounded by tehas' setting and not only by pi-rukas's own default. At most TEHAS_WORK_TIMEOUT; a longer one is refused with 78 |
Covered by the shell tests. Not yet seen on a host |
| Workarounds that expire | TEHAS_RUKAS_WORKAROUNDS lists the settings that work around a pi-rukas defect with the release that fixes it; a cycle on an image of that release or later stops with 78 |
Covered by the shell tests |
| Sandbox | Agents run in a container with CPU and memory limits, a fresh clone to work in and the GitHub App's narrowed cycle token: no Docker socket, no SSH keys, no host environment. Every capability of Docker's default list is dropped and only CHOWN and FOWNER are given back, and no process gains rights through its mode or file capabilities; the same options for a cycle, a planning turn, a tehas dev session and the push check, from one function in console/core/src/sandbox.rs. Each starts as the tehas user, not as root. The network is not restricted unless TEHAS_EGRESS=on, see the next row. A cycle's /tmp is a tmpfs of half the container's memory ceiling, so a full /tmp is ENOSPC for its writer and not an OOM kill, and nothing prunes it during a cycle |
Covered by the shell tests, which pin each option on all four docker run lines, and by the tests of the function that prints them. On tehas-tehas on 2026-10-19 every container started as root with these options died in its entrypoint (setpriv: setresuid failed, issue #420); the image started by hand with them and --user ran as its own user. Not proven: no whole cycle has been seen to build, test and drive a headless browser with the capabilities dropped; that is owner work on a host. On tehas-tehas on 2026-10-24, with the old size=8g above a 5.35 GiB ceiling, cycle #353 filled /tmp to 5.19 GB and the kernel killed its three agents and the driver (issue #761); the size is now half the ceiling. Not proven: no cycle has yet been seen to fill the smaller /tmp and get ENOSPC. TEHAS_SCRATCH_DIR puts a cycle's /tmp on a host's scratch disk instead: covered by the shell tests, not yet proven on a host. Its bounds TEHAS_SCRATCH_MAX and TEHAS_CYCLE_STOP_FREE stop the cycle at the cap disk: covered by the Rust tests of the decision, the measure and the report; not yet seen to stop a cycle on a host |
| Egress limit | With TEHAS_EGRESS=on, a cycle with its push check and its install of the product's dependencies, a planning turn, a review and a tehas dev session are on the internal network tehas-egress, whose one way out is the proxy container tehas-egress: it connects only to GitHub, the npm and crates.io registries, the endpoints in models.json and TEHAS_EGRESS_HOSTS. Off by default. See Where a container may connect |
Covered by the Rust tests of the proxy and of its start, and by a golden of the cycle's docker run lines. Run on a development machine on 2026-11-06 with the pi-rukas image: curl, git, gh, npm, cargo and bun reached GitHub, the registries and a model endpoint through it, and a direct connection or another host failed. Not yet seen on a host, and no whole cycle has run behind it |
| Project gates | The cycle runs the project's own .pi/verify-cmd, .pi/verify-cmd-full and .pi/smoke-cmd |
Gates verified in the sandbox, 2026-10-08, and run by the cycles seen on tehas-tehas since (see A cycle to a pull request below) |
| The product's Node | An instance layer puts the product's own Node first on PATH (instances/example/product-node.Dockerfile), so a tehas Node bump does not move the Node of its gates; pi and the npm tools tehas ships run tehas's Node from /opt/tehas-node by its path. See The product's Node |
Covered by the shell tests of the recipe and of its links. Not yet built or seen on a host |
| Protected gates | pi-rukas halts a cycle whose patch touches .pi/, .github/, CODEOWNERS or agents.json. An edit to AGENTS.md or CLAUDE.md is not halted: it ships and you see it in the diff, but the cycle is judged against the doctrine at its own base commit, so its own edit changes nothing for it |
pi-rukas feature, not exercised here. The list is pi-rukas's own, behind its PI_ENSEMBLE_PROTECTED_PATHS |
| Review severity bar | A review finding blocks the change at the severity the product states, and starts a fix round. Here that bar is HIGH: LOW findings are notes on the pull request, a CRITICAL finding blocks whatever the bar says, and pi-rukas reads the bar from the product's doctrine (AGENTS.md, or CLAUDE.md when it has one) at the cycle's base commit, or from PI_ENSEMBLE_REVIEW_THRESHOLD on the instance. With neither, its default is HIGH from v0.14.50 (MEDIUM up to v0.14.49), which is what applies here, because this repository's AGENTS.md states no bar; the bar the platform repository decided is recorded in docs/adr/0002-review-severity-policy.md, which a person has to bring to HIGH and copy into AGENTS.md. Two rounds at most from v0.14.49, three before |
pi-rukas feature. Its MEDIUM default was seen in the log of cycle 97-261013-125428, 2026-10-13, where the verdict was recorded as unstated because this repository states no bar. A bar read from doctrine has not been seen on a host |
| Human merge | Nothing merges on its own | By configuration (no merge grant in AGENTS.md) |
| Self-hosted models only | Every role runs on the endpoints of the instance's models.json; the model is set in instance.env, one for every role unless a role names its own |
Verified |
| A model per role | PI_ENSEMBLE_MODEL_<ROLE> gives one of the five roles the pinned pi-rukas reads its own model; the provider defaults to the subagent one. An unknown role is refused with exit 78 |
Covered by the shell tests. Not yet seen on a host |
| Work by hand | tehas dev gives a person an interactive pi-rukas session on the host: the cycle's sandbox with a terminal, a clone that is kept, and the person's name on the commits. The push and the pull request are still the bot's |
Seen on the tehas-tehas host through the own-account entry below, which runs this command. Started directly as the tehas user: covered by the shell tests only |
| Work by hand, own account | An account in the group tehas types tehas dev and gets its session in a clone named after it, with the name and email of its own git configuration on the commits. One sudo rule, written by bootstrap.sh dev, runs it as the tehas user |
Seen on the tehas-tehas host: the root step, the clone, a session that reached the model, and the account's own name and email as author and committer inside it. A push and a pull request from a session are not yet seen |
| Concurrency knob | TEHAS_WORKSTREAMS sets how many workstreams a cycle runs side by side; 1 by default, above 1 only with one cycle at a time (TEHAS_MAX_CYCLES=1), else every command stops with 78 |
Setting reaches the sandbox; its effect on a cycle is not yet observed |
| Code index | tehas index builds the index behind the agents' code search, in the sandbox image; install.sh runs it once. The dispatcher refreshes it as its own unit, tehas-index.service, before it starts cycles while none is running and the branch has moved, and starts them on the poll after it; a cycle started while another runs gets the index as it is, so on a host that is never idle it falls behind the branch |
Covered by the shell tests; run against the upstream image on a development machine, not yet on a tehas host |
Visibility
| Feature | Detail | Status |
|---|---|---|
| Solid 2 kit | host/fun/kit/, kit 1: Solid 2 (solid-js 2.0.3, @solidjs/web 2.0.3, @solidjs/signals 2.0.3, @solidjs/html 2.0.1) vendored as one module by tools/vendor-solid, the island base, the feed store (with request headers, credentials, text, a status taken as data and the answer's status, headers and Date), the stream source for SSE and NDJSON over fetch, presses for Solid's action(), page stores and shared parts, with a manifest, and vendor/solid.d.ts, types for the library's exports that an install never copies into a home. The byte ratchet counts the library once, checks the manifest and refuses Solid 1.x names, library imports outside the files that draw, templates built from strings, and a type file that is missing or does not name exactly the library's exports. The seven modules carry JSDoc types, checked strict by the workspace test update::types with the tsc TSC_VERSION of versions.env pins (7.0.2), which CI, the sandbox image and bootstrap.sh user install; without one the test is skipped unless CI or TEHAS_TEST_STRICT is set. The plain dashboard loads it (next row); no other page does yet. See The front end |
Built, not proven: covered by the Rust tests of the ratchet and the node tests of the page stores and feeds, and seen in a browser on a development machine with a demo page of two islands sharing one feed and one store under a strict CSP, and a third against a small test API: a feed with headers and an accepted 404, an SSE and an NDJSON stream feeding a page store, and a press whose optimistic value rolls back on a failure (test/browser/kit-check.mjs). On 2026-11-20, at commit e08a1687, the check passed 32 of 32 in headless Chromium 131, Firefox 132.0 (Playwright's build firefox-1466) and WebKit 18.2 WPE (Playwright's build webkit-2104), four runs in each, driven through playwright-core 1.49.1 with a copy of the check's harness. Playwright publishes no checksums for its browser builds, so those three builds were not verified. Streams and presses are tested in node (test/kit_stream_test.mjs, test/kit_press_test.mjs); no page of tehas uses them yet. The type check was seen to pass, and to reject its five fixtures of misuse, with tsc 7.0.2 on a development machine on 2026-11-20; it has not run in CI yet. Not seen in Safari on a Mac or on a phone, not on a host |
| Plain dashboard | At /dashboard: in line, being worked on, waiting for review, stopped, completed (10 each, then a link to GitHub). Since v1.1.0 drawn by Solid islands on the kit (host/fun/factory/), with the server HTML as the first view and one feed per /live/ file |
The lists verified with the plain scripts before v1.1.0. The islands are checked in a browser against the samples (test/browser/dashboard-check.mjs, outside the gate). On 2026-11-20, at commit e08a1687, it passed 33 of 33 in headless Chromium 131, Firefox 132.0 (Playwright's build firefox-1466) and WebKit 18.2 WPE (Playwright's build webkit-2104), four runs in each, through playwright-core 1.49.1 with a copy of the check's harness; Playwright publishes no checksums for its browser builds. Those runs served the files of host/ as they stand, not as an install names them, and missed that a staged install named the islands, kit.css and factory.css at addresses with no file: the stage now names a hashed copy in its own folder, the workspace test update::assets checks every address of every staged page, and dashboard-check.mjs --staged serves a stage, which passed in headless Chromium 131. A staged install served by caddy 2.11.9 (release checksums verified) answered every address of its pages with 200, hashed scripts and stylesheets in /fun/, /fun/kit/ and /fun/factory/ immutable, the kit's plain files and solid.js no-cache, and the pages with the same headers as before; caddy validate passes for docs.Caddyfile and router.Caddyfile with that version. Not yet seen on a host |
| Live console | The running cycle's agents, the commands they run and the start of each result, streamed to the dashboard; tokens, keys, passwords and the values of the host's secret settings masked. The docs server serves it only with TEHAS_SITE_CONSOLE=on; without it the files are a 404 |
Verified on a real cycle as a Deno script. The Rust program that replaced it is tested, not yet seen on a host. The switch is covered by test/edge_test.sh, which runs the server's own Caddyfile where caddy is installed; not seen on a host |
| Factory floor (game view) | The front page: the stages as a 16-bit factory floor with the live queue, a work order monitor, an issue board and a breakroom. The work order shows each ticket's dates; the live queue carries no runs, tokens or time, so it shows those only for sample or exported tickets that hold them. A row with no data is left out | Tested with fake files |
| Designs | TEHAS_DESIGN draws the whole site, the Protolab included: beesknees26 by default, with the business page at /, or pixel, with the factory floor at /. Each page names the design's theme file, logo and share card; /floor and /business are always there. See The host |
Covered by the Rust and shell tests. Both designs rendered by the pinned caddy image and seen in headless Chrome on a development machine at /, /floor, /business and a manual page. Not yet on a host |
| Business page | At /business on every host: live power and tokens, the production line to shipped on one row, each stage only while it has something to show (Prototypes while there are any, Planning while work is being planned, Review while a pull request waits), the last 10 days, the issue board and, with TEHAS_SITE_CONSOLE=on, the console of the running cycles. See The host |
Covered by the shell and front page tests; seen in a browser against the docs server on a development machine with copies of a live host's files, before the look was pinned. Not yet on a host |
| Epics | Both front pages list the open epics, issues with sub-issues, newest first: a block per sub-issue, filled when it is closed. A row opens to the sub-issues, each with its state and a link, and a link to the epic. A closed epic leaves the list at the next poll. Read from live/epics.json, which tehasbot status writes |
Covered by the Rust, shell and front page tests; seen in a browser on a development machine, in pixel and beesknees26, with a file read from the tehas repository. Not yet on a host |
| Panels | tehas panel set <id> --label TEXT --url URL names up to four pages of the project, such as a support chat. Both front pages read live/panels.json once and put an item per panel in their menu; pressing it opens the page in a sandboxed frame in a dock at the side, made on the first press, with a link to open it in a new tab. A URL on TEHAS_DOMAIN is refused, and the page checks each URL again. A host bridge menu item docks the same way, or, with open: "page", is a plain link that opens its page in a new tab |
Covered by the Rust, shell and front page tests; seen in headless Chrome on a development machine, in pixel and beesknees26, at desktop and phone width, with a page on another origin. A page item is covered by the front page tests only, not yet seen in a browser. Not yet on a host |
| Host messages | tehas host-message set <id> --level info|warn|alert --text TEXT [--link URL] keeps up to 20 short messages for the factory in state/host-messages.json; clear <id> takes one away and list --json prints them. Health lists them in checks.hostMessages and warns on an alert or warn one; tehas status, the MCP factory_status answer and the front pages' banner show them |
Covered by the Rust and shell tests. Not yet on a host |
| Production console | The running cycle's console in the game view, read from the same /live/ files as the dashboard, so only with TEHAS_SITE_CONSOLE=on |
Tested with fake files |
| Console tabs | A tab per running cycle and one for the cycle that finished last, on the factory floor and the plain dashboard | Tested without a browser; the factory floor seen with fake files, the plain dashboard checked in headless Chromium with fake files; not yet seen on a host |
| Analytics | ~/tehas/libexec/analytics, built by install.sh, keeps 365 days of runs, their steps and roles, issue events and poll samples in ~/tehas/state/analytics.db (SQLite, mode 0600), and writes a copy with copy; tehas analytics copy --to <file> --json writes it for a person or a program and says what it holds, and tehas api lists the feature analytics. tehasbot cycle records each run and its end, the dispatcher the events ready and started and one sample at the end of a poll that wrote, started, stopped or turned anything (an idle poll takes none, so availability and energy measure work, not uptime), tehasbot status the events awaiting, stopped, merged and closed, and each planning turn as a run of kind plan, without usage; a call that fails only warns. tehasbot status writes the ten-day report, aggregates only, to live/analytics.json, and the plain dashboard shows it as "Last 10 days"; tehas analytics report prints it in a terminal. See Analytics. TEHAS_ANALYTICS=off stops every write |
Built, not proven: covered by its Rust tests (a copy through tehas analytics is checked for tokens, hosts and addresses), the shell tests of its callers and the node tests of the dashboard section. Proven needs one real cycle in the report on tehas-tehas and an export opened on another machine |
| One screen on the host | tehas top: the factory line, the queue and the issues behind the counts, the cycles, the host's own numbers (cpus, load, cpu and memory share, up to fifteen processes by pid and short name), the units, the energy sample and the tail of a cycle's console, on one screen that redraws itself. --json prints the snapshot a frame is drawn from, for the dashboard and not a public object. A redraw compares the host against the reading of the frame before it, so only the first frame waits a second for a pair of readings. It reads only the files under ~/tehas/live/, /proc and systemctl --user, loads no settings and writes nothing |
Covered by the shell tests; not yet seen on a host |
| Host snapshot, optional | tehasbot top writes that snapshot to ~/tehas/live/top.json every 5 seconds when TEHAS_TOP=on, cut to the keys the pages draw and nothing else: a key added to the snapshot later is not published until someone names it. With the default 0 it removes the file. tehas-top.service is installed and starts only when you enable it. It names processes by pid and short name: no command line, nothing from a cycle's container |
Covered by the shell tests; not yet seen on a host |
| Host panel | The same numbers on the factory floor (its own section and a chip on the head panel) and on the plain dashboard, read from top.json and hidden where the file is not published: the readings, the processes, then the units as tehas top lists them. A snapshot older than 30 seconds is called stale. Both pages work out what the file means with one module, host/fun/host-data.js (the plain dashboard draws it with its island host/fun/factory/tehas-factory-host). The floor asks for it with the rule of that module: not while the page is hidden, and once a minute rather than at every period where the file is not there. The plain dashboard asks through the kit's feed: every ten seconds while the file is there, once a minute while it is not, and not while the page is hidden; a poll that fell due meanwhile runs when the page shows again. Both pages judge a snapshot's age by the server's clock: the floor by the Date of its answer, the plain dashboard by the Date the kit's feed gives in meta(), moved on by what the viewer's clock has run since |
Tested with fake files: the floor's rule by test/host_view_test.mjs, the dashboard's periods and the server's Date by test/dashboard_feeds_test.mjs, the age by the server's clock by test/dashboard_host_test.mjs, and the dashboard in headless Chromium by test/browser/dashboard-check.mjs, which is outside the gate and sees the age by a server clock three days behind the viewer's. Not yet seen on a host |
| Energy use | Optional. In the game view, only when the model backend is a viiwork mesh and tehas-energy.service is enabled: draw now, kWh for 24 hours and 30 days, a 30-minute chart, the machines serving the factory and its models, and a live meter on the head panel with the draw now and tokens a minute |
Tested with fake files |
| Protolab | A page for every open issue labelled tehas:prototype by an account in TEHAS_ALLOWED_LABELERS, on port 8081: title, link to the issue, and the attached images, videos and static HTML files, 10 MB a ticket. An attached zip is unpacked into a folder of its own, its files held to the same limits. A label from anyone else, or a label that is not the one tehas labels pinned, counts as no label, and the page goes. A title changed since by anyone else is not published. Files are taken only from text an allowed account wrote, that nobody off the list edited last, and not from a quoted line; a change with no new link fetches no file again. Served by a container of its own; HTML runs sandboxed. Listed in the game view. With TEHAS_DOMAIN, each ticket also at lab-<issue>.<domain> |
Covered by the shell tests; run by hand against real attachments. The list was seen at lab.<domain> on the tehas-tehas host, served by the router, 2026-10-11; a ticket under its own name has not been. The check on who applied the label is covered by the shell tests only, and so are the label pin, the hold on a title changed since, and which texts give files. Unpacking a zip, now by the Rust program libexec/attach: covered by the shell tests and its Rust tests; not seen on a host. The pass itself, now in the console: covered by the shell tests and its Rust tests; not seen on a host. With TEHAS_ISSUE_TYPES, the issue type in place of the label, and the same type for the dispatcher's holds: covered by the shell tests and the Rust tests; not seen on a host, and no organisation has the types yet |
| Previews | A running copy of the product for every open pull request whose branch is in the repository and that an owner, member or collaborator opened, at uat-<pr>.<domain>: built from the commit's preview/Dockerfile with no network and in tehas.slice, locked down, removed when the pull request is merged or closed, with a second check every three hours. No build on a full disk; the pull request, the dashboard and /health say so. The head of the default branch has one too, at uat-main.<domain>, always on, beside the pull requests'. See Previews |
Covered by the shell tests. The router's routes were run in Caddy 2.8.4 with a container on an internal network, and again in 2.11.7 on 2026-11-02, and the preview image of this repository was built and run with a preview's options, both on a development machine. The domain, the certificate and the proxy were set up and checked from outside, 2026-10-10. Seen on the tehas-tehas host, 2026-10-11: two pull requests were built and served at their names, each announced by the bot in a comment; the notice now goes at the top of the pull request's description instead, which has not been seen on a host. Both previews were removed at the next run after their merge. What they left in GitHub stays: a merged pull request keeps the notice its description last said, and the comments of 11 Oct are not edited or removed by anything now. Not yet seen: the check every three hours removing anything, a full disk, a pull request over the limit, the default branch's preview on a host, a build with no network in tehas.slice |
| Health endpoint | /health and /healthz on port 8080: pass, warn (paused, or low on disk for previews) or fail (last cycle failed, answered with 503). A cycle that ended closed is not a failed one: the usual reason is that its pull request merged first, or a person closed the issue by hand. A start that was refused before anything ran ends as refused and is not a failed one either |
Tested with fake files |
| Old queue snapshot | A queue snapshot more than ten minutes old, because GitHub did not answer, is warn with its age; tehas status shows the age on the queue line |
Tested with fake files, not yet seen on a host |
Failed endings in /health |
checks.failed names the failed cycles among the last ten that ended, also one a later success overtook. A cycle that ended closed is not among them, nor is a start that never ran: its ending ends as refused and health leaves it out |
Tested with fake files, not yet seen on a host |
| Platform behind origin | A platform line in tehas status with the checkout's commit and how far it is behind origin's default branch, fetched at most once an hour; warn on /health after a day behind |
Tested with local git repositories, not yet seen on a host |
| Sandbox image behind pi-rukas | checks.rukas in the health file: the commit the sandbox image runs and its version, the commit the host follows, the clone's commit, and behind, which makes /health warn and install.sh --check say Sandbox: BEHIND, and layerMoved, the image's tehas.layer label against the sum of the instance's sandbox.Dockerfile, which makes /health warn too; bootstrap.sh user runs build.sh --if-moved. The front pages' footers show the versions from health, with the manager's when TEHAS_MANAGER_VERSION is set |
Covered by the Rust, shell and front page tests, not yet seen on a host |
The slice in tehas status |
A fourth line: the room the dispatcher's last poll read in tehas.slice, what is promised, the reserve and the age, or the hold. warn on /health while the slice is missing or cannot be read |
Tested with fake files, not yet seen on a host |
| The idle poll's budget | checks.poll_cost on /health gives the figures the median of the polls of the last hour that started no cycle came to, and warn when one is over TEHAS_POLL_BUDGET (default cpu=5,wall=30,writes=0), with the figures over it named in output. The figures are the store's: tehasbot health asks store poll-idle --since 3600 --budget <spec> and carries its over; a store that answers nothing leaves the check out rather than pass it. See What a poll costs |
Covered by the store's Rust tests (the medians, the names over the budget, a budget of another shape refused with 64) and the shell tests of tehasbot health (a poll of the planned cost passes the default, one over it warns and names it, and the instance's own budget is the one the store is asked for), and the shell tests of the loader (a budget the store would refuse stops the load with 78 rather than the store). Not yet seen on a host |
| The MCP server | tehasbot mcp serve (tehas-mcp.service, off unless TEHAS_MCP=1) runs a read-only MCP server, revision 2026-07-28 and the 2025-11-25 handshake, in a locked-down container given ~/tehas/live, the private ~/tehas/mcp (the sessions snapshot and the outcomes counts) and ~/tehas/logs read only. Sixteen tools, and factory_contractors while outsource is on. Five copy listed keys from the live files: status, issues, endings, a running cycle's console, the ten-day report. Five read the sessions of the last 30 days and their logs: factory_sessions, factory_session, factory_log (masked, plain or gzipped), factory_search (the logs of an issue's sessions searched for a fixed string, masked) and factory_failures. factory_events gives the lines of dispatch.log and refresh.log after an opaque cursor, masked, with a kind each, across a copy-and-truncate rotation of either log. factory_issue answers one issue's story by joining the two: the stage and title from the live files and the runs of the last 30 days from the snapshot. factory_outcomes reads only outcomes.jsonl and counts how the runs ended for a year back, per version pair or per UTC week. factory_park answers why an issue's last stopped run stopped: the step, failure kind, cap, park signature and the container's refused starts and memory kills from the snapshot, and the runner's error, cause and failing check lines from the run's result log, masked and cut. factory_decisions reads the last 1 MiB of dispatch.log, by that one name, and lists the dispatcher's last start, skip, wait, hold and drop decisions, the reason masked; a hold is an issue it keeps parked without starting it, and a drop is a refresh request it dropped; the lift #N: line that releases a hold is not a decision and comes from factory_events instead. factory_disk reads disk.json, the answer a run of tehas disk --publish wrote, and copies it with its own allowlist: how full each watched file system is and what fills it, with no figure ever served as 0; the server asks the host's disk nothing. Bearer keys from TEHAS_MCP_KEYS in ~/.config/tehas/env, which gives every tool, and TEHAS_MCP_DASHBOARD_KEYS, which gives only the four live-file tools a dashboard needs and no session, log or event tool; tehas mcp key makes one, and a key of both lists stops the server with 78. The journal's line per request names the key by its fingerprint, the list the key was read from as scope=, and for a tools/call the tool by name, never an argument; The MCP server gives its shape. See The MCP server |
Covered by the Rust and shell tests. Seen on tehas-tehas on 2026-10-20, through tehas.app: no key gets 401, an Origin 403, and a call to factory_status with a key returns the live status. Seen on tehas-tehas too: an outside agent has used it since 2026-10-22, one key, about 18,000 requests to 2026-10-26 and nearly all answered 200, from the unit's journal. Not proven: which tools that client called, as the journal named the request and not the tool until this release. Since the journal names the tool, on 2026-10-28, it shows that client calling all five session tools, each call answered 200; a tool error is answered 200 too, so their answers have not been checked on a host. The sandbox image of each run (image, imageBuilt, the image filter of factory_sessions and by: image of factory_failures) is covered by the Rust and shell tests and not proven: no host has recorded a build time yet. Work runs carry the image id since it was first recorded; build times and the image of a planning turn start with the release that brings them, so every run of the 30 days carries both only 30 days after that release. factory_park is covered by the Rust tests and has not been seen on a host. factory_disk is covered by the Rust tests, and its file is published hourly by the cleaner's unit; the tool itself has not been called over MCP on a host. factory_events is covered by the Rust tests only, rotations included, and was run once by hand on a copy of tehas-tehas's two logs, every line once over 50 calls; it has not been seen on a host. With TEHAS_MCP_CHECKOUT, a full key is also served factory_git_log, factory_git_show and factory_git_blame, read from that shared clone with the server's own git reader and no git program; covered by the Rust tests, blame checked against git blame and a clone whose config names programs checked to run none; not yet seen on a host. A client's handshake asks tehas-mcp-fetch.socket to fetch the clone, at most once a minute and only forward, and a git tool given seen says when the clone moved; covered by the Rust and shell tests, not yet seen on a host. While the server is on, the status run reads the repository's issues and pull requests into ~/tehas/mcp/tickets/ a few pages a poll, and a full key is served factory_ticket and factory_tickets from them, masked; covered by the Rust tests, and one read of 200 items of tehas-app/tehas was run by hand off a host; not yet seen on a host. factory_decisions is not proven for a hold line: its answer matched the last 50 and the last 200 lines of dispatch.log that hold start #, skip #, wait # or drop the refresh of #, and on a cut of it that ends among the drops, on a copy of tehas-tehas's log read by a server run off the host, not on a host. A hold #N: line is read as a decision of its own since this release and is covered by the Rust tests only; no host answer has been checked against the log |
| Optional features and switches | One registry names every optional feature, whether the release ships it or is still building it, and the switch that turns it on. Only a shipped feature can be on: a building feature's switch set to on stops every command with 78 and the feature's name. tehas api --json lists every one in flags with whether it is on. Every switch takes on, off, 1 and 0, and any other value stops every command with 78 |
Covered by the Rust tests and the shell tests, not yet seen on a host |
| The factory API | tehas api --json says the API version, release, repository, features, the optional features in flags, millwright and what the polls cost (poll: the last poll's wall and CPU time, its gh calls, its writes by kind, its starts, its age in minutes, and the hour's sums), so a program that keeps a copy of them can add the cost of many hosts up; tehas status --json prints the health file as one object, with the demand every poll counts, a paused one too. See The factory API |
Covered by the shell tests, not yet seen on a host |
| Approval record | Before it marks an issue tehas:running, the dispatcher records the approval in the state store: who approved the start, when, by label or retry tick, the sha256 of the approved body, of the approved title, and the attachment links. The cycle's start uses it, once: a second poll on the same label event starts nothing, and a start from the unit with no approval waiting exits 77 before any label or comment. On every start, whatever the instance gives the cycle, tehas work reads the issue once and stops with exit 4 when the hash of its body or of its title is not the approval's, when the approval cannot be read, or when the issue cannot be read, and says which on the issue; an approval that names no title is checked on the body alone; a run by hand says the run is its own approval and goes on, and a store that cannot be read is never taken for one. tehasbot cycle reports an exit 4 as a cycle that never ran and takes its approval off the record |
Covered by the shell tests, the store's included. Seen on 2026-10-19, with the record in a file: tehas work's own comparison, run by hand for 12 issues of the live repository, of the sha256 it computes from the REST answer with the one the dispatcher recorded from its GraphQL answer: equal for all 12. Not proven: no host has run a start from the state store, nor a start that refused an edited body or a renamed title |
| The links of the approval, not of today | With TEHAS_WORK_IMAGES=on, tehas work fetches the record's links only, records a sha256 for each image, lists them in the comment, keeps the manifest as state/cycles/<issue>.manifest.json, and stops when a link of the same approval gives other bytes |
Covered by the shell tests. Not proven: no host has run it |
| What a start measured | A start that had an approval record measures the approved body -- four counts of it, files, tests, deliverables, done_when (console/core/src/size.rs) -- and appends {at, issue, files, tests, deliverables, done_when} to ~/tehas/state/sizes.jsonl, mode 600, from the one read of the issue the text check already made. A run by hand has no approved body and records nothing. The ledger keeps the last 500 lines. A line it cannot write is one word on the command's error stream, naming the step that gave up, and the cycle starts all the same. tehas analytics report reads it for its size figures |
Covered by the shell tests, including a ledger that cannot be written, a ledger that is a link or a directory, and a body too long to measure in the time one start waits, and by the analytics tests that read a written ledger back. Not proven: no host has run it end to end |
| Images described in words | With TEHAS_WORK_DESCRIBE=on (needs TEHAS_WORK_IMAGES=on), tehas work and the first turn of tehas plan ask the model endpoint to describe each image, at most 8, 60 seconds and 1500 characters each, into images.md beside the manifest, quoted under a head that says a model wrote it from untrusted images. A failure of an image is said in the file. For tehas work, describe runs as a program of its own: one that fails, one that could not be started and one whose end could not be read are each said on standard error as what they are, and none stops the start. No mount or variable more. pi-rukas does not read the file yet |
Covered by the shell tests with curl stubbed. Not proven: no host has run it, and no model on the fleet has been asked |
| Text files for a cycle | With TEHAS_WORK_FILES=on, tehas work and the first turn of tehas plan fetch the md, txt, csv, json, yaml, log, html, css and js files the issue text links, valid UTF-8 with no NUL byte, at most 16, 1 MB each and 4 MB together, by the images' rules of approval, into the images' directory as file-<n>.<ext>, listed under files in the manifest with a sha256. The same mount and variable as images, with or without them. pi-rukas does not read them yet |
Covered by the shell tests. Not proven: no host has run it, and no pi-rukas reads the files |
| Zips for a cycle | With TEHAS_WORK_ZIPS=on (needs images or files on), a zip the issue text links is unpacked into that same directory by libexec/attach, the Protolab's unpacker, a Rust program that also fetches every linked file and reads its bytes: at most 2 archives per issue, each downloaded at most 4 MB, known by its first four bytes and not by its name. Every file in it then goes through the checks of a linked one, an image by its first bytes and a text file by its extension and its encoding, and counts against the images' and the files' limits; the rest is left out, each with its path in the archive and a reason. The files are named on from the linked ones and their manifest entries say the archive and the path. The archive and the directory it was unpacked into are removed. No mount and no variable more |
Covered by the shell tests and the attachment checker's Rust tests. Not proven: no host has run it, nor the Rust checker on any host |
| Attachments in comments | With TEHAS_WORK_COMMENTS=on (needs images or files on), the dispatcher adds to the approval record the links of the issue's comments that an allowed account wrote and nobody edited after the approval, each with source: "comment:<id>". tehas work fetches them after the body's links under the same limits, and every manifest entry says its source |
Covered by the shell tests. Not proven: no host has run it |
| Comments on a retry | A tick of Retry with the issue and all its comments adds to the approval record the text of every comment on the issue and on the bot's pull requests for it (conversation comments, review bodies, inline review comments) written up to the tick, not edited after it, by an account of TEHAS_ALLOWED_LABELERS with write permission at the tick, the bot's own left out. tehas work writes them to comments.json in the format of trail-openers/pi-rukas#2020 and mounts it, with images and files off too. With TEHAS_WORK_COMMENTS=on their links are fetched as well |
Covered by the Rust and shell tests. Not proven: no host has run it, and no pinned pi-rukas reads the blob yet (#2020 is open; the polyfill is being set up) |
| Attachments in a planning reply | With images or files on, a reply to a planning question that links images or files adds them to the session's directory before the next turn, numbered on, under the same limits, source: "answer:<id>", and the answer the agent gets names them. The turn's container is told PI_ENSEMBLE_PLAN_ISSUE. pi-rukas does not use the images in planning yet |
Covered by the shell tests. Not proven: no host has run it |
| An issue's image a cycle was not given | With TEHAS_WORK_IMAGES=off and TEHAS_WORK_FILES=off, tehas work fetches nothing of the issue for its attachments, though it still reads the issue's text once to hold it to the approval record. When the dispatcher's approval record lists links, it says so in a line that names how many and which approval it read, written to work-<issue>-<stamp>.jsonl.err, which the record copies as err.txt, and keeps a manifest with no image, that approval, and each link left out with the reason, at most 100 of them: a cycle that never saw a picture is not read as one that ignored it. The links are the approved text's, never what the issue happens to link today. No directory is mounted and no PI_ENSEMBLE_EXTRA_IMAGE_DIRS is passed on, whatever the instance file says. An issue the dispatcher never started has no approval record, so nothing of that gap is said and nothing is kept, though the run says on its error stream that no approval is recorded on this host for the issue and that a run by hand is its own approval |
Covered by the shell tests. Not proven: no host has run it |
| Attachments in a session by hand | tehas dev --issue <n>, with images or files on, fetches the issue's images and files by a cycle's rules into ~/tehas/dev/<name>.images and mounts it read-only with PI_ENSEMBLE_EXTRA_IMAGE_DIRS. Taken when an allowed account applied the last tehas:ready, or the issue's author is an owner, member or collaborator. Without --issue an instance's PI_ENSEMBLE_EXTRA_IMAGE_DIRS is not passed on |
Covered by the shell tests. Not proven: no session has used it |
| Images for a cycle | With TEHAS_WORK_IMAGES=on, tehas work fetches the png, jpg, webp and gif images the issue text links, at most 8 and 10 MB, only for an issue labelled by an allowed account or opened by an owner, member or collaborator, and mounts them read-only in the cycle's container with a manifest. The dispatcher holds the cycle of an issue that links an attachment while the sandbox image says its pi-rukas does not read the manifest, or the model does not declare image input or does not answer an image; it asks only when such an issue could start, once a poll at most, and other issues start. That answer is the image's own label tehas.rukas.images, written by sandbox/build.sh from the base it builds on. The comment on the issue says whether the cycle was shown them, which is what the label answers; an image that carries no label is not claimed either way. The reader is in pi-rukas's source since upstream merged it on 2026-10-14. The host follows upstream's newest release, and every release since then reads them; an image put back from before then does not, and a host with the setting on and that image holds every issue that links one. tehas plan gives them to a planning session the same way. What reaches a cycle, a planning session and the Protolab is in Attachments |
Covered by the shell tests and pi-rukas's own. Seen on 2026-10-13: a real attachment fetched, and Pi carrying a screenshot to the model on a model host, which read it correctly. Not proven: no cycle has used a picture, and no sandbox build carrying the label has been seen on a host |
| No resources | The dispatcher asks the model endpoint at every poll. While it does not answer, offers no models or does not offer the configured model, nothing starts: tehas status and /health say warn with No resources, the dashboard and the factory floor say so, and the log has the hold once |
Covered by the shell tests; not yet seen on a host |
| Operating manual | This site, Markdown rendered by the docs server with no build step | Verified |
Host management
| Feature | Detail | Status |
|---|---|---|
| Configuration from git | ./install.sh copies this repository's files into place and keeps the previous version; --check reports drift |
Verified |
| A factory machine | What a machine of its own needs (systemd and linger, its own Docker daemon, its own published ports, ~/.config/tehas/env, its own TEHAS_DOMAIN, the model gateway's baseUrl and key, TEHAS_ENERGY_URL behind a gateway) is one list, on The host, read by a person and by a program alike. See The factory API |
The list is written; one factory has been built from it |
| Host update in one step | tehas update fast-forwards the platform checkout, runs install.sh, then its follow-ups; nothing new is added, and a step that did not run stays owed until it has. A checkout on a branch other than origin's default is not updated |
Seen on the tehas-tehas host, 2026-10-15, run over ssh by scripts/tag-deploy.sh for v0.7.7: it installed the files, rebuilt the sandbox image and recreated the docs server and the edge router, and install.sh --check then printed all OK. A step left owed by a failed run, and the refusal of a branch other than the default, are covered by the tests only |
| Cycle token proven at update | A real tehas update and install.sh --check make a dry-run push from the product checkout with the app's cycle token; a refusal names the app's login and git's words, exits 1 and leaves a drained factory drained |
Tested by console/tests/update_push.rs and test/install_fresh_test.sh. Not yet seen on a host |
| Pinned tools move with the release | Before it tags, scripts/tag-release.sh moves every pin in host/versions.env and the npm trees beside it to the newest minor and patch of its major, with its checksum, digest or lockfile, in a pull request it opens; a later major is listed under "Held back" in CHANGELOG.md. The kit's Solid moves the same way within 2.x, with its tarball and integrity from npm, a release whose Solid dependencies the other pins do not meet kept back, and the bundle rebuilt by tools/vendor-solid. See Tools |
Covered by the shell tests and the console's tests, with every source stubbed. scripts/pins.sh check and move were run once against the real sources, 2026-11-05, on a scratch tree; no release has made the move yet. Solid: covered by the console's tests with npm and tools/vendor-solid stubbed; console pins check was run once against npm on 2026-11-21, on a scratch tree, and found no newer 2.x; no move of Solid has been made |
| Releases | scripts/tag-release.sh runs the gate on the head of the default branch and tags it as the next vX.Y.Z; scripts/tag-deploy.sh runs tehas update on a host over ssh when that tag is the branch head, and checks the host's checkout is at it. The tag script refuses a commit whose CHANGELOG.md has no Adopter action for the release, and a pushed tag runs .github/workflows/release.yml: it builds the nine programs, the two of outsource among them, packs the tarball with the commit it was built from, signs it with minisign, checks the signature and publishes the GitHub Release |
Tagging seen once, 2026-10-15: v0.7.7 tagged after the gate passed and deployed to the tehas-tehas host. The Adopter action check is covered by the shell tests. The release workflow ran once, 2026-10-21: v0.9.0 was built, signed and published, and its tarball, .sha256, signature and installer were checked from the public download addresses against host/release/minisign.pub. That run was on a self-hosted runner; the release job on a GitHub-hosted runner has not run yet |
| The speed lane | .github/workflows/release-gate.yml gates one commit on a [self-hosted, speedlane] runner: the whole gate and the sandbox images built by host/sandbox/build.sh, with a smoke run. scripts/tag-release.sh tags on a green run on that exact commit, starting one when there is none; a batch titled Express Lane runs verify there. See The speed lane |
Covered by the console's tests and the shell tests, with gh stubbed. No speedlane runner is registered yet, so the workflow has not run |
| Advisory check on the locked dependencies | .github/workflows/verify.yml scans console/Cargo.lock and the npm lockfiles under host/npm/ and host/sandbox/npm/ against the OSV database with OSV-Scanner, pinned in host/versions.env with the checksum its own release publishes, and fails on a known advisory. It is the one part of the gate that reaches the network for its answers: a scan that cannot reach the advisory database fails the run rather than reporting nothing. An advisory carried on purpose is named in osv-scanner.toml with its id, its reason and the date to look again; the ignore stops applying on that date. See The gates |
test/advisories_test.sh checks the pin, the shape of the step and what an ignore must say; it does not run the scanner. The scanner was run against these lockfiles on 2026-11-09: nothing found with the ignore, one finding without it, and a failed run when the advisory database could not be reached. CI was seen to fail on it the same way on 2026-11-10, on the closed pull request #1833, which carried the change without the ignore and was not merged: the step checked the pinned binary against its published checksum, scanned all five lockfiles and failed on RUSTSEC-2026-0459 with exit 1 in 28 s |
| Polyfills of pi-rukas features | A feature pi-rukas has not released yet, with an upstream issue and pull request, can be carried in tehas as lib/polyfill-<feature>.sh, used only while the image's --capabilities lacks it; scripts/tag-release.sh removes the ones the newest pi-rukas no longer needs in a pull request before it tags. See Tools |
Covered by the shell tests. No polyfill is carried yet, so no release has removed one |
| Update by release | tehas update and tehas update --to vX.Y.Z download a release, check its .sha256 and its minisign signature with the key built into tehas, from the repository built into tehas or the one TEHAS_RELEASE_REPO names (never from versions.env or a key file on the host), unpack it into ~/tehas/versions/<version>, check the instance against that version's rules, then point ~/tehas/current at it and install from there; --check prints the notes between with their Adopter action. The image each version ran with keeps a tag, and the last three versions stay. TEHAS_UPDATE_FROM chooses releases or the checkout |
Covered by the tests (console/tests/update_release.rs, console/tests/update_from_030.rs for a home a v0.30.x install left, and console/tests/update_from_032.rs for a home a v0.32.0 install left). Seen on a host on 2026-11-19 as a version change only: a lab factory managed by an industry moved from v0.30.6 to v0.32.0 and then to v1.0.0-beta.7, and its /health reports versions.platform.release v1.0.0-beta.7 at bba574d2. The industry moved it; which path it took was not recorded, so the .sha256, signature and instance checks and the current switch were not seen. No cycle has run there on the beta yet. Not yet seen on a host: an update to a release candidate or to this release, an update from v0.31.x, and an update from v0.30.x straight to a release candidate. Seen before, 2026-10-21: tehas-tehas moved from its checkout to v0.9.0 with TEHAS_UPDATE_FROM=release; the download was checked against its .sha256 and signature and unpacked in ~/tehas/versions/v0.9.0, current was switched and the sandbox image tagged release-v0.9.0. A rollback with --to has not been run. The console has done this since v0.21: that code has run only in the tests, and no run of it from one release to the next has been recorded on a host |
| A cycle keeps its code | [email protected] runs tehas-cycle run, which hardlinks ~/tehas/bin, libexec and lib into ~/tehas/run/cycle-<issue>-<pid>/ and runs the cycle from there, so an update while it runs leaves its code as it started; A planning turn runs from a copy of its own the same way. An update therefore needs no drain The store and the analytics program are the installed ones |
Covered by the Rust tests of console/cycle and console/dispatch, test/units_test.sh. Seen on the tehas-tehas host, 2026-10-29: two cycles started on v0.16.1, each from its own copy in ~/tehas/run/, and kept running through the update to v0.16.2 at 16:03Z, which had no drain. One ended in a handoff at 16:45Z, the other in a merged pull request at 18:20Z |
| Installer | host/release/install, run as root, checks a release with the key it carries, runs that release's bootstrap.sh root <user> and places it as the user's ~/tehas/current |
Built, covered by the shell tests (test/release_install_test.sh). Seen once, 2026-11-07, on a new Ubuntu 26.04.1 VM with nothing of tehas on it (#670): install --version v0.25.3 --from <dir> boss with the three files gh release download fetched, since the repository is private. It installed minisign, said the tarball matched its .sha256 and its signature, ran bootstrap.sh root boss and left ~boss/tehas/current pointing at versions/v0.25.3. Exit 0 in 6 min 48 s. The download path without --from was not run |
| Lab build | install.sh --lab-build builds every program from a checkout with the marker TEHAS_LAB_BUILD=on and without debug assertions, so it reads TEHAS_TEST_FEATURES and none of the tests' other hooks, and a building feature can be switched on to prove it; a release tree is refused with 78. A lab build's stamp matches no other, so any plain run or release installs every program again. Health warns and tehas status prints a features line on a lab build whether the variable is set or not, and wherever it is set, and says so when the build does not read it. See Proving a building feature on a lab host |
Covered by the shell and Rust tests. A release-profile console built with TEHAS_LAB_BUILD=on was seen to read the variable and to warn in health with it unset, and one built with TEHAS_LAB_BUILD=off not to read it, with cargo building again when the marker changed, on a development machine. Not yet seen on a lab host |
| Install from a release tree | install.sh run from an unpacked release installs the console, analytics, MCP server and store the release carries instead of building them, and reads the commit from its COMMIT file |
Covered by the shell tests (test/install_release_test.sh). Seen once, 2026-10-21, as part of tehas-tehas's update to v0.9.0: the packed console, analytics program and MCP server were installed with no cargo |
| The state store's database | A real install.sh run, under the update lock, makes ~/tehas/state/tehas.db with store init, or migrates it with store migrate, which first copies it into state/backup/; state/ is kept 0700, and a store that fails stops the install. It holds state/dispatch.lock from before the first copy. The oldest store it migrates is v0.30.0's, at schema 12; an older one is refused before any file is copied (store migrate --dry-run, exit 78) with a line that says to update to a v0.30 release first. A poll that finds a record file of a tehas before the state store left in state/ stops with exit 78 before it calls GitHub, and says this release does not import it. See The host |
Covered by the shell tests (test/install_steps_test.sh, test/install_dispatch_lock_test.sh, with the real store where cargo is installed, and console/dispatch/tests/dispatch_guard.rs) and the store's tests, which migrate the stores the v0.30, v0.31.0 and v0.32.0 releases made. The migration from those releases to this one is not yet seen on a host. On 2026-11-19 a lab factory came up on a v0.30.6 store after a move to v1.0.0-beta.7 (see Update by release); the migration itself was not watched |
| Records in the state store | The cycle's start, approval, image, settings, end and history, the park and its question, the quiet-cycle episode and the planning session are rows in ~/tehas/state/tehas.db, written and read through the store. What stays a file is a signal between two processes, a container's input or output, a lock, or the ledger of refined issues |
Tested, not seen on a host |
| Instance settings | Everything that differs between instances is in one directory; no script names a product or a host | Covered by the shell tests |
| Model named once | The session model is PI_ENSEMBLE_SUBAGENT_MODEL under _PROVIDER; the product's .pi/settings.json is optional and wins when it names one. A models.json entry needs only its id, the rest is filled at install |
Covered by the shell tests, not yet seen on a host |
| First install | install.sh puts the env.sh line at the top of ~/.bashrc once and reports it in --check; a first install makes the labels and enables the dispatch timer and path, and the optional units whose setting is on; tehas work keeps pi-rukas's state files out of git in the clone |
Covered by the shell tests, not yet seen on a host |
| Sandbox image shared between instance users | The recipe of the image ends at a FROM shared stage, so the layers up to the uid remap are the content every instance user of one daemon builds from: the remap, the read of the model as the cycle's user, the browser install and the tool gate are the steps built per uid. sandbox/build.sh stages the copy docker is handed from the tracked recipe and hands docker that one file. See What two instance users of one host share |
Tested, not yet seen on a host: test/build_test.sh pins the stages, the boundary, the single read of the uid and that no step above the boundary holds the id the remap moves. The two measurements that would prove the sharing are owed: docker history of two uid images on one daemon showing the same layer ids down to the remap, and the wall time of a second uid's build beside the first's |
| Lean sandbox base | sandbox/build.sh builds the base from sandbox/base.Dockerfile and the host's pi-rukas clone at the commit followed, with the user at the tehas uid from the first layer, then the sandbox image on it; Playwright brings only its headless shell. The base is per uid, so the sharing of the row above holds only between users of one uid |
Built by hand on a factory host on pi-rukas 686ed28 (base 2.39G, image 5.57G against 11.5G, every sandbox: check passing) and on a development machine on v0.14.54 for uid 1000 (base 1.66G, image 3.83G, tehas-cycle sandbox smoke-run answered started). Not seen: a work cycle on it, a factory host building it with tehas update |
| The cleaner | tehasbot clean, from tehas-clean.timer every hour, removes what has not been used for TEHAS_CLEAN_AFTER hours (24 by default): the build output named by TEHAS_CLEAN_DIRS anywhere in a kept workspace and the cycle's copy of the code index, with the issue's lock held and no symlink followed; Docker's build cache of that age, which is the whole host daemon's; old files under ~/tehas/tmp/dl, ~/tehas/tmp/node-compile-cache, old ~/tehas/tmp/analytics-facts.* files and old ~/tehas/tmp/health.* reports a health run killed by the poll's bound left, old ~/tehas/tmp/tehas-test.* directories, and the copy of the sandbox recipe (~/tehas/sandbox/sandbox-uid.Dockerfile) or its temporary, of that age, that a build killed before its cleanup ran left behind; the sandbox image's dated tags before the newest two builds, whatever their age, keeping any a container or a uid tag holds; and the upstream base image of that age a host pulled before the base was built on the host, removed by its own name with docker rmi so no other image is offered, the untagged images of the daemon among them. Sources, .git, uncommitted changes, memory and sessions stay; no volume and no image a container was made from is removed, and preview images are tehasbot preview's. The cargo build output a manual session keeps in ~/tehas/dev/<name>.state/target goes too, only when the disk is under TEHAS_CLEAN_MIN_FREE, only once it has gone untouched for TEHAS_CLEAN_AFTER hours, and only of a clone no session holds - the lock tehas dev keeps for the whole session, state/dev/<name>.lock, and the container name tehas-dev-<name> are both asked, and a docker that will not answer keeps the build; nothing else under <name>.state is ever named. install.sh copies the timer, a person enables it. The unit's second step runs console disk --publish after the clean, failed or not, so live/disk.json - the file factory_disk reads - is under an hour old on a host that runs the timer; a reading that could not be written fails the unit and is seen in the journal, and the step writes nothing of clean.log. One line per removal and the bytes freed go to ~/tehas/logs/clean.log, and the same lines are printed, so a timer run that wrote nothing there is read in journalctl --user -u tehas-clean; --dry-run removes nothing |
Covered by the shell tests. Seen on tehas-tehas from 2026-10-30 to 2026-11-02, on v0.19.0 to v0.20.1: clean.log has 34 lines build output of a cycle that ended, 25.7 GB in all, and on 2026-11-02, with no cycle running, no target was left in the 23 kept workspaces, stopped cycles #1014, #1203 and #1269 among them. A cycle's tree at its end was 854 to 896 MB in 20 of the 30 lines after the dev profile's change, against 2.7 GB before; 8 were under 300 MB and 2, both in a .worktrees tree, 1.09 and 1.15 GB. Not checked on a host: what a running cycle holds, sampled during the run, and the cleaner's other removals |
| Setup in one command | tehas setup asks for the repository, the labellers, the GitHub App (made in the browser with --new-app, or one you have with --app-id and --app-key-file) and the model endpoint; checks the endpoint offers the model and the app is installed on the repository with the rights it needs; writes instance.env with the required settings and the app's ID, models.json and the secrets at mode 600; sets the bot's git identity, makes the control issue and the labels, clones the product or fast-forwards the checkout it finds, installs, builds the sandbox (again when it is behind the pi-rukas the host follows), runs the gates where tehas check-product is installed, enables the dispatcher and prints the dashboard. A second run changes nothing; a differing setting needs --force |
Covered by the shell tests (test/setup_test.sh), not yet seen on a host. Tried 2026-11-07 on the VM of #670 and stopped before it wrote anything: with no key file and no token it exits 78 (no token), which is right. The run needs the App's key and a key for the model endpoint |
| Example instance | instances/example/instance.env holds the required settings only; optional.env beside it lists the optional ones with their defaults and what each turns on. A new project describes the release install: the installer, tehas setup, tehas init-product, a label |
Written. Not proven: no new project has followed it from a published release |
| Host bootstrap | bootstrap.sh installs every tool at a pinned version and checks the result. sudo ./bootstrap.sh root <user> is one command: it makes the user if missing, sets Docker's systemd cgroup driver in daemon.json when it is missing, installs the slice and runs the user part as that user, with no logout |
Check and a second run verified. A run from scratch was seen once, 2026-11-07, through the installer on a new Ubuntu 26.04.1 VM (#670): bootstrap.sh root boss made the user, installed the packages and Docker, put boss in docker, turned lingering on, installed the slice and ran the user part with no logout; bootstrap.sh check then exited 0 |
| The slice on the host | sudo ./bootstrap.sh slice installs /etc/systemd/system/tehas.slice, one systemd slice with MemoryMax=75%, and bootstrap.sh check and install.sh --check say whether it is in place. Every sandbox container runs in it (see Shared slice) |
Tested, not yet seen on a host |
| The slice follows memory added to a running host | Beside the slice, bootstrap.sh slice installs /etc/udev/rules.d/96-tehas-memory-online.rules, which starts tehas-slice-reload.service (a Type=oneshot running systemctl daemon-reload) when a memory block comes online, so the slice's MemoryMax=75% is worked out against the memory the host has now. Memory going offline needs nothing: the slice shrinks at the next reload, and the slice's MemoryMax is read from systemd on every poll and at every start. bootstrap.sh slice asks udevd to re-read its rules after writing the rule; bootstrap.sh check reports the rule and the unit beside the slice, by file, not whether the limit moved |
Tested in the shell tests; the reload has not been seen to follow memory on a host |
| Live resize of the host | The host is one virtual machine, so its CPUs and memory follow the hypervisor's own commands while it runs: <vcpu current='N'>MAX</vcpu> and a virtio-mem device set the maximum once, and virsh setvcpus --live and virsh update-memory-device --requested-size change what is under it with no restart. tehas.slice takes MemoryMax=75% and each container's ceiling is read as it starts, so nothing in tehas is told the new size and the cycles that start next get it. A host that is not a virtual machine under libvirt has no hypervisor, so nothing here applies to it. See Resize or restart the host |
Written, not proven: the page is written from the libvirt commands and from the two facts of tehas it rests on, that the slice's limit is a percentage and that a container's limits are read when it starts. No resize of a tehas host's VM has been seen, live or otherwise |
| A hypervisor restart with the cycles running | libvirt-guests with ON_SHUTDOWN=suspend saves the virtual machine to disk with its containers and their cycles in it and brings it back at boot, so the factory is not drained first; the save directory is sized for the guest's memory and the clock is synced after the restore with virsh domtime --sync. A model request open at the save fails and is retried, as it is after any provider failure. A host that is not a virtual machine under libvirt has no hypervisor, so nothing here applies to it. See Resize or restart the host |
Written, not proven: no save of a running factory's VM has been seen, so what it costs an in-flight model request, how long a save of this host's memory takes and whether every cycle came back are all unwritten |
| Shared slice | A cycle, a planning turn, a tehas dev session and the indexer run in tehas.slice with a memory ceiling of the slice over TEHAS_SLICE_CONTAINERS (a quarter by default), no swap, TEHAS_CYCLE_RESERVE as a floor, a CPU quota of the host's CPUs less one, a pids limit that follows each cycle's share of that (the cycles side by side counted at most TEHAS_SLICE_CONTAINERS) and a CPU weight, all with an init. The indexer runs there with an init too. A cycle, a planning turn, a session and the push check are given the security options of What a container may not do as well; the indexer is not. Without a usable slice each command stops with exit 78 before a clone, a GitHub call or a container. tehas dev says how much room the slice has |
Tested, not yet seen on a host |
| A killed container | A container that ends with 137 while its cycle was running is reported as killed and the issue is parked, or handed off with its pull request when one is open. It goes on record with the cap container-killed and a capReason that names the exit status, the step in flight and the number of processes killed for memory in the container; console.txt and err.txt end with a line that says the same. The pull request is found by the branch the run log names after commit-pr, as a step or in a later event's branch field |
Tested, not yet seen on a host |
| A runner that died | A cycle whose result file holds nothing is still reported. Its last step is read from the step-started lines of its own run log and said as such; of a log longer than the 200 KB tehas reads only its end is read, and what came before it is unknown; its branch is the step right after the last commit-pr, and GitHub is asked for the bot's pull request of it. With one found and the whole log read the comment is a handoff whose review did not finish, with the pull request named and no box for a clean retry; with none, or of a log read only from its end, the cycle is parked as any other that left no pull request. The comment names the runner's own exit, which tehas work records in state/cycles/<issue>.runner_exit |
Covered by the shell tests, not yet seen on a host |
| Ending a cycle by hand | tehas stop <issue> [--keep-workspace] stops tehas-cycle@<issue>.service, waits for its lock, removes the container tehas-work-<issue>, the workspace and the files that say a cycle runs or owes something, takes the park's question off the record and spends its retry, and keeps the cycle's record and its logs. Nothing is removed under a cycle that still holds its lock. When it cleared something on this host and nothing of that failed, it takes tehas:running off the issue as its last step, and adds no other label |
Covered by the shell tests; not yet seen on a host |
| Read-only instance | Optional, TEHAS_READ_ONLY=on. The host's gh shim refuses every write and says it, a cycle's container pushes into its own workspace and its gh refuses writes, the dispatcher keeps its starts on the host, and tehas status --json and the dashboard say read-only |
Covered by the shell tests, the dispatcher's fixtures and a test of the container's git, not yet seen on a host |
| Read-only source | The host clones this repository with a read-only deploy key; the bot has no access to it | Verified |
| Millwright's grant | Optional. The dispatcher takes tehas:ready from the millwright, which is the bot, only on an issue a person approved before, its title and body unchanged since, at most TEHAS_MILLWRIGHT_MAX_RETRIES times. With TEHAS_MILLWRIGHT_FEED=on it also starts the first cycle of an issue an allowed labeller wrote, its text unchanged since, at most TEHAS_MILLWRIGHT_MAX_FEEDS at once (the feed: covered by the dispatcher's fixtures, not yet seen on a host). With TEHAS_MILLWRIGHT_EPICS=on a person's tehas:ready on an epic approves its open sub-issues: the millwright's tehas:ready or tehas:plan on one stands on that person's approval, recorded as their label (covered by the dispatcher's fixtures, not yet seen on a host); the millwright's comment reaches the cycle in comments.json. A planning question takes the millwright's tick or marked reply when no person answered it, in a session a person started, at most TEHAS_MILLWRIGHT_MAX_PLAN_ANSWERS times and never two turns in a row, never to end the session. Each cycle's end leaves a line of history in the state store, the last 50 of each issue. What decides as the millwright is not part of tehas |
Covered by the shell tests. Not yet seen on a host |
| Refreshes | Asked for one pull request at a time: tehas refresh --pr N (or tehasbot refresh, its old name) writes a request for one of the bot's pull requests that conflicts with the branch, of an issue that waits for a merge or was handed off. No timed scan looks for them. The dispatcher starts a cycle, in a lane of TEHAS_REFRESH_SLOTS (1) apart from the cycle slots, on the approving person's word that merges the branch in and pushes to the same pull request, marked tehas:refreshing while it runs, at most TEHAS_REFRESH_MAX_PER_PR times and never after a parked refresh. Needs a sandbox image whose pi-rukas takes --continue-pr (pi-rukas#1468). tehas refresh --pr N --json says what it asked as one object |
Covered by the shell tests. On tehas-tehas the timed scan of earlier versions ran and found conflicts, but no refresh cycle had run by 2026-10-20: the starts seen then could not put tehas:refreshing on the pull request and started nothing. The --json object is covered by the Rust and shell tests, not yet seen on a host. The name tehas refresh, and its reading through ~/tehas/shim with no login PATH, are covered by the Rust and shell tests, not yet seen on a host |
| Ordering the queue | tehas order sets the order ready issues start in: the issues it names that are ready, in that order, then refreshes, then the other ready issues lowest number first. With --only a ready issue it does not name waits. An order that expired or cannot be read is no order, and with no order ready issues start lowest number first. It only sorts: an issue starts only on an allowed account's tehas:ready or tehas:blocked. A person can set one by hand with no expiry, and a host program can set one on every poll. An open native blocked-by link holds any issue until its blockers close, and never starts one; tehas:blocked holds one while an issue its marked comment names is open, and on its own starts the issue once they are all closed. Both count from an allowed labeller or the millwright (a lone tehas:blocked starts work only from an allowed labeller), and a hold that cannot be read waits. The marked comment keeps working for one release beside the links. |
Covered by the shell tests and the dispatcher's fixtures, not yet seen on a host. tehas order: covered by the tests and the dispatcher's fixtures, not yet seen on a host. |
| Starting from the host | tehas start N approves issue N on the host, as an approval of its own kind (host) in the state store, given by no GitHub account. The next poll starts it under the rules a label's start passes: slots, the limit, a pause, blockers, an open pull request, a park and the start order. A title or text changed since starts nothing until it is approved again; --clear takes back an approval no cycle used. The start comment, tehas history and tehas status say the cycle was started from the host, and the millwright's retries and finish asks rest on it as on a label |
Covered by the store's tests, the dispatcher's fixtures and a shell test of the command, not yet seen on a host |
| Product wiki | wiki, a feature still being built: a release refuses TEHAS_WIKI=on with 78, lists wiki in flags as false, does not install tehas-wiki-status.service or its timer, tehas wiki exits 78 and tehasbot wiki exits 0 and writes nothing. A wiki of the product, built by the model from its code, its version tags and its commit history and shown at /wiki (the spec). Built so far: the state of a build, read from ~/tehas/wiki/current/build.json and the product checkout: its id (its date and the first eight hex of its commit), and how far it is behind main, the commits since its commit and the age, in days or from 60 days in months. tehas wiki [--json] prints it and tehasbot wiki, every five minutes, writes it to ~/tehas/live/wiki.json. tehas wiki build [--full], tehas-wiki.path and the nightly tehas-wiki.timer start tehasbot wiki build: pi-rukas's wiki verb in a container with the code and the raw sources read-only and no token, then on the host the checks of the schema, the render to HTML with any HTML shown as text, and the move into place, keeping the last ten builds and the last of each release; a failed build leaves the current one served. The page /wiki shows it, with a link to the build at /wiki/<id>/, which the docs server serves from ~/tehas/wiki/ with no script and a strict content security policy; the dashboard links the current build. /wiki and its builds answer 404 while there is no live/wiki.json. pi-rukas has the wiki verb from v0.14.99 (trail-openers/pi-rukas#2459); no build has run on a host yet |
Still being built: covered by the Rust tests, with fixture repositories for the count and the age, by node tests of the page's and the link's models, by Rust tests of the build with a writer standing in for the model, and by the pinned argument list of the build's container. Not seen on a host |
| Review loop | review, a feature still being built: a release refuses TEHAS_REVIEW=on and a TEHAS_REVIEW_REPO line with 78, lists review in flags as false, does not install tehas-review.service or tehas-review.timer, and tehasbot review exits 0 at once. With the feature on: once a week tehasbot review runs pi-rukas's six lens reviewers headless over the default branch since the commit the last review read, in a container with no token, and files the findings of a run as one issue labelled tehas:improvement in TEHAS_REVIEW_REPO for a person to triage; loading refuses the product. Only the exits that mean the reviewer answered move the record on, so a run that failed reads the same commits again. With the setting off it exits 0 at once and calls nothing. See the review loop |
Still being built. Never seen on a host: covered by the shell tests with the runner and GitHub stubbed, and by the store's tests for what the issue says. No run has been seen on a host, so it became building for 1.0 (decided 2026-11-19) |
| Plugins | plugins, a feature still being built: a release refuses TEHAS_PLUGIN=on, and a line of TEHAS_PLUGINS, TEHAS_PLUGIN_GRANTS_<NAME>, TEHAS_PLUGIN_ACCESS, TEHAS_PLUGIN_LIMITS, TEHAS_PLUGIN_MODEL_DAY or TEHAS_PLUGIN_GATE_ADDR, with 78, lists plugins in flags as false, and tehas plugin exits 78. A plugin is a program from a git repository pinned by commit, with grants for that commit. Built so far: the settings' rules at load (the pins, at most 4; each grants line for a plugin of the pins, its grants from the list of v1, skill:<id> and needs:<name>, a grant of a later version refused naming it; view or action: refused without TEHAS_DOMAIN or TEHAS_PLUGIN_ACCESS), the reader of a plugin's manifest tehas-plugin.json with api/plugin-manifest.schema.json, a plugin with no build being text alone (skills for the chats, no runs) and the check of a skill's text, a manifest's views (at most four, each its own folder of /out with view:<id> granted, opened in the dock or a page; a path belongs to the view with the longest folder that holds it, and is 404 unless that view is granted; with menu granted, tehas update lists a plugin's granted views in live/plugins.json in place of its panel, and both front pages show them in the menu under the plugin's label), a manifest's needs (at most two other plugins and the skills it wants from each) and the rule that orders and refuses plugins by their needs, with the condition that the chat hosts' enforcement of a granted skill (its label and the rule on proposals it shaped) merges before plugins are promoted, a cycle given the files of a plugin's record a labeller filed in its issue, checked by GitHub id and by their sha256 (tehas work), the rules of a drafted issue (its title, body and record, the tehas-files: line a filed body carries, and which records a removed plugin keeps while an open issue links them), with nothing calling them yet and issue:draft still refused, tehas plugin [--json], which lists each plugin with the state tehas update left (unbuilt, building, ready, refused with why), its image id, its manifest's sha256 and its base images, the fetch and the build at tehas update (the pin into ~/tehas/plugins/<name>/repo.git over https only, the manifest, skills and Dockerfile checked, base images pulled by digest and refused with an ONBUILD trigger, the image built from git archive with BuildKit and no network; a refused plugin skipped and the update exiting 1; a plugin taken out losing its images and directory), tehas plugin review with api/plugin-review.schema.json, and the state store's plugin_runs table, schema 19, the model socket of a run in console/plugin: chat completions for one model id, its fields checked, each request's tokens held against the run's grant and TEHAS_PLUGIN_MODEL_DAY before it is sent through curl, one at a time; with model:images granted, a request may also carry up to four PNG, JPEG or WebP images of at most 4 MiB each, only as data: URLs, checked by their first bytes, in a body of at most 20 MiB, each image held as 2000 tokens rather than by its bytes until the answer's usage settles it, and the runner tehas-plugin with its units: tehas plugin run, hook and log, [email protected] and [email protected] for a run, and tehas-plugin.timer, whose tehasbot plugin tick asks for a refresh when the default branch moved, not while the factory is held back. A run takes its lock, begins a row of plugin_runs, clones the product's mirror at its head, serves the model socket to a refresh (a hook gets none), runs the container by the pure function's arguments, kills it at its timeout, keeps the last 1 MiB of its log, reads /out through the tar reader into the view (with view or a view:<id> granted, marked with the commit it ran at, which the gate serves only at the pin and tehas update removes when the pin moves) or a hook's verdict (api/plugin-verdict.schema.json), measures the volumes against disk, removes the container and its files and ends the row. tehas plugin call runs one call of a granted tool: its arguments checked against the tool's params, two calls of a plugin and one of a caller at once, the container attached with a cap of 16 KiB on its answer and killed at the tool's timeout, one JSON object back, a row of kind call with the answer's size and no login (plugin_runs at schema 23), and --login checked against TEHAS_PLUGIN_ACCESS by GitHub user id with the gate's own check, on every call. install.sh installs the program and the units only while the feature is on. The gate of the views, tehas-plugin-gate, a program of its own that install.sh builds and installs with its unit tehas-plugin-gate.service (tehasbot plugin-gate) only while the feature is on, and to which the edge router sends every plugin-* and plugins name first, with texts of its own for a name no plugin has and for the gate down, answers only the names plugin-<name>.<domain> and plugins.<domain>, with the gate's headers on every answer, a plugin's kept files at /_frame/ under a fixed policy that sandboxes them with no script and lets only the plugin's own view frame them (no plugin keeps files yet), the rules on requests from another site, normalised paths, the GitHub sign-in through the App's web flow with a one-use code for each name, the person's permission on TEHAS_REPO checked by user id every 10 minutes and on each press, sessions in memory of 2 hours unused and 12 in all, a policy for each page with the hashes of its inline blocks, the kit, /_actions and a hook's kept findings. The seam in tehas-cycle: after its report, a cycle not stopped by a signal nor refused at its start that left an open pull request of the bot's writes a hook request for each plugin granted hook:after:work and ready, and starts its unit without waiting. A hook's end posts one commit status on the head it read (tehas/plugin/<name>, success for pass and note, error for a hook that did not finish, the summary cleaned and cut at 140 characters, a link to /_hooks/<pr> with view, where the gate shows the head the hook read and its findings or that it did not finish), keeps a 403 for tehas plugin to say, and asks again for a head that moved. A hook takes its request before it runs, so one asked meanwhile runs next, and reads the plugin again before each run: one no longer ready or granted runs and posts nothing. The tick removes the verdicts of pull requests merged or left for 30 days |
Still being built: covered by the Rust tests of the settings' rules and the load, of the manifest's reader against its schema and samples, of tehas plugin and review against their samples, of the fetch, the build and the update's step with git and docker stubbed, of the store's migrations to 19 and 23 and its run verbs, of a call with docker stubbed and of the attached run with plain processes, of the model socket against a stub endpoint, of the runner, its commands and the tick with docker, git, systemd and the store stubbed, of the gate with GitHub stubbed, and of the seam's choice of plugins, the status and the removal of verdicts with GitHub, git and systemd stubbed. tehas setup keeps the GitHub App's client id and secret for the sign-in (from --new-app, whose manifest names the callback when there is a domain, or from --app-client-id and --app-secret-file), and tehas update docks each ready view granted as the panel p-<name>, an id tehas panel set refuses: covered by the Rust tests of setup, the panels and the update's step. The router's routes for the plugins' names are pinned by test/edge_test.sh and were run in its pinned Caddy with a stand-in gate on a development machine. The reference plugin's driver made a first map with the factory's model on 2026-11-21, run by hand and not in a plugin's container. No plugin has been fetched, built or run on a host, and the container, the gate and the hook have not run on one |
| Protolab zip by address | Still being built: a release refuses TEHAS_PROTOLAB_ZIP_URL=on with 78 and lists protolab-zip-url in flags as false. With the feature on, a ticket at the prototype stage names a zip with a line Zip: <address> sha256:<64 hex digits> from an allowed account: a file attached on GitHub, or an https address on a host of TEHAS_PROTOLAB_ZIP_HOSTS, empty by default. Redirects are followed only on those hosts, bytes of another sha256 are refused, and the zip is unpacked as an attached one under the same 10 MB and 40 files. See a zip by address |
Still being built, planned for 1.1: covered by the Rust tests of the address rule, the redirect walk and the line, and by the shell tests of the pass with curl stubbed. Not seen on a host |
| Filing a prototype | Still being built: a release refuses TEHAS_PROTOTYPE_FILE=on with 78 and lists prototype-file in flags as false, and tehas prototype file exits 78. With the feature on, it opens an issue with the ticket text, a Zip: line and a Spec: <link> sha256:<hex> line when given, and puts tehas:prototype on it (or the issue type of TEHAS_ISSUE_TYPES), every call with the caller's own gh login. A gh signed in as the bot or another app, or as a login off TEHAS_ALLOWED_LABELERS, is refused with 3 before anything is written. A zip outside GitHub needs protolab-zip-url on. See tehas prototype file |
Still being built, planned for 1.1: covered by the Rust tests of the arguments, the text and the refusals, and by the shell tests with gh stubbed. Not seen on a host |
| Outsource | Still being built: a release refuses TEHAS_OUTSOURCE=on with 78 and lists outsource in flags as false. When it ships it is optional, TEHAS_OUTSOURCE=on with the repositories of TEHAS_OUTSOURCE_REPOS. A contractor is another host that joined with a one-time invite code and holds no source, GitHub token or model key of this factory; it calls the factory and the factory never calls it. Built here: the feature's gate, the instance's settings, and the state of it in the store, which is five tables and the verbs that move a job through offered, running, stopping, finished, released and lost, one row of history for each change. A job that goes quiet past TEHAS_OUTSOURCE_TIMEOUT is lost after TEHAS_OUTSOURCE_GRACE more, a contractor that lost one rests for TEHAS_OUTSOURCE_REST seconds, and an issue takes TEHAS_OUTSOURCE_RETRIES losses before it runs in-house. The cycle supervisor takes a job waiter in place of tehas work (tehas-cycle cycle <issue> --runner job, refused with 78 unless the feature is on): it reports a cycle run elsewhere from the notes, run log and exit status the waiter leaves, as it reports one of its own, and reads no workspace and no image of this host. Built since: `tehas outsource invite |
list |
| Spec mark | Part of spec-pipe, a feature still being built: a release refuses TEHAS_SPEC_PIPE=on with 78 and lists spec-pipe in flags as false. With the feature on, an issue names the spec it is built to with one line of its body, Spec: <link> sha256:<64 hex digits>, where the link is a file attached on GitHub. A line outside a fenced code block that starts with Spec: and is not of that form, a link that is no attached file, or two such lines: the poll starts nothing, takes the label that asked off and says why once. A body with no such line starts as before. A start fetches the file, at most 1 MiB, and holds its bytes to the sha256 of the line before anything of the start changes, and its approval keeps the link and that sha256. Bytes of another sha256, a larger file or a link GitHub refuses with a 4xx start nothing, and what asked for the start is used up so the next poll does not pick it again; the issue says why once. A fetch that fails on the way, a 5xx among them, changes nothing, ends the poll with 1, and the next poll tries again. The cycle is given that spec, fetched again and held to the pin, and the approved title and body as approved.json, each named in the manifest of the issue's directory (spec and approvedText); a cycle with a spec starts only on a runner that lists issueSpec, which no pi-rukas release does yet. The spec entry names in block the version of the pull request spec block the cycle writes, and issueSpec means a runner writes it. Nothing writes the block yet. The cycle's report checks it: a handoff whose approval pins a spec waits for a merge only when its pull request's block names that sha256, and parks with the reason spec-block otherwise |
Still being built, planned for 1.1: covered by tests only, the Rust tests of the grammar (the issue's line and the pull request block), the pin, the handoff and the report's check of the block, and the Rust tests of the poll (console/dispatch/tests/dispatch_spec.rs) and the Rust tests of the start (console/cycle/tests/work_spec.rs). Not seen on a host |
| pi-rukas by compatible line | versions.env names the pi-rukas line this tehas works with, PI_RUKAS_FOLLOW=release:0 while pi-rukas is before 1.0, and a host installed from a checkout follows the newest tag of that line: a new pi-rukas arrives at the next tehas update, a new major version waits for a tehas change. A release pins: scripts/tag-release.sh resolves the tag's own PI_RUKAS_FOLLOW before and after the release gate, refuses to tag when it moved, and writes the commit in the tag; the release workflow packs it as PI_RUKAS_FOLLOW=commit:<sha>, the last line of the release's versions.env, so every install of that release gets the pi-rukas the gate built, and a tag that names none is not published. The status names the release a pinned commit is. An instance may set its own PI_RUKAS_FOLLOW in instance.env (release, release:<line>, branch:<name> or commit:<sha>, the last answered without asking upstream), and it picks the commit of both the sandbox image and the host's clone that bootstrap.sh user moves. The base is built on the host from that commit; PI_RUKAS_IMAGE_DIGEST no longer picks it. Tools by version; each build is also tagged by date for rollback. codebase-memory-mcp goes into the image at the version versions.env names, the one bootstrap.sh puts on the host, not the one the base image carried |
Covered by the shell tests: a digest of another shape is refused with 78 and no docker call, a line takes its newest tag and no newer line, a pinned commit asks upstream nothing, and the instance's value wins over versions.env, for the build and for bootstrap.sh user and check, which stop with 78 when the instance's settings do not load. Seen once, 2026-10-21: tehas update on tehas-tehas took release:0 to pi-rukas v0.14.2, the newest 0.x tag, and rebuilt the sandbox on it. The release pin is covered by the Rust and shell tests (the pack writes the commit alone, tag-release writes the gated commit in the tag and refuses one that moved, the workflow's pack step passes the tag's commit and stops without one). Seen 2026-11-20 in v1.1.0-beta.1, whose archive ends with PI_RUKAS_FOLLOW=commit:188a7a75… (v0.14.94), resolved then at pack time; not yet seen on a host. A pinned commit that no tag or branch upstream holds is fetched by its id: covered by a Rust test against a local upstream that serves it by id, and by the shell tests of the build and bootstrap; not yet seen against GitHub |
| Tools a cycle finds in the image | The image adds file and python3-pil to what the base carries, so a cycle can look at a picture instead of writing its own PNG decoder, and takes wigolo off PATH: the base installs it with npm's scripts off, which skips the native build of its better-sqlite3, so every call died on a missing bindings file. A step near the end of the build stops when a command a cycle's instructions name, or one libexec/ gives a container (pi, pi-rukas's headless runner, git, codebase-memory-mcp), is not in the image |
Seen on tehas-tehas: in the image built 2026-10-16, file is on PATH and wigolo is not, and cycles have run on it since. Not proven: python3-pil was not checked, and no build has been seen to refuse an image for a tool it was missing |
The example instance
The instance on the host tehas-tehas works on this repository, product
tehas-app/tehas, with the settings in instances/tehas-tehas/. Each row
is what was seen there or in the tests, with its date.
| Check | Result | Status |
|---|---|---|
| No product or host names in platform files | scripts/check-generic.sh passes. It is a lint against regressions, not proof |
Passing, 2026-10-08 |
| No script edits | Installed from instances/tehas-tehas/ with no file changed outside instances/. One local line (TEHAS_BRANCH) was added on the host, see below |
Verified, 2026-10-08 |
| Fresh install | 39 files on that date; the docs server and the dispatcher timer run, and nothing else was put on the host | Verified, 2026-10-08 |
| Invalid settings change nothing | install.sh and tehas dispatch exit 78 with an empty or incomplete instance; ~/tehas identical before and after |
Verified, 2026-10-08 |
| Gates in the sandbox image | The repository's own .pi/verify-cmd-full and .pi/smoke-cmd pass inside the image as the unprivileged user |
Verified, 2026-10-08 |
| What a cycle's container can reach | A GitHub token for the repository and the listed mounts; no Docker socket, no SSH keys, no ~/.config/tehas, not the platform checkout. The token was then a bot account's; a cycle now gets the GitHub App's narrowed cycle token, see Sandbox above |
Verified, 2026-10-08 |
| Dispatch | The timer picked up a labelled issue unattended, checked who labelled it, relabelled it, commented, passed the push check and started the cycle | Verified, 2026-10-08 |
| A cycle to a pull request | Issue 6 went from a label to pull request 13 in 61 minutes, unattended: explore, plan, develop, adversarial review, commit, lens review. The change (3 files, 172 lines, 13 new test cases) passes the full gate. It took five attempts; see below | Verified, 2026-10-09 |
| Host stays responsive during a cycle | Load 0.2 to 0.5 on 8 CPUs through a whole 61-minute cycle; the cycle's container at 5% of a CPU and about 200 MB | Verified, 2026-10-09 |
| Bootstrap | bootstrap.sh check passes and a second bootstrap.sh user changes nothing. The host itself was installed by hand before the script existed |
A run from scratch is not proven |
| Installing a factory unattended | bootstrap.sh then install.sh run with nothing on standard input, end by themselves, and change nothing when the machine is already installed; --check stays at 1 while a follow-up from an earlier run is owed and goes to 0 once it has run; a machine missing one model token stops at 78 naming it and installs nothing |
Covered by the shell tests (test/install_test.sh). Not proven: no run of the two commands in a system container nobody prepared by hand. That run is the first acceptance test of the program that manages factories, and what it finds is fixed here |
What the five attempts showed, none of it a fault of the instance's setup:
- A cycle needs two model conversations served at once. pi-rukas's
driving session takes turns of its own while a step's agent works. With one
free slot, or with other agents using the model, calls are refused
(
no free slot) and the cycle stops after three retries. Attempts 1 to 3 ended that way. The dispatcher only checks that the model is listed. - A renamed repository empties the queue without an error. Fixed: the dispatcher now checks the name at every poll.
- pi-rukas can lose a file an agent left uncommitted (reported upstream as
pi-rukas issue 1049). Attempt 4 did the work and failed its gate for that
reason. Attempt 5 passed after
AGENTS.mdtold agents to commit their own work. pi-rukas fixed it in v0.12.80, and the rule was dropped. - The pull request was opened against
main, not the branch the cycle started from, so its review read the whole difference between the two. The lens review ended incomplete and the issue carriesneeds-human-attentionnext totehas:awaiting-merge. On an instance whose work branch is the default branch this does not arise.
One cycle is one cycle. It used about 8.5 million tokens for a 172-line change.
The local line: a cycle starts from the product's default branch, and this
repository's contract files were on a work branch when the instance was set up.
TEHAS_BRANCH named that branch on the host until it was merged.
Not built
- Monitoring: availability probes, incident issues, weekly report.
- Electricity price command (#410). No command reads prices. A program that
runs the factory can hold starts back with
tehas limitand choose which ready issues start first withtehas order; nothing on the host does that by itself. - Model evaluation; every role uses the same model by default, by decision, not by measurement.
- Watching tehas itself: a failed refresh. A full disk is seen where previews are on, and stops previews only. A cycle that holds its lock and is not heard from for 20 minutes is stopped by the dispatcher; tested, not yet seen on a host.
- More than one project per host. See A new project.
- A private database copy per cycle or per preview.
Known limits
- One host, one project. Cycles that run side by side do not know of each other: two issues that touch the same files give conflicting pull requests.
- The cycle's container holds a GitHub token for its repository, so agent code
can do what that token can, and its network is open unless
TEHAS_EGRESS=on(tehas#51). The factory acts as a GitHub App, and the cycle's token reaches the product repository only and lasts an hour. Give each instance its own App. Turn on the egress limit to keep the container to GitHub, the registries and the model endpoints: see Where a container may connect. - The cycle's container holds the model key, as
$TEHAS_MODEL_KEY_<NAME>. Give the factory a key of its own, with its own spending limit, so that you can revoke it without stopping anything else. - The cycle's token can comment on any pull request of the repository, not only the one its cycle opens: pull requests take one write permission for both. Keep the factory on a repository whose pull requests it may write to.
- GitHub's bad minutes cost more than the step they hit (tehas#823). A poll
that cannot read the queue after its retries does nothing, and the next poll
tries again; one that cannot read the issues to plan starts nothing either
(tehas#1702). A cycle whose push or pull request failed on GitHub's side is
finished by a later poll, three tries within the hour. Its other last steps,
such as the handoff comment, are not tried again: read the run log, and use
tehas:finishfor a cycle left without its pull request. - tehas checks the issue's title and body against the approval when it starts a cycle, and the cycle then reads the issue from GitHub again. An edit made in between reaches the cycle. Until pi-rukas reads the text tehas hands over, let only people you trust edit the product's issues.
- The lean driver is still being built, and a host has not yet been seen to run it to a merged change. A release refuses it; it is planned for 1.1. See the lean rows above.
- The review loop is still being built: no run has been seen on a host. A
release refuses
TEHAS_REVIEW=on: see the review loop row above. - Files under
live/are for the dashboard, not for programs, and may change in any release. A program reads the commands'--jsoninstead: see the factory API. - A host is assumed to sit on a private network. The MCP server is not hardened for the open internet: reach it over the private network or through your own proxy with TLS, and give out keys only to clients you trust.
- A kept installation token is used until it runs out, up to an hour, after it
stops reaching the repository, for example when the App is taken off it.
tehas github checksays whether the token reaches the repository. - A pull request closed without merging leaves
tehas:awaiting-mergeon its issue until someone removes it. - A parked issue is held until its body changes or Retry is ticked, also when
the host caused the park (tehas#1742). A gate on the base branch killed for
memory can park as
verify-baseline-red, and the issue stays held after the base is green again. Read the run log; when the base was not red, tick Retry in the park comment. - Nothing deletes a branch a cycle pushed (tehas#1791). Each
feature/issue-<n>andfinish/issue-<n>stays on GitHub after its issue closes, and every product checkout fetches it. Turn on "Automatically delete head branches" in the repository's settings, and delete the branches of closed issues by hand. - The cleaner frees build output, Docker's build cache, host scratch, the
sandbox image's dated tags past the age except the newest and except any a
container or a
uidtag holds, and the pulled base image of that age, removed by its own name. No volume is removed, no image a container was made from, and no image that has lost its tag. - A preview is public, and it is built from a pull request nobody has reviewed yet. Only a branch in the product repository gets one, and only when an owner, member or collaborator opened the pull request. See Previews.