@turri-dev/cli 0.2.4-next.efe96fe → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +2 -2
  2. package/dist/chat-skills.d.ts +1 -1
  3. package/dist/chat-skills.js +1 -1
  4. package/dist/chats.d.ts +42 -8
  5. package/dist/chats.js +122 -38
  6. package/dist/cli.js +1 -1
  7. package/dist/config-edit.js +4 -4
  8. package/dist/config.d.ts +48 -11
  9. package/dist/config.js +102 -13
  10. package/dist/extension.d.ts +22 -2
  11. package/dist/extension.js +225 -125
  12. package/dist/genome.js +1 -1
  13. package/dist/host-session.d.ts +6 -5
  14. package/dist/host-session.js +2 -2
  15. package/dist/host.d.ts +2 -0
  16. package/dist/identity.js +2 -2
  17. package/dist/init-config.d.ts +1 -1
  18. package/dist/init-config.js +7 -7
  19. package/dist/launch-agent.d.ts +51 -0
  20. package/dist/launch-agent.js +267 -0
  21. package/dist/{release-cli.js → launch-cli.js} +41 -24
  22. package/dist/launch-session.d.ts +68 -0
  23. package/dist/launch-session.js +217 -0
  24. package/dist/launch-tools.d.ts +28 -0
  25. package/dist/launch-tools.js +69 -0
  26. package/dist/launch-track.d.ts +125 -0
  27. package/dist/launch-track.js +320 -0
  28. package/dist/loop-cli.js +4 -4
  29. package/dist/loop-tools.d.ts +8 -3
  30. package/dist/loop-tools.js +37 -32
  31. package/dist/notice.d.ts +7 -6
  32. package/dist/plain-files.d.ts +2 -2
  33. package/dist/plain-files.js +3 -3
  34. package/dist/regenerate/command-check.d.ts +7 -1
  35. package/dist/regenerate/command-check.js +43 -1
  36. package/dist/regenerate/delivery.d.ts +1 -1
  37. package/dist/regenerate/delivery.js +3 -3
  38. package/dist/regenerate/launch.d.ts +154 -0
  39. package/dist/regenerate/{release.js → launch.js} +195 -51
  40. package/dist/regenerate/ledger.d.ts +32 -1
  41. package/dist/regenerate/lineage.d.ts +2 -0
  42. package/dist/regenerate/lineage.js +8 -0
  43. package/dist/regenerate/loop.d.ts +18 -7
  44. package/dist/regenerate/loop.js +28 -22
  45. package/dist/regenerate/paths.d.ts +2 -2
  46. package/dist/regenerate/paths.js +2 -2
  47. package/dist/self-invocation.js +7 -7
  48. package/dist/sentinel-check.d.ts +3 -3
  49. package/dist/sentinel-check.js +3 -3
  50. package/dist/sentinel.d.ts +18 -12
  51. package/dist/sentinel.js +68 -42
  52. package/docs/README.md +2 -2
  53. package/docs/chats.md +2 -2
  54. package/docs/config.md +9 -9
  55. package/docs/development.md +1 -1
  56. package/docs/headless.md +1 -1
  57. package/docs/hosting.md +14 -13
  58. package/docs/launch.md +67 -0
  59. package/docs/parser.md +1 -1
  60. package/docs/regenerating.md +3 -3
  61. package/docs/sandbox.md +3 -3
  62. package/docs/sentinel.md +24 -12
  63. package/docs/skills-and-gates.md +3 -3
  64. package/docs/using.md +8 -8
  65. package/genome/rules/turri-regeneration.md +1 -1
  66. package/package.json +1 -1
  67. package/dist/regenerate/release.d.ts +0 -121
  68. package/dist/release-agent.d.ts +0 -43
  69. package/dist/release-agent.js +0 -130
  70. package/dist/release-tools.d.ts +0 -44
  71. package/dist/release-tools.js +0 -170
  72. package/docs/deploy.md +0 -48
  73. /package/dist/{release-cli.d.ts → launch-cli.d.ts} +0 -0
package/docs/config.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # The project config
2
2
 
