@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.
Files changed (92) hide show
  1. package/README.md +2 -2
  2. package/dist/chat-idle.d.ts +2 -2
  3. package/dist/chat-idle.js +2 -2
  4. package/dist/chats.d.ts +0 -10
  5. package/dist/chats.js +0 -23
  6. package/dist/cli.js +2 -5
  7. package/dist/config-edit.js +1 -3
  8. package/dist/config.d.ts +6 -21
  9. package/dist/config.js +3 -16
  10. package/dist/conformance-switch.d.ts +7 -17
  11. package/dist/conformance-switch.js +21 -46
  12. package/dist/drift-cli.js +1 -1
  13. package/dist/extension.d.ts +2 -10
  14. package/dist/extension.js +109 -205
  15. package/dist/genome.js +5 -48
  16. package/dist/graph.js +3 -5
  17. package/dist/host-session.d.ts +4 -15
  18. package/dist/host-session.js +2 -4
  19. package/dist/host.d.ts +1 -3
  20. package/dist/host.js +1 -4
  21. package/dist/identity.js +0 -1
  22. package/dist/init-config.d.ts +0 -1
  23. package/dist/init-config.js +2 -9
  24. package/dist/installed-providers.d.ts +1 -1
  25. package/dist/installed-providers.js +1 -1
  26. package/dist/loop-cli.d.ts +4 -3
  27. package/dist/loop-cli.js +13 -11
  28. package/dist/loop-tools.js +5 -10
  29. package/dist/new-project.js +2 -2
  30. package/dist/pi-launch.js +1 -1
  31. package/dist/pi.js +6 -6
  32. package/dist/plain/check.d.ts +1 -8
  33. package/dist/plain/check.js +3 -38
  34. package/dist/regenerate/activity.d.ts +0 -7
  35. package/dist/regenerate/activity.js +2 -20
  36. package/dist/regenerate/failure-reports.d.ts +28 -0
  37. package/dist/regenerate/failure-reports.js +79 -0
  38. package/dist/regenerate/jobs-tree.js +1 -1
  39. package/dist/regenerate/jobs.d.ts +2 -0
  40. package/dist/regenerate/jobs.js +4 -0
  41. package/dist/regenerate/ledger-view.d.ts +11 -24
  42. package/dist/regenerate/ledger-view.js +14 -60
  43. package/dist/regenerate/ledger.d.ts +1 -14
  44. package/dist/regenerate/ledger.js +1 -1
  45. package/dist/regenerate/loop.d.ts +37 -60
  46. package/dist/regenerate/loop.js +165 -101
  47. package/dist/regenerate/regenerate.d.ts +0 -2
  48. package/dist/regenerate/regenerate.js +0 -14
  49. package/dist/regenerate/standing.js +1 -1
  50. package/dist/regenerate/testing-steps.d.ts +11 -0
  51. package/dist/regenerate/testing-steps.js +22 -3
  52. package/dist/regenerate-cli.js +18 -9
  53. package/dist/self-invocation.js +4 -7
  54. package/dist/sentinel.js +3 -3
  55. package/dist/skill.d.ts +0 -11
  56. package/dist/skill.js +0 -9
  57. package/dist/stacks.js +1 -1
  58. package/dist/tools.js +2 -3
  59. package/docs/README.md +0 -2
  60. package/docs/authoring-plain.md +3 -3
  61. package/docs/chats.md +1 -3
  62. package/docs/config.md +10 -12
  63. package/docs/deploy.md +1 -1
  64. package/docs/development.md +2 -3
  65. package/docs/headless.md +4 -3
  66. package/docs/hosting.md +6 -6
  67. package/docs/parser.md +2 -2
  68. package/docs/regenerating.md +12 -10
  69. package/docs/sentinel.md +3 -3
  70. package/docs/skills-and-gates.md +3 -8
  71. package/docs/using.md +10 -18
  72. package/genome/rules/test-plain-files.md +15 -7
  73. package/genome/rules/turri-regeneration.md +4 -9
  74. package/genome/skills/convert-old-syntax/SKILL.md +5 -5
  75. package/package.json +1 -1
  76. package/dist/advisor-chat.d.ts +0 -63
  77. package/dist/advisor-chat.js +0 -290
  78. package/dist/change-plain-cli.d.ts +0 -1
  79. package/dist/change-plain-cli.js +0 -55
  80. package/dist/ledger-cli.d.ts +0 -1
  81. package/dist/ledger-cli.js +0 -50
  82. package/dist/ledger-tools.d.ts +0 -10
  83. package/dist/ledger-tools.js +0 -64
  84. package/dist/regenerate/advisor-records.d.ts +0 -93
  85. package/dist/regenerate/advisor-records.js +0 -110
  86. package/dist/regenerate/advisor-runs.d.ts +0 -87
  87. package/dist/regenerate/advisor-runs.js +0 -327
  88. package/dist/regenerate/test-advisor.d.ts +0 -101
  89. package/dist/regenerate/test-advisor.js +0 -379
  90. package/dist/spec-tools.d.ts +0 -36
  91. package/dist/spec-tools.js +0 -128
  92. package/docs/test-advisor.md +0 -110
@@ -59,10 +59,10 @@ A codebase that requires no other module starts empty - unless `base-folder:` in
59
59
 
60
60
  ## One job
61
61
 
