@turri-dev/cli 0.2.3-next.5009c4c → 0.2.3-next.a3b9451

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 CHANGED
@@ -7,7 +7,9 @@
7
7
  <a href="https://discord.com/invite/REJzFmVQfC"><img src="https://img.shields.io/badge/Discord-join%20the%20community-5865F2?logo=discord&logoColor=white" alt="Join the turri Discord"></a>
8
8
  </p>
9
9
 
10
- **turri** builds regenerative software: what lasts is the system's intent, and the code is derived from it - cheap to throw away and build again. You tell **turri** what the system should do; **turri** writes that down as durable intent, with the tests that say when it is met, and builds the code from it. From then on the durable intent is the source of truth: as it changes, the code is regenerated from it rather than patched in place, and never left to drift from it.
10
+ **turri** is the first coding agent with the power of [regenerative software](https://chadfowler.com/regenerative-software/). It gives you back control over engineering while the agent handles the coding. Instead of maintaining code, you maintain the system's definition (specs, tests, and ADRs) structured using [\*\*\*plain](https://plainlang.org/). You describe what you want, **turri** captures it as a durable, reviewable system definition, and generates the code from it. As your intent evolves, **turri** regenerates the affected code rather than patching it prompt after prompt. The system definition remains the source of truth, and tests verify that the generated code conforms to it.
11
+
12
+ Code is disposable, system definition is durable.
11
13
 
12
14
  **turri** is named after *Turritopsis dohrnii*, the immortal jellyfish that regenerates itself from its young form, again and again - as **turri** regenerates the code from the durable intent - see [the name](#the-name).
13
15
 
@@ -15,53 +17,53 @@
15
17
 
16
18
  ## Quick start
17
19
 
18
- **turri** is built on [pi](https://pi.dev), the coding agent, and runs wherever [pi](https://pi.dev) runs: macOS, Linux, WSL; native Windows best effort, with Git Bash. You need git, bash and [Node](https://nodejs.org/en/download) 22.19 or newer - a Linux distribution's own `nodejs` package is often older. The agents use this machine's toolchains, fenced by a command check and an audit everywhere, and an OS sandbox where the OS has one - Seatbelt on macOS, bubblewrap on Linux (`apt install bubblewrap`) - see [installation](docs/installation.md#installation).
20
+ **turri** is built on [pi](https://pi.dev/) and runs on macOS, Linux, and WSL (native Windows via Git Bash is best effort). You'll need Git, Bash, and Node.js 22.19+.
21
+
22
+ ### Install
19
23
 
20
24
  ```bash
21
- npm install -g @turri-dev/cli # puts `turri` on your PATH
22
- turri --version # the version you installed? if not, see docs/installation.md#an-older-turri-runs
23
- turri doctor # checks the machine
25
+ npm install -g @turri-dev/cli
26
+ turri doctor
24
27
  ```
25
28
 
26
- To follow `main` as it moves, or work on turri itself, run it [from a clone](#from-a-clone) instead.
29
+ `turri doctor` checks your environment and tells you how to fix any missing dependencies. See the [installation guide](docs/installation.md) for details.
27
30
 
28
- `doctor` checks for Node 22.19+, bash, the OS sandbox and a model provider for [pi](https://pi.dev); in a project, the toolchains its modules need, what its testing scripts run against this machine, and that each model `config.turri.yaml` names answers with your credentials. It changes nothing without asking: when a check fails - the OS sandbox does not start, say - it says why, and the command for you to run. Run it again whenever something breaks. What each check means: [installation](docs/installation.md).
31
+ ### Configure your models
29
32
 
30
- Then start it in your project, signed in to your model providers:
33
+ **turri** uses a capable model to define the system and plan the work, and a smaller, cheaper model to write the code. It supports any model provider available through [pi](https://pi.dev/), and some subscriptions too.
31
34
 
32
35
  ```bash
33
- cd ~/my-project
34
- turri init-config # asks which vendor you use: Anthropic, OpenAI, Google, Amazon Bedrock, a Claude subscription, or other
35
- export ANTHROPIC_API_KEY=... # the key it names - or skip it, and type /login in turri once it has started
36
- turri
36
+ mkdir my-project && cd my-project
37
+ turri init-config
37
38
  ```
38
39
 
39
- `turri init-config` asks which vendor's models you use and writes the project's `config.turri.yaml` with two of theirs - a capable one you talk to, which writes the durable intent and plans the work, and a smaller, cheaper one that writes the code. For Anthropic:
40
+ Choose your model provider, then sign in with `/login` once **turri** has started.
40
41
 
41
- ```yaml
42
- harness-model: anthropic/claude-opus-5-5:medium # you talk to it
43
- coding-model: anthropic/claude-haiku-5-5:low # it writes the code
44
- ```
45
-
46
- To skip the question, name the vendor - `anthropic`, `openai`, `google`, `amazon-bedrock` (with `--maker` and `--region`), `claude-code` - your Claude Pro or Max subscription, through Claude Code ([how](docs/claude-subscription.md)) - or `other`:
42
+ ### Build your first app
47
43
 
48
44
  ```bash
49
- turri init-config --vendor anthropic
45
+ turri
50
46
  ```
51
47
 
52
- It then tells you which API key to set - or to type `/login` once **turri** is running instead. **turri** loads the `config.turri.yaml` in the folder you start it from. Below the two models, the file sets every other setting to its default - change any of them in the file, or from the chat with `/turri-config`. Any other model works too: [models](#models).
48
+ Then simply describe what you want:
49
+
50
+ > Build a small API where users can register and sign in.
53
51
 
54
- Once `turri` is running, say what you want - `a small API where people can register and sign in` - and **turri** starts the project and regenerates it at once.
52
+ **turri** captures your intent in [\*\*\*plain](https://plainlang.org/), generates the code, and validates it against the system definition.
55
53
 
56
- No project of your own yet? Build one of [**the examples**](examples/README.md) with turri, step by step.
54
+ As your requirements evolve, just describe the changes. **turri** updates the system definition and regenerates the affected code.
57
55
 
58
- Rather not install Node and the rest? **turri** also runs in Docker, from one image: [turri in Docker](docker/README.md).
56
+ ### Other ways to run turri
59
57
 
60
- Choosing models: [models](#models); what to do next: [use](#use).
58
+ Prefer a graphical interface? Try [turri desktop](https://github.com/turri-oss/turri-desktop).
59
+
60
+ You can also run **turri** [in Docker](docker/README.md), or [from a clone](#from-a-clone) to follow `main` or work on **turri** itself.
61
+
62
+ For more, see [Using **turri**](docs/using.md) and [Examples](examples/README.md).
61
63
 
62
64
  ### From a clone
63
65
 
64
- In place of the npm package - for the latest of `main`, or to change turri itself:
66
+ To run the local version of **turri** instead of the npm package:
65
67
 
66
68
  ```bash
67
69
  git clone git@github.com:turri-oss/turri.git && cd turri
@@ -70,47 +72,41 @@ npm link # puts `turri` on your PATH, pointing at this clone
70
72
  turri doctor
71
73
  ```
72
74
 
73
- The clone runs its TypeScript sources directly, so there is nothing to build. When new commits land:
75
+ The clone runs its TypeScript sources directly, so there is nothing to build. To pick up new commits, run `git pull` and `npm install`, then start **turri** again - a running one keeps the code it started with. More in the [installation guide](docs/installation.md#from-a-clone).
74
76
 
75
- ```bash
76
- git pull
77
- npm install # picks up any dependency that changed
78
- ```
77
+ ## Why
79
78
 
80
- A **turri** already running keeps the code it started with - start it again to run what you pulled. More in [installation](docs/installation.md#from-a-clone).
79
+ Coding agents write in minutes what used to take teams weeks. But while coding got faster, our ability to understand and review code didn't. We increasingly become accountable for software we don't fully understand.
81
80
 
82
- ## Why
81
+ Software built with coding agents grows prompt after prompt, patch upon patch. Decisions and reasoning get lost in chat sessions, misunderstandings accumulate in the code, and each change builds on top of the last. Eventually, neither the developer nor the agent fully understands the system anymore.
82
+
83
+ Better models and more elaborate agent workflows don't solve the fundamental problem: code remains the source of truth, and humans are expected to understand and maintain something they can no longer meaningfully review.
84
+
85
+ Regenerative software flips the traditional model of software development. Instead of maintaining code and trying to preserve the reasoning behind it, we maintain the system's definition and regenerate the code from it.
86
+
87
+ With **turri**, you engineer the system's definition instead of maintaining its implementation. The agent writes the code, but you retain the understanding and control over what gets built.
88
+
89
+ **The goal isn't to write code faster. It's to understand your software again.**
83
90
 
84
- Software has always been maintained: written once, then patched for as long as it lives and everything learnt while building it lived only in the code. Coding agents code in minutes what took a team weeks, and they get better at it with every model, so code is now cheap and a disposable asset. It no longer has to be maintained - it can be regenerated. What has to last instead is the intent: what the system should do, and the tests that say whether it does. Get that right and the code is replaceable. Get it wrong and no agent, however capable, can guess what you meant.
91
+ For the story behind **turri**, read [Why I built turri](https://turri.dev/blog/why-i-built-turri/).
85
92
 
86
- Code that is patched, prompt after prompt, drifts: every misunderstanding stays in it, and the next change is made on top. When the software can always be regenerated from durable information instead, that understanding is written down - explicit, reviewable and tested - and it evolves with the software rather than against it.
93
+ ## Code is disposable
87
94
 
88
- ## How it differs from ye old coding agent
95
+ ### 1. Define
89
96
 
90
- With a coding agent you work on code: you ask for a change, it edits the code, and you review the code it wrote.
97
+ Describe what you want to build or change. **turri** captures your intent as a structured system definition using [\*\*\*plain](https://plainlang.org/), including specifications, architectural decisions, and tests.
91
98
 
92
- With **turri** you work on the durable intent. You say what the software must do, and **turri** updates durable intent and can always regenerate the code from that. You don't review the code or keep it - you review and keep the intent: what the software must do, and what must hold as it changes. The code is a disposable artefact, rebuilt from it whenever it changes.
99
+ ### 2. Review
93
100
 
94
- | | ye old coding agent | **turri** |
95
- | --- | --- | --- |
96
- | **What you maintain** | the code, patched prompt after prompt | the durable intent |
97
- | **What gets built, in what order** | whatever the agent decides, as it goes | the code is built from the durable intent step by step, in a fixed order, so no intent is skipped |
98
- | **Who writes the code** | the agent, and it decides everything else too | the agent - **turri** decides what it builds, the agent only how, line by line |
99
- | **How it works** | improvised, differently every time | a developer workflow baked in - build, unit test, review, conformance test, regression test, commit - the same every time |
100
- | **What counts as done** | the agent says so | every unit of intent is tested and validated by **turri** itself: all its tests pass, or the work goes back |
101
- | **Tests** | written and changed by the agent that writes the code | written from the durable intent, apart from the code; the agent writing the code cannot change them |
102
- | **When it gets stuck** | it keeps going, or quietly works around the problem | it stops and tells you which intent to clarify |
101
+ Review the system definition before implementation begins. Make sure it describes what you actually want, without getting lost in implementation details.
103
102
 
104
- ## How it works
103
+ ### 3. Regenerate
105
104
 
106
- **turri** captures the durable intent in [\*\*\*plain](https://plainlang.org/docs/), a language for saying what software should do. \*\*\*plain breaks the intent down into functionalities - small units, each a single thing the software does - and **turri** regenerates the code from them piece by piece.
105
+ **turri** generates code from the approved definition. When requirements change, it regenerates the affected parts of the implementation rather than accumulating patches on top of existing code.
107
106
 
108
- 1. **Define.** You say what the software should do; **turri** writes it down as \*\*\*plain.
109
- 2. **Review and refine.** You review \*\*\*plain and change it with **turri** until it says what you mean.
110
- 3. **Regenerate.** Agents write the code; **turri** decides what they write and when, step by step, the same way every time.
111
- 4. **Validate.** Agents write conformance tests from \*\*\*plain; **turri** runs them, and keeps the code only when it does what \*\*\*plain says.
107
+ ### 4. Prove
112
108
 
113
- These are not phases, one after the other: you don't spend hours writing \*\*\*plain and then hours waiting for the code. You go round the loop in small steps, in conversation with **turri** - while you refine the next functionality, the one before it is already being regenerated and validated. A bug is fixed in \*\*\*plain; a new behaviour goes into \*\*\*plain; and the next regeneration carries it. Ask to try it at any time: **turri** puts what is built in `dist` and starts it on your machine - an app, and it tells you where to open your browser.
109
+ **turri** verifies the generated implementation against independently defined tests. The coding agent cannot change the tests to make its implementation pass. If validation fails, **turri** iterates until the implementation conforms to the definition.
114
110
 
115
111
  ## The name
116
112
 
package/dist/cli.js CHANGED
@@ -88,6 +88,25 @@ const SETUP_COMMANDS = {
88
88
  "init-config": "write a quick start config.turri.yaml here, from the vendor you use: a strong model to talk to, a smaller one to write the code",
89
89
  doctor: "check what turri needs - in a project, what it needs of this machine, and that its models answer",
90
90
  };
91
+ /**
92
+ * pi's package commands, run by pi itself: someone who installs turri has no `pi` on the PATH - npm links only turri's
93
+ * own command - and turri reads the packages pi installs (installed-providers.ts). `update` updates packages only: pi's
94
+ * own `update` with no source updates pi, and turri's pi is a pinned dependency (`updatesPi`).
95
+ */
96
+ const PACKAGE_COMMANDS = {
97
+ install: "install a pi package for every turri, -l for this project only - pi-claude-code for a Claude subscription, say",
98
+ update: "update a pi package, or --extensions for all of them",
99
+ remove: "remove a pi package `turri install` put in",
100
+ list: "the pi packages installed, yours and this project's",
101
+ };
102
+ /** Whether `update <args>` would update pi itself, as pi reads it: no package named, `self` or `pi`, `--self` or `--all`. */
103
+ function updatesPi(args) {
104
+ if (args.some((arg) => arg === "--self" || arg === "--all" || arg === "self" || arg === "pi"))
105
+ return true;
106
+ if (args.some((arg) => arg === "-h" || arg === "--help" || arg === "--extensions" || arg === "--extension" || arg === "--models"))
107
+ return false;
108
+ return !args.some((arg) => !arg.startsWith("-"));
109
+ }
91
110
  const USAGE = [
92
111
  "usage: turri [options] open the conversation here: pi, with turri's tools and themes loaded",
93
112
  " turri <command> [args]",
@@ -101,6 +120,7 @@ const USAGE = [
101
120
  ...Object.entries(COMMANDS).map(([name, { blurb }]) => ` ${name.padEnd(12)} ${blurb}`),
102
121
  "",
103
122
  ...Object.entries(SETUP_COMMANDS).map(([name, blurb]) => ` ${name.padEnd(12)} ${blurb}`),
123
+ ...Object.entries(PACKAGE_COMMANDS).map(([name, blurb]) => ` ${name.padEnd(12)} ${blurb}`),
104
124
  "",
105
125
  "Run `turri <command> --help` for that command's options.",
106
126
  "",
@@ -152,7 +172,7 @@ if (command === "-v" || command === "--version") {
152
172
  // The AWS region the project's Bedrock models need, set before any model is called - here, and in the pi the chat starts,
153
173
  // which inherits it - unless the person set one (bedrock-region.ts). The models named on the command line count too. A
154
174
  // command that calls no model is left alone.
155
- if (!["parse", "drift", "lineage", "ledger", "init-config"].includes(command ?? "")) {
175
+ if (!["parse", "drift", "lineage", "ledger", "init-config", ...Object.keys(PACKAGE_COMMANDS)].includes(command ?? "")) {
156
176
  const { applyBedrockRegion } = await import("./bedrock-region.js");
157
177
  const named = argv.flatMap((arg, at) => ["--harness-model", "--coding-model", "--model"].includes(arg) ? [argv[at + 1] ?? ""] : arg.startsWith("--harness-model=") || arg.startsWith("--coding-model=") || arg.startsWith("--model=") ? [arg.slice(arg.indexOf("=") + 1)] : []);
158
178
  applyBedrockRegion(process.cwd(), { also: named.filter((model) => model !== "") });
@@ -169,6 +189,16 @@ if (command === "doctor") {
169
189
  const { main } = await import("./setup.js");
170
190
  process.exit(await main(rest));
171
191
  }
192
+ // pi's own main answers them, as `pi install` would - into the same ~/.pi/agent turri reads - and exits.
193
+ if (Object.hasOwn(PACKAGE_COMMANDS, command)) {
194
+ if (command === "update" && updatesPi(rest)) {
195
+ console.error("turri update updates pi packages: name one (turri update <source>), or --extensions for all of them. pi is part of turri - npm install -g @turri-dev/cli@latest updates both.");
196
+ process.exit(1);
197
+ }
198
+ const { main } = await import("@earendil-works/pi-coding-agent");
199
+ await main(argv);
200
+ process.exit(process.exitCode ?? 0);
201
+ }
172
202
  const entry = COMMANDS[command];
173
203
  if (entry === undefined) {
174
204
  console.error(`unknown command: ${command}\n\n${USAGE}`);
@@ -73,7 +73,7 @@ export function conformanceBlock(on) {
73
73
  "go on with what they asked: the test reqs, the conformance testing script, the scenarios.",
74
74
  "You may offer them yourself, once and in a line, never turning them on unasked: when a functional spec could go wrong",
75
75
  "silently, or the coding agent keeps failing at one - say what they would add, and ask. A yes, and you call the tool.",
76
- "Asked how they are turned on: by asking you, or /turri-config conformance-tests true.",
76
+ "Asked how they are turned on: by asking you, /conform - which turns them on and tests what is built - or /turri-config conformance-tests true.",
77
77
  ].join("\n"),
78
78
  "</conformance-tests>",
79
79
  ].join("\n");
@@ -54,6 +54,13 @@ export default extension;
54
54
  * chat has asked for work yet.
55
55
  */
56
56
  export declare function sessionLoop(session: TurriCore): WorkLoop;
57
+ /** The functional specs a command's words name first, each as module:func-id - a comma after one allowed - and the words after them. */
58
+ export declare function funcIdsNamedFirst(words: string[]): {
59
+ funcIds: string[];
60
+ rest: string[];
61
+ };
62
+ /** Whether a /conform's words after its functional specs ask for a pulse a functional spec - "one by one", "separately". */
63
+ export declare function asksOneByOne(words: string): boolean;
57
64
  /**
58
65
  * What a slash command showed the person: kept in the chat, where they read it, and put in the conversation as well -
59
66
  * unseen there - so that when they speak of it next ("fix it"), the agent knows what they saw. A command runs outside
@@ -64,10 +71,15 @@ export declare function shownAfterCommand(pi: ExtensionAPI, ctx: ExtensionContex
64
71
  /** The command is in the chat already, above it (echoCommand): the text alone. */
65
72
  echoed?: boolean, react?: string): void;
66
73
  /**
67
- * What the agent does once /regenerate has started pulses: a command's output alone leaves the chat silent, and the
68
- * person wondering whether to wait. It says what runs, and that they need not - and starts nothing itself.
74
+ * What the agent does once /regenerate or /conform has started pulses: a command's output alone leaves the chat silent,
75
+ * and the person wondering whether to wait. It says what runs, and that they need not - and starts nothing itself.
69
76
  */
70
77
  export declare const COMMAND_STARTED_REACTION: string;
78
+ /**
79
+ * What the agent does when /conform started nothing: answers it at once - why, and what would let it start - and offers
80
+ * to do that, rather than leave the person with a refusal and a silent chat.
81
+ */
82
+ export declare const CONFORM_REFUSED_REACTION: string;
71
83
  export declare const COMMAND_OUTCOME = "turri_command_outcome";
72
84
  interface CommandOutcome {
73
85
  command: string;
package/dist/extension.js CHANGED
@@ -18,7 +18,7 @@ import { findTestScripts, scriptKindOfSkill } from "./regenerate/test-scripts.js
18
18
  import { writingScript } from "./regenerate/scripts-being-written.js";
19
19
  import { applyBedrockRegion } from "./bedrock-region.js";
20
20
  import { bannerWarnings } from "./turri-versions.js";
21
- import { conformanceBlock, conformanceTestsOnIn, CONFORMANCE_TOOLS, TURN_ON_TOOL, turnOnConformanceTests, turnOnConformanceTestsTool } from "./conformance-switch.js";
21
+ import { conformanceBlock, conformanceTestsOn, conformanceTestsOnIn, CONFORMANCE_TOOLS, TURN_ON_TOOL, turnOnConformanceTests, turnOnConformanceTestsTool } from "./conformance-switch.js";
22
22
  import { BACKGROUND_NOTE, doneLine, failedTask, ownChanges, runDetails, skillRunDelivery, startedText } from "./background-skills.js";
23
23
  import { createAskUserTool } from "./tools.js";
24
24
  import { asksFromScratch, asksWholeChain, driftTool, fromWorkingDir, haltTool, loopReply, MODEL_PARAM, regenerateTool, STACK_PARAM, stopJob, WAIT_PARAM, withCallStack, WORKING_DIR_PARAM } from "./loop-tools.js";
@@ -38,7 +38,7 @@ import { checkPlainFile, formatCheckResults } from "./plain/check.js";
38
38
  import { checkPlainTool } from "./parse-tool.js";
39
39
  import { changedFiles, projectFiles } from "./plain-files.js";
40
40
  import { whyFailed } from "./regenerate/diagnose-job.js";
41
- import { createWorkLoop, describeModules, isUpToDate, previewJobs } from "./regenerate/loop.js";
41
+ import { conformanceRefusal, createWorkLoop, describeModules, isUpToDate, previewJobs } from "./regenerate/loop.js";
42
42
  import { createTestAdvisor } from "./regenerate/advisor-runs.js";
43
43
  import { advisorDir } from "./regenerate/advisor-records.js";
44
44
  import { bindAdvisor, evaluateTestsTool, TEST_ADVISOR_BLOCK, verdictDelivery } from "./advisor-chat.js";
@@ -738,7 +738,7 @@ function turriExtension(api, session, link) {
738
738
  registerRegenerate(pi, cwd, jobs);
739
739
  registerDrift(pi, cwd, jobs);
740
740
  registerGlimpse(pi, cwd, jobs);
741
- registerBind(pi, cwd, jobs);
741
+ registerBind(pi, cwd, jobs, (plainFile) => turnOnConformance(session, plainFile));
742
742
  registerRenderModels(pi);
743
743
  registerDeploy(pi, cwd, jobs, deployStates.get(jobs) ?? createDeployState());
744
744
  registerSteering(pi, cwd);
@@ -1187,41 +1187,13 @@ function registerRegenerate(pi, cwd, jobs) {
1187
1187
  const command = `/regenerate ${args.trim()}`.trim();
1188
1188
  await echoCommand(pi, command);
1189
1189
  const say = (text, level) => shownAfterCommand(pi, ctx, command, text, level, true);
1190
- const all = args.trim().split(/\s+/).filter((word) => word !== "");
1191
- const [first = ""] = all;
1192
- const { named, rest } = moduleNamedFirst(cwd, all);
1193
- if (named === undefined && first.endsWith(".plain")) {
1194
- say(`There is no ${first} here.`, "error");
1190
+ const picked = await commandModule(cwd, ctx, args, say, { verb: "regenerate", outcome: "regenerated" });
1191
+ if (picked === undefined)
1195
1192
  return;
1196
- }
1193
+ const { plainFile } = picked;
1197
1194
  // Functional specs named first, each as module:func-id, as on the command line; what follows them is guidance.
1198
- const words = rest;
1199
- const again = [];
1200
- while (words.length > 0 && /^[^\s:]+:[a-z0-9-]+,?$/.test(words[0]))
1201
- again.push(words.shift().replace(/,$/, ""));
1195
+ const { funcIds: again, rest: words } = funcIdsNamedFirst(picked.rest);
1202
1196
  const guidance = words.join(" ").trim();
1203
- let plainFile = named;
1204
- if (plainFile === undefined) {
1205
- const modules = defaultMapFiles(cwd);
1206
- if (modules.length === 0) {
1207
- say("No .plain file to regenerate: name one - /regenerate app.plain - or set module: in config.turri.yaml.", "warning");
1208
- return;
1209
- }
1210
- if (modules.length === 1 || !ctx.hasUI)
1211
- plainFile = modules[0];
1212
- else {
1213
- const label = (file) => relative(cwd, file) || basename(file);
1214
- const picked = await ctx.ui.select("Regenerate which module?", modules.map(label));
1215
- plainFile = modules.find((file) => label(file) === picked);
1216
- if (plainFile === undefined)
1217
- return;
1218
- }
1219
- }
1220
- const check = checkPlainFile(plainFile);
1221
- if (!check.ok) {
1222
- say(`${relative(cwd, plainFile) || plainFile} does not parse, so nothing can be regenerated from it yet:\n${formatCheckResults([check])}`, "error");
1223
- return;
1224
- }
1225
1197
  // From scratch - started over, its code deleted - asked in the person's words: started at once, as asked.
1226
1198
  const scratch = asksFromScratch(guidance);
1227
1199
  // The whole chain with it - "from scratch, the whole chain" - every module it requires built again from the bottom.
@@ -1270,6 +1242,55 @@ function registerRegenerate(pi, cwd, jobs) {
1270
1242
  },
1271
1243
  });
1272
1244
  }
1245
+ /**
1246
+ * The module a /regenerate or /conform is for, and the words after it: the one its first words name, else the one
1247
+ * `module:` names, else the folder's top modules to pick from - checked to parse. Undefined, said why, when there is
1248
+ * none to take, or the person picked none.
1249
+ */
1250
+ async function commandModule(cwd, ctx, args, say, words) {
1251
+ const all = args.trim().split(/\s+/).filter((word) => word !== "");
1252
+ const [first = ""] = all;
1253
+ const { named, rest } = moduleNamedFirst(cwd, all);
1254
+ if (named === undefined && first.endsWith(".plain")) {
1255
+ say(`There is no ${first} here.`, "error");
1256
+ return undefined;
1257
+ }
1258
+ let plainFile = named;
1259
+ if (plainFile === undefined) {
1260
+ const modules = defaultMapFiles(cwd);
1261
+ if (modules.length === 0) {
1262
+ say(`No .plain file to ${words.verb}: name one - /${words.verb} app.plain - or set module: in config.turri.yaml.`, "warning");
1263
+ return undefined;
1264
+ }
1265
+ if (modules.length === 1 || !ctx.hasUI)
1266
+ plainFile = modules[0];
1267
+ else {
1268
+ const label = (file) => relative(cwd, file) || basename(file);
1269
+ const picked = await ctx.ui.select(`${words.verb === "regenerate" ? "Regenerate" : "Conform"} which module?`, modules.map(label));
1270
+ plainFile = modules.find((file) => label(file) === picked);
1271
+ if (plainFile === undefined)
1272
+ return undefined;
1273
+ }
1274
+ }
1275
+ const check = checkPlainFile(plainFile);
1276
+ if (!check.ok) {
1277
+ say(`${relative(cwd, plainFile) || plainFile} does not parse, so nothing can be ${words.outcome} from it yet:\n${formatCheckResults([check])}`, "error");
1278
+ return undefined;
1279
+ }
1280
+ return { plainFile, rest };
1281
+ }
1282
+ /** The functional specs a command's words name first, each as module:func-id - a comma after one allowed - and the words after them. */
1283
+ export function funcIdsNamedFirst(words) {
1284
+ const rest = [...words];
1285
+ const funcIds = [];
1286
+ while (rest.length > 0 && /^[^\s:]+:[a-z0-9-]+,?$/.test(rest[0]))
1287
+ funcIds.push(rest.shift().replace(/,$/, ""));
1288
+ return { funcIds, rest };
1289
+ }
1290
+ /** Whether a /conform's words after its functional specs ask for a pulse a functional spec - "one by one", "separately". */
1291
+ export function asksOneByOne(words) {
1292
+ return /\b(one[\s-]+(by|at)[\s-]+(one|a[\s-]+time)|separately|each[\s-]+(on[\s-]+its[\s-]+own|alone))\b/i.test(words);
1293
+ }
1273
1294
  /**
1274
1295
  * What a slash command showed the person: kept in the chat, where they read it, and put in the conversation as well -
1275
1296
  * unseen there - so that when they speak of it next ("fix it"), the agent knows what they saw. A command runs outside
@@ -1294,12 +1315,20 @@ echoed = false, react) {
1294
1315
  void pi.sendMessage({ customType: COMMAND_OUTCOME, content, display: false }, { triggerTurn: true, deliverAs: "followUp" });
1295
1316
  }
1296
1317
  /**
1297
- * What the agent does once /regenerate has started pulses: a command's output alone leaves the chat silent, and the
1298
- * person wondering whether to wait. It says what runs, and that they need not - and starts nothing itself.
1318
+ * What the agent does once /regenerate or /conform has started pulses: a command's output alone leaves the chat silent,
1319
+ * and the person wondering whether to wait. It says what runs, and that they need not - and starts nothing itself.
1299
1320
  */
1300
- export const COMMAND_STARTED_REACTION = "My pulses are regenerating from the person's /regenerate, in the background. Tell the person, in a line or two, what " +
1321
+ export const COMMAND_STARTED_REACTION = "My pulses are running from the person's command, in the background. Tell the person, in a line or two, what " +
1301
1322
  "runs and what is planned - and that the two of us can go on with the ***plain, or anything else, meanwhile: they need " +
1302
1323
  "not wait for it. Start nothing for it: no regenerate, no check, no release - its end is told when it comes.";
1324
+ /**
1325
+ * What the agent does when /conform started nothing: answers it at once - why, and what would let it start - and offers
1326
+ * to do that, rather than leave the person with a refusal and a silent chat.
1327
+ */
1328
+ export const CONFORM_REFUSED_REACTION = "Nothing was started from the person's /conform, for the reason shown. Tell them now, in a line or two, why - in your " +
1329
+ "words, not the message's - and what would let it start. Where it is something you can do - the scenarios, the test " +
1330
+ "reqs, the conformance testing script, the ***plain fixed - offer to do it, and do it once they say yes; then /conform, " +
1331
+ "or conform, runs their tests. Start nothing yet.";
1303
1332
  export const COMMAND_OUTCOME = "turri_command_outcome";
1304
1333
  /** Longer than a frame of the TUI's (16ms): an entry appended before it is drawn by its end. */
1305
1334
  const ONE_FRAME_MS = 20;
@@ -1346,13 +1375,89 @@ function plainFileNamed(cwd, word) {
1346
1375
  function registerDrift(pi, cwd, jobs) {
1347
1376
  pi.registerTool(driftTool({ cwd, jobs, loop: (ctx) => workLoopFor(jobs, cwd, ctx) }));
1348
1377
  }
1349
- function registerBind(pi, cwd, jobs) {
1378
+ function registerBind(pi, cwd, jobs, turnOn) {
1350
1379
  pi.registerTool(conformTool({
1351
1380
  cwd,
1352
1381
  loop: (ctx) => workLoopFor(jobs, cwd, ctx),
1353
1382
  model: (ctx, plainFile, named) => jobModel(ctx, "spec_changes", named, plainFile),
1354
1383
  wait: (ctx, asked) => shouldWait(ctx.mode, asked),
1355
1384
  }));
1385
+ // /conform: the same as the tool, from the person - a module's conformance tests written and run now, for the
1386
+ // functional specs named or every one with scenarios, in one pulse unless asked for one a functional spec. Asking for
1387
+ // them is asking for them on: off, they are turned on first. What would start nothing is found before anything is
1388
+ // said, and the chat's agent answers it at once.
1389
+ pi.registerCommand("conform", {
1390
+ description: "Write and run a module's conformance tests now - the functional specs named, or every one with scenarios - in one pulse, or one a functional spec when asked; turned on first when they are off: /conform [module | file.plain] [module:func-id ...] [one by one]",
1391
+ handler: async (args, ctx) => {
1392
+ const command = `/conform ${args.trim()}`.trim();
1393
+ await echoCommand(pi, command);
1394
+ /** Nothing started: shown, and the agent told to answer it now. */
1395
+ const refuse = (text) => shownAfterCommand(pi, ctx, command, text, "error", true, CONFORM_REFUSED_REACTION);
1396
+ const picked = await commandModule(cwd, ctx, args, (text, level) => (level === "info" ? shownAfterCommand(pi, ctx, command, text, level, true) : refuse(text)), {
1397
+ verb: "conform",
1398
+ outcome: "conformance tested",
1399
+ });
1400
+ if (picked === undefined)
1401
+ return;
1402
+ const { plainFile } = picked;
1403
+ const { funcIds, rest } = funcIdsNamedFirst(picked.rest);
1404
+ const words = rest.join(" ").trim();
1405
+ const separately = asksOneByOne(words);
1406
+ // Nothing but the functional specs and one by one: no planner reads guidance here, so other words are not dropped unsaid.
1407
+ if (words !== "" && !separately) {
1408
+ refuse(`/conform takes functional specs, each as module:func-id, and "one by one" - not "${words}". Nothing was started.`);
1409
+ return;
1410
+ }
1411
+ // Off: turned on - written where the module's value comes from, every chat's tools switched - and said with what follows.
1412
+ let turnedOn;
1413
+ try {
1414
+ if (!conformanceTestsOn(plainFile))
1415
+ turnedOn = `Conformance tests are on now - conformance-tests: true, written in ${turnOn(plainFile)}.`;
1416
+ }
1417
+ catch (error) {
1418
+ refuse(`Conformance tests could not be turned on: ${error instanceof Error ? error.message : String(error)}. Nothing was started.`);
1419
+ return;
1420
+ }
1421
+ const withTurnedOn = (text) => (turnedOn !== undefined ? `${turnedOn}\n${text}` : text);
1422
+ // What would start nothing - no scenarios, a functional spec not there, a step of adding tests skipped - read from the
1423
+ // ***plain alone, before anything is said.
1424
+ let refusal;
1425
+ try {
1426
+ refusal = withCallStack(plainFile, undefined, () => conformanceRefusal(plainFile, funcIds.length > 0 ? funcIds : undefined));
1427
+ }
1428
+ catch (error) {
1429
+ refusal = error instanceof Error ? error.message : String(error);
1430
+ }
1431
+ if (refusal !== undefined) {
1432
+ refuse(withTurnedOn(refusal));
1433
+ return;
1434
+ }
1435
+ const module = basename(plainFile).replace(/\.plain$/, "");
1436
+ const model = jobModel(ctx, "spec_changes", undefined, plainFile);
1437
+ shownAfterCommand(pi, ctx, command, withTurnedOn(`Starting ${funcIds.length > 0 ? `the conformance tests of ${funcIds.join(", ")}` : `${module}'s conformance tests`}…`), "info", true);
1438
+ await nextFrame();
1439
+ // In the background, as /regenerate: a codebase built on the module may be stopped and deleted first.
1440
+ void (async () => {
1441
+ try {
1442
+ const statuses = await withCallStack(plainFile, undefined, () => workLoopFor(jobs, cwd, ctx).conformance(plainFile, {
1443
+ ...(funcIds.length > 0 ? { funcIds } : {}),
1444
+ ...(model !== undefined ? { model } : {}),
1445
+ ...(separately ? { separately: true } : {}),
1446
+ }));
1447
+ // Nothing to write: said in the loop's words - "up to date" alone speaks of the code, not its tests.
1448
+ const upToDate = statuses.length > 0 && statuses.every(isUpToDate);
1449
+ const note = statuses.find((status) => status.conformanceNote !== undefined)?.conformanceNote;
1450
+ const text = upToDate ? `${(note ?? `the conformance tests of ${module} are written for it as built: there is nothing to write`).replace(/^./, (c) => c.toUpperCase())}.` : describeModules(statuses);
1451
+ shownAfterCommand(pi, ctx, command, text, "info", true, upToDate ? undefined : COMMAND_STARTED_REACTION);
1452
+ }
1453
+ catch (error) {
1454
+ refuse(error instanceof Error ? error.message : String(error));
1455
+ }
1456
+ })().catch(() => {
1457
+ // The chat let go meanwhile: there is nobody to say it to.
1458
+ });
1459
+ },
1460
+ });
1356
1461
  }
1357
1462
  /**
1358
1463
  * conform, for the conversation and for a skill that names it in its allowed-tools - the skill's on the conversation's
@@ -19,7 +19,7 @@ export const LOADING_PROVIDERS = "TURRI_LOADING_PROVIDERS";
19
19
  export const EXTENSION_PROVIDERS = {
20
20
  "claude-code": {
21
21
  label: "Claude subscription (Claude Code)",
22
- install: "pi install https://github.com/earendil-works/pi-claude-code",
22
+ install: "turri install https://github.com/earendil-works/pi-claude-code",
23
23
  signIn: "Claude Code installed (npm install -g @anthropic-ai/claude-code) and signed in to your Claude Pro or Max subscription: claude auth login",
24
24
  },
25
25
  };
@@ -374,6 +374,11 @@ export declare function namesOf(module: string, funcIds: string[]): string;
374
374
  * a func-id is unique in its module only.
375
375
  */
376
376
  export declare function funcIdsNamed(module: string, names: string[]): string[];
377
+ /**
378
+ * Why conform would start nothing for a module, from its ***plain alone (`conformanceAskedIn`): undefined when it would
379
+ * go on. What /conform checks before it says anything.
380
+ */
381
+ export declare function conformanceRefusal(plainFile: string, funcIds?: string[]): string | undefined;
377
382
  /** The codebases the loop looks after, as the person reads them: what runs, what is planned after it, and why nothing does. */
378
383
  /**
379
384
  * The coding agent's task for a dry run's first job, built as the render builds it - and all it did rolled back. Not for
@@ -293,21 +293,6 @@ export function createWorkLoop(options) {
293
293
  const tip = tipEntry(state);
294
294
  return testingGap({ moduleName: tip.moduleName, plainFile: tip.plainFile, tree: spec.tree, buildDir: tip.buildDir });
295
295
  };
296
- /**
297
- * The functional specs conform is asked for, as the spec has them now - refused when one is not in the spec, or has no
298
- * scenarios to test.
299
- */
300
- const askedSpecs = (moduleName, spec, funcIds) => {
301
- const items = spec[FUNCTIONAL_REQUIREMENTS] ?? [];
302
- const unknown = funcIds.filter((funcId) => !items.some((item) => item.id === funcId));
303
- if (unknown.length > 0)
304
- throw new Error(`${moduleName} has no functional spec ${namesOf(moduleName, unknown)}. Nothing was started.`);
305
- const untested = funcIds.filter((funcId) => !hasScenarios(items.find((item) => item.id === funcId)));
306
- if (untested.length > 0) {
307
- throw new Error(`${namesOf(moduleName, untested)} ${untested.length === 1 ? "has" : "have"} no scenarios - no test plain file - so there is nothing to test: ` +
308
- "write the conformance or acceptance scenarios first, with change_plain, and their tests are written once the code is built. Nothing was started.");
309
- }
310
- };
311
296
  /**
312
297
  * Whether a codebase lacks a testing script of this kind that is being written in the background now: it waits for it,
313
298
  * rather than fail for want of it, and is looked at again once the run ends.
@@ -1297,20 +1282,8 @@ export function createWorkLoop(options) {
1297
1282
  throw new Error(`Conformance tests are off for ${self.moduleName} (conformance-tests: false, or unset): nothing is conformance tested. ` +
1298
1283
  "They are turned on in the chat - by asking for them - or with conformance-tests: true in config.turri.yaml. Nothing was started.");
1299
1284
  }
1300
- const named = request.funcIds === undefined ? undefined : funcIdsNamed(self.moduleName, [...new Set(request.funcIds)]);
1301
- const ownSpec = chainSpec(own).tree;
1302
- const withScenarios = testedFuncIds(ownSpec);
1303
- // Refused before anything is touched: nothing to test, a functional spec not there, or one with no scenarios.
1304
- if (withScenarios.length === 0) {
1305
- throw new Error(`No functional spec of ${self.moduleName} has scenarios - none has a test plain file - so there is nothing to test: ` +
1306
- "write the conformance or acceptance scenarios first, with change_plain, and their tests are written once the code is built. Nothing was started.");
1307
- }
1308
- if (named !== undefined && named.length > 0)
1309
- askedSpecs(self.moduleName, ownSpec, named);
1310
- // A step of adding tests skipped - its test reqs, or the conformance testing script for its stack: refused, naming it.
1311
- const gap = testingGap({ moduleName: self.moduleName, plainFile: self.plainFile, tree: ownSpec, buildDir: self.buildDir });
1312
- if (gap !== undefined)
1313
- throw new Error(`${gap.text} Nothing was started.`);
1285
+ // Refused before anything is touched: a functional spec not there, nothing to test, or a step of adding tests skipped.
1286
+ const { named, spec: ownSpec, withScenarios } = conformanceAskedIn(own, request.funcIds);
1314
1287
  const tested = new Set((readRecord(conformanceDirFor(self.moduleName, modulesRoot(projectDirOf(self.plainFile))))?.[FUNCTIONAL_REQUIREMENTS] ?? []).map((item) => item.id));
1315
1288
  const toWrite = (named !== undefined && named.length > 0 ? named : withScenarios).some((funcId) => !tested.has(funcId));
1316
1289
  let wentBack = false;
@@ -1692,6 +1665,52 @@ export function funcIdsNamed(module, names) {
1692
1665
  return funcId;
1693
1666
  });
1694
1667
  }
1668
+ /**
1669
+ * What conform is asked for in a module, checked from its ***plain alone - quick, before anything is said or touched: the
1670
+ * functional specs named, as func-ids, and the module's spec and those of its functional specs with scenarios. Throws,
1671
+ * saying why nothing was started, when a functional spec named is not there or has no scenarios, when none has any, or
1672
+ * when a step of adding tests is skipped - no test reqs, no conformance testing script. Conformance tests off are not
1673
+ * checked: the conform tool is refused for that, and /conform turns them on.
1674
+ */
1675
+ function conformanceAskedIn(own, funcIds) {
1676
+ const self = tipOf(own);
1677
+ const named = funcIds === undefined ? undefined : funcIdsNamed(self.moduleName, [...new Set(funcIds)]);
1678
+ const spec = chainSpec(own).tree;
1679
+ const withScenarios = testedFuncIds(spec);
1680
+ if (withScenarios.length === 0) {
1681
+ throw new Error(`No functional spec of ${self.moduleName} has scenarios - none has a test plain file - so there is nothing to test: ` +
1682
+ "write the conformance or acceptance scenarios first, with change_plain, and their tests are written once the code is built. Nothing was started.");
1683
+ }
1684
+ if (named !== undefined && named.length > 0) {
1685
+ const items = spec[FUNCTIONAL_REQUIREMENTS] ?? [];
1686
+ const unknown = named.filter((funcId) => !items.some((item) => item.id === funcId));
1687
+ if (unknown.length > 0)
1688
+ throw new Error(`${self.moduleName} has no functional spec ${namesOf(self.moduleName, unknown)}. Nothing was started.`);
1689
+ const untested = named.filter((funcId) => !hasScenarios(items.find((item) => item.id === funcId)));
1690
+ if (untested.length > 0) {
1691
+ throw new Error(`${namesOf(self.moduleName, untested)} ${untested.length === 1 ? "has" : "have"} no scenarios - no test plain file - so there is nothing to test: ` +
1692
+ "write the conformance or acceptance scenarios first, with change_plain, and their tests are written once the code is built. Nothing was started.");
1693
+ }
1694
+ }
1695
+ // A step of adding tests skipped - its test reqs, or the conformance testing script for its stack: refused, naming it.
1696
+ const gap = testingGap({ moduleName: self.moduleName, plainFile: self.plainFile, tree: spec, buildDir: self.buildDir });
1697
+ if (gap !== undefined)
1698
+ throw new Error(`${gap.text} Nothing was started.`);
1699
+ return { named, spec, withScenarios };
1700
+ }
1701
+ /**
1702
+ * Why conform would start nothing for a module, from its ***plain alone (`conformanceAskedIn`): undefined when it would
1703
+ * go on. What /conform checks before it says anything.
1704
+ */
1705
+ export function conformanceRefusal(plainFile, funcIds) {
1706
+ try {
1707
+ conformanceAskedIn(resolveRequiresChain(resolve(plainFile), [], undefined, { allowNoFunctionalities: true }), funcIds);
1708
+ return undefined;
1709
+ }
1710
+ catch (error) {
1711
+ return error instanceof Error ? error.message : String(error);
1712
+ }
1713
+ }
1695
1714
  /** What a job does, in a few words: its cases, each functional spec by its func-id - with its module, a module below's. */
1696
1715
  function casesText(cases) {
1697
1716
  const named = (specs) => specs.map((spec) => (spec.module !== undefined ? `${spec.module}:${spec.funcId}` : spec.funcId)).join(", ");
@@ -105,7 +105,7 @@ export const TOOLS_NOT_CLI = [
105
105
  "run your own command line (turri regenerate, glimpse, conform, change-plain, cultivate, release, turri itself; npm run",
106
106
  "regenerate and the like) or start another pi through bash:",
107
107
  "that is a separate headless run the user cannot see or stop. Only when the user explicitly asks for the",
108
- "command line, run it. Configuring pi itself - pi install, update, list, config, auth, or its settings files -",
108
+ "command line, run it. Configuring pi itself - turri install, update, remove, list; pi install, update, list, config, auth; or its settings files -",
109
109
  "is fine; it starts no agent.",
110
110
  "</turri-tools>",
111
111
  ].join("\n");
@@ -21,13 +21,13 @@ turri does not depend on the extension: it finds it as pi does, once you have in
21
21
  claude auth login
22
22
  ```
23
23
 
24
- 2. **The extension**, installed into pi - turri runs on pi, and reads what pi has installed:
24
+ 2. **The extension**, installed with turri - turri runs on [pi](https://pi.dev), and `turri install` is pi's own `install`, run by the pi inside turri: no `pi` of your own needed:
25
25
 
26
26
  ```bash
27
- pi install https://github.com/earendil-works/pi-claude-code
27
+ turri install https://github.com/earendil-works/pi-claude-code
28
28
  ```
29
29
 
30
- `pi list` shows it; `pi update` updates it; `pi remove https://github.com/earendil-works/pi-claude-code` takes it out.
30
+ `turri list` shows it; `turri update https://github.com/earendil-works/pi-claude-code` updates it; `turri remove https://github.com/earendil-works/pi-claude-code` takes it out. A `pi` you installed yourself sees the same packages, as they are kept in pi's own folder, `~/.pi/agent`.
31
31
 
32
32
  3. **Nothing in the environment that points Claude Code elsewhere.** The extension refuses to run while any of these is set - each sends Claude Code to an API key or another backend, not the subscription: `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_BASE_URL`, `ANTHROPIC_FOUNDRY_API_KEY`, `CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_VERTEX`, `CLAUDE_CODE_USE_FOUNDRY`. Unset them where turri starts - your shell's profile, say. A project that also uses `anthropic/...` models with a key cannot run both from one shell.
33
33
 
@@ -74,10 +74,10 @@ Each step says what you should see; the first one that does not is where it stop
74
74
 
75
75
  `"loggedIn": true`, and a `"subscriptionType"` - `pro`, `max` or `team`. None, and Claude Code is signed in with a Console API key instead: `claude auth logout`, then `claude auth login` with the subscription's account.
76
76
 
77
- 2. **pi has the extension.**
77
+ 2. **The extension is installed.**
78
78
 
79
79
  ```bash
80
- pi list
80
+ turri list
81
81
  ```
82
82
 
83
83
  lists `https://github.com/earendil-works/pi-claude-code`.
@@ -121,7 +121,7 @@ The desktop app runs turri's chats itself, and finds the extension as the termin
121
121
 
122
122
  | what you see | what to do |
123
123
  | --- | --- |
124
- | `claude-code/... need pi-claude-code, pi's extension for a Claude subscription, which is not installed` | `pi install https://github.com/earendil-works/pi-claude-code` |
124
+ | `claude-code/... need pi-claude-code, pi's extension for a Claude subscription, which is not installed` | `turri install https://github.com/earendil-works/pi-claude-code` |
125
125
  | `claude-code - Claude subscription (Claude Code) - is not there` | the same: the extension is not installed, so pi has no `claude-code` provider |
126
126
  | `Claude Code (claude) is not on the PATH` | `npm install -g @anthropic-ai/claude-code`, or name it in `PI_CLAUDE_CODE_COMMAND` |
127
127
  | `Claude Code (...) is not signed in` | `claude auth login` |
package/docs/config.md CHANGED
@@ -28,7 +28,7 @@ Beside a `config.yaml` - another tool's, say - the new file takes from it the ke
28
28
 
29
29
  ### A Claude subscription
30
30
 
31
- `--vendor claude-code` runs every agent on your Claude Pro, Max or Team subscription instead of an API key, through Claude Code and [pi-claude-code](https://github.com/earendil-works/pi-claude-code), a [pi](https://pi.dev) extension: `claude-code/claude-opus-5-5` to talk to, `claude-code/claude-sonnet-5` to code. It needs the extension installed (`pi install https://github.com/earendil-works/pi-claude-code`) and Claude Code signed in (`claude auth login`), and none of `ANTHROPIC_API_KEY` and the like set; `turri doctor` checks all of it. Setting it up, its models, checking it yourself and what to know: [a Claude subscription](claude-subscription.md).
31
+ `--vendor claude-code` runs every agent on your Claude Pro, Max or Team subscription instead of an API key, through Claude Code and [pi-claude-code](https://github.com/earendil-works/pi-claude-code), a [pi](https://pi.dev) extension: `claude-code/claude-opus-5-5` to talk to, `claude-code/claude-sonnet-5` to code. It needs the extension installed (`turri install https://github.com/earendil-works/pi-claude-code`) and Claude Code signed in (`claude auth login`), and none of `ANTHROPIC_API_KEY` and the like set; `turri doctor` checks all of it. Setting it up, its models, checking it yourself and what to know: [a Claude subscription](claude-subscription.md).
32
32
 
33
33
  ## Where it is read from
34
34
 
@@ -180,7 +180,7 @@ A job keeps the model it was queued with: choosing another holds for what is que
180
180
 
181
181
  ## Conformance tests
182
182
 
183
- `conformance-tests: true` turns them on, a stack's `config.turri.<stack>.yaml` able to say its own. Unset, they are off, and `turri init-config` writes `conformance-tests: false`: no scenarios are written or tested, no conformance testing script is written, no conformance pulse runs - in the work loop, from `conform` or `turri conform` - the test advisor is off, and the chat has neither `conform` nor `evaluate_tests`. Test plain files already there are kept and parsed, and not tested: `parse` and `drift` say so. The chat always knows what they are, that they are off, and how they are turned on, and may offer them - once, never turning them on unasked. You asking it for conformance tests or testing scenarios, or agreeing when it offers them, turns them on: it writes `conformance-tests: true` - into the stack's file when that names the key, else `config.turri.yaml` - in effect at once, and kept for the sessions after. So does `/turri-config conformance-tests true`.
183
+ `conformance-tests: true` turns them on, a stack's `config.turri.<stack>.yaml` able to say its own. Unset, they are off, and `turri init-config` writes `conformance-tests: false`: no scenarios are written or tested, no conformance testing script is written, no conformance pulse runs - in the work loop, from `conform` or `turri conform` - the test advisor is off, and the chat has neither `conform` nor `evaluate_tests`. Test plain files already there are kept and parsed, and not tested: `parse` and `drift` say so. The chat always knows what they are, that they are off, and how they are turned on, and may offer them - once, never turning them on unasked. You asking it for conformance tests or testing scenarios, or agreeing when it offers them, turns them on: it writes `conformance-tests: true` - into the stack's file when that names the key, else `config.turri.yaml` - in effect at once, and kept for the sessions after. So does `/turri-config conformance-tests true`, and so does `/conform`, which then tests what has scenarios and code at once.
184
184
 
185
185
  On, what is tested is the functional specs with scenarios - the conformance and acceptance scenarios of each one's test plain file, `<test-dir>/<module>/<func-id>.plain` - in every module with `***test reqs***`. A functional spec with no test plain file is not tested, and a module with no functional spec with scenarios gets no conformance pulse at all - but keeps the codebase's existing tests passing. `test-dir` says where the test plain files are. To have a functional spec tested, write its scenarios: the chat writes them with `change_plain` when you ask for conformance tests (see [conformance tests](regenerating.md#conformance-tests)).
186
186
 
@@ -24,7 +24,7 @@ The package on npm is built: Node runs no `.ts` file inside a `node_modules`, so
24
24
  `.github/workflows/publish.yml` publishes `@turri-dev/cli`, after the typecheck and the suite pass:
25
25
 
26
26
  - every push or merge into `main` publishes a prerelease under the `next` dist-tag - the patch after the `latest` on npm, with the commit's sha: `0.1.2-next.<sha>`. `latest` is not touched; `npm install -g @turri-dev/cli@next` gets it.
27
- - a GitHub Release tagged `vX.Y.Z`, published by hand, publishes `X.Y.Z` as `latest` (or under `next`, if the release is marked a pre-release). The tag is the version: it is set in the runner and never committed, so `package.json`'s version on `main` is stale by design.
27
+ - a GitHub Release tagged `vX.Y.Z`, published by hand, publishes `X.Y.Z` as `latest` (or under `next`, if the release is marked a pre-release). The tag is the version: it is set in the runner and never committed, so `package.json`'s version on `main` is stale by design. Once npm has a release on `latest`, it is posted to the Discord channel whose webhook is the repository secret `DISCORD_RELEASE_WEBHOOK` - its name, its notes and the command that updates; without the secret nothing is posted.
28
28
 
29
29
  The workflow signs in to npm with npm's trusted publishing (OIDC), not a token: the package's settings on npmjs.com trust `turri-oss/turri`, the workflow `publish.yml` and the environment `npm`. Renaming the workflow file breaks it.
30
30
 
package/docs/hosting.md CHANGED
@@ -149,7 +149,7 @@ await turri.dispose(); // every chat let go, what activate start
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
- - **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")` - so the plan is the chats'. 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`.
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
154
  - **The surface.** What turri tells the model of where the person watches the work is the terminal's by default: regen, the side panel on `ctrl+h`, `/pulses`. In a host none of that is there, and the model would send the person to keys and panels that do not exist. `surface` is the host's own description of its UI - the views it has in place of the terminal's, what its marks and buttons mean, where questions appear - in its own words. Given, turri leaves every terminal instruction out of what the model is told and puts the surface in turri's identity, as a `<surface>` block, where the identity speaks of regen. It reaches the side questions and the tools' own words too: a pulse not found says the `pulses` tool lists them, not `/pulses`. Text only the person sees in the terminal - the job panel, the side panel - is the terminal's and stays as it is. Without `surface`, the prompt is the terminal's, byte for byte. What the conversation is to do once something is released belongs there too - open it in the host's preview, say what to test: with `sentinel: false`, after a pulse released under `release-after-pulse`, the conversation does what it was told to do once something is released. With the sentinel on, the sentinel tests the release, and the conversation only says it landed.
155
155
  - **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.
@@ -157,7 +157,7 @@ await turri.dispose(); // every chat let go, what activate start
157
157
 
158
158
  ### The test advisor
159
159
 
160
- Conformance tests, and the test advisor with them, are on only with `conformance-tests: true` ([config](config.md#conformance-tests)) - off when unset: then no conformance pulse runs, `evaluateTests` throws saying how they are turned on, and the chats have `turn_on_conformance_tests` in place of `conform` and `evaluate_tests`; `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 the chat's `turn_on_conformance_tests` does, with no model call: it writes `conformance-tests: true` where the module's value comes from - its stack's `config.turri.<stack>.yaml` when that sets the key, which `/turri-config` alone would not change, else `config.turri.yaml` - switches every open chat's tools (`conform` and `evaluate_tests` in, `turn_on_conformance_tests` out), the test advisor starting at its next look, 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`. A host's session has the [test advisor](test-advisor.md), as the terminal's chat does: new and changed functional specs are checked in the background for whether they need testing scenarios. Its verdict goes to the chat the person looks at, once that chat is idle - its agent done: a yes as a hidden message to its agent, `customType: "turri_advisor_verdict"`, that starts a turn in which the chat tells the person and writes the scenarios; a no as an entry of its session, `turri_advisor` (`data.text`, the line), that starts none. A host's chats have the `evaluate_tests` tool too, whatever `test-advisor` says, and a host has its own way in: `turri.evaluateTests(funcIds, { plainFile?, reason? })` - a button on a functional spec, say - asks the same, `module:func-id`s or func-ids of `plainFile`'s module, and returns at once with `{ started, already, scenarios, missing }`, each verdict coming to the chat the person looks at as any does. What it made of each functional spec is `readAdvisor(projectDir, module)`: `{ module, plainFile, entries }`, an entry by func-id - `state` `pending` (being evaluated), `yes`, `no` or `failed`, its `report` (the questions that were a yes, with their evidence, and the inputs to cover), `undelivered` for a yes no chat has had yet - and current while its `hash` is `textHash` of the functional spec's text - `plainGraph`'s `item.text` for it: its body without the `# <func-id>` heading, its links as the parser reads them, exactly the text the advisor hashes; a functional spec with no entry, or a stale one, has not been looked at as it reads. Its facts are ledger events - `advisor.classified`, `advisor.dropped`, `advisor.failed` - heard through `onLedgerEvent`. `test-advisor` is one of `configSettings()`.
160
+ Conformance tests, and the test advisor with them, are on only with `conformance-tests: true` ([config](config.md#conformance-tests)) - off when unset: then no conformance pulse runs, `evaluateTests` throws saying how they are turned on, and the chats have `turn_on_conformance_tests` in place of `conform` and `evaluate_tests`; `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 the chat's `turn_on_conformance_tests` does, with no model call: it writes `conformance-tests: true` where the module's value comes from - its stack's `config.turri.<stack>.yaml` when that sets the key, which `/turri-config` alone would not change, else `config.turri.yaml` - switches every open chat's tools (`conform` and `evaluate_tests` in, `turn_on_conformance_tests` out), the test advisor starting at its next look, 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`. A host's session has the [test advisor](test-advisor.md), as the terminal's chat does: new and changed functional specs are checked in the background for whether they need testing scenarios. Its verdict goes to the chat the person looks at, once that chat is idle - its agent done: a yes as a hidden message to its agent, `customType: "turri_advisor_verdict"`, that starts a turn in which the chat tells the person and writes the scenarios; a no as an entry of its session, `turri_advisor` (`data.text`, the line), that starts none. A host's chats have the `evaluate_tests` tool too, whatever `test-advisor` says, and a host has its own way in: `turri.evaluateTests(funcIds, { plainFile?, reason? })` - a button on a functional spec, say - asks the same, `module:func-id`s or func-ids of `plainFile`'s module, and returns at once with `{ started, already, scenarios, missing }`, each verdict coming to the chat the person looks at as any does. What it made of each functional spec is `readAdvisor(projectDir, module)`: `{ module, plainFile, entries }`, an entry by func-id - `state` `pending` (being evaluated), `yes`, `no` or `failed`, its `report` (the questions that were a yes, with their evidence, and the inputs to cover), `undelivered` for a yes no chat has had yet - and current while its `hash` is `textHash` of the functional spec's text - `plainGraph`'s `item.text` for it: its body without the `# <func-id>` heading, its links as the parser reads them, exactly the text the advisor hashes; a functional spec with no entry, or a stale one, has not been looked at as it reads. Its facts are ledger events - `advisor.classified`, `advisor.dropped`, `advisor.failed` - heard through `onLedgerEvent`. `test-advisor` is one of `configSettings()`.
161
161
 
162
162
  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
163
 
@@ -22,6 +22,10 @@ turri # pi, with turri's tools, skills and themes loaded
22
22
 
23
23
  The package is `@turri-dev/cli` - npm keeps the name `turri` back, as too like another package's - and the command it puts on your PATH is `turri`. `npm install -g @turri-dev/cli@next` gets the latest prerelease instead, built from the last commit on `main`. Installed again - `@latest` or `@next` - it replaces the one there. `turri --version` says which turri runs, and the [pi](https://pi.dev) under it: `turri 0.1.6 (pi 1.3.0)`, and from a clone its commit too.
24
24
 
25
+ ## pi packages
26
+
27
+ turri installs no `pi` command of its own - npm puts only `turri` on your PATH - so [pi](https://pi.dev)'s package commands are turri's: `turri install <source>` installs a pi package - an extension, such as [pi-claude-code](https://github.com/earendil-works/pi-claude-code) for a [Claude subscription](claude-subscription.md) - for every turri (`-l` for this project only), `turri list` lists them, `turri update <source>` updates one and `turri update --extensions` all of them, and `turri remove <source>` takes one out. They are pi's own commands, run by the pi inside turri, and keep the packages in pi's folder, `~/.pi/agent`, where a `pi` you installed yourself finds them too. `turri update` never updates pi itself - pi is part of turri, and installing turri again updates both.
28
+
25
29
  ## An older turri runs
26
30
 
27
31
  The install worked, and a bare `turri` still runs an older turri: another one comes before it on your PATH - installed under another Node version (nvm, fnm, volta and the like give each its own global folder), or an old `npm link` of a clone. The shell takes the first it finds.
@@ -316,7 +316,7 @@ A change that regenerates nothing - definitions moved to a common module, reqs r
316
316
 
317
317
  ## Conformance tests
318
318
 
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, the test advisor off - and everything below is what turri does once they are on. The chat always knows they are off and how they are turned on: you asking it for conformance tests, or agreeing when it offers them, has it call `turn_on_conformance_tests`, which writes `conformance-tests: true` and gives it `conform` and `evaluate_tests` back.
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, the test advisor off - and everything below is what turri does once they are on. The chat always knows they are off and how they are turned on: you asking it for conformance tests, or agreeing when it offers them, has it call `turn_on_conformance_tests`, which writes `conformance-tests: true` and gives it `conform` and `evaluate_tests` back. `/conform` turns them on too, before it tests.
320
320
 
321
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 `change_plain` when you ask for conformance tests. In the chat and a host, the [test advisor](test-advisor.md) checks in the background whether a new or changed functional spec needs testing, and on a yes the chat writes its scenarios - with the test reqs and the conformance testing script, when they are missing.
322
322
 
package/docs/using.md CHANGED
@@ -45,7 +45,7 @@ What each regeneration does, in order, is in [regenerating the code](regeneratin
45
45
 
46
46
  The conversation knows the \*\*\*plain standard library from its first turn: the stdlib rule in its system prompt lists every stack and where the templates are, so "build this as a Flask backend" becomes an import of `stdlib/backend/python-flask`, not a stack written out by hand. The banner at start says how many stacks there are, and **`/stdlib`** lists them, each with what it is (see [the standard library](authoring-plain.md#the-standard-library)).
47
47
 
48
- The agent does this work with these tools, never by running turri's command line - or another [pi](https://pi.dev) - through its shell: that would be a separate, headless run outside regen and `/halt`. The harness refuses such a command unless your message asks for the command line ("run it headless", "use the CLI", or the command itself). [pi](https://pi.dev) configuring itself - `pi install`, `update`, `list`, `config`, `auth`, its settings - is not affected.
48
+ The agent does this work with these tools, never by running turri's command line - or another [pi](https://pi.dev) - through its shell: that would be a separate, headless run outside regen and `/halt`. The harness refuses such a command unless your message asks for the command line ("run it headless", "use the CLI", or the command itself). [pi](https://pi.dev) configuring itself - `turri install`, `update`, `remove`, `list`, or `pi install`, `update`, `list`, `config`, `auth`, its settings - is not affected.
49
49
 
50
50
  ## Pulses
51
51
 
@@ -86,8 +86,9 @@ A regeneration takes minutes, so in the TUI every tool that regenerates starts t
86
86
  - **`/sentinel`** says whether the [sentinel](sentinel.md) checks every pulse that finishes: `ask` - you are asked before it first opens in a session - `on`, or `off`; written to `config.turri.yaml`.
87
87
  - **`/stack`** chooses the stack everything is built with from then on, in a project whose parts are on different stacks: a list of the project's stacks, or `/stack backend`, `/stack none`. The stack's `config.turri.<stack>.yaml` is laid over `config.turri.yaml` - its testing scripts, toolchains, models - for the session; a module already asked for keeps the stack it was asked for with. The chat model switches it too when you ask - and, to build one part, passes that part's stack to `regenerate` instead, leaving the session's as it is. See [stacks](config.md#stacks).
88
88
  - **`/regenerate [module | file.plain] [module:func-id ...] [from scratch [whole chain]] [how to cut the work]`** regenerates a module from its \*\*\*plain as it is now, as the `regenerate` tool does: what is left to regenerate is planned into pulses - one functional spec at a time, a few together or the whole module in one, as the planner judges - and the first starts. Words after the module are guidance for that plan (`/regenerate app models first`). A module's name typed with spaces for its underscores is that module - `/regenerate d365_function executor` is `d365_function_executor`. With no module named: the one `module:` in `config.turri.yaml` names, else the folder's top modules, to pick from. Asked for from scratch - `from scratch`, `start over`, `delete the module` - it starts at once, with nothing to confirm: it deletes the module's code and conformance tests in every codebase where they live, committed so `/lineage` keeps them, and regenerates the whole module from its \*\*\*plain, built though nothing in it changed: `/regenerate shorty from scratch`. The modules below it keep their code, and the module starts again from a copy of the code below it. Asked for its chain too - `/regenerate shorty from scratch, the whole chain` - the code of every module of its requires chain is deleted, the base's included, and the whole chain is regenerated from the bottom: what to do after modules were split, merged or moved, when the code below was laid out for modules that are no more. The chat's `regenerate` does the same with `from_scratch: "module"` or `"chain"`, when you ask for it; `turri regenerate --from-scratch` or `--from-scratch-chain` on the command line, not with `--dry-run`. Functional specs named after the module, each as `<module>:<func-id>` - `/regenerate shorty shorty:shorten shorty:expand` - are regenerated though their \*\*\*plain did not change, on the model chosen for functionalities: as `turri regenerate shorty.plain shorty:shorten shorty:expand` does, and the chat's `regenerate` with `funcIds`. A bare func-id is refused: the module is always named. Code built before functional specs had func-ids - its record numbers them - is never built on: the module's whole chain has to be regenerated from scratch, and the chat asks you first, as for a start over.
89
+ - **`/conform [module | file.plain] [module:func-id ...] [one by one]`** writes and runs a module's conformance tests now, as the `conform` tool does: those of the functional specs named, each as `<module>:<func-id>` - `/conform shorty shorty:shorten shorty:expand` - or, with none named, of every functional spec with scenarios. They go in one pulse, as far as a size guardrail lets; `one by one` (or `separately`, `one at a time`) has a pulse a functional spec. No other words are taken: there is no plan to guide. The module is found as `/regenerate` finds it. Asking for them is asking for them on: with conformance tests off, `/conform` turns them on first - `conformance-tests: true`, written where the module's value comes from, as the chat's `turn_on_conformance_tests` does - and says so. What would start nothing is found from the \*\*\*plain before anything is said - no scenarios, a functional spec named that is not there or has none, a step of adding tests skipped (no test reqs, no conformance testing script) - and turri answers it at once in the chat: why, and an offer to write what is missing. Its tests come before anything is built on it: a codebase built on the module is stopped and deleted, and regenerated from it once they pass. Tests written already for the scenarios as built are said to be, and nothing starts.
89
90
  - **`/halt <id>`** halts a pulse - a queued one never starts - **`/halt <module>`** (or a planned row's id) halts a module's planned pulses until you ask for it again, a \*\*\*plain change not starting it, and **`/halt activated <name>`** halts a server `activate` started; it lists all three when no id is given.
90
- - **What these commands show you, the chat knows.** What `/regenerate` and `/halt activated` tell you - \*\*\*plain that does not parse, the pulses planned, a server halted - stays in the chat under the command, and since a slash command runs outside the conversation, it is put in the conversation as well: say "fix it" next and turri knows what you are looking at. Once `/regenerate` has started pulses, turri says so in the chat too - what runs and what is planned, and that you need not wait for it - without starting anything more for it; a module already up to date gets the plan's answer alone. A halted pulse reaches it as every pulse's end does.
91
+ - **What these commands show you, the chat knows.** What `/regenerate`, `/conform` and `/halt activated` tell you - \*\*\*plain that does not parse, the pulses planned, a server halted - stays in the chat under the command, and since a slash command runs outside the conversation, it is put in the conversation as well: say "fix it" next and turri knows what you are looking at. When `/conform` starts nothing, turri answers it at once - why, and what would let it start. Once `/regenerate` or `/conform` has started pulses, turri says so in the chat too - what runs and what is planned, and that you need not wait for it - without starting anything more for it; a module already up to date gets the plan's answer alone. A halted pulse reaches it as every pulse's end does.
91
92
  - **Nothing is queued.** What is left to build is worked out from what each codebase is built from and \*\*\*plain as it is now - again whenever a pulse ends or \*\*\*plain changes - and the first pulse of it runs; see [a whole module](regenerating.md#a-whole-module). Changes that overlap never pile up: the next pulse builds \*\*\*plain as it is. The pulses planned after the one running are listed behind it, as queued, and so is each module waiting for the one it is built on - "waits for base" - until it can be planned. A change inside what the running pulse regenerates - a functional spec it regenerates reworded or given a sub-bullet, a definition or req it is given, a file they link - steers it: its agent is told, and it lands \*\*\*plain as it is now there, twice a pulse at most. Otherwise a pulse building something \*\*\*plain no longer wants is stopped and rolled back - unless `allow-to-stop-jobs: false` in `config.turri.yaml`, which has it land first and the change regenerated on top. To drop something, take it out of \*\*\*plain - one \*\*\*plain diff. Stopping a pulse leaves its change in \*\*\*plain: the codebase waits until its \*\*\*plain changes or it is asked for again.
92
93
  - **A change to a module below** is made in the codebase at the tip of the chain, where its code lives; the codebase below is left as it was, and is brought up to its own \*\*\*plain only when a new module is to start from it. \*\*\*plain moved into a module the code was not built on stops the codebase: no change to its code brings that module in, so it has to be started over - its code and conformance tests taken out, kept in its history, and built again from the bottom of the chain. That is never done unasked: the chat asks you, saying why, and regenerates it from scratch once you agree; on the command line `turri regenerate` asks at the terminal, and `--start-over` agrees in advance.
93
94
  - **Conformance tests are a track of their own.** A code pulse lands once its unit tests pass and are reviewed. Then, before the next one builds on it, a conformance pulse writes and runs the tests of what it built - the scenarios of its functional specs, by the test reqs - with the whole suite the module inherits, and, where one fails, fixes the test or the code, whichever is wrong; what they are written for is recorded in `tests/.turri.json`. A functional spec with no test plain file, or an empty one, gets none: to have it tested, ask for conformance tests, or let the [test advisor](test-advisor.md) find that it needs them - either way the chat writes its scenarios with `change_plain`, and the loop tests them once the code is built. `conform` runs them now, for a module or some of its functional specs. A conformance pulse that does not pass is undone whole and halts the conformance tests alone: the code goes on being built.
@@ -146,7 +147,7 @@ A provider failure - no credits, bad key, rate limit - is raised with the provid
146
147
 
147
148
  ### Models from a pi extension
148
149
 
149
- A provider a [pi](https://pi.dev) extension registers - a Claude subscription through Claude Code ([pi-claude-code](https://github.com/earendil-works/pi-claude-code), `claude-code/...`, see [a Claude subscription](claude-subscription.md)), your company's own LLM gateway - works everywhere turri needs a model. Install the extension as pi installs any (`pi install <source>`), and name its models in `config.turri.yaml` as any. In the chat, pi loads it, and every agent the conversation starts is given the providers the conversation's extensions registered, as they are when it starts - the agents themselves load no extensions, which would load a second copy of turri. A run with no conversation - `turri regenerate`, `turri change-plain`, `turri release` and the rest - loads the installed extensions itself, once, as pi loads them, and keeps only the providers they register; so do `turri doctor` and `turri init-config`, which check a model against them. An older turri that installed itself into every pi is among them, and is loaded as nothing.
150
+ A provider a [pi](https://pi.dev) extension registers - a Claude subscription through Claude Code ([pi-claude-code](https://github.com/earendil-works/pi-claude-code), `claude-code/...`, see [a Claude subscription](claude-subscription.md)), your company's own LLM gateway - works everywhere turri needs a model. Install the extension with `turri install <source>` - pi's own `install`, run by the pi inside turri, so no `pi` of your own is needed; `turri list`, `turri update <source>` and `turri remove <source>` are pi's too - and name its models in `config.turri.yaml` as any. In the chat, pi loads it, and every agent the conversation starts is given the providers the conversation's extensions registered, as they are when it starts - the agents themselves load no extensions, which would load a second copy of turri. A run with no conversation - `turri regenerate`, `turri change-plain`, `turri release` and the rest - loads the installed extensions itself, once, as pi loads them, and keeps only the providers they register; so do `turri doctor` and `turri init-config`, which check a model against them. An older turri that installed itself into every pi is among them, and is loaded as nothing.
150
151
 
151
152
  ## Module history
152
153
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turri-dev/cli",
3
- "version": "0.2.3-next.5009c4c",
3
+ "version": "0.2.3-next.a3b9451",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {