@turri-dev/cli 0.2.4-next.35ab04b → 0.2.4-next.636a651

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +2 -2
  2. package/dist/chat-idle.d.ts +2 -2
  3. package/dist/chat-idle.js +2 -2
  4. package/dist/chats.d.ts +0 -10
  5. package/dist/chats.js +0 -23
  6. package/dist/cli.js +5 -7
  7. package/dist/config-edit.js +1 -3
  8. package/dist/config.d.ts +20 -22
  9. package/dist/config.js +49 -22
  10. package/dist/conformance-switch.d.ts +7 -17
  11. package/dist/conformance-switch.js +24 -46
  12. package/dist/drift-cli.js +1 -1
  13. package/dist/extension.d.ts +8 -10
  14. package/dist/extension.js +157 -217
  15. package/dist/genome.js +9 -48
  16. package/dist/graph.js +3 -5
  17. package/dist/host-session.d.ts +4 -15
  18. package/dist/host-session.js +2 -4
  19. package/dist/host.d.ts +1 -3
  20. package/dist/host.js +1 -4
  21. package/dist/identity.js +0 -1
  22. package/dist/init-config.d.ts +0 -1
  23. package/dist/init-config.js +2 -9
  24. package/dist/installed-providers.d.ts +1 -1
  25. package/dist/installed-providers.js +1 -1
  26. package/dist/loop-cli.d.ts +4 -3
  27. package/dist/loop-cli.js +13 -11
  28. package/dist/loop-tools.d.ts +26 -3
  29. package/dist/loop-tools.js +85 -20
  30. package/dist/new-project.js +2 -2
  31. package/dist/pi-launch.js +1 -1
  32. package/dist/pi.js +9 -6
  33. package/dist/plain/check.d.ts +1 -8
  34. package/dist/plain/check.js +3 -38
  35. package/dist/regenerate/activity.d.ts +0 -7
  36. package/dist/regenerate/activity.js +2 -20
  37. package/dist/regenerate/agent-shell.js +3 -1
  38. package/dist/regenerate/audit.js +9 -0
  39. package/dist/regenerate/chunk-plan.d.ts +5 -0
  40. package/dist/regenerate/chunk-plan.js +16 -1
  41. package/dist/regenerate/failure-reports.d.ts +28 -0
  42. package/dist/regenerate/failure-reports.js +79 -0
  43. package/dist/regenerate/job-panel.js +3 -1
  44. package/dist/regenerate/jobs-tree.js +1 -1
  45. package/dist/regenerate/jobs.d.ts +2 -0
  46. package/dist/regenerate/jobs.js +4 -0
  47. package/dist/regenerate/ledger-view.d.ts +11 -24
  48. package/dist/regenerate/ledger-view.js +14 -60
  49. package/dist/regenerate/ledger.d.ts +1 -14
  50. package/dist/regenerate/ledger.js +1 -1
  51. package/dist/regenerate/loop.d.ts +37 -60
  52. package/dist/regenerate/loop.js +174 -106
  53. package/dist/regenerate/regenerate.d.ts +0 -2
  54. package/dist/regenerate/regenerate.js +4 -15
  55. package/dist/regenerate/standing.js +1 -1
  56. package/dist/regenerate/submit-work.d.ts +2 -0
  57. package/dist/regenerate/submit-work.js +8 -3
  58. package/dist/regenerate/testing-steps.d.ts +11 -0
  59. package/dist/regenerate/testing-steps.js +22 -3
  60. package/dist/regenerate-cli.js +18 -9
  61. package/dist/self-invocation.d.ts +11 -0
  62. package/dist/self-invocation.js +33 -7
  63. package/dist/sentinel.js +8 -5
  64. package/dist/skill.d.ts +0 -11
  65. package/dist/skill.js +0 -9
  66. package/dist/stacks.js +1 -1
  67. package/dist/tools.js +2 -3
  68. package/dist/turri-versions.js +2 -1
  69. package/docs/README.md +0 -2
  70. package/docs/authoring-plain.md +3 -3
  71. package/docs/chats.md +1 -3
  72. package/docs/config.md +11 -13
  73. package/docs/deploy.md +1 -1
  74. package/docs/development.md +2 -3
  75. package/docs/headless.md +5 -4
  76. package/docs/hosting.md +6 -6
  77. package/docs/parser.md +2 -2
  78. package/docs/regenerating.md +14 -12
  79. package/docs/sentinel.md +4 -4
  80. package/docs/skills-and-gates.md +4 -8
  81. package/docs/using.md +10 -18
  82. package/genome/rules/test-plain-files.md +15 -7
  83. package/genome/rules/turri-regeneration.md +4 -9
  84. package/genome/skills/convert-old-syntax/SKILL.md +5 -5
  85. package/package.json +1 -1
  86. package/dist/advisor-chat.d.ts +0 -63
  87. package/dist/advisor-chat.js +0 -290
  88. package/dist/change-plain-cli.d.ts +0 -1
  89. package/dist/change-plain-cli.js +0 -55
  90. package/dist/ledger-cli.d.ts +0 -1
  91. package/dist/ledger-cli.js +0 -50
  92. package/dist/ledger-tools.d.ts +0 -10
  93. package/dist/ledger-tools.js +0 -64
  94. package/dist/regenerate/advisor-records.d.ts +0 -93
  95. package/dist/regenerate/advisor-records.js +0 -110
  96. package/dist/regenerate/advisor-runs.d.ts +0 -87
  97. package/dist/regenerate/advisor-runs.js +0 -327
  98. package/dist/regenerate/test-advisor.d.ts +0 -101
  99. package/dist/regenerate/test-advisor.js +0 -379
  100. package/dist/spec-tools.d.ts +0 -36
  101. package/dist/spec-tools.js +0 -128
  102. package/docs/test-advisor.md +0 -110
@@ -39,3 +39,14 @@ export declare function testingGap(input: {
39
39
  tree: MarshalledPlainSource;
40
40
  buildDir?: string;
41
41
  }): TestingGap | undefined;
42
+ /**
43
+ * The steps of adding tests a module still has to take before it has anything to test - in their order: its test reqs,
44
+ * the conformance testing script for its stack, the scenarios - from the first one missing. What is said when conform
45
+ * finds no scenarios: the whole way there, not the last step alone.
46
+ */
47
+ export declare function stepsToScenarios(input: {
48
+ moduleName: string;
49
+ plainFile: string;
50
+ tree: MarshalledPlainSource;
51
+ buildDir?: string;
52
+ }): string;
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
- import { dirname, join, resolve } from "node:path";
2
+ import { dirname, join, relative, resolve } from "node:path";
3
3
  import { conformanceTestsOn } from "../conformance-switch.js";
4
- import { stackForModule, stackPinned, withStack } from "../config.js";
4
+ import { stackForModule, stackPinned, testDirOf, withStack } from "../config.js";
5
5
  import { IMPORT_DIRECTIVE, readPlainSourceMetadata } from "../plain/parser.js";
6
6
  import { FUNCTIONAL_REQUIREMENTS, REQUIRED_FUNCTIONAL_SPECS, TEST_REQUIREMENTS } from "../plain/spec.js";
