@turri-dev/cli 0.4.3-next.620bae9 → 0.4.3-next.7ada234
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 +1 -0
- package/dist/background-skills.d.ts +4 -1
- package/dist/background-skills.js +9 -1
- package/dist/capture/agents.d.ts +406 -0
- package/dist/capture/agents.js +379 -0
- package/dist/capture/area.d.ts +58 -0
- package/dist/capture/area.js +197 -0
- package/dist/capture/assemble.d.ts +112 -0
- package/dist/capture/assemble.js +453 -0
- package/dist/capture/capture.d.ts +116 -0
- package/dist/capture/capture.js +1315 -0
- package/dist/capture/chat.d.ts +29 -0
- package/dist/capture/chat.js +94 -0
- package/dist/capture/checks.d.ts +142 -0
- package/dist/capture/checks.js +649 -0
- package/dist/capture/config.d.ts +13 -0
- package/dist/capture/config.js +66 -0
- package/dist/capture/interface.d.ts +71 -0
- package/dist/capture/interface.js +199 -0
- package/dist/capture/map.d.ts +56 -0
- package/dist/capture/map.js +530 -0
- package/dist/capture/models.d.ts +4 -0
- package/dist/capture/models.js +16 -0
- package/dist/capture/plan.d.ts +7 -0
- package/dist/capture/plan.js +13 -0
- package/dist/capture/progress.d.ts +111 -0
- package/dist/capture/progress.js +266 -0
- package/dist/capture/python-interface.d.ts +3 -0
- package/dist/capture/python-interface.js +17 -0
- package/dist/capture/report.d.ts +75 -0
- package/dist/capture/report.js +268 -0
- package/dist/capture/runners.d.ts +6 -0
- package/dist/capture/runners.js +59 -0
- package/dist/capture/scripts.d.ts +26 -0
- package/dist/capture/scripts.js +38 -0
- package/dist/capture/state.d.ts +310 -0
- package/dist/capture/state.js +43 -0
- package/dist/capture/trial.d.ts +34 -0
- package/dist/capture/trial.js +89 -0
- package/dist/capture-cli.d.ts +1 -0
- package/dist/capture-cli.js +77 -0
- package/dist/chat-tab-header.d.ts +3 -2
- package/dist/chat-tab-header.js +22 -9
- package/dist/chat-tabs.d.ts +7 -1
- package/dist/chat-tabs.js +10 -6
- package/dist/chat-terminal.js +27 -6
- package/dist/chats.d.ts +14 -8
- package/dist/chats.js +46 -20
- package/dist/cli.js +32 -14
- package/dist/config-edit.js +5 -2
- package/dist/config.d.ts +15 -2
- package/dist/config.js +62 -3
- package/dist/extension.d.ts +2 -1
- package/dist/extension.js +225 -68
- package/dist/identity.js +2 -1
- package/dist/init-config.d.ts +4 -1
- package/dist/init-config.js +31 -4
- package/dist/loop-cli.js +5 -1
- package/dist/loop-tools.js +5 -1
- package/dist/new-project.d.ts +5 -0
- package/dist/new-project.js +11 -0
- package/dist/pi-launch.js +2 -0
- package/dist/pi-themes.d.ts +3 -0
- package/dist/pi-themes.js +21 -0
- package/dist/pi.d.ts +2 -2
- package/dist/pi.js +4 -4
- package/dist/plain-code-blocks.d.ts +14 -0
- package/dist/plain-code-blocks.js +56 -0
- package/dist/pointer-hover.d.ts +1 -1
- package/dist/pointer-hover.js +4 -0
- package/dist/question-dialog.d.ts +5 -0
- package/dist/question-dialog.js +26 -3
- package/dist/regenerate/agent-env.js +5 -1
- package/dist/regenerate/command-check.js +80 -11
- package/dist/regenerate/job-panel.d.ts +5 -107
- package/dist/regenerate/job-panel.js +4 -289
- package/dist/regenerate/loop.js +9 -1
- package/dist/regenerate/side-panel.d.ts +2 -0
- package/dist/regenerate/side-panel.js +32 -5
- package/dist/regenerate/spec-map-view.d.ts +2 -2
- package/dist/regenerate/test-scripts.d.ts +5 -0
- package/dist/regenerate/test-scripts.js +4 -0
- package/dist/reopen.d.ts +29 -0
- package/dist/reopen.js +47 -0
- package/dist/sentinel-chat.js +7 -2
- package/dist/sentinel.d.ts +1 -1
- package/dist/sentinel.js +3 -1
- package/dist/setup.js +9 -1
- package/dist/terminal-notifications.d.ts +37 -0
- package/dist/terminal-notifications.js +164 -0
- package/docs/README.md +2 -0
- package/docs/capture.md +227 -0
- package/docs/chats.md +6 -3
- package/docs/config.md +18 -4
- package/docs/development.md +4 -1
- package/docs/hosting.md +2 -2
- package/docs/launch.md +2 -2
- package/docs/regenerating.md +1 -1
- package/docs/sandbox.md +4 -2
- package/docs/sentinel.md +11 -11
- package/docs/theming.md +3 -3
- package/docs/using.md +7 -3
- package/genome/capture/capture.md +26 -0
- package/genome/capture/check-conventions.md +5 -0
- package/genome/capture/check-reference.md +12 -0
- package/genome/capture/compact.md +7 -0
- package/genome/capture/concepts.md +3 -0
- package/genome/capture/divide.md +9 -0
- package/genome/capture/feature.md +45 -0
- package/genome/capture/interface.md +9 -0
- package/genome/capture/modules.md +25 -0
- package/genome/capture/outline.md +11 -0
- package/genome/capture/python-interface.py +111 -0
- package/genome/capture/readability.md +12 -0
- package/genome/capture/reference.md +10 -0
- package/genome/capture/runners/python-requirements.sh +67 -0
- package/genome/capture/split.md +9 -0
- package/genome/capture/survey.md +39 -0
- package/genome/capture/trial.md +18 -0
- package/genome/capture/verify.md +7 -0
- package/genome/rules/turri-regeneration.md +1 -1
- package/package.json +1 -1
package/docs/chats.md
CHANGED
|
@@ -19,7 +19,7 @@ The session's, shared by every chat:
|
|
|
19
19
|
- **what launches started** - it runs until turri ends or `/halt launched <name>`, whatever chats are opened or closed - and the launch track;
|
|
20
20
|
- **the ledger** - one run, each event with the id of the chat its work was asked for in (`chat`), and `chat.opened` and `chat.closed` as they happen.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Each finished pulse appears in the session's notifications. When the [sentinel](sentinel.md) is on, it checks the pulse in the background and puts its findings and conclusion there too. Your conversation stays on what you asked; accepting a notice's action starts work in the chat it names. Closing a chat stops its turn, never its pulses.
|
|
23
23
|
|
|
24
24
|
## In the terminal
|
|
25
25
|
|
|
@@ -30,18 +30,21 @@ A pulse's end goes to the [sentinel](sentinel.md) - a chat of turri's own, opene
|
|
|
30
30
|
| Click a tab's `×`, `/chat close 3` | close that chat; closing a background chat leaves the one shown in place |
|
|
31
31
|
| `/chat close`, `alt+w` | close the chat shown and switch to the next one |
|
|
32
32
|
| `/chat` | a list of the chats, to pick one - or a new one |
|
|
33
|
+
| `***plain ›` → `notifications`, `/notifications` | finished pulses and sentinel findings across this session; open a notice to read its evidence and answer it |
|
|
33
34
|
| `/new` | the same as `/chat new` |
|
|
34
35
|
| `/resume` | a saved chat, opened as a chat of its own beside the others - or shown, when it is open |
|
|
35
36
|
| `ctrl+c` | what the chat shown is doing, stopped - its turn, a skill or a tool in it, a `!` command, a compaction; in a chat doing nothing, a draft in the editor cleared, else turri left, every chat with it |
|
|
36
37
|
|
|
37
|
-
The
|
|
38
|
+
The welcome banner appears only in the first tab. Typing or pasting a draft leaves it visible. Submitting a non-empty message or slash command, including `/regenerate`, hides it for the rest of the session. After that, and in new chats, only the tab row remains above the conversation.
|
|
39
|
+
|
|
40
|
+
When the tabs scroll away, they stay at the top of the fullscreen terminal. A fresh session starts with one tab and a `+` button. Click `+` to open a chat, a tab's title to switch to it, or its `×` to close it. The active tab has the accent fill and a `▸` marker when there is room. Moving the pointer over a control highlights and underlines that target, including the close button independently of its tab. Each tab shows its number and title - "new chat" until the first message, unless `/name` gives it a name - and a spinner while it works, `?` while a question waits, or `•` when it said something since you last looked. In `--tui-mode regular` the tabs scroll with the terminal; use the commands or keys to switch.
|
|
38
41
|
|
|
39
42
|
A message you send while a chat's agent works is shown under the chat at once, shaded and marked `not read yet`, and stays under what the agent writes and the tools it calls until the agent reads it - at the end of its current step - when it goes into the chat as a normal message, where it was read. `alt+up` takes the messages waiting back into the editor (`src/chat-waiting.ts`). While a skill runs in the chat its own agent is the one at work, and the chat's waits for the whole run: what you type then goes to the skill's agent, shown waiting until it reads it, at the end of its current step - and is in the chat from then, where it was read. The chat's agent is told what you said to the skill when the run ends. A message the skill's agent has not read when the run ends goes to the chat's agent instead.
|
|
40
43
|
|
|
41
44
|
On macOS, `alt` is Option (⌥), and reaches turri only when the terminal sends Option as Meta - otherwise ⌥N is the dead key for ñ and ⌥1 types `¡`, and nothing reaches turri. turri says so as a session's second chat opens. To turn it on: Ghostty, `macos-option-as-alt = true` in its config; iTerm2, Profiles → Keys → Left Option key: Esc+; Terminal.app, Profiles → Keyboard → Use Option as Meta key; Kitty, `macos_option_as_alt yes`; WezTerm, `send_composed_key_when_left_alt_is_pressed = false`. `/chat` works without it.
|
|
42
45
|
|
|
43
46
|
- **A hidden chat's questions** wait until you show it, then come up one after another. What it says in passing is said as you show it; what it keeps on the screen - a skill's progress, the job panel - is put back each time; what you had typed in its editor and not sent is still there.
|
|
44
|
-
- **The side panel** belongs to the session and stays open when you switch chats. Click `***plain ›` at the right end of the chat tabs to open
|
|
47
|
+
- **The side panel** belongs to the session and stays open when you switch chats. Click `***plain ›` at the right end of the chat tabs to open it; click `***plain ‹` to close it. The button turns pink and spins while turri plans or runs pulses. Its tabs are `***plain`, `pulses` and `notifications`; `× close` also closes it. From the keyboard, `ctrl+h` opens the panel, `p` switches between the map and pulses, and `n` opens notifications. A terminal under 104 columns shows the panel full screen.
|
|
45
48
|
- **A long command** - `/regenerate`, planning a module from scratch - does its work in the background once it is under way: the chat, and switching to another, stay free while the planner plans.
|
|
46
49
|
- **`ctrl+c`** reaches the chat shown and nothing else: another chat's turn and skill go on, and so do the pulses - `/halt` stops one. A skill stopped keeps its run, for the model to continue with `resume`. At a question - the chat's `ask_user`, a skill's interview - `ctrl+c` declines it, and the asker is told so and goes on - each question it is pressed at, however many in a row. A skill is stopped by `ctrl+c` with no question open. A second press straight after one that stopped something does nothing, so pressing twice to be sure does not leave turri; once the chat is doing nothing, the next one does - with what every other chat is doing. A host has the same as `interrupt(id)`, and `decline(id)` for a question ([hosting](hosting.md)).
|
|
47
50
|
- **The sentinel** is a chat in the strip like the others, `sentinel`, and never shown by itself: it closes like any chat, and the next pulse that finishes opens it again. Each pulse it checks in a fresh conversation, replacing the one in its tab. With it on, you open up to eight chats - the ninth slot is its. See [the sentinel](sentinel.md).
|
package/docs/config.md
CHANGED
|
@@ -18,7 +18,7 @@ Amazon Bedrock asks three more things, from [pi](https://pi.dev)'s catalogue: wh
|
|
|
18
18
|
|
|
19
19
|
`--harness-model` and `--coding-model` name the two models instead, for any vendor: provider/model-id without a thinking level - `turri init-config --harness-model amazon-bedrock/global.xai.grok-4.7 --coding-model amazon-bedrock/global.xai.grok-4.6`. They are written wherever the vendor's own would be - the two models with their thinking, the commented-out `judge-model` and `models:` examples - and the vendor, maker and geography are read from them. `--judge-model` names the strong one the judging examples use, the harness model unless given. Each is checked against [pi](https://pi.dev)'s catalogue first: one it does not have, or that is not a chat model, is named, with the closest it has, and nothing is written.
|
|
20
20
|
|
|
21
|
-
Each is written with how hard it thinks - `harness-model: openai/gpt-6-astra:medium`, `coding-model: openai/gpt-6-luna:low` - so the file shows it. The reviews and judges run on the coding model but think medium (see [models per role](#models-per-role)).
|
|
21
|
+
Each is written with how hard it thinks - `harness-model: openai/gpt-6-astra:medium`, `coding-model: openai/gpt-6-luna:low` - so the file shows it. `init-config` also writes and prints the three active capture tiers. On an existing config it fills in missing capture entries and preserves explicit overrides. The reviews and judges of a regeneration run on the coding model but think medium (see [models per role](#models-per-role)).
|
|
22
22
|
|
|
23
23
|
They are an example, not a requirement - any model [pi](https://pi.dev) supports works, signed in any way [pi](https://pi.dev) supports; `other` is the starting point for another provider. What we recommend is that split, a capable model to talk to and a smaller, cheaper one for the coding. Once written, it says what to do next: the key to set in your shell - or `/login` in turri, which [pi](https://pi.dev) keeps in `~/.pi/agent/auth.json` - and that the file belongs to that folder: turri reads the nearest `config.turri.yaml` upwards from where it starts, so one written anywhere else is not seen.
|
|
24
24
|
|
|
@@ -107,7 +107,7 @@ models: # each agent role's model, thinking and tur
|
|
|
107
107
|
| `rules-off` | a list of rule names - `integrations`, `concise-specs`, the files of `genome/rules/` without `.md` - left out of the conversation's prompt and every \*\*\*plain-writing agent's: a rule this project's own skills or AGENTS.md replace, such as one that says to probe a live API before any \*\*\*plain is written. `turri init-config` writes it with `integration-embedded`, `integration-embedded-testing` and `integration-standalone` - take them out when the project writes an integration against a REST API. The project's alone | none |
|
|
108
108
|
| `allow-to-stop-jobs` | `true` or `false`: whether turri stops a running job \*\*\*plain has moved on from - a functional spec it regenerates changed, or a file one links was edited - rolls it back and regenerates \*\*\*plain as it now is. `false`: the job runs to its end and lands, and what changed since is regenerated on top of it by the next job - see [regenerating the code](regenerating.md). Your own `halt` stops a job either way | `true` |
|
|
109
109
|
| `launch-after-pulse` | `true` or `false`: whether every pulse that lands code is launched, in the chat, in the background - the pulse ends as it lands, and the codebase's next pulse does not wait: the commit it landed goes on the [launch track](launch.md#the-launch-track), one launch of a codebase at a time, the newest commit winning. An agent on the coding model launches it, following the project's launch guidance (what was passed to `launch` this session, AGENTS.md, the project's skills) for how, or from `dist/<module>` without any - see [launch](launch.md#after-every-pulse). The sentinel tests each pulse in a launch that holds its commit; with it off, the chat is told how each launch went. `turri init-config` writes `true`. Formerly `release-after-pulse`: a file that still has it has it renamed as turri first reads it | `false` |
|
|
110
|
-
| `sentinel` | `ask`, `true` or `false`: whether
|
|
110
|
+
| `sentinel` | `ask`, `true` or `false`: whether the sentinel checks each finished pulse, tests what was launched under `launch-after-pulse`, and reports findings in notifications. `ask`: answer the start question in notifications before it first opens in a session - see [starting it](sentinel.md#starting-it); `true`: it opens without asking. `/sentinel` sets it from the chat. `turri init-config` writes `ask` | `ask` |
|
|
111
111
|
| `conformance-tests` | whether functional specs are conformance tested - black-box tests of the built software against the scenarios of their test plain files, run with the whole suite as more lands. `false`: none - no scenarios written or tested, no conformance testing script, and the chat's `conform` refused. Off by default for fast iteration - they make each change take about twice as long - and turned on by the person, with `/conform` - see [conformance tests](#conformance-tests). A module's `config.turri.<module>.yaml` can set its own | `false` |
|
|
112
112
|
| `test-dir` | the folder of the test plain files, by path from the project root: a module's are every `.plain` file in `<test-dir>/<module>/`, each a functional spec's conformance and acceptance scenarios - see [test plain files](parser.md#test-plain-files). A module's `config.turri.<module>.yaml` can set its own | `tests` |
|
|
113
113
|
| `base-folder` | a folder, by path from the project root, that a codebase requiring no other module starts from instead of nothing - an existing codebase to build on, files to use (images, animations, fonts), or both. It is copied in once, before the codebase's first pulse, and never written to: from a git repo what git sees, else every file but `.git` and installed dependencies. The \*\*\*plain may refer to it, and link into it; a codebase built on another starts from that one's code, base folder and all. A module's `config.turri.<module>.yaml` can name its own - see [the base folder](regenerating.md#the-base-folder) | none: the codebase starts empty |
|
|
@@ -139,6 +139,9 @@ Keys are written with dashes; underscores are read the same (`mutation_testing`)
|
|
|
139
139
|
| `chat` | `turri`'s model - the same as `harness-model`, which it wins over |
|
|
140
140
|
| `sentinel` | [the sentinel](sentinel.md): checks every finished pulse, and tests what was launched. Unnamed, the chat's model |
|
|
141
141
|
| `planner` | the conversation's side: the planner's agents. Unnamed, the chat's model |
|
|
142
|
+
| `capture-exploration` | gathers the interface reference from the original code. Claude default: Haiku low |
|
|
143
|
+
| `capture-analysis` | checks evidence and conventions, outlines areas and features, and trials scenarios on the original. Claude default: Sonnet low |
|
|
144
|
+
| `capture` | reasons about requirements, writes and revises \*\*\*plain and writes custom runners. Claude default: Opus medium. `init-config` writes all three active [capture tiers](capture.md#models); setting one does not change the others |
|
|
142
145
|
| `diagnosis` | the diagnosis of a job that failed for good: why it did not land, and what to do. Unnamed, the coding model the job ran on, thinking medium |
|
|
143
146
|
| `launch` | the launch agent - the chat's `launch`, `turri launch` and launch-after-pulse's: it follows steps - a script, a start command - so it runs on the coding model, thinking low |
|
|
144
147
|
| `coding` | the coding agent, the code fixer of a conformance run and the repair agent - the same as `coding-model`, which it wins over. `--model` on the command line, or a model a call to `regenerate` or `conform` names, wins over both |
|
|
@@ -152,7 +155,7 @@ Keys are written with dashes; underscores are read the same (`mutation_testing`)
|
|
|
152
155
|
|
|
153
156
|
What an entry leaves out it takes from `default`: `reviewer: { thinking: low }` runs the default model, thinking little. A turn limit is the role's own, else `default`'s, else `turn-limit:`, else two minutes. A module's `config.turri.<module>.yaml` lays its own `models:` over the project's, role by role - all but `chat`, the project's alone.
|
|
154
157
|
|
|
155
|
-
A role whose thinking nothing names - neither its entry, `default`'s, nor a `:level` on the model it runs on - thinks as its kind of work needs: **low** for
|
|
158
|
+
A role whose thinking nothing names - neither its entry, `default`'s, nor a `:level` on the model it runs on - thinks as its kind of work needs: **low** for `coding`, `conformance`, `explorer`, `launch` and `capture-analysis`, and **medium** for `reviewer`, `test-reviewer`, `judge`, `arbiter`, `debugger`, `planner`, `capture` and `diagnosis`. Capture analysis and a judging role that falls back on the coding model take its model alone, not its thinking. The conversation keeps its own level, as [pi](https://pi.dev) sets it.
|
|
156
159
|
|
|
157
160
|
The thinking level reaches the model as each provider takes it. OpenAI's models on Bedrock are sent it as their reasoning effort (`none`, `low`, `medium`, `high`, `xhigh`) by turri itself, as [pi](https://pi.dev) sends them none.
|
|
158
161
|
|
|
@@ -286,4 +289,15 @@ turri's settings were once in `config.yaml`, and a module's own in `config.<modu
|
|
|
286
289
|
|
|
287
290
|
The first time turri itself writes a setting there with `/settings`, it copies `config.yaml` to `config.turri.yaml` and each `config.<name>.yaml` to `config.turri.<name>.yaml` first, leaves the old files as they are, and from then on reads only the new ones. `turri init-config` copies the modules' files the same way, but writes `config.turri.yaml` as its quick start, taking from `config.yaml` only the keys turri reads too - `unittests-script`, `conformance-tests-script` and `prepare-environment-script`, say - each in its place in the file, and saying which keys it left: `template_dir`, `verbose`, `api`, the other tool's alone. The two models are the vendor's, never taken. To change a setting by hand in such a project, do the same: copy the files to their new names, and edit the copies - never `config.yaml`. Writing a `config.turri.yaml` of your own beside it is the same move: from then on `config.yaml` is not read, its testing scripts with it. For a headless run that only needs conformance tests or another judge, or review, those options leave the files alone: `--conformance-tests`, `--judge-model`, `--review true|false`, and the models' too.
|
|
288
291
|
|
|
289
|
-
Keys turri does not read - another tool's `verbose`, `api-key`, `build-folder`, ... - are ignored without a word, and so is a value of the wrong type.
|
|
292
|
+
Keys turri does not read - another tool's `verbose`, `api-key`, `build-folder`, ... - are ignored without a word, and so is a value of the wrong type.
|
|
293
|
+
|
|
294
|
+
## A config that does not parse
|
|
295
|
+
|
|
296
|
+
A `config.turri.yaml` - or a module's own file, or a `config.yaml` turri still reads - that is not valid YAML is read as empty: none of it applies, and turri would run on its defaults and [pi](https://pi.dev)'s, the models among them - pi's own default model, which may not be one your credentials reach. A key set twice is the usual way in: a second config pasted under the first. So turri says it, never silently (`configProblems` in `src/config.ts`), naming the file, the line and what is wrong - `config.turri.yaml, line 13: conformance-tests is set twice`:
|
|
297
|
+
|
|
298
|
+
- **The chat** says it under the banner, in the error colour, as it starts.
|
|
299
|
+
- **Nothing is regenerated with it.** `regenerate`, `conform`, `/regenerate`, `/conform` and `turri regenerate` refuse to start a pulse until it parses, saying why - as they refuse a module that cannot be built with its config.
|
|
300
|
+
- **A capture** started where it is in use refuses to start, since the captured project starts as that config ([capture](capture.md)).
|
|
301
|
+
- **`turri doctor`** lists it first among the project's checks.
|
|
302
|
+
|
|
303
|
+
Fix it - each key set once - and ask again.
|
package/docs/development.md
CHANGED
|
@@ -64,7 +64,10 @@ The workflow signs in to npm with npm's trusted publishing (OIDC), not a token:
|
|
|
64
64
|
| `src/regenerate/pulse-files.ts` | what a pulse writes only for a person - its logs, outputs, temporary files, its chain's installed dependencies - removed as it ends outside debug mode |
|
|
65
65
|
| `src/regenerate/failure-reports.ts` | why a pulse that failed or finished without landing did - what `pulses` says of it - kept in `.turri/pulses/<id>.md` whatever the debug setting, for a later session |
|
|
66
66
|
| `src/regenerate/ledger.ts`, `src/regenerate/ledger-view.ts` | the ledger: what turri did, as typed facts, in `.turri/ledger/` - `record()`, read back for `pulses` - see [the ledger](using.md#the-ledger) |
|
|
67
|
-
| `
|
|
67
|
+
| `src/capture/`, `src/capture-cli.ts` | [capture](capture.md): the map, areas folded to a budget, the agents and the checks of what they hand over, assembling the modules, the testing scripts, the report, resuming, its status while it runs - and `turri capture` |
|
|
68
|
+
| `src/reopen.ts` | a chat opened again in another folder by `turri` once it quits - into the project a capture wrote |
|
|
69
|
+
| `src/plain-code-blocks.ts` | \*\*\*plain fenced as ` ```plain ` in the chat, highlighted by turri's grammar - pi-tui's Markdown patched |
|
|
70
|
+
| `genome/` | what turri knows and can do: `genome/skills/`, the skill library, `genome/rules/`, the \*\*\*plain authoring rules, and `genome/capture/`, capture's prompts |
|
|
68
71
|
|
|
69
72
|
## Known edges
|
|
70
73
|
|
package/docs/hosting.md
CHANGED
|
@@ -171,11 +171,11 @@ The [sentinel](sentinel.md) is one of the host's chats: turri opens it with the
|
|
|
171
171
|
- **A conversation a pulse.** The sentinel checks each pulse from scratch, in a conversation of its own - one pulse at a time, the others waiting their turn. The chat keeps its id; its session is replaced. As it starts on a pulse, the session it had is stopped and let go (`abort`, `dispose`), a new one is made in its place, and `onChatSession(chat, session)` comes with it - before the pulse is put to it - then `onChats`; `session(id)` returns the new one from then on. A host that follows the sentinel's chat subscribes to that session in place of the old - an `onChats` listener that follows only the ids it has not seen would hear nothing more of it. The first pulse goes to the session the chat was opened with: there is no `onChatSession` for it. Each conversation's first message is the hidden brief of its pulse - `customType: "turri_sentinel_pulse"`, `details.jobId` - so a host that splits the sentinel's work by pulse on it still can; the conversations before are not in the new session, and what the host showed of them is its own to keep.
|
|
172
172
|
|
|
173
173
|
- **Notices.** What it finds wrong comes as `onNotice(notice)`: `{ id, chat, severity: "error" | "warning" | "info", summary, evidence: string[], actions: [{ label, task }], module?, pulse?, job?, ignorable?, state: "open" }`. Draw it in the chat `chat` names - the one `focus` last named, or, while that is the sentinel, the chat that asked for the pulse. It is drawn there as a card in the transcript too. A host given `onNotice` answers it itself - the terminal's dialog is not opened - with `answer(id, …)`: `{ action: index | label }` starts that chat's agent on the action's task, `{ steer: text }` on the person's words, `{ dismiss: true }` on nothing, this once. A notice with `ignorable: true` - a gap in the \*\*\*plain the build settled with an assumption, which the person may leave as it is - takes `{ ignore: true }` too: offer it as its own button beside the actions. Nothing is done in the chat, the notice ends `state: "ignored"` (`"ignored"`), and turri writes it to the sentinel's guidance, so it is not raised again in this session or the next; on a notice without `ignorable`, `{ ignore: true }` is `"refused"` and the notice stays open. `onNoticeOver(notice)` comes as it is answered - and when a newer notice about its module supersedes it (`state: "superseded"`) - for the host to take the card down. `notices()` lists the open ones.
|
|
174
|
-
- **Fixes it made.** The sentinel fixes the project's testing scripts and their config itself ([what it may do](sentinel.md#what-it-may-do)), and says so as a notice with `kind: "fixed"`, `severity: "info"`, no actions, the lines before and after in `evidence`: a note, with nothing to answer. Draw it as one - its card with a way to put it away (`answer(id, { dismiss: true })`), no "say what to do instead". It never supersedes a notice about its module. The terminal
|
|
174
|
+
- **Fixes it made.** The sentinel fixes the project's testing scripts and their config itself ([what it may do](sentinel.md#what-it-may-do)), and says so as a notice with `kind: "fixed"`, `severity: "info"`, no actions, the lines before and after in `evidence`: a note, with nothing to answer. Draw it as one - its card with a way to put it away (`answer(id, { dismiss: true })`), no "say what to do instead". It never supersedes a notice about its module. The terminal puts it in notifications.
|
|
175
175
|
- **The machine is the person's.** turri installs nothing and changes no setting of the machine's or the person's shell, in any chat, the sentinel's included - and through a host's tools as through its own: a tool call whose input has a `command` string - a host's `terminal_run` - is refused when the command would (`machineChange`), with what to do instead (`machineChangeReason`), as turri's own `bash` is; and the sentinel's, also when it writes a `.plain` file, or starts or runs the code in `plain_modules` - what nobody launched: it tests what is launched. A tool that types into what already runs - a terminal's `terminal_type` at a shell prompt - is the host's to check: `machineChange(text)` says whether a line would change the machine, and why.
|
|
176
176
|
- **Starting it.** Under `sentinel: ask` - as it is unset - the person is asked before it first opens in the session: a notice with `kind: "sentinel-start"`, `severity: "info"`, in the chat `chat` names, its `summary` the question in one sentence, no `evidence`, and its actions the answers - `Start the sentinel`, `Start it, and don't ask again`, `Not this session`, `Turn it off for this project`. Draw it as a question rather than as something wrong. `answer(id, { action })` answers it, by index or label - `"done"` - and `{ dismiss: true }` is not this session; turri writes `sentinel:` itself for the two that choose for the project. Until it is answered, the pulses that finish are held: neither the sentinel nor the chat hears of them. A host that offers the setting too writes it as `/settings` does - `ask`, `true` or `false` (see `configSettings`).
|
|
177
177
|
- **Conclusions.** As the sentinel is done with each pulse - all well or not - `onConcluded({ job, verdict: "holds" | "wrong", summary, module, pulse, chat })` comes, and the chat `chat` names - the one `focus` last named, as for a notice - shows it and its agent says so in a line. A pulse turri cannot brief it on - what runs cannot hold the pulse's commit, turri's own error - ends `verdict: "unchecked"`, with an error shown in that chat as well.
|
|
178
|
-
- **A host that shows them itself.** With the sentinel on, the
|
|
178
|
+
- **A host that shows them itself.** With the sentinel on, the default host has the chat report each landed pulse and each conclusion in a turn of its own. A host with a notification centre passes `pulseEndsShown: true` and presents them from `onJobChange` and `onConcluded`. Both still reach the chat - `customType: "turri_job_landed"` and `"turri_sentinel_concluded"`, hidden and starting no turn - so it can answer when asked. The terminal uses this quiet delivery with its own notifications tab. Host notice actions, the sentinel's briefs and checks, and delivery with the sentinel off are unchanged.
|
|
179
179
|
- **Checks.** `check({ module, funcIds })` asks the sentinel to test functional specs of one module - the person picked them on a list of its built ones, say - in the background, on its own judgement, reported as a pulse is. `module` is the module whose launch is checked, by name; `funcIds` the functional specs to test, each `module:func-id` - of that module, or of any module its requires chain builds on, whose code its codebase holds: `check({ module: "predators", funcIds: ["depths:gene-fragments"] })`. A bare func-id is the module's own. The check and its brief name each as `module:func-id`. It returns `{ check: id }` at once, or `{ refused: why }`, saying which: the sentinel off (`sentinel: false`), or not started this session; a module not in the project's folder, an import module, one that does not parse; a name outside its chain - `Not in predators' codebase: arena:waves - arena is not predators or a module its requires chain builds on (depths, ocean).`; a func-id its module does not have; one not built in the module's own codebase as its \*\*\*plain has it now - with where the module's code is built on instead, when it is. What is tested is what is launched of the module - its own codebase's code, which holds the code of every module its requires chain builds on - never what a pulse is writing, and never another module's: turri does not choose one for it. Under `sentinel: ask`, a check asked before the sentinel was started puts the start question first, as a pulse does - `check` set on the notice - and waits for the answer.
|
|
180
180
|
- **Queued with the pulses.** It waits its turn behind the sentinel's work, and is taken in a conversation of its own: `onChatSession`, then the conversation's first message, the hidden brief of the check - `customType: "turri_sentinel_check"`, `details: { checkId, module, funcIds }`. A pulse of its module that lands meanwhile waits for it, rather than stopping it.
|
|
181
181
|
- **In what is launched.** The sentinel launches nothing. Once the module's launches are settled - nothing launching, nothing waiting to - it is told what runs and where, as for a pulse, and each functional spec's text and scenarios, as turri reads them, to test those and not the module's others. With nothing of the module launched - never, or halted - the check ends unchecked, its summary saying so in the person's words - `Not checked: nothing of app is launched to test it in - ask the chat to try it first, which launches it.` - and with no notice: it is an answer, not an error. When the module's last launch did not come up, the sentinel is told why, and that is its finding.
|
package/docs/launch.md
CHANGED
|
@@ -73,8 +73,8 @@ With `launch-after-pulse: true` in `config.turri.yaml`, turri launches what each
|
|
|
73
73
|
|
|
74
74
|
The launch agent finds the guidance as for any launch: what the chat passed to `launch` earlier for the codebase, the project's AGENTS.md and its skills. The setting is the word to launch; the guidance says only how - without any, the code goes to `dist/<module>` and is started from there.
|
|
75
75
|
|
|
76
|
-
- **With the [sentinel](sentinel.md) on
|
|
77
|
-
- **With `sentinel: false`**,
|
|
76
|
+
- **With the [sentinel](sentinel.md) on**, the terminal puts the finished pulse in notifications. Once the launch holds its commit, the sentinel tests it and adds its conclusion there. A launch that did not come up is a finding like any other. A host hears every launch as it is asked for, starts and ends (`onLaunch`) - one out already once, as launched.
|
|
77
|
+
- **With `sentinel: false`**, finished pulses still appear in the terminal's notifications. The chat that asked for the pulse hears when the launch ends: where it runs, or why it did not come up - unless a newer launch replaced it, whose end is told instead. It then does what it was told to do once something is launched - a host such as a desktop app tells it, in its `surface`, to open it where the person can watch and say what to test.
|
|
78
78
|
|
|
79
79
|
Off without the key: launching after a pulse is then the chat's, when its guidance says so. `turri init-config` writes `launch-after-pulse: true`.
|
|
80
80
|
|
package/docs/regenerating.md
CHANGED
|
@@ -365,7 +365,7 @@ A conformance job is a \*\*\*plain diff's conformance run: the tests of its chan
|
|
|
365
365
|
|
|
366
366
|
A functional spec with no scenarios is not listed: `parse` shows it as "no scenarios - not tested".
|
|
367
367
|
|
|
368
|
-
While a codebase's work is being planned into jobs, with nothing running there, what is planned says so - the conformance tests being planned, or the work - rather than showing nothing until the plan is made. A module asked for - `regenerate`, from scratch, functionalities again - shows its work as being planned from that moment, before its code is deleted and what is left is worked out, not only once the planner runs: in the loop's status, which a host draws its plan from, and in the job panel - a module the loop holds nothing of yet, as when turri was just opened, too. A \*\*\*plain change is looked at quietly.
|
|
368
|
+
While a codebase's work is being planned into jobs, with nothing running there, what is planned says so - the conformance tests being planned, or the work - rather than showing nothing until the plan is made. A module asked for - `regenerate`, from scratch, functionalities again - shows its work as being planned from that moment, before its code is deleted and what is left is worked out, not only once the planner runs: in the loop's status, which a host draws its plan from, and in the job panel - a module the loop holds nothing of yet, as when turri was just opened, too. One whose chain has a module below it not built at all is shown waiting for that module instead, from the moment its codebase is tracked - `top.plain - waits for base` - never as being planned while the codebases below it are looked at first, each taking the planner's time: nothing plans it until the one below is built. A \*\*\*plain change is looked at quietly.
|
|
369
369
|
|
|
370
370
|
**What a conformance job tests is built.** As a conformance job starts, the harness reads the code record, `code/.turri.json`, and checks that it has every functional spec the job adds or changes tests for, as the job has it. One it does not have stops the job before any agent runs: its report says which are not built, the conformance tests halt, and the chat model tells the person. They are tried again once the code or \*\*\*plain changes. Code jobs and conformance jobs are planned apart, each track on its own: a job is one or the other. A module built on another starts with the tests record below it, as what it inherits: none of its own tests is written yet.
|
|
371
371
|
|
package/docs/sandbox.md
CHANGED
|
@@ -4,6 +4,8 @@ A regenerating agent is building one module. It has no business reading \*\*\*pl
|
|
|
4
4
|
|
|
5
5
|
## What an agent can reach
|
|
6
6
|
|
|
7
|
+
The agent's `PATH` omits the launching shell's Python virtual environments. A venv's `bin` (or Windows `Scripts`) alone is not a usable interpreter without its neighbouring `pyvenv.cfg` and packages. Commands use the next installed Python and can create a venv inside their own workspace. No additional host directory needs to be opened to trial a Python project.
|
|
8
|
+
|
|
7
9
|
Each agent's file tools reach its own module and only the parts its role needs:
|
|
8
10
|
|
|
9
11
|
| Role | Reads | Writes |
|
|
@@ -64,10 +66,10 @@ Before an agent's command runs, its text is checked (`src/regenerate/command-che
|
|
|
64
66
|
- names the code record, `.turri.json`;
|
|
65
67
|
- writes a credential file (`.env` and its variants; a template is fine) - by redirect, `tee`, `cp`, `mv` or an edit in place;
|
|
66
68
|
- changes a setting of the machine's or the person's environment: `defaults write`, `launchctl`, `systemctl enable`, `sysctl -w`, `git config --global`, `npm config set`, a line written to a shell profile (`~/.zshrc`) or `/etc`. The same rule (`machineChange`) holds in every shell turri runs, not only the agents': the chat's and the launch agent's refuse an install or a system setting too, asked or not - turri changes nothing of the machine's;
|
|
67
|
-
- installs software outside the project: `sudo`, the system's package managers installing (`brew`, `apt`, `dnf`, `apk`, `pacman`, `choco`, `winget`, ...), toolchain managers installing (`nvm`, `sdk`, `rustup`, `pyenv`, `asdf`, ...), global installs (`npm -g`, `yarn global`, `pip --user`, `pipx`, `gem install`), a script downloaded and run (`curl ... | sh`), an installer (`.pkg`, `.msi`, `.dmg`, `.run`). The project's own dependencies - `npm install`, pip into its venv, `mvn`, `cargo`, `go mod` - are building the code, and pass;
|
|
69
|
+
- installs software outside the project: `sudo`, the system's package managers installing (`brew`, `apt`, `dnf`, `apk`, `pacman`, `choco`, `winget`, ...), toolchain managers installing (`nvm`, `sdk`, `rustup`, `pyenv`, `asdf`, ...), global installs (`npm -g`, `yarn global`, `pip --user`, `pipx`, `gem install`), a script downloaded and run (`curl ... | sh`, `| python3 -`; a response piped to an interpreter given its code by an option - `| python3 -c '...'`, `| python3 -m json.tool`, `| node -e` - is data it reads, and passes), an installer (`.pkg`, `.msi`, `.dmg`, `.run`). The project's own dependencies - `npm install`, pip into its venv, `mvn`, `cargo`, `go mod` - are building the code, and pass;
|
|
68
70
|
- kills what its pulse did not start: `pkill`, `killall`, `taskkill`, `fuser -k`, or `kill` aimed at a port or name lookup. `kill $!` and `kill %1` pass.
|
|
69
71
|
|
|
70
|
-
It reads the command as the shell reads its operators: a `>`, `<`, `|`, `&` or `;` inside quotes is text (`grep -rl "</content>" .` redirects nothing), and so is the body of a here-document fed to `cat` or `tee` under a quoted delimiter (`cat > src/App.tsx <<'EOF'`) - the text of a file being written, whose `../lib/logger` is an import, not a path. A body that runs - under an unquoted delimiter, where `$(...)` expands, or fed to a shell or an interpreter - and a `$(...)` in double quotes are checked as commands.
|
|
72
|
+
It reads the command as the shell reads its operators: a `>`, `<`, `|`, `&` or `;` inside quotes is text (`grep -rl "</content>" .` redirects nothing), and so is the body of a here-document fed to `cat` or `tee` under a quoted delimiter (`cat > src/App.tsx <<'EOF'`) - the text of a file being written, whose `../lib/logger` is an import, not a path. A body that runs - under an unquoted delimiter, where `$(...)` expands, or fed to a shell or an interpreter - and a `$(...)` in double quotes are checked as commands. So the installs, the system settings and the kills are looked for a simple command at a time, split where the shell splits - `grep -rn "main\|uvicorn.run" app` is one command, not a `.run` installer - and in the script a shell is handed as a word of its own (`bash -c "cd app; pip install --user x"`, `eval`), which a string hides from the line.
|
|
71
73
|
|
|
72
74
|
On Windows, drive letters, backslashes and any case are read as Windows has them. It knowingly misses a path built at run time (`$(...)`, a variable, a script that reads one from a file): the OS sandbox and the audit are for those.
|
|
73
75
|
|
package/docs/sentinel.md
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
# The sentinel
|
|
2
2
|
|
|
3
|
-
The sentinel is a chat of turri's own, beside the chats you talk to.
|
|
3
|
+
The sentinel is a chat of turri's own, beside the chats you talk to. It checks each finished pulse and, with `launch-after-pulse` on, tests what was launched. You can keep working and read its findings in notifications when you're ready.
|
|
4
4
|
|
|
5
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
|
|
|
9
|
-
Under `sentinel: ask`,
|
|
9
|
+
Under `sentinel: ask`, the first finished pulse adds a question to notifications: start the sentinel for this session? Open `***plain ›` and choose **notifications**, beside **pulses**, or use `/notifications`. A host receives this question as a `sentinel-start` notice. You can choose:
|
|
10
10
|
|
|
11
11
|
- **Start the sentinel** - it opens, and checks this pulse and each after it this session;
|
|
12
12
|
- **Start it, and don't ask again** - the same, and `sentinel: true` is written to `config.turri.yaml`;
|
|
13
|
-
- **Not this session**, or
|
|
13
|
+
- **Not this session**, or **Dismiss** - no sentinel until turri starts again;
|
|
14
14
|
- **Turn it off for this project** - `sentinel: false` is written.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Finished pulses appear in notifications immediately. Their reviews wait until you answer. Leaving the tab or pressing `esc` keeps the question open. Once you answer, turri does not ask again in the same session.
|
|
17
17
|
|
|
18
18
|
`/sentinel` sets it from the chat - `/sentinel ask`, `/sentinel on`, `/sentinel off`, or `/sentinel` alone to pick - written to `config.turri.yaml` as `/settings sentinel` does.
|
|
19
19
|
|
|
20
20
|
## What you see
|
|
21
21
|
|
|
22
|
-
- **
|
|
22
|
+
- The **notifications** tab is shared by all chats in the terminal session. Each finished pulse has a completion entry, even with the sentinel off. Each sentinel review has one entry: its conclusion is added to the finding or fix, alongside the evidence and actions. A conclusion does not reopen a dismissed notice or mark it unread again. Failed pulses, builds that did not pass, and reviews that found a problem or could not be checked use the warning colour (orange in the turri themes). Open an entry to see the details; **Back** returns to the list. The **mark all as read** button (`r`) clears unread marks without answering or dismissing notices. The count beside `***plain` and on the notifications tab still includes notices waiting for an answer.
|
|
23
23
|
- **The sentinel** opens with the first pulse that finishes - once you said to start it, under `sentinel: ask` - in the background: it never takes the screen, and you stay in your chat. It is a tab in the strip like any other chat - `sentinel` - marked while it works and when it has something new. Switch to it to read what it checked: it shows the pulse it is on, or the last one it checked - each pulse has a conversation of its own (below).
|
|
24
|
-
- **A notice**, when something needs you:
|
|
24
|
+
- **A notice**, when something needs you: open its `?` entry in notifications to read what is wrong, the evidence and the choices:
|
|
25
25
|
- `enter` on an action accepts it: the chat's agent is started on it - a change to the \*\*\*plain, a pulse regenerated again, a credential to provide, a setting to change;
|
|
26
26
|
- **Ignore - leave it as the build has it**, on a notice the sentinel marked ignorable: nothing is done, and it is not raised again - in this session or the next (below);
|
|
27
27
|
- **Say what to do instead…** - your own words, and the agent does that;
|
|
28
|
-
- **Dismiss
|
|
28
|
+
- **Dismiss**: nothing is done, this once - the next pulse may raise it again. `esc` goes back without dismissing.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Accepted work goes to the chat the notice was addressed to. A newer finding about the same module supersedes the old one; the old entry stays in the list but can no longer be acted on.
|
|
31
31
|
|
|
32
32
|
## What it does
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ Each pulse it checks from scratch, in a conversation of its own: its prompt, you
|
|
|
37
37
|
2. **tests what was launched**, with `launch-after-pulse` on: what runs is 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 - but not what a later pulse in the same launch changed again: that is the later pulse's check. 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 `launch-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 launch 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
|
-
5. **concludes**, last, whether all is well or not: what it checked and what it found, in a line or two.
|
|
40
|
+
5. **concludes**, last, whether all is well or not: what it checked and what it found, in a line or two. Read the conclusion in notifications, or ask your chat about it.
|
|
41
41
|
|
|
42
42
|
A host can ask it to check too: functional specs the person picks in a module - its own, or those of any module its requires chain builds on (`depths:gene-fragments` in predators') - in turri-desktop, on the preview's list of a module's built ones. It tests those, on its own judgement, in what is launched of the module - its own codebase's code - once the codebase's launches are settled, and reports as for a pulse: a notice when something is wrong, and its conclusion. The sentinel launches nothing: with nothing of the module launched - never, or you halted it - the check ends unchecked, its conclusion saying so - "ask the chat to try it first, which launches it" - and nothing else: it is an answer, not an error; when its last launch did not come up, that is what the sentinel finds out about, as for a pulse. It is refused with the sentinel off, and for a module that does not parse, a functional spec it does not have, or one not built; see [in a host](hosting.md#the-sentinel).
|
|
43
43
|
|
|
@@ -51,7 +51,7 @@ With `launch-after-pulse` on, a pulse is launched in the background on the [laun
|
|
|
51
51
|
- **The launch did not come up**: it is told why, and that is what it finds out about - a finding like any other. It tests nothing in its place: never the code in `plain_modules`, where a pulse may be writing, nor a server of its own.
|
|
52
52
|
- **You stopped the launch** (`/halt launched <module>`, or every server it started): nothing runs, and it checks the pulse alone.
|
|
53
53
|
- **Whichever it is**, it is told never to run the code in `plain_modules`, where a pulse may be writing, nor to start a server of its own - not in its shell, not with a host's terminal: what would pass there is not what you try. A server that should run and does not is its finding. A host's terminal command that starts or runs the code there - `cd plain_modules/shorty/code && .venv/bin/uvicorn …`, a program or a path there, an environment variable pointing there - is refused it, saying why; reading there is not.
|
|
54
|
-
- **What runs cannot hold it** - turri got it wrong: it is not told of the pulse. The
|
|
54
|
+
- **What runs cannot hold it** - turri got it wrong: it is not told of the pulse. The reason appears in notifications with the unchecked conclusion and in the ledger (`sentinel.refused`); the next pulse is taken.
|
|
55
55
|
|
|
56
56
|
When its codebase is launched again while it checks a pulse - a newer pulse landed, of it or of a module built on it - or what runs of it is stopped for another module's launch that needed what it held, its turn is stopped where it is, its conversation kept: what it was testing is being replaced. It takes nothing else meanwhile. Once the codebase's launches have settled - one, or several in a row - turri checks again that what runs holds the pulse's commit, and tells it, in the same conversation, to carry on: what runs now, and to do again what it was doing as the servers restarted. What runs no longer holding it, it is refused as above - for one stopped for another module's launch, saying which. A launch of another codebase that stops nothing of its own leaves it alone.
|
|
57
57
|
|
|
@@ -63,7 +63,7 @@ Two functional specs that contradict each other stop a pulse in a way only you c
|
|
|
63
63
|
|
|
64
64
|
It fixes the project's tooling itself, and nothing else:
|
|
65
65
|
|
|
66
|
-
- **It fixes** the testing scripts - `test_scripts/`, a `run_*.sh` or `prepare_environment*.sh` at the project's root, each script `config.turri.yaml` names - and, in `config.turri*.yaml`, where the scripts are (`unittests-script`, `conformance-tests-script`, `prepare-environment-script`) and `toolchains:`.
|
|
66
|
+
- **It fixes** the testing scripts - `test_scripts/`, a `run_*.sh` or `prepare_environment*.sh` at the project's root, each script `config.turri.yaml` names - and, in `config.turri*.yaml`, where the scripts are (`unittests-script`, `conformance-tests-script`, `prepare-environment-script`) and `toolchains:`. For example, if a script calls `python3` but this machine has the required version as `python`, it verifies the version, edits the script and calls `resume` to run the module again. A `fixed` notification shows what changed and why, with nothing to answer. Any other config key it changes is put back and its edit refused.
|
|
67
67
|
- **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.
|
|
68
68
|
- **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.
|
|
69
69
|
|
package/docs/theming.md
CHANGED
|
@@ -10,7 +10,7 @@ turri --use-theme dark # pi's own
|
|
|
10
10
|
|
|
11
11
|
The second form follows your terminal's light/dark appearance. The default is for `turri` only: [pi](https://pi.dev)'s settings are left alone, so a plain `pi` keeps its theme. With the themes copied to `~/.pi/agent/themes/` (`cp .pi/themes/*.json ~/.pi/agent/themes/`), `{"theme": "turri-dark"}` in `~/.pi/agent/settings.json` gives a plain `pi` the same one.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
If the same turri theme is installed in both places, the project's `.pi/themes/` copy takes precedence over the one in `~/.pi/agent/themes/`. turri does not warn about these expected copies. Theme files that fail to load and name clashes with other themes still appear in pi's startup diagnostics.
|
|
14
14
|
|
|
15
15
|
## The palette
|
|
16
16
|
|
|
@@ -36,7 +36,7 @@ Both themes, the command line's colours, the \*\*\*plain diff's, the banner's je
|
|
|
36
36
|
| indigo | `#5b57d9` | the jellyfish's bell, at its rim - nowhere else |
|
|
37
37
|
| orange | `#ff7a3d` | the jellyfish's gut, the `$` of bash mode, and everything that asks for you - what failed (`✗`), what works with limits, what needs you (the \*\*\*plain map's `!`): `error`, `warning` |
|
|
38
38
|
|
|
39
|
-
In the chat header
|
|
39
|
+
In the chat header the `+` button uses the theme's success colour. The `***plain` toggle takes a brand-pink fill and a spinner while regeneration is active; its arrow points left when the panel is open and right when closed. Tabs use the theme's `selectedBg` for their padded surfaces and `accent` for the active tab. Hover underlines the target; `×` takes the warning colour on hover to distinguish closing from switching. The side panel uses the same treatment. In the transcript, pink carries what is done and orange everything that asks for you - what failed, what works with limits, what waits on you - the mark (`✗`, `!`, `■`) telling them apart. The palette has no red.
|
|
40
40
|
|
|
41
41
|
## Why there are two
|
|
42
42
|
|
|
@@ -70,7 +70,7 @@ With tool rows carrying no background, their state is signalled by the title and
|
|
|
70
70
|
|
|
71
71
|
## \*\*\*plain diffs
|
|
72
72
|
|
|
73
|
-
A \*\*\*plain diff in the panels is not painted with the theme's colours for code: those are made for code, and the turri themes' backgrounds are all the surface colour, so a diff drawn with them would have no fills and hardly any highlighting. It has a palette of its own (`src/regenerate/plain-palette.ts`), one for a dark theme and one for a light, picked by the theme's appearance: a hue for each piece of \*\*\*plain - a section's header, the `# <id>` heading of a functional spec or a scenario (neon, bold; eggplant, bold, on a light theme), a concept, a link, text in quotes or backticks, a front matter key, a module, a comment - at least 7:1 on the surface, and a fill behind each added and removed line: on a dark theme blue whale and eggplant, on a light one neon hover and siesta tan. Every colour reads at least 4.8:1 on blue whale and 5:1 on the light fills; eggplant, the design system's only warm dark fill, takes the pinks and grauzone down to 3.7:1.
|
|
73
|
+
A \*\*\*plain diff in the panels - and \*\*\*plain fenced as ` ```plain ` in the chat - is not painted with the theme's colours for code: those are made for code, and the turri themes' backgrounds are all the surface colour, so a diff drawn with them would have no fills and hardly any highlighting. It has a palette of its own (`src/regenerate/plain-palette.ts`), one for a dark theme and one for a light, picked by the theme's appearance: a hue for each piece of \*\*\*plain - a section's header, the `# <id>` heading of a functional spec or a scenario (neon, bold; eggplant, bold, on a light theme), a concept, a link, text in quotes or backticks, a front matter key, a module, a comment - at least 7:1 on the surface, and a fill behind each added and removed line: on a dark theme blue whale and eggplant, on a light one neon hover and siesta tan. Every colour reads at least 4.8:1 on blue whale and 5:1 on the light fills; eggplant, the design system's only warm dark fill, takes the pinks and grauzone down to 3.7:1.
|
|
74
74
|
|
|
75
75
|
## The font
|
|
76
76
|
|
package/docs/using.md
CHANGED
|
@@ -15,6 +15,8 @@ Peeking is safe while a question is open - a skill's or the chat's: `ctrl+h` ope
|
|
|
15
15
|
|
|
16
16
|
While a skill runs, a line above the input shows its phases, every one by name - those done ticked, the one it is in marked, the rest to come - and where it is: the skill's name at the left edge, `phase 2 of 4` at the right, and its phases centred between them, `✓ intent ━━━━ ⠋ stack ──── ○ testing ──── ○ product`. Under it, dimmed, the phase it is in and what it does: `stack - the language, frameworks, storage and architecture`. The phases are the skill's own steps, read from its `SKILL.md`. A skill of one phase, or none, has nothing to be partway through: its line is the spinner and its name alone, `⠹ analyze-func-specs`.
|
|
17
17
|
|
|
18
|
+
To bring an existing codebase under \*\*\*plain instead, `/capture` captures it into `plain/`, in the background - nothing is asked, its progress shows above the input, and once it ends turri offers to open again in `plain/`, where its report is told and `/regenerate` builds it; only you start it (see [capture](capture.md)).
|
|
19
|
+
|
|
18
20
|
`genome/skills/` holds the rest: adding a feature, a concept, a requirement, a resource; splitting a functional spec that is too big; resolving conflicts; checking the environment - see [authoring \*\*\*plain](authoring-plain.md#the-skills). A skill run that is interrupted can be resumed where it stopped. A project can have skills of its own, in `.turri/skills/` or `.agents/skills/` - see [skills and gates](skills-and-gates.md#a-projects-own-skills).
|
|
19
21
|
|
|
20
22
|
## The tools
|
|
@@ -42,7 +44,7 @@ The agent does this work with these tools, never by running turri's command line
|
|
|
42
44
|
|
|
43
45
|
## Pulses
|
|
44
46
|
|
|
45
|
-
In the fullscreen TUI, click `***plain ›` at the right end of the chat tabs to open the spec map on the right. The panel
|
|
47
|
+
In the fullscreen TUI, click `***plain ›` at the right end of the chat tabs to open the spec map on the right. The button then points back into the chat (`***plain ‹`); click it again to close the panel, from any of its tabs. Choose `***plain` for the spec, `pulses` for the work regenerating it or `notifications` for results and notices. The selected tab is highlighted; its label stays in place. Below 104 terminal columns the panel fills the screen; `× close` returns to the chat.
|
|
46
48
|
|
|
47
49
|
Click a spec's heading or summary, or an imported file's name, to select it and toggle its details. A wrapped summary is clickable on any of its lines. Click a module tab to switch modules. In `pulses`, click a section, a pulse or a file in its diff to expand or collapse it. The arrow keys and Enter continue from the row you clicked.
|
|
48
50
|
|
|
@@ -50,8 +52,9 @@ A pulse is one unit of work regenerating the code. It was called a job, and stil
|
|
|
50
52
|
|
|
51
53
|
A regeneration takes minutes, so in the TUI every tool that regenerates starts the work as a pulse and returns straight away. The conversation carries on, and you need not wait for a pulse to finish: go on shaping the \*\*\*plain and writing its next change, ask questions, try what has landed - turri says so as each pulse starts, and never waits for one itself. A \*\*\*plain change made meanwhile steers the running pulse or is planned again around it (see below); pulses on the same module - or on modules of one `requires` chain - queue behind each other, in the order they were asked for, from the first pulse on: one queued while the module's \*\*\*plain is only a scaffold, with no functional specs yet, or while it does not parse, still holds its module, so nothing on the module runs beside it. Pulses on modules that share nothing run side by side, each with its own progress panel - two modules or ten. How many run at once is capped by what the machine has room for: past `parallel-jobs` (see [the project config](config.md#how-many-jobs-at-once)), a pulse whose turn has come waits for a free slot, and says so.
|
|
52
54
|
|
|
53
|
-
- **The
|
|
55
|
+
- **The `***plain` button** turns pink and shows a spinner while turri is preparing or planning pulses, regenerating code, or running conformance. It returns to its idle colour when that work stops. Open `pulses` for progress and `notifications` for finished work; neither takes space above the editor.
|
|
54
56
|
- **A pulse's change** is what its agent works from, not a text diff of the module's file: the items `<spec change>` gives the agent - only what the pulse's functional specs use, an import's items as well as the module's own, a code pulse's without the test reqs - each in the file it is written in, under its section, in the file's order (`change-view.ts`).
|
|
57
|
+
- **\*\*\*plain in the chat** - a block an agent fences as ` ```plain `, or with no language around a section's header - is highlighted as a \*\*\*plain diff is, by turri's own grammar in the same colours (`src/plain-code-blocks.ts`).
|
|
55
58
|
- **A \*\*\*plain diff**, in the side panel, reads as an editor shows a diff: its [\*\*\*plain](https://plainlang.org/docs/) highlighted by turri's own grammar, which started from [plyn](https://github.com/plainlang/plyn)'s - section headers, the `# <id>` heading of a functional spec or a scenario, concepts, names in backticks, text in quotes, links, the front matter - each added line filled green and each removed one red, the text on top, the fill the width of the panel ([colours](theming.md#plain-diffs)). It is shown file by file, each file's lines together under its name, with what it adds and takes out - the module being regenerated first, the rest by name, and none the diff does not change. Each line has its number in that file: a \*\*\*plain diff is of \*\*\*plain as read, with what it imports laid in, so a line is placed in the file it is written in - its links read as the parser renders them - and a removed line, in no file now, goes with the change it is part of and has no number. A line is never put in a file on a guess: one that cannot be placed is listed last, under "not found in the spec's files". Where lines of a file are not in the diff, `↕ 28 lines` says how many, as GitHub does - `↑` above the first - and names the section the lines under it are in when it is another than the one above, `↕ 28 lines · ***functional specs***`, as GitHub names a hunk's function: each section is named once.
|
|
56
59
|
- **The side panel** (`ctrl+h`, as it was left - but on the pulse that last failed, stopped or did not pass, when one has since it was last opened: the live panel that showed it is gone with the last pulse, and its announcement in the chat says `ctrl+h shows this pulse`; **`/pulses`** on the pulses; not `ctrl+j`, which a terminal without the Kitty keyboard protocol sends as a line feed, the same as `shift+enter`, and which a dialog takes for `enter`; both stay [pi](https://pi.dev)'s new-line keys. `ctrl+h` is the byte old terminals sent for backspace; a terminal set to send `^H` for its Backspace key would open the panel on it) takes the whole screen - the panel or the chat, one at a time - or, `s`, sits beside the chat: the chat on the left, the panel in the right half of the screen, and `s` again over the whole screen. It opens as it was last left, for the conversation; a terminal under 104 columns - 100 inside the screen's padding, a blank row above and below everything and two columns either side - has no room for both and shows the panel over the whole screen. It opens on **regen**: the module's \*\*\*plain itself, in full, with how much of it the code has been regenerated from drawn onto it.
|
|
57
60
|
|
|
@@ -131,7 +134,7 @@ To change [pi](https://pi.dev)'s own default, in `~/.pi/agent/settings.json`:
|
|
|
131
134
|
{ "defaultProvider": "google", "defaultModel": "gemini-3.1-pro-preview" }
|
|
132
135
|
```
|
|
133
136
|
|
|
134
|
-
A provider failure - no credits, bad key, rate limit - is raised with the provider's own message, rather than surfacing as an agent that said nothing. One that passes - overloaded, rate limited, unreachable, timed out - is waited out first, after [pi](https://pi.dev)'s own retries: six more tries, the wait doubled each time from 15 seconds up to five minutes (15s, 30s, 1m, 2m, 4m, 5m, a tenth either way so parallel jobs do not all come back at once), the agent carrying on where it was. Each wait - [pi](https://pi.dev)'s own retries too - is shown as it happens - a notification in the chat and the job panel's status, an orange line in a headless run - and listed in the run report's `turn_incidents`. So is a provider stalling: a request to the model that nothing has come back on for two minutes (`TURRI_PROVIDER_STALL`, in seconds; 0 never), said once for each silence while the turn goes on waiting. A turn turri stops itself - its time up, the agent going round in a circle - is the work's normal course and is not said, only listed.
|
|
137
|
+
A provider failure - no credits, bad key, rate limit - is raised with the provider's own message, rather than surfacing as an agent that said nothing. One that passes - overloaded, rate limited, unreachable, timed out, its stream cut off part-way - is waited out first, after [pi](https://pi.dev)'s own retries: six more tries, the wait doubled each time from 15 seconds up to five minutes (15s, 30s, 1m, 2m, 4m, 5m, a tenth either way so parallel jobs do not all come back at once), the agent carrying on where it was. Each wait - [pi](https://pi.dev)'s own retries too - is shown as it happens - a notification in the chat and the job panel's status, an orange line in a headless run - and listed in the run report's `turn_incidents`. So is a provider stalling: a request to the model that nothing has come back on for two minutes (`TURRI_PROVIDER_STALL`, in seconds; 0 never), said once for each silence while the turn goes on waiting. A turn turri stops itself - its time up, the agent going round in a circle - is the work's normal course and is not said, only listed.
|
|
135
138
|
|
|
136
139
|
### Models from a pi extension
|
|
137
140
|
|
|
@@ -204,6 +207,7 @@ turri conform <file.plain> --from-scratch # its tests folder taken out and wri
|
|
|
204
207
|
turri lineage <module> # what each regeneration changed in a module, and when
|
|
205
208
|
turri cultivate debug-specs # run a skill directly - by name, the project's too, or by its folder
|
|
206
209
|
turri launch <file.plain> # launch what is regenerated from dist/<module>, here
|
|
210
|
+
turri capture [path] # capture an existing codebase into ***plain, in <path>/plain - offline
|
|
207
211
|
```
|
|
208
212
|
|
|
209
213
|
`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.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Capture
|
|
2
|
+
|
|
3
|
+
You are one of the agents of a capture: an existing codebase is captured into ***plain, and from then on the ***plain is the source of truth - the code is regenerated from it, and the original codebase is abandoned. The harness gives a small program to one writer and splits larger ones among writers. It assembles what each hands over into ***plain files and checks it.
|
|
4
|
+
|
|
5
|
+
## You run offline
|
|
6
|
+
|
|
7
|
+
Nobody can be asked anything, and nobody watches. Where the code leaves something open, decide it yourself - the reading most consistent with the code, its tests and its docs - and say what you decided where your tool asks for assumptions. Never stop to ask.
|
|
8
|
+
|
|
9
|
+
## What you look at
|
|
10
|
+
|
|
11
|
+
The codebase is read only to you: read, grep, find and ls, no shell - but where your task gives you a shell on a copy of it. You are shown a map of your part of it - folders, files, their sizes and the surfaces the harness found in them: routes, commands, options, screens, environment variables, tables, test names, exports. The map is how you find your way; the code is what you read to answer a question, never what you read through. Follow a surface: a route into its handler, a command into what it runs, grep where the trail leads. Read the parts of a file you need with an offset and a limit, not the whole of a long one. You have a budget of tool calls: spend it on what decides the ***plain, then hand over.
|
|
12
|
+
|
|
13
|
+
## What the ***plain says
|
|
14
|
+
|
|
15
|
+
***plain a person has to review is ***plain a person can read. A capture that writes down everything the code does is as unreadable as the code, and nobody reviews it. So - but never at the cost of the interface:
|
|
16
|
+
|
|
17
|
+
- **The interface, whole and exact - never guessed, never obvious.** What a user, a client or a script calls is the contract the regenerated software must keep, call for call: every command and subcommand; every option and argument with each name it has, the value it takes, its choices and its default; every route with its method, path, parameters, the fields it takes and answers, and its status codes; every environment variable and configuration key read; every output format, message and exit code a user or a script sees. Read each from the code that defines it, and follow it to what it does - never infer it from a name, the help text or the docs, never fill it in from a convention, never leave it out as obvious or as the stack's: a stack says how errors are shaped, never which options exist or what they accept. Each part's interface is taken from the code as data, before any feature is written, into its interface reference - a linked resource every functional spec about it carries through the part's interface concept: there the details are exact, and the prose names them. Where the code leaves one open, read on until it does not; what you still cannot settle is said where your tool asks what is uncertain, never settled by guess. The rest of what follows is how short to be about everything else.
|
|
18
|
+
- **What someone sees, not what the code does.** Of each fact ask: *would a user or a client notice if it were different, and would they care?* Function names, file layout, helpers, internal data shapes, retries, logging and utility libraries are the code's business - left out. What a user can do, what they see, the boundary cases and the errors they meet are captured.
|
|
19
|
+
- **Only where the code departs from the default.** The default is what a competent developer builds with no instruction: the stack's conventions, the domain's ("a login rejects a wrong password"), and every functional spec before this one. Cookie-cutter behaviour is one line or none; an odd rule - deleting a list archives its items, an unusual sort order, a 30-day limit - is written down exactly.
|
|
20
|
+
- **Exact where exactness is the contract.** A response's fields, a file format, a command's flags, an error code a client checks: these are captured exactly, in the fewest words that keep them exact - terse, never cut. A literal - a URL, a path, a message - is code in backticks, never a link: ***plain refuses a link to anything but a file of the project.
|
|
21
|
+
- **Edge cases go in scenarios.** A functional spec states the rule; its scenarios pin its edge cases with concrete values - the examples, and what each wrong input answers. Neither is said again in the functional spec. Detail moved to a scenario is still captured, and still readable.
|
|
22
|
+
- **Terse is right.** Clipped bullets, no lead-ins, no rationale, no history, no "the system". Every rule of concise ***plain you are given applies.
|
|
23
|
+
|
|
24
|
+
## What is left out
|
|
25
|
+
|
|
26
|
+
Behaviour nothing relies on - an incidental order, a leftover endpoint, debug output, dead code - is left out, and said so where your tool asks what you dropped. What you could not make out is captured as best you can, and said so where your tool asks what is uncertain. Both reach the person in the capture's report: a judgement said is one they can check.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Check the conventions against the code
|
|
2
|
+
|
|
3
|
+
The survey settled the conventions below: what every feature of the part does the same way - how an error, a warning and a message are written, the exit code or status of each kind of failure, what changes when there is no terminal, what quiet and debug modes hide or add, and what reaches the other side of every call it makes or answers. Every feature is captured following them, so one that is wrong is wrong everywhere. Check each against the code: start at the files it names, follow the entry point to where it catches errors, writes to its streams and exits, and read the conditions exactly - which flag, which level, which stream, when a terminal matters, which name the program goes by. For what reaches the other side, follow a call to where it leaves - the request built and sent, the response written - and read what is added there: the headers set of its own, how a body is serialised and encoded, how header values are encoded, when a body is read or streamed. A declaration is no evidence, a help text or a docstring neither when the code does otherwise; two conventions that disagree cannot both hold.
|
|
4
|
+
|
|
5
|
+
Call `submit_capture_conventions` once, with every convention as the code has it: each that holds, word for word; each corrected; any the code shows that every feature follows and the survey missed. Each with `where`, the files whose code decides it. In `changes`, what you changed, a line each, with why - the file and what its code does. Never change one that holds.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Check the interface reference against the code
|
|
2
|
+
|
|
3
|
+
Below is part of the software's interface reference as an agent took it from the code, each entry with where it is defined. The reference is given whole to every agent that regenerates or tests the code, and it is the one place its details are written: what it lacks or gets wrong, the regenerated software lacks or gets wrong. Every literal in it was checked to be in the code - so nothing in it is invented; what is left to check is that it is whole and right. Read each entry where it is defined, and follow the code to where each detail is worked out:
|
|
4
|
+
|
|
5
|
+
- **Its help, whole:** the text the program prints for it with `--help` - every paragraph, word for word. Where the code keeps a short help and a long one, the one `--help` prints.
|
|
6
|
+
- **Its choices:** every value it accepts, from wherever the code lists them - a constant elsewhere, the letters of a format. Choices worked out when it runs - filtered by what the machine has, taken from what is installed - go in its details, saying how, never as a fixed list that is not always the list.
|
|
7
|
+
- **Its default, what it takes, whether it repeats, is required or is hidden** - as the code has them; a default worked out when it runs, in its details, saying how.
|
|
8
|
+
- **Before you say what a set, a list or a mapping holds,** grep every line that builds it or adds to it - a set defined in one place is often added to in another, a mapping filtered further down - and read each. Correct an entry only where the code shows it wrong, and say the file and the line that show it.
|
|
9
|
+
- **What was missed:** grep the part for interface no entry holds - environment variables read through a constant or a helper, subcommands, arguments, routes a router adds - and add each.
|
|
10
|
+
- **Which command owns an option:** shared arguments belong to each actual command. Do not invent a command named `a, b`. Keep usage failures, configuration failures and domain failures distinct, even when the CLI catches them in the same file.
|
|
11
|
+
|
|
12
|
+
Call `submit_capture_reference_checked` once, with every entry as the code has it - each that holds, word for word; each corrected; each missed - and every exclusion; and in `changes` what you changed, a line each, with why: the file and the line, and what its code does there. Never change one that holds.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Capture a small program as one module
|
|
2
|
+
|
|
3
|
+
You are the only feature writer for this program. Read its source and the tests that show what someone relies on. Use the surveyed stack, concepts and conventions and the interface reference you were given. Capture the whole program as one feature with its functional specs in build order. Name its interface exactly, using the interface concept when there is one; let the reference carry the literal details. Write for the person who will read this module. Keep the rule in the functional spec and the examples in its scenarios.
|
|
4
|
+
|
|
5
|
+
Use a short kebab-case `func_id` per functional spec. Give its black-box conformance and acceptance scenarios concrete inputs and observable outcomes, especially where the original has tests. Define the concepts they need beyond the part's, and say what was assumed, unclear or left out.
|
|
6
|
+
|
|
7
|
+
Call `submit_capture_compact` with `feature` when all its behaviour fits in one readable module, at most eight functional specs and the scenario budget given. If it has independent concerns that need separate modules, or its behaviour or tests do not fit, call it with `expand` instead, saying why. The harness will give the concerns writers of their own. Never leave behaviour or tests out to make it fit.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Reconcile concepts
|
|
2
|
+
|
|
3
|
+
Agents capturing different features of the same codebase each defined some of the same concepts, in different words. Each concept below has every definition it was given, and the functional specs that use it. Give each concept one definition that serves every one of those uses: one plain sentence that starts with the concept and says what it is, with the attributes the specs rely on. Use only the concepts listed with it. Call `submit_capture_concepts` once, with a definition for every concept.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Divide the features
|
|
2
|
+
|
|
3
|
+
The part was outlined area by area, each area by an agent that saw only its own files - so one behaviour can be in two features: an option parsed in one area and acted on in another, a message built in a third, a command's help beside the command. Each feature is then written by an agent of its own, side by side; a behaviour in two features is written twice, in different words, and the two copies contradict each other. Below is every feature of the part, area by area, in build order, with what it is about and where it is built. Give each behaviour to one feature. Call `submit_capture_owners` once.
|
|
4
|
+
|
|
5
|
+
- `features`: every feature that stays, by its key as listed, with `owns`: one line naming what it alone captures - its commands, options, messages and behaviour - so its writer knows its edges and leaves the rest to the others. A behaviour two features would both capture is in the `owns` of one: the feature that is about it - where a user would look for it - never one that only parses it, passes it on or prints it.
|
|
6
|
+
- `merged`: a feature that is a slice of another's behaviour - the options of what another feature does, the printing of what another sends - is merged `into` the features that take it, with `why`: it is not written, and its files go to them. Merge for that, never because two features are small.
|
|
7
|
+
- Every option, command and route of the part is in the `owns` of one feature: the interface is captured whole, so name in `owns` the options and commands each feature takes.
|
|
8
|
+
- A feature builds only on the features before it: give a behaviour to one that comes after what it needs.
|
|
9
|
+
- You see the outline, not the code: decide from what each feature is about and where it is built. Most features stay as they are, owning what they were outlined for.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Capture a feature
|
|
2
|
+
|
|
3
|
+
Capture one feature of the codebase into ***plain: its functional specs, the concepts they need, and their scenarios. Agents capture the other features side by side; the features before yours in the outline are built before it. Call `submit_capture_feature` once.
|
|
4
|
+
|
|
5
|
+
## What is yours
|
|
6
|
+
|
|
7
|
+
Every feature of the part is listed with what it owns: each behaviour is one feature's. Capture all that yours owns - also where its code is in files you were not pointed to. Never capture what another feature owns, even where your code or your tests touch it: it is captured there, and your functional specs build on it, naming it at most. When your tests check another feature's behaviour along with yours, your scenarios check yours.
|
|
8
|
+
|
|
9
|
+
The part's conventions are settled: how errors are written, the exit code or status of each kind of failure, what changes without a terminal, what reaches the other side of a call. Every functional spec and scenario follows them; none decides them again. Where your feature departs from one, capture the departure.
|
|
10
|
+
|
|
11
|
+
## First, find out what it does
|
|
12
|
+
|
|
13
|
+
Start at the feature's paths and its surfaces. Follow each route, command or screen to what it does and what the user sees: the inputs it takes, what it answers or shows, what it refuses and how, what it keeps. Read the original's tests of the feature: what they assert is what someone cared about. Then stop reading and write from what you found out - never while reading code, never line by line.
|
|
14
|
+
|
|
15
|
+
## Then write the functional specs
|
|
16
|
+
|
|
17
|
+
- At most eight functional specs, in build order - each only builds on those before it, here and in the features before yours.
|
|
18
|
+
- `func_id`: short kebab-case from what it does (`add-task`), unique in your feature.
|
|
19
|
+
- `text`: what the software does once built, as a statement of fact with a concrete subject - `A :User: can archive a :List:.` - its first line the behaviour, then the detail that matters: inputs, outputs, boundaries, and the errors the stack does not settle. No line starts with `# ` or `***`.
|
|
20
|
+
- Each implies about two hundred lines of code at most: a larger one is two functional specs.
|
|
21
|
+
- The interface your feature owns, whole and exact. The interface in your files is listed - from the part's interface reference when it has one: taken from the code, every literal checked against it, and carried by every functional spec that uses the part's interface concept (`:<Part>Interface:`). Capture what each piece your feature owns does, by its exact name, using the concept; what it takes, its choices, its default and its help are the reference's - say them only where a behaviour turns on them, and never otherwise than it does. With no reference, capture each exactly yourself: every name it has, what it takes, its choices and default, what it does and what it answers - an endpoint's method, path, fields and status codes; a command's arguments and output; a message's exact text; a file's format. A client of the original must work against the code regenerated from your ***plain, call for call. Read each where it is defined - never from its name, its help text or what the stack would do.
|
|
22
|
+
- Everything else: as short as its facts allow. Leave out what a competent developer would build anyway on this stack, and anything only the code knows - never the interface.
|
|
23
|
+
- Nothing the stack says: what its templates and implementation reqs settle - settings, logging, request ids, error bodies, how it starts - is built already. Capture only where the original departs from them. A stack settles how; which options, routes and commands exist, and what each takes and answers, is always yours to capture.
|
|
24
|
+
- The rule, never its cases. A functional spec says what is refused - `The url is an absolute http or https URL with a host.` - and the stack says how: what invalid input, a missing record or no access answers, its status and its error code. So neither an example (`nope`, `ftp://example.com`) nor what one wrong input answers is a line of the functional spec: each is a scenario of it. Only a refusal the stack does not settle - a status or an error code of the original's own - is written in the functional spec, once, with its rule.
|
|
25
|
+
|
|
26
|
+
## Scenarios
|
|
27
|
+
|
|
28
|
+
A functional spec gets scenarios - `conformance` for its expected use, `acceptance` for use that is not expected: wrong input, a missing record, no access.
|
|
29
|
+
|
|
30
|
+
- **Where the original tests it.** The original's black-box tests are your evidence and your model: a test that runs the software through its interface - an HTTP call, the command run (in a process of its own or the test's), a page driven - is captured as a scenario that does what it does, with its values. A test that calls a function or a class directly is not. Spend your scenarios where the original's tests are densest: a functional spec it tests twenty ways gets several, one it tests once gets one, and error cases get no larger share than the original gives them. A functional spec the original tests through its interface never goes without a scenario.
|
|
31
|
+
- **Where it does not,** a functional spec gets scenarios only when a wrong implementation would give output that looks right, when two readings of it give different outputs, or when a bug in it costs money, security, data or users' trust.
|
|
32
|
+
|
|
33
|
+
Each scenario: a `scenario_id` in kebab-case, unique for its functional spec; one concrete, checkable outcome with concrete values (`named "Buy milk"`, `answers 404`); acting only through the interface; never more than its functional spec says. No more scenarios in all than your budget says - it grows with the original's tests of your feature.
|
|
34
|
+
|
|
35
|
+
A scenario runs as the part's test reqs say, so it expects what the original does then: its output is not a terminal unless they give it one - a scenario about colours passes the option that forces them; it talks to a local server, never a site on the internet; its width, its configuration and its home are the test's. A unit test of the original that mocks a library or calls a function is not a scenario recast: check its behaviour through the interface, or leave it out. What only your scenario needs set up - a file it sends, a session it starts from, a server that answers one exact body - it says itself: the test reqs are what every test of the part sets up.
|
|
36
|
+
|
|
37
|
+
Each feature's scenarios are tried on the original before the ***plain is written, and one the original fails is corrected - but write each to hold the first time.
|
|
38
|
+
|
|
39
|
+
## Concepts
|
|
40
|
+
|
|
41
|
+
Use the concepts you are given - the part's core ones - and the predefined ones. Define a new one in `definitions` only when your specs need a name the given ones do not have: one plain sentence that starts with the concept. Never define a given or predefined one again. Every concept in your specs, scenarios and definitions must be given, predefined or yours, and no definition names a concept whose definition names it back.
|
|
42
|
+
|
|
43
|
+
## Say what you decided
|
|
44
|
+
|
|
45
|
+
`assumptions`: what you decided where the code left it open. `uncertain`: what you captured without being sure of it. `dropped`: behaviour you judged incidental and left out. One line each; empty when there is nothing.
|