@turri-dev/cli 0.2.3 → 0.2.4-next.009bd0c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -8
- package/dist/bedrock-region.js +3 -3
- package/dist/chat-idle.d.ts +2 -2
- package/dist/chat-idle.js +2 -2
- package/dist/chat-models.d.ts +1 -1
- package/dist/chat-models.js +1 -1
- package/dist/chat-scope.d.ts +1 -3
- package/dist/chat-skills.d.ts +1 -1
- package/dist/chat-skills.js +1 -1
- package/dist/chats.d.ts +44 -20
- package/dist/chats.js +125 -64
- package/dist/cli.js +12 -31
- package/dist/config-edit.d.ts +20 -8
- package/dist/config-edit.js +32 -26
- package/dist/config.d.ts +106 -78
- package/dist/config.js +267 -133
- package/dist/conform-cli.js +14 -3
- package/dist/conformance-switch.d.ts +13 -22
- package/dist/conformance-switch.js +37 -59
- package/dist/drift-cli.js +1 -1
- package/dist/extension.d.ts +17 -10
- package/dist/extension.js +425 -531
- package/dist/genome.js +10 -49
- package/dist/graph.js +3 -5
- package/dist/host-session.d.ts +11 -21
- package/dist/host-session.js +6 -8
- package/dist/host.d.ts +4 -4
- package/dist/host.js +4 -7
- package/dist/identity.js +2 -3
- package/dist/init-config.d.ts +1 -2
- package/dist/init-config.js +10 -17
- package/dist/installed-providers.d.ts +1 -1
- package/dist/installed-providers.js +1 -1
- package/dist/launch-agent.d.ts +41 -0
- package/dist/launch-agent.js +219 -0
- package/dist/{release-cli.js → launch-cli.js} +41 -24
- package/dist/launch-session.d.ts +58 -0
- package/dist/launch-session.js +195 -0
- package/dist/launch-tools.d.ts +28 -0
- package/dist/launch-tools.js +69 -0
- package/dist/launch-track.d.ts +120 -0
- package/dist/launch-track.js +298 -0
- package/dist/loop-cli.d.ts +4 -3
- package/dist/loop-cli.js +17 -15
- package/dist/loop-tools.d.ts +45 -21
- package/dist/loop-tools.js +155 -90
- package/dist/new-project.js +2 -2
- package/dist/notice.d.ts +7 -6
- package/dist/parse-cli.js +2 -2
- package/dist/pi-launch.js +4 -1
- package/dist/pi-settings.d.ts +4 -0
- package/dist/pi-settings.js +39 -0
- package/dist/pi.js +12 -9
- package/dist/plain/check.d.ts +2 -9
- package/dist/plain/check.js +6 -39
- package/dist/plain-files.d.ts +2 -2
- package/dist/plain-files.js +7 -7
- package/dist/regenerate/activity.d.ts +0 -7
- package/dist/regenerate/activity.js +2 -20
- package/dist/regenerate/agent-env.d.ts +1 -1
- package/dist/regenerate/agent-env.js +3 -3
- package/dist/regenerate/agent-shell.js +5 -3
- package/dist/regenerate/audit.js +9 -0
- package/dist/regenerate/base-folder.d.ts +2 -2
- package/dist/regenerate/base-folder.js +1 -1
- package/dist/regenerate/cases.js +7 -0
- package/dist/regenerate/chunk-plan.d.ts +5 -0
- package/dist/regenerate/chunk-plan.js +16 -1
- package/dist/regenerate/command-check.d.ts +1 -1
- package/dist/regenerate/command-check.js +1 -1
- package/dist/regenerate/delivery.d.ts +1 -1
- package/dist/regenerate/delivery.js +3 -3
- package/dist/regenerate/drift.d.ts +4 -0
- package/dist/regenerate/drift.js +26 -6
- package/dist/regenerate/failure-reports.d.ts +28 -0
- package/dist/regenerate/failure-reports.js +79 -0
- package/dist/regenerate/job-panel.js +3 -1
- package/dist/regenerate/jobs-tree.js +1 -1
- package/dist/regenerate/jobs.d.ts +4 -2
- package/dist/regenerate/jobs.js +14 -10
- package/dist/regenerate/launch.d.ts +126 -0
- package/dist/regenerate/{release.js → launch.js} +60 -48
- package/dist/regenerate/ledger-view.d.ts +11 -24
- package/dist/regenerate/ledger-view.js +14 -60
- package/dist/regenerate/ledger.d.ts +26 -16
- package/dist/regenerate/ledger.js +1 -1
- package/dist/regenerate/lineage.d.ts +2 -0
- package/dist/regenerate/lineage.js +8 -0
- package/dist/regenerate/loop.d.ts +54 -67
- package/dist/regenerate/loop.js +312 -148
- package/dist/regenerate/model-names.d.ts +33 -0
- package/dist/regenerate/{engine.js → model-names.js} +2 -28
- package/dist/regenerate/paths.d.ts +3 -3
- package/dist/regenerate/paths.js +4 -4
- package/dist/regenerate/records.d.ts +11 -0
- package/dist/regenerate/records.js +15 -0
- package/dist/regenerate/regenerate.d.ts +0 -2
- package/dist/regenerate/regenerate.js +4 -15
- package/dist/regenerate/renames.js +4 -4
- package/dist/regenerate/requires.d.ts +7 -0
- package/dist/regenerate/requires.js +24 -18
- package/dist/regenerate/scripts-being-written.d.ts +4 -4
- package/dist/regenerate/scripts-being-written.js +3 -3
- package/dist/regenerate/spec-map.js +3 -3
- package/dist/regenerate/standing.js +1 -1
- package/dist/regenerate/submit-work.d.ts +2 -0
- package/dist/regenerate/submit-work.js +8 -3
- package/dist/regenerate/test-scripts.d.ts +2 -1
- package/dist/regenerate/test-scripts.js +33 -23
- package/dist/regenerate/testing-steps.d.ts +16 -5
- package/dist/regenerate/testing-steps.js +28 -9
- package/dist/regenerate-cli.js +18 -9
- package/dist/self-invocation.d.ts +11 -0
- package/dist/self-invocation.js +36 -10
- package/dist/sentinel-check.d.ts +3 -3
- package/dist/sentinel-check.js +3 -3
- package/dist/sentinel.d.ts +17 -12
- package/dist/sentinel.js +75 -46
- package/dist/{config-command.d.ts → settings.d.ts} +13 -8
- package/dist/{config-command.js → settings.js} +155 -24
- package/dist/setup.d.ts +2 -2
- package/dist/setup.js +7 -7
- package/dist/skill.d.ts +0 -11
- package/dist/skill.js +0 -9
- package/dist/tools.js +2 -3
- package/dist/turri-versions.js +2 -1
- package/docs/README.md +4 -6
- package/docs/authoring-plain.md +3 -3
- package/docs/chats.md +6 -9
- package/docs/claude-subscription.md +2 -2
- package/docs/config.md +61 -51
- package/docs/development.md +4 -5
- package/docs/headless.md +7 -6
- package/docs/hosting.md +24 -23
- package/docs/launch.md +63 -0
- package/docs/parser.md +3 -3
- package/docs/regenerating.md +30 -22
- package/docs/sandbox.md +3 -3
- package/docs/sentinel.md +27 -16
- package/docs/skills-and-gates.md +6 -11
- package/docs/using.md +25 -42
- package/genome/rules/project-model.md +2 -1
- package/genome/rules/test-plain-files.md +15 -7
- package/genome/rules/turri-regeneration.md +7 -10
- package/genome/skills/convert-old-syntax/SKILL.md +5 -5
- package/genome/skills/implement-conformance-testing-script/SKILL.md +2 -2
- package/genome/skills/implement-unit-testing-script/SKILL.md +3 -3
- package/package.json +1 -1
- package/dist/advisor-chat.d.ts +0 -63
- package/dist/advisor-chat.js +0 -290
- package/dist/change-plain-cli.js +0 -55
- package/dist/ledger-cli.d.ts +0 -1
- package/dist/ledger-cli.js +0 -50
- package/dist/ledger-tools.d.ts +0 -10
- package/dist/ledger-tools.js +0 -64
- package/dist/regenerate/advisor-records.d.ts +0 -93
- package/dist/regenerate/advisor-records.js +0 -110
- package/dist/regenerate/advisor-runs.d.ts +0 -87
- package/dist/regenerate/advisor-runs.js +0 -327
- package/dist/regenerate/engine.d.ts +0 -52
- package/dist/regenerate/release.d.ts +0 -121
- package/dist/regenerate/test-advisor.d.ts +0 -101
- package/dist/regenerate/test-advisor.js +0 -379
- package/dist/release-agent.d.ts +0 -43
- package/dist/release-agent.js +0 -130
- package/dist/release-cli.d.ts +0 -1
- package/dist/release-tools.d.ts +0 -44
- package/dist/release-tools.js +0 -170
- package/dist/spec-tools.d.ts +0 -36
- package/dist/spec-tools.js +0 -128
- package/dist/stacks.d.ts +0 -13
- package/dist/stacks.js +0 -96
- package/docs/deploy.md +0 -48
- package/docs/test-advisor.md +0 -110
- /package/dist/{change-plain-cli.d.ts → launch-cli.d.ts} +0 -0
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ExtensionAPI, type ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { type Setting } from "./config-edit.ts";
|
|
3
3
|
/**
|
|
4
|
-
* `/
|
|
5
|
-
* `/
|
|
4
|
+
* `/settings`: every setting of the project's config.turri.yaml from the chat - `/settings` alone lists them,
|
|
5
|
+
* `/settings review` asks for review's value, `/settings review false` sets it. Each is written into the file
|
|
6
6
|
* and takes effect as it says - now, at your next message, at the next pulse - never only once turri starts again:
|
|
7
|
-
* what turri fixes at its start is changed live here (live).
|
|
7
|
+
* what turri fixes at its start is changed live here (live). It takes pi's own /settings over (pi-settings.ts), whose
|
|
8
|
+
* menu is its last entry.
|
|
9
|
+
*
|
|
10
|
+
* The chat's `settings` tool reads them and changes them as the person asks - into config.turri.yaml, or a module's
|
|
11
|
+
* own config.turri.<module>.yaml - a model checked as it is written, by the name the person said. What is the person's
|
|
12
|
+
* alone (`personOnly`) it refuses, and points to /settings.
|
|
8
13
|
*/
|
|
9
14
|
/** What a change does to turri as it runs, beside the file: each says what it did, or nothing. */
|
|
10
15
|
export interface LiveHooks {
|
|
11
16
|
/** The chat's model is now this - provider/id:thinking - or, undefined, no longer set in the file. */
|
|
12
17
|
chatModel(spec: string | undefined, ctx: ExtensionContext): Promise<string | undefined>;
|
|
13
|
-
/** The coding model changed in the file: one
|
|
18
|
+
/** The coding model changed in the file: one given for this session - --coding-model - gives way to it. */
|
|
14
19
|
codingModel(): string | undefined;
|
|
15
20
|
/** How many pulses run at once: the number, or the machine's default. */
|
|
16
21
|
parallelJobs(count: number | undefined): string | undefined;
|
|
17
22
|
}
|
|
18
|
-
export interface
|
|
23
|
+
export interface SettingsOptions {
|
|
19
24
|
/** The folder whose config.turri.yaml the chat reads. */
|
|
20
25
|
cwd: string;
|
|
21
26
|
/** The ***plain rules there are, by name - what rules-off takes. */
|
|
@@ -27,7 +32,7 @@ export interface TurriConfigOptions {
|
|
|
27
32
|
/** The models pi can reach here, signed in: provider/id - from a chat's context, the model registry the chats use. */
|
|
28
33
|
export declare function reachable(ctx: ExtensionContext | undefined): string[];
|
|
29
34
|
/**
|
|
30
|
-
* Every value /
|
|
35
|
+
* Every value /settings offers for a setting after what is typed, in its order - "unset" left out, and uncapped: what
|
|
31
36
|
* its completions show, the first of them, and what a host's settings list shows (host-session.ts `settingChoices`).
|
|
32
37
|
* A model setting's are every model pi can reach, signed in - `models` - and after a colon, that model's thinking levels.
|
|
33
38
|
*/
|
|
@@ -37,4 +42,4 @@ export declare function settingCandidates(setting: Setting, typed: string, where
|
|
|
37
42
|
}): string[];
|
|
38
43
|
/** The ***plain rules there are, by name - what rules-off takes, and its values. */
|
|
39
44
|
export declare function ruleNames(): string[];
|
|
40
|
-
export declare function
|
|
45
|
+
export declare function registerSettings(pi: ExtensionAPI, options: SettingsOptions): void;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { Type } from "typebox";
|
|
3
|
+
import { basename, isAbsolute, join, relative, resolve } from "node:path";
|
|
2
4
|
import { applyBedrockRegion } from "./bedrock-region.js";
|
|
3
|
-
import { CONFIG_FILE, LEGACY_CONFIG_FILE, THINKING_LEVELS, usesLegacyConfig } from "./config.js";
|
|
4
|
-
import { currentValue, dotenvFiles, EFFECT_TEXT, overriddenBy, parseValue, pathOptions, readConfigText, settingOf, settings, shownValue, writeSetting, } from "./config-edit.js";
|
|
5
|
+
import { CONFIG_FILE, LEGACY_CONFIG_FILE, moduleConfigFile, moduleConfigsOf, THINKING_LEVELS, usesLegacyConfig } from "./config.js";
|
|
6
|
+
import { currentValue, dotenvFiles, EFFECT_TEXT, overriddenBy, parseValue, pathOptions, readConfigText, readModuleConfigText, settingOf, settings, shownValue, writeSetting, } from "./config-edit.js";
|
|
5
7
|
import { PACKAGE_ROOT } from "./environment.js";
|
|
8
|
+
import { describeResolution, resolveModel } from "./regenerate/model-names.js";
|
|
9
|
+
import { openPiSettings } from "./pi-settings.js";
|
|
6
10
|
import { loadRules } from "./rules.js";
|
|
7
11
|
/** The option that unsets a setting, for a setting. */
|
|
8
12
|
const unsetOption = (setting) => `unset - ${setting.unset}`;
|
|
9
13
|
const TYPE_ANOTHER = "type another…";
|
|
10
14
|
const DONE = "done";
|
|
11
15
|
const ROLES_ENTRY = "models.<role> - each agent role's own model, thinking and turn limit…";
|
|
16
|
+
const PI_ENTRY = "pi's own settings - the theme, the editor, how the chat is shown…";
|
|
12
17
|
/** The models pi can reach here, signed in: provider/id - from a chat's context, the model registry the chats use. */
|
|
13
18
|
export function reachable(ctx) {
|
|
14
19
|
try {
|
|
@@ -21,7 +26,7 @@ export function reachable(ctx) {
|
|
|
21
26
|
/** How many values the terminal's autocomplete shows for a setting: a host reads them whole (`settingCandidates`). */
|
|
22
27
|
const COMPLETIONS_SHOWN = 40;
|
|
23
28
|
/**
|
|
24
|
-
* Every value /
|
|
29
|
+
* Every value /settings offers for a setting after what is typed, in its order - "unset" left out, and uncapped: what
|
|
25
30
|
* its completions show, the first of them, and what a host's settings list shows (host-session.ts `settingChoices`).
|
|
26
31
|
* A model setting's are every model pi can reach, signed in - `models` - and after a colon, that model's thinking levels.
|
|
27
32
|
*/
|
|
@@ -48,25 +53,22 @@ function listLine(setting, text) {
|
|
|
48
53
|
const value = currentValue(text, setting.key);
|
|
49
54
|
return `${setting.key}: ${value === undefined ? `(unset - ${setting.unset})` : shownValue(value)}`;
|
|
50
55
|
}
|
|
51
|
-
export function
|
|
56
|
+
export function registerSettings(pi, options) {
|
|
52
57
|
const { cwd } = options;
|
|
53
58
|
// The models for completions, which are given no context: the last one seen.
|
|
54
59
|
let seen;
|
|
55
60
|
pi.on("session_start", (_event, ctx) => {
|
|
56
61
|
seen = ctx;
|
|
57
62
|
});
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
ctx.ui.notify(parsed.error, "error");
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const value = "unset" in parsed ? undefined : parsed.value;
|
|
63
|
+
/**
|
|
64
|
+
* Write a setting - or unset it - into config.turri.yaml, or `module`'s own file, and change live what turri fixed at
|
|
65
|
+
* its start; says what it did and when it takes effect.
|
|
66
|
+
*/
|
|
67
|
+
const change = async (setting, value, ctx, module) => {
|
|
67
68
|
// The first setting written where the project is still read from config.yaml: copied to config.turri.yaml first.
|
|
68
69
|
const adopting = usesLegacyConfig(cwd);
|
|
69
|
-
const text = writeSetting(cwd, setting.key, value);
|
|
70
|
+
const text = writeSetting(cwd, setting.key, value, module);
|
|
71
|
+
const file = module !== undefined ? moduleConfigFile(module) : CONFIG_FILE;
|
|
70
72
|
const notes = [];
|
|
71
73
|
// A model changed: the AWS region its Bedrock models need is worked out again - set, moved or taken back by turri.
|
|
72
74
|
if (setting.key.endsWith("-model") || setting.key.startsWith("models."))
|
|
@@ -89,9 +91,21 @@ export function registerTurriConfig(pi, options) {
|
|
|
89
91
|
}
|
|
90
92
|
if (adopting)
|
|
91
93
|
notes.push(`${LEGACY_CONFIG_FILE} was copied to ${CONFIG_FILE} first - turri reads its own file from now on, and leaves ${LEGACY_CONFIG_FILE} as it is.`);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
if (module !== undefined)
|
|
95
|
+
notes.push(`It holds for ${module}.plain and every module built on it that has no file of its own, over ${CONFIG_FILE}.`);
|
|
96
|
+
notes.push(...overriddenBy(cwd, text, setting, module));
|
|
97
|
+
const what = value === undefined ? `${setting.key} unset - ${module !== undefined ? `${CONFIG_FILE}'s holds` : setting.unset}` : `${setting.key}: ${shownValue(value)}`;
|
|
98
|
+
return [`${what} - written to ${file}, ${EFFECT_TEXT[setting.effect]}.`, ...notes].join("\n");
|
|
99
|
+
};
|
|
100
|
+
/** Set a setting to what was typed - or unset it - and say what it did and when it takes effect. */
|
|
101
|
+
const apply = async (setting, typed, ctx) => {
|
|
102
|
+
const models = reachable(ctx);
|
|
103
|
+
const parsed = parseValue(setting, typed, models.length > 0 ? (model) => models.includes(model) : undefined);
|
|
104
|
+
if ("error" in parsed) {
|
|
105
|
+
ctx.ui.notify(parsed.error, "error");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
ctx.ui.notify(await change(setting, "unset" in parsed ? undefined : parsed.value, ctx), "info");
|
|
95
109
|
};
|
|
96
110
|
/** Ask for a setting's value, as its kind takes it: what is typed comes back, or nothing when the dialog is left. */
|
|
97
111
|
const askValue = async (setting, ctx) => {
|
|
@@ -154,15 +168,20 @@ export function registerTurriConfig(pi, options) {
|
|
|
154
168
|
}
|
|
155
169
|
}
|
|
156
170
|
};
|
|
157
|
-
/** Pick a setting from the list - the models of each role behind one entry. */
|
|
171
|
+
/** Pick a setting from the list - the models of each role behind one entry, and pi's own settings last. */
|
|
158
172
|
const askSetting = async (ctx) => {
|
|
159
173
|
const text = readConfigText(cwd);
|
|
160
174
|
const all = settings(options.rules());
|
|
161
175
|
const top = all.filter((setting) => !setting.key.startsWith("models."));
|
|
162
|
-
const lines = [...top.map((setting) => listLine(setting, text)), ROLES_ENTRY];
|
|
163
|
-
const chosen = await ctx.ui.select(`/
|
|
176
|
+
const lines = [...top.map((setting) => listLine(setting, text)), ROLES_ENTRY, PI_ENTRY];
|
|
177
|
+
const chosen = await ctx.ui.select(`/settings - the project's ${CONFIG_FILE}. Pick a setting to change:`, lines);
|
|
164
178
|
if (chosen === undefined)
|
|
165
179
|
return undefined;
|
|
180
|
+
if (chosen === PI_ENTRY) {
|
|
181
|
+
if (!openPiSettings())
|
|
182
|
+
ctx.ui.notify("pi's own settings open only in the terminal's chat.", "info");
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
166
185
|
if (chosen === ROLES_ENTRY) {
|
|
167
186
|
const roles = all.filter((setting) => setting.key.startsWith("models."));
|
|
168
187
|
const role = await ctx.ui.select("Which role's model or turn limit?", roles.map((setting) => listLine(setting, text)));
|
|
@@ -200,8 +219,8 @@ export function registerTurriConfig(pi, options) {
|
|
|
200
219
|
await apply(setting, value, ctx);
|
|
201
220
|
},
|
|
202
221
|
});
|
|
203
|
-
pi.registerCommand("
|
|
204
|
-
description: `Change a setting of the project's ${CONFIG_FILE}`,
|
|
222
|
+
pi.registerCommand("settings", {
|
|
223
|
+
description: `Change a setting of the project's ${CONFIG_FILE} - or pi's own, last in the list`,
|
|
205
224
|
getArgumentCompletions: (prefix) => {
|
|
206
225
|
const all = settings(options.rules());
|
|
207
226
|
const space = prefix.indexOf(" ");
|
|
@@ -234,7 +253,7 @@ export function registerTurriConfig(pi, options) {
|
|
|
234
253
|
setting = settingOf(key, options.rules());
|
|
235
254
|
if (setting === undefined) {
|
|
236
255
|
const near = settings(options.rules()).filter((entry) => entry.key.includes(key.toLowerCase())).map((entry) => entry.key);
|
|
237
|
-
ctx.ui.notify(`No setting ${key}.${near.length > 0 ? ` Did you mean ${near.slice(0, 5).join(", ")}?` : " /
|
|
256
|
+
ctx.ui.notify(`No setting ${key}.${near.length > 0 ? ` Did you mean ${near.slice(0, 5).join(", ")}?` : " /settings alone lists them."}`, "error");
|
|
238
257
|
return;
|
|
239
258
|
}
|
|
240
259
|
}
|
|
@@ -244,4 +263,116 @@ export function registerTurriConfig(pi, options) {
|
|
|
244
263
|
await apply(setting, given, ctx);
|
|
245
264
|
},
|
|
246
265
|
});
|
|
266
|
+
pi.registerTool(defineTool({
|
|
267
|
+
name: "settings",
|
|
268
|
+
label: "Settings",
|
|
269
|
+
description: `Read or change the project's settings: ${CONFIG_FILE}, and a module's own config.turri.<module>.yaml laid over it for ` +
|
|
270
|
+
"that module and every module built on it that has no file of its own. With no key: every setting, what it is " +
|
|
271
|
+
"and where it is set. With a key and no value: that setting, what it takes and what it is unset. With a value: " +
|
|
272
|
+
"written, taking effect as it says - the coding model at the next pulse. A model may be given by its name as the " +
|
|
273
|
+
"user said it; one that fits several, or none with credentials, comes back as a list - ask the user which. " +
|
|
274
|
+
"Some settings are the user's alone and are refused: they change them with /settings. For one pulse on another " +
|
|
275
|
+
"model, pass model to regenerate or conform instead.",
|
|
276
|
+
promptSnippet: "read the project's settings, or change one when the user asks - the coding model among them",
|
|
277
|
+
promptGuidelines: [
|
|
278
|
+
"Change a setting only when the user asks for it - \"regenerate with gpt 5.5 from now on\" is coding-model - and say what it is now and when it takes effect.",
|
|
279
|
+
"If settings returns several candidate models, ask the user which one, then call it again with the exact provider/model-id.",
|
|
280
|
+
"A setting settings refuses is the user's to change: tell them why it matters and that /settings changes it - never edit the config files to get round it.",
|
|
281
|
+
],
|
|
282
|
+
parameters: Type.Object({
|
|
283
|
+
key: Type.Optional(Type.String({ description: "The setting as the config file writes it - coding-model, models.coding, review, unittests-script. Omitted: every setting" })),
|
|
284
|
+
value: Type.Optional(Type.String({
|
|
285
|
+
description: "What to set it to: true or false, a number, one of its words, a path from the project root, a model as " +
|
|
286
|
+
"provider/model-id - :thinking after it - or its name as the user said it, a list separated by commas; " +
|
|
287
|
+
"unset to take it out. Omitted: what it is now",
|
|
288
|
+
})),
|
|
289
|
+
module: Type.Optional(Type.String({
|
|
290
|
+
description: `The module - its .plain file, e.g. backend.plain - whose own config.turri.<module>.yaml to write. Omitted: ${CONFIG_FILE}, the whole project's`,
|
|
291
|
+
})),
|
|
292
|
+
}),
|
|
293
|
+
async execute(_id, params, _signal, _onUpdate, ctx) {
|
|
294
|
+
const reply = (text) => ({ content: [{ type: "text", text }], details: {} });
|
|
295
|
+
const module = params.module !== undefined && params.module.trim() !== "" ? basename(params.module.trim(), ".plain") : undefined;
|
|
296
|
+
if (params.key === undefined || params.key.trim() === "")
|
|
297
|
+
return reply(describeSettings(cwd, options.rules));
|
|
298
|
+
const setting = settingOf(params.key, options.rules());
|
|
299
|
+
if (setting === undefined) {
|
|
300
|
+
const key = params.key.trim().toLowerCase();
|
|
301
|
+
const near = settings(options.rules()).filter((entry) => entry.key.includes(key)).map((entry) => entry.key);
|
|
302
|
+
throw new Error(`No setting ${params.key}.${near.length > 0 ? ` Did you mean ${near.slice(0, 5).join(", ")}?` : " Call settings with no key for every one."}`);
|
|
303
|
+
}
|
|
304
|
+
if (params.value === undefined)
|
|
305
|
+
return reply(describeSetting(cwd, setting));
|
|
306
|
+
if (setting.personOnly === true) {
|
|
307
|
+
throw new Error(`${setting.key} is the user's to change, not yours: ${setting.about}. Nothing was written. Tell them what it would change, ` +
|
|
308
|
+
`and that /settings ${setting.key} changes it.`);
|
|
309
|
+
}
|
|
310
|
+
if (module !== undefined && setting.projectOnly === true)
|
|
311
|
+
throw new Error(`${setting.key} is the whole project's: it is set in ${CONFIG_FILE} alone, never in a module's file. Nothing was written.`);
|
|
312
|
+
const value = writtenValue(setting, params.value, cwd, ctx);
|
|
313
|
+
return reply(await change(setting, value, ctx, module));
|
|
314
|
+
},
|
|
315
|
+
}));
|
|
316
|
+
}
|
|
317
|
+
/** What a setting is set to, read from what the chat gave: a model's name resolved, a path kept inside the project - or why not. */
|
|
318
|
+
function writtenValue(setting, given, cwd, ctx) {
|
|
319
|
+
let typed = given.trim();
|
|
320
|
+
if (setting.kind === "model" && !/^(unset|default|none|-)$/i.test(typed)) {
|
|
321
|
+
const colon = typed.lastIndexOf(":");
|
|
322
|
+
const level = colon !== -1 && THINKING_LEVELS.includes(typed.slice(colon + 1)) ? typed.slice(colon + 1) : undefined;
|
|
323
|
+
const name = level !== undefined ? typed.slice(0, colon) : typed;
|
|
324
|
+
const resolved = resolveModel(name, ctx.modelRegistry);
|
|
325
|
+
if (!resolved.ok)
|
|
326
|
+
throw new Error(`Nothing was written.\n${describeResolution(resolved)}`);
|
|
327
|
+
typed = `${resolved.model}${level !== undefined ? `:${level}` : ""}`;
|
|
328
|
+
}
|
|
329
|
+
if (setting.kind === "path" && !/^(unset|default|none|-)$/i.test(typed)) {
|
|
330
|
+
const inside = relative(cwd, resolve(cwd, typed));
|
|
331
|
+
if (inside.startsWith("..") || isAbsolute(inside))
|
|
332
|
+
throw new Error(`${setting.key} takes a path inside the project, from its root - ${typed} is outside it. Nothing was written.`);
|
|
333
|
+
}
|
|
334
|
+
const parsed = parseValue(setting, typed);
|
|
335
|
+
if ("error" in parsed)
|
|
336
|
+
throw new Error(`${parsed.error} Nothing was written.`);
|
|
337
|
+
return "unset" in parsed ? undefined : parsed.value;
|
|
338
|
+
}
|
|
339
|
+
/** Every setting, as the chat is told them: what each is in config.turri.yaml, what each module's file sets over it. */
|
|
340
|
+
function describeSettings(cwd, rules) {
|
|
341
|
+
const text = readConfigText(cwd);
|
|
342
|
+
const all = settings(rules());
|
|
343
|
+
const lines = all
|
|
344
|
+
.filter((setting) => !setting.key.startsWith("models.") || currentValue(text, setting.key) !== undefined)
|
|
345
|
+
.map((setting) => `- ${listLine(setting, text)}${setting.personOnly === true ? " - the user's to change" : ""}`);
|
|
346
|
+
const modules = moduleConfigsOf(cwd).map((module) => {
|
|
347
|
+
const own = readModuleConfigText(cwd, module);
|
|
348
|
+
const set = all.filter((setting) => currentValue(own, setting.key) !== undefined).map((setting) => `${setting.key}: ${shownValue(currentValue(own, setting.key))}`);
|
|
349
|
+
return `${moduleConfigFile(module)}, over it for ${module}.plain and the modules built on it: ${set.length > 0 ? set.join(", ") : "nothing"}`;
|
|
350
|
+
});
|
|
351
|
+
return [`${CONFIG_FILE}:`, ...lines, ...(modules.length > 0 ? ["", ...modules] : []), "", "models.<role> not listed are unset: each role takes default's, then coding-model's."].join("\n");
|
|
352
|
+
}
|
|
353
|
+
/** One setting, as the chat is told it: what it does, what it takes, what it is in each file. */
|
|
354
|
+
function describeSetting(cwd, setting) {
|
|
355
|
+
const now = currentValue(readConfigText(cwd), setting.key);
|
|
356
|
+
const takes = setting.kind === "boolean"
|
|
357
|
+
? "true or false"
|
|
358
|
+
: setting.kind === "model"
|
|
359
|
+
? "a model, provider/model-id[:thinking]"
|
|
360
|
+
: setting.kind === "path"
|
|
361
|
+
? "a path from the project root"
|
|
362
|
+
: setting.kind === "list"
|
|
363
|
+
? `a list${setting.options !== undefined ? ` of ${setting.options.join(", ")}` : ""}`
|
|
364
|
+
: setting.options !== undefined
|
|
365
|
+
? `${setting.kind === "number" ? "a number - e.g. " : "one of "}${setting.options.join(", ")}`
|
|
366
|
+
: `a ${setting.kind}`;
|
|
367
|
+
const modules = setting.projectOnly === true ? [] : moduleConfigsOf(cwd).flatMap((module) => {
|
|
368
|
+
const own = currentValue(readModuleConfigText(cwd, module), setting.key);
|
|
369
|
+
return own !== undefined ? [`${moduleConfigFile(module)}: ${shownValue(own)}`] : [];
|
|
370
|
+
});
|
|
371
|
+
return [
|
|
372
|
+
`${setting.key} - ${setting.about}.`,
|
|
373
|
+
`Takes ${takes}; unset: ${setting.unset}.`,
|
|
374
|
+
`${CONFIG_FILE}: ${now === undefined ? "unset" : shownValue(now)}${modules.length > 0 ? `; ${modules.join("; ")}` : ""}.`,
|
|
375
|
+
...(setting.personOnly === true ? ["The user's to change, with /settings - not yours."] : []),
|
|
376
|
+
...(setting.projectOnly === true ? [`The whole project's: set in ${CONFIG_FILE} alone.`] : []),
|
|
377
|
+
].join("\n");
|
|
247
378
|
}
|
package/dist/setup.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare function checkProject(project: string, machine?: {
|
|
|
38
38
|
jdk?: () => boolean | Promise<boolean>;
|
|
39
39
|
}): Promise<Check[]>;
|
|
40
40
|
/**
|
|
41
|
-
* In a project: each model its config names -
|
|
41
|
+
* In a project: each model its config.turri.yaml names - or the module config pinned, its file's over it - tried with one short
|
|
42
42
|
* request. A model that answers is ready; one that does not says what the provider said, and what to do about it.
|
|
43
43
|
*/
|
|
44
44
|
export declare function checkProjectModels(project: string, access?: ModelAccess): Promise<Check[]>;
|
|
@@ -77,7 +77,7 @@ export interface ClaudeCodeProbe {
|
|
|
77
77
|
*/
|
|
78
78
|
export declare function checkClaudeSubscription(project: string, env?: NodeJS.ProcessEnv, probe?: ClaudeCodeProbe): Promise<Check[]>;
|
|
79
79
|
/**
|
|
80
|
-
* The base folders the project's config names - its own, and each
|
|
80
|
+
* The base folders the project's config names - its own, and each module's own file's - each there with its files, or not: a codebase
|
|
81
81
|
* that requires nothing starts from one, and its first pulse stops when it is not there. Nothing when none is named.
|
|
82
82
|
*/
|
|
83
83
|
export declare function checkBaseFolders(project: string): Promise<Check[]>;
|
package/dist/setup.js
CHANGED
|
@@ -10,7 +10,7 @@ import { fetchLatest, newerThan, turrisOnPath, versionFindings } from "./turri-v
|
|
|
10
10
|
import { sandboxAvailable, sandboxWithAsync } from "./regenerate/os-sandbox.js";
|
|
11
11
|
import { findTestScripts, onThisMachine } from "./regenerate/test-scripts.js";
|
|
12
12
|
import { configKeyOptions, parseArgs } from "./cli-options.js";
|
|
13
|
-
import { CONFIG_FILE, hasProjectConfig, readProjectConfig,
|
|
13
|
+
import { CONFIG_FILE, hasProjectConfig, readProjectConfig, moduleConfigFile, configModuleOf, moduleConfigsOf } from "./config.js";
|
|
14
14
|
import { checkModels, modelsInUse, piModelAccess } from "./model-check.js";
|
|
15
15
|
import { bedrockRegionFor, describeBedrockRegion, regionInGeography } from "./bedrock-region.js";
|
|
16
16
|
import { baseFilesAsync } from "./regenerate/base-folder.js";
|
|
@@ -181,11 +181,11 @@ function checkGlobal() {
|
|
|
181
181
|
];
|
|
182
182
|
}
|
|
183
183
|
/**
|
|
184
|
-
* In a project: each model its config names -
|
|
184
|
+
* In a project: each model its config.turri.yaml names - or the module config pinned, its file's over it - tried with one short
|
|
185
185
|
* request. A model that answers is ready; one that does not says what the provider said, and what to do about it.
|
|
186
186
|
*/
|
|
187
187
|
export async function checkProjectModels(project, access) {
|
|
188
|
-
const used = modelsInUse(readProjectConfig(project,
|
|
188
|
+
const used = modelsInUse(readProjectConfig(project, configModuleOf(project)));
|
|
189
189
|
if (used.length === 0) {
|
|
190
190
|
return [{ level: "missing", name: "Models", detail: "config.turri.yaml names none", fix: "turri init-config writes the two models - or name them here: --harness-model, --coding-model" }];
|
|
191
191
|
}
|
|
@@ -262,7 +262,7 @@ const claudeCodeProbe = (project) => ({
|
|
|
262
262
|
* Max subscription, and nothing in the environment it refuses. Nothing when no model is a claude-code one.
|
|
263
263
|
*/
|
|
264
264
|
export async function checkClaudeSubscription(project, env = process.env, probe = claudeCodeProbe(project)) {
|
|
265
|
-
const configs = [readProjectConfig(project), ...
|
|
265
|
+
const configs = [readProjectConfig(project), ...moduleConfigsOf(project).map((module) => readProjectConfig(project, module))];
|
|
266
266
|
const named = [...new Set(configs.flatMap((config) => modelsInUse(config)).filter((used) => used.spec.startsWith("claude-code/")).map((used) => used.spec))];
|
|
267
267
|
if (named.length === 0)
|
|
268
268
|
return [];
|
|
@@ -290,15 +290,15 @@ export async function checkClaudeSubscription(project, env = process.env, probe
|
|
|
290
290
|
return [{ level: "ok", name, detail: `pi-claude-code installed, Claude Code signed in to ${status.subscriptionType} - for ${named.join(", ")}` }];
|
|
291
291
|
}
|
|
292
292
|
/**
|
|
293
|
-
* The base folders the project's config names - its own, and each
|
|
293
|
+
* The base folders the project's config names - its own, and each module's own file's - each there with its files, or not: a codebase
|
|
294
294
|
* that requires nothing starts from one, and its first pulse stops when it is not there. Nothing when none is named.
|
|
295
295
|
*/
|
|
296
296
|
export async function checkBaseFolders(project) {
|
|
297
297
|
const named = new Map();
|
|
298
|
-
for (const [
|
|
298
|
+
for (const [module, config] of [[undefined, readProjectConfig(project)], ...moduleConfigsOf(project).map((module) => [module, readProjectConfig(project, module)])]) {
|
|
299
299
|
if (config.baseFolder === undefined)
|
|
300
300
|
continue;
|
|
301
|
-
named.set(config.baseFolder, [...(named.get(config.baseFolder) ?? []),
|
|
301
|
+
named.set(config.baseFolder, [...(named.get(config.baseFolder) ?? []), module === undefined ? CONFIG_FILE : moduleConfigFile(module)]);
|
|
302
302
|
}
|
|
303
303
|
return Promise.all([...named].map(async ([folder, files]) => {
|
|
304
304
|
const path = resolve(project, folder);
|
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/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
|
|
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,
|
|
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() {
|
package/dist/turri-versions.js
CHANGED
|
@@ -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
|
-
|
|
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,11 +18,10 @@ 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) |
|
|
25
|
-
| how a backend and a frontend on different stacks share one project | [
|
|
24
|
+
| how a backend and a frontend on different stacks share one project | [a module's own config](config.md#a-modules-own-config) |
|
|
26
25
|
| which ready-made stacks \*\*\*plain can import - a FastAPI backend, a React frontend | [the standard library](authoring-plain.md#the-standard-library) |
|
|
27
26
|
| everything an agent was sent and did, to debug it | [using](using.md#agent-logs) |
|
|
28
27
|
| how to regenerate \*\*\*plain overnight, and resume it | [running unattended](headless.md) |
|
|
@@ -31,7 +30,7 @@ turri is the first coding agent with the power of regenerative software: [\*\*\*
|
|
|
31
30
|
| which skill does what | [authoring \*\*\*plain](authoring-plain.md#the-skills) |
|
|
32
31
|
| what happens when \*\*\*plain changes | [regenerating the code](regenerating.md#when-plain-changes) |
|
|
33
32
|
| why a test was not allowed to be deleted | [regenerating the code](regenerating.md#the-tests-must-actually-pass) |
|
|
34
|
-
| how to try what is built, and what
|
|
33
|
+
| how to try what is built, and what a launch may install | [launch](launch.md) |
|
|
35
34
|
| what the agents can and cannot reach | [the sandbox](sandbox.md) |
|
|
36
35
|
| how skill review gates and judges work | [skills and gates](skills-and-gates.md) |
|
|
37
36
|
| how the parser matches the reference implementation | [the \*\*\*plain parser](parser.md) |
|
|
@@ -46,10 +45,9 @@ 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
|
-
| [The project config](config.md) | `config.turri.yaml` and
|
|
52
|
-
| [
|
|
49
|
+
| [The project config](config.md) | `config.turri.yaml` and a module's own `config.turri.<module>.yaml`: where they are read from, every key, models and their inheritance, conformance, the testing scripts, which file builds a module, the old `config.yaml` |
|
|
50
|
+
| [Launch](launch.md) | trying what is built: the launch track, a commit in dist/<module>, starting it on your machine, after every pulse, `turri launch` |
|
|
53
51
|
| [Running unattended](headless.md) | regenerating overnight or in CI: before you leave it, the command, the results, resuming, rebuilding one functionality |
|
|
54
52
|
| [Authoring \*\*\*plain](authoring-plain.md) | a \*\*\*plain project, what \*\*\*plain is made of, the rules, writing \*\*\*plain with the agent, the skills, checking \*\*\*plain |
|
|
55
53
|
| [Regenerating](regenerating.md) | where things go, one job, a whole module and how its work is cut into jobs, each job's cases, \*\*\*plain changes, conformance tests, the two records of what is built |
|
package/docs/authoring-plain.md
CHANGED
|
@@ -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
|
|
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 `
|
|
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 `
|
|
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
|
@@ -8,22 +8,19 @@ Each chat has its own:
|
|
|
8
8
|
|
|
9
9
|
- **history** - what was said in it, and nothing said in another; a chat asked about another's says so and asks;
|
|
10
10
|
- **turns** - a hidden chat keeps working, and starts a turn of its own when a pulse it asked for ends;
|
|
11
|
-
- **model and thinking level** - [pi](https://pi.dev)'s `/model`, and `/
|
|
12
|
-
- **stack** - `/stack` and the chat's `stack` tool choose it for that chat alone; a new chat starts with `--stack`'s, or none (see [stacks](config.md#stacks));
|
|
11
|
+
- **model and thinking level** - [pi](https://pi.dev)'s `/model`, and `/settings harness-model` in that chat;
|
|
13
12
|
- **questions** - what it asks waits in it until you look at it.
|
|
14
13
|
|
|
15
14
|
The session's, shared by every chat:
|
|
16
15
|
|
|
17
16
|
- **the pulses and their plan** - one job registry and one work loop on the project: a pulse any chat starts is in every chat's side panel and `pulses`, and two chats asking for the same module get one plan, not two;
|
|
18
|
-
- **the coding model**
|
|
17
|
+
- **the coding model** given with `--coding-model`, and `parallel-jobs`;
|
|
19
18
|
- **steering** - what `steer` was told, every plan follows;
|
|
20
19
|
- **conformance** chosen with `conform`, module by module;
|
|
21
|
-
- **what
|
|
20
|
+
- **what launches started** - it runs until turri ends or `/halt launched <name>`, whatever chats are opened or closed - and the launch track;
|
|
22
21
|
- **the ledger** - one run, each event with the id of the chat its work was asked for in (`chat`), and `chat.opened` and `chat.closed` as they happen.
|
|
23
22
|
|
|
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
|
|
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`.
|
|
23
|
+
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 launched, 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.
|
|
27
24
|
|
|
28
25
|
## In the terminal
|
|
29
26
|
|
|
@@ -63,11 +60,11 @@ turri records which chats are open in `.turri/chats.json` - a run a session, eac
|
|
|
63
60
|
- **a session's chats** are kept until five newer sessions have recorded theirs, then deleted with their record;
|
|
64
61
|
- a session still running is never reopened by another turri.
|
|
65
62
|
|
|
66
|
-
In [debug mode](config.md#debug-mode) nothing is deleted.
|
|
63
|
+
In [debug mode](config.md#debug-mode) nothing is deleted.
|
|
67
64
|
|
|
68
65
|
## Where there is one chat
|
|
69
66
|
|
|
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
|
|
67
|
+
[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
68
|
|
|
72
69
|
## In a host
|
|
73
70
|
|
|
@@ -44,7 +44,7 @@ turri does not depend on the extension: it finds it as pi does, once you have in
|
|
|
44
44
|
coding-model: claude-code/claude-sonnet-5:low # it writes the code
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
For a project that has a `config.turri.yaml` already, it sets those two and leaves everything else as it was; or change them yourself, or with `/
|
|
47
|
+
For a project that has a `config.turri.yaml` already, it sets those two and leaves everything else as it was; or change them yourself, or with `/settings harness-model claude-code/claude-opus-5-5:medium` in the chat.
|
|
48
48
|
|
|
49
49
|
Two settings of the extension's own, read from the environment: `PI_CLAUDE_CODE_COMMAND`, the Claude Code to run when it is not `claude` on the PATH, and `PI_CLAUDE_CODE_CONFIG_DIR`, a Claude Code configuration folder of its own - another account's sign-in, say.
|
|
50
50
|
|
|
@@ -103,7 +103,7 @@ Each step says what you should see; the first one that does not is where it stop
|
|
|
103
103
|
turri regenerate app.plain
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
The pulse's coding agent runs on `claude-code/claude-sonnet-5`, and the pulse lands as on any model. To watch it work, run it in [debug mode](config.md#debug-mode) (`--debug`): the pulse's log in `.turri/jobs/` names each agent's model and shows the tools it called. In the chat,
|
|
106
|
+
The pulse's coding agent runs on `claude-code/claude-sonnet-5`, and the pulse lands as on any model. To watch it work, run it in [debug mode](config.md#debug-mode) (`--debug`): the pulse's log in `.turri/jobs/` names each agent's model and shows the tools it called. In the chat, ask which model the code is regenerated on: the `settings` tool says, and where it is set.
|
|
107
107
|
|
|
108
108
|
## In turri-desktop
|
|
109
109
|
|