7
7
  import { isStdlibModule, STDLIB_ROOT } from "../plain/stdlib.js";
@@ -93,7 +93,7 @@ export function testingGap(input) {
93
93
  return {
94
94
  step: "test reqs",
95
95
  text: `${moduleName} has scenarios to test - ${named(tested)} - but no ***test reqs***, so its conformance tests cannot be written - the test reqs are ` +
96
- `the first step of adding tests. Next step: ${reqs}, with change_plain${found.script === undefined ? `; then ${scriptStep}` : ""}.`,
96
+ `the first step of adding tests. Next step: ${reqs}${found.script === undefined ? `; then ${scriptStep}` : ""}.`,
97
97
  short: "scenarios not tested: no test reqs",
98
98
  };
99
99
  }
@@ -108,3 +108,22 @@ export function testingGap(input) {
108
108
  }
109
109
  return undefined;
110
110
  }
111
+ /**
112
+ * The steps of adding tests a module still has to take before it has anything to test - in their order: its test reqs,
113
+ * the conformance testing script for its stack, the scenarios - from the first one missing. What is said when conform
114
+ * finds no scenarios: the whole way there, not the last step alone.
115
+ */
116
+ export function stepsToScenarios(input) {
117
+ const { moduleName, plainFile } = input;
118
+ const steps = [];
119
+ if ((input.tree[TEST_REQUIREMENTS] ?? []).length === 0) {
120
+ const conformance = conformanceTemplateOf(plainFile);
121
+ steps.push(conformance !== undefined ? `import the stack's conformance template, ${conformance}` : "write the module's own ***test reqs***");
122
+ }
123
+ if (conformanceScriptOf(plainFile, input.buildDir).script === undefined)
124
+ steps.push("write the conformance testing script with the implement-conformance-testing-script skill");
125
+ const testDir = relative(projectDirOf(resolve(plainFile)), testDirOf(plainFile)) || ".";
126
+ steps.push(`write the scenarios, each functional spec's in ${testDir}/${moduleName}/<func-id>.plain, then regenerate`);
127
+ const order = steps.length > 1 ? "Adding tests is three steps, in this order: the test reqs, the conformance testing script, the scenarios. " : "";
128
+ return `${order}Next step: ${steps.join("; then ")}.`;
129
+ }
@@ -16,7 +16,8 @@ build when none is given), coding-model (the agents that build) and harness-mode
16
16
  0 only when every module is complete: regenerated from the spec as it is, and its conformance tests written
17
17
  for every functional spec's scenarios.
18
18
 
19
- --dry-run plan the work and print the prompt of the first job, and run nothing (turri glimpse)
19
+ --dry-run look ahead: plan the work as regenerate would and print the prompt of each codebase's
20
+ next pulse, starting nothing and changing no code or tests
20
21
  --start-over start over, without asking, a codebase regenerated without a module it now requires -
21
22
  with no terminal to ask and without it, the run stops there
22
23
  --from-scratch delete the module's code and conformance tests (its lineage keeps them) and regenerate all of it
@@ -45,23 +46,31 @@ if (!named) {
45
46
  process.exit(1);
46
47
  }
47
48
  const scratch = options["from-scratch-chain"] !== undefined ? "chain" : options["from-scratch"] !== undefined ? "module" : undefined;