3
- A project says how its \*\*\*plain is built in `config.turri.yaml`, at the project root. Everything in it is optional: with no file at all, turri finds the testing scripts on its own, turns conformance tests on wherever a module has test reqs, and runs on [pi](https://pi.dev)'s configured model. A project whose parts are on different stacks - a backend and a frontend - gives a module a file of its own, `config.turri.<module>.yaml`, beside it, which builds that module and those built on it (see [a module's own config](#a-modules-own-config)). turri never writes a `config.yaml`: it may be another tool's, and is read only by a project that has no file of turri's yet (see [the old config.yaml](#the-old-configyaml)). A key in `config.turri.yaml` or a module's file that turri reads nothing of - a setting it no longer has, like `test-advisor`, or one misspelt - is named in a warning under the banner as turri starts, rather than ignored without a word.
3
+ A project says how its \*\*\*plain is built in `config.turri.yaml`, at the project root. Everything in it is optional: with no file at all, turri finds the testing scripts on its own, turns conformance tests on wherever a module has test reqs, and runs on [pi](https://pi.dev)'s configured model. A project whose parts are on different stacks - a backend and a frontend - gives a module a file of its own, `config.turri.<module>.yaml`, beside it, which builds that module and those built on it (see [a module's own config](#a-modules-own-config)). turri never writes a `config.yaml`: it may be another tool's, and is read only by a project that has no file of turri's yet (see [the old config.yaml](#the-old-configyaml)). A key in `config.turri.yaml` or a module's file that turri reads nothing of - a setting it no longer has, like `test-advisor`, or one misspelt - is named in a warning under the banner as turri starts, rather than ignored without a word. A key turri has renamed is renamed in the file itself as turri first reads or writes the project's config - `release-after-pulse`, now `launch-after-pulse` - its value and its comment kept, and the banner says so; a file that sets the new name too is left as it is, the banner saying the old one does nothing.
4
4
 
5
5
  `turri init-config` starts one: the two models, a strong one to talk to and a smaller one to write the code. It asks which vendor's models you use - `--vendor` says it without asking, and with neither, as from a script, it is `other`:
6
6
 
@@ -64,7 +64,7 @@ Each change says when it takes effect. None needs turri started again - what tur
64
64
  | the next pulse - one running keeps what it started with | `coding-model`, `judge-model`, every other `models.<role>`, `review`, `mutation-testing`, `turn-limit`, `compact-at`, `agent-env`, `toolchains`, `debug` |
65
65
  | the next time the work is planned | `max-specs-per-pulse`, `max-lines-per-pulse` |
66
66
  | the next test run - the running pulse's too | the testing scripts, `testing-scripts-run-on` |
67
- | the next pulse that lands - the running one too | `release-after-pulse`, `sentinel` |
67
+ | the next pulse that lands - the running one too | `launch-after-pulse`, `sentinel` |
68
68
  | the next regeneration that names no `.plain` file | `module` |
69
69
  | the next time turri starts here | `ledger-keep`, `cache-keep` |
70
70
 
@@ -106,8 +106,8 @@ models: # each agent role's model, thinking and tur
106
106
  | `mutation-testing` | `true` or `false`: whether the coding agent and the reviewer have `can_it_fail` - one change put in the code for one run of the unit testing script, to see that a test catches it; on a copy of the code, or in place and put back after the run (see [regenerating the code](regenerating.md#checking-its-own-work)). `turri regenerate --mutation-testing false` for one run | `true` |
107
107
  | `rules-off` | a list of rule names - `integrations`, `concise-specs`, the files of `genome/rules/` without `.md` - left out of the conversation's prompt and every \*\*\*plain-writing agent's: a rule this project's own skills or AGENTS.md replace, such as one that says to probe a live API before any \*\*\*plain is written. `turri init-config` writes it with `integration-embedded`, `integration-embedded-testing` and `integration-standalone` - take them out when the project writes an integration against a REST API. The project's alone | none |
108
108
  | `allow-to-stop-jobs` | `true` or `false`: whether turri stops a running job \*\*\*plain has moved on from - a functional spec it regenerates changed, or a file one links was edited - rolls it back and regenerates \*\*\*plain as it now is. `false`: the job runs to its end and lands, and what changed since is regenerated on top of it by the next job - see [regenerating the code](regenerating.md). Your own `halt` stops a job either way | `true` |
109
- | `release-after-pulse` | `true` or `false`: whether every pulse that lands code releases it, in the chat, as its last stage - before the module's next pulse starts, whatever the chat is doing: an agent on the coding model releases it, following the project's release guidance as the chat finds it (what was passed to `release` this conversation, AGENTS.md, the project's skills) for how, or to `dist/<module>` without any - see [deploy](deploy.md#after-every-pulse). One release a pulse that lands; a release that fails is said in the pulse's report, and what it landed stays. `turri init-config` writes `true` | `false` |
110
- | `sentinel` | `ask`, `true` or `false`: whether a chat of turri's own, the sentinel, gets every pulse that finishes - checks it, tests what was released under `release-after-pulse`, and puts what needs you as a notice in the chat you are in - instead of the chat that asked for it. `ask`: you are asked, with what it does, before it first opens in a session - see [starting it](sentinel.md#starting-it); `true`: it opens without asking. `/sentinel` sets it from the chat. `turri init-config` writes `ask` | `ask` |
109
+ | `launch-after-pulse` | `true` or `false`: whether every pulse that lands code is launched, in the chat, in the background - the pulse ends as it lands, and the codebase's next pulse does not wait: the commit it landed goes on the [launch track](launch.md#the-launch-track), one launch of a codebase at a time, the newest commit winning. An agent on the coding model launches it, following the project's launch guidance (what was passed to `launch` this session, AGENTS.md, the project's skills) for how, or from `dist/<module>` without any - see [launch](launch.md#after-every-pulse). The sentinel tests each pulse in a launch that holds its commit; with it off, the chat is told how each launch went. `turri init-config` writes `true`. Formerly `release-after-pulse`: a file that still has it has it renamed as turri first reads it | `false` |
110
+ | `sentinel` | `ask`, `true` or `false`: whether a chat of turri's own, the sentinel, gets every pulse that finishes - checks it, tests what was launched under `launch-after-pulse`, and puts what needs you as a notice in the chat you are in - instead of the chat that asked for it. `ask`: you are asked, with what it does, before it first opens in a session - see [starting it](sentinel.md#starting-it); `true`: it opens without asking. `/sentinel` sets it from the chat. `turri init-config` writes `ask` | `ask` |
111
111
  | `conformance-tests` | whether functional specs are conformance tested - black-box tests of the built software against the scenarios of their test plain files, run with the whole suite as more lands. `false`: none - no scenarios written or tested, no conformance testing script, and the chat's `conform` refused. Off by default for fast iteration - they make each change take about twice as long - and turned on by the person, with `/conform` - see [conformance tests](#conformance-tests). A module's `config.turri.<module>.yaml` can set its own | `false` |
112
112
  | `test-dir` | the folder of the test plain files, by path from the project root: a module's are every `.plain` file in `<test-dir>/<module>/`, each a functional spec's conformance and acceptance scenarios - see [test plain files](parser.md#test-plain-files). A module's `config.turri.<module>.yaml` can set its own | `tests` |
113
113
  | `base-folder` | a folder, by path from the project root, that a codebase requiring no other module starts from instead of nothing - an existing codebase to build on, files to use (images, animations, fonts), or both. It is copied in once, before the codebase's first pulse, and never written to: from a git repo what git sees, else every file but `.git` and installed dependencies. The \*\*\*plain may refer to it, and link into it; a codebase built on another starts from that one's code, base folder and all. A module's `config.turri.<module>.yaml` can name its own - see [the base folder](regenerating.md#the-base-folder) | none: the codebase starts empty |
@@ -137,10 +137,10 @@ Keys are written with dashes; underscores are read the same (`mutation_testing`)
137
137
  | --- | --- |
138
138
  | `default` | every role not named below - but the conversation's side |
139
139
  | `chat` | `turri`'s model - the same as `harness-model`, which it wins over |
140
- | `sentinel` | [the sentinel](sentinel.md): checks every finished pulse, and tests the release. Unnamed, the chat's model |
140
+ | `sentinel` | [the sentinel](sentinel.md): checks every finished pulse, and tests what was launched. Unnamed, the chat's model |
141
141
  | `planner` | the conversation's side: the planner's agents. Unnamed, the chat's model |
142
142
  | `diagnosis` | the diagnosis of a job that failed for good: why it did not land, and what to do. Unnamed, the coding model the job ran on, thinking medium |
143
- | `release` | `turri release`'s agent and release-after-pulse's: it follows steps - a script, a start command - so it runs on the coding model, thinking low |
143
+ | `launch` | the launch agent - the chat's `launch`, `turri launch` and launch-after-pulse's: it follows steps - a script, a start command - so it runs on the coding model, thinking low |
144
144
  | `coding` | the coding agent, the code fixer of a conformance run and the repair agent - the same as `coding-model`, which it wins over. `--model` on the command line, or a model a call to `regenerate` or `conform` names, wins over both |
145
145
  | `conformance` | the conformance agent |
146
146
  | `explorer` | the explorers of a conformance run |
@@ -152,7 +152,7 @@ Keys are written with dashes; underscores are read the same (`mutation_testing`)
152
152
 
153
153
  What an entry leaves out it takes from `default`: `reviewer: { thinking: low }` runs the default model, thinking little. A turn limit is the role's own, else `default`'s, else `turn-limit:`, else two minutes. A module's `config.turri.<module>.yaml` lays its own `models:` over the project's, role by role - all but `chat`, the project's alone.
154
154
 
155
- A role whose thinking nothing names - neither its entry, `default`'s, nor a `:level` on the model it runs on - thinks as its kind of work needs: **low** for the agents that do the work (`coding`, `conformance`, `explorer`, `release`), which work from \*\*\*plain that leaves little to guess and take many turns, and **medium** for the ones that judge (`reviewer`, `test-reviewer`, `judge`, `arbiter`, `debugger`, `planner`, `diagnosis`), where a wrong call costs pulses. A judging role that falls back on the coding model takes its model alone, not its thinking. The conversation keeps its own level, as [pi](https://pi.dev) sets it.
155
+ A role whose thinking nothing names - neither its entry, `default`'s, nor a `:level` on the model it runs on - thinks as its kind of work needs: **low** for the agents that do the work (`coding`, `conformance`, `explorer`, `launch`), which work from \*\*\*plain that leaves little to guess and take many turns, and **medium** for the ones that judge (`reviewer`, `test-reviewer`, `judge`, `arbiter`, `debugger`, `planner`, `diagnosis`), where a wrong call costs pulses. A judging role that falls back on the coding model takes its model alone, not its thinking. The conversation keeps its own level, as [pi](https://pi.dev) sets it.
156
156
 
157
157
  The thinking level reaches the model as each provider takes it. OpenAI's models on Bedrock are sent it as their reasoning effort (`none`, `low`, `medium`, `high`, `xhigh`) by turri itself, as [pi](https://pi.dev) sends them none.
158
158
 
@@ -213,13 +213,13 @@ turri writes much more than it needs to work, for a person working out why it di
213
213
  | | outside debug mode | in debug mode |
214
214
  | --- | --- | --- |
215
215
  | each pulse's log (`.turri/jobs/`) and its agents' (`.turri/debug/`) | written while the pulse runs - the diagnosis of a failure reads them - and removed as it ends | kept |
216
- | the logs of agents outside a pulse - the release agent, a side question | not written | kept |
216
+ | the logs of agents outside a pulse - the launch agent, a side question | not written | kept |
217
217
  | the agents' saved sessions (`.turri/sessions/`) | not written - each is kept in memory while it works; a gated skill's alone is saved, as its run resumes from it | kept |
218
218
  | whole outputs of test runs and services (`plain_modules/.turri/logs/`, `services/`) | read by the pulse's agents while it runs, removed as it ends | kept, the last 100 outputs |
219
219
  | a module's `TMPDIR` (`plain_modules/.turri/tmp/<module>`) | emptied as each of its pulses ends | kept |
220
220
  | dependencies installed in the modules below a pulse's own in its chain (`node_modules`, `.venv`) | removed as the pulse ends: the chain is built in its tip, and a module built on again installs them again, from the cache | kept |
221
221
 
222
- Kept either way: the ledger - what each pulse did, how it ended, what it cost (see [the ledger](using.md#the-ledger)) - and, for each pulse that failed or finished without landing, why: its report in `.turri/pulses/<id>.md` - its diagnosis, the stages that went wrong, the last failing test run's output, the last review that sent the work back, the tool calls that failed - which `pulses` tells with it in a later session, the newest 200 kept and none where `ledger-keep: 0`; the code, its tests and their history, a gated skill's run, what a conformance explorer found, what `deploy` started, and the package caches, held to `cache-keep:`. The testing scripts install what they run with themselves, so nothing removed is ever missed by a test run.
222
+ Kept either way: the ledger - what each pulse did, how it ended, what it cost (see [the ledger](using.md#the-ledger)) - and, for each pulse that failed or finished without landing, why: its report in `.turri/pulses/<id>.md` - its diagnosis, the stages that went wrong, the last failing test run's output, the last review that sent the work back, the tool calls that failed - which `pulses` tells with it in a later session, the newest 200 kept and none where `ledger-keep: 0`; the code, its tests and their history, a gated skill's run, what a conformance explorer found, what a launch started, and the package caches, held to `cache-keep:`. The testing scripts install what they run with themselves, so nothing removed is ever missed by a test run.
223
223
 
224
224
  Turn it on in `config.turri.yaml` (`debug: true`, or `/settings debug true`), or for one run with `TURRI_DEBUG=1` or `turri --debug`.
225
225
 
@@ -53,7 +53,7 @@ The workflow signs in to npm with npm's trusted publishing (OIDC), not a token:
53
53
  | `src/regenerate/chunk-plan.ts`, `src/regenerate/cases.ts` | cutting the work into jobs, and what a job's agents are told by its cases |
54
54
  | `src/regenerate/regression.ts` | the whole conformance suite run, and the repair agent that may not touch tests |
55
55
  | `src/regenerate/lineage.ts` | module history in `.plaingit` |
56
- | `src/regenerate/release.ts`, `src/release-tools.ts`, `src/release-cli.ts` | deploy: the last commit to `dist/<module>`, what installs software, what it starts on the host - see [deploy](deploy.md) |
56
+ | `src/regenerate/launch.ts`, `src/launch-track.ts`, `src/launch-session.ts`, `src/launch-agent.ts`, `src/launch-tools.ts`, `src/launch-cli.ts` | launch: a commit to `dist/<module>`, the launch track, the launch agent and what it starts on the host - see [launch](launch.md) |
57
57
  | `src/regenerate/confine.ts`, `src/regenerate/agent-shell.ts`, `src/regenerate/command-check.ts`, `src/regenerate/os-sandbox.ts`, `src/regenerate/audit.ts`, `src/regenerate/agent-env.ts`, `src/regenerate/shell.ts` | the file-tool fence and the walls around every agent command: the check, the OS sandbox, the audit, the module's environment, the host runner - see [sandbox](sandbox.md) |
58
58
  | `src/regenerate/model-names.ts` | resolving a model named as the person said it - for a call's `model` and the `settings` tool |
59
59
  | `src/regenerate/job-panel.ts`, `src/regenerate/transcript-view.ts`, `src/regenerate/diff-view.ts` | the job panel, the side panel's colours, and a \*\*\*plain diff as they show it - highlighted and banded |
package/docs/headless.md CHANGED
@@ -27,7 +27,7 @@ turri parse app.plain
27
27
  turri regenerate app.plain --model anthropic/claude-sonnet-5
28
28
  ```
29
29
 
30
- That builds every functionality in order - code and unit tests, then conformance tests when the module has `***test reqs***`, then every conformance test so far - and advances only when they pass. A module that `requires` others builds them first, bottom up. When it is done it prints `To try it: turri release <spec>` - see [deploy](deploy.md).
30
+ That builds every functionality in order - code and unit tests, then conformance tests when the module has `***test reqs***`, then every conformance test so far - and advances only when they pass. A module that `requires` others builds them first, bottom up. When it is done it prints `To try it: turri launch <spec>` - see [launch](launch.md).
31
31
 
32
32
  Keep it running when the terminal closes and the laptop would sleep, and keep the log:
33
33
 
package/docs/hosting.md CHANGED
@@ -120,7 +120,7 @@ const turri = await createTurri({
120
120
  pulseEndsShown: true, // the host shows each pulse that lands and each conclusion itself: the chat is told without a turn
121
121
  onChatSession: (chat, session) => {}, // a chat's session replaced, same id: the sentinel's, fresh for each pulse - follow this one
122
122
  sentinel: {
123
- tools: [browserTool], // the sentinel's own tools, beside turri's: what it tests a release with
123
+ tools: [browserTool], // the sentinel's own tools, beside turri's: what it tests a launch with
124
124
  surface: "...", // where the person watches it use them, in the host's words
125
125
  },
126
126
  });
@@ -133,7 +133,7 @@ await turri.interrupt(chat.id); // ctrl+c: "stopped" what it was doing, e
133
133
  await turri.decline(chat.id); // ctrl+c at a question: "declined", the turn going on - "none", "missing"
134
134
  turri.chats(); // [{ id, title, status: "idle" | "working" | "question" | "unread", shown, role? }]
135
135
  turri.notices(); // the notices open now
136
- turri.check({ module: "app", funcIds: ["add-task"] }); // the sentinel to test these in app's release: { check: id } or { refused: why }
136
+ turri.check({ module: "app", funcIds: ["add-task"] }); // the sentinel to test these in what is launched of app: { check: id } or { refused: why }
137
137
  turri.settingChoices("harness-model"); // every value /settings offers for a setting, whole: every model signed in to
138
138
  turri.settingChoices("harness-model", "openai/gpt-6-astra:"); // after a colon, that model's thinking levels
139
139
  turri.turnOnConformanceTests("app.plain"); // conformance tests on: the file written - config.turri.yaml, or the stack's
@@ -142,16 +142,17 @@ turri.onChats((chats) => {}); // a chat opened, closed, renamed, workin
142
142
  await turri.closeChat(chat.id); // its turn stopped, its conversation deleted - its pulses run on
143
143
  turri.jobs; // the session's job registry: every pulse any chat started
144
144
  turri.loop; // its work loop, once a chat is open
145
- await turri.dispose(); // every chat let go, what activate started stopped
145
+ await turri.dispose(); // every chat let go, what launches started stopped
146
146
  ```
147
147
 
148
- - **The chats.** Up to nine, each its own history, model, thinking level and stack, all on the session's one job registry and work loop - see [chats](chats.md). `openChat({ sessionFile })` reopens a saved one. A pulse's end goes to the sentinel (below), and is shown in the chat `focus` last named - its agent told of a pulse that landed only to say so and what the sentinel is doing with it, and not told of one that went wrong. What the `surface` says to do once something is released is then not done: the sentinel tests the release. With `sentinel: false`, it is told to the chat that asked for it, its agent reacting there - to the chat `focus` last named when that one is closed. A chat is never hidden from turri's side: what the host does not show, it still runs, and its questions go to the host's dialogs at once - the host decides where they wait. `status` says a turn is running (`working`) or that it said something since it was last focused (`unread`).
148
+ - **The chats.** Up to nine, each its own history, model, thinking level and stack, all on the session's one job registry and work loop - see [chats](chats.md). `openChat({ sessionFile })` reopens a saved one. A pulse's end goes to the sentinel (below), and is shown in the chat `focus` last named - its agent told of a pulse that landed only to say so and what the sentinel is doing with it, and not told of one that went wrong. What the `surface` says to do once something is launched is then not done after a pulse: the sentinel tests what was launched. With `sentinel: false`, it is told to the chat that asked for it, its agent reacting there - to the chat `focus` last named when that one is closed. A chat is never hidden from turri's side: what the host does not show, it still runs, and its questions go to the host's dialogs at once - the host decides where they wait. `status` says a turn is running (`working`) or that it said something since it was last focused (`unread`).
149
149
  - **Interrupting.** `interrupt(id)` is the terminal's ctrl+c for a host's key or button: it stops what that chat is doing - its turn, a skill or a tool in it, a `!` command, a compaction - and nothing in the other chats (`stopped`). A skill stopped keeps its run, to be continued. A question of the chat's open in the host's dialogs when its turn is stopped is over - declined - and its dialog's `signal` aborted, for the host to close it. A chat doing nothing ends the session, every chat with it, as `dispose` does (`ended`): turri never exits the host's process, so the host closes what showed it. An interrupt straight after one that stopped something is `ignored`, so pressing twice to be sure ends nothing. `session.abort()` is the chat's turn alone, and never ends the session.
150
150
  - **Declining a question.** `decline(id)` is ctrl+c at a question in turri's terminal: the question the chat asks now - its ask_user, a skill's interview, a review gate's escalation, whatever goes through the host's dialogs - declined. The asker is told "The user declined to answer the question." and the turn goes on; a review gate declined stands. It declines each question it is called at, however many in a row, and never stops the turn - that is `interrupt`. `none` when the chat asks nothing now, `missing` for a chat not open. A dialog that resolves with `undefined` is something else - dismissed, and in a question of several answers "done" with the boxes ticked so far.
151
151
  - **The record.** The chats are recorded in `.turri/chats.json` as the terminal records them, and `restore: true` reopens the last ended session's - without it, a host starts with none and deletes nothing. A chat closed is deleted; a session's chats are kept until five newer sessions have recorded theirs.
152
152
  - **The jobs.** The host is told of each job as it changes, and has the registry and the loop themselves, so it shows the very jobs the chats run. Its buttons are best a chat's commands - `session.prompt("/regenerate app.plain")`, `session.prompt("/conform app.plain app:add-task")` - so the plan is the chats', and no model turn stands between the button and the pulse. A job's \*\*\*plain diff is `job.diff`, and `job.diffWhere` places its lines in the `.plain` files: by a line's place in the diff, its `file`, its `line` there, the `section` it is in and `written` - the line as the file has it. The diff is \*\*\*plain as read, a link `[text](path)` in it as `` `[resource]text` ``, so a host that finds the lines again in a file's text - after an edit since the pulse started - matches them by `written`, never by the diff's text. A `job.diff` in a ledger written before `written` was added has none. `job.cases` is the functional specs the pulse covers, as planned, by what it does to each - `{ add, patch, again, delete }`, each a list of `{ module, funcId }`, `module` the pulse's own or one below it: new, changed, regenerated again with its text unchanged, taken out. A host lights those specs from it, and marks a line of the diff as regenerated again from `again` - never from the diff, where such a line is unchanged. A pulse of none is mechanical - reqs, or definitions none uses; a job that is not a pulse has no `cases`. The ledger's `job.queued` carries them too. `job.building` is the one functional spec a job is on now, when it is on one: `{ spec: { module, funcId }, label, text, since }` - `spec` the functional spec as data, `label` and `text` what the terminal shows (`core:add-task, functional spec of 3`, its text with its scenarios). Only a conformance run of one named functional spec sets it; a pulse the work loop plans covers its functional specs together and leaves it unset - light those from `cases`.
153
153
  - **The questions.** `dialogs(chat)` gives a chat's two dialogs: `select(title, options, context, at, { signal })` and `input(title, context, { signal })`, each resolving with the answer, or undefined when the person dismissed it. `signal` is aborted when the question is over without the dialog's answer - declined by `decline`, or its turn stopped (`interrupt`, `session.abort()`): the host closes the dialog it opened for it, whatever it resolves with then being ignored. A host may leave it unread. The chat's questions, a skill's interview and a review gate's escalation are put in them; without them, in the `uiContext`'s own dialogs.
154
- - **The surface.** What turri tells the model of where the person watches the work is the terminal's by default: regen, the side panel on `ctrl+h`, `/pulses`. In a host none of that is there, and the model would send the person to keys and panels that do not exist. `surface` is the host's own description of its UI - the views it has in place of the terminal's, what its marks and buttons mean, where questions appear - in its own words. Given, turri leaves every terminal instruction out of what the model is told and puts the surface in turri's identity, as a `<surface>` block, where the identity speaks of regen. It reaches the side questions and the tools' own words too: a pulse not found says the `pulses` tool lists them, not `/pulses`. Text only the person sees in the terminal - the job panel, the side panel - is the terminal's and stays as it is. Without `surface`, the prompt is the terminal's, byte for byte. What the conversation is to do once something is released belongs there too - open it in the host's preview, say what to test: with `sentinel: false`, after a pulse released under `release-after-pulse`, the conversation does what it was told to do once something is released. With the sentinel on, the sentinel tests the release, and the conversation only says it landed.
154
+ - **The surface.** What turri tells the model of where the person watches the work is the terminal's by default: regen, the side panel on `ctrl+h`, `/pulses`. In a host none of that is there, and the model would send the person to keys and panels that do not exist. `surface` is the host's own description of its UI - the views it has in place of the terminal's, what its marks and buttons mean, where questions appear - in its own words. Given, turri leaves every terminal instruction out of what the model is told and puts the surface in turri's identity, as a `<surface>` block, where the identity speaks of regen. It reaches the side questions and the tools' own words too: a pulse not found says the `pulses` tool lists them, not `/pulses`. Text only the person sees in the terminal - the job panel, the side panel - is the terminal's and stays as it is. Without `surface`, the prompt is the terminal's, byte for byte. What the conversation is to do once something is launched belongs there too - open it in the host's preview, say what to test: it is told once each launch it asked for ends, and - with `sentinel: false` - each launch after a pulse under `launch-after-pulse`, and does then what it was told to do once something is launched. With the sentinel on, the sentinel tests what is launched after a pulse, and the conversation only says it landed. With `sentinel: false`, the chat that asked for a pulse that lands under `launch-after-pulse` is told as it lands that its commit is being launched in the background - to say so in a line and offer nothing else - and then told the launch's end. Every launch, as it is asked for, starts and ends, comes to the host as `onLaunch(launch)` - its codebase, commit, status and summary. One whose code runs already - the chat asking for what runs, a pulse that landed only tests - comes once, `status: "launched"` with `already: true`, its own cause and the commit it was asked for; the launch that started what runs is not told again. One that ended with a newer launch of its codebase waiting comes with its real status and `replacedBy`, the newer one's id: that one starts at once and stops what it started, so draw it as replaced rather than as running - the chat that asked for it is told so, and hears the newer one's end instead, as for one `superseded` as it waited (`supersededBy`). What a launch started, halted on request (`/halt launched`, the `halt` tool) with nothing of it left running, comes again as `status: "stopped"`, "Stopped on request.": nothing of the codebase is launched from then on, and its next launch launches anew. A launch that said a server runs is `launched` only while one it started itself runs: something else answering at its port - a server an earlier session left, another program - makes it `failed`, its summary saying what holds the port. What an earlier turri's launches left running - a host that quit without `dispose`, a turri killed outright - is stopped as the session starts and before each launch of its codebase, and the next launch's `summary` begins with what was stopped (see [what an earlier session left running](launch.md#what-an-earlier-session-left-running)).
155
+ - **The banner.** The first chat's session starts with turri's banner, an entry `customType: "turri_banner"`. Its `data.config` is what turri says of the project's config files, a line each - `{ kind, file, text }`, `text` as the terminal shows it: `renamed`, a key turri renamed in the file itself, its value kept (`release-after-pulse` to `launch-after-pulse`) - information, nothing to do; `old-beside-new`, a file that sets an old name beside its new one, the old doing nothing - take it out; `unknown`, keys turri does not read - a setting it no longer has, a misspelt one. Draw `renamed` as information, the others as warnings, by `kind`, never by the words. `ConfigLine` and `ConfigLineKind` are exported.
155
156
  - **The system prompt.** `systemPrompt(prompt)` gets the whole system prompt for the turn - [pi](https://pi.dev)'s, turri's identity and blocks, the rules - after turri's own `before_agent_start` work, and returns what is sent. It is for what `surface` does not cover; to describe the UI, use `surface`, rather than words appended after turri's that contradict them.
156
157
  - **The mode.** Each chat is bound in [pi](https://pi.dev)'s `tui` mode: the work runs in the background and keeps the chat free, as the terminal does. Its other UI calls - its notices, its working line, a confirm - come to `uiContext(chat)`, as [pi](https://pi.dev)'s [SDK](https://github.com/earendil-works/pi) describes it.
157
158
 
@@ -171,17 +172,17 @@ The [sentinel](sentinel.md) is one of the host's chats: turri opens it with the
171
172
 
172
173
  - **Notices.** What it finds wrong comes as `onNotice(notice)`: `{ id, chat, severity: "error" | "warning" | "info", summary, evidence: string[], actions: [{ label, task }], module?, pulse?, job?, ignorable?, state: "open" }`. Draw it in the chat `chat` names - the one `focus` last named, or, while that is the sentinel, the chat that asked for the pulse. It is drawn there as a card in the transcript too. A host given `onNotice` answers it itself - the terminal's dialog is not opened - with `answer(id, …)`: `{ action: index | label }` starts that chat's agent on the action's task, `{ steer: text }` on the person's words, `{ dismiss: true }` on nothing, this once. A notice with `ignorable: true` - a gap in the \*\*\*plain the build settled with an assumption, which the person may leave as it is - takes `{ ignore: true }` too: offer it as its own button beside the actions. Nothing is done in the chat, the notice ends `state: "ignored"` (`"ignored"`), and turri writes it to the sentinel's guidance, so it is not raised again in this session or the next; on a notice without `ignorable`, `{ ignore: true }` is `"refused"` and the notice stays open. `onNoticeOver(notice)` comes as it is answered - and when a newer notice about its module supersedes it (`state: "superseded"`) - for the host to take the card down. `notices()` lists the open ones.
173
174
  - **Fixes it made.** The sentinel fixes the project's testing scripts and their config itself ([what it may do](sentinel.md#what-it-may-do)), and says so as a notice with `kind: "fixed"`, `severity: "info"`, no actions, the lines before and after in `evidence`: a note, with nothing to answer. Draw it as one - its card with a way to put it away (`answer(id, { dismiss: true })`), no "say what to do instead". It never supersedes a notice about its module. The terminal draws its card and puts no dialog.
174
- - **The machine is the person's.** turri installs nothing and changes no setting of the machine's or the person's shell, in any chat, the sentinel's included - and through a host's tools as through its own: a tool call whose input has a `command` string - a host's `terminal_run` - is refused when the command would (`machineChange`), with what to do instead (`machineChangeReason`), as turri's own `bash` is; and the sentinel's, also when it writes a `.plain` file. A tool that types into what already runs - a terminal's `terminal_type` at a shell prompt - is the host's to check: `machineChange(text)` says whether a line would change the machine, and why.
175
+ - **The machine is the person's.** turri installs nothing and changes no setting of the machine's or the person's shell, in any chat, the sentinel's included - and through a host's tools as through its own: a tool call whose input has a `command` string - a host's `terminal_run` - is refused when the command would (`machineChange`), with what to do instead (`machineChangeReason`), as turri's own `bash` is; and the sentinel's, also when it writes a `.plain` file, or starts or runs the code in `plain_modules` - what nobody launched: it tests what is launched. A tool that types into what already runs - a terminal's `terminal_type` at a shell prompt - is the host's to check: `machineChange(text)` says whether a line would change the machine, and why.
175
176
  - **Starting it.** Under `sentinel: ask` - as it is unset - the person is asked before it first opens in the session: a notice with `kind: "sentinel-start"`, `severity: "info"`, in the chat `chat` names, its `summary` the question in one sentence, no `evidence`, and its actions the answers - `Start the sentinel`, `Start it, and don't ask again`, `Not this session`, `Turn it off for this project`. Draw it as a question rather than as something wrong. `answer(id, { action })` answers it, by index or label - `"done"` - and `{ dismiss: true }` is not this session; turri writes `sentinel:` itself for the two that choose for the project. Until it is answered, the pulses that finish are held: neither the sentinel nor the chat hears of them. A host that offers the setting too writes it as `/settings` does - `ask`, `true` or `false` (see `configSettings`).
176
- - **Conclusions.** As the sentinel is done with each pulse - all well or not - `onConcluded({ job, verdict: "holds" | "wrong", summary, module, pulse, chat })` comes, and the chat `chat` names - the one `focus` last named, as for a notice - shows it and its agent says so in a line.
177
+ - **Conclusions.** As the sentinel is done with each pulse - all well or not - `onConcluded({ job, verdict: "holds" | "wrong", summary, module, pulse, chat })` comes, and the chat `chat` names - the one `focus` last named, as for a notice - shows it and its agent says so in a line. A pulse turri cannot brief it on - what runs cannot hold the pulse's commit, turri's own error - ends `verdict: "unchecked"`, with an error shown in that chat as well.
177
178
  - **A host that shows them itself.** With the sentinel on, the chat the person is in is told of each pulse that lands - to say it landed and what the sentinel does with it - and of each conclusion, each in a turn of its own: its agent says it in the conversation, as the terminal has it. A host that shows both itself - its own notifications, from `onJobChange` and `onConcluded` - passes `pulseEndsShown: true`, and the chat then says neither. Both still reach it - `customType: "turri_job_landed"` and `"turri_sentinel_concluded"`, hidden - put in its conversation in order and starting no turn: its agent has them in its next turn, and knows what landed and what the sentinel found when the person asks. Their words say what happened, and ask nothing of it. The rest is as it was: the sentinel's briefs and checks, its notices, a pulse that stopped on \*\*\*plain that contradicts itself (a notice of turri's own), `onConcluded` itself - and, with the sentinel off, the turn in the chat that asked for a pulse, which does what the project's guidance says once a pulse finishes.
178
- - **Checks.** `check({ module, funcIds })` asks the sentinel to test functional specs of one module - the person picked them on a list of its built ones, say - in the background, on its own judgement, reported as a pulse is. `module` is the module whose release is checked, by name; `funcIds` the functional specs to test, each `module:func-id` - of that module, or of any module its requires chain builds on, whose code its release holds: `check({ module: "predators", funcIds: ["depths:gene-fragments"] })`. A bare func-id is the module's own. The check and its brief name each as `module:func-id`. It returns `{ check: id }` at once, or `{ refused: why }`, saying which: the sentinel off (`sentinel: false`), or not started this session; a module not in the project's folder, an import module, one that does not parse; a name outside its chain - `Not in predators' release: arena:waves - arena is not predators or a module its requires chain builds on (depths, ocean).`; a func-id its module does not have; one not built in the module's own codebase as its \*\*\*plain has it now - with where the module's code is built on instead, when it is. What is tested is the module's release - its own codebase's last commit, which holds the code of every module its requires chain builds on - never what a pulse is writing, and never another module's: turri does not choose one for it. Under `sentinel: ask`, a check asked before the sentinel was started puts the start question first, as a pulse does - `check` set on the notice - and waits for the answer.
179
+ - **Checks.** `check({ module, funcIds })` asks the sentinel to test functional specs of one module - the person picked them on a list of its built ones, say - in the background, on its own judgement, reported as a pulse is. `module` is the module whose launch is checked, by name; `funcIds` the functional specs to test, each `module:func-id` - of that module, or of any module its requires chain builds on, whose code its codebase holds: `check({ module: "predators", funcIds: ["depths:gene-fragments"] })`. A bare func-id is the module's own. The check and its brief name each as `module:func-id`. It returns `{ check: id }` at once, or `{ refused: why }`, saying which: the sentinel off (`sentinel: false`), or not started this session; a module not in the project's folder, an import module, one that does not parse; a name outside its chain - `Not in predators' codebase: arena:waves - arena is not predators or a module its requires chain builds on (depths, ocean).`; a func-id its module does not have; one not built in the module's own codebase as its \*\*\*plain has it now - with where the module's code is built on instead, when it is. What is tested is what is launched of the module - its own codebase's code, which holds the code of every module its requires chain builds on - never what a pulse is writing, and never another module's: turri does not choose one for it. Under `sentinel: ask`, a check asked before the sentinel was started puts the start question first, as a pulse does - `check` set on the notice - and waits for the answer.
179
180
  - **Queued with the pulses.** It waits its turn behind the sentinel's work, and is taken in a conversation of its own: `onChatSession`, then the conversation's first message, the hidden brief of the check - `customType: "turri_sentinel_check"`, `details: { checkId, module, funcIds }`. A pulse of its module that lands meanwhile waits for it, rather than stopping it.
180
- - **Released first.** When what runs of the module is its last commit - released since it landed, and nothing it started has ended - it is used as it is. Otherwise the module is released as release-after-pulse releases it - its release guidance followed, or its last commit put in `dist/<module>` and started - before the sentinel is told; the brief says what runs and where, as a pulse's does, and gives each functional spec's text and scenarios, as turri reads them, to test those and not the module's others.
181
- - **Reported as a pulse is.** Its notices come as `onNotice`, with `check` - its id - and its module. It ends with `onConcluded({ check, verdict, summary, module, chat })` - `check` in place of `job`, which it has none of. A release that fails ends it there, the sentinel told nothing: `verdict: "wrong"`, the summary saying why. A check that never runs - the person did not start the sentinel when asked, it could not be opened, it was closed before it got to it - ends `verdict: "unchecked"`, which the sentinel itself never gives. The ledger has `sentinel.asked` as it is asked for, and `sentinel.checking` and `sentinel.concluded` with `check`.
181
+ - **In what is launched.** The sentinel launches nothing. Once the module's launches are settled - nothing launching, nothing waiting to - it is told what runs and where, as for a pulse, and each functional spec's text and scenarios, as turri reads them, to test those and not the module's others. With nothing of the module launched - never, or halted - the check ends unchecked, its summary saying so in the person's words - `Not checked: nothing of app is launched to test it in - ask the chat to try it first, which launches it.` - and with no notice: it is an answer, not an error. When the module's last launch did not come up, the sentinel is told why, and that is its finding.
182
+ - **Reported as a pulse is.** Its notices come as `onNotice`, with `check` - its id - and its module. It ends with `onConcluded({ check, verdict, summary, module, chat })` - `check` in place of `job`, which it has none of. A check that never runs - nothing of the module launched, the person did not start the sentinel when asked, it could not be opened, it was closed before it got to it - ends `verdict: "unchecked"`, the summary saying why, which the sentinel itself never gives. The ledger has `sentinel.asked` as it is asked for, and `sentinel.checking` and `sentinel.concluded` with `check`.
182
183
  - **Its model.** The `sentinel` role in `models:`, else the chat's model - `models.chat`, else `harness-model` - with its thinking, set as its chat opens: not pi's default model, which may not be one the project's provider has. What the person then picks in its chat stands. See [its model](sentinel.md#its-model).
183
- - **Its tools.** `sentinel: { tools }` are [pi](https://pi.dev) tool definitions registered in the sentinel's chat alone and told to it in its prompt - the host's browser, say, for it to test a release with. The rest of the host's `extensions` are built into its chat too, but their tools are refused it: only its own read, and these.
184
- - **Its surface.** `sentinel: { surface }` is where the person watches the sentinel use those tools, in the host's own words - the preview pane its browser and terminal show in, say. Given, the sentinel's prompt has it, as a `<surface>` block, in place of the person not watching it: it tries a release with the host's tools, where the person can watch, and keeps its own shell for what those cannot show - logs, exit codes, files. Without it, the person does not watch the sentinel, and the host's tools are only to test with as well. As for the conversation, `systemPrompt` has the last word on its prompt.
184
+ - **Its tools.** `sentinel: { tools }` are [pi](https://pi.dev) tool definitions registered in the sentinel's chat alone and told to it in its prompt - the host's browser, say, for it to test what is launched with. The rest of the host's `extensions` are built into its chat too, but their tools are refused it: only its own read, and these.
185
+ - **Its surface.** `sentinel: { surface }` is where the person watches the sentinel use those tools, in the host's own words - the preview pane its browser and terminal show in, say. Given, the sentinel's prompt has it, as a `<surface>` block, in place of the person not watching it: it tries what is launched with the host's tools, where the person can watch, and keeps its own shell for what those cannot show - logs, exit codes, files. Without it, the person does not watch the sentinel, and the host's tools are only to test with as well. As for the conversation, `systemPrompt` has the last word on its prompt.
185
186
  - **Its surface.** What it is told is its own prompt, not the conversation's: the host's `surface` is not in it; `systemPrompt` still has the last word.
186
187
 
187
188
  A surface for a desktop app might read:
@@ -194,7 +195,7 @@ the chat, and the toolbar's buttons send them too.
194
195
  - The Pulses view lists every pulse - running, planned and finished. A row opens what its agents did and its log; its
195
196
  Halt button stops it.
196
197
  - Your questions appear as cards above the message box: the person picks an option or types an answer there.
197
- - The Run button releases what is built and opens it.`;
198
+ - The Run button launches what is built and opens it.`;
198
199
  ```
199
200
 
200
201
  ## \*\*\*plain for a host
package/docs/launch.md ADDED
@@ -0,0 +1,67 @@
1
+ # Trying what is built: launch
2
+
3
+ Ask to try it - "let me try it", "run the app" - at any time, even while a regeneration is running. The chat calls `launch`, and it returns at once: in the background, the module's code, as one of its commits has it, goes in `dist/<module>` in the project, and an agent starts it on your machine. The chat is told how it went once it ends - an app with a backend and a frontend started whole, and where to open your browser; for a command-line tool or a library, a few commands to paste, run from `dist/<module>`, and what they print.
4
+
5
+ With `launch-after-pulse: true`, turri launches what every pulse lands itself - see [after every pulse](#after-every-pulse).
6
+
7
+ ## The launch track
8
+
9
+ Every launch goes through the session's launch track, one codebase at a time:
10
+
11
+ - **One at a time.** A codebase has one launch running at most. A launch is never stopped for a newer one: it finishes, and then the newest is launched.
12
+ - **The newest wins.** While one runs, a newer commit asked for waits as the next - and replaces any older one waiting there, which is never launched (`superseded`). Its code is in the newer one: code accumulates commit by commit. A launch that ends with a newer one waiting is replaced too (`replacedBy`): the newer one starts at once and stops what it started - unless its code is out already. Whoever asked for either is told that a newer launch takes its place, and then where that one runs, or why it did not come up, once it ends - never that the one it asked for is up, only for it to be stopped the next moment.
13
+ - **Nothing waits on it.** A launch is not a pulse. It holds no lane and takes no `parallel-jobs` slot: the next pulse starts while it runs, and the person goes on talking.
14
+ - **Out already.** When what runs is a commit's code already - the same code, and nothing it started has ended - it does nothing, and says so: nothing exported, nothing stopped, what runs left running. It still ends as a launch of its own, at once - `already`, its own cause, the commit asked for - and when that commit is built on what runs, what runs holds it from then on; the launch that started what runs is left as it was. A pulse that landed only conformance tests is out already. Guidance passed again does not launch it anew - the agent found the project's guidance itself; `again: true` launches it anyway, for when the last launch did not leave it as you need it - guidance that says to launch it some other way, say.
15
+
16
+ What each launch is - its codebase, its commit, whether it came up, what it started - is recorded, and the [sentinel](sentinel.md) tests a pulse only in a launch whose commit holds the pulse's.
17
+
18
+ ## When the project says how it is launched
19
+
20
+ Every launch starts the same way: the commit's code goes in `dist/<module>`, as below. Not everything is tried from there, though. An integration that a host application loads goes on into the host's own tree, with the host's own scripts, and then the host is started. So the agent asks itself whether there is guidance for how this project is launched - in what you said (the chat passes it to `launch` whole), the project's AGENTS.md, a skill - and:
21
+
22
+ - **There is guidance.** The code goes on from `dist/<module>` as the guidance says, on your machine, from the host codebase - the git repository the project is in, or else where turri runs: the scripts it names, in their order, and any change it says the host needs. The code is taken from `dist`, never from `plain_modules`, where the next pulse may be writing; where the host's tooling reads `plain_modules` itself, the agent points it at `dist`, or does by hand from `dist` what it does. The rules below hold as they do for `dist`: the agent runs the project's scripts and installs what they need itself, and what keeps running - a start script, a server - is started with `activate`, from the host codebase. Nothing built is changed, and nor is the \*\*\*plain: its file tools refuse a `.plain` file - a module or a test plain file - as they refuse `plain_modules`.
23
+ - **There is none.** The default: it is started from `dist/<module>`, as below, as best it can be.
24
+
25
+ Guidance is whatever says it, in any words - a line in AGENTS.md such as *integrations are launched with `scripts/deploy_integrations.sh`, then the app is started with `scripts/start.sh`*, or the same said in the chat. What was said in the chat is kept for the codebase's launches after it, those after a pulse among them.
26
+
27
+ ## What goes in dist
28
+
29
+ - **The module on top.** Code accumulates up a `requires` chain: a module starts from a copy of the code of the one it requires. So a launch takes the module on top of the `requires` chain - the project's `module` from `config.turri.yaml` unless another module's \*\*\*plain is named. Before the module on top has anything built, it takes the nearest one below it that has, and says so.
30
+ - **A commit, whole.** Each `plain_modules/<module>` is a git repository (`.plaingit`), and every unit of work starts from a commit and ends with one. A launch after a pulse takes the commit the pulse landed; one the chat asks for, the codebase's last. What a pulse is writing right now is half-done, so it is left out: the launch exports the commit - `git archive` of `code/` - which is the code with every uncommitted change put back, and no `node_modules`, `.venv`, `target` or other build leftovers, whatever the stack. The working tree the next pulse is using is never read, reset or touched. The harness's own files - `.turri.json`, the agents' notes - are left out too.
31
+ - **Replaced whole.** Each launch stops what the last one of the codebase started, empties `dist/<module>` and exports again. Change nothing there you want to keep. `dist/` is not added to `.gitignore`: whether it is committed is yours to decide.
32
+
33
+ ## Starting it
34
+
35
+ It runs on your machine, outside the [sandbox](sandbox.md) - with your toolchains, where your browser can reach it. The launch agent - on the codebase's coding model, thinking low: it follows steps, and a small model does that well - reads how the code runs (its README, manifests and entry points), then:
36
+
37
+ 1. **Checks the toolchains** it needs (`node`, `python3`, `go`, ...) - under another name too: `python` where `python3` is not, of the version it needs. One is missing: it stops, and says the exact command to install it yourself (`brew install node`). turri installs nothing on your machine and changes none of its settings - not a launch, not the chat, not any agent: its shell refuses it.
38
+ 2. **Installs what it needs into the project.** Dependencies into a virtual environment or `node_modules`, a build that downloads packages, an image pull, a guided launch's project scripts: it runs them in its own shell, as any agent with a shell would, and fixes what fails. Nothing is put to you - there is no dialog to answer. Never a global install, never a system setting.
39
+ 3. **Starts what serves** with `activate`: in the background, in its own process group, its output in `.turri/launch/<module>-<name>.log`. It waits until something answers at the server's URL - up to a minute - so the URL you are given has answered once; one that exits first comes back with the end of its output. A port something else holds is said, with what holds it, and nothing is started there: the app is not moved to a port you were not told about. It runs in `dist/<module>`, or a folder inside it the agent names (`frontend`) - or, with guidance, in the host codebase; a folder that is not there starts nothing, and the agent is told so with what the folder holds, to name the right one.
40
+ 4. **Says how it went** with `submit_launch`: launched or not, whether it serves - a backend or a frontend, against a CLI or a library tried from its folder - and in a line or three where it runs, or why it did not come up. The chat is told that, not the agent's prose. turri checks it rather than trusting it: a launch that says it serves - or names a URL - is launched only while something it started with `activate` still runs. Something else answering at its port - an earlier build left running, another program - is not this launch: `submit_launch` refuses it, and a launch that ends that way is `failed`, saying what holds the port.
41
+
42
+ `activate` and `submit_launch` are the launch agent's alone: the chat has `launch`, and nothing else of it. What a launch started is listed by the `pulses` tool and by **`/halt`**, with the launches under way and waiting, and stopped by **`/halt launched <name>`** (one server), **`/halt launched <module>`** (the module's launch under way, the one waiting, and what it started), by `halt` with `launched`, by the next launch of the codebase, and when turri exits. Halted, a launch that has nothing left running is `stopped` - "Stopped on request." - a host hears it, the sentinel has nothing of it to test, and the next launch of the codebase launches anew, never out already.
43
+
44
+ ### What an earlier session left running
45
+
46
+ What a launch starts is written down as it starts - `.turri/launch/running/<pid>.json`: its process, its process group, its codebase, its command, folder and URL, and the turri that started it - and taken out as it ends. A turri that is killed outright stops nothing it started, and a server it left would hold its port in the next session, answering with old code. So as a session starts, and again before each launch of a codebase, turri stops what those records name whose turri has ended - its process group, politely and then not, as it stops its own - and says so in the ledger (`launch.left-behind`) and at the head of the summary of the codebase's next launch: `Stopped what an earlier turri session left running of shorty: backend (pid 66816, http://127.0.0.1:8000).` It stops only a process its records name, and only while it is still the one recorded - started when the record says; a pid given to another process since is left alone, its record taken out. What another turri still running started is that turri's.
47
+
48
+ ## After every pulse
49
+
50
+ With `launch-after-pulse: true` in `config.turri.yaml`, turri launches what each pulse lands itself, on the launch track: the pulse ends as it lands - once its line in the notes is committed with it - and its commit is asked for as the codebase's next launch. The codebase's next pulse starts at once; nothing waits on the launch, and the chat - waiting on your answer to a question, say - has no part in it.
51
+
52
+ The launch agent finds the guidance as for any launch: what the chat passed to `launch` earlier for the codebase, the project's AGENTS.md and its skills. The setting is the word to launch; the guidance says only how - without any, the code goes to `dist/<module>` and is started from there.
53
+
54
+ - **With the [sentinel](sentinel.md) on** - the default - the chat you are in is told that the pulse landed, is being launched in the background, and that the sentinel tests it once it is up; the sentinel is told the pulse once what runs holds its commit, and tests it there. A launch that did not come up is told to it, and is a finding of its own like any other. A host hears every launch as it is asked for, starts and ends (`onLaunch`) - one out already once, as launched.
55
+ - **With `sentinel: false`**, the chat that asked for the pulse - or the one shown - is told as the pulse lands that its commit is being launched in the background, and says so in a line, offering nothing else for it. It is told again once the launch ends, as a turn of its own: where it runs, or why it did not come up - unless a newer launch replaced it, whose end is told instead. It then does what it was told to do once something is launched - a host such as a desktop app tells it, in its `surface`, to open it where the person can watch and say what to test.
56
+
57
+ Off without the key: launching after a pulse is then the chat's, when its guidance says so. `turri init-config` writes `launch-after-pulse: true`.
58
+
59
+ ## On the command line
60
+
61
+ ```bash
62
+ turri launch [file.plain] [--in-module <module>] [--guidance <text>] [--model <provider/id>]
63
+ ```
64
+
65
+ The same, without the chat: one launch of the codebase's last commit, the agent on `coding-model`, thinking low (or `--model`; without either, [pi](https://pi.dev)'s default), given the project's AGENTS.md and what `--guidance <text>` says. It stays in the foreground with the servers' output; `Ctrl-C` stops them. If it does not get there, launch from the chat instead.
66
+
67
+ `turri regenerate` and `conform` end a build that landed with `To try it: turri launch <spec>`.
package/docs/parser.md CHANGED
@@ -86,7 +86,7 @@ FAIL tests/ 2 test plain files outside a module's folder
86
86
  tests/todos/x.plain - no module todos; module: todo is in tests/todo/
87
87
  ```
88
88
 
89
- A test plain file, or a test folder, is never taken for a module: `parse` - and `regenerate`, `conform`, `pulses`, `drift`, `release`, `/regenerate` and the commands - refuse one, naming its module (`\`tests/todo/add-task.plain\` is a test plain file of \`todo\`; name \`todo.plain\`, or \`todo:add-task\` for that one functional spec`).
89
+ A test plain file, or a test folder, is never taken for a module: `parse` - and `regenerate`, `conform`, `pulses`, `drift`, `launch`, `/regenerate` and the commands - refuse one, naming its module (`\`tests/todo/add-task.plain\` is a test plain file of \`todo\`; name \`todo.plain\`, or \`todo:add-task\` for that one functional spec`).
90
90
 
91
91
  The exit code is 0 only when every file passed. In a conversation the same check is `parse`; `regenerate` runs it on the module it is given, and regenerates nothing from one that does not pass.
92
92
 
@@ -40,8 +40,8 @@ The harness's scratch - each ignores itself, and is never part of a module's his
40
40
  | `.turri/debug/` | each agent's log: its prompt, every tool call and every answer - kept in debug mode only |
41
41
  | `.turri/sessions/` | the agents' saved sessions - in debug mode, and a gated skill's run's |
42
42
  | `.turri/runs/<skill>/` | a gated skill's run: what an interrupted one resumes from, and its gates' evidence |
43
- | `.turri/deploy/` | the output of what `deploy` started |
44
- | `dist/<module>/` | what `deploy` puts out: the module's code as its last commit has it, replaced whole each time - see [deploy](deploy.md) |
43
+ | `.turri/launch/` | the output of what a launch started |
44
+ | `dist/<module>/` | what a launch puts out: the module's code as a commit has it, replaced whole each time - see [launch](launch.md) |
45
45
 
46
46
  ### Parts on different stacks
47
47
 
@@ -158,7 +158,7 @@ Every time a review sends tests back, the agent that fixes them also leaves the
158
158
 
159
159
  ### Then
160
160
 
161
- Once the unit tests pass and are reviewed, the job lands: the code record becomes the \*\*\*plain description the job ends on, and a commit is made to the module's history. The conformance tests are not run here: they are the conformance track's, and its job for what this one built runs next, before anything is built on it (see [conformance tests in the work loop](#conformance-tests-in-the-work-loop)). A job that does not pass is undone instead - see [below](#what-the-code-is-built-from). Trying what it built is [deploy](deploy.md)'s, not the job's: on the command line, a run that landed ends with `turri release <spec>`.
161
+ Once the unit tests pass and are reviewed, the job lands: the code record becomes the \*\*\*plain description the job ends on, and a commit is made to the module's history. The conformance tests are not run here: they are the conformance track's, and its job for what this one built runs next, before anything is built on it (see [conformance tests in the work loop](#conformance-tests-in-the-work-loop)). A job that does not pass is undone instead - see [below](#what-the-code-is-built-from). Trying what it built is a [launch](launch.md)'s, not the job's: under `launch-after-pulse` the chat launches what each pulse lands in the background, and on the command line a run that landed ends with `turri launch <spec>`.
162
162
 
163
163
  ## A whole module
164
164
 
package/docs/sandbox.md CHANGED
@@ -63,7 +63,7 @@ Before an agent's command runs, its text is checked (`src/regenerate/command-che
63
63
  - names a path outside the role's roots - absolute, a `..` that climbs out of the agent's folder (after the `cd`s before it), or inside a quoted string (`python3 -c "..."`). `~`, `$HOME` and `$TMPDIR` are the module's own and allowed, as are the package caches, the machine's system folders and the toolchains, and the devices (`/dev/null`). A path is checked when it names something on disk - under a top folder such as `/Users`, `/home`, `/etc` or `/tmp`, one of the fence's, or one that exists - so an API route in a curl or a JSON body is not one, and nor is `/` alone, a slash in code (`case '/':`), though writing to `/` is refused;
64
64
  - names the code record, `.turri.json`;
65
65
  - writes a credential file (`.env` and its variants; a template is fine) - by redirect, `tee`, `cp`, `mv` or an edit in place;
66
- - changes a setting of the machine's or the person's environment: `defaults write`, `launchctl`, `systemctl enable`, `sysctl -w`, `git config --global`, `npm config set`, a line written to a shell profile (`~/.zshrc`) or `/etc`. The same rule (`machineChange`) holds in every shell turri runs, not only the agents': the chat's and the release agent's refuse an install or a system setting too, asked or not - turri changes nothing of the machine's;
66
+ - changes a setting of the machine's or the person's environment: `defaults write`, `launchctl`, `systemctl enable`, `sysctl -w`, `git config --global`, `npm config set`, a line written to a shell profile (`~/.zshrc`) or `/etc`. The same rule (`machineChange`) holds in every shell turri runs, not only the agents': the chat's and the launch agent's refuse an install or a system setting too, asked or not - turri changes nothing of the machine's;
67
67
  - installs software outside the project: `sudo`, the system's package managers installing (`brew`, `apt`, `dnf`, `apk`, `pacman`, `choco`, `winget`, ...), toolchain managers installing (`nvm`, `sdk`, `rustup`, `pyenv`, `asdf`, ...), global installs (`npm -g`, `yarn global`, `pip --user`, `pipx`, `gem install`), a script downloaded and run (`curl ... | sh`), an installer (`.pkg`, `.msi`, `.dmg`, `.run`). The project's own dependencies - `npm install`, pip into its venv, `mvn`, `cargo`, `go mod` - are building the code, and pass;
68
68
  - kills what its pulse did not start: `pkill`, `killall`, `taskkill`, `fuser -k`, or `kill` aimed at a port or name lookup. `kill $!` and `kill %1` pass.
69
69
 
@@ -98,9 +98,9 @@ Every regenerating agent - regenerate, \*\*\*plain change, conformance, regressi
98
98
 
99
99
  DuckDuckGo is used without a key through its Lite page, which is not an official API: it rate-limits, and a search that is turned away tells the agent to wait or fetch a page it knows instead.
100
100
 
101
- ## Outside the sandbox: deploy
101
+ ## Outside the sandbox: launch
102
102
 
103
- What `deploy` starts runs on your machine unfenced: you asked to try the software, with your toolchains, in your browser. It runs from `dist/<module>`, a copy of the last commit outside `plain_modules`, so no regenerating agent reaches it. Nothing is installed on the machine for it: its dependencies go into the project, and a toolchain or system setting it lacks is yours to install - the release agent's shell refuses it, and tells you the command. See [deploy](deploy.md).
103
+ What a launch starts runs on your machine unfenced: you asked to try the software, with your toolchains, in your browser. It runs from `dist/<module>`, a copy of a commit outside `plain_modules`, so no regenerating agent reaches it. Nothing is installed on the machine for it: its dependencies go into the project, and a toolchain or system setting it lacks is yours to install - the launch agent's shell refuses it, and tells you the command. See [launch](launch.md).
104
104
 
105
105
  ## What turri keeps beside the code
106
106
 
package/docs/sentinel.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # The sentinel
2
2
 
3
- The sentinel is a chat of turri's own, beside the chats you talk to. Every pulse that finishes goes to it: it checks how the pulse went - and, with `release-after-pulse` on, tests what was released - and when something needs you, it says so in the chat you are in, with what can be done about it. You go on talking about the software, and building it, while it watches what lands.
3
+ The sentinel is a chat of turri's own, beside the chats you talk to. Every pulse that finishes goes to it: it checks how the pulse went - and, with `launch-after-pulse` on, tests what was launched - and when something needs you, it says so in the chat you are in, with what can be done about it. You go on talking about the software, and building it, while it watches what lands.
4
4
 
5
5
  `sentinel:` in `config.turri.yaml` says whether there is one: `ask`, as it is unset - you are asked before it first opens in a session (below); `true` - it opens without asking; `false` - none. It is there in the terminal and in a host such as turri-desktop - wherever turri holds [chats](chats.md) - and not in pi's print, json or rpc modes, nor on the command line (`turri regenerate`, `turri conform`), which have no chat to tell: there a pulse is told as it is without it.
6
6
 
7
7
  ## Starting it
8
8
 
9
- Under `sentinel: ask`, a tab that starts working on its own is not sprung on you. When the first pulse of a session finishes, turri asks first - a notice of its own in the chat you are in, before the sentinel opens, in one sentence: `app · regenerate pulse 3 finished - start the sentinel, a background tab that reviews each finished pulse and tries to use what was released?` - the release left out with `release-after-pulse` off. In the terminal it is a dialog once that chat is not mid-turn, with how to switch to the sentinel once it is open - `Use "/chat 2" to open the sentinel.`, the number the one it will have in the strip; in a host, a notice with `kind: "sentinel-start"` (see [in a host](#in-a-host)). You answer:
9
+ Under `sentinel: ask`, a tab that starts working on its own is not sprung on you. When the first pulse of a session finishes, turri asks first - a notice of its own in the chat you are in, before the sentinel opens, in one sentence: `app · regenerate pulse 3 finished - start the sentinel, a background tab that reviews each finished pulse and tries to use what was launched?` - the launch left out with `launch-after-pulse` off. In the terminal it is a dialog once that chat is not mid-turn, with how to switch to the sentinel once it is open - `Use "/chat 2" to open the sentinel.`, the number the one it will have in the strip; in a host, a notice with `kind: "sentinel-start"` (see [in a host](#in-a-host)). You answer:
10
10
 
11
11
  - **Start the sentinel** - it opens, and checks this pulse and each after it this session;
12
12
  - **Start it, and don't ask again** - the same, and `sentinel: true` is written to `config.turri.yaml`;
@@ -19,7 +19,7 @@ Nothing goes to the sentinel, or to your chat, until you answer: the pulses that
19
19
 
20
20
  ## What you see
21
21
 
22
- - **In the chat you are in**, a pulse that finishes shows as it always has - `✓ app · regenerate pulse 3 finished after 4m 10s`, and for one that went wrong, where to see why. A pulse that landed is told to the chat's agent, which tells you in a line or two what landed and what the sentinel is doing with it - and again, in a line, when the sentinel is done with it - checking it, testing what was released - and does nothing else about it: it does not test, release or open it, nor do what the project's guidance says to do once a pulse finishes. The pulse is the sentinel's. A pulse that went wrong is not told to it: the sentinel looks into it, and you hear of it as a notice.
22
+ - **In the chat you are in**, a pulse that finishes shows as it always has - `✓ app · regenerate pulse 3 finished after 4m 10s`, and for one that went wrong, where to see why. A pulse that landed is told to the chat's agent, which tells you in a line or two what landed and what the sentinel is doing with it - and again, in a line, when the sentinel is done with it - checking it, testing what was launched - and does nothing else about it: it does not test, launch or open it, nor do what the project's guidance says to do once a pulse finishes. The pulse is the sentinel's. A pulse that went wrong is not told to it: the sentinel looks into it, and you hear of it as a notice.
23
23
  - **The sentinel** opens with the first pulse that finishes - once you said to start it, under `sentinel: ask` - in the background: it never takes the screen, and you stay in your chat. It is a tab in the strip like any other chat - `sentinel` - marked while it works and when it has something new. Switch to it to read what it checked: it shows the pulse it is on, or the last one it checked - each pulse has a conversation of its own (below).
24
24
  - **A notice**, when something needs you: a card in the chat you are in - what is wrong, what shows it, and what can be done, numbered - and, in the terminal, once that chat is not mid-turn, a dialog on it:
25
25
  - `enter` on an action accepts it: the chat's agent is started on it - a change to the \*\*\*plain, a pulse regenerated again, a credential to provide, a setting to change;
@@ -31,19 +31,31 @@ Nothing goes to the sentinel, or to your chat, until you answer: the pulses that
31
31
 
32
32
  ## What it does
33
33
 
34
- Each pulse it checks from scratch, in a conversation of its own: its prompt, your guidance (`.turri/sentinel.md`, below) and what turri writes it of that pulse - nothing of the pulses before it. Its chat stays the same tab; the conversation in it is replaced as it starts on the next pulse, and the one before is let go - deleted, outside [debug mode](config.md). For each pulse that finishes, turri writes the sentinel what it was and how it ended - its stages, rounds and failures as the [ledger](using.md#the-ledger) has them, its \*\*\*plain diff, its log, the chat that asked for it, the chat you are in, and what was released and where it runs. Then it:
34
+ Each pulse it checks from scratch, in a conversation of its own: its prompt, your guidance (`.turri/sentinel.md`, below) and what turri writes it of that pulse - nothing of the pulses before it. Its chat stays the same tab; the conversation in it is replaced as it starts on the next pulse, and the one before is let go - deleted, outside [debug mode](config.md). For each pulse that finishes, turri writes the sentinel what it was and how it ended - its stages, rounds and failures as the [ledger](using.md#the-ledger) has them, its \*\*\*plain diff, its log, the chat that asked for it, the chat you are in, and what runs of it: the launch whose commit holds the pulse's, the pulses after it that the launch holds too, and where it runs. Then it:
35
35
 
36
36
  1. **checks the pulse** - from what it is told, and when that is not enough, from the pulse in full (`pulses` with its id), its log, the code and the \*\*\*plain;
37
- 2. **tests the release**, with `release-after-pulse` on: what was released is running where it is told, and it tries it - in the terminal with its shell (`curl`, the program itself, the logs), in a host also with what the host gives it, a browser say. How far it tests is its own judgement, from what the pulse changed and what the \*\*\*plain says it now does. Where the \*\*\*plain picks one way among several - which of a tie comes first, how a default is chosen - it tries an input on which the ways give different answers, so a pass shows the \*\*\*plain's way and no other. With `release-after-pulse` off nothing is running, and it checks the pulse alone;
38
- 3. **finds out why**, when something is wrong - the pulse failed or stopped, it did not pass, the release did not come up, the software does not do what its \*\*\*plain says. A testing script, or where the config says the scripts are, it fixes itself, resumes the module, and tells you what it changed (below). Anything else it puts to you as a notice, each action a task your chat's agent can carry out once you accept it - and what the machine lacks, the exact command for you to run;
37
+ 2. **tests what was launched**, with `launch-after-pulse` on: what runs is where it is told, and it tries it - in the terminal with its shell (`curl`, the program itself, the logs), in a host also with what the host gives it, a browser say. How far it tests is its own judgement, from what the pulse changed and what the \*\*\*plain says it now does - but not what a later pulse in the same launch changed again: that is the later pulse's check. Where the \*\*\*plain picks one way among several - which of a tie comes first, how a default is chosen - it tries an input on which the ways give different answers, so a pass shows the \*\*\*plain's way and no other. With `launch-after-pulse` off nothing is running, and it checks the pulse alone;
38
+ 3. **finds out why**, when something is wrong - the pulse failed or stopped, it did not pass, the launch did not come up, the software does not do what its \*\*\*plain says. A testing script, or where the config says the scripts are, it fixes itself, resumes the module, and tells you what it changed (below). Anything else it puts to you as a notice, each action a task your chat's agent can carry out once you accept it - and what the machine lacks, the exact command for you to run;
39
39
  4. **notifies no one** when all is well;
40
40
  5. **concludes**, last, whether all is well or not: what it checked and what it found, in a line or two. The chat you are in shows it - `✓ sentinel · app · pulse 3 · checked, it holds` - and its agent tells you so in a line, and does nothing more; when something was wrong, that its notice says what.
41
41
 
42
- A host can ask it to check too: functional specs the person picks in a module's release - its own, or those of any module its requires chain builds on (`depths:gene-fragments` in predators' release) - in turri-desktop, on the preview's list of a module's built ones. It tests those, on its own judgement, in the module's release - its own codebase's last commit, released first unless that is what runs - and reports as for a pulse: a notice when something is wrong, and its conclusion. It is refused with the sentinel off, and for a module that does not parse, a functional spec it does not have, or one not built; see [in a host](hosting.md#the-sentinel).
42
+ A host can ask it to check too: functional specs the person picks in a module - its own, or those of any module its requires chain builds on (`depths:gene-fragments` in predators') - in turri-desktop, on the preview's list of a module's built ones. It tests those, on its own judgement, in what is launched of the module - its own codebase's code - once the codebase's launches are settled, and reports as for a pulse: a notice when something is wrong, and its conclusion. The sentinel launches nothing: with nothing of the module launched - never, or you halted it - the check ends unchecked, its conclusion saying so - "ask the chat to try it first, which launches it" - and nothing else: it is an answer, not an error; when its last launch did not come up, that is what the sentinel finds out about, as for a pulse. It is refused with the sentinel off, and for a module that does not parse, a functional spec it does not have, or one not built; see [in a host](hosting.md#the-sentinel).
43
43
 
44
- It checks one pulse at a time. A pulse that finishes while it works waits its turn, and is checked once it is done - from scratch, as every pulse is. A pulse that went well is checked until a newer pulse of its module finishes: its check is stopped, and the newer one is checked instead, at once - and a newer pulse of a module takes the place of one of it that went well and waits. A pulse that went wrong is looked into to its end.
44
+ It checks every pulse, one at a time, in the order they finished. A pulse that finishes while it works waits its turn, and is checked once it is done - from scratch, as every pulse is. None takes the place of another: a newer pulse of a module waits behind the check of the one before it.
45
45
 
46
- A notice may be **ignorable**: the sentinel marks one so when you may reasonably leave it as it is - chiefly a gap in the \*\*\*plain the build settled with an assumption: *the \*\*\*plain does not say what happens to passwords over 72 bytes; the build refuses them with 422*. Never something broken, a pulse that went wrong, a release that did not come up, nor the question whether to start the sentinel. Ignore one and it is left as the build has it, for good: nothing is done in your chat, and a line is written to the sentinel's guidance (`.turri/sentinel.md`, as `keep_guidance` writes) saying what was left as it is - its module, the gap, what the build does - and that you chose to. Every conversation after has it, and does not raise it again - unless the build no longer does what you accepted. To have it raised again, take the line out of `.turri/sentinel.md`.
46
+ ## What it tests in
47
+
48
+ With `launch-after-pulse` on, a pulse is launched in the background on the [launch track](launch.md#the-launch-track), the newest commit winning - so what runs may be a later commit than the pulse's own. The sentinel tests a pulse only in a launch whose commit holds the pulse's: its commit, or one built on it. Before it is told of a pulse, turri waits for its codebase's launches to settle - nothing launching, nothing waiting to - and checks that what runs holds the pulse's commit. The pulses waiting behind it wait with it.
49
+
50
+ - **What runs holds it**: it is told the launch, the commit, the pulses after it that the launch holds too - and that what those changed again is theirs to test. A launch that left nothing running - a CLI, a library - is named with the folder to try it from, `dist/<module>`, its absolute path.
51
+ - **The launch did not come up**: it is told why, and that is what it finds out about - a finding like any other. It tests nothing in its place: never the code in `plain_modules`, where a pulse may be writing, nor a server of its own.
52
+ - **You stopped the launch** (`/halt launched <module>`, or every server it started): nothing runs, and it checks the pulse alone.
53
+ - **Whichever it is**, it is told never to run the code in `plain_modules`, where a pulse may be writing, nor to start a server of its own - not in its shell, not with a host's terminal: what would pass there is not what you try. A server that should run and does not is its finding. A host's terminal command that starts or runs the code there - `cd plain_modules/shorty/code && .venv/bin/uvicorn …`, a program or a path there, an environment variable pointing there - is refused it, saying why; reading there is not.
54
+ - **What runs cannot hold it** - turri got it wrong: it is not told of the pulse. The error is shown in the chat you are in, recorded in the ledger (`sentinel.refused`), and the pulse is concluded unchecked; the next is taken.
55
+
56
+ When its codebase is launched again while it checks a pulse - a newer pulse landed - its turn is stopped where it is, its conversation kept: what it was testing is being replaced. It takes nothing else meanwhile. Once the codebase's launches have settled - one, or several in a row - turri checks again that what runs holds the pulse's commit, and tells it, in the same conversation, to carry on: what runs now, and to do again what it was doing as the servers restarted. What runs no longer holding it, it is refused as above. A launch of another codebase leaves it alone.
57
+
58
+ A notice may be **ignorable**: the sentinel marks one so when you may reasonably leave it as it is - chiefly a gap in the \*\*\*plain the build settled with an assumption: *the \*\*\*plain does not say what happens to passwords over 72 bytes; the build refuses them with 422*. Never something broken, a pulse that went wrong, a launch that did not come up, nor the question whether to start the sentinel. Ignore one and it is left as the build has it, for good: nothing is done in your chat, and a line is written to the sentinel's guidance (`.turri/sentinel.md`, as `keep_guidance` writes) saying what was left as it is - its module, the gap, what the build does - and that you chose to. Every conversation after has it, and does not raise it again - unless the build no longer does what you accepted. To have it raised again, take the line out of `.turri/sentinel.md`.
47
59
 
48
60
  Two functional specs that contradict each other stop a pulse in a way only you can settle: turri puts that notice itself, with an action that starts your chat on working it out with you.
49
61
 
@@ -55,7 +67,7 @@ It fixes the project's tooling itself, and nothing else:
55
67
  - **It never changes \*\*\*plain.** The \*\*\*plain is your intent: what needs it changed is a notice, its action a task for your chat's agent once you accept it.
56
68
  - **It installs nothing, and changes no setting of the machine's or your shell's** - not a toolchain, not a package, not a PATH line in your profile - under no circumstances: its shell refuses it, as every shell turri runs does. What the machine lacks is a notice with the exact command for you to run, and resuming as its action once you have.
57
69
 
58
- Its file tools - `read`, `ls`, `grep`, `find` - read the whole project; `write` and `edit` reach the tooling above and nothing else, \*\*\*plain never. Its shell runs [behind the walls](sandbox.md) every agent's does - the command check, the OS sandbox where one is up, the audit - with the project read only and the network open, its home and temporary folder its own. It has `pulses`, `parse`, `doctor` and the web, `resume`, `notify_person` for its notices, `conclude` for when it is done with a pulse, `keep_guidance`, and what a host gives it. Whatever else it calls is refused: it never steers, releases, or regenerates but by `resume` after a fix of its own, and never asks you a question - a notice is how it reaches you.
70
+ Its file tools - `read`, `ls`, `grep`, `find` - read the whole project; `write` and `edit` reach the tooling above and nothing else, \*\*\*plain never. Its shell runs [behind the walls](sandbox.md) every agent's does - the command check, the OS sandbox where one is up, the audit - with the project read only and the network open, its home and temporary folder its own. It has `pulses`, `parse`, `doctor` and the web, `resume`, `notify_person` for its notices, `conclude` for when it is done with a pulse, `keep_guidance`, and what a host gives it. Whatever else it calls is refused: it never steers, launches, or regenerates but by `resume` after a fix of its own, and never asks you a question - a notice is how it reaches you.
59
71
 
60
72
  ## Talking to it
61
73
 
@@ -73,8 +85,8 @@ The `sentinel` role in `models:` - else the chat's model, `models.chat` else `ha
73
85
 
74
86
  ## In a host
75
87
 
76
- A host sees the sentinel as one of its chats - `role: "sentinel"` in `chats()` and `onChats` - and never has focus moved to it. Each pulse's fresh conversation is a new pi session in the same chat, under the same id: `onChatSession(chat, session)` comes before the pulse is put to it, and `session(id)` returns the new one. Under `sentinel: ask`, the question before it first opens comes as a notice like the others, with `kind: "sentinel-start"`, its actions the four answers: `answer(id, { action })` answers it - by index or label - and `{ dismiss: true }` is not this session. Each notice comes as `onNotice(notice)` - `{ id, chat, module, pulse, job, severity, summary, evidence, actions, state }`, `chat` the one to draw it in - and `onNoticeOver(notice)` when it is answered or superseded; `notices()` lists those open. `answer(id, { action } | { steer } | { dismiss: true } | { ignore: true })` answers one, as the terminal's dialog does - `{ ignore: true }` only on a notice with `ignorable: true`, `"refused"` on any other; it ends `state: "ignored"`. `onConcluded({ job, verdict: "holds" | "wrong", summary, module, pulse, chat })` comes as it is done with a pulse, all well or not - told to the chat `chat` too. The sentinel's own tools - a browser - are given with `createTurri({ sentinel: { tools } })`, and it is told it has them. `sentinel: { surface }` says, in the host's words, where the person watches it use them: then it tries a release with them, where the person can watch, and keeps its shell for what they cannot show - logs, exit codes, files. Without it, the person does not watch the sentinel, and the host's tools are only to test with as well. See [running turri in a host](hosting.md#the-sentinel).
88
+ A host sees the sentinel as one of its chats - `role: "sentinel"` in `chats()` and `onChats` - and never has focus moved to it. Each pulse's fresh conversation is a new pi session in the same chat, under the same id: `onChatSession(chat, session)` comes before the pulse is put to it, and `session(id)` returns the new one. Under `sentinel: ask`, the question before it first opens comes as a notice like the others, with `kind: "sentinel-start"`, its actions the four answers: `answer(id, { action })` answers it - by index or label - and `{ dismiss: true }` is not this session. Each notice comes as `onNotice(notice)` - `{ id, chat, module, pulse, job, severity, summary, evidence, actions, state }`, `chat` the one to draw it in - and `onNoticeOver(notice)` when it is answered or superseded; `notices()` lists those open. `answer(id, { action } | { steer } | { dismiss: true } | { ignore: true })` answers one, as the terminal's dialog does - `{ ignore: true }` only on a notice with `ignorable: true`, `"refused"` on any other; it ends `state: "ignored"`. `onConcluded({ job, verdict: "holds" | "wrong", summary, module, pulse, chat })` comes as it is done with a pulse, all well or not - told to the chat `chat` too. The sentinel's own tools - a browser - are given with `createTurri({ sentinel: { tools } })`, and it is told it has them. `sentinel: { surface }` says, in the host's words, where the person watches it use them: then it tries what is launched with them, where the person can watch, and keeps its shell for what they cannot show - logs, exit codes, files. Without it, the person does not watch the sentinel, and the host's tools are only to test with as well. See [running turri in a host](hosting.md#the-sentinel).
77
89
 
78
90
  ## In the ledger
79
91
 
80
- `chat.opened` carries `role: "sentinel"` for its chat; `sentinel.asked` each check a host asks of it, its `check` and `module`; `sentinel.checking` each pulse - or check, with `check` - it starts a conversation for - `replaced`, the pulse of the same module whose check it stopped; `notice.put` and `notice.over` record each notice - the question before it opens among them - - its severity and module, and how it ended: `accepted`, `steered`, `dismissed`, `ignored`, `superseded` - and `sentinel.concluded` each pulse or check it is done with, `holds` or `wrong` - `unchecked`, a check that never ran.
92
+ `chat.opened` carries `role: "sentinel"` for its chat; `sentinel.asked` each check a host asks of it, its `check` and `module`; `sentinel.checking` each pulse - or check, with `check` - it starts a conversation for; `sentinel.paused` and `sentinel.resumed` a check paused while its codebase was launched again, and carried on - the launch's id; `sentinel.refused` a pulse or check it was not told of because what runs cannot hold it - or, for a check, nothing of its module is launched - and why; `notice.put` and `notice.over` record each notice - the question before it opens among them - - its severity and module, and how it ended: `accepted`, `steered`, `dismissed`, `ignored`, `superseded` - and `sentinel.concluded` each pulse or check it is done with, `holds` or `wrong` - `unchecked`, one it never checked.
@@ -49,9 +49,9 @@ A step ends when its agent's turn does. A turn that ends on a question in the re
49
49
 
50
50
  A skill gets the tools its `allowed-tools` names, and nothing else: one that names none has none. So every skill here names its own - the file tools (`read`, `write`, `edit`, `ls`, `grep`, `find`) for the ones that write \*\*\*plain, resources or scripts, `bash` only for those that need a shell (running the testing script they write, deleting a module they split up), only the reading ones for those that analyse and report, and turri's own (the ones below) where a skill uses them.
51
51
 
52
- A skill's `write` and `edit` reach the project's \*\*\*plain only (`plainWriteTools` in `src/plain-files.ts`): a `.plain` file, a resource one links, a testing script, a `config.turri*.yaml`, or a new file outside `plain_modules/`, `dist/` and the hidden folders - a resource about to be linked, a script about to be named. Any other file that is there already - the code, a release, what an app it started writes - is refused, with why. Its `bash`, where it has one, is not fenced.
52
+ A skill's `write` and `edit` reach the project's \*\*\*plain only (`plainWriteTools` in `src/plain-files.ts`): a `.plain` file, a resource one links, a testing script, a `config.turri*.yaml`, or a new file outside `plain_modules/`, `dist/` and the hidden folders - a resource about to be linked, a script about to be named. Any other file that is there already - the code, a launch, what an app it started writes - is refused, with why. Its `bash`, where it has one, is not fenced.
53
53
 
54
- What a run changed is part of its result: every file of the project's \*\*\*plain it added, changed or removed - its `.plain` files, the resources they link, its testing scripts and `config.turri*.yaml` (`projectFiles` in `src/plain-files.ts`), never the built code, a release in `dist/` or the log of an app it started, which change while a skill runs without being its doing - or that it changed none, which is said as such, so a run that wrote nothing is never reported as done. A skill without gates says it was not reviewed. A `.plain` file a skill edited with the file tools is not regenerated by it: the result says so, for the conversation to regenerate the change.
54
+ What a run changed is part of its result: every file of the project's \*\*\*plain it added, changed or removed - its `.plain` files, the resources they link, its testing scripts and `config.turri*.yaml` (`projectFiles` in `src/plain-files.ts`), never the built code, a launch in `dist/` or the log of an app it started, which change while a skill runs without being its doing - or that it changed none, which is said as such, so a run that wrote nothing is never reported as done. A skill without gates says it was not reviewed. A `.plain` file a skill edited with the file tools is not regenerated by it: the result says so, for the conversation to regenerate the change.
55
55
 
56
56
  A skill acts on the work loop with the conversation's own tools, on the conversation's loop - never copies of them (`src/loop-tools.ts`). Every skill with the loop has `drift`: what is left to regenerate, what is regenerating, and "Fully regenerated" once nothing is. One that lists `regenerate` and `halt` in `allowed-tools` can regenerate what a module's \*\*\*plain holds and halt a pulse, with why.
57
57
 
@@ -78,7 +78,7 @@ A gate can also have a `continuous` reviewer: a read-only agent that re-reads th
78
78
  Beside "Something else…", every list an agent's question shows carries "Chat about this": the person says what they want to talk over - why it is asked, what an option means for later - and it goes back to the agent that asked, as no answer. A skill's agent answers in the `context` of the question asked again, since nothing else it writes reaches them; the conversation's agent answers in its reply and ends its turn, the person going on in the chat. It is not counted against the questioning level, and owes no \*\*\*plain change. The harness's own first question - how many the phases may ask - has no agent to answer, and does not offer it. Either choice is backed out of with Esc, or by typing nothing: the options come back, so one picked by accident costs nothing. Esc on the options themselves dismisses the question.
79
79
  - **Be asked something on the side.** A skill runs inside one `cultivate` call, so the conversation can answer nothing until it returns. `/btw <question>` (`btw.ts`) can: [pi](https://pi.dev) runs a command at once, even mid-turn, and it starts an agent of its own - fresh, on the chat's model, reading the project and turri and changing nothing - shown the conversation, the running skill's trace and the end of its agent's session, and the pulses. It is told it is turri, as the conversation's agent is (`identity.ts`), and answers as turri, in the first person - never as an onlooker who sends the person to turri with a message to pass on. Its answer goes in the transcript as an entry, in no model's context: the conversation and the skill go on as if nothing was asked. While a question of the skill's has the keys, `/btw <question>` typed as the answer (under "Something else…") is the same: answered, and the question asked again with the answer above it - the skill's agent never sees it.
80
80
  - **Regenerate, and conform.** A skill that names them in `allowed-tools` gets the conversation's own `regenerate`, `drift`, `halt` and `conform`, on its loop: `conform` schedules a conformance pulse for functional specs not built yet, as it does from the chat. The skill never waits for them.
81
- - **Run commands, never turri again.** A skill with `bash` in `allowed-tools` has a shell in the project that refuses what the conversation's refuses: turri's own commands that start work - `turri regenerate`, `conform`, `cultivate`, `release` - turri itself or another pi, and any change to the machine's toolchains or settings (`skillShell` in `self-invocation.ts`). Such a run would build outside the session's work loop, beside its pulses and unseen by them: a script skill that tried its new conformance testing script with `turri conform` wrote and committed the module's conformance tests from a second turri the chat never heard of. The skill says what should run next in what it hands back, and the conversation runs it.
81
+ - **Run commands, never turri again.** A skill with `bash` in `allowed-tools` has a shell in the project that refuses what the conversation's refuses: turri's own commands that start work - `turri regenerate`, `conform`, `cultivate`, `launch` - turri itself or another pi, and any change to the machine's toolchains or settings (`skillShell` in `self-invocation.ts`). Such a run would build outside the session's work loop, beside its pulses and unseen by them: a script skill that tried its new conformance testing script with `turri conform` wrote and committed the module's conformance tests from a second turri the chat never heard of. The skill says what should run next in what it hands back, and the conversation runs it.
82
82
 
83
83
  The harness still owns the sequence. A step chooses what to ask; it does not choose whether the gate afterwards runs. A run is saved as it goes, so an interrupted one can be resumed where it stopped - a run stopped with the chat's turn (`ctrl+c`, `esc`) too: its agents end their turns there, and what it started on the work loop goes on.
84
84