An agent distilled by evolution. Each teneral rebuilds itself around its owner's work, one measured generation at a time. What proves itself in one individual is offered back to the species, so a new clone starts from the distilled experience of every one before it, and then becomes its own. Built on RayforceDB.
Teneral is what entomologists call an insect that has just molted: the new body is there, but it has not hardened yet. Here it is a generation of the agent's code that was just switched on and has not yet proven it works.
The question behind it is whether an agent can get better by rewriting its harness, and where that stops helping. Read What it does not do yet before trusting it with anything.
One repository holds a whole individual, laid out as an organism, and three directories that belong to that one individual and are never committed.
stem/is its brainstem: the part that keeps it alive and that it does not steer. A small supervisor starts the agent, restarts it, and puts back the previous generation when a new one fails. Under it is the launcher, which starts a stem and goes back from one that does not work.immune/decides what becomes part of it: the gates every new generation must pass, your approval of a change outside the body, and the pinned archives it runs on, each verified by its hash.brain/is what the agent thinks and remembers with: how it calls the model (brain/provider.ts), its memory, which decides what of the journal is in mind for a request (brain/memory.ts), the turn itself (brain/loop.ts), and the prompt it is given with its soul (brain/prompt.md,brain/soul.ts). It remembers as it lives: the journal is cut into episodes, and while nothing is asked of it the agent forms a memory of each one that is over, in its own words, which later stands for that episode wherever the episode itself no longer fits in a request (brain/episodes.ts,brain/sleep.ts,brain/logbook.ts). It finds things in its own past by their words, opens the journal where something happened, and lists its life by episodes (brain/recall.ts,brain/past.ts); with RayforceDB pinned, the journal is laid out in tables inside the agent's own process, a partition a day, and a question costs about a millisecond (brain/ray.ts,brain/store.ts). The journal is part of the brain too:brain/journal.tsholds its form and the code that writes and reads it, for the agent and for the stem alike. That one file is not changed on the agent's word alone: it waits for your approval like a change to the stem, because a journal is never rewritten and never rolled back with the code.body/is what it acts and senses with: its tools, its sensors, andbody/main.ts, where the stem starts it. Nothing limits its size or the brain's: how much of itself the agent can hold in mind is the agent's to manage.heart/is what moves it when nothing is asked of it (heart/coordinator.ts). When a turn that did something ends, it asks once what the turn leaves behind: a step that can be taken now is queued and the agent is woken to take it, and what waits is recorded with what it waits for. Everything else that is the agent's own, forming memories, looking ahead, the clock's ticks, it keeps for rest, which begins when you have said nothing for a while (TENERAL_REST_MINUTES); while you are talking with the agent none of it runs. What arrives for the agent is checked before and after each of these, and a request of its own is given up for anything that calls for a turn./heartin the terminal asks for one pulse now. Brain, body and heart are the agent's own: it rewrites all three on its own word.species/is its kin: which line it descends from, and how it offers a change of its own back.keeper/is yours, not part of the organism: the terminal you talk to it in, the setup, and the commands by which you approve a change or send it back a generation.oneis how you address it:./one up,./one talk,./one approve. It is someone, and who that is, it writes itself. The script builds and runs its container; with theDockerfileand the launcher it is your install, and no mutation changes it.
The agent may change all of the code above. What it changes in its brain, body and heart it mutates into on its own word; anything else waits for your approval.
memory/journal.jsonlis the agent's history, append-only. Every event carries the commit of the code that wrote it, so generations can be compared.soul/holds a few Markdown files the agent writes about who it is and who it works with. They are part of every request to the model.inbox/is where other programs leave messages for it.
One commit of the agent's code is a generation. Asking the stem to switch to a new one is a mutation:
- The agent edits a second checkout of this repository,
.teneral/candidate, on the branchlineage/local. The code it is running is a third checkout,.teneral/live, which the stem resets to the exact commit before every start. - The agent calls its
mutatetool. The tool commits the candidate, journals the request, and the process exits with code 75 when the turn ends. - The stem checks the commit:
- compared with the running generation, a commit that changes only
body/,brain/,heart/, their tests (test/body/,test/brain/,test/heart/) andBACKLOG.mdgoes on at once. This is an allowlist: a commit that changes any other path, the stem's own files and any new file included, waits here for your approval and goes on when it has it; body/,brain/andheart/may hold only regular files;- every organ the commit pins (see Organs) is in the cache with exactly the pinned hash, unpacks safely, and passes its own check. A body that pins none skips this;
- what the commit takes from the npm registry (see Packages) is installed from its lock, with no package's script run. A body that takes nothing skips this;
- in a fresh checkout the stem makes of exactly that commit, the type check, the tests of everything outside the body (
test/stem,test/immune,test/species,test/keeper) and the agent's own tests, of its body, its brain and its heart, must pass. A test run counts only if it ends with bun's summary showing at least one passing test and no failures. The checks run with almost none of the stem's environment (onlyPATH,HOME,LANGandBUN_INSTALLare passed on), so code under test does not see the API key, and with a temp directory of their own inside that checkout, which goes when the checkout does; - last, the smoke run: in the same checkout the stem starts the candidate the way it starts a generation, on an empty throwaway install with one message waiting and a stand-in for the model that the stem serves on a local port. The stand-in speaks both wire protocols, and the candidate is run as the provider you configured, with a dummy key: never with your key or your sign-in. Its environment is the checks' with the variables a generation is started with added, the model's pointing at the stand-in and the clock off; nothing else from
.envis there. The candidate has 30 seconds to report that it is ready and to answer the message. Code that passes its tests but does not start, or starts and never takes a turn, stops here.
- compared with the running generation, a commit that changes only
- If a check fails, the same generation starts again and is told which check and what it printed. If all pass, the stem switches to the new commit and starts it.
- A new generation has 60 seconds to report that it is ready, and 10 minutes to produce its first reply: the note about its promotion is waiting for it, so a working one answers. If it exits abnormally before it is ready, or is not ready in time, or is alive but silent after those 10 minutes (being interrupted by you is not silence: see Interrupting), or later crashes three times in a row without producing a reply, or needs more than ten restarts, the stem returns to the generation before it and tells the agent why, with the end of what the failed generation wrote to stderr. There is one step back, not a history: if that generation fails too, or there is none because this is the first, the stem stops.
Around that:
- Only a generation that became ready may mutate, so the one kept for rollback is always one that started.
- The 10 minutes apply until a promoted generation's first reply and never after. An outage of the model does not roll back a generation that has already answered once. Neither does anything else: a generation that answers once and then stays alive without answering again is not caught, and you will only see it as silence in
./one talk../one backis for that. - A restart after a crash waits a second longer for each crash in a row. The ten restarts are given back when a run lasted an hour before it failed.
- A rejected mutation is followed by a wait as well. Asking for a different commit each time is ordinary work and is never limited. Asking for the same commit and having it rejected three times in a row stops the supervisor and leaves it to you.
- Every mutation request gets an answer. If the stem is stopped while the checks run (
./one down, Ctrl-C in./one fg), the running check is killed and the stem exits within a few seconds; at the next start the agent is told that nothing was decided and to ask again. The same happens when the agent's process dies between asking and exiting. - In the journal a request is
mutation.requestedand a refusal ismutation.rejected. An individual born before the act had this name wrote them asmolt.requestedandmolt.rejected, through a tool namedmolt. A journal is never rewritten, and such a body runs until it changes itself, so the stem and both talk clients read the old names as the new ones for good, and a request made under the old name is answered under it. - A lock file keeps a second supervisor from running the same checkout, and a body left behind by a supervisor that was killed is stopped before a new one starts.
The agent is woken by sensors, not only by you typing: your lines are one, a clock is another (every 30 minutes unless you change it, and silent until the soul is written), its inbox is a third, and it can build more. It runs in the background, so the clock and the inbox reach it whether or not a terminal is open.
An agent's journal outgrows its model within days. Most harnesses then cut the beginning off. A teneral remembers instead, and what it remembers can be measured.
Episodes. The journal is cut into episodes by rules, never by a model: a silence of more than half an hour before something new arrives, a new generation, or size. A tool call and its result are never on two sides of a cut. The same journal always gives the same episodes.
Remembering while idle. When nothing is asked of it, the agent takes the oldest episode that is over and has no memory, and asks its own model what it will remember of it. The request shows the journal only up to the end of that episode, so the memory is formed as of then. Only a whole answer in the form asked for becomes a memory; after a second try the stretch is recorded as one no memory could be formed of, and stays in the journal as it happened. An episode in which nothing happened is recorded as quiet without asking a model. A memory keeps apart what the agent lived and what it only read, and the journal's own count is kept of whose words the stretch was made of.
What a request shows. After the prompt and the soul come the memories of what no longer fits word for word, in order; then what the agent knows and means to do; then the recent conversation as it happened. The word-for-word part is held near TENERAL_TAIL_CHARS characters. Unless set, it is a quarter of what a request may hold for the model in use, between 100000 and 250000: everything in a request is read again at every step of a turn, so that number is most of what a step costs. In it, the output of a tool is whole only among the newest 40000 characters; an older one is shown by its beginning and its end, with the id under which the journal holds it. When the memories themselves outgrow their room, the oldest six become one memory of the whole stretch, formed from the episodes themselves and not from their memories; six of those become one in turn. So a request shows a life from its first day, more briefly the further back it lies.
Facts and intentions. With a memory the agent may set down facts that hold beyond the episode, and what it took on to do later. A fact is never changed: a later one names the fact it replaces, so what holds now is worked out and what was believed earlier can be read back. Each fact says where it comes from: the owner, the agent's own eyes, something read from outside, or its own conclusion. An intention stays in every request until a record says it was done.
An agenda of its own. Remembering looks back; this looks ahead (brain/agenda.ts). Once six more episodes are remembered and nothing is asked of it, the agent is shown what a turn would show it and asked what follows: what was left unfinished that nobody holds, what keeps coming back and could be dealt with once, what you would be glad to find done unasked, what it needs to ask you. What it sets down are intentions of its own. With what it took on for others these are its agenda, and a clock tick offers it in order: what is past its day, what was taken on, its own ideas; one thing in a tick, closed with a word on how it ended.
Questions, and whom they are for. A question the agent sets down is for whoever can answer it: you, one person, the people of some chat. Whom it is for and where to reach them the agent says in its own words, and by what way it asks is its own choice: the memory knows of no channel, and nothing about one is written into the seed. A question counts as asked once its mark stands in something the agent said or gave a tool. What got no answer is put again to the same people a day later, then three days after that, then seven; after that nobody is nagged, and it stays on your page. An answer from someone else closes the question and is kept as theirs, never as your word.
When it is not sure it may. An idea of its own is no permission, and no idea is lost for want of one. What the agent is not sure you would allow it neither does nor drops: the idea waits for your word, and the agent comes to you with it, where it judges you will see it. A yes is recorded with the words you said it with, which must stand in a message of yours that came after the idea was set down, and with where that message came from; then the idea joins the agenda. A no closes it with your reason. Nothing here is tied to the terminal: whose word a message is, its source says (fromOwner in brain/owned.ts). The terminal is one such source, and any sensor, one the agent builds next year included, is another once it names its source owner:<channel>, which it may do only for a message whose sender the channel vouches for and who is the one you said you are there. From then on your words there count as yours everywhere: in what allows an idea, in whose voice a memory is told, in what recall weighs. The same label inside a message from anyone else is shown as not yours. /memory shows each idea you allowed with the source of the yes. It also lists what waits for you and what the agent is asking of others, and the status line of ./one talk counts what waits for you (3 for you).
An answer is a rule. With a yes the agent records how far it goes, and with a no what you do not want, as widely as you said it and no wider. That is kept as a fact in your name, with the message it stands in, and what it covers is not asked about again. So the line between what the agent does by itself and what it asks about is drawn by your answers, and the questions grow fewer.
Initiative is measured. The memory has its exam; the agenda has a count, made from the journal with no model asked: of the agent's own ideas, how many were done, given up, are open; of those it asked about, how many got a yes and how many a no; of its questions, how many were answered; how many ticks in a row ended with nothing done. An idea closed as done in a generation the stem then rolled back is counted as given up, with the undoing named: the one outcome the journal knows for certain. ./one usage shows what looking ahead costs on a row of its own. /memory shows it, and the agent is told it each time it looks ahead. An agenda cannot quietly stall: lines passed over three ticks running give way to the lines behind them, and twelve idle ticks with things still open make the memory's state behind. TENERAL_OWN_TOKENS_DAY in .env caps what the agent's time of its own may spend in a day; unset, there is no cap.
A report a day. What the agent does in time of its own is otherwise seen only by reading the whole conversation. Once a day, and only when there is something to tell, a tick asks it for one short message to you, by the way it chooses: what it did unasked and what came of it, what waits for your word, what it means to do next. TENERAL_REPORT_HOURS sets how often; 0 is never.
Whom to ask what. A fact may be about a person: who they are, what they answer for, where they are reached. When the agent sets down a question for someone, it is shown what it knows of them.
Looking things up. recall finds events by their words, with no model asked: what the agent was told, what it said and did, what its tools returned, and its memories. What it was told and what it chose to remember count for more than its own words, which are most of a journal by volume. Words of any script are found, and forms of one word find each other. open shows the journal word for word around one event; timeline lists the episodes with what is remembered of each.
What is made from the events lies in tables of its own beside them (.derived/ in the store): so far what the agent knows and means to do, a row for every fact and every intention as it stands now (brain/known-table.ts). The body is their only writer. It hands every event, once and in order, to the same step that reading a whole journal would take (brain/known.ts), and binds the tables in the database, where everything that asks what is known asks. They are written out after the events they were made from, read back at the next start, and made again from the first event when they cannot be read. Beside what is known lie the episodes the conversation is cut into and what is remembered of each (brain/memory-table.ts). Cutting needs every event, but of an event only its type, its time and its size, and only until its stretch is remembered; then the stretch is one row. That table is made from the conversation as it stands, so it is made again when the owner takes a conversation back.
Memories that no longer hold. A memory is written once and says what was so then; found again weeks later, it must not be taken for the present. So memories are tied to each other (brain/links.ts). When a memory is formed, the agent is shown the earlier memories nearest to it, found by the stretch's own words, and says which of them the stretch made outdated and in what. That is a note of kind memory.outdated.v1, and nothing is changed by it: the earlier memory stays and is found, and wherever it is shown, in a request or under what recall returns, it says what no longer holds and since when. A fact that replaced another is tied to it the same way, and a memory of several episodes to the memories it stands for. The ties are a graph: they lie in the store as a table of edges (brain/ties-table.ts), made by the body from the notes as they are written and kept on disk with the other tables, and the database builds its graph from that table and walks it with its own graph operations, to the end of a line of outdating however long; without the database they are walked from the notes, with the same answers. What the owner withdrew ties nothing.
What comes back unasked. recall finds only what the agent thinks to look for, and it cannot think of what it no longer knows it knew. So at the start of a turn the past is asked once, with the words of what was just said, and up to three memories that answer well and are not in front of the agent already are put there (brain/reminded.ts): as a note in the journal, shown where it lies, so that the request is the same the next time it is built and a later memory knows what the agent was reminded of. No model is asked. A memory that a later one made outdated is never brought back this way; each that is stands with its time and is said to be of then. A short remark or a tick of the clock brings nothing back, and what was brought back lately is not brought back again.
The engine. RayforceDB runs in a process of its own, which the agent's body starts and stops (brain/rayserver.ts). The body is its client: the same library, loaded through bun:ffi (brain/ray.ts), carries each question to it and the answer back, over shared memory, in a few millionths of a second. A fault in the database is then not a fault in the agent: when that process dies the agent reads its journal through, and its body starts the database again a minute later (a few times, at growing intervals). The journal itself stays what it is, a file of one event a line, written first and never rewritten; the database is laid out from it and can always be laid out again, by any later build. The journal is laid out beside itself in memory/store-v3/, in tables partitioned by day: days that are over lie on disk and are mapped into memory, the day that is going on is held in memory (brain/store.ts). A question costs about a millisecond however long the agent has lived. The store is no truth of its own: it is built from the journal, and thrown away and built again when it cannot be read. Without the database, the journal is read through for every question, with the same answers in the same order. The database can run commands, so only source written in the repository is ever evaluated by it, and whatever arrived from outside goes over as data in a column.
Health. The memory's state is one word, worked out from the journal: well, behind or failing, with the reasons (brain/health.ts). Episodes that pile up unremembered, stretches of which no memory could be formed, wider memories that are only lists of titles, things meant to be done that are past their day, and an exam that went badly each count. You see it in the status line of ./one talk, as memory well · event 41% · episode 88% on green, amber or red (the two numbers are the last exam's: how often recall found the very event that answers a question, and how often a memory of the stretch that holds it), and with its reasons in /memory and ./one usage. The agent sees it in every request for as long as anything is wrong.
The exam. With each memory the agent may set one or two questions its episode answers, in other words than the episode used, each tied to the one message that answers it. Every ten memories it sits the exam, with no model asked, and the result is journaled: how many answers recall finds among its first five, how many the plainest search finds, looking for the words as they stand, and how many are still told by the memories themselves. bun brain/exam.ts sits it by hand.
The exam is a gate. A mutation that changes any file the memory is made of must find no less than the running generation did when it last sat the exam, give or take one question. The candidate is only asked for its answers, against a copy of the journal; they are counted by the code of the generation that is running. A candidate that changes the memory and cannot be examined is refused. It guards against a memory that got worse by mistake, not against an agent that sets out to cheat: the questions and their answers are in a journal the candidate can read.
Your hand on it. Three things are yours to say, with /memory, and none is asked of a model. /memory pin keeps a stretch in front of the agent word for word; a pin that would not fit its share of a request is refused when you make it. /memory withdraw <mark> says a memory or a fact does not stand; a memory is then formed again from the journal. /memory back [n] takes the conversation back to before your last message, or your last n: what followed is set aside, the agent no longer sees or finds it, and it goes on from the earlier point. Nothing is cut out of the journal for any of this, and taking a conversation back undoes nothing in the world.
An organ is a native dependency the agent adopts for its body: a program or a library that somebody else publishes as release archives. The agent chooses it, pins it, and later upgrades it by itself. The mechanism knows nothing about any particular one.
The brain's engines. What the agent remembers and thinks with is no organ of its body: the database its memory lives in belongs to its brain. Such an engine is pinned in brain/engines.json, in the same shape and by everything said below of an organ: the same cache, the same gate, the same directory in TENERAL_ORGANS, the same rollback. A name stands for one thing, so none may be pinned in both files, and the limit of 16 pins counts both.
The pin is body/organs.json, a file of the body like any other, so it mutates and rolls back with the code that uses it:
{
"rayforce": {
"url": "https://github.com/RayforceDB/rayforce/releases/download/v3.0.2/rayforce-3.0.2-linux-x86_64.tar.gz",
"sha256": "ea20fd48a223ffb3ed3e37a5edcb8a7caf5c5199d4cc8ba4e072d0c21e4a57b7",
"dir": "rayforce-3.0.2-linux-x86_64",
"check": ["rayforce", "--help"]
}
}
A name (a-z, 0-9, -) maps to the https address of a .tar.gz or .zip archive and the archive's SHA-256. dir is optional: the directory inside the archive that is the organ's root, for an archive that wraps everything in one. check is optional: a command run in the organ's root that must exit with 0 within 60 seconds; its first word is a file of the organ. At most 16 organs. Nothing else is accepted in the file, and a field nobody defined is refused. No file, or {}, means no organs, and then nothing described here happens at all.
The cache is .teneral/organs/, outside git, with everything named by the archive's hash:
.teneral/organs/archives/<sha256>.tar.gz the archive, put there by the agent
.teneral/organs/archives/<sha256>.zip the same, for an organ published as a zip archive
.teneral/organs/trees/<sha256>/ the archive unpacked, by the stem
.teneral/organs/sets/<id>/<name> one link per pinned organ, to its root
The agent downloads an archive itself, with its own tools. The stem never reaches the network for one and does not take the agent's word either: it computes the hash of the cached file itself.
The gate organs runs after the size check and before anything of the candidate's is executed. For each pin of the candidate commit: the archive is in the cache and hashes to the pin (at most 256 MB); it is unpacked, unless that was done before, beside its place and renamed into it, so a tree that exists is a whole one; then the check runs, with the bare environment of every check. Unpacking refuses the whole archive for any entry that is not a plain file, a directory or a link that stays inside: a name that is absolute or climbs with .., a second entry for a name already written, a file that would be written through a link, a link pointing out, a device, a fifo; more than 1 GB unpacked or more than 20,000 entries. A refusal rejects the mutation with a message that says what to do, for example organ rayforce: it is not unpacked, and archive ea20… is not in the cache at …/archives/ea20….tar.gz; download https://… there first.
The body finds its organs through TENERAL_ORGANS: a directory with one entry per organ, by name, so the example's program is $TENERAL_ORGANS/rayforce/rayforce. The variable is set for the candidate's tests and its smoke run, from the candidate's pins, and for every generation at its start, from the pins of that generation's own commit. It is not set for a body that pins nothing. The unpacked tree is shared by every generation that pins the same archive and is to be read, not written: what an organ stores belongs elsewhere.
Rollback needs nothing more. The generation before pins what it pinned, and that tree is still in the cache: the stem never removes an archive or a tree, the current generation's, the previous one's or any other (so the cache only grows; see BACKLOG.md). At each start, a tree that is missing is unpacked again from its archive. When the archive is gone as well, the supervisor does not start the generation and does not roll it back: it stops and says which archive belongs at which path and where to download it, and ./one up goes on from there once the file is back. A cache that was wiped is a fault of the install, not of the generation, and going a generation back would give up a sound one.
An upgrade, as the agent does it: download the new archive and the hash its publisher gives; verify one against the other; move the archive to archives/<sha256>.tar.gz; change the pin in the workspace; run bun immune/organs.ts there, which does for the workspace's pins exactly what the gate will do and prints the directory to use as TENERAL_ORGANS for its own test run; then mutate. If the new version turns out worse, the stem's rollback or ./one back returns to the old pin with the old code.
Improving the dependency itself does not go through the stem. The image has git, curl, clang and make: the agent clones the dependency's source, builds and tests a patch locally, and proposes it upstream. Only a published release is pinned; when one holds the fix, it is installed as any upgrade. A locally built binary is for trying the patch, not for the body to depend on.
What is published on the npm registry the agent takes by itself: a tool it runs, a module its code imports. No step of the owner's is involved, and the image does not change.
The declaration is two files of the body, so it mutates and rolls back with the code that uses it: body/package.json, which names the packages, and body/bun.lock, which Bun writes and which pins every package, direct or not, with the hash of its archive. The agent runs bun add <name>@<version> in body/ of its workspace, tries the result, commits the two files and mutates.
The cache is .teneral/packages/, outside git:
.teneral/packages/<id>/node_modules/ installed by the stem, once; <id> is the hash of the two files
<checkout>/body/node_modules a link to it, made by the stem in each checkout
The gate packages runs after organs and before anything of the candidate's is executed. The stem installs the candidate's packages itself, with bun install --frozen-lockfile --ignore-scripts: from the lock as written, each archive checked by Bun against its hash, and no install script of any package run. This is the one place where the stem reaches the network on its own, and a mutation that takes a new package is rejected while the registry cannot be reached. A lock that does not match its manifest is rejected, and so is one that holds a package from a path, a git repository or an address: nothing would pin such a package. The tree is then closed to writing and shared by every generation that has the same two files.
The body finds its packages as any Bun program does: its code imports them by name, and their programs are on the PATH of the commands it runs, before the image's, together with those of its organs.
What this does not cover: a package that works only after its install script has run, and anything not on npm. A native program published as a release archive is an organ.
What the species takes this way. The agent reads a codebase through its code command (body/code.ts): what a file defines, the body of one function, where a name is defined and used, code of a given shape, what a compiler says. None of the programs behind it is in the image. ast-grep is a package in body/package.json; ripgrep, fd, clangd and the tree-sitter grammar for Rayfall are organs in body/organs.json, the grammar as source, which the body compiles once with the image's C compiler. An individual adds a tool of its own beside them, or drops one, by a mutation.
The journal has one event that is the body's own: { "type": "note", "kind": "...", "data": ... }. The stem stores it and never reads it; the talk clients do not show it, and it is neither a reply nor something that wakes the agent. kind is a short name the body chooses (a-z, 0-9, ., _, -, at most 64 characters), data is anything that is JSON, of any size. A note that breaks this is refused when it is appended, with nothing written. The seed body writes none and passes them over when it builds a request.
It is there for one rule: anything the body keeps outside the journal must be rebuildable from the journal, and lies in a place named by its schema version, so that no body opens data it does not understand. An index, a database, a summary are derived: the journal is the record, and what a store was built from must be in it, as the conversation itself or as notes. A body that changes the shape of its store writes to a new place (memory/store-v3/, not memory/store/ in a new shape) and builds it from the journal; the places of other shapes are removed then, and nothing is kept for a body that no longer runs. After a rollback the older body does not find the place it knows and builds it again from the journal. A store that is lost or damaged is a store to build again, never a loss.
The agent may change anything in its repository: its body, brain and heart, and also the stem that supervises it, the immune gates that judge it, their tests and the project's files. What it changes in its own code, body/, brain/ and heart/ with their tests, it mutates into on its own word. A mutation that changes anything else waits for yours, and that is the only difference. "The body" below is short for that own code, brain included.
The rule. A candidate that differs from the running generation outside body/, brain/, heart/, test/body/, test/brain/, test/heart/ and BACKLOG.md passes only when, outside those paths, it holds exactly what a commit you approved holds. So an approval is for what a commit holds outside the body: a later commit that changes only the body passes on it, also after a rollback, and a commit that changes anything else again waits again. A candidate that leaves everything outside those paths as the running generation has it is an ordinary mutation and is not looked at here.
Your approval. TENERAL_APPROVAL in .env says what you allow:
TENERAL_APPROVAL |
|
|---|---|
ask (the default) |
The mutation waits at gate approval until you have approved it. The answer names the paths it changes outside the body and tells the agent to ask you. Nothing of the candidate has run at that point. |
auto |
No approval is needed: the agent changes its stem as it changes its body. |
off |
A mutation that changes anything outside the body is refused, at gate stem. |
You approve with ./one approve (the commit the agent last asked about) or ./one approve <commit>, or with /approve and /approve <commit> in ./one talk. Either says back the commit, its first line and the paths it changes outside the body, and tells the agent to ask for its mutation again. In ./one talk a mutation that waits for you stands in the conversation as a notice with those paths. What you approved is kept in .teneral/approval.json and journaled as mutation.approved, with the way it came: one or talk. From a talk client the approval travels as a file in .teneral/owner/ whose name starts with a dot and ends in .mutation, holding the commit; the stem takes it in before it next judges a mutation, and no body reads it, because every body passes over names that start with a dot. A line you type is always a .txt file, so no text is ever taken for an approval, and /approve piped into ./one talk is a line like any other. A mutation that waits for you is not counted towards the three rejections of one commit that stop the supervisor.
What you are approving. The agent's account of the change is in the conversation; the change itself is git diff <running generation> <commit> in this directory. Nobody else reads it. Once it is approved and through the checks, that stem is what judges the next mutation, takes your approvals and puts a failed body back. Approve a change to the stem as you would merge a pull request to it.
The stem of a generation is the stem that runs it. After a mutation that changes the stem is promoted, the supervisor, the gates, the talk client, back and approve are that generation's own, run from .teneral/live. What the container starts is a small launcher, stem/launcher.ts, from this checkout. It checks the current generation out in .teneral/live, starts stem/main.ts from there, and starts the next stem when a supervisor ends with status 85, which a supervisor does after it changed the generation, by a promotion or a rollback, to one whose stem differs from its own. The old stem judges the new one: the gates for the candidate run under the running generation's stem, and execute the candidate's own stem tests in the gate checkout, as before.
A generation from before the launcher has a stem that cannot run from .teneral/live; this checkout's stem supervises it, as it always did. That is also how an existing install comes up: git pull, ./one down, ./one up, nothing else. Its state file is unchanged and is read as it is.
The launcher and a stem agree by a versioned contract, written at the top of stem/launcher.ts. A stem says in stem/launch.json the lowest launcher version it can be started by; the launcher is version 1. A commit whose stem says it needs a newer launcher than this checkout has is refused at gate stem with your owner must update the install. Should the current generation need one all the same, the launcher starts nothing, says the owner must update the install (git pull, then ./one down and ./one up) and exits with status 78. It does not loop.
When the new stem does not work. The stem that promotes a mutation with another stem writes .teneral/trial.json first. Until the new generation has journaled generation.ready under its new stem, the launcher holds that stem on trial. If it cannot be started, ends before that (with any status), has not got there within 5 minutes, or asks for another stem without having changed the generation, the launcher goes back to the generation before: it writes the state file and a generation.rolledback event itself, with the reason and the end of what that stem wrote to stderr, and starts the previous generation's stem. None of that is done by the stem that failed. A new stem that works, with a body that does not, rolls the body back itself as any stem does, and the launcher then starts the old stem again. Once the generation was ready the trial is over; a stem that fails later ends the launcher with its status and waits for you, and ./one back returns to an earlier generation and its stem.
The cage is yours. one, the Dockerfile, .dockerignore and the launcher are the install. They live in this checkout and no mutation puts another version of them into effect, whatever the lineage's commit holds; the container's flags are what your one says. When the generation's versions differ from this checkout's, the supervisor logs one line and ./one talk shows it; you look at the difference (git diff HEAD lineage/local -- box) and take it, or not: with git pull here when it is the species', by hand when it is the agent's own.
Which stem each command uses.
| Command | Runs |
|---|---|
./one up, ./one fg |
this checkout's launcher, which starts the current generation's stem |
./one talk, ./one back, ./one approve |
the stem in .teneral/live, once a generation has one; this checkout's for a generation from before the launcher. bun stem/launcher.ts home prints which |
./one setup, ./one run <command> |
this checkout: ./one run bun keeper/back.ts is this checkout's back, for when the generation's own is what is broken |
./one logs, ./one down |
no stem: Docker |
A talk client older than the journal is no problem: every reader passes over event kinds it does not know.
The page, the documents, the CI. site/, docs/, .github/, README.md and LICENSE are run by no stem, so a commit that changes nothing else outside the body is taken like a change to the body: no approval, no new stem started.
What this does not stop. The rule is checked on a mutation. The agent has a shell in this directory: it can write the approval file itself, or edit .teneral/live directly. And a stem you approved can do away with the rule. As everywhere here, this guards against mistakes, not against intent. What stays out of a mutation's reach is the launcher, and with it the way back from a stem that does not start.
main, as the project publishes it, is the species: the stem, its tests, this README, the seed body. An individual's branch is a lineage of it. A lineage takes what the species gained after its birth by merging it, and gives back what it made by offering it.
A merge of the species changes files outside the body, so it is a mutation that waits for your approval like any other that does; nothing else about it is special. Nothing obliges a lineage's stem to equal the species': an agent that changed its own stem resolves, in the merge, whatever the two changed alike, and the further its stem goes its own way, the more of each merge is its own work.
Which ref. TENERAL_UPSTREAM in .env names it: <remote>/<branch> when the first part is a remote of this repository, else a local branch. Unset, it is origin/main when there is a remote origin, else the branch this checkout is on. The agent fetches and merges it in its workspace; the stem never changes a remote's address and never pushes.
A development checkout. If you work on teneral in the same checkout your individual lives in, your main runs ahead of origin/main, and the agent cannot take what you have not pushed. Set TENERAL_UPSTREAM=main: the species is then your local branch, and the agent merges main. With TENERAL_APPROVAL=ask you still approve each such merge before its stem runs.
The first time you start it, the agent speaks first. Its journal holds no message yet, so the first one in it becomes the letter in BIRTH.md. The letter asks the agent to read its own code, tell you what it found, and ask who it should be for you: its name, what you want from it, how much initiative to take. Then it writes its soul, soul/SOUL.md and soul/OWNER.md, and from then on those files are part of every turn. They are the agent's own to revise, and they are never committed.
If you want a different beginning, edit BIRTH.md and commit it before the first start.
Anything can reach the agent by putting a JSON file into inbox/ (create the directory if it is not there yet): another teneral agent, a script, a bridge to a chat service. The format is in body/envelope.ts:
{"v": 1, "id": "note-1", "from": "script", "to": "anyone", "replyTo": null, "ts": "2026-11-11T12:00:00Z", "hops": 0, "text": "hello"}
The file name must end in .json. Write it under another name and rename it, so it is never read half-written. The inbox is looked at every two seconds; a message that was taken in moves to inbox/seen/, a file that is not a valid envelope to inbox/rejected/.
To let the agent write to another one, list that agent's inbox in soul/peers.json:
{ "bob": "/path/to/other/teneral/inbox" }
Messages are not signed. The agent is told to treat them as untrusted and not to change its code or run commands because one asked, and an exchange of replies is cut off after four. The limit on replies is in the body's send tool and the rest is an instruction to the model; the stem enforces neither.
Requires Docker and git. On Linux, one warns when Docker is installed through snap: its AppArmor confinement can deny the image build, no-new-privileges, or port publishing. If that happens, use a normally packaged Docker rather than disabling the container's security flags; see issue #11.
./one up # start the agent in the background; the first time, it sets up a model provider first
./one talk # attach this terminal to it
./one down # stop it
./one back # send it back to the generation before
./one approve # approve the mutation it asked for that changes something outside its body
./one setup # choose another model provider, or sign in again
./one offer list # what the agent wants to offer to the species; see "Offering a change to the species"
./one reset # begin again here as a newborn, on the species' newest code, with the same tokens
Commit your changes before the first start: the stem creates its worktrees from HEAD.
Beginning again. ./one reset ends the life lived in a directory and makes room for a new one. The journal and the memory, the soul, the inbox, the lineage and everything else the agent made are moved into .teneral/past/<time>/, and the lineage's commits stay under the branch past/<time>; nothing is deleted. The code becomes the species' newest (--keep-code leaves it). Kept where they are: .env, the sign-ins and tokens in .teneral/auth, the install's id and signing key, and the credentials the agent kept for its services, which are the files in its workspace's .teneral/ that only you can read. The next ./one up is a birth. It asks before it does anything, and refuses before it moves anything when the checkout has uncommitted changes or the species cannot be fetched.
What the species brings. The agent's own mutations and the species' new commits are both proposed under mutate in the row of actions in ./one talk, and by /update. /update take is your word to the agent to merge the species into its lineage, test it and ask to mutate; what that changes outside its body waits for /approve like any mutation.
The first ./one up finds no .env and runs the setup: you choose a model provider, give it what it needs, and two test requests are made, one that must be answered in words and one that must come back as a tool call. Only when both work is .env written, and the agent starts. At a terminal the setup is a few full-screen pages: you choose with the arrow keys or a number, a key is typed unseen, the two tests show their progress, and the last page says what was written and where. ./one setup --plain asks the same questions as lines of text. It also installs the project's two development dependencies once, which the checks on a mutation need. From a script, with no terminal to ask at, ./one up says what is missing and exits with status 1.
The setup offers what brain/providers.ts lists:
- ChatGPT plan (Continue with ChatGPT). The agent's requests use your ChatGPT Plus or Pro plan, through the sign-in OpenAI documents for open-source apps that run locally (Sign in with ChatGPT). No API key is involved.
- OpenAI API key. Pay as you go, at
https://api.openai.com/v1, over the Responses API. - Another OpenAI-compatible endpoint. Any chat-completions endpoint: you type its base URL, a key and a model that supports tool calls. This is what the project did before there was a choice, and what a
.envwithoutTENERAL_PROVIDERstill means. - Kimi Code plan. A Kimi membership with Kimi Code benefits, with an API key you create in the Kimi Code Console, at
https://api.kimi.ai/coding/v1over the Responses API, which Kimi Code documents for third-party tools. In mainland China the address ishttps://api.kimi.com/coding/v1: put it inTENERAL_BASE_URLafter the setup. Which models the key may use depends on the plan.
What the ChatGPT sign-in does:
- The setup shows an address at
auth.openai.com, as one line that your terminal wraps, so that selecting it copies it whole; where the terminal supports links it can also be clicked. You open it in your own browser, sign in there and approve the app, which OpenAI shows under the nameteneral; you never type a password into teneral. The address is for you alone. The setup waits until your browser comes back; Esc gives up. - OpenAI sends your browser back to
http://127.0.0.1:1455/auth/callback, where the setup is listening. For that, and only for the time of the sign-in,./one setuppublishes port 1455 on this machine's loopback address. No other command opens a port. If 1455 is taken,TENERAL_CALLBACK_PORT=<port> ./one setupuses another. - The tokens OpenAI issues are stored in
.teneral/auth/chatgpt.json, readable only by your user. An access token lasts an hour and is renewed by itself; the sign-in as a whole lasts 30 days from its last renewal..envholds no key for this provider. - The agent's own shell can read that file. It runs as your user in a directory it can see all of. The agent is told the credentials are yours and to leave them alone, and its code keeps the token out of its environment, its journal and its workspace; nothing stops a command it runs from reading the file. The same has always been true of an API key in
.env. - What the agent uses counts against your plan. On Plus, the five-hour limit is one total shared with everything else that uses your plan. Review it, limit this app's share or disconnect it at ChatGPT Settings, Usage.
./one talkreminds you with one line that the plan is in use. When a limit is reached the agent waits and tries again (after 10 s, 1 min, 5 min, then every 15 min);./one logsshows the reason with that link, while./one talkshows nothing until a request passes again. - When the sign-in has ended (30 days without a renewal, or you disconnected the app),
./one logssayssign in again with ./one setup. Running it again reuses the registration and asks OpenAI only to confirm the account. - On a machine with no browser, run the setup in a checkout on a machine that has one, and copy its
.teneral/auth/chatgpt.jsonto the same place here over a secure channel; or forward the port for the time of the setup (ssh -L 1455:127.0.0.1:1455 <machine>) and open the address locally.
To change provider or sign in again, run ./one setup. It asks before replacing an existing .env, keeps the settings in it that are not about the provider, and writes nothing unless the test requests work. A running agent takes up what the setup wrote within a few seconds, with no ./one down; see Changing the model while it runs. Model replies come whole, not streamed to your terminal, with either protocol.
Not verified against the real service. The ChatGPT sign-in was built from OpenAI's documentation and tested end to end against a stand-in that is as strict as that documentation reads; no account was available to try the real one. If an assumption is wrong, the setup's test requests are where it shows, before anything is written: a failed sign-in or test prints OpenAI's status and message. The open points: whether a first registration is accepted from any open-source app without prior arrangement; whether tool calls made in one request are accepted back in the next without the model's reasoning items, which are not kept (see BACKLOG.md); whether tools grouped in one namespace come back under their plain names; and which models your plan lists.
./one up starts the agent in a container of its own and returns. The agent does not depend on the terminal that started it: close the window and the clock still wakes it and its inbox is still read. Run again while it is up, ./one up says so and changes nothing.
./one talk attaches a terminal without taking over the alternate screen. The conversation is printed once and remains in the terminal's scrollback after you leave. PageUp, PageDown and the mouse wheel page through it above the input box and bottom actions; those bottom rows stay fixed while you read an older page. Typing returns to the newest output. From top to bottom:
- A welcome panel, printed once when you attach: teneral's mark, who you are talking with (the individual's own name once a file of its soul gives one: a line
name: ...in any.mdfile undersoul/, else a first-level heading of a word or two), and a table of what is true of it: the directory, the start of its id, the generation it is in (as an ordinal and a short commit) and how many it has lived in, the model and the provider, teneral's version, when it was born, which sensors are on (the clock and its interval, the inbox, your terminal), and its peers if it has any. - Status lines under the panel, each behind a
◆: that the individual is awake and what it is doing, or that nobody is running;Using ChatGPT plan. Manage usage: ...with the address, when the plan pays; how images get in on this machine; and, when the journal holds more than is shown, that/historyprints it. - The conversation, starting with the last few exchanges. Your lines are marked
›, with any image as a chip,[image 1 · png · 1280×720 · 240 KB]. A reply starts with●and has its markdown laid out (headings, emphasis, lists, quotes, code blocks cut at the edge rather than wrapped, links with their address dimmed). A summary of the model's reasoning, when the body journals one, is a dim slanted paragraph behind○, before what it led to. Each tool call is one dim line under▪, ending with✓or✗ failedand how long it took; the calls of one turn stand together. What the stem did to a mutation (a change the agent proposed to its own body) is a coloured block behind a bar:mutation acceptedwith both commits;mutation to <commit> rejected at gate ...with the end of the gate's output;rolled backwith the reason and the end of what the generation last printed;sent back by you. The clock, a message from another agent and the birth letter are one quiet line each, and words the body journaled in the model's place stand under! not from the model. Everything the agent, a tool or another agent wrote is stripped of control characters and escape sequences before it is shown, and always starts two columns in: the first two columns are the client's own. - The live region, the only part that is redrawn. What has not finished waits here and is printed above once it has: a tool call until its result, a line of yours until the agent has read it. It is faint while it waits: kept by this client because the agent is in the middle of a step (Up in an empty box takes the last one back, to change or drop it), then
on its wayonce sent andsent, not read yetonce the agent has it. Read, it stands in the conversation on a ground of its own. While the agent is doing something, one line says what, for how long, andesc to interruptwhere Esc would stop it:waking(its first start, before its first words),thinking,running <tool>,mutating(it proposed a mutation and the stem has not answered),starting(the stem is there and no body runs: between two runs). Under that is the input box, a thin frame across the width that grows with what you type, with attached images as chips inside it. Under the box is the footer, one row of segments: at the left the model (and the reasoning effort, ifTENERAL_REASONING_EFFORTis set), where the agent stands when it is doing nothing (resting,not running, orwaiting for you: its last finished reply ended with a question mark and nothing has arrived since), the directory and the generation; at the right what is attached or queued, else a tip that changes every twenty seconds, then how much of the last request's input the provider read from its cache,cached 97%(green from 70%, red under 30%), and how full the model's context is,context 8% (71.9k/1.05M). What does not fit gives way, the tip first.TENERAL_POWERLINE=1joins the segments with Powerline arrows, for a font that has them./usageadds up what the requests cost: by the last hour, the last day, this generation and the whole life, and by what woke the agent. Reasoning and context use appear when the agent's body records them and are simply absent when it does not. While the agent is thinking, the line that says so also says what the model is doing at that moment, from a small file the agent keeps while a request is under way (.teneral/pulse.json,brain/pulse.ts):waiting for the model's first word, 0:42,the model is reasoning: …orthe model is writing: …with the last words that arrived, and(nothing new for 1:00)when the stream has gone quiet. A request can take minutes; this is how thought is told from a hang.
| Key | What it does |
|---|---|
| Enter | send what you typed, and the images attached, to the agent as its owner |
| Alt+Enter, Ctrl-J | a new line; a pasted text keeps its line breaks. The box grows to eight rows |
| Left, Right, Home, End, Ctrl-A, Ctrl-E | move in the line; with Ctrl or Alt, Left and Right jump by words |
| Backspace, Delete, Ctrl-U, Ctrl-K, Ctrl-W | delete a character, to the start of the line, to its end, the word before. Backspace at the very start removes the last attached image |
| Up, Down | the line above or below in a text of several lines; at the first or last line, what you sent before. While commands are listed, they choose one |
| PageUp, PageDown, mouse wheel | page through the conversation above the fixed input/menu and action row |
/ |
list the commands under the box, fewer with each letter typed; see Commands |
| Ctrl+V | attach the image that is in your clipboard |
/image <path> |
attach an image file from your machine. Dragging a file into the terminal, or pasting its path, does the same |
Esc, /stop |
interrupt what the agent is doing now; see Interrupting. When it is doing nothing, this does nothing and says so. While commands are listed, Esc closes the list and does nothing else |
/approve, /approve <commit> |
approve the mutation the agent asked about that changes something outside its body, or the commit named; see Outside the body. It goes to the stem, not to the agent. With a commit that /offers lists, it lets that one go out instead |
Tab, /tools |
show a few rows of what each tool call returned, from now on, and once more for the calls since you last spoke; again to stop. While commands are listed, Tab completes the chosen one instead |
/history |
print the earlier conversation that was read from the journal when you attached |
/generations |
the generations it has lived in, as ./one back --list gives them |
| Down, from an empty line | onto the row of actions under the status line: mutate, publish, memory, more. Left and Right move along it, Enter opens the menu of what can be done there, Up and Down choose in the menu, Enter does it, Esc goes back. One that holds something for you says so and is where Down lands first. Every item is a command you could have typed. While the agent has left something running in the background (its tests, a build), a fifth action stands there, jobs, with how many run; its menu names each and what it runs. When one ends the agent is woken and told, without waiting for the clock |
/offers |
what waits for your approval before it goes out to the species; /approve <commit> lets one go. See Offering a change to the species |
/publish, /publish <commit> |
how the agent's work goes out to the species and where every offer stands: what waits for you, what you approved that was never sent, what was sent, each with the line to type for it. With a commit it lets that waiting offer go out and tells the agent to send it, or tells the agent again about one that has your yes and was not sent |
/memory |
how the agent's memory stands, with a mark for each memory, fact and intention; then /memory pin, unpin, withdraw <mark> or back [n]. See Memory |
/model, /model <name>, /model list |
the model the agent thinks with; with a name, test that model and change to it; see Changing the model while it runs |
/plain |
how to get the plain text client |
/help |
the keys and commands |
//... |
send the agent a line that begins with a slash: it arrives with one |
| Ctrl-L | draw the live region again |
/quit, Ctrl-D on an empty line, Ctrl-C |
leave. The agent goes on |
PageUp and PageDown page by a screen; the wheel scrolls three rows at a time. The client asks for SGR button-event mouse reports so it can handle the wheel, and disables that mode on exit. Clicks and drags are not acted on; in terminals that support it, hold Shift for native mouse selection. Dragging the terminal's own scrollbar still moves its whole viewport, including the live rows. The cursor you see in the box is drawn by the client; the terminal's own cursor is hidden while the client runs and is given back when it ends.
Esc interrupts a turn, and /model changes the model it thinks with. Nothing else in the client stops the agent or changes it; ./one down and ./one back do that. Leaving takes the live region away and leaves the conversation in the scrollback, with one line saying that the agent goes on. When the terminal goes away without a word (a closed window, a dropped connection), the client notices within about half a minute and ends by itself. Any number of terminals can be attached at once. Each sees the same replies, and what was typed in the others marked as such. The client keeps a bounded part of the conversation in memory, whatever the size of the journal. When the window changes size the live region is drawn anew at the new width; what was already printed is the terminal's to wrap, as with any output. One limit: a terminal that wraps its rows again, made much narrower and lower in a single step, can push the top of the old live region out of reach, and a few of its rows may then stay in the scrollback. The colours, the mark and the glyphs are in one place, keeper/tui/theme.ts: true colour, with the nearest of 256 or 16 colours where that is what the terminal has, chosen to read on a dark background and on a light one; NO_COLOR is honoured, and a locale that is not UTF-8 gets ASCII marks.
A line that is a slash, a word of lower-case letters and, after a blank, whatever follows it, is a command; the table above has them all, and so has /help, which prints the same table the client itself reads (keeper/commands.ts).
- Type
/and the commands are listed under the input box, where the footer otherwise is: each with what may follow it (<path>has to,[commit]may) and one line on what it does, the chosen one marked▸. Every letter leaves fewer. At most six are shown, the ones around the chosen one, fewer on a low screen. The list is part of the live region and leaves nothing in the scrollback. - Up and Down, or Ctrl-P and Ctrl-N, choose, and go round at the ends. Tab completes the chosen name, with a blank after it when something may follow. Enter on a whole name runs it. Enter on part of a name runs the chosen command when nothing follows that command (
/h, Enter is/help); when something has to or may follow (/image,/approve) it only completes the name, so that a slip of the hand approves nothing, and a second Enter runs it. Esc closes the list and leaves what you typed; it sends no interrupt then, even while the agent works, and the list stays closed until you change the line. These keys belong to the list only while it is open. A line brought back with Up from what you sent before is never offered a list, so Up and Down go on through the history. - The name is coloured as you type: set back while it is part of a command's name, in your own colour once it is a command, and as a warning when Enter would refuse it. What follows the name stays plain.
- A name that is no command is not sent to the agent. One line says so and names the nearest command, and what you typed stays in the box to be put right. The same goes for words after a command that takes none (
/stop now). - To send the agent a line that begins with a slash, begin it with two:
//help mearrives as/help me. That is rarely needed. A path such as/home/you/notes.txt, a slash further on in the line, a slash followed by a blank, a name with a capital or a digit in it, and any text of several lines are not commands: they are not listed, not coloured, and sent as they are, and a path that names an image is attached as before.
The plain client has /help, /stop, /approve, /offers, /model, /heart, /publish, /update and /quit, typed whole; /help lists them there.
While the agent is in the middle of a turn, waiting for the model or running a tool, Esc stops that turn; /stop is the same as a command, and is what the plain client has.
- The request to the model is cancelled and its answer, if one was on the way, is lost. A
bashcommand that is running is killed at once with everything it started, as at its two-minute limit. A tool that does not stop when asked is left behind after two seconds. - The journal stays whole: the tool call that was cut gets a result that starts with
[interrupted], the calls of that reply that had not begun get one that starts with[not started], and then one event,turn.interrupted, ends the turn. The client shows it as a quiet line,interrupted by you, here and in every other attached client. - The agent does not start again by itself. It waits for the next thing that wakes it, and is then shown, at that place in its conversation, that you interrupted it.
- Pressed while the agent rests, Esc sends nothing and says so. An interrupt is for what the agent is doing when it arrives; it is never kept for a later turn. One that arrives a moment too late, after the reply that ends the turn, is dropped.
- A turn that failed and is waiting to be tried again (the model was not reachable, or a limit was hit) is given up by Esc as well.
- A mutation that was already asked for is not undone: the stem checks the commit and answers. While it checks, and between two runs of the agent, there is no turn to stop, and Esc says so.
- A second Esc while the first is unanswered does nothing. If nothing answers within five seconds the client says so: a body from before interrupts does not hear them, and
./one downstill stops it for certain. An individual born earlier gets there when it takes this change into its own body. - Esc never leaves the client, and Ctrl-C never interrupts the agent: it leaves, as before.
- While commands are listed under the input box, Esc closes that list and sends nothing; the line over the box does not say
esc to interruptthen. Pressed again, it interrupts. - A generation that was just promoted and is interrupted before its first reply is neither rolled back for its silence nor taken as proven: it has its 10 minutes again from when something is next said to it.
Only you can interrupt. The interrupt travels where your lines do, through .teneral/owner/, as a file of its own kind (see How your lines reach it); nothing that arrives through inbox/, and nothing a tool prints, can stop a turn.
You can give the agent pictures: PNG, JPEG, GIF or WebP, at most 10 MB each and at most four in one message. What a file is, is decided by its first bytes, not its name.
- Ctrl+V attaches the image in your clipboard. (Your terminal's own paste, usually Ctrl+Shift+V, pastes text as before.)
- Dragging a file into the terminal attaches it: the terminal types the file's path, and a paste or a line that is exactly the path of an image file (quoted, with escaped spaces, or as a
file://address) becomes a chip instead of text. A path of anything else stays the text it is. /image <path>does the same for a path you type, from/or from~/.
An attached image is a chip in the input box, with its kind, its size in pixels and in bytes; the footer lists what is attached, and Backspace at the start of the line takes the last one off. The file is kept for good under memory/images/, named by the SHA-256 of its bytes, and the message you send ends with one line for each image, exactly [image: memory/images/<sha256>.<ext>]. In the conversation that line is shown as the chip again, here and in every other attached client.
The agent sees an image only once its own body knows how. A body that knows those lines, in messages from its owner, shows the model the picture; a body from before that shows the model the line as text. An individual that was born earlier gets there by a mutation of its own, like any other change to its body.
The client runs inside the container, where there is no clipboard and no file of your machine. So ./one talk runs a small helper on your machine for as long as the client is attached. The two share a directory of their own under .teneral/owner/.clip/, which is removed when you leave: the client leaves a request there, the helper answers with the bytes. A request names one of two things, "the clipboard's image" or "this file", and a file is only ever read. The helper needs a way to read the clipboard:
| Your machine | What reads the clipboard |
|---|---|
| Linux with X11 | xclip (the package xclip) |
| Linux with Wayland | wl-paste (the package wl-clipboard); xclip is used instead when only that is there |
| macOS | pngpaste if it is installed (brew install pngpaste), else osascript, which every Mac has |
When the clipboard offers an image in several formats PNG is taken, and nothing is converted. Without such a tool, or over SSH where there is no display, Ctrl+V says what is missing; dragging a file and /image work regardless. A client started without ./one (a plain docker exec, or bun keeper/talk.ts on the machine itself) has no helper: it says so, and /image then takes only files the client can read itself. Nothing is shown as a picture in the terminal; an image is always a chip.
./one talk --plain is the same conversation as plain text, without the panel and the input box: the last few exchanges, then replies in full, one short line for each tool call ( [bash] command: ...), the stem's notes as [stem] ..., an interruption as [interrupted by the owner], and what was typed in other terminals marked with > . A line that is exactly /stop interrupts the turn in progress instead of being sent, /approve, typed by a person, works as in the full client, and /help lists the commands there are. That is also what you get whenever the input or the output is not a terminal. It has no way to attach an image.
./one talk also takes its lines from a pipe, for scripts, and this is unchanged:
echo "What are you working on?" | ./one talk
Then it shows no history. It sends one line at a time: a line goes out when the agent is at rest, and the next line, or the exit, waits until the agent has finished its reply to that one. The exit status is 0 after the reply to the last line. If nothing is journaled for 300 seconds while a line waits, it gives up with status 1; ./one talk --wait 60 changes that time. With no lines at all (./one talk </dev/null) it prints the last few exchanges and exits. A piped line /stop is not sent as text: when its place among the lines comes and the agent is in the middle of a turn, that turn is interrupted, and what follows waits for the agent to come to rest (echo /stop | ./one talk).
./one down stops the agent: the stem is asked to stop, stops the agent and exits, and the container is removed. A terminal attached with ./one talk ends with it. Nothing is lost by it. The journal, the soul and the code are in this directory, and ./one up goes on from there.
./one back sends the agent back to the generation it was on before the current one, for when a generation that passed every check turns out worse. ./one back <commit> goes to a specific earlier one, named by its commit or the first seven or more characters of it, and ./one back --list shows the generations this individual has lived in, oldest first, with when each became ready, how many replies it gave, and which is current. The choice is made from the journal: a generation can be gone back to if it once reported ready and git still has its commit. "Before" follows the order in which generations were promoted, so after the stem has rolled a failed generation back, ./one back goes one further back, not forward to the failed one. A running agent is stopped for the change and started again; one that was down stays down. The agent is told as after any rollback, and its workspace is left as it is, with the later code still in it. When there is nothing to go back to, the command says so, changes nothing and exits with status 1.
./one logs follows what the container prints: the stem's [teneral] lines, [thinking] and [tool] as the agent works, and its replies.
./one fg runs the agent in the foreground of this terminal instead, for debugging. There you type straight to it; /quit stops the agent (typed while it is working, it takes effect when the turn ends), Ctrl-C stops it without waiting, and so does closing the terminal.
It does not come back by itself. After a reboot, or when Docker itself is restarted, the agent is down until you run ./one up. This is on purpose. When the stem gives up, because a generation cannot be kept running and there is nothing to roll back to, or the checks keep rejecting the same commit, it exits and waits for you; Docker's restart policies cannot tell that from a crash and would start it again, some of them without end. So there is no restart policy. When the stem has stopped by itself, ./one talk says so and gives its exit status, ./one logs shows what it last printed, and the next ./one up shows that once more before it starts again.
Settings, in .env:
| Variable | Meaning |
|---|---|
TENERAL_PROVIDER |
Which provider: chatgpt, openai or compatible. Written by ./one setup. Unset, or anything else: compatible. |
TENERAL_BASE_URL |
The endpoint, such as https://host/v1. Required, except for chatgpt, whose address is stored with the sign-in. |
TENERAL_API_KEY |
The key for it. Required, except for chatgpt, which must not have one. |
TENERAL_MODEL |
The model's name. Required. It must support tool calls. |
TENERAL_HEARTBEAT_MINUTES |
Minutes between clock stimuli. Default 30; 0 turns the clock off. A tick is given only while the agent is at rest and its agenda holds something it can act on. |
TENERAL_REST_MINUTES |
Minutes of your silence after which the agent is at rest: it then forms its memories, looks ahead and gets its ticks. While you are talking with it none of that runs. Default 10; 0 means always at rest. |
TENERAL_RAYBOARD_AMBIENT |
0: talk in a Rayboard channel that does not mention the agent never wakes it. Unset: as on Zulip, it is woken once such talk has paused. |
TENERAL_BACKGROUND |
serial: a memory being formed is cancelled when something arrives, and formed again later. Unset: it goes on beside the turn that answers, and is journaled when that turn is over. Set it for a provider that refuses two requests at once. |
TENERAL_SUBAGENTS |
How many subagents the agent may have running at a time. Unset: 3. See Subagents. |
TENERAL_SUBAGENT_STEPS |
Steps one subagent may take: a request to the model and the calls it asked for. Unset: 30. At the limit it is asked once more, with no tools, for what it has. |
TENERAL_SUBAGENT_MINUTES |
How long one subagent may run. Unset: 15. |
TENERAL_SUBAGENT_TOKENS |
Tokens one subagent may be charged, in and out together. Unset: 2000000. |
TENERAL_SUBAGENT_MODEL |
A model for subagents other than the agent's own, at the same provider. Unset: the agent's model. |
TENERAL_ZULIP_AMBIENT |
0: talk in a Zulip channel that does not mention the agent never wakes it. Unset: it is woken once such talk has paused, and may join in or stay silent. |
TENERAL_CONTEXT_CHARS |
Characters of context sent per request at most. Default 250000. Lower it when the agent reports that the conversation no longer fits the model. |
TENERAL_LOGBOOK_CHARS |
Characters the agent's memories of older episodes may take in a request; past it the oldest are made into wider ones. Default: about an eighth of what a request may hold for the model in use, between 50000 and 100000. |
TENERAL_TAIL_CHARS |
Characters of the conversation shown to the model word for word; what is older is shown as the agent's memories of it, which take a few lines an episode. Default: a quarter of what a request may hold for the model in use, between 100000 and 250000. Everything in a request is read again at each step of a turn, so this number is most of what a step costs and how long the first reply after a pause takes. |
TENERAL_OWN_TOKENS_DAY |
Tokens a day the agent may spend in time of its own, the turns a clock tick wakes it for. Past it there are no ticks until the day has moved on; what arrives is answered all the same. Unset: no cap. |
TENERAL_REPORT_HOURS |
Hours between the agent's reports to you of what it did on its own: one short message, by the way it chooses, and only when there is something to tell. Default 24; 0 for none. |
TENERAL_CHECK_MINUTES |
Minutes one check of a mutation (the type check, the tests of everything outside the body, the agent's own tests) may run before the stem stops it and refuses the mutation. Default 10; 0 for no limit. Raise it when the agent's own tests have grown past that. |
TENERAL_SMOKE_SECONDS |
Seconds the smoke run has to become ready and reply. Default 30; 0 for no limit. Raise it for a body that takes long to start. |
TENERAL_UPSTREAM |
Which ref is the species: <remote>/<branch> or a local branch. Default origin/main when there is a remote origin, else the branch this checkout is on. |
TENERAL_APPROVAL |
Whether a mutation may change anything outside the body, the stem included: ask (the default: you approve each such commit first), auto, or off. |
TENERAL_FORK |
Your fork of the species, as owner/name, where offers are pushed. Unset: your repository of the species' name, found by asking GitHub whose token it is. |
TENERAL_PUBLISH |
Whether the agent may offer changes to the species and report on others': ask (the default; you approve each commit), auto or off. See Offering a change to the species. |
./one setup writes the first four; .env.example shows the file for writing it by hand. Write values without quotes and without a comment after them: Docker passes the whole line on as written. The file is read when the container starts, so a change takes ./one down and ./one up; the exception is the first four, which a running agent takes up by itself.
To start over as a new individual, run ./one down, delete soul/, memory/, inbox/ and .teneral/, then run git worktree prune and git branch -D lineage/local. A ChatGPT sign-in lives in .teneral/auth/ and goes with it, and so do the individual's signing key and your GitHub token; keep that directory to stay signed in.
The agent can start workers of its own with its subagent tool. Each does one task beside the agent's own turns and outlives the turn that started it. A subagent has the agent's hands (read, write, edit, look, bash) and nothing else: it cannot mutate, speak in a chat, touch the agent's memory or agenda, or start a subagent of its own. It knows only the task the agent wrote for it.
It never works in the agent's workspace. Each gets a copy of it as it stands, uncommitted work included, and what it changed comes back as the branch subagent/<name>, holding one commit, which the agent looks at and takes with git cherry-pick or leaves. Two subagents, or a subagent and the agent, cannot write over each other, and a name is not used again while the branch of an earlier one still stands.
Started without hands (hands: none) a subagent is a reader: no tools and no copy of the workspace, only the task and a text the agent passes it. That is how the agent has text nobody vouches for read by something that cannot act on what the text says.
When one ends the agent is woken and told, with its report and the branch. The report is a worker's word, not yours, and the agent is told so. One that ran out of steps, time or tokens is asked once more for what it had, so none comes back with nothing.
A few run at a time (TENERAL_SUBAGENTS); one started beyond that waits for a place and starts by itself, and up to ten may wait. When the provider refuses a request for its rate, the request is asked again after a wait and half as many run at a time, one more again after some answers with no refusal. When the body is restarted, by you, by a change of model or by a crash, a subagent goes on afterwards from its own journal in the copy it had, told that it was restarted; one of an earlier generation, whose code is no longer the body's, is closed as cut off, with its last words. What subagents cost is a row of its own in /usage, and those the agent started in time of its own count towards TENERAL_OWN_TOKENS_DAY. Its whole journal stays in .teneral/subagents/<name>-<id>/journal.jsonl.
In ./one talk each running subagent has a row over the input box, with its name and its task, and the jobs action under the footer counts them with the commands the agent left running. The limits are settings: TENERAL_SUBAGENTS, TENERAL_SUBAGENT_STEPS, TENERAL_SUBAGENT_MINUTES, TENERAL_SUBAGENT_TOKENS, and TENERAL_SUBAGENT_MODEL for a cheaper model.
Which model the agent thinks with, and where it comes from, is four lines of .env: TENERAL_PROVIDER, TENERAL_BASE_URL, TENERAL_API_KEY and TENERAL_MODEL. The stem looks at the file every two seconds. When those lines say something else than before, and nothing an agent needs is missing from them, it stops the agent's body and starts it again with the new ones. Nothing else restarts: not the container, not the stem, not ./one talk. The journal is the agent's memory, so the conversation goes on where it was, and a turn that was in progress begins again from what the journal holds of it. This is not counted as a crash, and the journal gets a note of kind provider.changed with the provider and the model, never the key. A file that is incomplete (a key taken out, a sign-in not made) changes nothing; ./one logs says what is missing, and the agent goes on as it was.
There are three ways to change those lines:
/model <name>in./one talk, for another model of the same provider. The model is first asked the setup's two test requests, with the key or the sign-in the agent itself uses, and.envis written only when both come back right; otherwise nothing changes and the reason is shown./modelalone says which model and provider are configured, and/model listasks the provider which models it has for you../one setup, in another terminal, for another provider, a new key or a new sign-in. It tests before it writes, as always, and the running agent takes up what it wrote.- Editing
.envby hand. Nothing is tested then: a model's name the provider does not know shows in./one talkas an agent that cannot get an answer from its model, and putting the line right mends it the same way.
Only those four lines are taken up while the agent runs; every other setting still waits for ./one down and ./one up. A variable you gave the container yourself, through ONE_DOCKER_ARGS, stands until .env is next changed. A provider that refuses two requests at once may refuse /model's test while the agent is in the middle of a turn: try it when the agent is at rest.
./one talk runs a small client, keeper/talk.ts, inside the agent's container (what it draws at a terminal is in keeper/tui/); it is the running generation's own, like the rest of its stem. Each line you enter becomes a file in .teneral/owner/, which the agent reads within a quarter of a second and takes exactly as a line typed at its own terminal. What you see is read back from the journal. There is no connection between the client and the agent to break, which is why you can leave and come back, and why a line entered just before a mutation or a crash is not lost: the file stays until it is in the journal.
An interrupt is a file in the same directory whose name ends in .interrupt and which holds nothing. Its name alone makes it one. A line is always written under a name ending in .txt, so nothing you type, and nothing a client forwards as text, can be taken for an interrupt, whatever it says; and a body from before interrupts reads the file as an empty line and drops it. Your acceptance of a species commit is a third kind of file there, read by the stem and by no body; see The species.
Nothing is signed. Whoever can write to .teneral/owner/ speaks as the owner, and that includes the agent's own shell. inbox/ is the other door, for everyone else: what arrives there is shown to the agent as coming from another agent and is not to be obeyed.
The agent runs shell commands. ./one builds an image (Bun, git, a few standard tools, curl, clang and make for organs, gh, jq, and a browser of the agent's own: Chromium without a window, about 600 MB of the image, for the pages a person would open by hand, such as signing in to an account you made for the agent; what it is signed in to is kept in .teneral/browser/, as private as .teneral/auth/) and runs the agent in a container that can see this directory and nothing else of your machine: not your home directory, not your keys, not your other projects. It runs as your user id, so the files it writes here stay yours, with every capability dropped. Anything it writes outside this directory is gone when the container is removed. Run it that way.
What the container does not do: it does not stop the agent from changing files inside this directory, including the stem that supervises it, if it goes around the mutation path. It sets no limit on memory or on the number of processes, so a runaway command inside the container can exhaust the machine's memory or process table; ONE_DOCKER_ARGS="--memory 4g --pids-limit 512" puts limits back if you want them. The network is also open, because the agent has to reach its model. Whatever it can read here, including its own API key or the tokens of a ChatGPT sign-in, it could send elsewhere.
./one run <command> runs that command in a fresh container of the same kind instead of the agent: ./one run bun test, ./one run bash. It can run beside the agent. The agent's own container is named teneral- and the name of this directory, so a second agent for the same directory, or for another directory of the same name, is refused. ONE_DOCKER_ARGS in the environment adds options to docker run, for a host that needs them or for limits you want; a normal run needs none.
Worktrees record absolute paths, and inside the container this directory is /teneral. The stem mends those records at every start, so this directory can be moved while the agent is down, and an individual raised with ./one can later be started without it, or the other way round. What it cannot mend is a record that is gone: do not run git worktree prune here from outside the container while the individual's paths are the container's. Git would not find /teneral and would forget its worktrees. (git gc does the same to worktrees it has not found for three months; the stem switches that off in this repository's git config, with gc.worktreePruneExpire never.)
A peer's inbox in soul/peers.json has to be a path the agent can see, and in the container that means inside this directory. Dropping files into inbox/ from outside works as it is.
To run without the container, on a machine you are willing to hand over, you need Bun 1.4 and git: bun install, bun keeper/setup.ts for the setup, then bun start, which is the launcher. That runs in the foreground, as ./one fg does. bun stem/launcher.ts home prints where the current generation's stem is, . or .teneral/live; bun <that>/keeper/talk.ts in a second terminal is what ./one talk is, and bun <that>/keeper/back.ts, with the agent stopped, and bun <that>/keeper/approve.ts are ./one back and ./one approve. There the agent's shell has everything your account has.
- The stem guards against mistakes, not against intent. The body has a shell and runs as the same user as the stem, in the same container. A mutation changes the stem only with your approval, but a shell command can edit
.teneral/live, the journal,.teneral/state.jsonor the file that records your approval directly; and a stem you approved is from then on the one that keeps, or drops, every rule here. Nothing stops a body that goes around the mutation path. - Messages between agents are unsigned. The
fromon a message is whatever the sender wrote. - Only the memory is measured. A mutation of the memory is held against the exam (see Memory). For everything else the checks only show that a generation is not broken: it type-checks, its tests pass, it starts and answers one message from a stand-in model. Whether it is an improvement is for you and the agent to judge from the journal.
- The memory is young. Its exam asks only what the agent thought to ask, its third measure counts words and not meaning, and the thresholds of its health are first guesses. A memory formed by a model can be wrong; the journal beside it is what happened.
BACKLOG.md lists these and the smaller known faults of the seed. It is not a list of what to do: an agent has one such list, its agenda (see Memory). A fault the agent takes on becomes an intention there, and the mutation that mends it takes the item out of the file.
main is the shared starting point, and stays the species your individual descends from. Once you run it, your agent commits to its own lineage/local branch and diverges, in its body and, with your approval, in its stem, and takes what the species gains later by merging it. Its journal, its soul and its branch stay on your machine; the stem never pushes. The one thing that can leave is a change the agent offers back, and only as a branch made for that, with your approval.
The species is this repository where it is published, and its main changes in one way only: a human reads a pull request, merges it on their own machine, signs the merge and pushes it. No individual writes to main. What an individual can do, when it has built something that would serve any individual, is offer it.
A lineage also holds what is nobody else's business: sensors for its owner's things, notes, names. So an offer is never the lineage. It is a branch the agent starts at the species' head and fills with one change and nothing else. It may touch any path, the stem included, which no mutation can: it is a proposal, and a human decides about it.
-
Prepare. The agent makes a branch
offer/<name>at the species' head (origin/main;TENERAL_UPSTREAMnames another), in a checkout of its own, and commits the change there. The last commit's message becomes the pull request: its first line the title, and after it a line starting with each ofWhat it changes:,Why:,Evidence:andNot verified:.bun species/offer.ts sign offer/<name>signs the branch's commits with the individual's key. -
Check.
bun species/offer.ts check offer/<name>looks at the branch as a stranger would, and refuses it unless:- it descends from the species' head, so that it holds the offer and nothing older;
- every commit on it is signed with this individual's key, and the last one describes the offer as above;
- a scan of everything it would publish finds nothing that looks private (see below);
- the gates of a mutation pass on it as on a fresh seed: its organs as it pins them, the type check, the tests of everything outside the body, the agent's own tests, the smoke run. The rule about which paths wait for an owner's approval is not applied.
It prints what would be published: the commits, each changed file with its size, the paths outside the body, and the result of each check. The same is kept in
.teneral/offers/<commit>.json. -
Approve. Publishing is public and cannot be taken back, so it is yours to allow.
TENERAL_PUBLISHin.envsays how:TENERAL_PUBLISHask(the default)nothing goes out until you approve exactly that commit autoa commit that passed the check goes out when the agent publishes it offnothing goes out, approved or not The agent tells you what it wants to offer. The stem's own account of it, read from git and not from what the agent said, is
/offersin./one talk, or./one offer list;/approve <commit>there, or./one offer approve <commit>at a terminal, approves one, named by the first seven or more characters of its commit. An approval is an empty file,.teneral/owner/.approved/<commit>.approve: it is for that commit and no other, so a branch that changed afterwards waits again, and it is used up by the publishing it allowed. Nothing typed as a line and nothing that arrives throughinbox/is an approval, whatever it says. The setting is read from.envitself at each command, so a variable set in the agent's shell does not change it. -
Publish.
bun species/offer.ts publish offer/<name>pushes the commit tocontrib/<individual id>/<name>in your fork of the species and opens a pull request from there against the species'main, through GitHub's REST API, asteneral/<version>. You need no right to write to the species' repository. The fork is found by asking GitHub whose token it is: your repository of the species' name, when it is a fork of the species;TENERAL_FORKin.envnames it outright when it is called something else. Without a fork the agent is told to ask you for one, which is one click on the species' page; a maintainer, who may push to the species and has no fork, publishes there directly. The text is the agent's, from the commit message; under it the stem adds who offers it, the commit, the key's fingerprint and what its install checked. The journal gets anoffer.publishedevent with the commit, the branch and the pull request's address. If the species has moved on at its home since the check, nothing is pushed and the agent is told to rebase. Every step can be run again: a failure after the push leaves the branch there, keeps the approval, and the next run goes on from it. -
Witness.
bun species/offer.ts witness <number>is for somebody else's offer: it fetches the open pull request and the branch it is against, runs the same check on its head in this install (signed by any key; whose, nothing here knows), optionally one more command of the witness's own (--also '<command>', run in a checkout of that head), and posts the result as a comment: pass or fail for each check, the bun, git and platform it ran on, and an SSH signature of exactly that text. What the code printed is kept here and never posted. The sameTENERAL_PUBLISHapplies: underaskyou approve the pull request's head commit first, and nothing of it is run before you do. A witness report is evidence for the human who merges. It is not a vote, nothing counts them, and nothing checks who the witness is.
What the scan looks for, in every path a commit touches, every line a commit adds and every commit message, so also in what a later commit removes again:
- a path under
soul/,memory/,inbox/ornode_modules/, a path with.teneralor.envin it, a file named the way key files are (id_ed25519,*.pem, ...), and a path whose first part is not at the top of the species: a new top-level file or directory is for the maintainer to add; - this install's own secrets, literally: what
.envand the environment hold under a name that says key, token, secret or password, and the tokens, the owner's e-mail address and the keys in.teneral/auth/; - strings shaped like a credential: a private key's first line, a GitHub token, an
sk-...key, an AWS key id, a Slack token, a signed web token, an address with a password in it, and a quoted literal of 24 or more characters given to a name that says secret, token, key or password.
What it does not catch: anything private that is prose (a name, an address, something you said to the agent), a secret that is encoded, split, or shaped unlike the above, anything inside a file git takes for binary (those are named in the report, unread), and somebody else's secret that has no known shape. It is a net for mistakes. Under ask, you reading the report is the check; under auto there is none beyond the net.
Both lie in .teneral/auth/, readable only by your user.
-
A signing key per individual: an ed25519 SSH key,
offer-keyandoffer-key.pub, made the first time it is needed and never replaced. Commits are signed with it the way git signs with SSH keys (gpg.format=ssh), and so is the text of a witness report../one offer keyprints the public half and how to use it: add it to your GitHub account as a signing key and GitHub can mark the commits as verified; give it to the maintainer and they can check a commit withgit verify-commitagainst a file of the keys they know. -
A GitHub token,
github-token, which you type into./one offer token. It is not shown as you type, it is tried once against the repository before it is stored, and it is never put into an environment, an argument, git's configuration, the journal or anything printed: git is handed it by a small program made for that one command, and requests to the API carry it in a header. In the container the agent's owngitandghare signed in to github.com with it the same way, a program reading the file at each use, so the agent can push its branches and open pull requests in other repositories that account may write to: the token is the agent's GitHub account for its work, so store one whose reach you mean it to have.The simplest way to give the agent its account is not a token you make:
./one setupends with that step,./one setup githubis the step alone, at any time and with no restart, and/login githubin./one talkis the same from inside the conversation (/loginalone says who the agent is there; the account that came back is stored only when you confirm it by its name). Make an account for the agent at github.com, run it, and type the one-time code it shows at github.com/login/device in a browser where you are logged in as the agent's account. The setup names the account that came back and asks whether it is the agent's own before anything is stored; say no if it is yours. The code is asked for by GitHub's owngh, so the token is one of its app's (scopesrepo,read:org,gist); an organisation that restricts third-party apps has to allow GitHub CLI for the agent to reach its repositories. The agent is told which account it holds when it first sees it and whenever it changes, and accepts invitations to repositories for it by itself. Make it a classic personal access token with thepublic_reposcope: it may push to your fork and open a pull request on the species' repository, and that is what an offer needs. A fine-grained token limited to your fork can push there, but GitHub may refuse it the pull request on a repository that is not yours; if it does, the agent is told so in GitHub's own words.Your account needs write access to the species' repository for that token to push there, which the maintainer gives. GitHub cannot limit a token to some branches: this one could push to
mainas far as the token goes. What keeps it out is the protection ofmainat the repository, set up by the maintainer (below), not anything here.
What these prove, and what they do not. The agent has a shell in the directory where the key, the token and the approvals lie. The stem's commands keep an honest agent from publishing by mistake what it should not; they do not stop a body that goes around them, any more than the mutation path stops one that edits the stem. So a signature says "this came from that individual's install", and never "this content is safe" or "its owner read it". The safety of the species comes from the human who reads the change and merges it.
Not verified against GitHub. All of this was written from GitHub's documentation and tried only against a stand-in: a repository served by git's own HTTP server, and the REST endpoints as the documentation describes them. No request was ever made to GitHub. The first real offer is where a wrong assumption shows: that these two permissions are enough for the push, the pull request and the comment; that a pull request that already exists for the branch is refused with status 422 and the words "already exists"; that refs/pull/<number>/head can be fetched; that GitHub marks an SSH-signed commit as verified once the key is a signing key of the committer's account.
.github/workflows/gates.yml runs on every pull request, on its head: the type check, the tests of everything outside the body, the agent's own tests, and then bun species/offer.ts gates, which is the gate run of a mutation as the stem does it, ending with the smoke run against the stand-in for the model. It has read-only permissions and uses no secret. A second job lists the paths the pull request changes outside body/, brain/, their tests and BACKLOG.md, as a warning on the run and in its summary, so that a change to the stem is seen at a glance; it never fails. What runs is the pull request's own workflow, code and tests: a green run says the change is consistent with itself, and a change to the stem, or to the workflow, is exactly where that says least.
The maintainer is the one human who merges. For each pull request: read the change; look at the run of gates, at the paths warning, and at the witness reports if there are any (to see which key signed one: put its two blocks into two files, each line followed by a line break, and run ssh-keygen -Y check-novalidate -n teneral-witness -s <signature> < <report>); verify the commits' signatures against the keys you were given, if you keep such a file (git -c gpg.ssh.allowedSignersFile=<file> verify-commit <commit>); then merge locally, sign, and push:
git fetch origin
git checkout main && git merge --ff-only origin/main
git fetch origin pull/<number>/head
git merge --no-ff -S FETCH_HEAD
git push origin main
GitHub closes the pull request as merged when its commits arrive on main.
Settings to enable on the repository, since they and not the individuals' tokens are what keeps main closed. They are given as rulesets (Settings, Rules, Rulesets), which also exist for a repository owned by a person; the names are GitHub's:
- A ruleset for the default branch with Restrict updates, Restrict deletions and Block force pushes, and the repository admin role, which is you, as the only entry in its bypass list. Collaborators with write access then cannot move
main; you can. - A second ruleset for the default branch with Require signed commits and no bypass, so that your own merges are refused unsigned as well. GitHub then wants every commit that arrives on
mainto carry a signature it can verify, the individual's commits included. So either the owner has added the individual's key to their GitHub account as a signing key, or you take the change in as one commit of your own (git merge --squash origin/contrib/<individual id>/<name>, thengit commit -S) and close the pull request by hand, naming that commit. - A ruleset for all branches with Restrict creations, Restrict updates and Restrict deletions, bypass for the admin role. Offers arrive from forks, so nobody but you needs to write here at all.
- Not "Require a pull request before merging" on
main: the merge is made locally, and that rule would refuse your push. - Settings, Actions, General: workflow permissions Read repository contents, and keep no secrets in this repository's Actions. A pull request from a fork is given no secrets by GitHub, and the workflow here asks for none; require approval for workflow runs from first-time contributors, which is GitHub's default for public repositories.
MIT. Copyright (c) 2026 Rayforce Technologies Inc. See LICENSE.