62
- Every piece of work on the code is a job of the work loop (see [a whole module](#a-whole-module)) - in the chat, a **pulse** - the side panel's **regen** is \*\*\*plain with how much of it the code has been regenerated from (`spec-map.ts`), and its pulses every one of them - while the code and this page call it a job: a \*\*\*plain diff that takes the code from the \*\*\*plain description it is built from to the \*\*\*plain description the job ends on. To see what the first jobs would be told:
62
+ Every piece of work on the code is a job of the work loop (see [a whole module](#a-whole-module)) - in the chat, a **pulse** - the side panel's **regen** is \*\*\*plain with how much of it the code has been regenerated from (`spec-map.ts`), and its pulses every one of them - while the code and this page call it a job: a \*\*\*plain diff that takes the code from the \*\*\*plain description it is built from to the \*\*\*plain description the job ends on. To see what the next jobs will be told before they run, look ahead (see [a whole module](#a-whole-module)) - in the chat, `pulses` with the module's `plain_file`, then with the planned row's id; on the command line:
63
63
 
64
64
  ```bash
65
- turri regenerate <file.plain> --dry-run # plan the work, print each codebase's first prompt, start nothing
65
+ turri regenerate <file.plain> --dry-run # plan the work as regenerate would, print each codebase's next prompt, start nothing
66
66
  ```
67
67
 
68
68
  ### What the agent is given
@@ -172,7 +172,7 @@ Code accumulates up a `requires` chain: a module is built on a copy of the code
172
172
 
173
173
  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
174
 
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 - `change_plain` brings \*\*\*plain in 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.
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.
176
176
 
177
177
  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
178
 
@@ -190,17 +190,19 @@ Changes to what is built - an item edited or taken out, a functional spec built
190
190
 
191
191
  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
192
 
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` and `change_plain` take a `guidance` of their own, which the loop keeps with that module.
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.
194
194
 
195
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.
196
196
 
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 stack 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.
198
+
197
199
  ### When \*\*\*plain changes
198
200
 
199
201
  A \*\*\*plain change is a notice, not a diff to run: **`regenerate`**, called after \*\*\*plain was edited by any means - the file tools, a skill, you in an editor - has the loop work out the work again. A job running goes on while every change it makes is still part of the work, measured from the same record; one that is making something \*\*\*plain no longer wants is stopped, rolled back, and the work planned again - a fixed rule, no agent. Say a module of 50 functionalities is regenerating and \*\*\*plain changes while `app:export-csv` builds: it goes on if the change leaves it as it is, and the work after it is planned again from what it lands. A job stopped so says it was turri, not you, and what changed under it - the functional spec that reads otherwise now, or the file it links that holds something else (`whyNotWanted`).
200
202
 
201
203
  **A change inside what the running job regenerates steers it** (`steering.ts`), before any of that: a functional spec it regenerates reworded or given a sub-bullet, a definition or an implementation req it is given edited, a file one of them links edited - a change to an item it already has, never an item added or removed. Its coding agent is told, in the same shape as its first change (`describeSpecChange`): in its turn when it is in one, else as its next turn once the step it is at ends - a test run, a review - even when the tests passed or the review approved; edits made before it is told are one steer, the newest of each item. The unit tests run again after it, and a review still to come sees the change as steered, within its two reviews. The job's target moves with it: it lands built from \*\*\*plain as it was steered to. A definition or req that functional specs built before the job use too is told to the agent but kept out of the record, so those functional specs - and this job's with them - are patched by the next job. What else changed is the next job's; a change that is partly a steer is split. Two steers a job: a third goes the way above, stopped or - with `allow-to-stop-jobs: false` - left to the next job. Conformance jobs are not steered: they are planned from what the code lands. A steer shows in the job's view in the panel (what it regenerates now), in the transcript (`⇢ steered job …`), under the job in `regenerate`'s answer, and in the job's report.
202
204
 
203
- With `allow-to-stop-jobs: false` in `config.turri.yaml` it is not stopped: it runs to its end and lands what it was regenerating, and the next job regenerates what changed since as a patch on top of it. Something lands as soon as it can, and the software evolves job by job - the first build of an integration lands and throws, the next patch fills in what was missing - at the cost of regenerating what \*\*\*plain has already moved on from. Your own `halt` stops a job either way. `change_plain` makes an edit and gives the notice in one call, and so does `turri change-plain` on the command line. What is left to regenerate, without regenerating it, is `drift`.
205
+ With `allow-to-stop-jobs: false` in `config.turri.yaml` it is not stopped: it runs to its end and lands what it was regenerating, and the next job regenerates what changed since as a patch on top of it. Something lands as soon as it can, and the software evolves job by job - the first build of an integration lands and throws, the next patch fills in what was missing - at the cost of regenerating what \*\*\*plain has already moved on from. Your own `halt` stops a job either way. What is left to regenerate, without regenerating it, is `drift`.
204
206
 
205
207
  ### Regenerating a functionality
206
208
 
@@ -310,15 +312,15 @@ A functional spec is patched when a concept it uses changed as well as when its
310
312
 
311
313
  A job lands once its unit tests pass and are reviewed: the code record becomes the \*\*\*plain description the job ends on, committed with the code. Its conformance tests are not the code job's: they are a track of their own ([conformance tests in the work loop](#conformance-tests-in-the-work-loop)).
312
314
 
313
- A change that regenerates nothing - definitions moved to a common module, reqs reordered, \*\*\*plain moved between modules of the chain - is recorded, not regenerated: \*\*\*plain is recorded as it is now laid out and committed, with no agent and no testing script. Moving \*\*\*plain into a module the code was not built on is different: no change to the code brings that module's code in, so the codebase stops: it has to be started over - its code and conformance tests taken out, committed so its history keeps them, and the chain built again from the bottom. That is never done unasked. In the chat the model asks the person, saying why, and calls `regenerate` with `from_scratch: "module"` once they agree; `turri regenerate` and `change-plain` ask at the terminal, and `--start-over` agrees in advance - with no terminal and no flag, the run stops there, exit 1, saying so.
315
+ A change that regenerates nothing - definitions moved to a common module, reqs reordered, \*\*\*plain moved between modules of the chain - is recorded, not regenerated: \*\*\*plain is recorded as it is now laid out and committed, with no agent and no testing script. Moving \*\*\*plain into a module the code was not built on is different: no change to the code brings that module's code in, so the codebase stops: it has to be started over - its code and conformance tests taken out, committed so its history keeps them, and the chain built again from the bottom. That is never done unasked. In the chat the model asks the person, saying why, and calls `regenerate` with `from_scratch: "module"` once they agree; `turri regenerate` asks at the terminal, and `--start-over` agrees in advance - with no terminal and no flag, the run stops there, exit 1, saying so.
314
316
 
315
317
  **A pure rename.** A func-id given another name, and nothing else with it - in the \*\*\*plain diff, the functional spec's `# <func-id>` heading the only line of it that changed, and in its test plain file `func_id:`, wherever the file now is - is no work for an agent: its code does what it did, and its tests test what they did. In the trees it is a functional spec taken out and one added, identical but for their func-id - their text, their links, their scenarios. turri makes it itself, as one unit of work (`renames.ts`): the code record and the tests record rewritten to the new func-id, and the tests relabelled - `… of base:add-task` becomes `… of base:create-task`, on the whole key - committed together, or rolled back whole when any of it fails, the codebase then halted rather than the functional spec built anew. No agent runs, no testing script, no pulse, and the code is not touched. A scenario-id renamed - the same text, under the same functional spec, nothing else of it changed - has its tests relabelled the same way, none rewritten. A rename together with any other change - its text, a scenario - stays a functional spec taken out and another added, its code built anew and its tests written anew. A module file renamed gets nothing of this: `todo.plain` renamed `tasks.plain` is a new module, built from scratch, and `plain_modules/todo` is left for the person to delete. Before turri has made it, a pure rename is shown as one, never as a delete and an add: `drift` says `renames app:add-task to app:create-task`, the planner plans the work around it from the code as renamed, the regeneration shows the functional spec built, its old func-id beside it, and the ledger records it as a fact of its own (`loop.renamed`).
316
318
 
317
319
  ## Conformance tests
318
320
 
319
- **On or off.** A project has them only with `conformance-tests: true` ([config](config.md#conformance-tests)); unset, they are off - no scenarios written or tested, no conformance testing script, no conformance pulse, the test advisor off - and everything below is what turri does once they are on. The chat always knows they are off and how they are turned on: you asking it for conformance tests, or agreeing when it offers them, has it call `turn_on_conformance_tests`, which writes `conformance-tests: true` and gives it `conform` and `evaluate_tests` back. `/conform` turns them on too, before it tests.
321
+ **On or off.** A project has them only with `conformance-tests: true` ([config](config.md#conformance-tests)); unset, they are off - no scenarios written or tested, no conformance testing script, no conformance pulse - and everything below is what turri does once they are on. Turning them on is yours to decide, as they make each change take about twice as long: the chat always knows they are off and how they are turned on, its `conform` is refused while they are, 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 - `conformance-tests: true` - before it tests.
320
322
 
321
- The unit tests are written by the agent that wrote the code. Conformance tests are the other half: black box, end to end - and what they test is the scenarios. A functional spec's scenarios are in its test plain file, `<test-dir>/<module>/<func-id>.plain` ([authoring](authoring-plain.md#what-plain-is-made-of)), with its conformance scenarios under `***conformance tests***` and its acceptance scenarios under `***acceptance tests***`, each a `# <scenario-id>` heading and its text. A functional spec with scenarios is tested; one with no test plain file is not. There is no setting for it: to have a functional spec tested, write its scenarios - in the chat, its agent writes them with `change_plain` when you ask for conformance tests. In the chat and a host, the [test advisor](test-advisor.md) checks in the background whether a new or changed functional spec needs testing, and on a yes the chat writes its scenarios - with the test reqs and the conformance testing script, when they are missing.
323
+ The unit tests are written by the agent that wrote the code. Conformance tests are the other half: black box, end to end - and what they test is the scenarios. A functional spec's scenarios are in its test plain file, `<test-dir>/<module>/<func-id>.plain` ([authoring](authoring-plain.md#what-plain-is-made-of)), with its conformance scenarios under `***conformance tests***` and its acceptance scenarios under `***acceptance tests***`, each a `# <scenario-id>` heading and its text. A functional spec with scenarios is tested; one with no test plain file is not. There is no setting for it: to have a functional spec tested, write its scenarios - in the chat, its agent writes them with its file tools, then calls `regenerate`, when you ask for conformance tests. With conformance tests on, the chat also writes scenarios without being asked, for a functional spec it judges needs them - 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 - each with concrete evidence, a functional spec only likely to change later being no reason; they are a \*\*\*plain change like any other, which you review, and come with the test reqs and the conformance testing script when those are missing.
322
324
 
323
325
  ```bash
324
326
  turri conform <file.plain> # every functional spec with scenarios
@@ -329,9 +331,9 @@ They follow the code: a functional spec's scenarios get their tests once its cod
329
331
 
330
332
  ### The steps of adding tests
331
333
 
332
- Nothing about testing exists until the person asks for it, or the [test advisor](test-advisor.md)'s yes arrives: a module imports its stack alone, and its functional specs have no test plain files. The first time they ask for tests in a module, or the advisor's yes arrives, the chat takes three steps, in order, each a visible change: the **test reqs** - the stack's conformance template, `stdlib/<kind>/conformance/<stack>`, imported, or the module's own `***test reqs***`; the **conformance testing script** for the module's stack, written with `implement-conformance-testing-script` when the project has none ([the testing scripts](#the-testing-scripts)) - in the background, so the chat goes straight on, and the conformance tests wait for the script; then the **scenarios**.
334
+ Nothing about testing exists until the person asks for it, or - conformance tests on - the chat judges a functional spec needs it: a module imports its stack alone, and its functional specs have no test plain files. The first time tests are written in a module, the chat takes three steps, in order, each a visible change: the **test reqs** - the stack's conformance template, `stdlib/<kind>/conformance/<stack>`, imported, or the module's own `***test reqs***`; the **conformance testing script** for the module's stack, written with `implement-conformance-testing-script` when the project has none ([the testing scripts](#the-testing-scripts)) - in the background, so the chat goes straight on, and the conformance tests wait for the script; then the **scenarios**.
333
335
 
334
- A step skipped - functional specs with scenarios, and no test reqs (the module's own or imported), or no conformance testing script for its stack - and turri refuses to start a conformance pulse there, the work loop's and `conform`'s alike, naming the first step missing and the next step: `app has scenarios to test - app:say-hello - but no ***test reqs***, so its conformance tests cannot be written - the test reqs are the first step of adding tests. Next step: import the stack's conformance template, stdlib/backend/conformance/python-flask, with change_plain.` Nothing is started and nothing halts: the code goes on being built, and once it is, the module waits on that step - `waiting for its test reqs: …` in the loop's status and in `drift` - until \*\*\*plain or the scripts change, when the next look starts the pulse. `parse` gives the same as a warning, never a failure, and the map's top line says what is missing. A module another requires has its conformance tests written in the tips above it, so `parse` judges it by them, and says which: `base's conformance tests are written in top, which requires it: …`. A module with no scenarios skipped nothing: it is not tested, and nothing is said.
336
+ A step skipped - functional specs with scenarios, and no test reqs (the module's own or imported), or no conformance testing script for its stack - and turri refuses to start a conformance pulse there, the work loop's and `conform`'s alike, naming the first step missing and the next step: `app has scenarios to test - app:say-hello - but no ***test reqs***, so its conformance tests cannot be written - the test reqs are the first step of adding tests. Next step: import the stack's conformance template, stdlib/backend/conformance/python-flask.` Nothing is started and nothing halts: the code goes on being built, and once it is, the module waits on that step - `waiting for its test reqs: …` in the loop's status and in `drift` - until \*\*\*plain or the scripts change, when the next look starts the pulse. `parse` gives the same as a warning, never a failure, and the map's top line says what is missing. A module another requires has its conformance tests written in the tips above it, so `parse` judges it by them, and says which: `base's conformance tests are written in top, which requires it: …`. A module with no scenarios skipped nothing: it is not tested, and nothing is said. Asked to conform a module none of whose functional specs has scenarios yet, turri names every step still to take, in their order, from the first one missing - `No functional spec of app has scenarios - none has a test plain file - so there is nothing to test. Adding tests is three steps, in this order: the test reqs, the conformance testing script, the scenarios. Next step: write the module's own ***test reqs***; then write the conformance testing script with the implement-conformance-testing-script skill; then write the scenarios, each functional spec's in tests/app/<func-id>.plain, then regenerate.` - and with only the scenarios left, that step alone.
335
337
 
336
338
  ### Conformance tests in the work loop
337
339
 
package/docs/sentinel.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The sentinel is a chat of turri's own, beside the chats you talk to. Every pulse that finishes goes to it: it checks how the pulse went - and, with `release-after-pulse` on, tests what was released - and when something needs you, it says so in the chat you are in, with what can be done about it. You go on talking about the software, and building it, while it watches what lands.
4
4
 
5
- `sentinel:` in `config.turri.yaml` says whether there is one: `ask`, as it is unset - you are asked before it first opens in a session (below); `true` - it opens without asking; `false` - none. It is there in the terminal and in a host such as turri-desktop - wherever turri holds [chats](chats.md) - and not in pi's print, json or rpc modes, nor on the command line (`turri regenerate`, `turri change-plain`), which have no chat to tell: there a pulse is told as it is without it.
5
+ `sentinel:` in `config.turri.yaml` says whether there is one: `ask`, as it is unset - you are asked before it first opens in a session (below); `true` - it opens without asking; `false` - none. It is there in the terminal and in a host such as turri-desktop - wherever turri holds [chats](chats.md) - and not in pi's print, json or rpc modes, nor on the command line (`turri regenerate`, `turri conform`), which have no chat to tell: there a pulse is told as it is without it.
6
6
 
7
7
  ## Starting it
8
8
 
@@ -33,7 +33,7 @@ Nothing goes to the sentinel, or to your chat, until you answer: the pulses that
33
33
 
34
34
  Each pulse it checks from scratch, in a conversation of its own: its prompt, your guidance (`.turri/sentinel.md`, below) and what turri writes it of that pulse - nothing of the pulses before it. Its chat stays the same tab; the conversation in it is replaced as it starts on the next pulse, and the one before is let go - deleted, outside [debug mode](config.md). For each pulse that finishes, turri writes the sentinel what it was and how it ended - its stages, rounds and failures as the [ledger](using.md#the-ledger) has them, its \*\*\*plain diff, its log, the chat that asked for it, the chat you are in, and what was released and where it runs. Then it:
35
35
 
36
- 1. **checks the pulse** - from what it is told, and when that is not enough, from the pulse's log, the ledger (`ledger`, `pulses`), `diagnose`, the code and the \*\*\*plain;
36
+ 1. **checks the pulse** - from what it is told, and when that is not enough, from the pulse in full (`pulses` with its id), its log, the code and the \*\*\*plain;
37
37
  2. **tests the release**, with `release-after-pulse` on: what was released is running where it is told, and it tries it - in the terminal with its shell (`curl`, the program itself, the logs), in a host also with what the host gives it, a browser say. How far it tests is its own judgement, from what the pulse changed and what the \*\*\*plain says it now does. With `release-after-pulse` off nothing is running, and it checks the pulse alone;
38
38
  3. **finds out why**, when something is wrong - the pulse failed or stopped, it did not pass, the release did not come up, the software does not do what its \*\*\*plain says. A testing script, or where the config says the scripts are, it fixes itself, resumes the module, and tells you what it changed (below). Anything else it puts to you as a notice, each action a task your chat's agent can carry out once you accept it - and what the machine lacks, the exact command for you to run;
39
39
  4. **notifies no one** when all is well;
@@ -55,7 +55,7 @@ It fixes the project's tooling itself, and nothing else:
55
55
  - **It never changes \*\*\*plain.** The \*\*\*plain is your intent: what needs it changed is a notice, its action a task for your chat's agent once you accept it.
56
56
  - **It installs nothing, and changes no setting of the machine's or your shell's** - not a toolchain, not a package, not a PATH line in your profile - under no circumstances: its shell refuses it, as every shell turri runs does. What the machine lacks is a notice with the exact command for you to run, and resuming as its action once you have.
57
57
 
58
- Its file tools - `read`, `ls`, `grep`, `find` - read the whole project; `write` and `edit` reach the tooling above and nothing else, \*\*\*plain never. Its shell runs [behind the walls](sandbox.md) every agent's does - the command check, the OS sandbox where one is up, the audit - with the project read only and the network open, its home and temporary folder its own. It has `ledger`, `pulses`, `diagnose`, `parse`, `doctor` and the web, `resume`, `notify_person` for its notices, `conclude` for when it is done with a pulse, `keep_guidance`, and what a host gives it. Whatever else it calls is refused: it never steers, releases, or regenerates but by `resume` after a fix of its own, and never asks you a question - a notice is how it reaches you.
58
+ Its file tools - `read`, `ls`, `grep`, `find` - read the whole project; `write` and `edit` reach the tooling above and nothing else, \*\*\*plain never. Its shell runs [behind the walls](sandbox.md) every agent's does - the command check, the OS sandbox where one is up, the audit - with the project read only and the network open, its home and temporary folder its own. It has `pulses`, `parse`, `doctor` and the web, `resume`, `notify_person` for its notices, `conclude` for when it is done with a pulse, `keep_guidance`, and what a host gives it. Whatever else it calls is refused: it never steers, releases, or regenerates but by `resume` after a fix of its own, and never asks you a question - a notice is how it reaches you.
59
59
 
60
60
  ## Talking to it
61
61
 
@@ -39,19 +39,15 @@ 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, as the test advisor's verdicts are (`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 stack's `coding-model` over the project's, and the one chosen with `engine` this session 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
-
44
- `paced: false` under `metadata:` lets a skill write \*\*\*plain changes one after another on its own: `change_plain` otherwise refuses a new change until the user has answered a question since the last one - one answer, one change, as an interview writes them. An unpaced skill is told so by the tool, and after each change to write the next at once, not to carry on with an interview it does not have.
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 stack's `coding-model` over the project's, and the one chosen with `engine` this session 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.
45
43
 
46
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.
47
45
 
48
- `change-plain-per-answer:` under `metadata:` names the steps where every answer is a \*\*\*plain change - `[product]`, say - at every questioning level. There `ask_user` refuses the next question until the last answer is written with `change_plain` (a confirmation, or a question dismissed or declined, owes nothing), and `change_plain` no longer waits for an answer before a change: the agent writes as many as the step needs, those it decides itself included. The level limits the questions, never the \*\*\*plain changes.
49
-
50
- A step ends when its agent's turn does. A turn that ends on a question in the reply would end the step there, half done, on a question no one reads - the person sees only what `ask_user` asks. So such a step is sent back, twice at most: to ask with `ask_user` if the question is truly the person's, or, in an unpaced skill, to decide it itself - then to carry on until the step is done.
46
+ A step ends when its agent's turn does. A turn that ends on a question in the reply would end the step there, half done, on a question no one reads - the person sees only what `ask_user` asks. So such a step is sent back, twice at most: to ask with `ask_user` if the question is truly the person's, or else to decide it itself - then to carry on until the step is done.
51
47
 
52
48
  `phases:` under `metadata:` says what each step does, in a short line a step by its name - for the person, not the agent: while the skill runs, the line above the input shows its phases, and under them the one it is in with its line (`stack - the language, frameworks, storage and architecture`). A phase's name alone says little to someone who has not read the skill. Every skill with more than one step describes each; a line for a step the skill does not have is an error, as a gate after one is.
53
49
 
54
- A skill gets the tools its `allowed-tools` names, and nothing else: one that names none has none. So every skill here names its own - the file tools (`read`, `write`, `edit`, `ls`, `grep`, `find`) for the ones that write \*\*\*plain, resources or scripts, `bash` only for those that need a shell (running the testing script they write, deleting a module they split up), only the reading ones for those that analyse and report, and turri's own (`change_plain` and the ones below) where a skill uses them.
50
+ A skill gets the tools its `allowed-tools` names, and nothing else: one that names none has none. So every skill here names its own - the file tools (`read`, `write`, `edit`, `ls`, `grep`, `find`) for the ones that write \*\*\*plain, resources or scripts, `bash` only for those that need a shell (running the testing script they write, deleting a module they split up), only the reading ones for those that analyse and report, and turri's own (the ones below) where a skill uses them.
55
51
 
56
52
  A skill's `write` and `edit` reach the project's \*\*\*plain only (`plainWriteTools` in `src/plain-files.ts`): a `.plain` file, a resource one links, a testing script, a `config.turri*.yaml`, or a new file outside `plain_modules/`, `dist/` and the hidden folders - a resource about to be linked, a script about to be named. Any other file that is there already - the code, a release, what an app it started writes - is refused, with why. Its `bash`, where it has one, is not fenced.
57
53
 
@@ -81,7 +77,6 @@ A gate can also have a `continuous` reviewer: a read-only agent that re-reads th
81
77
 
82
78
  Beside "Something else…", every list an agent's question shows carries "Chat about this": the person says what they want to talk over - why it is asked, what an option means for later - and it goes back to the agent that asked, as no answer. A skill's agent answers in the `context` of the question asked again, since nothing else it writes reaches them; the conversation's agent answers in its reply and ends its turn, the person going on in the chat. It is not counted against the questioning level, and owes no \*\*\*plain change. The harness's own first question - how many the phases may ask - has no agent to answer, and does not offer it. Either choice is backed out of with Esc, or by typing nothing: the options come back, so one picked by accident costs nothing. Esc on the options themselves dismisses the question.
83
79
  - **Be asked something on the side.** A skill runs inside one `cultivate` call, so the conversation can answer nothing until it returns. `/btw <question>` (`btw.ts`) can: [pi](https://pi.dev) runs a command at once, even mid-turn, and it starts an agent of its own - fresh, on the chat's model, reading the project and turri and changing nothing - shown the conversation, the running skill's trace and the end of its agent's session, and the pulses. It is told it is turri, as the conversation's agent is (`identity.ts`), and answers as turri, in the first person - never as an onlooker who sends the person to turri with a message to pass on. Its answer goes in the transcript as an entry, in no model's context: the conversation and the skill go on as if nothing was asked. While a question of the skill's has the keys, `/btw <question>` typed as the answer (under "Something else…") is the same: answered, and the question asked again with the answer above it - the skill's agent never sees it.
84
- - **Build while it interviews.** `change_plain` (any skill that names it in `allowed-tools`) writes a change to \*\*\*plain and queues its regeneration in one call; the interview carries on while the builds run in the background, one after another. `drift` shows how they stand. The person sees its calls as `mutate`: a tool can be shown by a name of its own (`SHOWN_AS` in `regenerate/activity.ts`), while its agent calls it by the one that says what it takes.
85
80
  - **Regenerate, and conform.** A skill that names them in `allowed-tools` gets the conversation's own `regenerate`, `drift`, `halt` and `conform`, on its loop: `conform` schedules a conformance pulse for functional specs not built yet, as it does from the chat. The skill never waits for them.
86
81
  - **Choose the model that regenerates**, when the user says so - `engine`, the same tool the conversation has.
87
82
 
package/docs/using.md CHANGED
@@ -23,17 +23,12 @@ 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
- | `glimpse` | the pulse a module's codebases would start next, and the whole prompt its coding agent would get - starting nothing |
27
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 |
28
- | `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; whatever the config says |
29
- | `evaluate_tests` | have the [test advisor](test-advisor.md) judge whether functional specs need explicit testing scenarios, in the background - returning at once, the verdict coming back to the chat; whatever `test-advisor` says |
30
- | `turn_on_conformance_tests` | turn conformance tests on for the project - `conformance-tests: true`, for this session and the next - once you asked for them, or agreed when the chat offered them. The chat has it while they are off, and `conform` and `evaluate_tests` while they are on |
27
+ | `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 |
31
28
  | `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 for its stack, passes with a warning naming the next step (see [the steps of adding tests](regenerating.md#the-steps-of-adding-tests)) |
32
29
  | `engine` | show or choose the model the code is regenerated on - see [below](#choosing-a-model) |
33
- | `pulses` | the pulses - running, planned and finished - or one of them |
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 |
34
31
  | `halt` | halt a pulse, a module's planned pulses, or what `activate` started |
35
- | `diagnose` | why a pulse did not land, from its transcript: how it ended, the stages that went wrong, the last failing test run, the last review, the tool calls that failed - and what the [ledger](#the-ledger) recorded of it |
36
- | `ledger` | what turri did, from the [ledger](#the-ledger), this session's and every earlier one's: a pulse as facts, by its id - its rounds, test runs, verdicts, healers, refusals and commits; events of some kinds counted and listed, for a module or since a time - `healer.failed`, or `healer` for the group; or the last runs, a line a pulse |
37
32
  | `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 |
38
33
  | `lineage` | a module's lineage: what each regeneration and conformance run changed in it, and what it was regenerated from |
39
34
  | `cultivate` | run a gated skill, its steps and review gates enforced |
@@ -86,12 +81,12 @@ A regeneration takes minutes, so in the TUI every tool that regenerates starts t
86
81
  - **`/sentinel`** says whether the [sentinel](sentinel.md) checks every pulse that finishes: `ask` - you are asked before it first opens in a session - `on`, or `off`; written to `config.turri.yaml`.
87
82
  - **`/stack`** chooses the stack everything is built with from then on, in a project whose parts are on different stacks: a list of the project's stacks, or `/stack backend`, `/stack none`. The stack's `config.turri.<stack>.yaml` is laid over `config.turri.yaml` - its testing scripts, toolchains, models - for the session; a module already asked for keeps the stack it was asked for with. The chat model switches it too when you ask - and, to build one part, passes that part's stack to `regenerate` instead, leaving the session's as it is. See [stacks](config.md#stacks).
88
83
  - **`/regenerate [module | file.plain] [module:func-id ...] [from scratch [whole chain]] [how to cut the work]`** regenerates a module from its \*\*\*plain as it is now, as the `regenerate` tool does: what is left to regenerate is planned into pulses - one functional spec at a time, a few together or the whole module in one, as the planner judges - and the first starts. Words after the module are guidance for that plan (`/regenerate app models first`). A module's name typed with spaces for its underscores is that module - `/regenerate d365_function executor` is `d365_function_executor`. With no module named: the one `module:` in `config.turri.yaml` names, else the folder's top modules, to pick from. Asked for from scratch - `from scratch`, `start over`, `delete the module` - it starts at once, with nothing to confirm: it deletes the module's code and conformance tests in every codebase where they live, committed so `/lineage` keeps them, and regenerates the whole module from its \*\*\*plain, built though nothing in it changed: `/regenerate shorty from scratch`. The modules below it keep their code, and the module starts again from a copy of the code below it. Asked for its chain too - `/regenerate shorty from scratch, the whole chain` - the code of every module of its requires chain is deleted, the base's included, and the whole chain is regenerated from the bottom: what to do after modules were split, merged or moved, when the code below was laid out for modules that are no more. The chat's `regenerate` does the same with `from_scratch: "module"` or `"chain"`, when you ask for it; `turri regenerate --from-scratch` or `--from-scratch-chain` on the command line, not with `--dry-run`. Functional specs named after the module, each as `<module>:<func-id>` - `/regenerate shorty shorty:shorten shorty:expand` - are regenerated though their \*\*\*plain did not change, on the model chosen for functionalities: as `turri regenerate shorty.plain shorty:shorten shorty:expand` does, and the chat's `regenerate` with `funcIds`. A bare func-id is refused: the module is always named. Code built before functional specs had func-ids - its record numbers them - is never built on: the module's whole chain has to be regenerated from scratch, and the chat asks you first, as for a start over.
89
- - **`/conform [module | file.plain] [module:func-id ...] [one by one]`** writes and runs a module's conformance tests now, as the `conform` tool does: those of the functional specs named, each as `<module>:<func-id>` - `/conform shorty shorty:shorten shorty:expand` - or, with none named, of every functional spec with scenarios. They go in one pulse, as far as a size guardrail lets; `one by one` (or `separately`, `one at a time`) has a pulse a functional spec. No other words are taken: there is no plan to guide. The module is found as `/regenerate` finds it. Asking for them is asking for them on: with conformance tests off, `/conform` turns them on first - `conformance-tests: true`, written where the module's value comes from, as the chat's `turn_on_conformance_tests` does - and says so. What would start nothing is found from the \*\*\*plain before anything is said - no scenarios, a functional spec named that is not there or has none, a step of adding tests skipped (no test reqs, no conformance testing script) - and turri answers it at once in the chat: why, and an offer to write what is missing. Its tests come before anything is built on it: a codebase built on the module is stopped and deleted, and regenerated from it once they pass. Tests written already for the scenarios as built are said to be, and nothing starts.
84
+ - **`/conform [module | file.plain] [module:func-id ...] [one by one]`** writes and runs a module's conformance tests now, as the `conform` tool does: those of the functional specs named, each as `<module>:<func-id>` - `/conform shorty shorty:shorten shorty:expand` - or, with none named, of every functional spec with scenarios. They go in one pulse, as far as a size guardrail lets; `one by one` (or `separately`, `one at a time`) has a pulse a functional spec. No other words are taken: there is no plan to guide. The module is found as `/regenerate` finds it. Asking for them is asking for them on: with conformance tests off, `/conform` turns them on first - `conformance-tests: true`, written where the module's value comes from - 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 - no scenarios, a functional spec named that is not there or has none, a step of adding tests skipped (no test reqs, no conformance testing script) - and turri answers it at once in the chat. What is missing that turri can write - the test reqs, the conformance testing script, the scenarios of the functional specs named, or of each one that needs them - it writes at once, without asking again: your `/conform` was the yes. Then it regenerates the module, and says what it wrote and why. What is yours to settle - a functional spec named that is not there - it tells you, 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.
90
85
  - **`/halt <id>`** halts a pulse - a queued one never starts - **`/halt <module>`** (or a planned row's id) halts a module's planned pulses until you ask for it again, a \*\*\*plain change not starting it, and **`/halt activated <name>`** halts a server `activate` started; it lists all three when no id is given.
91
- - **What these commands show you, the chat knows.** What `/regenerate`, `/conform` and `/halt activated` tell you - \*\*\*plain that does not parse, the pulses planned, a server halted - stays in the chat under the command, and since a slash command runs outside the conversation, it is put in the conversation as well: say "fix it" next and turri knows what you are looking at. When `/conform` starts nothing, turri answers it at once - why, and what would let it start. Once `/regenerate` or `/conform` has started pulses, turri says so in the chat too - what runs and what is planned, and that you need not wait for it - without starting anything more for it; a module already up to date gets the plan's answer alone. A halted pulse reaches it as every pulse's end does.
86
+ - **What these commands show you, the chat knows.** What `/regenerate`, `/conform` and `/halt activated` tell you - \*\*\*plain that does not parse, the pulses planned, a server halted - stays in the chat under the command, and since a slash command runs outside the conversation, it is put in the conversation as well: say "fix it" next and turri knows what you are looking at. When `/conform` starts nothing, turri answers it at once - writing what it can of what is missing, 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.
92
87
  - **Nothing is queued.** What is left to build is worked out from what each codebase is built from and \*\*\*plain as it is now - again whenever a pulse ends or \*\*\*plain changes - and the first pulse of it runs; see [a whole module](regenerating.md#a-whole-module). Changes that overlap never pile up: the next pulse builds \*\*\*plain as it is. The pulses planned after the one running are listed behind it, as queued, and so is each module waiting for the one it is built on - "waits for base" - until it can be planned. A change inside what the running pulse regenerates - a functional spec it regenerates reworded or given a sub-bullet, a definition or req it is given, a file they link - steers it: its agent is told, and it lands \*\*\*plain as it is now there, twice a pulse at most. Otherwise a pulse building something \*\*\*plain no longer wants is stopped and rolled back - unless `allow-to-stop-jobs: false` in `config.turri.yaml`, which has it land first and the change regenerated on top. To drop something, take it out of \*\*\*plain - one \*\*\*plain diff. Stopping a pulse leaves its change in \*\*\*plain: the codebase waits until its \*\*\*plain changes or it is asked for again.
93
88
  - **A change to a module below** is made in the codebase at the tip of the chain, where its code lives; the codebase below is left as it was, and is brought up to its own \*\*\*plain only when a new module is to start from it. \*\*\*plain moved into a module the code was not built on stops the codebase: no change to its code brings that module in, so it has to be started over - its code and conformance tests taken out, kept in its history, and built again from the bottom of the chain. That is never done unasked: the chat asks you, saying why, and regenerates it from scratch once you agree; on the command line `turri regenerate` asks at the terminal, and `--start-over` agrees in advance.
94
- - **Conformance tests are a track of their own.** A code pulse lands once its unit tests pass and are reviewed. Then, before the next one builds on it, a conformance pulse writes and runs the tests of what it built - the scenarios of its functional specs, by the test reqs - with the whole suite the module inherits, and, where one fails, fixes the test or the code, whichever is wrong; what they are written for is recorded in `tests/.turri.json`. A functional spec with no test plain file, or an empty one, gets none: to have it tested, ask for conformance tests, or let the [test advisor](test-advisor.md) find that it needs them - either way the chat writes its scenarios with `change_plain`, and the loop tests them once the code is built. `conform` runs them now, for a module or some of its functional specs. A conformance pulse that does not pass is undone whole and halts the conformance tests alone: the code goes on being built.
89
+ - **Conformance tests are a track of their own.** A code pulse lands once its unit tests pass and are reviewed. Then, before the next one builds on it, a conformance pulse writes and runs the tests of what it built - the scenarios of its functional specs, by the test reqs - with the whole suite the module inherits, and, where one fails, fixes the test or the code, whichever is wrong; what they are written for is recorded in `tests/.turri.json`. A functional spec with no test plain file, or an empty one, gets none: to have it tested, ask for conformance tests - or, with them on, the chat writes scenarios itself for a functional spec it judges needs them (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) - either way the chat writes its scenarios with its file tools and calls `regenerate`, and the loop tests them once the code is built. `conform` runs them now, for a module or some of its functional specs. A conformance pulse that does not pass is undone whole and halts the conformance tests alone: the code goes on being built.
95
90
  - **A pulse that fails** - its work errors, or it does not pass - is run once more; one stopped on what only you can fix - the machine lacks something, a testing script no code could pass - is not. Failing again, it stops, and so does every pulse queued behind it on the same module, without running - the other modules' pulses go on. The harness then works out why: an agent that can read the project's \*\*\*plain, code, tests, testing scripts and logs, and turri's own source, skills and rules, says what happened, why, whether the fix belongs in \*\*\*plain, the environment, the code or turri itself, and exactly what to do.
96
91
  - **When a pulse finishes** the transcript shows its line - `✓`, `✗` or `■`, its module, kind and number, how long it took and what it cost, never what it regenerated - `✓ shorty · conformance pulse 4 finished after 3m 47s · 488.6k tok · $0.02` - and the chat, which gets its whole report, reacts then and there, whatever else is running or queued, without waiting for you to speak: at once when it is idle, else as soon as the reply it is in ends. It does what the project's guidance says to do when a pulse finishes - release what was built, say - or tells you what finished and what it means. Ask to try it ("let me try it") and the chat releases what is built to `dist/<module>` and starts it on your machine, even while other pulses run. See [deploy](deploy.md). The chat reacts to it then and there, whatever else is running or queued, without waiting for you to speak - at once when it is idle, else as soon as the reply it is in ends: it does what the project's guidance says to do when a pulse finishes (release what was built, say), or tells you in a line or two what finished.
97
92
  - **When a pulse stops** - a gate still failing after 20 attempts - it says where it stopped, why in plain words, and what to change in \*\*\*plain - which section, and how. Running the same build again picks up from there.
@@ -129,7 +124,7 @@ Every regeneration runs on the coding model unless you say otherwise. Say it in
129
124
 
130
125
  | kind of work | covers |
131
126
  | --- | --- |
132
- | \*\*\*plain changes | \*\*\*plain diff pulses, including the ones `change_plain` queues |
127
+ | \*\*\*plain changes | \*\*\*plain diff pulses |
133
128
  | functionalities | a functionality or a whole module regenerated, functionalities regenerated again, conformance |
134
129
  | everything | both |
135
130
 
@@ -147,7 +142,7 @@ A provider failure - no credits, bad key, rate limit - is raised with the provid
147
142
 
148
143
  ### Models from a pi extension
149
144
 
150
- A provider a [pi](https://pi.dev) extension registers - a Claude subscription through Claude Code ([pi-claude-code](https://github.com/earendil-works/pi-claude-code), `claude-code/...`, see [a Claude subscription](claude-subscription.md)), your company's own LLM gateway - works everywhere turri needs a model. Install the extension with `turri install <source>` - pi's own `install`, run by the pi inside turri, so no `pi` of your own is needed; `turri list`, `turri update <source>` and `turri remove <source>` are pi's too - and name its models in `config.turri.yaml` as any. In the chat, pi loads it, and every agent the conversation starts is given the providers the conversation's extensions registered, as they are when it starts - the agents themselves load no extensions, which would load a second copy of turri. A run with no conversation - `turri regenerate`, `turri change-plain`, `turri release` and the rest - loads the installed extensions itself, once, as pi loads them, and keeps only the providers they register; so do `turri doctor` and `turri init-config`, which check a model against them. An older turri that installed itself into every pi is among them, and is loaded as nothing.
145
+ A provider a [pi](https://pi.dev) extension registers - a Claude subscription through Claude Code ([pi-claude-code](https://github.com/earendil-works/pi-claude-code), `claude-code/...`, see [a Claude subscription](claude-subscription.md)), your company's own LLM gateway - works everywhere turri needs a model. Install the extension with `turri install <source>` - pi's own `install`, run by the pi inside turri, so no `pi` of your own is needed; `turri list`, `turri update <source>` and `turri remove <source>` are pi's too - and name its models in `config.turri.yaml` as any. In the chat, pi loads it, and every agent the conversation starts is given the providers the conversation's extensions registered, as they are when it starts - the agents themselves load no extensions, which would load a second copy of turri. A run with no conversation - `turri regenerate`, `turri conform`, `turri release` and the rest - loads the installed extensions itself, once, as pi loads them, and keeps only the providers they register; so do `turri doctor` and `turri init-config`, which check a model against them. An older turri that installed itself into every pi is among them, and is loaded as nothing.
151
146
 
152
147
  ## Module history
153
148
 
@@ -170,7 +165,7 @@ The logs are in `.turri/debug/` in the project, beside `plain_modules`, one per
170
165
 
171
166
  Beside them, each pulse has a log of its own in `.turri/jobs/` - `<time>-<pulse id>-<kind>.log`: its whole transcript, written as it happens. The harness's stages, the functional spec or the diff it builds, and every one of its agents in turn - each prompt, its thinking and replies, every tool call and its result, whole where the screen clips them - and how the pulse ended. A finished pulse, opened in the side panel, names it. It is the one to read for a pulse as a whole; an agent's own log has its system prompt, tokens and retries besides.
172
167
 
173
- They are kept only in [debug mode](config.md#debug-mode) - `debug: true` in `config.turri.yaml`, or `TURRI_DEBUG=1`, or `turri --debug` for one run. Otherwise a pulse's logs are written while it runs - the diagnosis of a pulse that fails twice reads them, and quotes what it needs, never sending you to a file that is about to go - and removed as it ends, and an agent outside a pulse writes none; the [ledger](#the-ledger) still says what each pulse did, how it ended and what it cost. To read why an agent did something, turn debug mode on and run it again.
168
+ They are kept only in [debug mode](config.md#debug-mode) - `debug: true` in `config.turri.yaml`, or `TURRI_DEBUG=1`, or `turri --debug` for one run. Otherwise a pulse's logs are written while it runs - the diagnosis of a pulse that fails twice reads them, and quotes what it needs, never sending you to a file that is about to go - and removed as it ends, and an agent outside a pulse writes none; the [ledger](#the-ledger) still says what each pulse did, how it ended and what it cost, and a pulse that failed or finished without landing keeps why in `.turri/pulses/<id>.md` - what `pulses` says of it as it ends, so the chat can tell why in a later session too. To read why an agent did something, turn debug mode on and run it again.
174
169
 
175
170
  The coding and conformance agents cannot read the logs: they are outside `plain_modules` - or, for a `--build-dir` outside it, beside that folder rather than in it. The diagnosis of a failed pulse reads them. In debug mode nothing prunes them - delete the folder when you are done with it. A log that cannot be written is given up on without failing the regeneration.
176
171
 
@@ -196,7 +191,7 @@ It is in `.turri/ledger/` in the project, a JSON line an event, one file a run -
196
191
 
197
192
  Never in it: prompts, replies, thinking, tool arguments and results, file contents - the one body it keeps is each pulse's \*\*\*plain diff, so what an earlier session regenerated can be read back. What an event does carry - a stage, an error's first line - is masked as the logs are.
198
193
 
199
- `turri ledger` prints the last runs, a line a pulse - runs and pulses newest first, as every list of the ledger's is, the events and a pulse's history and stages too; `turri ledger <pulse>` one pulse - its rounds, its test runs and how many failed the same way, the verdicts, the healers, what turri refused, what its history recorded, its log, and the \*\*\*plain diff it regenerated; `--json` the events themselves, for `jq`. A pulse not ended is still running when it is of the run reading the ledger, and never ended - its run stopped while it ran - when it is another's. In the chat, `ledger` is the way in - a pulse of this session or an earlier one, the events of some kinds counted (how often the debugger failed this week: `kinds: [healer.failed], since: 7d`), the last runs - and `pulses` lists the last three earlier runs under this session's pulses, `pulses` and `diagnose` tell one of them by its id, and `diagnose` adds the ledger's facts to a pulse of this session; the side panel's pulses list has them as **earlier sessions** (see [the side panel](#in-a-conversation)).
194
+ In the chat, `pulses` is the way in: it lists the last three runs of earlier sessions under this session's pulses, a line a pulse - runs and pulses newest first - and more with `runs`; with a pulse's id it tells one, this session's or an earlier one's - for an earlier one, as the ledger recorded it: its rounds, its test runs and how many failed the same way, the verdicts, the healers, what turri refused, what its history recorded, its log, and the \*\*\*plain diff it regenerated. A pulse not ended is still running when it is of the run reading the ledger, and never ended - its run stopped while it ran - when it is another's; the side panel's pulses list has them as **earlier sessions** (see [the side panel](#in-a-conversation)).
200
195
 
201
196
  It is for looking up, never for deciding: what to build comes from the records alone (see [what the code is built from](regenerating.md#what-the-code-is-built-from)), so deleting `.turri/ledger/` loses nothing but what can be looked up. When a run first writes to the project, the files of runs that have ended are gzipped and the oldest pruned past `ledger-keep:` megabytes - 100 unset, `0` for none at all; a run still going is never touched. `.turri` ignores itself, so the ledger is never committed, and nothing of it is sent anywhere. A ledger that cannot be written is said once and given up on, never failing the work.
202
197
 
@@ -208,16 +203,13 @@ The same work, without a conversation. Run it from the directory that holds the
208
203
  turri parse <file.plain> # parse ***plain, its syntax and structure - no model, no API key
209
204
  turri drift <file.plain> # what is left to regenerate - no model, starts nothing
210
205
  turri regenerate <file.plain> # regenerate what the code is not built from yet, and what it requires
211
- turri glimpse <file.plain> # plan it, and print the first job's prompt - starts nothing
212
206
  turri regenerate <file.plain> app:add-task # regenerate a functional spec again, changed or not
213
207
  turri regenerate <file.plain> --from-scratch # delete the module's code and tests (its lineage keeps them), regenerate all of it
214
208
  turri regenerate <file.plain> --from-scratch-chain # the same for every module of its requires chain, from the bottom
215
- turri change-plain <file.plain> <diff> # apply a ***plain diff, and regenerate it
216
209
  turri conform <file.plain> app:add-task # black-box tests for one functional spec
217
210
  turri lineage <module> # what each regeneration changed in a module, and when
218
- turri ledger [pulse] # what turri did here: the last runs and their pulses, or one pulse
219
211
  turri cultivate debug-specs # run a skill directly - by name, the project's too, or by its folder
220
212
  turri release <file.plain> # release what is regenerated to dist/<module>, and activate it here
221
213
  ```
222
214
 
223
- `turri cultivate` runs a skill on the project's harness model, as the chat does, unless `--model` names another. The ones that build take `--model provider/model-id`; `regenerate` also takes `--build-dir` and `--dry-run`, which plans the work, prints the prompt of each codebase's first pulse and starts nothing. Template directories come from `PLAIN_TEMPLATE_DIRS`. `--help` on any of them lists the rest.
215
+ `turri cultivate` runs a skill on the project's harness model, as the chat does, unless `--model` names another. The ones that build take `--model provider/model-id`; `regenerate` also takes `--build-dir` and `--dry-run`, which looks ahead as `pulses` does in the chat - plans the work as `regenerate` would, prints the prompt of each codebase's next pulse from that plan, and starts and writes nothing - so not with `--from-scratch` or functional specs named, which change the code or its record before anything is planned. Template directories come from `PLAIN_TEMPLATE_DIRS`. `--help` on any of them lists the rest.
@@ -10,7 +10,7 @@ A test plain file holds the test scenarios of one functional spec. Conformance s
10
10
  - Every test plain file of a module lives in `tests/<module>/`, with `tests/` beside the module (`test-dir:` in `config.turri.yaml` can name another folder). This is a rule, not a convention: a file's folder matches its `module:`, and a `.plain` file in `tests/` outside a module's folder is an error `turri parse` reports
11
11
  - Name the file after its functional spec, `tests/<module>/<func-id>.plain`; the name is convention, the frontmatter is what binds it
12
12
  - A functional spec with no scenarios has no test plain file: it is not tested. Write one only to give a functional spec scenarios, and never an empty one - an empty file is a syntax error, as an empty section is
13
- - When turri's test advisor's yes arrives for a functional spec, you add its test plain file, with the test reqs and conformance testing script it needs (see `turri-regeneration.md`) - as below, asking nothing
13
+ - With conformance tests on, a functional spec that needs scenarios by the criteria under *When a functional spec needs scenarios* gets its test plain file without the person asking, with the test reqs and conformance testing script it needs - as below
14
14
  - More than one test plain file may bind to one functional spec: their scenarios are merged, and the scenario-ids must be unique across them. Write one file per functional spec, and keep a person's extra files as they are
15
15
  - A test plain file is never a module: never import or require one, and never name one where a module is asked for
16
16
 
@@ -57,8 +57,8 @@ Adding a :Task: named "Buy milk" to an empty :TaskList: shows one :Task: named "
57
57
  - It goes under `***conformance tests***` when every step is expected use, and under `***acceptance tests***` when any step is not; write one only when the person asks for it
58
58
 
59
59
  ## Keeping test plain files in step
60
- Only scenarios that exist are kept in step: a change to a functional spec never calls for new ones. In the same ***plain diff as the change:
61
- - A new functional spec gets no test plain file, unless the person asks for its tests
60
+ Scenarios that exist are kept in step; a change calls for new ones only as *When a functional spec needs scenarios* says. In the same ***plain diff as the change:
61
+ - A new functional spec gets no test plain file, unless the person asks for its tests or - conformance tests on - it needs scenarios by the criteria below
62
62
  - A functional spec whose body changes has its scenarios, if it has any, reviewed: one that no longer follows from it is changed or taken out, and your reply says so
63
63
  - The last scenario of a section taken out: the section is taken out with it. The last scenario of the file: the file is deleted
64
64
  - A functional spec split into several: each part gets its own test plain file, and each scenario moves to the part it tests
@@ -66,17 +66,25 @@ Only scenarios that exist are kept in step: a change to a functional spec never
66
66
  - A functional spec moved to another module: its test plain file moves to that module's folder, with `module:` changed
67
67
  - A func-id renamed: `func_id:` is renamed in every test plain file bound to it, and the file with it
68
68
 
69
+ ## When a functional spec needs scenarios
70
+ With conformance tests on, judge each functional spec as you write or change it - and one the person asks about. It needs scenarios when you can show, concretely, any of these:
71
+ - **It can fail silently:** an incorrect implementation could give output that looks plausible but is wrong - name the input and the wrong output
72
+ - **It can be read two ways:** two reasonable readings of its text give different outputs for some input - name the input and the output under each
73
+ - **A bug in it is costly:** financial loss, security exposure, data loss, or harm to users' trust - name the consequence
74
+
75
+ Without that evidence it does not: a functional spec with nothing at stake is left to its unit tests, and you do not write scenarios to be safe. Being likely to change, or to be built on later, is no reason alone - the unit tests guard against regressions. A functional spec that has scenarios already is judged no further: its scenarios are kept in step as above. Say in a line, for each you write scenarios for, which of these it is.
76
+
69
77
  ## Writing scenarios
70
- Nothing about testing exists until the person asks for it, or the test advisor's yes arrives: a module imports no conformance template, and its functional specs have no test plain files. The first time the person asks for tests in a module, or the advisor's yes arrives for one of its functional specs, do three things, in this order, each a visible change - only what is missing:
78
+ Nothing about testing exists until the person asks for it, or - with conformance tests on - a functional spec needs scenarios by the criteria below: a module imports no conformance template, and its functional specs have no test plain files. With conformance tests off, the person turns them on first, with `/conform` (see `turri-regeneration.md`). The first time the person asks for tests in a module, or one of its functional specs needs scenarios, do three things, in this order, each a visible change - only what is missing:
71
79
  1. **Test reqs:** import the stack's conformance template, `stdlib/<kind>/conformance/<stack>` (see `stdlib.md`), or write the module's own `***test reqs***` when it has no stack from the standard library (see `test-reqs.md`)
72
80
  2. **The conformance testing script:** write it with `implement-conformance-testing-script`, if the project has none for the module's stack
73
81
  3. **The scenarios**, as below
74
82
 
75
83
  Then, and for every later request:
76
- - Decide in prose which scenarios each functional spec named needs, then write them with `change_plain`, conformance and acceptance in one change where both were asked for. Ask for no further confirmation: the change is visible, and turri starts the conformance pulses itself
77
- - Write scenarios only for the functional specs the person named. Scenarios in one functional spec imply nothing about another, in the same module or not: the person may test one thoroughly and leave the rest untested
84
+ - Decide in prose which scenarios each functional spec named needs, then write them with the file tools, conformance and acceptance in one change where both were asked for, and call `regenerate` for the module. Ask for no further confirmation: the change is visible, and turri starts the conformance pulses itself
85
+ - Write scenarios for the functional specs the person named, and for those that need them by the criteria below. Scenarios in one functional spec imply nothing about another, in the same module or not: the person may test one thoroughly and leave the rest untested
78
86
  - Write acceptance scenarios only when the person asks for them
79
- - On the test advisor's yes, the functional spec it names is named, and its report says what to cover: each input that is this functional spec's, an agreed one with the readers' output and never a placeholder, a split one by the reading most consistent with the functional spec and its module - say which you took. Leave out an input it does not settle rather than ask; ask the person nothing
87
+ - For a functional spec that needs scenarios by the criteria, cover what made it need them: the input an incorrect implementation would get wrong, the input two readings answer differently - settled by the reading most consistent with the functional spec and its module, and say which you took - and its boundary inputs. Leave out an input it does not settle rather than guess at it
80
88
  - One conformance scenario per expected use the functional spec states: its main path first, then each valid variant it names - another input shape, an optional parameter. Stop when each has one, and never write the same outcome twice in different words
81
89
  - Write no outcome the functional spec does not state. When a needed one is missing, ask the person, and put the answer in the functional spec first
82
90
  - A scenario that needs a dependency to fail - a backend that does not answer, a database that is down - is written only when the test reqs let a test cause that failure, with a local mock of it, say; otherwise ask the person whether to add such a test req or leave the scenario out
@@ -36,15 +36,10 @@ The other rules say what a spec means. This one says what turri does with a chan
36
36
  - A functional spec written on its happy path and hardened later - its validation, edge cases and errors added to it - is patched in place each time: growing a spec a step at a time costs no more than writing it whole up front
37
37
  - A module's first pulse, when it builds one functional spec - the project set up and the smallest thing that runs - lands on its unit tests with no review
38
38
 
39
- ## The test advisor
40
-
41
- - Conformance tests are the project's choice: `conformance-tests:` in config.turri.yaml, off when unset. Off, no scenarios are tested and the test advisor is off - write no test plain file, test reqs or conformance testing script unless the person asks for tests; their asking, or their yes when the chat offers them, turns them on first
42
- - In the chat and a host, turri's test advisor looks at each functional spec that is new, or whose text changed since its code was built, and that has no scenarios - in the background, beside the pulses, taking no slot of theirs and never stopping one. It asks whether a wrong implementation could give output that looks right, whether two reasonable readings give different outputs for some input, whether it is likely to be built on later, and whether a bug in it would be costly. A yes to the first, the second or the last, with evidence, means the functional spec needs testing; built on later alone does not
43
- - It writes nothing in the ***plain: you are its only writer. A functional spec with scenarios of any kind is not looked at by it; its scenarios go through the usual review when its text changes
44
- - A change's result names the functional specs the advisor is checking: tell the person in a line that testing scenarios are being evaluated for them, and go on
45
- - Its yes comes to you as a message, once the chat is idle, with its report: tell the person in a line, then write with `change_plain` what testing the functional spec needs - its test reqs, the conformance testing script, its scenarios, in that order and only what is missing - the script written in the background, so you go straight on to the scenarios - as the rules on test plain files say, asking the person nothing. Its no is a line turri draws: nothing for you to do
46
- - `evaluate_tests` asks the advisor yourself, for functional specs you name with why, even a text it judged already: it returns at once, and the verdict comes back the same way. Call it when the person asks whether a functional spec needs tests, and on your own as another way of expressing intent - when pulses keep failing on a complicated functional spec, scenarios may pin down what it should do. A functional spec with scenarios is not evaluated
47
- - When the person asks for scenarios, write them yourself, as the rules on test plain files say. `test-advisor: false` turns off only what a change starts, never `evaluate_tests`; the advisor never runs in a headless run
39
+ ## Conformance tests
40
+
41
+ - Conformance tests are the person's choice: `conformance-tests:` in config.turri.yaml, off when unset, as they make each change take about twice as long. Off, no scenarios are tested and `conform` is refused - write no test plain file, test reqs or conformance testing script. When you think a module needs conformance tests, or the person asks for them, tell them in a line or two why; they decide, and turn them on with `/conform`
42
+ - On, you decide which functional specs need scenarios: as you write or change one, judge it by the criteria in the rules on test plain files, and when it needs them, write them - with the test reqs and the conformance testing script first, when missing - as a visible ***plain change the person reviews like any other, then call `regenerate`. The work loop writes and runs their conformance tests once the code is built
48
43
 
49
44
  ## What a coding agent sees
50
45
 
@@ -7,11 +7,11 @@ description: >-
7
7
  when turri says a module is in the old ***plain syntax, or the person asks to
8
8
  convert one. One run converts one module, the lowest of the chain first;
9
9
  it never regenerates.
10
- allowed-tools: [read, ls, grep, find, change_plain, parse]
10
+ allowed-tools: [read, write, edit, ls, grep, find, parse]
11
11
  metadata:
12
12
  phases:
13
13
  ids: "a func-id for each functional spec and a scenario-id for each acceptance test, proposed and confirmed"
14
- rewrite: "the module and its test plain files, in one ***plain diff, word for word"
14
+ rewrite: "the module and its test plain files, word for word"
15
15
  check: "parse, and which module is next"
16
16
  gates:
17
17
  - after: rewrite
@@ -44,7 +44,7 @@ Ask the person once, with `ask_user`: the whole list in its `context` - each fun
44
44
 
45
45
  ### rewrite
46
46
 
47
- Write the whole conversion as one `change_plain` diff, with the confirmed ids:
47
+ Write the whole conversion with `write` and `edit`, with the confirmed ids:
48
48
 
49
49
  - **The module.** Under `***functional specs***`, each bullet becomes its `# <func-id>` heading followed by its body: the bullet's text without its leading `- `, word for word. Its sub-bullets become `- ` bullets under that text, one level less indented, word for word and in the same order. Its nested `***acceptance tests***` are taken out of the module. The functional specs keep their order, one blank line between them. The frontmatter, every other section, the comments and any Liquid stay exactly as they are.
50
50
  - **Its test plain files,** one for each functional spec that has acceptance tests, at `tests/<module>/<func-id>.plain`: frontmatter `module:` (the module's file name without `.plain`) and `func_id:`, then `***conformance tests***`, then `***acceptance tests***` (`test-plain-files.md`). Each acceptance test of the functional spec becomes a scenario under `***acceptance tests***`: its `# <scenario-id>` heading followed by its text without its `- `, word for word, and its sub-bullets as `- ` bullets under it. `***conformance tests***` stays empty. A functional spec with no acceptance tests gets no test plain file: it has no scenarios.
@@ -53,13 +53,13 @@ Nothing else: no word added, reworded or dropped, no conformance scenario, no fi
53
53
 
54
54
  The change regenerates nothing: a module built before func-ids is not built on until its chain is regenerated from scratch, which the chat asks the person for.
55
55
 
56
- The record for the review: the module as it was before the change, word for word as you read it; the confirmed ids; and every file the change wrote. When the review sends the step back, show the person what it found and your fix with `ask_user`, then write the fix with one `change_plain`.
56
+ The record for the review: the module as it was before the change, word for word as you read it; the confirmed ids; and every file the change wrote. When the review sends the step back, show the person what it found and your fix with `ask_user`, then write the fix.
57
57
 
58
58
  ### check
59
59
 
60
60
  Run `parse` on the module and show what it says in your reply.
61
61
 
62
- When it reports an error the conversion made, show it to the person with `ask_user`, with the fix, and write the fix with one `change_plain`; then run `parse` again. An error the module had before the conversion stays for the person.
62
+ When it reports an error the conversion made, show it to the person with `ask_user`, with the fix, and write the fix; then run `parse` again. An error the module had before the conversion stays for the person.
63
63
 
64
64
  End with the result:
65
65
  - the module converted, its functional specs and scenarios counted, and the files written
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turri-dev/cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.4-next.240620d",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,63 +0,0 @@
1
- import { type ExtensionAPI, type ExtensionContext, type ToolDefinition } from "@earendil-works/pi-coding-agent";
2
- import type { ChatLink } from "./chats.ts";
3
- import type { AdvisorVerdict, TestAdvisor } from "./regenerate/advisor-runs.ts";
4
- import type { WorkLoop } from "./regenerate/loop.ts";
5
- /** The line a no is drawn as: the functional spec, and the classifier's reading in a few words - a no has no evidence. */
6
- export declare function noLine(verdict: AdvisorVerdict): string;
7
- /** The line the chat is to tell the person a yes in. */
8
- export declare function yesLine(verdict: AdvisorVerdict): string;
9
- /** A yes's report, as the chat's agent is given it: the questions that were a yes with their evidence, and the inputs. */
10
- export declare function describeReport(verdict: AdvisorVerdict): string[];
11
- /** The turn a batch of yeses starts: each one's report, and what the chat is to do with them - asking the person nothing. */
12
- export declare function yesTask(verdicts: AdvisorVerdict[]): string;
13
- /** How long a verdict waits before the chat is looked at again, while the person types or it cannot be told yet. */
14
- export declare const ADVISOR_RECHECK_MS = 2000;
15
- /**
16
- * A chat's verdicts: held until the chat is idle - its agent done, and nothing typed in its editor - then delivered
17
- * together: one turn for every yes, one line for each no. A verdict no longer about its functional spec as it is - its
18
- * text changed, or it was given scenarios meanwhile - is let go.
19
- */
20
- export declare function verdictDelivery(pi: ExtensionAPI, link: ChatLink, context: () => ExtensionContext | undefined): {
21
- put(verdict: AdvisorVerdict): void;
22
- };
23
- /**
24
- * The test advisor and the chat, in its system prompt while the session has the advisor and the project wants it: the
25
- * two ways an evaluation starts, what to say while it runs, what to do with its verdict, and when to ask for one.
26
- */
27
- export declare const TEST_ADVISOR_BLOCK: string;
28
- /** The test advisor of the session a work loop is in. */
29
- export declare function bindAdvisor(loop: WorkLoop, advisor: () => TestAdvisor | undefined): void;
30
- /**
31
- * What a change's tool result tells the chat's agent of the test advisor: the functional specs it has taken up, so the
32
- * agent tells the person they are being evaluated - nothing when it has taken up none.
33
- */
34
- export declare function advisingNote(loop: WorkLoop, plainFile: string): string;
35
- /** What an evaluation asked for came to, by functional spec - each named `module:func-id`, a missing one with why. */
36
- export interface EvaluateOutcome {
37
- /** Being evaluated now: the verdict comes to the chat the person looks at. */
38
- started: string[];
39
- /** Being evaluated already. */
40
- already: string[];
41
- /** With scenarios already: not evaluated. */
42
- scenarios: string[];
43
- /** Not found, with why. */
44
- missing: string[];
45
- }
46
- /**
47
- * The test advisor asked to evaluate functional specs - `module:func-id`s, or func-ids of `plainFile`'s module (else the
48
- * one the project's config names) - even a text it judged already, and whatever `test-advisor` says: `evaluate_tests`'s
49
- * and a host's `evaluateTests`. It returns at once.
50
- */
51
- export declare function evaluateTests(cwd: string, advisor: TestAdvisor | undefined, funcIds: string[], options?: {
52
- plainFile?: string;
53
- reason?: string;
54
- }): EvaluateOutcome;
55
- /**
56
- * evaluate_tests: the chat's own way to the test advisor - a functional spec evaluated in the background, whatever
57
- * `test-advisor` says, and even when its text was judged already. It returns at once; the verdict comes back to the chat
58
- * as the advisor's verdicts do. In the chat and a host only: the session has an advisor.
59
- */
60
- export declare function evaluateTestsTool(options: {
61
- cwd: string;
62
- advisor: () => TestAdvisor | undefined;
63
- }): ToolDefinition;