@turri-dev/cli 0.2.4-next.8422d0f → 0.2.4-next.bc1fc47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/chat-idle.d.ts +2 -2
- package/dist/chat-idle.js +2 -2
- package/dist/chats.d.ts +0 -10
- package/dist/chats.js +0 -23
- package/dist/cli.js +5 -7
- package/dist/config-edit.js +1 -3
- package/dist/config.d.ts +20 -22
- package/dist/config.js +49 -22
- package/dist/conform-cli.js +13 -2
- package/dist/conformance-switch.d.ts +7 -17
- package/dist/conformance-switch.js +24 -46
- package/dist/drift-cli.js +1 -1
- package/dist/extension.d.ts +8 -10
- package/dist/extension.js +188 -242
- package/dist/genome.js +9 -48
- package/dist/graph.js +3 -5
- package/dist/host-session.d.ts +4 -15
- package/dist/host-session.js +2 -4
- package/dist/host.d.ts +1 -3
- package/dist/host.js +1 -4
- package/dist/identity.js +0 -1
- package/dist/init-config.d.ts +0 -1
- package/dist/init-config.js +2 -9
- package/dist/installed-providers.d.ts +1 -1
- package/dist/installed-providers.js +1 -1
- package/dist/loop-cli.d.ts +4 -3
- package/dist/loop-cli.js +13 -11
- package/dist/loop-tools.d.ts +28 -5
- package/dist/loop-tools.js +87 -22
- package/dist/new-project.js +2 -2
- package/dist/pi-launch.js +1 -1
- package/dist/pi.js +9 -6
- package/dist/plain/check.d.ts +1 -8
- package/dist/plain/check.js +3 -38
- package/dist/regenerate/activity.d.ts +0 -7
- package/dist/regenerate/activity.js +2 -20
- package/dist/regenerate/agent-shell.js +3 -1
- package/dist/regenerate/audit.js +9 -0
- package/dist/regenerate/cases.js +7 -0
- package/dist/regenerate/chunk-plan.d.ts +5 -0
- package/dist/regenerate/chunk-plan.js +16 -1
- package/dist/regenerate/drift.d.ts +4 -0
- package/dist/regenerate/drift.js +26 -6
- package/dist/regenerate/failure-reports.d.ts +28 -0
- package/dist/regenerate/failure-reports.js +79 -0
- package/dist/regenerate/job-panel.js +3 -1
- package/dist/regenerate/jobs-tree.js +1 -1
- package/dist/regenerate/jobs.d.ts +2 -0
- package/dist/regenerate/jobs.js +4 -0
- package/dist/regenerate/ledger-view.d.ts +11 -24
- package/dist/regenerate/ledger-view.js +14 -60
- package/dist/regenerate/ledger.d.ts +1 -14
- package/dist/regenerate/ledger.js +1 -1
- package/dist/regenerate/loop.d.ts +46 -60
- package/dist/regenerate/loop.js +277 -116
- package/dist/regenerate/records.d.ts +11 -0
- package/dist/regenerate/records.js +15 -0
- package/dist/regenerate/regenerate.d.ts +0 -2
- package/dist/regenerate/regenerate.js +4 -15
- package/dist/regenerate/renames.js +4 -4
- package/dist/regenerate/requires.d.ts +7 -0
- package/dist/regenerate/requires.js +24 -18
- package/dist/regenerate/spec-map.js +3 -3
- package/dist/regenerate/standing.js +1 -1
- package/dist/regenerate/submit-work.d.ts +2 -0
- package/dist/regenerate/submit-work.js +8 -3
- package/dist/regenerate/testing-steps.d.ts +11 -0
- package/dist/regenerate/testing-steps.js +22 -3
- package/dist/regenerate-cli.js +18 -9
- package/dist/self-invocation.d.ts +11 -0
- package/dist/self-invocation.js +33 -7
- package/dist/sentinel.js +8 -5
- package/dist/skill.d.ts +0 -11
- package/dist/skill.js +0 -9
- package/dist/stacks.js +1 -1
- package/dist/tools.js +2 -3
- package/dist/turri-versions.js +2 -1
- package/docs/README.md +0 -2
- package/docs/authoring-plain.md +3 -3
- package/docs/chats.md +1 -3
- package/docs/config.md +11 -13
- package/docs/deploy.md +1 -1
- package/docs/development.md +2 -3
- package/docs/headless.md +6 -4
- package/docs/hosting.md +6 -6
- package/docs/parser.md +2 -2
- package/docs/regenerating.md +21 -13
- package/docs/sentinel.md +4 -4
- package/docs/skills-and-gates.md +4 -8
- package/docs/using.md +13 -21
- package/genome/rules/test-plain-files.md +15 -7
- package/genome/rules/turri-regeneration.md +4 -8
- package/genome/skills/convert-old-syntax/SKILL.md +5 -5
- package/package.json +1 -1
- package/dist/advisor-chat.d.ts +0 -63
- package/dist/advisor-chat.js +0 -290
- package/dist/change-plain-cli.d.ts +0 -1
- package/dist/change-plain-cli.js +0 -55
- package/dist/ledger-cli.d.ts +0 -1
- package/dist/ledger-cli.js +0 -50
- package/dist/ledger-tools.d.ts +0 -10
- package/dist/ledger-tools.js +0 -64
- package/dist/regenerate/advisor-records.d.ts +0 -93
- package/dist/regenerate/advisor-records.js +0 -110
- package/dist/regenerate/advisor-runs.d.ts +0 -87
- package/dist/regenerate/advisor-runs.js +0 -327
- package/dist/regenerate/test-advisor.d.ts +0 -101
- package/dist/regenerate/test-advisor.js +0 -379
- package/dist/spec-tools.d.ts +0 -36
- package/dist/spec-tools.js +0 -128
- package/docs/test-advisor.md +0 -110
package/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
|
|
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,8 +33,8 @@ 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
|
|
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;
|
|
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
|
+
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. Where the \*\*\*plain picks one way among several - which of a tie comes first, how a default is chosen - it tries an input on which the ways give different answers, so a pass shows the \*\*\*plain's way and no other. 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;
|
|
40
40
|
5. **concludes**, last, whether all is well or not: what it checked and what it found, in a line or two. The chat you are in shows it - `✓ sentinel · app · pulse 3 · checked, it holds` - and its agent tells you so in a line, and does nothing more; when something was wrong, that its notice says what.
|
|
@@ -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 `
|
|
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
|
|
package/docs/skills-and-gates.md
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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 (
|
|
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,8 +77,8 @@ 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.
|
|
81
|
+
- **Run commands, never turri again.** A skill with `bash` in `allowed-tools` has a shell in the project that refuses what the conversation's refuses: turri's own commands that start work - `turri regenerate`, `conform`, `cultivate`, `release` - turri itself or another pi, and any change to the machine's toolchains or settings (`skillShell` in `self-invocation.ts`). Such a run would build outside the session's work loop, beside its pulses and unseen by them: a script skill that tried its new conformance testing script with `turri conform` wrote and committed the module's conformance tests from a second turri the chat never heard of. The skill says what should run next in what it hands back, and the conversation runs it.
|
|
86
82
|
- **Choose the model that regenerates**, when the user says so - `engine`, the same tool the conversation has.
|
|
87
83
|
|
|
88
84
|
The harness still owns the sequence. A step chooses what to ask; it does not choose whether the gate afterwards runs. A run is saved as it goes, so an interrupted one can be resumed where it stopped - a run stopped with the chat's turn (`ctrl+c`, `esc`) too: its agents end their turns there, and what it started on the work loop goes on.
|
package/docs/using.md
CHANGED
|
@@ -23,19 +23,13 @@ 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
|
|
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` |
|
|
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
|
-
| `lineage` | a module's lineage: what each regeneration and conformance run changed in it, and what it was regenerated from |
|
|
39
33
|
| `cultivate` | run a gated skill, its steps and review gates enforced |
|
|
40
34
|
| `release`, `activate` | try what is regenerated: release it to `dist/<module>` and activate it on this machine, installing what it needs - see [deploy](deploy.md) |
|
|
41
35
|
| `ask_user` | put a question to you as a dialog to pick from - several at once, each a box you tick and untick, "Something else…" to type, or "Chat about this" to talk it over first; Esc in either goes back to the options |
|
|
@@ -86,12 +80,12 @@ A regeneration takes minutes, so in the TUI every tool that regenerates starts t
|
|
|
86
80
|
- **`/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
81
|
- **`/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
82
|
- **`/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
|
|
83
|
+
- **`/conform [module | file.plain] [module:func-id ...] [from scratch [whole chain]] [one by one]`** writes and runs a module's conformance tests now, as the `conform` tool does: those of the functional specs named, each as `<module>:<func-id>` - `/conform shorty shorty:shorten shorty:expand` - or, with none named, of every functional spec with scenarios. A functional spec named whose tests are written has them written again, deleted and written anew from its scenarios; `from scratch` takes out the tests folder where the module's code lives - the tip of its chain, never a module in the middle - its lineage keeping it, and writes the tests again from a copy of the tests of the module the tip requires; `from scratch, whole chain`, from nothing. None of it touches the code ([written again](regenerating.md#conformance-tests-in-the-work-loop)). They go in one pulse, as far as a size guardrail lets; `one by one` (or `separately`, `one at a time`) has a pulse a functional spec. No other words are taken: there is no plan to guide. The module is found as `/regenerate` finds it. Asking for them is asking for them on: with conformance tests off, `/conform` turns them on first - `conformance-tests: true`, written where the module's value comes from - and says so: the one way the chat's work has them turned on, as the `conform` tool is refused while they are off. What would start nothing is found from the \*\*\*plain before anything is said - 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
84
|
- **`/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 -
|
|
85
|
+
- **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
86
|
- **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
87
|
- **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
|
|
88
|
+
- **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
89
|
- **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
90
|
- **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
91
|
- **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 +123,7 @@ Every regeneration runs on the coding model unless you say otherwise. Say it in
|
|
|
129
123
|
|
|
130
124
|
| kind of work | covers |
|
|
131
125
|
| --- | --- |
|
|
132
|
-
| \*\*\*plain changes | \*\*\*plain diff pulses
|
|
126
|
+
| \*\*\*plain changes | \*\*\*plain diff pulses |
|
|
133
127
|
| functionalities | a functionality or a whole module regenerated, functionalities regenerated again, conformance |
|
|
134
128
|
| everything | both |
|
|
135
129
|
|
|
@@ -147,11 +141,11 @@ A provider failure - no credits, bad key, rate limit - is raised with the provid
|
|
|
147
141
|
|
|
148
142
|
### Models from a pi extension
|
|
149
143
|
|
|
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
|
|
144
|
+
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
145
|
|
|
152
146
|
## Module history
|
|
153
147
|
|
|
154
|
-
Each `plain_modules/<module>` is a git repository whose git directory is `.plaingit` rather than `.git`, so it stays plain files to your own repository. A commit is made after every step that changes the module - a regeneration, a functionality regenerated, a conformance run, a regression repair, a \*\*\*plain change. `/lineage [module]` and `lineage` show it.
|
|
148
|
+
Each `plain_modules/<module>` is a git repository whose git directory is `.plaingit` rather than `.git`, so it stays plain files to your own repository. A commit is made after every step that changes the module - a regeneration, a functionality regenerated, a conformance run, a regression repair, a \*\*\*plain change. `/lineage [module]` and `turri lineage <module> [commit]` show it; the chat reads it with git.
|
|
155
149
|
|
|
156
150
|
The last commit is also the last known good state. Every regeneration, functionality regenerated, \*\*\*plain change and conformance run starts by putting the codebase it works in back to it, so if turri was stopped or restarted mid-pulse, whatever that pulse left half-written is undone first - and one that does not pass is undone the same way when it ends, commits and all. Only work that passed is committed. Installed dependencies and caches are not in the history and stay.
|
|
157
151
|
|
|
@@ -170,7 +164,7 @@ The logs are in `.turri/debug/` in the project, beside `plain_modules`, one per
|
|
|
170
164
|
|
|
171
165
|
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
166
|
|
|
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.
|
|
167
|
+
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
168
|
|
|
175
169
|
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
170
|
|
|
@@ -196,7 +190,7 @@ It is in `.turri/ledger/` in the project, a JSON line an event, one file a run -
|
|
|
196
190
|
|
|
197
191
|
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
192
|
|
|
199
|
-
|
|
193
|
+
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
194
|
|
|
201
195
|
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
196
|
|
|
@@ -208,16 +202,14 @@ The same work, without a conversation. Run it from the directory that holds the
|
|
|
208
202
|
turri parse <file.plain> # parse ***plain, its syntax and structure - no model, no API key
|
|
209
203
|
turri drift <file.plain> # what is left to regenerate - no model, starts nothing
|
|
210
204
|
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
205
|
turri regenerate <file.plain> app:add-task # regenerate a functional spec again, changed or not
|
|
213
206
|
turri regenerate <file.plain> --from-scratch # delete the module's code and tests (its lineage keeps them), regenerate all of it
|
|
214
207
|
turri regenerate <file.plain> --from-scratch-chain # the same for every module of its requires chain, from the bottom
|
|
215
|
-
turri
|
|
216
|
-
turri conform <file.plain>
|
|
208
|
+
turri conform <file.plain> app:add-task # black-box tests for one functional spec - written again when written already
|
|
209
|
+
turri conform <file.plain> --from-scratch # its tests folder taken out and written again; --from-scratch-chain, from nothing
|
|
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
|
|
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
|
-
-
|
|
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
|
-
|
|
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
|
|
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
|
|
77
|
-
- Write scenarios
|
|
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
|
-
-
|
|
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
|
-
##
|
|
39
|
+
## Conformance tests
|
|
40
40
|
|
|
41
|
-
- Conformance tests are the
|
|
42
|
-
-
|
|
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
|
|
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, without asking: conformance tests on is the person's yes to all three - 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
|
|
|
@@ -57,6 +52,7 @@ The other rules say what a spec means. This one says what turri does with a chan
|
|
|
57
52
|
|
|
58
53
|
- Never edit the code under `plain_modules/`: the next regeneration does not keep it, and the code record no longer says what the code is
|
|
59
54
|
- In order of cost: change the spec where it is wrong or silent; regenerate the functional specs whose code went bad again, by name; regenerate the module from scratch, or its whole chain - only when the person asks for it or agrees to it
|
|
55
|
+
- Bad conformance tests are fixed the same way, their code untouched: `conform` naming a functional spec whose tests are written writes them again, anew from its scenarios; `conform` from scratch takes out the tests folder at the tip of the module's chain and writes them again - from the tests of the module the tip requires, or, its whole chain, from nothing - only when the person asks for it
|
|
60
56
|
- Pulses regenerate in the background: the spec can be changed while they run, and need not wait for them. A change inside what a running pulse regenerates steers it; the rest is planned again around it
|
|
61
57
|
- A pulse that does not land is rolled back whole - code, tests and record together - and its module waits until the spec changes or the module is asked for again. Running it again unchanged usually ends the same way: look at why it did not land first
|
|
62
58
|
- A finished pulse goes to the sentinel, a chat of turri's own - unless `sentinel: false`; under `sentinel: ask`, the default, only once the person said to start it, asked by turri before it first opens in a session (declined, a pulse goes to the chat that asked for it, as with `false`): it checks the pulse, tests what was released, fixes a testing script - or where the config says the scripts are - itself and regenerates the module again, and puts anything else that is wrong to the person as a notice with what can be done. It never changes ***plain. turri installs nothing on the machine and changes none of its settings - not the sentinel, the chat, a release or any agent: a toolchain the machine lacks is the person's to install, told the exact command. A pulse that landed is told to the chat the person is in too, only to say it landed and what the sentinel does with it, and when the sentinel is done with a pulse, what it found - the chat does nothing else about either; a pulse that went wrong is not told to it - the chat's agent is given a notice's task once the person accepts it, and does that
|
|
@@ -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,
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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
package/dist/advisor-chat.d.ts
DELETED
|
@@ -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;
|