@turri-dev/cli 0.2.3 → 0.2.4-next.240620d
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 +2 -2
- package/dist/chat-idle.d.ts +2 -2
- package/dist/chat-idle.js +2 -2
- package/dist/chats.d.ts +0 -10
- package/dist/chats.js +0 -23
- package/dist/cli.js +2 -5
- package/dist/config-edit.js +1 -3
- package/dist/config.d.ts +6 -21
- package/dist/config.js +3 -16
- package/dist/conformance-switch.d.ts +7 -17
- package/dist/conformance-switch.js +21 -46
- package/dist/drift-cli.js +1 -1
- package/dist/extension.d.ts +2 -10
- package/dist/extension.js +109 -205
- package/dist/genome.js +5 -48
- package/dist/graph.js +3 -5
- package/dist/host-session.d.ts +4 -15
- package/dist/host-session.js +2 -4
- package/dist/host.d.ts +1 -3
- package/dist/host.js +1 -4
- package/dist/identity.js +0 -1
- package/dist/init-config.d.ts +0 -1
- package/dist/init-config.js +2 -9
- package/dist/installed-providers.d.ts +1 -1
- package/dist/installed-providers.js +1 -1
- package/dist/loop-cli.d.ts +4 -3
- package/dist/loop-cli.js +13 -11
- package/dist/loop-tools.js +5 -10
- package/dist/new-project.js +2 -2
- package/dist/pi-launch.js +1 -1
- package/dist/pi.js +6 -6
- package/dist/plain/check.d.ts +1 -8
- package/dist/plain/check.js +3 -38
- package/dist/regenerate/activity.d.ts +0 -7
- package/dist/regenerate/activity.js +2 -20
- package/dist/regenerate/failure-reports.d.ts +28 -0
- package/dist/regenerate/failure-reports.js +79 -0
- package/dist/regenerate/jobs-tree.js +1 -1
- package/dist/regenerate/jobs.d.ts +2 -0
- package/dist/regenerate/jobs.js +4 -0
- package/dist/regenerate/ledger-view.d.ts +11 -24
- package/dist/regenerate/ledger-view.js +14 -60
- package/dist/regenerate/ledger.d.ts +1 -14
- package/dist/regenerate/ledger.js +1 -1
- package/dist/regenerate/loop.d.ts +37 -60
- package/dist/regenerate/loop.js +165 -101
- package/dist/regenerate/regenerate.d.ts +0 -2
- package/dist/regenerate/regenerate.js +0 -14
- package/dist/regenerate/standing.js +1 -1
- package/dist/regenerate/testing-steps.d.ts +11 -0
- package/dist/regenerate/testing-steps.js +22 -3
- package/dist/regenerate-cli.js +18 -9
- package/dist/self-invocation.js +4 -7
- package/dist/sentinel.js +3 -3
- package/dist/skill.d.ts +0 -11
- package/dist/skill.js +0 -9
- package/dist/stacks.js +1 -1
- package/dist/tools.js +2 -3
- package/docs/README.md +0 -2
- package/docs/authoring-plain.md +3 -3
- package/docs/chats.md +1 -3
- package/docs/config.md +10 -12
- package/docs/deploy.md +1 -1
- package/docs/development.md +2 -3
- package/docs/headless.md +4 -3
- package/docs/hosting.md +6 -6
- package/docs/parser.md +2 -2
- package/docs/regenerating.md +12 -10
- package/docs/sentinel.md +3 -3
- package/docs/skills-and-gates.md +3 -8
- package/docs/using.md +10 -18
- package/genome/rules/test-plain-files.md +15 -7
- package/genome/rules/turri-regeneration.md +4 -9
- package/genome/skills/convert-old-syntax/SKILL.md +5 -5
- 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.d.ts +0 -1
- 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/test-advisor.d.ts +0 -101
- package/dist/regenerate/test-advisor.js +0 -379
- package/dist/spec-tools.d.ts +0 -36
- package/dist/spec-tools.js +0 -128
- package/docs/test-advisor.md +0 -110
package/dist/self-invocation.js
CHANGED
|
@@ -11,11 +11,9 @@
|
|
|
11
11
|
/** The tool that does what a turri subcommand does, from inside the conversation. */
|
|
12
12
|
const TOOL_FOR = {
|
|
13
13
|
regenerate: "regenerate",
|
|
14
|
-
glimpse: "glimpse",
|
|
15
14
|
conform: "conform",
|
|
16
15
|
cultivate: "cultivate",
|
|
17
16
|
release: "release",
|
|
18
|
-
"change-plain": "regenerate",
|
|
19
17
|
chat: "nothing - you are the conversation already",
|
|
20
18
|
ask: "nothing - you are the conversation already",
|
|
21
19
|
};
|
|
@@ -31,7 +29,6 @@ const NPM_SCRIPT = {
|
|
|
31
29
|
const ENTRY = {
|
|
32
30
|
"regenerate-cli": "regenerate",
|
|
33
31
|
"conform-cli": "conform",
|
|
34
|
-
"change-plain-cli": "change-plain",
|
|
35
32
|
"cultivate-cli": "cultivate",
|
|
36
33
|
"release-cli": "release",
|
|
37
34
|
};
|
|
@@ -43,10 +40,10 @@ const AT_COMMAND = String.raw `(?:^|[\s;&|()\x60$])`;
|
|
|
43
40
|
* agent - and neither are setup and doctor.
|
|
44
41
|
*/
|
|
45
42
|
export function selfInvocation(command) {
|
|
46
|
-
const cli = new RegExp(`${AT_COMMAND}(?:npx\\s+)?turri\\s+(regenerate|
|
|
43
|
+
const cli = new RegExp(`${AT_COMMAND}(?:npx\\s+)?turri\\s+(regenerate|conform|cultivate|release)\\b`).exec(command);
|
|
47
44
|
if (cli)
|
|
48
45
|
return cli[1];
|
|
49
|
-
const launcher = new RegExp(`(?:bin/turri\\.mjs|src/cli\\.ts)\\s+(regenerate|
|
|
46
|
+
const launcher = new RegExp(`(?:bin/turri\\.mjs|src/cli\\.ts)\\s+(regenerate|conform|cultivate|release)\\b`).exec(command);
|
|
50
47
|
if (launcher)
|
|
51
48
|
return launcher[1];
|
|
52
49
|
// turri alone, or with options, is the conversation - where a command starts, not a word an argument names (`which turri`).
|
|
@@ -83,7 +80,7 @@ const PI_CONFIGURES = new Set([
|
|
|
83
80
|
export function askedForCommandLine(message) {
|
|
84
81
|
const text = message.toLowerCase();
|
|
85
82
|
return (/\b(headless|command[ -]line|cli|terminal|shell|in bash|via bash|through bash|npm run|nohup)\b/.test(text) ||
|
|
86
|
-
/\bturri\s+(regenerate|
|
|
83
|
+
/\bturri\s+(regenerate|conform|cultivate|release)\b/.test(text) ||
|
|
87
84
|
/(^|\s)turri\s+-p\b/.test(text) ||
|
|
88
85
|
/(^|\s)pi\s+-p\b/.test(text));
|
|
89
86
|
}
|
|
@@ -102,7 +99,7 @@ export const TOOLS_NOT_CLI = [
|
|
|
102
99
|
"<turri-tools>",
|
|
103
100
|
"In this conversation, you do your work with your tools - regenerate, conform, cultivate and the rest - which run as",
|
|
104
101
|
"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,
|
|
102
|
+
"run your own command line (turri regenerate, conform, cultivate, release, turri itself; npm run",
|
|
106
103
|
"regenerate and the like) or start another pi through bash:",
|
|
107
104
|
"that is a separate headless run the user cannot see or stop. Only when the user explicitly asks for the",
|
|
108
105
|
"command line, run it. Configuring pi itself - turri install, update, remove, list; pi install, update, list, config, auth; or its settings files -",
|
package/dist/sentinel.js
CHANGED
|
@@ -178,8 +178,8 @@ 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,
|
|
182
|
-
"
|
|
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
185
|
" it should do: that it came up, answers, and does what its ***plain diff says it now does.",
|
|
@@ -316,7 +316,7 @@ export function sentinelCheckBrief(check, context) {
|
|
|
316
316
|
* The tools the sentinel's agent may call: what reads, write and edit for the project's tooling alone, resume, its
|
|
317
317
|
* notices and its guidance - and what a host gives it.
|
|
318
318
|
*/
|
|
319
|
-
export const SENTINEL_TOOLS = ["read", "ls", "grep", "find", "write", "edit", "bash", "read_output", "
|
|
319
|
+
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
320
|
/** A testing script by its name - `run_unittests_python.sh`, `prepare_environment_node.sh` - and a config file of turri's. */
|
|
321
321
|
const SCRIPT_FILE = /^(run_|prepare_environment).*\.(sh|ps1|bat|cmd)$/;
|
|
322
322
|
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
|
|
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
|
|
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/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` |
|
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
|
@@ -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
|
|
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
|
@@ -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
|
|
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
|
-
| `
|
|
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
|
|
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
|
|
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` -
|
|
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 `
|
|
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
|
|
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`, `
|
|
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.
|
|
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
|
|
48
|
+
`turri regenerate` and `conform` end a build that landed with `To try it: turri release <spec>`.
|
package/docs/development.md
CHANGED
|
@@ -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/
|
|
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
|
package/docs/headless.md
CHANGED
|
@@ -51,7 +51,7 @@ coding-model: # the model every agent runs on, and h
|
|
|
51
51
|
judge-model: anthropic/claude-opus-5-5 # the judge and the test review (default: coding-model)
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
The same file names the [testing scripts](regenerating.md#the-testing-scripts); every key is in [the project config](config.md). `turri regenerate
|
|
54
|
+
The same file names the [testing scripts](regenerating.md#the-testing-scripts); every key is in [the project config](config.md). `turri regenerate` and `conform` take four of its keys on the command line too - `--harness-model`, `--coding-model` (`--model` is the same), `--judge-model` and `--review`. Each is read as if the file had it, in its place: it takes that key's value, and every key keeps its place in the order the config resolves them in - a `models:` entry still wins over `harness-model`, `coding-model` or `judge-model`, the planner runs on the harness model, the judge falls back on the coding model. So a run with the options is the same as one, or a chat, with those keys in `config.turri.yaml` - and a `config.yaml` the project has is left as it is. A project whose parts are on different stacks keeps each stack's settings in `config.turri.<stack>.yaml` beside it ([stacks](config.md#stacks)). Choose the one to build with `--stack <name>` - on any command: `regenerate`, `conform`, `release`, `cultivate` - or `TURRI_STACK`: `turri regenerate backend.plain --stack backend`. With none chosen, `config.turri.yaml` alone is used; a stack the project has no file for is refused.
|
|
55
55
|
|
|
56
56
|
Useful options - `turri regenerate --help` lists all of them:
|
|
57
57
|
|
|
@@ -82,7 +82,8 @@ The command exits `0` only when every module is complete: its code regenerated f
|
|
|
82
82
|
| `plain_modules/<module>/code/` | the code and unit tests |
|
|
83
83
|
| `plain_modules/<module>/tests/` | the conformance tests |
|
|
84
84
|
| `plain_modules/<module>/code/.turri.json` | the marshalled plain tree the code is built from |
|
|
85
|
-
| `.turri/ledger/` | what each pulse did, how it ended and what it cost - `
|
|
85
|
+
| `.turri/ledger/` | what each pulse did, how it ended and what it cost - `pulses` in the chat reads it back |
|
|
86
|
+
| `.turri/pulses/` | why each pulse that failed or finished without landing did - its diagnosis, the last failing test run's output, the last review, the tool calls that failed - kept whatever the debug setting |
|
|
86
87
|
| `.turri/jobs/` | each pulse's log: its agents, its test runs, how it ended - with `--debug` (or `debug: true`) only |
|
|
87
88
|
| `.turri/debug/` | each agent's whole conversation - with `--debug` only |
|
|
88
89
|
|
|
@@ -170,7 +171,7 @@ A module that `requires` others is built in its own codebase on top of theirs: t
|
|
|
170
171
|
|
|
171
172
|
**Pulses.** `landed`: its work is committed. `rolled_back`: it ended without landing - failed, stopped, or did not pass - and everything it wrote was undone. A pulse that failed is tried once more before it counts as failed; both tries are the one pulse.
|
|
172
173
|
|
|
173
|
-
**Time to first regeneration.** `pulses.first_started_seconds` is how long after the run started its first code pulse started - planning the work, and any wait for a free slot, before it - and `first_landed_seconds` how long until the first one landed, when there is first something to try. Both are `null` until it happens.
|
|
174
|
+
**Time to first regeneration.** `pulses.first_started_seconds` is how long after the run started its first code pulse started - planning the work, and any wait for a free slot, before it - and `first_landed_seconds` how long until the first one landed, when there is first something to try. Both are `null` until it happens.
|
|
174
175
|
|
|
175
176
|
**Gaps in \*\*\*plain.** A behaviour \*\*\*plain leaves open that an agent met and decided on its own - reported with `report_spec_gap` (see [regenerating](regenerating.md)). In the chat they are put to you as the pulse ends; a headless run has no one to ask, so they are listed here, in the order the pulses started, and printed under the pulse that met them. `assumption` is what the agent decided meanwhile, also in the codebase's notes' assumptions while its pulse is `landed`; a pulse rolled back takes it out of the notes, but the question still stands. Settle the ones you care about in \*\*\*plain and run again.
|
|
176
177
|
|
package/docs/hosting.md
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
| `stdlibTemplates()`, `isStack`, `STDLIB_KINDS` | turri's standard library: every template with its kind, file, text, imports and its conformance template or the stack it tests, and the kinds in order with their titles. |
|
|
30
30
|
| `projectStanding(projectDir, { loop?, files? })`, `ModuleStanding` | how every module of a project stands, in one call - see [how a project stands](#how-a-project-stands). |
|
|
31
31
|
| `requiresOrder(projectDir, { files? })` | a project's .plain files, absolute, in the order they are built: each after every module it requires, as its requires chain (`resolveRequiresChain`) has them - the files taken in the order given, by name without `files`, each brought in after what it requires. A module whose chain does not resolve - it does not parse, a module it requires is not there, a cycle - goes after what its front matter says it requires, as far as those are found; none is left out. Only the files given are in it: `files`, absolute or from the project, else every .plain file in the project's folder. |
|
|
32
|
-
| `functionalityCompletion`, `createWorkLoop`, `createJobRegistry`, `
|
|
32
|
+
| `functionalityCompletion`, `createWorkLoop`, `createJobRegistry`, `describeModules`, `PlannedPulse` | how far each functional spec is built - each module's `specified`, `withScenarios` (those tested, which tested-of-specified counts over), `completed`, `conformanceTested`, `tested` and `incomplete` - and the work a \*\*\*plain change would plan, before it runs: the session's `turri.loop` `lookAhead(plainFile)` plans a module as regenerate would and starts nothing, and `plannedPulse(rowId)` gives a planned row's cases and - the next pulse of its codebase - its coding agent's whole prompt (`PlannedPulse`), from the plan regenerate then runs ([looking ahead](regenerating.md#a-whole-module)). |
|
|
33
33
|
| `onModelEvent`, `describeTurnIncident` | a provider failing and waited out, a turn turri ended itself. |
|
|
34
34
|
| `onLedgerEvent`, `readLedger`, `ledgerDir`, `runViews`, `pulseView`, `describePulseView`, `describeRuns`, `ledgerProjects`, `earlierPulses`, `asJob` | what turri did, as facts - the [ledger](using.md#the-ledger): each event heard as it is recorded, and every run and pulse read back, earlier sessions' too - see [the ledger in a host](#the-ledger-in-a-host). |
|
|
35
35
|
| `doctor({ dir, models, env })`, `Check`, `Level` | whether the machine - and, with `dir`, that project - is ready for turri, as `turri doctor` checks it: a list of checks to show in the host's own way - see [doctor in a host](#doctor-in-a-host). |
|
|
@@ -70,7 +70,7 @@ for (const { plainFile, module, drift, driftError, completion, completionError }
|
|
|
70
70
|
|
|
71
71
|
`projectStanding` gives each module of the project what `drift` and `functionalityCompletion` give it asked alone - `drift`, every codebase of its requires chain with what is left to regenerate there, and `completion`, its chain's functional specs completed and conformance tested - in one call. Asked module by module, each call parses and reads the whole chain below the module again: on a project of a dozen modules in one chain, seconds. Asked of the project, each file is parsed once and each codebase's record read once, the modules below shared by every chain they are in.
|
|
72
72
|
|
|
73
|
-
- `loop` is the work loop whose `drift` is read - the session's `turri.loop`, which knows the pulses running and the codebases halted. Without one, a loop of its own
|
|
73
|
+
- `loop` is the work loop whose `drift` is read - the session's `turri.loop`, which knows the pulses running and the codebases halted. Without one, a loop of its own, asked nothing, reads the codebases as their records have them - drift plans and starts nothing.
|
|
74
74
|
- `files` are the .plain files to look at, absolute or from the project. Without them, every .plain file in the project's folder.
|
|
75
75
|
- A module drift or completion cannot say - one that does not parse, a module it requires not there - has `driftError` or `completionError`, the message, in place of the answer; the others are answered all the same.
|
|
76
76
|
|
|
@@ -155,9 +155,9 @@ await turri.dispose(); // every chat let go, what activate start
|
|
|
155
155
|
- **The system prompt.** `systemPrompt(prompt)` gets the whole system prompt for the turn - [pi](https://pi.dev)'s, turri's identity and blocks, the rules - after turri's own `before_agent_start` work, and returns what is sent. It is for what `surface` does not cover; to describe the UI, use `surface`, rather than words appended after turri's that contradict them.
|
|
156
156
|
- **The mode.** Each chat is bound in [pi](https://pi.dev)'s `tui` mode: the work runs in the background and keeps the chat free, as the terminal does. Its other UI calls - its notices, its working line, a confirm - come to `uiContext(chat)`, as [pi](https://pi.dev)'s [SDK](https://github.com/earendil-works/pi) describes it.
|
|
157
157
|
|
|
158
|
-
###
|
|
158
|
+
### Conformance tests
|
|
159
159
|
|
|
160
|
-
Conformance tests
|
|
160
|
+
Conformance tests are on only with `conformance-tests: true` ([config](config.md#conformance-tests)) - off when unset: then no conformance pulse runs, and the chats' `conform` is refused - turning them on is the person's decision; `conformance-tests` is one of `configSettings()`, and `settingChoices("conformance-tests")` gives `true` and `false`. To turn them on from the host's own button, the session's `turnOnConformanceTests(plainFile?)` does what `/conform` does before it tests, with no model call: it writes `conformance-tests: true` where the module's value comes from - its stack's `config.turri.<stack>.yaml` when that sets the key, which `/turri-config` alone would not change, else `config.turri.yaml` - the chats' `conform` no longer refused, and returns the file it wrote, from the project. `plainFile`, absolute or from the project, picks the module; omitted, the project's. It starts no conformance pulse: the host offers that itself, with `/conform`. With them on, the chats write scenarios for a functional spec they judge needs them, as a \*\*\*plain change like any other - its test plain file, `<test-dir>/<module>/<func-id>.plain` - which the work loop then tests.
|
|
161
161
|
|
|
162
162
|
A host's chats run the [background skills](skills-and-gates.md) in the background, as the terminal's do - the two that write the testing scripts: `cultivate` returns at once, and nothing of the run shows while it runs. Its result's `details` say what it started: `{ background: true, kind?, plainFile? }` - `kind` the testing script it writes, `unit` or `conformance`, and `plainFile` the module it is for, relative to the project, each left out when there is none; `started: false` too when the skill was running already and nothing new was started - enough to show "writing the unit testing script for hello.plain, in the background" with no table of which skill writes which. Its end goes to the chat that started it, once that chat is idle: a run that did its work as an entry of its session, `turri_skill_run` (`data.text`, the line - `Unit testing script written: test_scripts/run_unittests_python.sh.`), that starts no turn; one that did not as a hidden message to its agent, `customType: "turri_skill_run"` (`details.skills`), that starts a turn in which the chat tells the person what went wrong, its `details` `{ skills, runs }` - `runs` one `{ skill, kind?, plainFile? }` for each run in it, for a turn marked "unit testing script not written · hello.plain". Meanwhile a module that lacks the script waits for it, its `why` in `mapPlan()` and `status()` `waiting for its unit testing script, which is being written` - or its conformance testing script - and starts by itself once it is written. `onPlanChange` fires as it starts waiting and as it stops - the script written, or the run ended without it - as it does whenever a module's `why` changes.
|
|
163
163
|
|
|
@@ -224,7 +224,7 @@ concepts.find((concept) => concept.definition === "/…/base.plain:8");
|
|
|
224
224
|
|
|
225
225
|
## The ledger in a host
|
|
226
226
|
|
|
227
|
-
`createTurri` starts the ledger itself, in the process's working folder - the project's - so a host needs nothing to have one: its pulses are recorded as `host` runs, each event with the chat its work was asked for in, and the chats' `pulses`
|
|
227
|
+
`createTurri` starts the ledger itself, in the process's working folder - the project's - so a host needs nothing to have one: its pulses are recorded as `host` runs, each event with the chat its work was asked for in, and the chats' `pulses` already tells the model of earlier sessions' pulses. What the host can do with it is show it.
|
|
228
228
|
|
|
229
229
|
```js
|
|
230
230
|
import { onLedgerEvent, pulseView, readLedger, runViews } from "@turri-dev/cli/host";
|
|
@@ -246,7 +246,7 @@ const { jobs, more } = earlierPulses(ledgerProjects(projectDir), new Set(turri.j
|
|
|
246
246
|
```
|
|
247
247
|
|
|
248
248
|
- **Live.** `onLedgerEvent(listener)` is told every event as turri records it, with the project it is about, until what it returns is called; a listener that throws misses that event and nothing else. It is the pulse's own detail - its stages, test runs, verdicts, refusals - where `onJobChange` is the job as a whole.
|
|
249
|
-
- **Read back.** `readLedger(project, { job, run, kinds, since })` is the project's events, oldest first, the gzipped runs too; `runViews` and `pulseView` gather them into runs and pulses, and `describePulseView` and `describeRuns` say them in lines, as
|
|
249
|
+
- **Read back.** `readLedger(project, { job, run, kinds, since })` is the project's events, oldest first, the gzipped runs too; `runViews` and `pulseView` gather them into runs and pulses, and `describePulseView` and `describeRuns` say them in lines, as the chat's `pulses` tells them. `ledgerProjects(dir)` finds the ledgers of a folder and the projects under it. `earlierPulses(projects, known, runs = 3)` gives the last runs before this one as `Job`s - the shape a host already draws for this session's - each marked `earlier: { run, runMode, lines }`, `lines` what the ledger says of it, and with its `cases`, `diff` and `diffWhere` - the \*\*\*plain diff it regenerated, as last steered, and where its lines are written - as a pulse of this session has them (a pulse recorded before `job.diff` was has none); `more` is how many runs are beyond them. They are read only: never started, halted or waited for. turri's own side panel lists them so, as **earlier sessions**.
|
|
250
250
|
- **What it is for.** Looking up, never deciding: what is built and what is left come from the records and the work loop, as before. Its events and their fields are `LedgerEvent`'s - a kind is added, never changed, and every event carries `v: 1`.
|
|
251
251
|
|
|
252
252
|
## Running it
|
package/docs/parser.md
CHANGED
|
@@ -86,9 +86,9 @@ FAIL tests/ 2 test plain files outside a module's folder
|
|
|
86
86
|
tests/todos/x.plain - no module todos; module: todo is in tests/todo/
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
A test plain file, or a test folder, is never taken for a module: `parse` - and `regenerate`, `conform`, `
|
|
89
|
+
A test plain file, or a test folder, is never taken for a module: `parse` - and `regenerate`, `conform`, `pulses`, `drift`, `release`, `/regenerate` and the commands - refuse one, naming its module (`\`tests/todo/add-task.plain\` is a test plain file of \`todo\`; name \`todo.plain\`, or \`todo:add-task\` for that one functional spec`).
|
|
90
90
|
|
|
91
|
-
The exit code is 0 only when every file passed. In a conversation the same check is `parse`; `
|
|
91
|
+
The exit code is 0 only when every file passed. In a conversation the same check is `parse`; `regenerate` runs it on the module it is given, and regenerates nothing from one that does not pass.
|
|
92
92
|
|
|
93
93
|
## Two rules of inheritance
|
|
94
94
|
|