@turri-dev/cli 0.2.3 → 0.2.4-next.009bd0c
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.
- package/README.md +7 -8
- package/dist/bedrock-region.js +3 -3
- package/dist/chat-idle.d.ts +2 -2
- package/dist/chat-idle.js +2 -2
- package/dist/chat-models.d.ts +1 -1
- package/dist/chat-models.js +1 -1
- package/dist/chat-scope.d.ts +1 -3
- package/dist/chat-skills.d.ts +1 -1
- package/dist/chat-skills.js +1 -1
- package/dist/chats.d.ts +44 -20
- package/dist/chats.js +125 -64
- package/dist/cli.js +12 -31
- package/dist/config-edit.d.ts +20 -8
- package/dist/config-edit.js +32 -26
- package/dist/config.d.ts +106 -78
- package/dist/config.js +267 -133
- package/dist/conform-cli.js +14 -3
- package/dist/conformance-switch.d.ts +13 -22
- package/dist/conformance-switch.js +37 -59
- package/dist/drift-cli.js +1 -1
- package/dist/extension.d.ts +17 -10
- package/dist/extension.js +425 -531
- package/dist/genome.js +10 -49
- package/dist/graph.js +3 -5
- package/dist/host-session.d.ts +11 -21
- package/dist/host-session.js +6 -8
- package/dist/host.d.ts +4 -4
- package/dist/host.js +4 -7
- package/dist/identity.js +2 -3
- package/dist/init-config.d.ts +1 -2
- package/dist/init-config.js +10 -17
- package/dist/installed-providers.d.ts +1 -1
- package/dist/installed-providers.js +1 -1
- package/dist/launch-agent.d.ts +41 -0
- package/dist/launch-agent.js +219 -0
- package/dist/{release-cli.js → launch-cli.js} +41 -24
- package/dist/launch-session.d.ts +58 -0
- package/dist/launch-session.js +195 -0
- package/dist/launch-tools.d.ts +28 -0
- package/dist/launch-tools.js +69 -0
- package/dist/launch-track.d.ts +120 -0
- package/dist/launch-track.js +298 -0
- package/dist/loop-cli.d.ts +4 -3
- package/dist/loop-cli.js +17 -15
- package/dist/loop-tools.d.ts +45 -21
- package/dist/loop-tools.js +155 -90
- package/dist/new-project.js +2 -2
- package/dist/notice.d.ts +7 -6
- package/dist/parse-cli.js +2 -2
- package/dist/pi-launch.js +4 -1
- package/dist/pi-settings.d.ts +4 -0
- package/dist/pi-settings.js +39 -0
- package/dist/pi.js +12 -9
- package/dist/plain/check.d.ts +2 -9
- package/dist/plain/check.js +6 -39
- package/dist/plain-files.d.ts +2 -2
- package/dist/plain-files.js +7 -7
- package/dist/regenerate/activity.d.ts +0 -7
- package/dist/regenerate/activity.js +2 -20
- package/dist/regenerate/agent-env.d.ts +1 -1
- package/dist/regenerate/agent-env.js +3 -3
- package/dist/regenerate/agent-shell.js +5 -3
- package/dist/regenerate/audit.js +9 -0
- package/dist/regenerate/base-folder.d.ts +2 -2
- package/dist/regenerate/base-folder.js +1 -1
- package/dist/regenerate/cases.js +7 -0
- package/dist/regenerate/chunk-plan.d.ts +5 -0
- package/dist/regenerate/chunk-plan.js +16 -1
- package/dist/regenerate/command-check.d.ts +1 -1
- package/dist/regenerate/command-check.js +1 -1
- package/dist/regenerate/delivery.d.ts +1 -1
- package/dist/regenerate/delivery.js +3 -3
- package/dist/regenerate/drift.d.ts +4 -0
- package/dist/regenerate/drift.js +26 -6
- package/dist/regenerate/failure-reports.d.ts +28 -0
- package/dist/regenerate/failure-reports.js +79 -0
- package/dist/regenerate/job-panel.js +3 -1
- package/dist/regenerate/jobs-tree.js +1 -1
- package/dist/regenerate/jobs.d.ts +4 -2
- package/dist/regenerate/jobs.js +14 -10
- package/dist/regenerate/launch.d.ts +126 -0
- package/dist/regenerate/{release.js → launch.js} +60 -48
- package/dist/regenerate/ledger-view.d.ts +11 -24
- package/dist/regenerate/ledger-view.js +14 -60
- package/dist/regenerate/ledger.d.ts +26 -16
- package/dist/regenerate/ledger.js +1 -1
- package/dist/regenerate/lineage.d.ts +2 -0
- package/dist/regenerate/lineage.js +8 -0
- package/dist/regenerate/loop.d.ts +54 -67
- package/dist/regenerate/loop.js +312 -148
- package/dist/regenerate/model-names.d.ts +33 -0
- package/dist/regenerate/{engine.js → model-names.js} +2 -28
- package/dist/regenerate/paths.d.ts +3 -3
- package/dist/regenerate/paths.js +4 -4
- package/dist/regenerate/records.d.ts +11 -0
- package/dist/regenerate/records.js +15 -0
- package/dist/regenerate/regenerate.d.ts +0 -2
- package/dist/regenerate/regenerate.js +4 -15
- package/dist/regenerate/renames.js +4 -4
- package/dist/regenerate/requires.d.ts +7 -0
- package/dist/regenerate/requires.js +24 -18
- package/dist/regenerate/scripts-being-written.d.ts +4 -4
- package/dist/regenerate/scripts-being-written.js +3 -3
- package/dist/regenerate/spec-map.js +3 -3
- package/dist/regenerate/standing.js +1 -1
- package/dist/regenerate/submit-work.d.ts +2 -0
- package/dist/regenerate/submit-work.js +8 -3
- package/dist/regenerate/test-scripts.d.ts +2 -1
- package/dist/regenerate/test-scripts.js +33 -23
- package/dist/regenerate/testing-steps.d.ts +16 -5
- package/dist/regenerate/testing-steps.js +28 -9
- package/dist/regenerate-cli.js +18 -9
- package/dist/self-invocation.d.ts +11 -0
- package/dist/self-invocation.js +36 -10
- package/dist/sentinel-check.d.ts +3 -3
- package/dist/sentinel-check.js +3 -3
- package/dist/sentinel.d.ts +17 -12
- package/dist/sentinel.js +75 -46
- package/dist/{config-command.d.ts → settings.d.ts} +13 -8
- package/dist/{config-command.js → settings.js} +155 -24
- package/dist/setup.d.ts +2 -2
- package/dist/setup.js +7 -7
- package/dist/skill.d.ts +0 -11
- package/dist/skill.js +0 -9
- package/dist/tools.js +2 -3
- package/dist/turri-versions.js +2 -1
- package/docs/README.md +4 -6
- package/docs/authoring-plain.md +3 -3
- package/docs/chats.md +6 -9
- package/docs/claude-subscription.md +2 -2
- package/docs/config.md +61 -51
- package/docs/development.md +4 -5
- package/docs/headless.md +7 -6
- package/docs/hosting.md +24 -23
- package/docs/launch.md +63 -0
- package/docs/parser.md +3 -3
- package/docs/regenerating.md +30 -22
- package/docs/sandbox.md +3 -3
- package/docs/sentinel.md +27 -16
- package/docs/skills-and-gates.md +6 -11
- package/docs/using.md +25 -42
- package/genome/rules/project-model.md +2 -1
- package/genome/rules/test-plain-files.md +15 -7
- package/genome/rules/turri-regeneration.md +7 -10
- package/genome/skills/convert-old-syntax/SKILL.md +5 -5
- package/genome/skills/implement-conformance-testing-script/SKILL.md +2 -2
- package/genome/skills/implement-unit-testing-script/SKILL.md +3 -3
- package/package.json +1 -1
- package/dist/advisor-chat.d.ts +0 -63
- package/dist/advisor-chat.js +0 -290
- package/dist/change-plain-cli.js +0 -55
- package/dist/ledger-cli.d.ts +0 -1
- package/dist/ledger-cli.js +0 -50
- package/dist/ledger-tools.d.ts +0 -10
- package/dist/ledger-tools.js +0 -64
- package/dist/regenerate/advisor-records.d.ts +0 -93
- package/dist/regenerate/advisor-records.js +0 -110
- package/dist/regenerate/advisor-runs.d.ts +0 -87
- package/dist/regenerate/advisor-runs.js +0 -327
- package/dist/regenerate/engine.d.ts +0 -52
- package/dist/regenerate/release.d.ts +0 -121
- package/dist/regenerate/test-advisor.d.ts +0 -101
- package/dist/regenerate/test-advisor.js +0 -379
- package/dist/release-agent.d.ts +0 -43
- package/dist/release-agent.js +0 -130
- package/dist/release-cli.d.ts +0 -1
- package/dist/release-tools.d.ts +0 -44
- package/dist/release-tools.js +0 -170
- package/dist/spec-tools.d.ts +0 -36
- package/dist/spec-tools.js +0 -128
- package/dist/stacks.d.ts +0 -13
- package/dist/stacks.js +0 -96
- package/docs/deploy.md +0 -48
- package/docs/test-advisor.md +0 -110
- /package/dist/{change-plain-cli.d.ts → launch-cli.d.ts} +0 -0
package/docs/hosting.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
| `MAX_CHATS`, `ChatInfo`, `ChatStatus` | the most chats a session has open - nine - and what the host is told of each. |
|
|
14
14
|
| `pi` | [pi](https://pi.dev) itself, as turri is built against it. Make the host's own extensions and UI with this one, not another copy. |
|
|
15
15
|
| `readProjectConfig`, `projectModels`, `modelSpec`, `configForSpec`, `hasProjectConfig`, `stacksOf` | the project's settings, as [config.turri.yaml](config.md) has them. |
|
|
16
|
-
| `configSettings`, `currentValue`, `readConfigText`, `overriddenBy`, `EFFECT_TEXT` | every setting of config.turri.yaml as [/
|
|
16
|
+
| `configSettings`, `currentValue`, `readConfigText`, `overriddenBy`, `EFFECT_TEXT` | every setting of config.turri.yaml as [/settings](config.md#changing-it-from-the-chat) knows it - its key, what it does, its kind (a yes or no, one of a few words, a number, a model, a list, a path, a budget), its words or the values offered first, what it is unset and when a change takes effect - and what the file has now (`currentValue(readConfigText(dir), key)`), and what wins over it. Change one as the person would, by sending `/settings <key> <value>` to the chat: turri checks it and writes it with the file's comments kept. A setting's values for a list are the session's `settingChoices(key, typed?)`: what /settings's completions offer after `typed`, in their order, but whole - uncapped, where the terminal shows forty - and without unset, which the host draws itself; the values alone. A model setting's are every model of every provider signed in to, from the model registry the chats use, whether or not one has run /settings - and after a colon, that model's thinking levels. An unknown key gives `[]`. |
|
|
17
17
|
| `debugMode` | whether turri keeps, in a project, what it writes only for debugging it - `debug:`, or `TURRI_DEBUG` over it (see [debug mode](config.md#debug-mode)). |
|
|
18
18
|
| `initConfig(dir, { vendor, bedrock, models, force, catalogue })`, `VENDORS`, `BEDROCK_REGIONS`, `BEDROCK_DEFAULT` | a project's first config.turri.yaml, as `turri init-config` writes it - async, it may read [pi](https://pi.dev)'s catalogue - see [a project's first config](#a-projects-first-config). |
|
|
19
19
|
| `machineChange(command)`, `machineChangeReason(why)` | whether a command line would install something on the machine or change a setting of the machine's or the person's shell - and why - and what turri says instead: for a host's own tool that types into a shell, which turri cannot see a command in. |
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
| `checkPlainFile`, `plainFileParser`, `resolveTemplateDirs`, `iterateFunctionalSpecs`, `FUNCTIONAL_REQUIREMENTS` | \*\*\*plain checked and parsed, with its test plain files, its functional specs one by one - `{ funcId, specifications }`, the specifications with the functional spec's conformance and acceptance scenarios, each `{ id, text }` - as `turri parse` reads it. |
|
|
25
25
|
| `highlightLines`, `roleOf` | \*\*\*plain's lines coloured by turri's own [\*\*\*plain](https://plainlang.org/docs/) grammar, each piece by its `PlainRole`: `section`, `concept`, `link`, `literal`, `keyword`, `module`, `comment`, `bullet` and `id` - the `# <id>` heading of a functional spec or a scenario, and a test plain file's `func_id:` value, the functional spec it binds to. A test plain file's `module:` value is a `module`, whole - `my-app`, `billing.v2` - as a module name listed under `import:` or `requires:` is. |
|
|
26
26
|
| `plainGraph(projectDir)` | a project's \*\*\*plain as a graph to move around in: its modules with what each imports and requires and what imports and requires it, each item of their sections with its line, and the concepts - an item linked to those it names and to where each is defined - see [\*\*\*plain for a host](#plain-for-a-host). |
|
|
27
|
-
| `testDirOf(plainFile)`, `DEFAULT_TEST_DIR` | the absolute folder a module's test plain files are in - `test-dir`, its
|
|
27
|
+
| `testDirOf(plainFile)`, `DEFAULT_TEST_DIR` | the absolute folder a module's test plain files are in - `test-dir`, its module's own file's over the project's, else `tests` (`DEFAULT_TEST_DIR`), from the project's folder - for a host that lists a project's modules by walking its .plain files and leaves the test plain files out. It is a module's, not a project's, because a module's `config.turri.<module>.yaml` may name a folder of its own. |
|
|
28
28
|
| `conceptsOf(plainFile)`, `findConcepts(text)`, `conceptBeingTyped(text)` | the concepts a module can name, with what each is and the module that defines it; the concepts written in a piece of text; the one being typed at its end. |
|
|
29
29
|
| `stdlibTemplates()`, `isStack`, `STDLIB_KINDS` | turri's standard library: every template with its kind, file, text, imports and its conformance template or the stack it tests, and the kinds in order with their titles. |
|
|
30
30
|
| `projectStanding(projectDir, { loop?, files? })`, `ModuleStanding` | how every module of a project stands, in one call - see [how a project stands](#how-a-project-stands). |
|
|
31
31
|
| `requiresOrder(projectDir, { files? })` | a project's .plain files, absolute, in the order they are built: each after every module it requires, as its requires chain (`resolveRequiresChain`) has them - the files taken in the order given, by name without `files`, each brought in after what it requires. A module whose chain does not resolve - it does not parse, a module it requires is not there, a cycle - goes after what its front matter says it requires, as far as those are found; none is left out. Only the files given are in it: `files`, absolute or from the project, else every .plain file in the project's folder. |
|
|
32
|
-
| `functionalityCompletion`, `createWorkLoop`, `createJobRegistry`, `
|
|
32
|
+
| `functionalityCompletion`, `createWorkLoop`, `createJobRegistry`, `describeModules`, `PlannedPulse` | how far each functional spec is built - each module's `specified`, `withScenarios` (those tested, which tested-of-specified counts over), `completed`, `conformanceTested`, `tested` and `incomplete` - and the work a \*\*\*plain change would plan, before it runs: the session's `turri.loop` `lookAhead(plainFile)` plans a module as regenerate would and starts nothing, and `plannedPulse(rowId)` gives a planned row's cases and - the next pulse of its codebase - its coding agent's whole prompt (`PlannedPulse`), from the plan regenerate then runs ([looking ahead](regenerating.md#a-whole-module)). |
|
|
33
33
|
| `onModelEvent`, `describeTurnIncident` | a provider failing and waited out, a turn turri ended itself. |
|
|
34
34
|
| `onLedgerEvent`, `readLedger`, `ledgerDir`, `runViews`, `pulseView`, `describePulseView`, `describeRuns`, `ledgerProjects`, `earlierPulses`, `asJob` | what turri did, as facts - the [ledger](using.md#the-ledger): each event heard as it is recorded, and every run and pulse read back, earlier sessions' too - see [the ledger in a host](#the-ledger-in-a-host). |
|
|
35
35
|
| `doctor({ dir, models, env })`, `Check`, `Level` | whether the machine - and, with `dir`, that project - is ready for turri, as `turri doctor` checks it: a list of checks to show in the host's own way - see [doctor in a host](#doctor-in-a-host). |
|
|
@@ -56,7 +56,7 @@ const { written, message } = await initConfig(project, { models: { harness, codi
|
|
|
56
56
|
- `models: { harness, coding, strong? }` writes those two instead - any pair [pi](https://pi.dev)'s catalogue has as chat models, full model ids without a thinking level (`amazon-bedrock/global.xai.grok-4.7`). They go wherever the vendor's own would: the two models with the thinking turri writes, the commented-out `judge-model` and `models:` examples, `strong` - the judging examples' model - being `harness` unless given. The vendor, the Bedrock maker and the geography are read from them, so neither `vendor` nor `bedrock` is needed. A model the catalogue does not have, or that is not a chat model, writes nothing: `written` is false and `message` says which, with the closest the catalogue has.
|
|
57
57
|
- `catalogue`, the one the host already read, saves reading it again.
|
|
58
58
|
|
|
59
|
-
The message says whose models were written - "with xAI's models on Amazon Bedrock (global)" - and how to sign in: an `AWS_PROFILE` or a Bedrock API key, never a region. For a geography that needs one, it says which turri calls it in - `turri calls eu's models in eu-central-1. AWS_REGION, set, overrides it - and so does your AWS profile's region, when it is in eu.` - `bedrockAwsRegion(geography)` being that region, and `bedrockNeedsAwsRegion(geography)` whether the geography needs one. turri sets it itself: `createTurri` - and `turri` in a terminal, and every command that calls a model - sets `AWS_REGION` for the project's Bedrock models before any is called, when they need a region and neither `AWS_REGION` nor `AWS_DEFAULT_REGION` is set, and works it out again when the config's models change through `/
|
|
59
|
+
The message says whose models were written - "with xAI's models on Amazon Bedrock (global)" - and how to sign in: an `AWS_PROFILE` or a Bedrock API key, never a region. For a geography that needs one, it says which turri calls it in - `turri calls eu's models in eu-central-1. AWS_REGION, set, overrides it - and so does your AWS profile's region, when it is in eu.` - `bedrockAwsRegion(geography)` being that region, and `bedrockNeedsAwsRegion(geography)` whether the geography needs one. turri sets it itself: `createTurri` - and `turri` in a terminal, and every command that calls a model - sets `AWS_REGION` for the project's Bedrock models before any is called, when they need a region and neither `AWS_REGION` nor `AWS_DEFAULT_REGION` is set, and works it out again when the config's models change through `/settings` and as each pulse takes its model. A host that shows the person where their models run reads `bedrockRegionFor(projectDir)` - "turri calls these models in eu-central-1" - rather than asking them to set anything.
|
|
60
60
|
|
|
61
61
|
## How a project stands
|
|
62
62
|
|
|
@@ -70,7 +70,7 @@ for (const { plainFile, module, drift, driftError, completion, completionError }
|
|
|
70
70
|
|
|
71
71
|
`projectStanding` gives each module of the project what `drift` and `functionalityCompletion` give it asked alone - `drift`, every codebase of its requires chain with what is left to regenerate there, and `completion`, its chain's functional specs completed and conformance tested - in one call. Asked module by module, each call parses and reads the whole chain below the module again: on a project of a dozen modules in one chain, seconds. Asked of the project, each file is parsed once and each codebase's record read once, the modules below shared by every chain they are in.
|
|
72
72
|
|
|
73
|
-
- `loop` is the work loop whose `drift` is read - the session's `turri.loop`, which knows the pulses running and the codebases halted. Without one, a loop of its own
|
|
73
|
+
- `loop` is the work loop whose `drift` is read - the session's `turri.loop`, which knows the pulses running and the codebases halted. Without one, a loop of its own, asked nothing, reads the codebases as their records have them - drift plans and starts nothing.
|
|
74
74
|
- `files` are the .plain files to look at, absolute or from the project. Without them, every .plain file in the project's folder.
|
|
75
75
|
- A module drift or completion cannot say - one that does not parse, a module it requires not there - has `driftError` or `completionError`, the message, in place of the answer; the others are answered all the same.
|
|
76
76
|
|
|
@@ -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
|
|
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,8 +133,8 @@ 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
|
|
137
|
-
turri.settingChoices("harness-model"); // every value /
|
|
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
|
+
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
|
|
140
140
|
await turri.answer(notice.id, { action: 0 }); // or { steer: "…" }, { dismiss: true }, { ignore: true }: "done", "dismissed", "ignored", "refused", "over", "missing"
|
|
@@ -142,22 +142,23 @@ 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
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
|
158
|
-
###
|
|
159
|
+
### Conformance tests
|
|
159
160
|
|
|
160
|
-
Conformance tests
|
|
161
|
+
Conformance tests are on only with `conformance-tests: true` ([config](config.md#conformance-tests)) - off when unset: then no conformance pulse runs, and the chats' `conform` is refused - turning them on is the person's decision; `conformance-tests` is one of `configSettings()`, and `settingChoices("conformance-tests")` gives `true` and `false`. To turn them on from the host's own button, the session's `turnOnConformanceTests(plainFile?)` does what `/conform` does before it tests, with no model call: it writes `conformance-tests: true` where the module's value comes from - its own `config.turri.<module>.yaml`, or a required module's, when that sets the key, which `/settings` alone would not change, else `config.turri.yaml` - the chats' `conform` no longer refused, and returns the file it wrote, from the project. `plainFile`, absolute or from the project, picks the module; omitted, the project's. It starts no conformance pulse: the host offers that itself, with `/conform`. With them on, the chats write scenarios for a functional spec they judge needs them, as a \*\*\*plain change like any other - its test plain file, `<test-dir>/<module>/<func-id>.plain` - which the work loop then tests.
|
|
161
162
|
|
|
162
163
|
A host's chats run the [background skills](skills-and-gates.md) in the background, as the terminal's do - the two that write the testing scripts: `cultivate` returns at once, and nothing of the run shows while it runs. Its result's `details` say what it started: `{ background: true, kind?, plainFile? }` - `kind` the testing script it writes, `unit` or `conformance`, and `plainFile` the module it is for, relative to the project, each left out when there is none; `started: false` too when the skill was running already and nothing new was started - enough to show "writing the unit testing script for hello.plain, in the background" with no table of which skill writes which. Its end goes to the chat that started it, once that chat is idle: a run that did its work as an entry of its session, `turri_skill_run` (`data.text`, the line - `Unit testing script written: test_scripts/run_unittests_python.sh.`), that starts no turn; one that did not as a hidden message to its agent, `customType: "turri_skill_run"` (`details.skills`), that starts a turn in which the chat tells the person what went wrong, its `details` `{ skills, runs }` - `runs` one `{ skill, kind?, plainFile? }` for each run in it, for a turn marked "unit testing script not written · hello.plain". Meanwhile a module that lacks the script waits for it, its `why` in `mapPlan()` and `status()` `waiting for its unit testing script, which is being written` - or its conformance testing script - and starts by itself once it is written. `onPlanChange` fires as it starts waiting and as it stops - the script written, or the run ended without it - as it does whenever a module's `why` changes.
|
|
163
164
|
|
|
@@ -172,16 +173,16 @@ The [sentinel](sentinel.md) is one of the host's chats: turri opens it with the
|
|
|
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
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. 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
|
-
- **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 `/
|
|
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.
|
|
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`).
|
|
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
|
|
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
|
-
- **
|
|
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
|
|
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
|
|
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
|
|
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
|
|
198
|
+
- The Run button launches what is built and opens it.`;
|
|
198
199
|
```
|
|
199
200
|
|
|
200
201
|
## \*\*\*plain for a host
|
|
@@ -224,7 +225,7 @@ concepts.find((concept) => concept.definition === "/…/base.plain:8");
|
|
|
224
225
|
|
|
225
226
|
## The ledger in a host
|
|
226
227
|
|
|
227
|
-
`createTurri` starts the ledger itself, in the process's working folder - the project's - so a host needs nothing to have one: its pulses are recorded as `host` runs, each event with the chat its work was asked for in, and the chats' `pulses`
|
|
228
|
+
`createTurri` starts the ledger itself, in the process's working folder - the project's - so a host needs nothing to have one: its pulses are recorded as `host` runs, each event with the chat its work was asked for in, and the chats' `pulses` already tells the model of earlier sessions' pulses. What the host can do with it is show it.
|
|
228
229
|
|
|
229
230
|
```js
|
|
230
231
|
import { onLedgerEvent, pulseView, readLedger, runViews } from "@turri-dev/cli/host";
|
|
@@ -246,7 +247,7 @@ const { jobs, more } = earlierPulses(ledgerProjects(projectDir), new Set(turri.j
|
|
|
246
247
|
```
|
|
247
248
|
|
|
248
249
|
- **Live.** `onLedgerEvent(listener)` is told every event as turri records it, with the project it is about, until what it returns is called; a listener that throws misses that event and nothing else. It is the pulse's own detail - its stages, test runs, verdicts, refusals - where `onJobChange` is the job as a whole.
|
|
249
|
-
- **Read back.** `readLedger(project, { job, run, kinds, since })` is the project's events, oldest first, the gzipped runs too; `runViews` and `pulseView` gather them into runs and pulses, and `describePulseView` and `describeRuns` say them in lines, as
|
|
250
|
+
- **Read back.** `readLedger(project, { job, run, kinds, since })` is the project's events, oldest first, the gzipped runs too; `runViews` and `pulseView` gather them into runs and pulses, and `describePulseView` and `describeRuns` say them in lines, as the chat's `pulses` tells them. `ledgerProjects(dir)` finds the ledgers of a folder and the projects under it. `earlierPulses(projects, known, runs = 3)` gives the last runs before this one as `Job`s - the shape a host already draws for this session's - each marked `earlier: { run, runMode, lines }`, `lines` what the ledger says of it, and with its `cases`, `diff` and `diffWhere` - the \*\*\*plain diff it regenerated, as last steered, and where its lines are written - as a pulse of this session has them (a pulse recorded before `job.diff` was has none); `more` is how many runs are beyond them. They are read only: never started, halted or waited for. turri's own side panel lists them so, as **earlier sessions**.
|
|
250
251
|
- **What it is for.** Looking up, never deciding: what is built and what is left come from the records and the work loop, as before. Its events and their fields are `LedgerEvent`'s - a kind is added, never changed, and every event carries `v: 1`.
|
|
251
252
|
|
|
252
253
|
## Running it
|
package/docs/launch.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
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, 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.
|
|
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
|
+
## After every pulse
|
|
45
|
+
|
|
46
|
+
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.
|
|
47
|
+
|
|
48
|
+
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.
|
|
49
|
+
|
|
50
|
+
- **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.
|
|
51
|
+
- **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.
|
|
52
|
+
|
|
53
|
+
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`.
|
|
54
|
+
|
|
55
|
+
## On the command line
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
turri launch [file.plain] [--in-module <module>] [--guidance <text>] [--model <provider/id>]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
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.
|
|
62
|
+
|
|
63
|
+
`turri regenerate` and `conform` end a build that landed with `To try it: turri launch <spec>`.
|
package/docs/parser.md
CHANGED
|
@@ -65,7 +65,7 @@ turri parse . # every .plain module in a directory
|
|
|
65
65
|
turri parse <file.plain> --json
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
It uses this repo's own parser, so it needs no external tool, no API key and no credits: it parses each module with its test plain files, resolves its imports and required modules, and reports every syntax, concept and structure error with the line it is on. A module that passes lists each functional spec with its test plain file and its scenarios - and, where they have scenarios but the module has no test reqs, or no conformance testing script
|
|
68
|
+
It uses this repo's own parser, so it needs no external tool, no API key and no credits: it parses each module with its test plain files, resolves its imports and required modules, and reports every syntax, concept and structure error with the line it is on. A module that passes lists each functional spec with its test plain file and its scenarios - and, where they have scenarios but the module has no test reqs, or no conformance testing script, a `WARN` line naming the next step ([the steps of adding tests](regenerating.md#the-steps-of-adding-tests)): a warning, never a failure:
|
|
69
69
|
|
|
70
70
|
```
|
|
71
71
|
PASS todo.plain 3 functional specs, requires base
|
|
@@ -86,9 +86,9 @@ 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`, `
|
|
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
|
-
The exit code is 0 only when every file passed. In a conversation the same check is `parse`; `
|
|
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
|
|
|
93
93
|
## Two rules of inheritance
|
|
94
94
|
|
package/docs/regenerating.md
CHANGED
|
@@ -4,13 +4,13 @@ What happens when \*\*\*plain is turned into code - in which order, by which age
|
|
|
4
4
|
|
|
5
5
|
## Where things go
|
|
6
6
|
|
|
7
|
-
\*\*\*plain is built in its **project**: the nearest folder, from \*\*\*plain's own up, that holds a `config.turri.yaml`, a
|
|
7
|
+
\*\*\*plain is built in its **project**: the nearest folder, from \*\*\*plain's own up, that holds a `config.turri.yaml`, a module's `config.turri.<module>.yaml`, the old `config.yaml` or a `plain_modules/` - or, with none, \*\*\*plain's own folder. That is where its `plain_modules/` is, its `config.turri.yaml` read and its testing scripts found, wherever turri was started: a project that keeps its \*\*\*plain in `plain/`, with `plain/config.turri.yaml` and `plain/plain_modules/`, builds `plain/hubspot.plain` in `plain/plain_modules/hubspot/`, named from the folder above. Links in \*\*\*plain are relative to the file they are in.
|
|
8
8
|
|
|
9
9
|
Every path below is in the project. What the person writes:
|
|
10
10
|
|
|
11
11
|
| | |
|
|
12
12
|
| --- | --- |
|
|
13
|
-
| `config.turri.yaml`, `config.turri.<
|
|
13
|
+
| `config.turri.yaml`, `config.turri.<module>.yaml` | the project config, and a module's own, laid over it for that module and the modules built on it - see [the project config](config.md) |
|
|
14
14
|
| `test_scripts/run_unittests_<lang>.sh`, `test_scripts/run_conformance_tests_<lang>.sh` | the testing scripts, the only judges of pass or fail - their static checks included, the formatter, linter and type checker - where `config.turri.yaml` names them, else in the project folder, else in `test_scripts/` - see [below](#the-testing-scripts) |
|
|
15
15
|
| `AGENTS.md` | optional: a section whose heading names the queue steers how the work is cut - see [how the work is cut into jobs](#how-the-work-is-cut-into-jobs) |
|
|
16
16
|
|
|
@@ -40,16 +40,16 @@ 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/
|
|
44
|
-
| `dist/<module>/` | what
|
|
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
|
|
|
48
|
-
One project can hold modules that share nothing but a common module - a Python backend and a React frontend side by side, each importing `base`, neither requiring the other. Each
|
|
48
|
+
One project can hold modules that share nothing but a common module - a Python backend and a React frontend side by side, each importing `base`, neither requiring the other. Each gets its testing scripts, models and conformance in a file of its own, `config.turri.<module>.yaml`, laid over `config.turri.yaml` for that module and every module built on it that has no file of its own - worked out from the module, never chosen, and pinned to each pulse: see [a module's own config](config.md#a-modules-own-config).
|
|
49
49
|
|
|
50
50
|
### The base folder
|
|
51
51
|
|
|
52
|
-
A codebase that requires no other module starts empty - unless `base-folder:` in [the config](config.md) names a folder, by path from the project root, that it starts from instead: an existing codebase to build on, files the code is to use - images, animations, fonts - or both. A
|
|
52
|
+
A codebase that requires no other module starts empty - unless `base-folder:` in [the config](config.md) names a folder, by path from the project root, that it starts from instead: an existing codebase to build on, files the code is to use - images, animations, fonts - or both. A module's `config.turri.<module>.yaml` can name its own.
|
|
53
53
|
|
|
54
54
|
- **Copied once.** Before the codebase's first pulse, the folder's files are copied into `plain_modules/<module>/code` and committed - `start from the base folder <folder>` - and what was copied is recorded beside the code record, `code/.turri-base.json`. From a git repo, what git sees is copied - tracked files, and untracked ones it does not ignore - so no dependencies or build output; from any other folder, every file but `.git` and installed dependencies. The folder itself is never written to.
|
|
55
55
|
- **Up the chain with the code.** A module that requires another starts from that one's finished code, as always - whatever its agents did to what came from the base folder - and the record comes with it.
|
|
@@ -59,10 +59,10 @@ A codebase that requires no other module starts empty - unless `base-folder:` in
|
|
|
59
59
|
|
|
60
60
|
## One job
|
|
61
61
|
|
|
62
|
-
Every piece of work on the code is a job of the work loop (see [a whole module](#a-whole-module)) - in the chat, a **pulse** - the side panel's **regen** is \*\*\*plain with how much of it the code has been regenerated from (`spec-map.ts`), and its pulses every one of them - while the code and this page call it a job: a \*\*\*plain diff that takes the code from the \*\*\*plain description it is built from to the \*\*\*plain description the job ends on. To see what the
|
|
62
|
+
Every piece of work on the code is a job of the work loop (see [a whole module](#a-whole-module)) - in the chat, a **pulse** - the side panel's **regen** is \*\*\*plain with how much of it the code has been regenerated from (`spec-map.ts`), and its pulses every one of them - while the code and this page call it a job: a \*\*\*plain diff that takes the code from the \*\*\*plain description it is built from to the \*\*\*plain description the job ends on. To see what the next jobs will be told before they run, look ahead (see [a whole module](#a-whole-module)) - in the chat, `pulses` with the module's `plain_file`, then with the planned row's id; on the command line:
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
|
-
turri regenerate <file.plain> --dry-run # plan the work, print each codebase's
|
|
65
|
+
turri regenerate <file.plain> --dry-run # plan the work as regenerate would, print each codebase's next prompt, start nothing
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
### What the agent is given
|
|
@@ -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 [
|
|
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
|
|
|
@@ -172,7 +172,7 @@ Code accumulates up a `requires` chain: a module is built on a copy of the code
|
|
|
172
172
|
|
|
173
173
|
A module already built from \*\*\*plain as it is gets nothing. A job that does not land is rolled back, and halts its codebase: nothing more runs there until \*\*\*plain changes or the module is asked for again. On the command line, `turri regenerate` runs until nothing more can start, one line as each job starts and ends, and exits 1 when any failed.
|
|
174
174
|
|
|
175
|
-
The person halts a module's planned work too: `halt` (and `/halt`) given a planned row - `planned-<module>-2`, `planned-<module>-waiting` - or the module's name. A module's pulses are planned again from its \*\*\*plain at every look, so one planned pulse cannot be taken out alone: the module is halted - its running pulse stopped and rolled back, none of its planned pulses started, the modules built on it waiting for it - and what landed stays. A halt the person asked for holds through \*\*\*plain changes -
|
|
175
|
+
The person halts a module's planned work too: `halt` (and `/halt`) given a planned row - `planned-<module>-2`, `planned-<module>-waiting` - or the module's name. A module's pulses are planned again from its \*\*\*plain at every look, so one planned pulse cannot be taken out alone: the module is halted - its running pulse stopped and rolled back, none of its planned pulses started, the modules built on it waiting for it - and what landed stays. A halt the person asked for holds through \*\*\*plain changes - the loop sees them without starting the module - until the module is asked for again (`regenerate`, `conform`). To build some of it later, or cut it differently, there is `steer`; to drop work, \*\*\*plain.
|
|
176
176
|
|
|
177
177
|
A module the loop looked after whose `.plain` file is gone is forgotten - no rows, nothing waited for - and a codebase left behind, or whose \*\*\*plain no longer parses, shows nothing planned: its plan, and what it waited for, were \*\*\*plain's before.
|
|
178
178
|
|
|
@@ -186,21 +186,23 @@ A job that regenerates the whole of a new module's \*\*\*plain is too big to bui
|
|
|
186
186
|
|
|
187
187
|
Each pulse's title says what it does - at most 10 words and 70 characters, as it heads the pulse where the person watches the work. The grouping agent titles its groups; groups no agent made - the conformance tests', and a grouping that fell back - are titled by a third agent, told what each pulse does: what it builds, or, for the conformance tests, what they test. Without it, or when it fails, a pulse is titled by its functional specs' first lines, cut short. A pulse that makes the whole of an edit in one go - an edit that only changes what is built (a functional spec reworded, a definition or an implementation req changed, none new and none marked to regenerate again), or one no plan of holds together - is titled by the same agent, shown every change, before and after: by what the edit does (`Expired links answer 410 and the stats page goes`), and an edit to definitions or implementation reqs alone by what it changes in what is built (`Links are kept for 30 days`), never by its section. Without it, or when it fails, it is titled by the first line of the first functional spec it changes - else of its first change - and how many more (`Follow-link answers 410 for expired links, and 2 more`). A title names the change, never the act: one that starts with "regenerate" does not hold. Pulses already in the ledger keep the titles they were recorded with.
|
|
188
188
|
|
|
189
|
-
Changes to what is built - an item edited or taken out, a functional spec built worded differently - go where the same agent places each: with the group of new functional specs it is about, by default - so one edit that adds a functional spec, changes another and takes out a third is one pulse - or first, in a pulse of its own, when it reshapes what the new work is built on (a concept many functional specs use redefined, one others rely on taken out, a large rewrite) or has nothing to do with it. A functional spec changed counts toward its group's `max-specs-per-pulse`; one taken out does not. Every answer is checked: every new functional spec once, in order, next to each other, at most `max-specs-per-pulse`; every change to what is built placed once; every req placed once; every group titled once, within the limit. One that does not hold goes back to its agent, twice at most, and then the plan is a functional spec a job with every req in the first. A group whose functional specs and the definitions they bring pass `max-lines-per-pulse` (120 unset) is split into as few pulses as fit - its functional specs kept together in runs, in order, as long as each run stays within it, `Comments (1 of 2)`, `Comments (2 of 2)` - not a functional spec a job; its reqs do not count, as a split leaves them with its first job whatever happens. The planner runs on the chat's model in a conversation, and on the harness model under `turri regenerate`. No agent reviews its plan: the harness checks it - every change in exactly one job, \*\*\*plain holding together after each, the last ending on \*\*\*plain as it is.
|
|
189
|
+
Changes to what is built - an item edited or taken out, a functional spec built worded differently - go where the same agent places each: with the group of new functional specs it is about, by default - so one edit that adds a functional spec, changes another and takes out a third is one pulse - or first, in a pulse of its own, when it reshapes what the new work is built on (a concept many functional specs use redefined, one others rely on taken out, a large rewrite) or has nothing to do with it - titled by what it changes: `Changes to top-words`, or `Changes to the definitions` when no functional spec is among them. A functional spec changed counts toward its group's `max-specs-per-pulse`; one taken out does not. Every answer is checked: every new functional spec once, in order, next to each other, at most `max-specs-per-pulse`; every change to what is built placed once; every req placed once; every group titled once, within the limit. One that does not hold goes back to its agent, twice at most, and then the plan is a functional spec a job with every req in the first. A group whose functional specs and the definitions they bring pass `max-lines-per-pulse` (120 unset) is split into as few pulses as fit - its functional specs kept together in runs, in order, as long as each run stays within it, `Comments (1 of 2)`, `Comments (2 of 2)` - not a functional spec a job; its reqs do not count, as a split leaves them with its first job whatever happens. The planner runs on the chat's model in a conversation, and on the harness model under `turri regenerate`. No agent reviews its plan: the harness checks it - every change in exactly one job, \*\*\*plain holding together after each, the last ending on \*\*\*plain as it is.
|
|
190
190
|
|
|
191
191
|
Each planned job knows its cases - which functional specs it adds, changes (their text, or a concept they use) and takes out, or none: reqs and definitions only - and the loop says them, with each job's title, where the person looks (`drift`, `pulses`, and what `regenerate` returns).
|
|
192
192
|
|
|
193
|
-
**Steering.** How you want the work cut and ordered - "build the batch worker's helpers with the worker", "models first" - goes to the grouping and placement agents with every plan, as a strong preference: it never overrides the limits and checks. It comes from three places, each labelled with where it came from: the conversation (`steer`, for the whole project or one module, for the session); the project's `AGENTS.md`, every section whose heading names the queue (`## Queue guidance`), read afresh with every plan; and whatever asks for the work - `regenerate`
|
|
193
|
+
**Steering.** How you want the work cut and ordered - "build the batch worker's helpers with the worker", "models first" - goes to the grouping and placement agents with every plan, as a strong preference: it never overrides the limits and checks. It comes from three places, each labelled with where it came from: the conversation (`steer`, for the whole project or one module, for the session); the project's `AGENTS.md`, every section whose heading names the queue (`## Queue guidance`), read afresh with every plan; and whatever asks for the work - `regenerate` takes a `guidance` of its own, which the loop keeps with that module.
|
|
194
194
|
|
|
195
195
|
A plan is kept until \*\*\*plain, what it starts from or its steering changes. `steer` alone plans nothing: the next look does - a `regenerate`, a job ending, \*\*\*plain changing. Then the work not running yet is planned again to follow it, a running job going on as it is. Where a plan did not do as asked, it says so, and what `regenerate` returns lists it under "what the plan did not do as asked": each wish an agent did not follow, with why (both tools take a `notes` for that), a grouping or placement that did not hold, with what was wrong, and a group split for its size. The conversation tells the person that, rather than guessing.
|
|
196
196
|
|
|
197
|
+
**Looking ahead.** What will run can be seen before it does, from the same plan: a look ahead (`WorkLoop.lookAhead` - the chat's `pulses` with a module's `plain_file`, and `turri regenerate --dry-run`) has the session's work loop plan the module as `regenerate` would - the same codebases, its config pinned, the steering and AGENTS.md's queue section given to the planner - and keep the plans, starting nothing. Its codebases are held for it, apart from a halt: none of their pulses starts when another pulse ends and the loop looks again, and the look ahead writes nothing - a pure rename is not made, the work planned from the code as it would leave it. A codebase whose chain has a pulse running goes on as it was, what follows that pulse planned; a module the person halted stays halted. `regenerate`, `conform` or `/regenerate` lifts the hold, and the first pulse of the kept plan starts as it is, no planner asked again - so the plan seen is the plan run. Until then the plan is kept only while it fits: \*\*\*plain, what it starts from or the steering changed, it is dropped, not made again - only a look ahead plans a held codebase - and the next look ahead or `regenerate` plans it anew. The planned rows say they wait for `regenerate`. A planned row's id (`pulses` with `planned-<module>-1`) gives the next pulse of its codebase's whole prompt, built from the kept plan - and never planned again for it; a later pulse's prompt depends on what the ones before it land, a conformance pulse's on the code once it is built, and a codebase with a pulse running shows none. `turri regenerate --dry-run` keeps its plan only while it runs: it prints the next pulse's prompt and exits, and the `turri regenerate` after it plans again.
|
|
198
|
+
|
|
197
199
|
### When \*\*\*plain changes
|
|
198
200
|
|
|
199
201
|
A \*\*\*plain change is a notice, not a diff to run: **`regenerate`**, called after \*\*\*plain was edited by any means - the file tools, a skill, you in an editor - has the loop work out the work again. A job running goes on while every change it makes is still part of the work, measured from the same record; one that is making something \*\*\*plain no longer wants is stopped, rolled back, and the work planned again - a fixed rule, no agent. Say a module of 50 functionalities is regenerating and \*\*\*plain changes while `app:export-csv` builds: it goes on if the change leaves it as it is, and the work after it is planned again from what it lands. A job stopped so says it was turri, not you, and what changed under it - the functional spec that reads otherwise now, or the file it links that holds something else (`whyNotWanted`).
|
|
200
202
|
|
|
201
203
|
**A change inside what the running job regenerates steers it** (`steering.ts`), before any of that: a functional spec it regenerates reworded or given a sub-bullet, a definition or an implementation req it is given edited, a file one of them links edited - a change to an item it already has, never an item added or removed. Its coding agent is told, in the same shape as its first change (`describeSpecChange`): in its turn when it is in one, else as its next turn once the step it is at ends - a test run, a review - even when the tests passed or the review approved; edits made before it is told are one steer, the newest of each item. The unit tests run again after it, and a review still to come sees the change as steered, within its two reviews. The job's target moves with it: it lands built from \*\*\*plain as it was steered to. A definition or req that functional specs built before the job use too is told to the agent but kept out of the record, so those functional specs - and this job's with them - are patched by the next job. What else changed is the next job's; a change that is partly a steer is split. Two steers a job: a third goes the way above, stopped or - with `allow-to-stop-jobs: false` - left to the next job. Conformance jobs are not steered: they are planned from what the code lands. A steer shows in the job's view in the panel (what it regenerates now), in the transcript (`⇢ steered job …`), under the job in `regenerate`'s answer, and in the job's report.
|
|
202
204
|
|
|
203
|
-
With `allow-to-stop-jobs: false` in `config.turri.yaml` it is not stopped: it runs to its end and lands what it was regenerating, and the next job regenerates what changed since as a patch on top of it. Something lands as soon as it can, and the software evolves job by job - the first build of an integration lands and throws, the next patch fills in what was missing - at the cost of regenerating what \*\*\*plain has already moved on from. Your own `halt` stops a job either way.
|
|
205
|
+
With `allow-to-stop-jobs: false` in `config.turri.yaml` it is not stopped: it runs to its end and lands what it was regenerating, and the next job regenerates what changed since as a patch on top of it. Something lands as soon as it can, and the software evolves job by job - the first build of an integration lands and throws, the next patch fills in what was missing - at the cost of regenerating what \*\*\*plain has already moved on from. Your own `halt` stops a job either way. What is left to regenerate, without regenerating it, is `drift`.
|
|
204
206
|
|
|
205
207
|
### Regenerating a functionality
|
|
206
208
|
|
|
@@ -218,9 +220,9 @@ Whether something is done is never the agent's call, and never a command it chos
|
|
|
218
220
|
| `test_scripts/run_conformance_tests_<lang>.sh` | `run_conformance_tests_<lang>.sh <build> <tests>` | whether the conformance tests pass - the whole suite in `plain_modules/<module>/tests`, every functionality's and those carried up from below, at once - and the tests' static checks with them, exit 80 when only the checks fail |
|
|
219
221
|
| `test_scripts/prepare_environment_<lang>.sh` - optional | `prepare_environment_<lang>.sh <build>`, before every run of the conformance testing script | nothing on its own: it readies the environment the conformance tests run in - a `mvn install` of the build, say - and when it fails, the conformance tests are not run and the run fails as the preparation's |
|
|
220
222
|
|
|
221
|
-
The `implement-unit-testing-script` and `implement-conformance-testing-script` skills write them, in the background on the coding model of the module they are for ([background skills](skills-and-gates.md)). While one is being written, a module
|
|
223
|
+
The `implement-unit-testing-script` and `implement-conformance-testing-script` skills write them, in the background on the coding model of the module they are for ([background skills](skills-and-gates.md)). While one is being written - in the background, or to its end in print mode - a module built with the config it is named in waits for it, whether it lacks that script or has one being written over (a pulse started meanwhile would run against the old one) - `waiting for its unit testing script, which is being written`, or its conformance testing script - rather than fail for want of it, and is looked at again once the run ends: built, once the script is there, and stopped for want of it as before, when the run wrote none (`src/regenerate/scripts-being-written.ts`). A script written for one module's config file holds only the modules built with that file. They are looked for at the project root - the folder that holds `plain_modules` - in this order:
|
|
222
224
|
|
|
223
|
-
1. `config.turri.yaml` - with the
|
|
225
|
+
1. `config.turri.yaml` - with the module's own `config.turri.<module>.yaml` over it, or the one of a module it requires - naming them by path from the root:
|
|
224
226
|
|
|
225
227
|
```yaml
|
|
226
228
|
unittests-script: test_scripts/run_unittests.sh
|
|
@@ -230,7 +232,7 @@ The `implement-unit-testing-script` and `implement-conformance-testing-script` s
|
|
|
230
232
|
2. the root itself: the one `run_unittests*.sh` and `run_conformance_tests*.sh` there;
|
|
231
233
|
3. `test_scripts/`: the one of each there.
|
|
232
234
|
|
|
233
|
-
The same `config.turri.yaml` holds the project's other defaults - `module`, `model`, `review` - for [unattended runs](headless.md). A folder holding two of a kind is not guessed between: name the one to use in `config.turri.yaml` - or
|
|
235
|
+
The same `config.turri.yaml` holds the project's other defaults - `module`, `model`, `review` - for [unattended runs](headless.md). A folder holding two of a kind is not guessed between: name the one to use in `config.turri.yaml` - or in the module's own `config.turri.<module>.yaml`. A module with no file of its own, where others have one, says so when it stops: which files there are, and which script each names. The scripts are not linked from \*\*\*plain; a link to one is ignored.
|
|
234
236
|
|
|
235
237
|
They are required: a build with no unit testing script, or with conformance on and no conformance testing script, stops before it starts and says which skill adds it.
|
|
236
238
|
|
|
@@ -310,28 +312,30 @@ A functional spec is patched when a concept it uses changed as well as when its
|
|
|
310
312
|
|
|
311
313
|
A job lands once its unit tests pass and are reviewed: the code record becomes the \*\*\*plain description the job ends on, committed with the code. Its conformance tests are not the code job's: they are a track of their own ([conformance tests in the work loop](#conformance-tests-in-the-work-loop)).
|
|
312
314
|
|
|
313
|
-
A change that regenerates nothing - definitions moved to a common module, reqs reordered, \*\*\*plain moved between modules of the chain - is recorded, not regenerated: \*\*\*plain is recorded as it is now laid out and committed, with no agent and no testing script. Moving \*\*\*plain into a module the code was not built on is different: no change to the code brings that module's code in, so the codebase stops: it has to be started over - its code and conformance tests taken out, committed so its history keeps them, and the chain built again from the bottom. That is never done unasked. In the chat the model asks the person, saying why, and calls `regenerate` with `from_scratch: "module"` once they agree; `turri regenerate`
|
|
315
|
+
A change that regenerates nothing - definitions moved to a common module, reqs reordered, \*\*\*plain moved between modules of the chain - is recorded, not regenerated: \*\*\*plain is recorded as it is now laid out and committed, with no agent and no testing script. Moving \*\*\*plain into a module the code was not built on is different: no change to the code brings that module's code in, so the codebase stops: it has to be started over - its code and conformance tests taken out, committed so its history keeps them, and the chain built again from the bottom. That is never done unasked. In the chat the model asks the person, saying why, and calls `regenerate` with `from_scratch: "module"` once they agree; `turri regenerate` asks at the terminal, and `--start-over` agrees in advance - with no terminal and no flag, the run stops there, exit 1, saying so.
|
|
314
316
|
|
|
315
317
|
**A pure rename.** A func-id given another name, and nothing else with it - in the \*\*\*plain diff, the functional spec's `# <func-id>` heading the only line of it that changed, and in its test plain file `func_id:`, wherever the file now is - is no work for an agent: its code does what it did, and its tests test what they did. In the trees it is a functional spec taken out and one added, identical but for their func-id - their text, their links, their scenarios. turri makes it itself, as one unit of work (`renames.ts`): the code record and the tests record rewritten to the new func-id, and the tests relabelled - `… of base:add-task` becomes `… of base:create-task`, on the whole key - committed together, or rolled back whole when any of it fails, the codebase then halted rather than the functional spec built anew. No agent runs, no testing script, no pulse, and the code is not touched. A scenario-id renamed - the same text, under the same functional spec, nothing else of it changed - has its tests relabelled the same way, none rewritten. A rename together with any other change - its text, a scenario - stays a functional spec taken out and another added, its code built anew and its tests written anew. A module file renamed gets nothing of this: `todo.plain` renamed `tasks.plain` is a new module, built from scratch, and `plain_modules/todo` is left for the person to delete. Before turri has made it, a pure rename is shown as one, never as a delete and an add: `drift` says `renames app:add-task to app:create-task`, the planner plans the work around it from the code as renamed, the regeneration shows the functional spec built, its old func-id beside it, and the ledger records it as a fact of its own (`loop.renamed`).
|
|
316
318
|
|
|
317
319
|
## Conformance tests
|
|
318
320
|
|
|
319
|
-
**On or off.** A project has them only with `conformance-tests: true` ([config](config.md#conformance-tests)); unset, they are off - no scenarios written or tested, no conformance testing script, no conformance pulse
|
|
321
|
+
**On or off.** A project has them only with `conformance-tests: true` ([config](config.md#conformance-tests)); unset, they are off - no scenarios written or tested, no conformance testing script, no conformance pulse - and everything below is what turri does once they are on. Turning them on is yours to decide, as they make each change take about twice as long: the chat always knows they are off and how they are turned on, its `conform` is refused while they are, and when it thinks a module needs them - or you ask it for them - it tells you why and leaves it to you. `/conform` turns them on - `conformance-tests: true` - before it tests.
|
|
320
322
|
|
|
321
|
-
The unit tests are written by the agent that wrote the code. Conformance tests are the other half: black box, end to end - and what they test is the scenarios. A functional spec's scenarios are in its test plain file, `<test-dir>/<module>/<func-id>.plain` ([authoring](authoring-plain.md#what-plain-is-made-of)), with its conformance scenarios under `***conformance tests***` and its acceptance scenarios under `***acceptance tests***`, each a `# <scenario-id>` heading and its text. A functional spec with scenarios is tested; one with no test plain file is not. There is no setting for it: to have a functional spec tested, write its scenarios - in the chat, its agent writes them with `
|
|
323
|
+
The unit tests are written by the agent that wrote the code. Conformance tests are the other half: black box, end to end - and what they test is the scenarios. A functional spec's scenarios are in its test plain file, `<test-dir>/<module>/<func-id>.plain` ([authoring](authoring-plain.md#what-plain-is-made-of)), with its conformance scenarios under `***conformance tests***` and its acceptance scenarios under `***acceptance tests***`, each a `# <scenario-id>` heading and its text. A functional spec with scenarios is tested; one with no test plain file is not. There is no setting for it: to have a functional spec tested, write its scenarios - in the chat, its agent writes them with its file tools, then calls `regenerate`, when you ask for conformance tests. With conformance tests on, the chat also writes scenarios without being asked, for a functional spec it judges needs them - when an incorrect implementation could give output that looks right but is wrong, when two reasonable readings of its text answer some input differently, or when a bug would be costly - money, security, data, users' trust - each with concrete evidence, a functional spec only likely to change later being no reason; they are a \*\*\*plain change like any other, which you review, and come with the test reqs and the conformance testing script when those are missing.
|
|
322
324
|
|
|
323
325
|
```bash
|
|
324
326
|
turri conform <file.plain> # every functional spec with scenarios
|
|
325
|
-
turri conform <file.plain> app:add-task # one, named module:func-id
|
|
327
|
+
turri conform <file.plain> app:add-task # one, named module:func-id - written again when its tests are written
|
|
328
|
+
turri conform <file.plain> --from-scratch # the tests folder at the tip taken out, written again from the module it requires
|
|
329
|
+
turri conform <file.plain> --from-scratch-chain # the same, from nothing: every functional spec of the chain written again
|
|
326
330
|
```
|
|
327
331
|
|
|
328
332
|
They follow the code: a functional spec's scenarios get their tests once its code is built, for modules with `***test reqs***` and a conformance testing script. Once a codebase has conformance tests, they are always run and kept passing, and they are carried up to the modules built on top of it.
|
|
329
333
|
|
|
330
334
|
### The steps of adding tests
|
|
331
335
|
|
|
332
|
-
Nothing about testing exists until the person asks for it, or
|
|
336
|
+
Nothing about testing exists until the person asks for it, or - conformance tests on - the chat judges a functional spec needs it: a module imports its stack alone, and its functional specs have no test plain files. The first time tests are written in a module, the chat takes three steps, in order, each a visible change, asking nothing - conformance tests on, or `/conform`, is the person's yes to them: the **test reqs** - the stack's conformance template, `stdlib/<kind>/conformance/<stack>`, imported, or the module's own `***test reqs***`; the **conformance testing script** for the module's stack, written with `implement-conformance-testing-script` when the project has none ([the testing scripts](#the-testing-scripts)) - in the background, so the chat goes straight on, and the conformance tests wait for the script; then the **scenarios**.
|
|
333
337
|
|
|
334
|
-
A step skipped - functional specs with scenarios, and no test reqs (the module's own or imported), or no conformance testing script
|
|
338
|
+
A step skipped - functional specs with scenarios, and no test reqs (the module's own or imported), or no conformance testing script - and turri refuses to start a conformance pulse there, the work loop's and `conform`'s alike, naming the first step missing and the next step: `app has scenarios to test - app:say-hello - but no ***test reqs***, so its conformance tests cannot be written - the test reqs are the first step of adding tests. Next step: import the stack's conformance template, stdlib/backend/conformance/python-flask.` Nothing is started and nothing halts: the code goes on being built, and once it is, the module waits on that step - `waiting for its test reqs: …` in the loop's status and in `drift` - until \*\*\*plain or the scripts change, when the next look starts the pulse. `parse` gives the same as a warning, never a failure, and the map's top line says what is missing. A module another requires has its conformance tests written in the tips above it, so `parse` judges it by them, and says which: `base's conformance tests are written in top, which requires it: …`. A module with no scenarios skipped nothing: it is not tested, and nothing is said. Asked to conform a module none of whose functional specs has scenarios yet, turri names every step still to take, in their order, from the first one missing - `No functional spec of app has scenarios - none has a test plain file - so there is nothing to test. Adding tests is three steps, in this order: the test reqs, the conformance testing script, the scenarios. Next step: write the module's own ***test reqs***; then write the conformance testing script with the implement-conformance-testing-script skill; then write the scenarios, each functional spec's in tests/app/<func-id>.plain, then regenerate.` - and with only the scenarios left, that step alone.
|
|
335
339
|
|
|
336
340
|
### Conformance tests in the work loop
|
|
337
341
|
|
|
@@ -343,6 +347,8 @@ A conformance job is a \*\*\*plain diff's conformance run: the tests of its chan
|
|
|
343
347
|
|
|
344
348
|
**`conform`.** The loop starts conformance pulses by itself; `conform` starts them now - every functional spec of the module with scenarios, or those named as `module:func-id`. Named, it writes their tests alone: the module's other functional specs whose tests are behind are left as they are - `drift` lists them, saying conform asked for the named ones alone - until `conform` names none or the module is asked for again (`regenerate`); one of them whose text or scenarios change meanwhile joins those named. A module none of whose functional specs has scenarios, a functional spec \*\*\*plain does not have, one with no scenarios ("write them first") or a module that skipped a step of adding tests ([above](#the-steps-of-adding-tests)) is refused, and nothing is started. `conform` changes the module named alone, never the modules below it. For a module not regenerated yet, its tests are written once its code is built, before anything is built on it. For a module already regenerated whose tests are not written, while a module above it was started from it - its first pulse running, or code of its own built - the codebase above is disposable: a pulse running there is stopped, whatever `allow-to-stop-jobs` says, as the person asked; the codebase is deleted whole, its history with it; the tests are written in the module's own codebase; and the module above is regenerated from it once they pass. With every test written for what is built, it says so, and nothing is touched.
|
|
345
349
|
|
|
350
|
+
**Written again.** `conform` asks for tests written already to be written again - as `regenerate` does code - and touches no code. A functional spec it names whose tests are written has them written anew: marked `conform_again` in the tests record of every codebase where its code lives - the tips of its chains, whose suite holds the chain's tests, among the functional specs required there for a module below - committed, so the mark differs from what the tests are to be written for and the work loop plans a conformance pulse for it; one named whose tests are not written is written, as before. The pulse deletes every test labelled with each of its scenarios, and what only those tests used, and writes them again from the scenario and the functional spec's text, never from the old tests; it lands the tests record without the mark. **From scratch** (`from_scratch`, `/conform … from scratch`, `turri conform --from-scratch`) works where the module's code lives, as `regenerate` from scratch does - the tip of each chain it is built in, never a codebase in the middle: the tip's whole tests folder - its tests, their notes and their record - is taken out, committed first so its lineage keeps it, and the tests of the module the tip requires are copied in, as the codebase started from them; the tip's own tests are written anew on them, and those it inherits are brought up to date. `"chain"` (`from scratch, whole chain`, `--from-scratch-chain`) copies nothing in: every functional spec of the chain with scenarios has its tests written anew at the tip. Neither touches the code, a codebase below the tip or one built on the module. Functional specs named and from scratch are not asked for together, and a pulse running in a codebase it would touch refuses it, as `regenerate` from scratch does.
|
|
351
|
+
|
|
346
352
|
**`turri drift`** lists the conformance work one functional spec a line, its scenarios counted by case, and why else its tests are behind:
|
|
347
353
|
|
|
348
354
|
```
|
|
@@ -351,6 +357,7 @@ A conformance job is a \*\*\*plain diff's conformance run: the tests of its chan
|
|
|
351
357
|
todo:edit-task 1 added, 1 changed, 1 removed
|
|
352
358
|
todo:list-tasks its code was regenerated again - 3 to run on it
|
|
353
359
|
todo:delete-task taken out - its tests go (2 removed)
|
|
360
|
+
todo:log-in written again from scratch - 2 to write anew
|
|
354
361
|
```
|
|
355
362
|
|
|
356
363
|
A functional spec with no scenarios is not listed: `parse` shows it as "no scenarios - not tested".
|
|
@@ -370,6 +377,7 @@ A conformance job goes down to the scenarios. For each functional spec it touche
|
|
|
370
377
|
| removed | deleted, every test labelled with it - and nothing else |
|
|
371
378
|
| unchanged | left exactly as they are |
|
|
372
379
|
| unchanged, its functional spec's code changed - its text or a file it links patched, it was regenerated again, or a concept it uses changed | run on the new code: those that pass stay as they are, and one that fails is fixed against its scenario, read with the functional spec's text - no test holds the new code to what only the old code did |
|
|
380
|
+
| written anew - its functional spec's tests asked for again (`conform`, [above](#conformance-tests-in-the-work-loop)) | deleted, every test labelled with it, and written again from the scenario - none left as it was; a scenario it no longer has is removed |
|
|
373
381
|
|
|
374
382
|
A scenario given another scenario-id, and nothing else with it, is relabelled by turri itself, its tests not rewritten (see [a pure rename](#what-a-job-is-given-and-what-it-records)); renamed with any other change of its functional spec's, it is one removed and one added, and so is one moved between `***conformance tests***` and `***acceptance tests***`, as its label changes; one moved between two test plain files of the same functional spec is nothing. A functional spec whose text and scenarios both changed gets both cases. The tests record stores nothing new for it: each scenario's `{id, text}`, as written. The reviewer holds the agent to the cases: the tests of an unchanged scenario come out unchanged - unless the code changed under it and a test failed on it - and none labelled with a removed scenario is left.
|
|
375
383
|
|