48
- // A dry run starts nothing, and from scratch deletes before it plans: the two do not go together.
49
- if (scratch !== undefined && options["dry-run"] !== undefined) {
49
+ const dryRun = options["dry-run"] !== undefined;
50
+ // A dry run writes nothing: from scratch deletes the code before it plans, and functional specs named are marked in the records first.
51
+ if (scratch !== undefined && dryRun) {
50
52
  console.error(`--from-scratch${scratch === "chain" ? "-chain" : ""} deletes the code before anything is planned: it cannot be a dry run.`);
51
53
  process.exit(1);
52
54
  }
55
+ if (again.length > 0 && dryRun) {
56
+ console.error(`${again.join(", ")} would be marked to regenerate again in the code records before anything is planned: that cannot be a dry run.`);
57
+ process.exit(1);
58
+ }
53
59
  runLoop({
54
60
  plainFile: named,
55
61
  ...(buildDir !== undefined ? { buildDir } : {}),
56
62
  ...(report !== undefined ? { report } : {}),
57
63
  command: ["regenerate", ...process.argv.slice(2)],
58
- dryRun: options["dry-run"] !== undefined,
64
+ dryRun,
59
65
  startOver: options["start-over"] !== undefined,
60
- ask: (loop) => again.length > 0
61
- ? loop.regenerateAgain(named, again)
62
- : scratch !== undefined
63
- ? loop.fromScratch(named, { chain: scratch === "chain" })
64
- : loop.bringUp(named),
66
+ // A dry run is a look ahead: planned as regenerate plans it, nothing started.
67
+ ask: (loop) => dryRun
68
+ ? loop.lookAhead(named)
69
+ : again.length > 0
70
+ ? loop.regenerateAgain(named, again)
71
+ : scratch !== undefined
72
+ ? loop.fromScratch(named, { chain: scratch === "chain" })
73
+ : loop.bringUp(named),
65
74
  }).catch((error) => {
66
75
  console.error(error instanceof Error ? error.message : error);
67
76
  process.exit(1);
@@ -8,6 +8,7 @@
8
8
  * the same build directories. It is never the right call unless the person asked for the
9
9
  * command line, so the harness refuses it and names the tool to use instead.
10
10
  */
11
+ import { type ToolDefinition } from "@earendil-works/pi-coding-agent";
11
12
  /**
12
13
  * What a shell command would run of turri or pi itself, if anything: the subcommand,
13
14
  * or "pi" for another pi. `turri parse`, `drift` and `lineage` are not in it - they start no
@@ -23,3 +24,13 @@ export declare function askedForCommandLine(message: string): boolean;
23
24
  export declare function refusal(what: string, surface?: string): string;
24
25
  /** The instruction that goes into the conversation's system prompt. */
25
26
  export declare const TOOLS_NOT_CLI: string;
27
+ type AnyTool = ToolDefinition<any, any, any>;
28
+ /** What a skill's agent is told when its shell would run turri or another pi. */
29
+ export declare function skillRefusal(what: string): string;
30
+ /**
31
+ * A skill's shell: pi's bash in the project, refusing what its agent never runs there - turri or another pi again
32
+ * (selfInvocation), and a change to the machine's toolchains or settings (machineChange). The conversation's own bash is
33
+ * held to the same by its tool_call guard; a skill runs in a session of its own, which that guard does not see.
34
+ */
35
+ export declare function skillShell(cwd: string): AnyTool;
36
+ export {};
@@ -8,14 +8,14 @@
8
8
  * the same build directories. It is never the right call unless the person asked for the
9
9
  * command line, so the harness refuses it and names the tool to use instead.
10
10
  */
11
+ import { createBashToolDefinition } from "@earendil-works/pi-coding-agent";
12
+ import { machineChange, machineChangeReason } from "./regenerate/command-check.js";
11
13
  /** The tool that does what a turri subcommand does, from inside the conversation. */
12
14
  const TOOL_FOR = {
13
15
  regenerate: "regenerate",
14
- glimpse: "glimpse",
15
16
  conform: "conform",
16
17
  cultivate: "cultivate",
17
18
  release: "release",
18
- "change-plain": "regenerate",
19
19
  chat: "nothing - you are the conversation already",
20
20
  ask: "nothing - you are the conversation already",
21
21
  };
@@ -31,7 +31,6 @@ const NPM_SCRIPT = {
31
31
  const ENTRY = {
32
32
  "regenerate-cli": "regenerate",
33
33
  "conform-cli": "conform",
34
- "change-plain-cli": "change-plain",
35
34
  "cultivate-cli": "cultivate",
36
35
  "release-cli": "release",
37
36
  };
@@ -43,10 +42,10 @@ const AT_COMMAND = String.raw `(?:^|[\s;&|()\x60$])`;
43
42
  * agent - and neither are setup and doctor.
44
43
  */
45
44
  export function selfInvocation(command) {
46
- const cli = new RegExp(`${AT_COMMAND}(?:npx\\s+)?turri\\s+(regenerate|glimpse|conform|cultivate|release|change-plain)\\b`).exec(command);
45
+ const cli = new RegExp(`${AT_COMMAND}(?:npx\\s+)?turri\\s+(regenerate|conform|cultivate|release)\\b`).exec(command);
47
46
  if (cli)
48
47
  return cli[1];
49
- const launcher = new RegExp(`(?:bin/turri\\.mjs|src/cli\\.ts)\\s+(regenerate|glimpse|conform|cultivate|release|change-plain)\\b`).exec(command);
48
+ const launcher = new RegExp(`(?:bin/turri\\.mjs|src/cli\\.ts)\\s+(regenerate|conform|cultivate|release)\\b`).exec(command);
50
49
  if (launcher)
51
50
  return launcher[1];
52
51
  // turri alone, or with options, is the conversation - where a command starts, not a word an argument names (`which turri`).
@@ -83,7 +82,7 @@ const PI_CONFIGURES = new Set([
83
82
  export function askedForCommandLine(message) {
84
83
  const text = message.toLowerCase();
85
84
  return (/\b(headless|command[ -]line|cli|terminal|shell|in bash|via bash|through bash|npm run|nohup)\b/.test(text) ||
86
- /\bturri\s+(regenerate|glimpse|conform|change-plain|cultivate|release)\b/.test(text) ||
85
+ /\bturri\s+(regenerate|conform|cultivate|release)\b/.test(text) ||
87
86
  /(^|\s)turri\s+-p\b/.test(text) ||
88
87
  /(^|\s)pi\s+-p\b/.test(text));
89
88
  }
@@ -102,10 +101,37 @@ export const TOOLS_NOT_CLI = [
102
101
  "<turri-tools>",
103
102
  "In this conversation, you do your work with your tools - regenerate, conform, cultivate and the rest - which run as",
104
103
  "background jobs the user can watch and halt. To try what is regenerated, release it - never by hand in plain_modules. Never",
105
- "run your own command line (turri regenerate, glimpse, conform, change-plain, cultivate, release, turri itself; npm run",
104
+ "run your own command line (turri regenerate, conform, cultivate, release, turri itself; npm run",
106
105
  "regenerate and the like) or start another pi through bash:",
107
106
  "that is a separate headless run the user cannot see or stop. Only when the user explicitly asks for the",
108
107
  "command line, run it. Configuring pi itself - turri install, update, remove, list; pi install, update, list, config, auth; or its settings files -",
109
108
  "is fine; it starts no agent.",
110
109
  "</turri-tools>",
111
110
  ].join("\n");
111
+ /** What a skill's agent is told when its shell would run turri or another pi. */
112
+ export function skillRefusal(what) {
113
+ return (`Not run: that starts ${what === "pi" ? "another agent" : `turri ${what}`} from the shell - a separate, headless run outside the person's session, ` +
114
+ "its pulses and /halt, writing the same codebases as the work loop. A skill starts no pulse: finish your own work, and say in what you " +
115
+ "hand back what should run next - the conversation runs it.");
116
+ }
117
+ /**
118
+ * A skill's shell: pi's bash in the project, refusing what its agent never runs there - turri or another pi again
119
+ * (selfInvocation), and a change to the machine's toolchains or settings (machineChange). The conversation's own bash is
120
+ * held to the same by its tool_call guard; a skill runs in a session of its own, which that guard does not see.
121
+ */
122
+ export function skillShell(cwd) {
123
+ const bash = createBashToolDefinition(cwd);
124
+ return {
125
+ ...bash,
126
+ async execute(toolCallId, params, signal, onUpdate, ctx) {
127
+ const command = String(params.command ?? "");
128
+ const what = selfInvocation(command);
129
+ if (what !== undefined)
130
+ throw new Error(skillRefusal(what));
131
+ const changes = machineChange(command);
132
+ if (changes !== undefined)
133
+ throw new Error(machineChangeReason(changes));
134
+ return bash.execute(toolCallId, params, signal, onUpdate, ctx);
135
+ },
136
+ };
137
+ }
package/dist/sentinel.js CHANGED
@@ -178,11 +178,14 @@ export function sentinelPrompt(cwd, options = {}) {
178
178
  ]),
179
179
  "",
180
180
  "For the pulse:",
181
- "1. Check how it went, from what turri tells you - and, when that is not enough, its log, the ledger (ledger, pulses),",
182
- " diagnose, and the code and the ***plain, which you read.",
181
+ "1. Check how it went, from what turri tells you - and, when that is not enough, the pulse in full (pulses with its id),",
182
+ " its log, and the code and the ***plain, which you read.",
183
183
  "2. When it was released (the message says so - release-after-pulse is on), test what was released: it is running",
184
184
  " where the message says. How far you test is yours to judge, from what the pulse changed and what the ***plain says",
185
- " it should do: that it came up, answers, and does what its ***plain diff says it now does.",
185
+ " it should do: that it came up, answers, and does what its ***plain diff says it now does. Where the ***plain picks",
186
+ " one way among several - which of a tie comes first, how a default is chosen - try an input on which the ways give",
187
+ " different answers, so a pass shows the ***plain's way and no other: a tie whose first word is also first",
188
+ " alphabetically tells \"first in the file\" from nothing.",
186
189
  "3. When something is wrong - the pulse failed or stopped, it did not pass, the release did not come up, the software",
187
190
  " does not do what its ***plain says - find out why. Then:",
188
191
  " - When it is the project's tooling - a testing script, or where config.turri.yaml says the scripts are and which",
@@ -209,7 +212,7 @@ export function sentinelPrompt(cwd, options = {}) {
209
212
  "",
210
213
  "You fix the project's tooling and nothing else. Your file tools read the whole project; write and edit reach only the",
211
214
  "testing scripts and config.turri.yaml - and in it only where the scripts are, and toolchains:. Your shell runs with",
212
- "the project read only. You never change ***plain - it is the person's intent, never yours to fix - and never steer,",
215
+ "the project read only; the files you try a release with go in $TMPDIR - /tmp is outside what it may write. You never change ***plain - it is the person's intent, never yours to fix - and never steer,",
213
216
  "release, or regenerate but by resume after a fix of yours. You install nothing on this machine and change none of",
214
217
  "its settings, nor the person's shell - under no circumstances: that is always the person's, said in a notice. You",
215
218
  "never ask the person questions - a notice is how you reach them.",
@@ -316,7 +319,7 @@ export function sentinelCheckBrief(check, context) {
316
319
  * The tools the sentinel's agent may call: what reads, write and edit for the project's tooling alone, resume, its
317
320
  * notices and its guidance - and what a host gives it.
318
321
  */
319
- export const SENTINEL_TOOLS = ["read", "ls", "grep", "find", "write", "edit", "bash", "read_output", "ledger", "pulses", "diagnose", "parse", "doctor", "web_search", "web_fetch", "resume", "notify_person", "conclude", "keep_guidance"];
322
+ export const SENTINEL_TOOLS = ["read", "ls", "grep", "find", "write", "edit", "bash", "read_output", "pulses", "parse", "doctor", "web_search", "web_fetch", "resume", "notify_person", "conclude", "keep_guidance"];
320
323
  /** A testing script by its name - `run_unittests_python.sh`, `prepare_environment_node.sh` - and a config file of turri's. */
321
324
  const SCRIPT_FILE = /^(run_|prepare_environment).*\.(sh|ps1|bat|cmd)$/;
322
325
  const CONFIG_FILE_NAME = /^config\.turri(\..+)?\.yaml$/;
package/dist/skill.d.ts CHANGED
@@ -69,22 +69,11 @@ export interface Skill {
69
69
  dir: string;
70
70
  allowedTools: string[];
71
71
  steps: StepSpec[];
72
- /**
73
- * Whether `change_plain` needs an answer from the user between two new changes - one answer,
74
- * one change, as an interview writes them. `metadata.paced: false` turns it off, for a skill that
75
- * writes the specs on its own.
76
- */
77
- paced: boolean;
78
72
  /**
79
73
  * The phases the questioning level caps (`metadata.questioning`, questioning.ts): when there are any, the harness asks
80
74
  * the level first, and each of them asks at most as many questions as it allows. Empty: no level is asked.
81
75
  */
82
76
  questioning: string[];
83
- /**
84
- * The steps where each answer is a spec change (`metadata.change-plain-per-answer`): the next question waits until the
85
- * last answer is written with `change_plain`, and changes the agent decides itself need no answer before them.
86
- */
87
- diffPerAnswer: string[];
88
77
  /**
89
78
  * Started only by the person, with its slash command - `/release-notes` - never by the model on its own
90
79
  * (`metadata.command-only: true`): cultivate runs it only when the person has just typed its command.
package/dist/skill.js CHANGED
@@ -109,13 +109,6 @@ export function loadSkill(skillDir) {
109
109
  throw new Error(`${name}: 'metadata.questioning' names unknown step '${stepName}'`);
110
110
  }
111
111
  }
112
- const perAnswer = data.metadata?.["change-plain-per-answer"];
113
- const diffPerAnswer = Array.isArray(perAnswer) ? perAnswer.map(String) : [];
114
- for (const stepName of diffPerAnswer) {
115
- if (!steps.some((s) => s.name === stepName)) {
116
- throw new Error(`${name}: 'metadata.change-plain-per-answer' names unknown step '${stepName}'`);
117
- }
118
- }
119
112
  for (const stepName of gatesByStep.keys()) {
120
113
  if (!steps.some((s) => s.name === stepName)) {
121
114
  throw new Error(`${name}: gate references unknown step '${stepName}'`);
@@ -132,9 +125,7 @@ export function loadSkill(skillDir) {
132
125
  // What a skill may use is what its frontmatter names, and nothing else: no list, no tools.
133
126
  allowedTools: Array.isArray(data["allowed-tools"]) ? data["allowed-tools"] : [],
134
127
  steps,
135
- paced: data.metadata?.paced !== false,
136
128
  questioning: capped,
137
- diffPerAnswer,
138
129
  commandOnly: data.metadata?.["command-only"] === true,
139
130
  background: data.metadata?.background === true,
140
131
  ...(model !== undefined ? { model } : {}),
package/dist/stacks.js CHANGED
@@ -78,7 +78,7 @@ export function registerStacks(pi, cwd) {
78
78
  "For this chat alone - each chat chooses its own; a pulse already running keeps the stack it started with. Without a name, says the stacks and the one chosen.",
79
79
  promptSnippet: "choose the stack - its testing scripts and settings - that everything is built with",
80
80
  promptGuidelines: [
81
- "Switch the stack only when the user asks for it, and say which you chose. A module is built with the stack named after it by itself; to build one whose stack has another name, pass that stack as stack to regenerate, conform, glimpse or change_plain instead: it is pinned to that module's pulses, and this chat's choice stays as it is.",
81
+ "Switch the stack only when the user asks for it, and say which you chose. A module is built with the stack named after it by itself; to build one whose stack has another name, pass that stack as stack to regenerate, conform or pulses instead: it is pinned to that module's pulses, and this chat's choice stays as it is.",
82
82
  ],
83
83
  parameters: Type.Object({
84
84
  name: Type.Optional(Type.String({ description: "The stack to choose, or none. Omitted: the stacks there are, and the one chosen" })),
package/dist/tools.js CHANGED
@@ -155,7 +155,7 @@ function talkBack(talks) {
155
155
  "with ask_user only once it is settled - changed, if what they said calls for it. It was not counted as answered."
156
156
  : "Answer what they said, then ask the question again with ask_user - changed, if what they said calls for it. Put " +
157
157
  "your answer to them in the question's `context`: nothing else you write reaches them. It was not counted as a " +
158
- "question, and nothing is owed for it.";
158
+ "question.";
159
159
  }
160
160
  /** Ends the questions of a phase the questioning level caps: what is left, the agent decides itself. */
161
161
  export function createEndQuestionsTool(questioning) {
@@ -163,8 +163,7 @@ export function createEndQuestionsTool(questioning) {
163
163
  name: "end_questions",
164
164
  label: "End questions",
165
165
  description: "End this phase's questions: you have asked what the person must decide, and you decide what is left " +
166
- "yourself, saying what you chose. Afterwards ask_user asks only the phase's closing confirmation, and " +
167
- "change_plain needs no answer between changes.",
166
+ "yourself, saying what you chose. Afterwards ask_user asks only the phase's closing confirmation.",
168
167
  promptSnippet: "end this phase's questions and decide what is left yourself",
169
168
  parameters: Type.Object({}),
170
169
  async execute() {
@@ -180,7 +180,8 @@ export function removalOf(turri, platform = process.platform) {
180
180
  export function versionFindings(options = {}) {
181
181
  const identity = options.self ?? (() => {
182
182
  const own = turriIdentity();
183
- return { ...(own.version !== null ? { version: own.version } : {}), clone: own.git_commit !== null, root: PACKAGE_ROOT };
183
+ // An image built from a clone (docker/Dockerfile) has no .git, and is updated by building it again from a newer clone.
184
+ return { ...(own.version !== null ? { version: own.version } : {}), clone: own.git_commit !== null || process.env.TURRI_FROM_CLONE === "1", root: PACKAGE_ROOT };
184
185
  })();
185
186
  const onPath = options.onPath ?? turrisOnPath();
186
187
  const findings = [];
package/docs/README.md CHANGED
@@ -18,7 +18,6 @@ turri is the first coding agent with the power of regenerative software: [\*\*\*
18
18
  | how to start a project, or add a feature, in a conversation | [using](using.md#in-a-conversation) |
19
19
  | how to have several chats open at once, and reopen them | [chats](chats.md) |
20
20
  | what checks each pulse as it finishes, and tells me what needs me | [the sentinel](sentinel.md) |
21
- | why the chat wrote scenarios I did not ask for, and how to turn that off | [the test advisor](test-advisor.md) |
22
21
  | which model codes, and how to change it | [using](using.md#choosing-a-model), [the project config](config.md#models) |
23
22
  | how to run turri on my Claude Pro, Max or Team subscription instead of an API key | [a Claude subscription](claude-subscription.md) |
24
23
  | what `config.turri.yaml` can set, and what happens without it | [the project config](config.md) |
@@ -46,7 +45,6 @@ turri is the first coding agent with the power of regenerative software: [\*\*\*
46
45
  | [Using turri](using.md) | the conversation, the tools, background jobs, choosing a model, module history, the command line |
47
46
  | [Chats](chats.md) | several chats in one session: what each keeps and what they share, `/chat` and its keys, `turri --continue` and `.turri/chats.json` |
48
47
  | [The sentinel](sentinel.md) | the chat every finished pulse goes to: what it checks and tests, its notices and how to answer them, what it may do, closing it, its model, in a host |
49
- | [The test advisor](test-advisor.md) | turri's background check of new and changed functional specs: when it runs, how it decides, what you see, its records, model and setting |
50
48
  | [A Claude subscription](claude-subscription.md) | running every agent on a Claude Pro, Max or Team subscription through Claude Code: setting it up, its models, checking it yourself, in turri-desktop, its limits, when it does not work |
51
49
  | [The project config](config.md) | `config.turri.yaml` and each stack's `config.turri.<stack>.yaml`: where they are read from, every key, models and their inheritance, conformance, the testing scripts, stacks and choosing one, the old `config.yaml` |
52
50
  | [Deploy](deploy.md) | trying what is built: dist/<module>, the last commit, starting it on your machine, `turri release` |
@@ -65,11 +65,11 @@ Adding a :Task: named "Buy milk" to an empty :TaskList: shows one :Task: named "
65
65
  Adding a :Task: named "Go" is rejected with the error "Name must be at least 3 characters".
66
66
  ```
67
67
 
68
- Nothing about testing is written until the person asks for it, or the [test advisor](test-advisor.md) finds a functional spec that needs it: a module imports its stack alone, and a new functional spec gets no test plain file. The first time tests are written in a module, turri does three things, in this order, each a change the person sees:
68
+ Nothing about testing is written until the person asks for it, or - conformance tests on - the chat judges a functional spec needs it (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): a module imports its stack alone, and a new functional spec gets no test plain file. The first time tests are written in a module, turri does three things, in this order, each a change the person sees:
69
69
 
70
70
  1. **The test reqs** - the stack's conformance template, `stdlib/<kind>/conformance/<stack>`, or the module's own `***test reqs***` when it has no stack from the standard library.
71
71
  2. **The conformance testing script** - with `implement-conformance-testing-script`, when the project has none for the module's stack. It runs in the background on the module's coding model; the conformance tests wait for it.
72
- 3. **The scenarios** - for the functional specs the person named, conformance scenarios and, only when asked for, acceptance scenarios, written with `change_plain` with no further confirmation. Scenarios in one functional spec say nothing about another: the rest stay untested until they are asked for too.
72
+ 3. **The scenarios** - for the functional specs the person named, conformance scenarios and, only when asked for, acceptance scenarios, written with the file tools and regenerated with `regenerate`, with no further confirmation. Scenarios in one functional spec say nothing about another: the rest stay untested until they are asked for too.
73
73
 
74
74
  Scenarios that exist are kept in step with their functional specs: a functional spec changed has its scenarios reviewed in the same \*\*\*plain diff, and one split, moved, renamed or taken out takes its test plain file with it. The rules are in `test-plain-files.md`.
75
75
 
@@ -178,6 +178,6 @@ Every skill in `genome/skills/` can be run from a conversation; most are also us
178
178
  turri parse app.plain # or parse in a conversation
179
179
  ```
180
180
 
181
- It parses \*\*\*plain with this repo's own parser - each module with its test plain files - resolves its imports and required modules, and reports every syntax, concept and structure error with its line, and every test plain file outside its module's folder; it lists each functional spec with its scenarios - `no scenarios - not tested` for one without, which is no problem - and warns of a step of adding tests that was skipped. No model, no API key. The interview skills run it before a phase ends, and `change_plain` refuses a change that leaves a file that does not pass. Pass the project directory to check every module at once.
181
+ It parses \*\*\*plain with this repo's own parser - each module with its test plain files - resolves its imports and required modules, and reports every syntax, concept and structure error with its line, and every test plain file outside its module's folder; it lists each functional spec with its scenarios - `no scenarios - not tested` for one without, which is no problem - and warns of a step of adding tests that was skipped. No model, no API key. The interview skills run it before a phase ends, and `regenerate` refuses a module that does not pass. Pass the project directory to check every module at once.
182
182
 
183
183
  What `check` cannot see - a fact in the wrong section, a functional spec that is too big, two that conflict, wording no test can check - is what the rules, the skills and the reviewers are for.
package/docs/chats.md CHANGED
@@ -23,8 +23,6 @@ The session's, shared by every chat:
23
23
 
24
24
  A pulse's end goes to the [sentinel](sentinel.md) - a chat of turri's own, opened in the background with the first pulse that finishes, once you said to start it under `sentinel: ask` - which checks it, tests what was released, and puts what needs you as a notice in the chat you are in. That chat shows the pulse's end; its agent is told of a pulse that landed, to tell you so and what the sentinel is doing with it - and when the sentinel is done with any pulse, what it found - and nothing more - and not of one that went wrong: the sentinel's notice is what it hears of that. With `sentinel: false`, a pulse's end is told to the chat that asked for it instead, shown or not - its agent reacts to it there; the chat's mark in the strip says it has something new. When that chat has been closed, the chat shown is told. Closing a chat stops its turn, never its pulses.
25
25
 
26
- The session has one [test advisor](test-advisor.md), which checks new and changed functional specs in the background for whether they need testing scenarios. Its verdict goes to the chat you are looking at, once that chat is idle: on a yes, the chat tells you and writes the scenarios; a no is a line. Any chat can also ask it itself, with `evaluate_tests`.
27
-
28
26
  ## In the terminal
29
27
 
30
28
  | | |
@@ -67,7 +65,7 @@ In [debug mode](config.md#debug-mode) nothing is deleted. The `engine`'s choices
67
65
 
68
66
  ## Where there is one chat
69
67
 
70
- [pi](https://pi.dev)'s print, json and rpc modes - `turri -p "…"`, `--mode json`, `--mode rpc` - and a `turri` given its input on stdin have one chat and record none, and no [test advisor](test-advisor.md). So does `npm run chat`, pi with turri's extension loaded from its file. The command line's `turri regenerate`, `conform` and the rest have no chat, and no test advisor either.
68
+ [pi](https://pi.dev)'s print, json and rpc modes - `turri -p "…"`, `--mode json`, `--mode rpc` - and a `turri` given its input on stdin have one chat and record none. So does `npm run chat`, pi with turri's extension loaded from its file. The command line's `turri regenerate`, `conform` and the rest have no chat.
71
69
 
72
70
  ## In a host
73
71
 
package/docs/config.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # The project config
2
2
 
3
- A project says how its \*\*\*plain is built in `config.turri.yaml`, at the project root. Everything in it is optional: with no file at all, turri finds the testing scripts on its own, turns conformance tests on wherever a module has test reqs, and runs on [pi](https://pi.dev)'s configured model. A project whose parts are on different stacks - a backend and a frontend - adds a file per stack, `config.turri.<stack>.yaml`, beside it, and chooses the stack to build with (see [stacks](#stacks)). turri never writes a `config.yaml`: it may be another tool's, and is read only by a project that has no file of turri's yet (see [the old config.yaml](#the-old-configyaml)).
3
+ A project says how its \*\*\*plain is built in `config.turri.yaml`, at the project root. Everything in it is optional: with no file at all, turri finds the testing scripts on its own, turns conformance tests on wherever a module has test reqs, and runs on [pi](https://pi.dev)'s configured model. A project whose parts are on different stacks - a backend and a frontend - adds a file per stack, `config.turri.<stack>.yaml`, beside it, and chooses the stack to build with (see [stacks](#stacks)). turri never writes a `config.yaml`: it may be another tool's, and is read only by a project that has no file of turri's yet (see [the old config.yaml](#the-old-configyaml)). A key in `config.turri.yaml` or a stack's file that turri reads nothing of - a setting it no longer has, like `test-advisor`, or one misspelt - is named in a warning under the banner as turri starts, rather than ignored without a word.
4
4
 
5
5
  `turri init-config` starts one: the two models, a strong one to talk to and a smaller one to write the code. It asks which vendor's models you use - `--vendor` says it without asking, and with neither, as from a script, it is `other`:
6
6
 
@@ -62,7 +62,7 @@ A coding model chosen this session - `--coding-model`, or `engine` - gives way t
62
62
 
63
63
  ```yaml
64
64
  module: app.plain # what to build when no .plain file is named
65
- conformance-tests: false # whether functional specs are conformance tested - false: none, the test advisor off (default: false)
65
+ conformance-tests: false # whether functional specs are conformance tested - false: none (default: false)
66
66
  test-dir: tests # the test plain files, a folder per module (default: tests)
67
67
  base-folder: existing-app # what a codebase that requires no module starts from (default: nothing)
68
68
  harness-model: # the model you chat with
@@ -96,8 +96,7 @@ models: # each agent role's model, thinking and tur
96
96
  | `allow-to-stop-jobs` | `true` or `false`: whether turri stops a running job \*\*\*plain has moved on from - a functional spec it regenerates changed, or a file one links was edited - rolls it back and regenerates \*\*\*plain as it now is. `false`: the job runs to its end and lands, and what changed since is regenerated on top of it by the next job - see [regenerating the code](regenerating.md). Your own `halt` stops a job either way | `true` |
97
97
  | `release-after-pulse` | `true` or `false`: whether every pulse that lands code releases it, in the chat, as its last stage - before the module's next pulse starts, whatever the chat is doing: an agent on the coding model releases it, following the project's release guidance as the chat finds it (what was passed to `release` this conversation, AGENTS.md, the project's skills) for how, or to `dist/<module>` without any - see [deploy](deploy.md#after-every-pulse). One release a pulse that lands; a release that fails is said in the pulse's report, and what it landed stays. `turri init-config` writes `true` | `false` |
98
98
  | `sentinel` | `ask`, `true` or `false`: whether a chat of turri's own, the sentinel, gets every pulse that finishes - checks it, tests what was released under `release-after-pulse`, and puts what needs you as a notice in the chat you are in - instead of the chat that asked for it. `ask`: you are asked, with what it does, before it first opens in a session - see [starting it](sentinel.md#starting-it); `true`: it opens without asking. `/sentinel` sets it from the chat. `turri init-config` writes `ask` | `ask` |
99
- | `test-advisor` | `true` or `false`: whether the [test advisor](test-advisor.md) starts by itself - in the chat and a host, never headless - checking each new or changed functional spec with no scenarios in the background for whether it needs testing - on a yes, the chat writes its \*\*\*test reqs\*\*\*, conformance testing script and scenarios. `false` turns off only that: the chat's `evaluate_tests` still works, and scenarios you ask the chat for are written as before. `turri init-config` writes `true` | `true` |
100
- | `conformance-tests` | whether functional specs are conformance tested - black-box tests of the built software against the scenarios of their test plain files, run with the whole suite as more lands. `false`: none - no scenarios written or tested, no conformance testing script, the test advisor and the chat's `conform` and `evaluate_tests` off. The person asking for them in the chat, or agreeing when the chat offers them, turns them on - see [conformance tests](#conformance-tests). A stack's `config.turri.<stack>.yaml` can set its own | `false` |
99
+ | `conformance-tests` | whether functional specs are conformance tested - black-box tests of the built software against the scenarios of their test plain files, run with the whole suite as more lands. `false`: none - no scenarios written or tested, no conformance testing script, and the chat's `conform` refused. Off by default for fast iteration - they make each change take about twice as long - and turned on by the person, with `/conform` - see [conformance tests](#conformance-tests). A stack's `config.turri.<stack>.yaml` can set its own | `false` |
101
100
  | `test-dir` | the folder of the test plain files, by path from the project root: a module's are every `.plain` file in `<test-dir>/<module>/`, each a functional spec's conformance and acceptance scenarios - see [test plain files](parser.md#test-plain-files). A stack's `config.turri.<stack>.yaml` can set its own | `tests` |
102
101
  | `base-folder` | a folder, by path from the project root, that a codebase requiring no other module starts from instead of nothing - an existing codebase to build on, files to use (images, animations, fonts), or both. It is copied in once, before the codebase's first pulse, and never written to: from a git repo what git sees, else every file but `.git` and installed dependencies. The \*\*\*plain may refer to it, and link into it; a codebase built on another starts from that one's code, base folder and all. A stack's `config.turri.<stack>.yaml` can name its own - see [the base folder](regenerating.md#the-base-folder) | none: the codebase starts empty |
103
102
  | `unittests-script` | the unit testing script, by path from the project root - it runs the code's static checks too, exiting 80 when only they fail (see [the static checks](regenerating.md#the-static-checks)) | looked for - see below |
@@ -138,11 +137,10 @@ Keys are written with dashes; underscores are read the same (`mutation_testing`)
138
137
  | `judge` | the judge of a failing conformance run - the same as `judge-model`, which it wins over |
139
138
  | `arbiter` | the arbiters that weigh a second review |
140
139
  | `debugger` | the fresh look at unit tests that keep failing the same way, or a coding agent going round in circles. Unnamed, `judge-model` when it is set, else the harness model - not `default` |
141
- | `advisor` | the [test advisor](test-advisor.md): classifying a new or changed functional spec, its probes, readers and verifier |
142
140
 
143
141
  What an entry leaves out it takes from `default`: `reviewer: { thinking: low }` runs the default model, thinking little. A turn limit is the role's own, else `default`'s, else `turn-limit:`, else two minutes. A stack's `config.turri.<stack>.yaml` lays its own `models:` over the project's, role by role - all but `chat`, the project's alone.
144
142
 
145
- A role whose thinking nothing names - neither its entry, `default`'s, nor a `:level` on the model it runs on - thinks as its kind of work needs: **low** for the agents that do the work (`coding`, `conformance`, `explorer`, `release`, `advisor`), which work from \*\*\*plain that leaves little to guess and take many turns, and **medium** for the ones that judge (`reviewer`, `test-reviewer`, `judge`, `arbiter`, `debugger`, `planner`, `diagnosis`), where a wrong call costs pulses. A judging role that falls back on the coding model takes its model alone, not its thinking. The conversation keeps its own level, as [pi](https://pi.dev) sets it.
143
+ A role whose thinking nothing names - neither its entry, `default`'s, nor a `:level` on the model it runs on - thinks as its kind of work needs: **low** for the agents that do the work (`coding`, `conformance`, `explorer`, `release`), which work from \*\*\*plain that leaves little to guess and take many turns, and **medium** for the ones that judge (`reviewer`, `test-reviewer`, `judge`, `arbiter`, `debugger`, `planner`, `diagnosis`), where a wrong call costs pulses. A judging role that falls back on the coding model takes its model alone, not its thinking. The conversation keeps its own level, as [pi](https://pi.dev) sets it.
146
144
 
147
145
  The thinking level reaches the model as each provider takes it. OpenAI's models on Bedrock are sent it as their reasoning effort (`none`, `low`, `medium`, `high`, `xhigh`) by turri itself, as [pi](https://pi.dev) sends them none.
148
146
 
@@ -174,15 +172,15 @@ They are defaults. What is asked for wins over them:
174
172
  | coding | `turri --coding-model <m>`, `engine` in the conversation |
175
173
  | judge | - |
176
174
 
177
- `turri regenerate`, `conform` and `change-plain` read `--harness-model`, `--coding-model` (or `--model`), `--judge-model` and `--review` differently: as the keys themselves, as if the file had them. Each takes its key's value and its place in the order above - a `models:` entry still wins over it - so a headless run is the same as a chat with those keys in the file.
175
+ `turri regenerate` and `conform` read `--harness-model`, `--coding-model` (or `--model`), `--judge-model` and `--review` differently: as the keys themselves, as if the file had them. Each takes its key's value and its place in the order above - a `models:` entry still wins over it - so a headless run is the same as a chat with those keys in the file.
178
176
 
179
177
  A job keeps the model it was queued with: choosing another holds for what is queued after.
180
178
 
181
179
  ## Conformance tests
182
180
 
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.
181
+ `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` - and the chat's `conform` is refused. Test plain files already there are kept and parsed, and not tested: `parse` and `drift` say so. Turning them on is yours to decide, as they make each change take about twice as long: the chat always knows what they are, that they are off, and how they are turned on, 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: 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, then tests what has scenarios and code at once. So does `/turri-config conformance-tests true`, without testing anything.
184
182
 
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)).
183
+ 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 its file tools, then calls `regenerate`, when you ask for conformance tests (see [conformance tests](regenerating.md#conformance-tests)).
186
184
 
187
185
  ## The testing scripts
188
186
 
@@ -209,7 +207,7 @@ turri writes much more than it needs to work, for a person working out why it di
209
207
  | a module's `TMPDIR` (`plain_modules/.turri/tmp/<module>`) | emptied as each of its pulses ends | kept |
210
208
  | dependencies installed in the modules below a pulse's own in its chain (`node_modules`, `.venv`) | removed as the pulse ends: the chain is built in its tip, and a module built on again installs them again, from the cache | kept |
211
209
 
212
- Kept either way: the ledger - what each pulse did, how it ended, what it cost (see [the ledger](using.md#the-ledger)) - the code, its tests and their history, a gated skill's run, what a conformance explorer found, what `deploy` started, and the package caches, held to `cache-keep:`. The testing scripts install what they run with themselves, so nothing removed is ever missed by a test run.
210
+ Kept either way: the ledger - what each pulse did, how it ended, what it cost (see [the ledger](using.md#the-ledger)) - and, for each pulse that failed or finished without landing, why: its report in `.turri/pulses/<id>.md` - its diagnosis, the stages that went wrong, the last failing test run's output, the last review that sent the work back, the tool calls that failed - which `pulses` tells with it in a later session, the newest 200 kept and none where `ledger-keep: 0`; the code, its tests and their history, a gated skill's run, what a conformance explorer found, what `deploy` started, and the package caches, held to `cache-keep:`. The testing scripts install what they run with themselves, so nothing removed is ever missed by a test run.
213
211
 
214
212
  Turn it on in `config.turri.yaml` (`debug: true`, or `/turri-config debug true`), or for one run with `TURRI_DEBUG=1` or `turri --debug`.
215
213
 
@@ -253,9 +251,9 @@ coding-model:
253
251
 
254
252
  Which stack builds a module, first match wins:
255
253
 
256
- - **The one a call names.** `regenerate`, `conform`, `glimpse` and `change_plain` take a `stack`; the chat's model passes it for a module whose stack has a name of its own, leaving the chat's choice as it is.
254
+ - **The one a call names.** `regenerate`, `conform` and `pulses` (with `plain_file`) take a `stack`; the chat's model passes it for a module whose stack has a name of its own, leaving the chat's choice as it is.
257
255
  - **The stack named after the module** - `config.turri.backend.yaml` builds `backend.plain` - with nothing to choose or pass. Name each stack after the module it builds, and a backend and a frontend are each built with their own, side by side - in the chat, as each change is written, and on the command line.
258
- - **The one chosen in the chat** - each [chat](chats.md) its own - with `/stack` - a list of the project's stacks and none - or `/stack backend`, `/stack none`. The chat's model has a `stack` tool too, and switches the stack when you ask it to. `/stack` alone says which is chosen now. On the command line, with `--stack <name>` on any command - `turri regenerate`, `conform`, `change-plain`, `glimpse`, `release`, `cultivate` - and on `turri --stack backend` for the chat; or with `TURRI_STACK` in the environment.
256
+ - **The one chosen in the chat** - each [chat](chats.md) its own - with `/stack` - a list of the project's stacks and none - or `/stack backend`, `/stack none`. The chat's model has a `stack` tool too, and switches the stack when you ask it to. `/stack` alone says which is chosen now. On the command line, with `--stack <name>` on any command - `turri regenerate`, `conform`, `release`, `cultivate` - and on `turri --stack backend` for the chat; or with `TURRI_STACK` in the environment.
259
257
 
260
258
  A chat's choice is its own, and lasts while it is open: a new chat starts with `--stack`'s, or none, and nothing remembers it - turri started again has none chosen. A stack the project has no file for is refused, with the stacks it has. With none chosen, `config.turri.yaml` alone is used.
261
259
 
@@ -263,7 +261,7 @@ How a stack's config is made:
263
261
 
264
262
  - **Laid over `config.turri.yaml`, key by key.** What the stack's file gives wins; what it leaves out is the project's. A model it names takes what it leaves out from the project's same model - above, with the stack frontend chosen, everything regenerates on the project's coding model, thinking `high`.
265
263
  - **Pinned to a module when it is asked for.** A module is built with the stack it was asked for with, from its first pulse to its last: the pulses planned after it, its test runs, the scripts found, its plans and its conformance tests, whatever stack is chosen meanwhile. A pulse waiting for a free slot keeps the stack it was queued with. A change to its \*\*\*plain keeps its stack - unless it was built with none and has a stack of its own now; asked for again, its stack is worked out again. What `regenerate` says back names each module's stack, and so does a pulse's report.
266
- - **Refused with none, when that cannot build.** In a project of stacks, a module asked for with no stack - none named, none named after it, none chosen - is refused before anything is planned when `config.turri.yaml` alone names no unit testing script: every pulse would stop for want of one. The refusal names the stacks and the script each names. A \*\*\*plain change `change_plain` writes is never refused: it is written, and said not to be built yet - passed the stack, everything written is built. `stack: none` builds with `config.turri.yaml` alone all the same.
264
+ - **Refused with none, when that cannot build.** In a project of stacks, a module asked for with no stack - none named, none named after it, none chosen - is refused before anything is planned when `config.turri.yaml` alone names no unit testing script: every pulse would stop for want of one. The refusal names the stacks and the script each names. `stack: none` builds with `config.turri.yaml` alone all the same.
267
265
  - **The project's alone.** `module:`, `harness-model:`, `parallel-jobs:`, `rules-off:`, `compact-at:`, `ledger-keep:`, `debug:` and `cache-keep:` are read only from `config.turri.yaml` - there is one conversation, one module built when none is named, one machine. `agent-env:` and `toolchains:` in a stack's file add to the project's.
268
266
 
269
267
  The chat is told each stack's config and the one chosen. The skills that write testing scripts put each stack's in its own file once a project has two stacks, each stack named after the module it builds.
package/docs/deploy.md CHANGED
@@ -45,4 +45,4 @@ turri release [file.plain] [--in-module <module>] [--guidance <text>] [--model <
45
45
 
46
46
  The same, without the chat: a one-off agent on `coding-model`, thinking low (or `--model`; without either, [pi](https://pi.dev)'s default) is given the project's AGENTS.md and what `--guidance <text>` says, looks for guidance in them, and releases as above - as the guidance says, or to `dist/<module>` - then works out how to start it and starts it here, installing what it needs without asking. It stays in the foreground with the servers' output; `Ctrl-C` stops them. If it does not get there, deploy from the chat instead.
47
47
 
48
- `turri regenerate`, `change-plain` and `conform` end a build that landed with `To try it: turri release <spec>`.
48
+ `turri regenerate` and `conform` end a build that landed with `To try it: turri release <spec>`.
@@ -38,7 +38,6 @@ The workflow signs in to npm with npm's trusted publishing (OIDC), not a token:
38
38
  | `src/extension.ts` | the [pi](https://pi.dev) extension: every tool and command the conversation has - and `createTurriCore`, the session it is built into |
39
39
  | `src/chats.ts`, `src/chat-scope.ts`, `src/chat-records.ts` | the session's [chats](chats.md): which chat a pulse is told to, each chat's scope - its id and stack - and `.turri/chats.json` |
40
40
  | `src/sentinel.ts`, `src/sentinel-chat.ts` | [the sentinel](sentinel.md): its prompt, what it is told of a pulse, its fenced tools, its guidance; notices - their cards, the terminal's dialog, their answers |
41
- | `src/regenerate/advisor-runs.ts`, `src/regenerate/test-advisor.ts`, `src/regenerate/advisor-records.ts`, `src/advisor-chat.ts` | [the test advisor](test-advisor.md): which functional specs it takes and when, its model calls, its file in `.turri/advisor/`, and how its verdicts reach the chat |
42
41
  | `src/chat-terminal.ts`, `src/chat-ui.ts`, `src/chat-commands.ts` | the terminal's chats: [pi](https://pi.dev)'s screen switched between live sessions, a hidden chat's stand-in for it, `/chat` and its keys |
43
42
  | `src/host-session.ts` | `createTurri`, the session for a host |
44
43
  | `src/skill.ts` | parses `SKILL.md` into steps and gates |
@@ -46,7 +45,6 @@ The workflow signs in to npm with npm's trusted publishing (OIDC), not a token:
46
45
  | `src/judge.ts` | runs independent judges, applies the quorum, builds the critique |
47
46
  | `src/genome.ts` | `runSkill()` - the one entry point the CLI and the extension share |
48
47
  | `src/pi.ts` | [pi](https://pi.dev) session factories for executors, sub-agents and judges |
49
- | `src/spec-tools.ts` | `change_plain` |
50
48
  | `src/loop-tools.ts` | `regenerate`, `drift` and `halt` - one definition each, for the conversation and the skills alike |
51
49
  | `src/plain/` | the [\*\*\*plain](https://plainlang.org/docs/) parser - see [parser](parser.md) - and `highlight.ts`, which highlights \*\*\*plain with turri's own grammar, `plain.tmLanguage.json` - started from [plyn](https://github.com/plainlang/plyn)'s at `f9c02b8`, and changed here since: test plain files' sections and keys, the `# <id>` heading |
52
50
  | `src/regenerate/conformance.ts` | conformance tests: writing them, and fixing the test or the code until they pass |
@@ -64,7 +62,8 @@ The workflow signs in to npm with npm's trusted publishing (OIDC), not a token:
64
62
  | `src/regenerate/spec-map.ts`, `src/regenerate/spec-map-view.ts` | regen: each item's mark, from the records, the `.plain` files and the work loop's plan (`mapPlan`), and the map drawn |
65
63
  | `src/regenerate/debug-log.ts` | each regenerating agent's whole conversation, streamed to `.turri/debug/` - while its pulse runs, and kept in debug mode |
66
64
  | `src/regenerate/pulse-files.ts` | what a pulse writes only for a person - its logs, outputs, temporary files, its chain's installed dependencies - removed as it ends outside debug mode |
67
- | `src/regenerate/ledger.ts`, `src/regenerate/ledger-view.ts`, `src/ledger-tools.ts`, `src/ledger-cli.ts` | the ledger: what turri did, as typed facts, in `.turri/ledger/` - `record()`, read back for the `ledger` tool, `pulses`, `diagnose` and `turri ledger` - see [the ledger](using.md#the-ledger) |
65
+ | `src/regenerate/failure-reports.ts` | why a pulse that failed or finished without landing did - what `pulses` says of it - kept in `.turri/pulses/<id>.md` whatever the debug setting, for a later session |
66
+ | `src/regenerate/ledger.ts`, `src/regenerate/ledger-view.ts` | the ledger: what turri did, as typed facts, in `.turri/ledger/` - `record()`, read back for `pulses` - see [the ledger](using.md#the-ledger) |
68
67
  | `genome/` | what turri knows and can do: `genome/skills/`, the skill library, and `genome/rules/`, the \*\*\*plain authoring rules |
69
68
 
70
69
  ## Known edges