@turri-dev/cli 0.4.2-next.a6867e8 → 0.4.3-next.aea3ca1

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.
@@ -1,2 +1,5 @@
1
- /** pi's line on the way out that says how to resume the session, left out: turri leaves nothing behind but the command run. */
1
+ /**
2
+ * pi's lines on the way out that say how to resume the session - its label, then the command on a line of its own -
3
+ * left out: turri leaves nothing behind but the command run.
4
+ */
2
5
  export declare function withoutResumeLine(text: string): string;
@@ -1,4 +1,7 @@
1
- /** pi's line on the way out that says how to resume the session, left out: turri leaves nothing behind but the command run. */
1
+ /**
2
+ * pi's lines on the way out that say how to resume the session - its label, then the command on a line of its own -
3
+ * left out: turri leaves nothing behind but the command run.
4
+ */
2
5
  export function withoutResumeLine(text) {
3
- return text.replace(/^(?:\x1b\[[0-9;]*m)*To resume this session:.*\n?/m, "");
6
+ return text.replace(/^(?:\x1b\[[0-9;]*m)*To resume this session:(?:\x1b\[[0-9;]*m)*\n[^\n]*\n?/m, "");
4
7
  }
package/dist/sentinel.js CHANGED
@@ -219,7 +219,7 @@ export function sentinelPrompt(cwd, options = {}) {
219
219
  "You fix the project's tooling and nothing else. Your file tools read the whole project; write and edit reach only the",
220
220
  "testing scripts and config.turri.yaml - and in it only where the scripts are, and toolchains:. Your shell runs with",
221
221
  "the project read only; the files you try a launch with go in $TMPDIR - /tmp is outside what it may write. It sees no",
222
- "other process: ps and lsof do not run there - who_holds says what holds a port and whose it is. You never change ***plain - it is the person's intent, never yours to fix - and never steer,",
222
+ "other process: ps and lsof do not run there - who_holds says what holds a port and whose it is. You never change ***plain - it is the person's intent, never yours to fix - and never",
223
223
  "launch, or regenerate but by resume after a fix of yours. You install nothing on this machine and change none of",
224
224
  "its settings, nor the person's shell - under no circumstances: that is always the person's, said in a notice. You",
225
225
  "never ask the person questions - a notice is how you reach them.",
package/docs/chats.md CHANGED
@@ -15,7 +15,6 @@ The session's, shared by every chat:
15
15
 
16
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;
17
17
  - **the coding model** given with `--coding-model`, and `parallel-jobs`;
18
- - **steering** - what `steer` was told, every plan follows;
19
18
  - **conformance** chosen with `conform`, module by module;
20
19
  - **what launches started** - it runs until turri ends or `/halt launched <name>`, whatever chats are opened or closed - and the launch track;
21
20
  - **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.
package/docs/config.md CHANGED
@@ -202,6 +202,8 @@ A build needs a unit testing script - and, with conformance on, a conformance te
202
202
  2. the one `run_unittests*.sh` / `run_conformance_tests*.sh` in the project root;
203
203
  3. the one of each in `test_scripts/`.
204
204
 
205
+ Where modules have files of their own, a module with none - nor any module it requires - never takes a script one of those files names from 2 or 3: it is another module's, of another stack. It waits for one of its own instead, saying which file names which.
206
+
205
207
  The optional prepare script - `prepare-environment-script:`, else the one `prepare_environment*.sh` - is looked for the same way, and run on the build before the conformance testing script.
206
208
 
207
209
  A folder holding two of a kind is not guessed between: name the one to use. A script named inside `plain_modules/` is refused - agents write there, so it could be changed by the work it judges. The scripts are never linked from \*\*\*plain. What they are and how they run is in [regenerating the code](regenerating.md#the-testing-scripts).
@@ -12,7 +12,6 @@ Every path below is in the project. What the person writes:
12
12
  | --- | --- |
13
13
  | `config.turri.yaml`, `config.turri.<module>.yaml` | the project config, and a module's own, laid over it for that module and the modules built on it - see [the project config](config.md) |
14
14
  | `test_scripts/run_unittests_<lang>.sh`, `test_scripts/run_conformance_tests_<lang>.sh` | the testing scripts, the only judges of pass or fail - their static checks included, the formatter, linter and type checker - where `config.turri.yaml` names them, else in the project folder, else in `test_scripts/` - see [below](#the-testing-scripts) |
15
- | `AGENTS.md` | optional: a section whose heading names the queue steers how the work is cut - see [how the work is cut into jobs](#how-the-work-is-cut-into-jobs) |
16
15
 
17
16
  What a module is - each module's folder, its own git history:
18
17
 
@@ -172,7 +171,7 @@ Code accumulates up a `requires` chain: a module is built on a copy of the code
172
171
 
173
172
  A module already built from \*\*\*plain as it is gets nothing. A job that does not land is rolled back, and halts its codebase: nothing more runs there until \*\*\*plain changes or the module is asked for again. On the command line, `turri regenerate` runs until nothing more can start, one line as each job starts and ends, and exits 1 when any failed.
174
173
 
175
- The person halts a module's planned work too: `halt` (and `/halt`) given a planned row - `planned-<module>-2`, `planned-<module>-waiting` - or the module's name. A module's pulses are planned again from its \*\*\*plain at every look, so one planned pulse cannot be taken out alone: the module is halted - its running pulse stopped and rolled back, none of its planned pulses started, the modules built on it waiting for it - and what landed stays. A halt the person asked for holds through \*\*\*plain changes - the loop sees them without starting the module - until the module is asked for again (`regenerate`, `conform`). To build some of it later, or cut it differently, there is `steer`; to drop work, \*\*\*plain.
174
+ The person halts a module's planned work too: `halt` (and `/halt`) given a planned row - `planned-<module>-2`, `planned-<module>-waiting` - or the module's name. A module's pulses are planned again from its \*\*\*plain at every look, so one planned pulse cannot be taken out alone: the module is halted - its running pulse stopped and rolled back, none of its planned pulses started, the modules built on it waiting for it - and what landed stays. A halt the person asked for holds through \*\*\*plain changes - the loop sees them without starting the module - until the module is asked for again (`regenerate`, `conform`). To drop work, change \*\*\*plain.
176
175
 
177
176
  A module the loop looked after whose `.plain` file is gone is forgotten - no rows, nothing waited for - and a codebase left behind, or whose \*\*\*plain no longer parses, shows nothing planned: its plan, and what it waited for, were \*\*\*plain's before.
178
177
 
@@ -190,11 +189,11 @@ Changes to what is built - an item edited or taken out, a functional spec built
190
189
 
191
190
  Each planned job knows its cases - which functional specs it adds, changes (their text, or a concept they use) and takes out, or none: reqs and definitions only - and the loop says them, with each job's title, where the person looks (`drift`, `pulses`, and what `regenerate` returns).
192
191
 
193
- **Steering.** How you want the work cut and ordered - "build the batch worker's helpers with the worker", "models first" - goes to the grouping and placement agents with every plan, as a strong preference: it never overrides the limits and checks. It comes from three places, each labelled with where it came from: the conversation (`steer`, for the whole project or one module, for the session); the project's `AGENTS.md`, every section whose heading names the queue (`## Queue guidance`), read afresh with every plan; and whatever asks for the work - `regenerate` takes a `guidance` of its own, which the loop keeps with that module.
192
+ How the work is cut is the planner's alone: nobody tells it which functional specs go together or what goes first. To have work built differently, change \*\*\*plain.
194
193
 
195
- A plan is kept until \*\*\*plain, what it starts from or its steering changes. `steer` alone plans nothing: the next look does - a `regenerate`, a job ending, \*\*\*plain changing. Then the work not running yet is planned again to follow it, a running job going on as it is. Where a plan did not do as asked, it says so, and what `regenerate` returns lists it under "what the plan did not do as asked": each wish an agent did not follow, with why (both tools take a `notes` for that), a grouping or placement that did not hold, with what was wrong, and a group split for its size. The conversation tells the person that, rather than guessing.
194
+ A plan is kept until \*\*\*plain or what it starts from changes. Then the work not running yet is planned again, a running job going on as it is - or [steered](#when-plain-changes), when the change is inside what it regenerates. Where a plan fell back, it says so, and what `regenerate` returns lists it under "where the plan fell back": a grouping, placement or titling that was not given or did not hold, with what was wrong, and a group split for its size. The conversation tells the person that, rather than guessing.
196
195
 
197
- **Looking ahead.** What will run can be seen before it does, from the same plan: a look ahead (`WorkLoop.lookAhead` - the chat's `pulses` with a module's `plain_file`, and `turri regenerate --dry-run`) has the session's work loop plan the module as `regenerate` would - the same codebases, its config pinned, the steering and AGENTS.md's queue section given to the planner - and keep the plans, starting nothing. Its codebases are held for it, apart from a halt: none of their pulses starts when another pulse ends and the loop looks again, and the look ahead writes nothing - a pure rename is not made, the work planned from the code as it would leave it. A codebase whose chain has a pulse running goes on as it was, what follows that pulse planned; a module the person halted stays halted. `regenerate`, `conform` or `/regenerate` lifts the hold, and the first pulse of the kept plan starts as it is, no planner asked again - so the plan seen is the plan run. Until then the plan is kept only while it fits: \*\*\*plain, what it starts from or the steering changed, it is dropped, not made again - only a look ahead plans a held codebase - and the next look ahead or `regenerate` plans it anew. The planned rows say they wait for `regenerate`. A planned row's id (`pulses` with `planned-<module>-1`) gives the next pulse of its codebase's whole prompt, built from the kept plan - and never planned again for it; a later pulse's prompt depends on what the ones before it land, a conformance pulse's on the code once it is built, and a codebase with a pulse running shows none. `turri regenerate --dry-run` keeps its plan only while it runs: it prints the next pulse's prompt and exits, and the `turri regenerate` after it plans again.
196
+ **Looking ahead.** What will run can be seen before it does, from the same plan: a look ahead (`WorkLoop.lookAhead` - the chat's `pulses` with a module's `plain_file`, and `turri regenerate --dry-run`) has the session's work loop plan the module as `regenerate` would - the same codebases, its config pinned - and keep the plans, starting nothing. Its codebases are held for it, apart from a halt: none of their pulses starts when another pulse ends and the loop looks again, and the look ahead writes nothing - a pure rename is not made, the work planned from the code as it would leave it. A codebase whose chain has a pulse running goes on as it was, what follows that pulse planned; a module the person halted stays halted. `regenerate`, `conform` or `/regenerate` lifts the hold, and the first pulse of the kept plan starts as it is, no planner asked again - so the plan seen is the plan run. Until then the plan is kept only while it fits: \*\*\*plain or what it starts from changed, it is dropped, not made again - only a look ahead plans a held codebase - and the next look ahead or `regenerate` plans it anew. The planned rows say they wait for `regenerate`. A planned row's id (`pulses` with `planned-<module>-1`) gives the next pulse of its codebase's whole prompt, built from the kept plan - and never planned again for it; a later pulse's prompt depends on what the ones before it land, a conformance pulse's on the code once it is built, and a codebase with a pulse running shows none. `turri regenerate --dry-run` keeps its plan only while it runs: it prints the next pulse's prompt and exits, and the `turri regenerate` after it plans again.
198
197
 
199
198
  ### When \*\*\*plain changes
200
199
 
@@ -222,7 +221,7 @@ Whether something is done is never the agent's call, and never a command it chos
222
221
 
223
222
  Each is run by bash, its folders given as absolute paths - on Windows written with forward slashes (`C:/Users/...`), which Windows and Git Bash both take: GNU tar, and the other tools of Git Bash that read a backslash as an escape, would take the `\a` of `C:\Users\anton` for a bell.
224
223
 
225
- The `implement-unit-testing-script` and `implement-conformance-testing-script` skills write them, in the background on the coding model of the module they are for ([background skills](skills-and-gates.md)). While one is being written - in the background, or to its end in print mode - a module built with the config it is named in waits for it, whether it lacks that script or has one being written over (a pulse started meanwhile would run against the old one) - `waiting for its unit testing script, which is being written`, or its conformance testing script - rather than fail for want of it, and is looked at again once the run ends: built, once the script is there, and stopped for want of it as before, when the run wrote none (`src/regenerate/scripts-being-written.ts`). A script written for one module's config file holds only the modules built with that file. They are looked for at the project root - the folder that holds `plain_modules` - in this order:
224
+ The `implement-unit-testing-script` and `implement-conformance-testing-script` skills write them, in the background on the coding model of the module they are for ([background skills](skills-and-gates.md)). While one is being written - in the background, or to its end in print mode - a module built with the config it is named in waits for it, whether it lacks that script or has one being written over (a pulse started meanwhile would run against the old one) - `waiting for its unit testing script, which is being written`, or its conformance testing script - rather than fail for want of it, and is looked at again once the run ends: built, once the script is there, and stopped for want of it as before, when the run wrote none (`src/regenerate/scripts-being-written.ts`). A script written for one module's config file holds only the modules built with that file. Asked for while the same skill writes another module's, it waits its turn, and its modules wait with it from the moment it is asked for - never started in between with the other module's script. Where the modules have config files of their own, each its own stack's, a module with none - nor any module it requires - is never given a script one of those files names: that is another module's, of another stack. Without a script of its own it waits - `waiting for a unit testing script of its own`, with which file names which - and is looked at again when a script run ends or it is asked for again, rather than start a pulse that would stop for want of one, or run another stack's tests on its code. They are looked for at the project root - the folder that holds `plain_modules` - in this order:
226
225
 
227
226
  1. `config.turri.yaml` - with the module's own `config.turri.<module>.yaml` over it, or the one of a module it requires - naming them by path from the root:
228
227
 
@@ -234,7 +233,9 @@ The `implement-unit-testing-script` and `implement-conformance-testing-script` s
234
233
  2. the root itself: the one `run_unittests*.sh` and `run_conformance_tests*.sh` there;
235
234
  3. `test_scripts/`: the one of each there.
236
235
 
237
- The same `config.turri.yaml` holds the project's other defaults - `module`, `model`, `review` - for [unattended runs](headless.md). A folder holding two of a kind is not guessed between: name the one to use in `config.turri.yaml` - or in the module's own `config.turri.<module>.yaml`. A module with no file of its own, where others have one, says so when it stops: which files there are, and which script each names. The scripts are not linked from \*\*\*plain; a link to one is ignored.
236
+ In 2 and 3 a script another module's own config file names is not a candidate for a module with no file of its own.
237
+
238
+ The same `config.turri.yaml` holds the project's other defaults - `module`, `model`, `review` - for [unattended runs](headless.md). A folder holding two of a kind is not guessed between: name the one to use in `config.turri.yaml` - or in the module's own `config.turri.<module>.yaml`. A module with no file of its own, where others have one, says so while it waits: which files there are, and which script each names. The scripts are not linked from \*\*\*plain; a link to one is ignored.
238
239
 
239
240
  They are required: a build with no unit testing script, or with conformance on and no conformance testing script, stops before it starts and says which skill adds it.
240
241
 
package/docs/sandbox.md CHANGED
@@ -67,6 +67,8 @@ Before an agent's command runs, its text is checked (`src/regenerate/command-che
67
67
  - installs software outside the project: `sudo`, the system's package managers installing (`brew`, `apt`, `dnf`, `apk`, `pacman`, `choco`, `winget`, ...), toolchain managers installing (`nvm`, `sdk`, `rustup`, `pyenv`, `asdf`, ...), global installs (`npm -g`, `yarn global`, `pip --user`, `pipx`, `gem install`), a script downloaded and run (`curl ... | sh`), an installer (`.pkg`, `.msi`, `.dmg`, `.run`). The project's own dependencies - `npm install`, pip into its venv, `mvn`, `cargo`, `go mod` - are building the code, and pass;
68
68
  - kills what its pulse did not start: `pkill`, `killall`, `taskkill`, `fuser -k`, or `kill` aimed at a port or name lookup. `kill $!` and `kill %1` pass.
69
69
 
70
+ It reads the command as the shell reads its operators: a `>`, `<`, `|`, `&` or `;` inside quotes is text (`grep -rl "</content>" .` redirects nothing), and so is the body of a here-document fed to `cat` or `tee` under a quoted delimiter (`cat > src/App.tsx <<'EOF'`) - the text of a file being written, whose `../lib/logger` is an import, not a path. A body that runs - under an unquoted delimiter, where `$(...)` expands, or fed to a shell or an interpreter - and a `$(...)` in double quotes are checked as commands.
71
+
70
72
  On Windows, drive letters, backslashes and any case are read as Windows has them. It knowingly misses a path built at run time (`$(...)`, a variable, a script that reads one from a file): the OS sandbox and the audit are for those.
71
73
 
72
74
  ### The OS sandbox
@@ -39,7 +39,7 @@ A skill declares its steps with a `## Steps` section whose `###` headings are th
39
39
 
40
40
  `command-only: true` under `metadata:` keeps a skill from the model: it is started only by the person, with its slash command. None of turri's own is; turri registers the command for every such skill, the project's own too. Typed, the command puts what was typed in the chat as the person's message, and lets `cultivate` start the skill once - and so does an option starting with the command - a project's `/release-notes - for this release` - picked in the conversation's `ask_user` (`chosenCommand` in `src/skills.ts`). The answer tells the model to call `cultivate` for it at once, with the person's request word for word as its context (`startPicked`), so they never type the command after picking it; the run starting uses that up, so the model cannot start it again later on its own. Without either, `cultivate` refuses it and the model is told how the person starts it; the skill's line in `cultivate`'s list says so too.
41
41
 
42
- `background: true` under `metadata:` runs a skill in the background, in the chat and a host: `cultivate` starts it and returns at once, and the chat's turn goes on. Nothing shows while it runs - no progress, no spinner - and nobody is asked anything: it has no `ask_user`, a gate it cannot pass stands, and its agent is told to decide what is left open and say what it decided. Its end comes back to the chat it was started from once that chat is idle - its agent done, nothing typed - batched (`src/background-skills.ts`): a line drawn by turri when it did its work, naming the files it changed; a message that starts a turn when it stopped at a gate, failed, or changed no file, for the chat to tell the person and decide what next. One runs at a time a skill and project, whichever chat started it; quitting turri stops it. In pi's print, json and rpc modes, and from `turri cultivate`, it runs as any skill does, to its end. `model: coding` runs a skill on the coding model of the module it is for - `cultivate`'s `plainFile`: that module's own file's `coding-model` over the project's, and `--coding-model` over both - the model a code pulse of that module runs on; without it, a skill runs on the chat's model (`harness-model` from the command line). turri's two that write the testing scripts, `implement-unit-testing-script` and `implement-conformance-testing-script`, are its only ones that set either, and they set both.
42
+ `background: true` under `metadata:` runs a skill in the background, in the chat and a host: `cultivate` starts it and returns at once, and the chat's turn goes on. Nothing shows while it runs - no progress, no spinner - and nobody is asked anything: it has no `ask_user`, a gate it cannot pass stands, and its agent is told to decide what is left open and say what it decided. Its end comes back to the chat it was started from once that chat is idle - its agent done, nothing typed - batched (`src/background-skills.ts`): a line drawn by turri when it did its work, naming the files it changed; a message that starts a turn when it stopped at a gate, failed, or changed no file, for the chat to tell the person and decide what next. One runs at a time a skill and project, whichever chat started it: asked for again for the same module, nothing new starts; asked for another module - a frontend's testing script while the backend's is written - it waits its turn and starts once the run before it ends, and a testing script it is to write counts as being written from the moment it is asked for, so the modules that need it wait for it. Quitting turri stops it, and drops what waits. In pi's print, json and rpc modes, and from `turri cultivate`, it runs as any skill does, to its end. `model: coding` runs a skill on the coding model of the module it is for - `cultivate`'s `plainFile`: that module's own file's `coding-model` over the project's, and `--coding-model` over both - the model a code pulse of that module runs on; without it, a skill runs on the chat's model (`harness-model` from the command line). turri's two that write the testing scripts, `implement-unit-testing-script` and `implement-conformance-testing-script`, are its only ones that set either, and they set both.
43
43
 
44
44
  `questioning:` under `metadata:` names the steps the questioning level caps (`src/questioning.ts`) - `[stack, product]`, say. When there are any and someone to ask, the harness itself asks the first question of the first step: how many questions those steps may ask - light (3), medium (5), thorough (10) or best judgement - and tells the agent the answer beside each step's instructions, with how broad each question is to be: broad at light, a whole area at once, narrow at thorough, an edge case at a time. Every level covers the same ground, in less or more depth. In a capped step `ask_user` refuses a question past the cap; the step's closing confirmation, asked with `confirms_phase: true`, is never counted. `end_questions` ends the step's questions sooner - best judgement's only end. What the questions leave open, the agent decides itself and says what it chose. The level, and how many questions each step has asked, are kept in the run's `run.json`, so a resumed run keeps them. A step it does not name, or a run with nobody to ask, is not capped.
45
45
 
package/docs/using.md CHANGED
@@ -23,11 +23,10 @@ While a skill runs, a line above the input shows its phases, every one by name -
23
23
  | --- | --- |
24
24
  | `regenerate` | regenerate a module and its chain from \*\*\*plain as it is now - after any change to it, by any means: what is left to regenerate is planned into pulses of one to three functional specs, each with the definitions and reqs it uses, and a pulse regenerating what \*\*\*plain no longer wants is stopped. With functionalities named, those are regenerated though their \*\*\*plain did not change - their code taken out and built anew, planned into pulses as any change is; with `from_scratch`, the whole module, its code deleted first - `"chain"` for every module of its requires chain too, built again from the bottom - only when you ask, or agree |
25
25
  | `drift` | what is left to regenerate: how far the code and its conformance tests have drifted from \*\*\*plain, starting nothing |
26
- | `steer` | say how the work is planned - which functional specs go together, what first - for the project or one module, for the session; the next plan follows it, beside what AGENTS.md says under a heading naming the queue |
27
26
  | `conform` | write and run conformance tests for functional specs - now, or ahead of their code: every one tested in one conformance pulse, as far as a size guardrail lets (or one a functional spec, or a pulse each of groups you name - 1-3 and 4-6 - when you ask for that), started once every one named is regenerated. Refused while conformance tests are off: turning them on is yours, with `/conform`, and the chat tells you why it wants them |
28
27
  | `parse` | parse \*\*\*plain - its syntax and structure, never its code or tests - regenerating nothing - a module whose functional specs have scenarios but which has no test reqs, or no conformance testing script, passes with a warning naming the next step (see [the steps of adding tests](regenerating.md#the-steps-of-adding-tests)) |
29
28
  | `settings` | read the project's settings, or change one when you ask - "regenerate with gpt 5.5 from now on" sets `coding-model` - see [below](#choosing-a-model) and [changing it from the chat](config.md#changing-it-from-the-chat) |
30
- | `pulses` | pulses in every tense: this session's - finished, running and planned - and the last runs of earlier sessions (`runs` for more), or one of them - a finished one with what the [ledger](#the-ledger) recorded of it: its rounds, test runs, verdicts, healers and commits; one that did not land says why besides, from its transcript: its diagnosis, the stages that went wrong, the last failing test run, the last review, the tool calls that failed. With a module's `plain_file`, a look ahead: its work planned as `regenerate` plans it - the steering with it - and kept, nothing started, its pulses waiting for `regenerate`, `conform` or `/regenerate`, which runs that plan as it is unless the \*\*\*plain or the steering changed since. A planned row's id (`planned-<module>-1`) then gives its cases and - the next pulse of its codebase - the whole prompt its coding agent will get |
29
+ | `pulses` | pulses in every tense: this session's - finished, running and planned - and the last runs of earlier sessions (`runs` for more), or one of them - a finished one with what the [ledger](#the-ledger) recorded of it: its rounds, test runs, verdicts, healers and commits; one that did not land says why besides, from its transcript: its diagnosis, the stages that went wrong, the last failing test run, the last review, the tool calls that failed. With a module's `plain_file`, a look ahead: its work planned as `regenerate` plans it and kept, nothing started, its pulses waiting for `regenerate`, `conform` or `/regenerate`, which runs that plan as it is unless the \*\*\*plain changed since. A planned row's id (`planned-<module>-1`) then gives its cases and - the next pulse of its codebase - the whole prompt its coding agent will get |
31
30
  | `halt` | halt a pulse, a module's planned pulses, a launch, or what a launch started |
32
31
  | `doctor` | turri's self check, as `turri doctor` runs it: Node, bash, git, the OS sandbox, a model provider, and the project's toolchains and testing scripts - against the PATH turri's pulses run with, not the agent's shell's. The project's models are asked for a word only when you ask (a request a model); it changes nothing |
33
32
  | `cultivate` | run a gated skill, its steps and review gates enforced |
@@ -78,7 +77,7 @@ A regeneration takes minutes, so in the TUI every tool that regenerates starts t
78
77
  - `turri` runs [pi](https://pi.dev) in fullscreen mode, so the conversation stays where you scroll it while the pulses redraw (PgUp/PgDn, the wheel); `--tui-mode regular` goes back to the terminal's own scrollback.
79
78
  - **`/settings`** changes a setting of the project's `config.turri.yaml` - the models, review, conformance tests, any key - and says when it takes effect: now, at your next message, or at the next pulse; never only after a restart. It takes [pi](https://pi.dev)'s own `/settings` over, pi's menu the last entry of its list. See [changing it from the chat](config.md#changing-it-from-the-chat).
80
79
  - **`/sentinel`** says whether the [sentinel](sentinel.md) checks every pulse that finishes: `ask` - you are asked before it first opens in a session - `on`, or `off`; written to `config.turri.yaml`.
81
- - **`/regenerate [module | file.plain] [module:func-id ...] [from scratch [whole chain]] [how to cut the work]`** regenerates a module from its \*\*\*plain as it is now, as the `regenerate` tool does: what is left to regenerate is planned into pulses - one functional spec at a time, a few together or the whole module in one, as the planner judges - and the first starts. Words after the module are guidance for that plan (`/regenerate app models first`). A module's name typed with spaces for its underscores is that module - `/regenerate d365_function executor` is `d365_function_executor`. With no module named: the one `module:` in `config.turri.yaml` names, else the folder's top modules, to pick from. Asked for from scratch - `from scratch`, `start over`, `delete the module` - it starts at once, with nothing to confirm: it deletes the module's code and conformance tests in every codebase where they live, committed so `/lineage` keeps them, and regenerates the whole module from its \*\*\*plain, built though nothing in it changed: `/regenerate shorty from scratch`. The modules below it keep their code, and the module starts again from a copy of the code below it. Asked for its chain too - `/regenerate shorty from scratch, the whole chain` - the code of every module of its requires chain is deleted, the base's included, and the whole chain is regenerated from the bottom: what to do after modules were split, merged or moved, when the code below was laid out for modules that are no more. The chat's `regenerate` does the same with `from_scratch: "module"` or `"chain"`, when you ask for it; `turri regenerate --from-scratch` or `--from-scratch-chain` on the command line, not with `--dry-run`. Functional specs named after the module, each as `<module>:<func-id>` - `/regenerate shorty shorty:shorten shorty:expand` - are regenerated though their \*\*\*plain did not change, on the coding model: as `turri regenerate shorty.plain shorty:shorten shorty:expand` does, and the chat's `regenerate` with `funcIds`. A bare func-id is refused: the module is always named. Code built before functional specs had func-ids - its record numbers them - is never built on: the module's whole chain has to be regenerated from scratch, and the chat asks you first, as for a start over.
80
+ - **`/regenerate [module | file.plain] [module:func-id ...] [from scratch [whole chain]]`** regenerates a module from its \*\*\*plain as it is now, as the `regenerate` tool does: what is left to regenerate is planned into pulses - one functional spec at a time, a few together or the whole module in one, as the planner judges - and the first starts. No other words are taken: how the work is cut is the planner's. A module's name typed with spaces for its underscores is that module - `/regenerate d365_function executor` is `d365_function_executor`. With no module named: the one `module:` in `config.turri.yaml` names, else the folder's top modules, to pick from. Asked for from scratch - `from scratch`, `start over`, `delete the module` - it starts at once, with nothing to confirm: it deletes the module's code and conformance tests in every codebase where they live, committed so `/lineage` keeps them, and regenerates the whole module from its \*\*\*plain, built though nothing in it changed: `/regenerate shorty from scratch`. The modules below it keep their code, and the module starts again from a copy of the code below it. Asked for its chain too - `/regenerate shorty from scratch, the whole chain` - the code of every module of its requires chain is deleted, the base's included, and the whole chain is regenerated from the bottom: what to do after modules were split, merged or moved, when the code below was laid out for modules that are no more. The chat's `regenerate` does the same with `from_scratch: "module"` or `"chain"`, when you ask for it; `turri regenerate --from-scratch` or `--from-scratch-chain` on the command line, not with `--dry-run`. Functional specs named after the module, each as `<module>:<func-id>` - `/regenerate shorty shorty:shorten shorty:expand` - are regenerated though their \*\*\*plain did not change, on the coding model: as `turri regenerate shorty.plain shorty:shorten shorty:expand` does, and the chat's `regenerate` with `funcIds`. A bare func-id is refused: the module is always named. Code built before functional specs had func-ids - its record numbers them - is never built on: the module's whole chain has to be regenerated from scratch, and the chat asks you first, as for a start over.
82
81
  - **`/conform [module | file.plain] [module:func-id ...] [from scratch [whole chain]] [one by one]`** writes and runs a module's conformance tests now, as the `conform` tool does: those of the functional specs named, each as `<module>:<func-id>` - `/conform shorty shorty:shorten shorty:expand` - or, with none named, of every functional spec with scenarios. A functional spec named whose tests are written has them written again, deleted and written anew from its scenarios; `from scratch` takes out the tests folder where the module's code lives - the tip of its chain, never a module in the middle - its lineage keeping it, and writes the tests again from a copy of the tests of the module the tip requires; `from scratch, whole chain`, from nothing. None of it touches the code ([written again](regenerating.md#conformance-tests-in-the-work-loop)). They go in one pulse, as far as a size guardrail lets; `one by one` (or `separately`, `one at a time`) has a pulse a functional spec. No other words are taken: there is no plan to guide. The module is found as `/regenerate` finds it. Asking for them is asking for them on: with conformance tests off, `/conform` turns them on first - `conformance-tests: true`, written where the module's value comes from - and says so: the one way the chat's work has them turned on, as the `conform` tool is refused while they are off. What would start nothing is found from the \*\*\*plain before anything is said. A step of adding tests still to take - no test reqs, no conformance testing script, no scenarios - is not an error: it is what `/conform` needs first, told to turri alone, not shown to you, and turri takes it at once - the test reqs, the conformance testing script, the scenarios of the functional specs named, or of each one that needs them - without asking again: your `/conform` was the yes. Then it regenerates the module, and says what it is writing and why. What is yours to settle - a functional spec named that is not there - is shown to you, and turri tells you what would let it start, starting nothing. Its tests come before anything is built on it: a codebase built on the module is stopped and deleted, and regenerated from it once they pass. Tests written already for the scenarios as built are said to be, and nothing starts.
83
82
  - **`/halt <id>`** halts a pulse - a queued one never starts - **`/halt <module>`** (or a planned row's id) halts a module's planned pulses until you ask for it again, a \*\*\*plain change not starting it, and **`/halt launched <name>`** halts a server a launch started - **`/halt launched <module>`** the module's launch under way, the one waiting, and what it started; it lists them all when no id is given.
84
83
  - **What these commands show you, the chat knows.** What `/regenerate`, `/conform` and `/halt launched` tell you - \*\*\*plain that does not parse, the pulses planned, a server halted - stays in the chat under the command, and since a slash command runs outside the conversation, it is put in the conversation as well: say "fix it" next and turri knows what you are looking at. When `/conform` starts nothing, turri answers it at once - taking the steps of adding tests still to take, which you are not shown, and saying why for the rest. Once `/regenerate` or `/conform` has started pulses, turri says so in the chat too - what runs and what is planned, and that you need not wait for it - without starting anything more for it; a module already up to date gets the plan's answer alone. A halted pulse reaches it as every pulse's end does.
@@ -46,7 +46,7 @@ The other rules say what a spec means. This one says what turri does with a chan
46
46
 
47
47
  - A coding agent sees its prompt and its module's code - nothing else. It cannot read `.plain` files, this conversation, AGENTS.md or the person. It never sees a functional spec's scenarios: those are the conformance tests'
48
48
  - What the code needs to know has to be in the spec. A fact said only in the conversation, AGENTS.md or notes never reaches the code, and is lost at the next regeneration
49
- - Steering reaches the agents that plan the work - how it is cut and in what order - not what the code does. What the code does is changed in the spec
49
+ - How the work is cut into pulses, and in what order, is the planner's alone: nothing the person or the conversation says reaches it. What the code does is changed in the spec
50
50
  - A codebase that requires no module may start from a base folder (`base-folder:` in config.turri.yaml): an existing codebase, files to use - images, animations - or both, copied in once before its first pulse and up the chain with the code. The agents that change and review its code are told what came from it, and keep it unless a functional spec asks otherwise. Refer to what is in it in the spec - in words, or by a link into the folder, relative to the module's file as every link is - for the code to use it: a file it holds that no functional spec names is kept, never used. A change to the folder later reaches the code only when the module is regenerated from scratch
51
51
 
52
52
  ## How bad code is fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turri-dev/cli",
3
- "version": "0.4.2-next.a6867e8",
3
+ "version": "0.4.3-next.aea3ca1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -39,8 +39,8 @@
39
39
  "prepack": "npm run build"
40
40
  },
41
41
  "dependencies": {
42
- "@earendil-works/pi-coding-agent": "1.4.0",
43
- "@earendil-works/pi-tui": "1.4.0",
42
+ "@earendil-works/pi-coding-agent": "1.6.0",
43
+ "@earendil-works/pi-tui": "1.6.0",
44
44
  "@langchain/langgraph": "1.4.15",
45
45
  "gray-matter": "^4.0.3",
46
46
  "js-yaml": "^5.4.2",
@@ -1,34 +0,0 @@
1
- /**
2
- * How the person wants the queue planned - which functional specs go together, what goes first, how big a job is -
3
- * given to the planner's agents with every plan, as a strong preference.
4
- *
5
- * It comes from three places. The conversation sets it (`steer`), for the whole project or one module, and it
6
- * holds for the session. The project's AGENTS.md can say it once for good: a section whose heading names the queue
7
- * ("## Queue guidance") is read with every plan, so an edit to it holds from the next. And whatever queues work can
8
- * pass guidance for that work (a tool's `guidance`), which the queue keeps with it.
9
- */
10
- /** Everything the conversation's steering applies to: every module of the project. */
11
- export declare const EVERY_MODULE = "*";
12
- export interface SteeringStore {
13
- /** The steering for a scope - a module's name, or EVERY_MODULE - in the order it was given. */
14
- get(scope: string): string[];
15
- set(scope: string, texts: string[]): void;
16
- scopes(): string[];
17
- }
18
- export declare function createSteeringStore(): SteeringStore;
19
- /** A module's name as the steering names it: its spec file's name, without `.plain`. */
20
- export declare function moduleNameOf(plainFile: string): string;
21
- /**
22
- * What an AGENTS.md says of the queue: every section whose heading names it - "Queue", "Queue guidance", "How the
23
- * render queue is planned" - up to the next heading of its level or above. Empty when there is none.
24
- */
25
- export declare function queueSectionOf(markdown: string): string;
26
- /** The steering a plan of this spec's codebase follows - AGENTS.md's, then the conversation's for every module and for this one. */
27
- export declare function steeringFor(plainFile: string, cwd: string, store: SteeringStore): Steering[];
28
- /** How the person or the harness wants the queue planned: a strong preference, each with where it came from. */
29
- export interface Steering {
30
- source: string;
31
- text: string;
32
- }
33
- /** The steering, for an agent's task: each with where it came from, and how binding it is. */
34
- export declare function steeringBlock(steering: Steering[] | undefined): string[];
@@ -1,91 +0,0 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { basename, dirname, extname, join, resolve } from "node:path";
3
- import { projectDirOf } from "./paths.js";
4
- /**
5
- * How the person wants the queue planned - which functional specs go together, what goes first, how big a job is -
6
- * given to the planner's agents with every plan, as a strong preference.
7
- *
8
- * It comes from three places. The conversation sets it (`steer`), for the whole project or one module, and it
9
- * holds for the session. The project's AGENTS.md can say it once for good: a section whose heading names the queue
10
- * ("## Queue guidance") is read with every plan, so an edit to it holds from the next. And whatever queues work can
11
- * pass guidance for that work (a tool's `guidance`), which the queue keeps with it.
12
- */
13
- /** Everything the conversation's steering applies to: every module of the project. */
14
- export const EVERY_MODULE = "*";
15
- export function createSteeringStore() {
16
- const byScope = new Map();
17
- return {
18
- get: (scope) => [...(byScope.get(scope) ?? [])],
19
- set(scope, texts) {
20
- if (texts.length === 0)
21
- byScope.delete(scope);
22
- else
23
- byScope.set(scope, [...texts]);
24
- },
25
- scopes: () => [...byScope.keys()],
26
- };
27
- }
28
- /** A module's name as the steering names it: its spec file's name, without `.plain`. */
29
- export function moduleNameOf(plainFile) {
30
- return basename(plainFile, extname(plainFile));
31
- }
32
- /**
33
- * What an AGENTS.md says of the queue: every section whose heading names it - "Queue", "Queue guidance", "How the
34
- * render queue is planned" - up to the next heading of its level or above. Empty when there is none.
35
- */
36
- export function queueSectionOf(markdown) {
37
- const lines = markdown.split("\n");
38
- const out = [];
39
- let level = 0;
40
- for (const line of lines) {
41
- const heading = /^(#{1,6})\s+(.*)$/.exec(line);
42
- if (heading !== null) {
43
- const depth = heading[1].length;
44
- if (level > 0 && depth <= level)
45
- level = 0;
46
- if (level === 0 && /\bqueue/i.test(heading[2])) {
47
- level = depth;
48
- continue;
49
- }
50
- }
51
- if (level > 0)
52
- out.push(line);
53
- }
54
- return out.join("\n").trim();
55
- }
56
- /** The AGENTS.md files a spec's steering is read from: where turri runs, and the spec's project - once each. */
57
- function agentsFiles(plainFile, cwd) {
58
- const dirs = [resolve(cwd), projectDirOf(resolve(cwd, plainFile))];
59
- return [...new Set(dirs.map((dir) => join(dir, "AGENTS.md")))].filter((file) => existsSync(file));
60
- }
61
- /** The steering a plan of this spec's codebase follows - AGENTS.md's, then the conversation's for every module and for this one. */
62
- export function steeringFor(plainFile, cwd, store) {
63
- const fromFiles = agentsFiles(plainFile, cwd).flatMap((file) => {
64
- try {
65
- const text = queueSectionOf(readFileSync(file, "utf8"));
66
- return text === "" ? [] : [{ source: `AGENTS.md (${basename(dirname(file))})`, text }];
67
- }
68
- catch {
69
- return [];
70
- }
71
- });
72
- const module = moduleNameOf(plainFile);
73
- return [
74
- ...fromFiles,
75
- ...store.get(EVERY_MODULE).map((text) => ({ source: "the conversation", text })),
76
- ...store.get(module).map((text) => ({ source: `the conversation, for ${module}`, text })),
77
- ];
78
- }
79
- /** The steering, for an agent's task: each with where it came from, and how binding it is. */
80
- export function steeringBlock(steering) {
81
- if (steering === undefined || steering.length === 0)
82
- return [];
83
- return [
84
- "<how the queue is to be planned - the person's or the harness's wishes>",
85
- ...steering.map((entry) => `<from source="${entry.source}">\n${entry.text.trim()}\n</from>`),
86
- "</how the queue is to be planned>",
87
- "Follow these as a strong preference: they say how the person wants the work cut and ordered. They never override the",
88
- "limits and checks the plan is held to; where one would, keep to the limit, and say which and why in your answer's notes.",
89
- "",
90
- ];
91
- }