@dialecte/cli 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +569 -106
  2. package/dist/cli.js +16489 -6285
  3. package/dist/lookups.js +64 -63
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -17,41 +17,84 @@ npm i -D @dialecte/cli # provides the `dialecte` binary
17
17
 
18
18
  ## Commands
19
19
 
20
+ `dialecte --help` lists the commands by family; `dialecte <command> --help` prints that command only (its
21
+ verbs, flags, exit codes and one example); `dialecte --help --json` answers every command, verb, flag and exit
22
+ code from the one map the code declares (each command's `verbs` and `flags` derived from its usage lines, and
23
+ `renamed`: every old form with its new one), and `dialecte <command> --help --json` that one command in the same
24
+ shape. Exit codes: 0 an answer or green, 1 nothing found or a failed check,
25
+ 2 usage or refused; a command's help says when it differs.
26
+
20
27
  ```
21
- dialecte coverage # generate complete, schema-driven type-coverage probes
22
- dialecte bench [--check] # measure the type-instantiation cost of your own types (library .d.ts skipped); --check gates CI
23
- dialecte audit # render the public type surface and flag readability issues (C1–C6)
24
- dialecte skills sync # install the agent skills your dependencies ship, for your agents
25
- dialecte skills generate # refresh the generated blocks of this package's skills
26
- dialecte skills check # fail on a skill citing what the code no longer has, or an undocumented public function
27
- dialecte skills changed # per skill touched: hand-written (its evals are due) or generated blocks only (no evals)
28
- dialecte api find "<need>" # find a method by what you need
29
- dialecte api show <path> # read one method's contract
28
+ Discover api members schema explain standard
29
+ Use run fixture new
30
+ Grow lot
31
+ Check gate tdd rules contrib mutants
32
+ Hand over handover
33
+ Workspace worktree doctor models skills
34
+ Maintain bench coverage narrowing audit text
35
+ ```
36
+
37
+ ```
38
+ dialecte api find "<need>" # find a method by what you need; api show <path>: one method's contract
30
39
  dialecte members <expr> # what an expression of the live types holds
31
40
  dialecte schema <Tag> # what an element may hold and where
32
- dialecte models # which model each tier (fast, standard, strong, frontier) means for your vendor
33
- dialecte doctor # versions, core API generation, skills and station agents in sync, local checkouts
34
- dialecte rules # code-rules self-check of the changed files
41
+ dialecte explain <code> # what an error or diagnostic code means, when it is raised, the usual fix
42
+ dialecte standard index|find|show|eval # index and search the standards kept on this machine, outside every repository
43
+ dialecte run <script.ts> # run a script on an in-memory project of the installed dialecte: one structured outcome
44
+ dialecte fixture <Tag> # the smallest valid XML document holding an element, built by the dialecte's engine
45
+ dialecte new verb <namespace> <query|transaction> <name>
46
+ dialecte lot start <brief.json> # a lot from its brief: the lot folder in the store, the numbered worktree, .dialecte/lot
47
+ dialecte lot status <id> # its state derived from the records, the checks, the exact next command; reads only
48
+ dialecte lot wait <id> [--timeout <seconds>] # until the lot needs someone: ready, a question, failed, a limit
49
+ dialecte lot answer <id> <question> "<answer>" [--by <who>] # answer an open question of the lot, once
50
+ dialecte lot result <id> # the hand-over (card, show and run lines) of a ready lot, or why it stopped; writes nothing
51
+ dialecte lot stop <id> --reason <text> # end the lot: its pending hand-over abandoned first, then canceled
52
+ dialecte inbox # what waits on someone across every lot store: questions, ready hand-overs, failed lots
53
+ dialecte lot exempt|accept|revised|gone|mutation # the lot declaration .dialecte/lot.json
54
+ dialecte lot finding|decide|snapshot|choice|standard <id|folder> ... # a lot's review rounds, in its lot or hand-over folder
55
+ dialecte lot delta <id|folder> --round <n> # the fix diff since round n-1; --worktree: the old code to run a test on
56
+ dialecte lot recap <id|folder> # the pull request's expandable part, built from the hand-over's records only
57
+ dialecte lot close <name|index> # a finished lot: node_modules to the pool, its worktree to the trash
35
58
  dialecte gate [--full] # the package's Definition of Done, with the real counts
36
59
  dialecte gate --hook # in a commit hook: the suite, unless a green gate --full of the committed tree answers it
37
60
  dialecte tdd red|green|status # receipts: each new test failed on an assertion before the code, then passed untouched
38
- dialecte new verb <namespace> <query|transaction> <name>
39
- dialecte handover <lots.json> # the guarded commit-by-lots hand-over a human runs (run, list)
40
- dialecte handover --legend # every term of the hand-over card: what it means, whether to look
41
- dialecte worktree add|prune # a worktree ready to work in (sibling links, node_modules checked); what a merge left behind
42
- dialecte record review|decision|snapshot # a lot's findings ledger and round snapshots, in its hand-over folder
43
- dialecte record choice <folder> --by <who> <decision> # a decision made outside the ledger, in decisions.md
44
- dialecte record standard <folder> consulted <note> # the standard check, read by the card's standard line
45
- dialecte recap <folder> # the pull request's expandable part, built from the hand-over's records only
46
- dialecte mutants run|status|schedule|abandon|migrate|judge|record|drop # mutation testing of the declared scope; survivors tracked until handled
61
+ dialecte rules # code-rules self-check of the changed files
62
+ dialecte contrib # the contributor checks, after gate --full and before the hand-over
63
+ dialecte mutants run|status|schedule|abandon|migrate|judge|record|drop # mutation testing of the declared scope
64
+ dialecte handover write <lots.json> # the guarded commit-by-lots hand-over a human runs (handover <lots.json> too)
65
+ dialecte handover show|run|abandon|list|--legend
66
+ dialecte worktree add|prune # a worktree ready to work in; what a merge left behind
67
+ dialecte doctor # versions, core API generation, skills and station agents in sync, local checkouts
68
+ dialecte models # which model each tier (fast, standard, strong, frontier) means for your vendor
69
+ dialecte skills sync|generate|check|changed # the agent skills your dependencies ship, and this package's own
70
+ dialecte bench [--check] # measure the type-instantiation cost of your own types; --check gates CI
71
+ dialecte coverage # generate complete, schema-driven type-coverage probes
72
+ dialecte narrowing # assert schema-derived type narrowing still holds
73
+ dialecte audit # render the public type surface and flag readability issues (C1-C6)
47
74
  dialecte text check <file> # the human part of a GitHub text: its fixed headings and its word cap
48
- dialecte review delta <folder> --round <n> # the fix diff since round n-1; --worktree: the old code to run a test on
49
- dialecte run <script.ts> # run a script on an in-memory project of the installed dialecte: one structured outcome
50
- dialecte fixture <Tag> # the smallest valid XML document holding an element, built by the dialecte's engine
51
- dialecte explain <code> # what an error or diagnostic code means, when it is raised, the usual fix
52
- dialecte --help
53
75
  ```
54
76
 
77
+ ### Renamed in 1.0
78
+
79
+ The review rounds' commands moved under `lot`. The old forms run nothing and write nothing: each answers
80
+ `renamed: dialecte <old> is now dialecte <new>` on stderr, exit 2, until 2.0. Its second line is the full new
81
+ command with the same arguments, or, with no arguments, the new form's usage line; `record` or `review`
82
+ without a verb lists every form that replaced it. Asked with `--help`, an old form prints the same answer on
83
+ stdout, with the words given before `--help`, exit 0; with `--help --json` it prints
84
+ `{ renamed: [{ old, new }] }`, the words after `dialecte` (`record` lists its five forms).
85
+
86
+ | 1.0 | Before |
87
+ | ----------------------------------------------------------------------------------------- | -------------------------- |
88
+ | `dialecte lot finding <id\|folder> --round <n> --severity <s> --at <file:line> <finding>` | `dialecte record review` |
89
+ | `dialecte lot decide <id\|folder> <finding> <state>` | `dialecte record decision` |
90
+ | `dialecte lot snapshot <id\|folder> --round <n>` | `dialecte record snapshot` |
91
+ | `dialecte lot choice <id\|folder> --by <who> <decision>` | `dialecte record choice` |
92
+ | `dialecte lot standard <id\|folder> consulted <note> \| not-consulted <reason>` | `dialecte record standard` |
93
+ | `dialecte lot delta <id\|folder> --round <n> [--worktree] [--json]` | `dialecte review delta` |
94
+ | `dialecte lot recap <id\|folder>` | `dialecte recap` |
95
+
96
+ `dialecte handover write <lots.json>` names what `dialecte handover <lots.json>` does; the old form stays.
97
+
55
98
  ## Zero-config
56
99
 
57
100
  A dialect is built by convention: `src/<version>/definition/{constants,definition}.generated.ts`, and
@@ -130,6 +173,16 @@ Every Dialecte package ships the agent skills that describe it in `skills/<name>
130
173
  intent quotes a sentence, since the generated pages republish the JSDoc. A page about several
131
174
  repositories declares `<!-- dialecte-skills workspace -->` and is fully verified with
132
175
  `--workspace <folder>`; a deliberate outside mention goes in `<!-- dialecte-skills ignore: token -->`.
176
+ It also verifies every cli invocation a page cites in code (inline code and fenced blocks of any language,
177
+ never prose; generated blocks left out): one starting with `dialecte` or `@dialecte/cli`, after `npx`, a
178
+ `$ ` prompt or a shell operator. Its command, its verb and each `--flag` must be in the command map of the
179
+ cli the package uses (the cli's own map in the cli itself, else what the installed `@dialecte/cli` answers to
180
+ `dialecte --help --json`); an unknown one, or an old form of a command renamed in 1.0 (see "Renamed in
181
+ 1.0"), is an error at `page:line` naming the closest valid form, or the new form, on a workspace page too. A quoted word, a
182
+ `<placeholder>` and what follows a bare `--` are not checked; `ignore:` takes the offending word (`record`,
183
+ `--fats`). With no installed cli, or one before the map, the invocations are not checked: one warning says
184
+ why and the summary line says so. A versioned `@dialecte/cli@<version>` and what follows an unclosed `<` are
185
+ not read.
133
186
 
134
187
  ## Lookups for agents (and people)
135
188
 
@@ -174,6 +227,87 @@ Exit codes: 0 an answer, 1 nothing found (or a warning for `doctor`), 2 a usage
174
227
 
175
228
  Run outside a package (no `package.json`), each answers a usage error.
176
229
 
230
+ ## The standard index
231
+
232
+ `dialecte standard` indexes the standards you hold on your machine and answers from them, in slices of whole
233
+ lines with their original line numbers. The cli ships no standard and never copies one into a repository.
234
+
235
+ **Where the standards are.** `DIALECTE_STANDARD` names one root folder holding one folder per standard; the
236
+ folder's name, lowercased, is the standard's id, and its top-level, non-hidden `.md` files are the standard
237
+ (subfolders are ignored; a symlink to a folder or a file counts). A file's id is `<standard id>/<file name
238
+ without .md>`, lowercased.
239
+
240
+ ```
241
+ $DIALECTE_STANDARD/
242
+ <standard id>/
243
+ <part>.md
244
+ <amendment>.md
245
+ <other standard id>/
246
+ <part>.md
247
+ ```
248
+
249
+ Refused with exit 2, nothing built: `DIALECTE_STANDARD` not set, empty or naming a path that does not exist; a
250
+ root that is a file, that holds `.md` files directly (they are named, with the expected layout) or that holds no
251
+ standard folder; two folders,
252
+ or two files of a folder, whose ids differ only by case (both named); a `--standard <id>` with no folder (the
253
+ known ids named); the root, a standard folder or the cache inside a git work tree. A folder with no `.md` file
254
+ is reported as `no indexable file` and skipped.
255
+
256
+ **Where the index is.** In the cache only: `$XDG_CACHE_HOME/dialecte/standard/<standard id>/<manifest hash>/`
257
+ (else `~/.cache/dialecte/...`), one folder per standard and per set of file contents (the manifest hash is the
258
+ sha256 of the index format and each file's id and sha256). A folder is built into `<hash>.tmp-<pid>/` and renamed
259
+ into place once complete: a file changed during the build aborts it (exit 1, the file named, nothing kept); a
260
+ second builder reuses the first one's folder; a temporary folder left by a process that is gone is removed at the
261
+ next build. A complete folder is reused, never rebuilt, unless `--rebuild` (the old folder is moved aside, the new
262
+ one renamed in, then the old one removed: a reader never sees a half-removed index); the links to the vocabulary of the
263
+ installed dialectes are a file of their own, written beside the rest when the selected dialectes change.
264
+ Old folders are kept. While a build runs, a running line with its elapsed time goes to stderr on a terminal.
265
+
266
+ **The vocabulary.** The tags, attributes and enumeration values of the dialectes installed where the command runs
267
+ (every one, or the one `--package <name>` names) are exact names: case kept, never stemmed, then scored like a
268
+ word (1 per clause or table, doubled in its heading or caption, weighted by the lines naming it). An attribute under three
269
+ characters counts only as `@name`, `name=` or a table cell equal to it, an enumeration value under three
270
+ characters only as a table cell equal to it; a name in lowercase letters only, from three characters, is searched
271
+ as an ordinary word. The tags file is named by the hash of the selected dialectes' `name@version` list. `index`,
272
+ `find` and `eval` print `vocabulary <name@version>[, ...]` (or `vocabulary none (no dialecte installed)`) as their
273
+ first line, and `vocabulary: { packages }` in `--json`. A `--package` that is not installed answers exit 2 with
274
+ the installed ones named.
275
+
276
+ **Words.** Other words are searched by their stem: lowercased, the plural removed, then `-ied` and `-ying` to `-y`,
277
+ a final `-ing` or `-ed` (with its doubled consonant) and a final `e` removed; common English, modal and question
278
+ words are not searched. A word in capitals and digits with two capitals or more (an acronym) is kept from two
279
+ characters, never split nor stemmed; its plural (the acronym and one lowercase `s`) is searched as the acronym.
280
+
281
+ - `dialecte standard index [--standard <id>] [--package <name>] [--rebuild] [--json]`: builds or reuses the index of each standard
282
+ (or of `--standard <id>` only), then per standard `<id> <n> files built|reused in <time> manifest <hash>`,
283
+ per file its lines, quality verdict, noise share, headings kept over candidates, tables and definitions, and
284
+ the lines repeated often enough to be a watermark (information only: nothing is dropped for being repeated).
285
+ Exit 1 when no selected folder holds a `.md` file.
286
+ - `dialecte standard find "<terms>" [--standard <id>] [--package <name>] [--about <Tag>] [--limit <n>] [--json]`:
287
+ the slices that hold the terms, ranked over every selected standard (each slice names its file id): a header
288
+ `<file id>:<from>-<to> <clause> <title> score <s>`, then the normalised text. A slice starts at the first hit
289
+ of its clause's or table's densest run of terms (at most 60 lines holding the most distinct terms, weighted as
290
+ in the score) and runs to the last hit, 60 lines at most; a table starts at its caption when that run ends
291
+ within 60 lines of it. After the `--limit` (10)
292
+ direct slices come the clauses and tables they refer to, marked `[linked]`. `--about <Tag>` adds a tag of the
293
+ installed dialectes (an unknown one answers the closest; none installed is a usage error). Exit 1 when nothing
294
+ matches.
295
+ - `dialecte standard show <file id>:<from>-<to> [--json]`: the normalised text of the logical lines overlapping
296
+ the range, each with its original lines. Exit 1 when the range holds only blank or dropped lines; 2 for a
297
+ malformed range, an unknown file id (the known ones named), a start after its end or an end after the file's
298
+ last line.
299
+ - `dialecte standard eval <gold.jsonl> [--standard <id>] [--package <name>] [--json]`: recall at 5 and at 10 of `find` over a gold
300
+ file you keep, one `{ "question": ..., "about"?: ..., "expected": [{ "file": "<file id>", "quote": ... }] }` per
301
+ line (other fields are ignored). The expected quotes of an item are alternatives: the item is found at the best
302
+ rank of any of them. A quote is matched in plain words: table pipes, `<br>` tags, `**`/`__` and a leading `#`
303
+ run are left out on both sides, then the text is normalised and case is ignored. Each missed item names its
304
+ closest quote and why (`ranked <r>`, `not found by find`, `not in the text`, `unknown file <id>`). Items with
305
+ no expected quote are counted apart. Exit 1 when no item has one; 2 for a gold file that cannot be read or a
306
+ malformed line (its number named).
307
+
308
+ `show`, `find` and `eval` build the index first when it is missing. Every verb answers exit 2 with how to set
309
+ `DIALECTE_STANDARD` when no standard is configured.
310
+
177
311
  ## MCP server
178
312
 
179
313
  The MCP server of the read-only lookups is its own package: [`@dialecte/mcp`](https://github.com/dialecte/mcp) (`npx @dialecte/mcp`). It builds on the pure answer functions this package exports at `@dialecte/cli/lookups`.
@@ -238,7 +372,7 @@ The hand-over follows the profile:
238
372
  install, the linked dependencies), no record can answer the real run: the rehearsal says which part, and
239
373
  does not run contrib.
240
374
  - Both profiles get the card's `standard` line (see the hand-over card below) and
241
- `dialecte record standard <folder> consulted <note> | not-consulted <reason>`.
375
+ `dialecte lot standard <id|folder> consulted <note> | not-consulted <reason>`.
242
376
 
243
377
  ## Contributing to a Dialecte package
244
378
 
@@ -256,10 +390,13 @@ the answer.
256
390
  gives the test a folder of its own); positional parameters (beyond a leading `query` / `tx`, a
257
391
  symmetric pair aside) and abbreviated names are warnings. Without file arguments it records its result
258
392
  in the worktree's git folder (`dialecte-rules.json`: when, HEAD, the state hash, the files, the errors
259
- and warnings), which `dialecte recap` reads; a run on named files records nothing.
393
+ and warnings), which `dialecte lot recap` reads; a run on named files records nothing.
260
394
  - `dialecte gate [--fast | --full] [--base <ref>] [--no-reuse] [--declare <path>]... [--json]` runs the Definition of Done: `--fast` (default) `check`,
261
395
  `skills:check` and the tests of the changed files; `--full` adds `build` and the whole suite (the
262
- runner's defaults: every file in parallel). The docs build and the type bench are contributor checks:
396
+ runner's defaults: every file in parallel), then the steps derived from the package's scripts after its
397
+ own (declared or default): `type-narrowing` (`npm run type-narrowing`, a check a publish workflow runs)
398
+ when the package has that script and no step runs it; without the script, one line
399
+ `skip type-narrowing no npm script "type-narrowing"` and no step of the record. The docs build and the type bench are contributor checks:
263
400
  `dialecte contrib` runs them (see [Profiles](#profiles)). Each step runs unfiltered, with
264
401
  `GIT_OPTIONAL_LOCKS=0` (a `git status` inside it never takes the index lock), and is judged on its exit
265
402
  code and on the counts it printed: a step exiting non-zero fails whatever it says, a test step that
@@ -363,7 +500,9 @@ the answer.
363
500
  changed against HEAD (recorded as `dialecte rules` records it), the package's `dialecte.contrib.steps`
364
501
  (default: `docs`, `npm run doc:build` with the `generatedDocs` restored, and `type-bench`,
365
502
  `npm run type-bench:check`; `[]` keeps the built-in rows only) run as the gate runs its steps (a missing
366
- npm script skips the step), `release` (no dependency named by a local folder), then `mutation` when the
503
+ npm script skips the step), `type-narrowing` (`npm run type-narrowing`) when the package has that script and
504
+ none of its steps runs it (without the script, one line `skip type-narrowing no npm script
505
+ "type-narrowing"` before `release`, no row), `release` (no dependency named by a local folder), then `mutation` when the
367
506
  package declares a mutation scope (read from the mutation store now, never recorded). A package step a
368
507
  green `gate --full` record of this tree and install passed with the same name and command is not run
369
508
  again: its row says `reused from gate --full at <time>`. The run is recorded as `dialecte-gate-contrib.json`
@@ -387,7 +526,10 @@ the answer.
387
526
  still waiting for its green whose test file, or test code it imports, changed since its red ("test
388
527
  code changed since its red and it passes"); a failure on a missing export, a type or syntax error, a
389
528
  timeout, a stub thrown at import or before the assertion; a file holding `.only` or `only: true`. A
390
- case the same as at the base is marked unchanged; a case the lot accepts is marked accepted; a green
529
+ case the same as at the base is marked unchanged; a case the lot accepts is marked accepted, unless
530
+ it is proven red then green at its current test call (an acceptance never overrides a proof: it goes
531
+ the normal path, no accepted receipt, and the line adds `acceptance not needed (proven red → green): it
532
+ can be removed from the lot file`); a green
391
533
  case whose test code changed around it is kept and flagged `test code changed around it` (the next
392
534
  step adding a case to a green file); a case never proven green (only unchanged, accepted or revised)
393
535
  is kept without a flag, and no receipt. A file with a refusal still records its other cases'
@@ -422,13 +564,47 @@ the answer.
422
564
  (`fixtures/scan.ts`, a full path): it brings the files it imports (`import type` included). A bare
423
565
  file name (`index.ts`) may be another file: the changed file it names is a dependency, not followed. A
424
566
  helper no red covers stays unfrozen, and the gate fails on it, unless a `revised` entry names it
425
- (below). An import that looks local (`@/`, `~/`,
426
- `#`, a `paths` or alias prefix) and resolves nowhere refuses its file, naming the import.
567
+ (below). A Vite import query or fragment (`./x.worker?worker&url`, `?raw`, `?url`, `?inline`, `#part`) is
568
+ left out of the file the import names; a specifier starting with `#` is a subpath import. The files of
569
+ the change an `import.meta.glob(...)` of its test code matches (a pattern relative to the file, `/` for
570
+ the package root, or a vite alias; a negated `!pattern` leaves its files out and names none) are
571
+ dependencies too, followed like an import. An import that looks local (`@/`, `~/`,
572
+ `#`, a `paths` or alias prefix) and resolves nowhere refuses its file, naming the import as written.
573
+ - A test-code file moved with its bytes as at the base (git's R100: a deleted path and a new one,
574
+ added or untracked, holding the same blob) is no change: a moved test file's cases are `unchanged`
575
+ with no receipt to hold, its old path lists no deleted case, a moved helper or fixture waits for no
576
+ freeze. A move stays within one kind (a test file to a test file, other test code to other test code;
577
+ an empty file never pairs): a test file renamed off (`a.test.ts.off`) lists its cases deleted, one
578
+ renamed on is a new file. A move with an edit is a new file and a deleted one. A change that only
579
+ deletes test files lists their cases `deleted` in the gate's `tdd` step.
580
+ - Cases moved out of a test file (a file split in several, a case cut out into another file) keep the
581
+ base's proof with no declaration. A case of a new or changed test file is `moved` when its test call,
582
+ by tokens (those its case hash reads), under the same describe path, is in the base text of a test
583
+ file the change deletes, or of a changed one that no longer holds that call under that path, and its
584
+ own file's base did not hold it; a case of the same name and project matched in two files is moved
585
+ from neither (`ambiguous <case> in <files>: moved from none of them`). A moved case is a case of the
586
+ base: `tdd red` records it `unchanged` when it passes (and freezes the helpers its file depends on),
587
+ and with no receipt yet `status`, the gate and the card read it `unchanged`. `status` and the gate's
588
+ details print one line per source file, `moved <n> case(s) <old file> → <k> file(s)`, with
589
+ ` · test code changed around them` when a target's code outside its test calls (imports, hooks, helpers,
590
+ under the describe paths it keeps) differs from the source's base, read by the same tokens; the card's
591
+ tdd section shows the line, and a deleted source is reported by it instead of as deleted. A case a
592
+ helper registers (the call at its location is no test call: `checkRow(row)`) is `moved by name` when a
593
+ test file the change deletes, or that registers fewer cases now, registered one case of the same name
594
+ and project through a runner at the base:
595
+ `moved by name <n> case(s) <old file> → <k> file(s) · runner changed: <base call> → <new call>`. Those
596
+ base names come from one collect-only run of the base files (no test executes), paid only when a split
597
+ is detected statically (a test file deleted, or a changed one whose base ran a registering statement
598
+ outside its test calls, by tokens, that it no longer runs; a row added to a table is no split), in a
599
+ scratch copy of the base tree outside the worktree removed after it, bounded
600
+ at 5 minutes; `status` prints its duration (`base collect <n> file(s) <duration>`).
427
601
  - `green` runs the changed test files: each case needs a red receipt, its file, its test call and its
428
602
  test code as frozen, production changed since its red ("nothing in production changed since red"),
429
603
  and a pass.
430
604
  - `status` prints each case (red, green, unchanged, accepted, missing receipt, test edited after red,
431
- with its flags), the test code changed outside `tdd red`, and the cases the change deletes. A test
605
+ with its flags), one `skipped <case> <receipts>` line per case with receipts the read rule skips
606
+ (below; the gate's details too), the test code changed outside `tdd red`, and the cases the change
607
+ deletes. A test
432
608
  call of the base gone without a title (an `it(name, ...)` whose title is a variable: an edited call
433
609
  looks deleted) prints `deleted <file> a test call of the base is gone`; when a `gone` entry of
434
610
  `.dialecte/lot.json` names its file (a path or a glob), it prints
@@ -478,7 +654,16 @@ the answer.
478
654
  cases' earlier green stale: `tdd green` proves them again. Without that red run the gate fails on the
479
655
  edit; `status` lists the revised cases, the gate and the hand-over card list the revisions (cases
480
656
  and helpers) with their reason, an entry (exact, file or glob) no revised case or helper used as a
481
- note.
657
+ note. A `revised` entry covering a proven case nothing changed since its proof (same test call, test
658
+ code as frozen) records nothing: the line reads `kept <case> proven before (<kind>) revision not
659
+ needed (nothing changed since its proof): <reason>`, and the entry stays unused.
660
+ - A receipt counts only while its declaration holds (the read rule of `tdd red`, `tdd green`,
661
+ `tdd status`, the gate and the card): an `accepted` receipt whose `accept` entry the lot file no longer
662
+ holds, or that a red then a green of the same test call precede, and a `revised` receipt no `revised`
663
+ entry (exact, file or glob) covers any more, are skipped, and the case reads from its earlier proof (a
664
+ case whose file was frozen again after its green owes a fresh `tdd green`). Nothing in the ledger is
665
+ rewritten; the flags are read from every receipt. A skipped receipt is named:
666
+ `skipped <case> 1 accepted receipt (no longer declared)`, or `(proven red → green before it)`.
482
667
  - What it cannot see: the receipts can be written by an agent with a shell; a deliberate throw in
483
668
  production looks like a stub; code written first, hidden, then a red taken at the base state, cannot
484
669
  be told from an honest red (at the first step the red's production is the base's). The flags and the
@@ -489,9 +674,10 @@ the answer.
489
674
  iterating, run the case with `npx vitest run <file> -t "<case>"`), its barrel export and, for a new
490
675
  namespace, the namespace module and its registration. Its JSDoc summary and `@intent` start with
491
676
  `FILL:`, which `skills check` refuses until written; the command prints every placeholder left.
492
- - `dialecte handover <lots.json> [--out <dir>] [--rehash] [--json]` prepares the commit-by-lots
493
- hand-over a human runs. The lots file names the repository, the branch and HEAD expected, and the lots
494
- (paths, message):
677
+ - `dialecte handover write <lots.json> [--release] [--out <id|folder>] [--rehash] [--json]` (or `dialecte handover <lots.json>`) prepares the commit-by-lots
678
+ hand-over a human runs. `--release` marks it a release hand-over (`"release": true` in the lots file): its card
679
+ then holds a required `gate release` row, green only with a green `gate --release` record of the tree it commits.
680
+ The lots file names the repository, the branch and HEAD expected, and the lots (paths, message):
495
681
 
496
682
  ```json
497
683
  {
@@ -517,17 +703,44 @@ the answer.
517
703
  `commit.sh` that runs
518
704
  `npx --no-install @dialecte/cli handover run <folder>` (bash, also run with `sh`; when the repository
519
705
  installs no cli that can, it says so in one line with the fix) - and prints the hand-over card, the
520
- command with its absolute `cd` under it. `--json` answers the card as data: the verdict, `profile`,
706
+ command with its absolute `cd` under it. The folder is the lots file's, or `--out <id|folder>`: a lot (its
707
+ index, full name, a path to its folder or `.dialecte/lot`) writes into the lot folder, any other word is a
708
+ folder; either way the folder is taken by its real path (a folder not made yet: the real path of its nearest
709
+ existing ancestor, then the rest) before anything is written, so `commit.sh`, the lock, the card, `--json`'s
710
+ `folder` and the registry all hold it. A word naming both an existing folder and a lot is the folder: the
711
+ card's output starts with the note saying so (`outNote` in `--json`). Refused (exit 2, nothing written), when the folder is a lot folder, in
712
+ this order: a simulated lot (`a simulated lot has no hand-over`), a `canceled` or `failed` lot, an open
713
+ question (`answer q<k> first: dialecte lot answer <full name> q<k> "<answer>" ...`), a lots file whose
714
+ repository is not the lot's worktree or whose branch is not the lot's (both named); and for any folder whose
715
+ registered hand-over is `committed` (`<name> is committed: a committed hand-over is never rewritten`). Every hand-over
716
+ written is registered in the repository's store, `<git common dir>/dialecte-handover/`: shared by every
717
+ worktree of the repository, kept when a worktree is removed, never in the working tree. The store holds
718
+ one entry per hand-over, `<name>.json` = `{ folder, branch, worktree, index, written, state }` (the folder's
719
+ absolute path, the lots file's branch and repository, the worktree's index when its folder is numbered
720
+ (`0171` for `.worktrees/0171-cli-x`, absent otherwise), when it was written, and its state as last
721
+ recorded: `pending` when written, `committed` by a real run that commits every lot, `abandoned` by
722
+ `handover abandon`); the folder stays where it was written. The name is `<yyyy-mm-dd>-<branch slug>[-<n>]` -
723
+ the local date, the branch with every run of characters outside `[A-Za-z0-9._-]` (the `/` included)
724
+ turned into one `-`, then `-2`, `-3`... when that name has an entry already. A folder registered already
725
+ (the same real path) keeps its name: `--rehash` updates its entry, never a second one, and never one
726
+ recorded `committed`. An entry is written whole (a reader sees the old entry or the new one; on a file
727
+ system without hard links a new entry is written exclusively instead) and stays writable, so an older cli
728
+ can still record its state. A rehearsal and `show` write no entry. `--json` answers the card as data: the verdict, `profile`,
521
729
  `failedGates`, `otherTreeGates`, `declarations` (the entries to read), `gates` (the gate lines: name,
522
730
  status, detail), `contrib` (a contributor's contrib rows, one per row: name, status, detail, and `stale`
523
- or `source` - `rehearsal`, `from <commit>` - when they apply), `tdd` (the tdd lines as the text a person reads, no layout and no padding), `notes`, and each lot with
731
+ or `source` - `rehearsal`, `from <commit>` - when they apply), `tdd` (the tdd lines as the text a person reads, no layout and no padding), `notes`, `name` (the
732
+ hand-over's registered name; absent for a folder with no entry), `worktree` (absolute), `index` (a
733
+ numbered worktree's), and each lot with
524
734
  `pending` until it is committed. Edited a file after the review? `--rehash` (also after
525
735
  editing `lots.json`). The repository stays held until every lot is committed: `dialecte gate` runs
526
736
  only under this hand-over (see `gate`), and a hand-over of another folder is refused, naming the script
527
737
  that holds the repository and its lock.
528
738
 
529
739
  - The hand-over card is what a person reads before running the hand-over, and again at its end. Its title
530
- is `hand-over: <repository folder> <branch>`; the repository and worktree paths are not in it. Its
740
+ is `hand-over: <repository folder> <branch>`, with the worktree's index first from a numbered worktree
741
+ (`hand-over: 0171 cli feat/x`: the repository's own folder name, so the number is shown once). The commit
742
+ section ends with the `worktree` line: the worktree the lots are committed in, relative to the workspace
743
+ when it is inside it (`.worktrees/0171-cli-x`, `cli` for the main checkout), else its absolute path. Its
531
744
  first line is the verdict: `READY` when no gate line failed and none ran on another tree, `BLOCKED` with
532
745
  `<n> gates failed: <names>` and `gates ran on another tree: <names>`, `DONE` once a real run committed
533
746
  every lot; then the lots, files and `+<added> −<removed>` (`all gates green` when nothing blocks), and
@@ -540,8 +753,13 @@ the answer.
540
753
  - `gates`: one line per gate step from the gate records (the latest record of each step over `--fast`,
541
754
  `--full` and the commit hook's record, a line of the hook's ending with `commit hook`:
542
755
  `✓ test:run 1214/1214 · commit hook`; a gate record newer than the hook's replaces its lines whole,
543
- since the hook names its own scripts, not the gate's steps), then, in a consumer, `mutation` when the
544
- package declares a mutation scope (below), then
756
+ since the hook names its own scripts, not the gate's steps; the other way round, a hook record of the
757
+ tree the hand-over commits, not dropped by a newer gate record of that tree, replaces the lines of
758
+ every gate record of another tree it answers - a step of the same name, or a step counting tests when
759
+ the hook counts tests: a merge hand-over rehearsed or committed reads the hook's lines of the merged
760
+ tree, the worktree's `tests` of its tree before the merge left out. No check leaves silently: a step
761
+ the hook did not run reads `! skills not run on the merged tree` (a warning, not of another tree), a
762
+ failed one stays `✗ ... (the tree changed since)`, and `tdd` stays the worktree's), then, in a consumer, `mutation` when the package declares a mutation scope (below), then
545
763
  `review` from the hand-over folder's findings ledger and `round-<n>/` snapshots, then `standard`. `✓`
546
764
  passed; `!` to look at (a step not run here, with its reason, or not run after a failure; no
547
765
  findings ledger, or one holding no row yet: `no findings recorded`; only nits open); `✗` failed (a
@@ -555,7 +773,10 @@ the answer.
555
773
  history of HEAD ends `· from <sha>` (the branch commit's hook record read for a merge on main; a
556
774
  record of an earlier commit of this line carries none), a rehearsal's record `· rehearsal`. A record
557
775
  of another tree than the one checked ends with `(the tree changed since)`: its line turns `!` and
558
- blocks the hand-over; a failed step stays `✗`.
776
+ blocks the hand-over; a failed step stays `✗`. The `tdd` line is the worktree's: it is stale only when
777
+ its record is of another tree than the worktree's now, never because the tree checked is a merge's;
778
+ once a merge hand-over is committed, its card keeps `! tdd ... (the tree changed since)` and `gates ran
779
+ on another tree: tdd`, since the worktree took the merge after its tdd verdict.
559
780
  The `mutation` line is what the package still owes its mutation runs, read from the mutation store when
560
781
  the card is written. `✗` (blocks): `new` survivors or died runs of the package, whatever their lot
561
782
  (`2 new survivors · 1 died run: dialecte mutants status`); a run of the branch still running when the
@@ -573,10 +794,11 @@ the answer.
573
794
  The `standard` line says whether the standard was consulted. A standard is configured when
574
795
  `DIALECTE_STANDARD` names a file or folder that exists (the environment only: no committed file names
575
796
  it). `✓ standard consulted · <note>` when one is configured and the station recorded a consultation;
576
- `✗ standard configured, not consulted: dialecte record standard <folder> consulted <note>` (blocks) when
797
+ `✗ standard configured, not consulted: dialecte lot standard <folder> consulted <note>` (blocks) when
577
798
  one is configured and none is recorded; `! standard not consulted: none configured (DIALECTE_STANDARD)`
578
799
  otherwise, with the recorded not-consulted reason when there is one: a warning that never blocks. The station records it
579
- with `dialecte record standard <folder> consulted <note>` or `not-consulted <reason>`.
800
+ with `dialecte lot standard <id|folder> consulted <note>` or `not-consulted <reason>` (the card's line
801
+ names the hand-over's folder).
580
802
  - `contrib` (a contributor's): the rows of the `dialecte contrib` record of the tree the hand-over commits,
581
803
  read as gate lines (`rules` with its errors and warnings, the package's steps, `release`), then the live
582
804
  `mutation` row. A stored record counts when its key is the one the `contrib` guard asks for: a run at
@@ -595,12 +817,13 @@ the answer.
595
817
  (`<n> proven red → green · <m> unchanged`, and `· <k> kept` when any); the accepted cases: a head
596
818
  line `<n> accepted`, then one row per reason of the lot file (`<count> <reason>`, the largest group
597
819
  first, a tie in the lot file's order, each reason wrapped under itself); the accepted and revised receipts
598
- of earlier lots, which the lot file no longer names, on one line
820
+ of earlier lots (cases outside the change), which the lot file no longer names, on one line
599
821
  (`earlier lots: 410 accepted, 12 revised (not in the lot file)`); then
600
- `<n> revised · <m> gone · <k> unused` with `to read ↓` at its right edge and one entry each: a revised case `<file> › <title>` (named by the lot file exactly, or by a file or glob entry)
822
+ `<n> revised · <m> gone · <k> unused · <j> skipped` with `to read ↓` at its right edge and one entry each: a revised case `<file> › <title>` (named by the lot file exactly, or by a file or glob entry)
601
823
  with its reason under it, a helper a red run froze for a `revised` entry as `revised <helper>` with its
602
824
  reason under it, a `gone` entry with its reason (whether one covers a finding is the gate's
603
- to say), an `accept` or `revised` entry no case used. Then one line per kind of flag with its count of
825
+ to say), an `accept` or `revised` entry no case used, a case of the change whose receipts the read
826
+ rule skips (`skipped <file> › <title>: 1 accepted receipt (no longer declared)`). Then one line per kind of flag with its count of
604
827
  cases (`dialecte tdd status --flags` lists them); cases whose only flag is `test code changed around it`
605
828
  and whose receipts are otherwise only unchanged are counted apart (a case flagged rollback or red after
606
829
  green never is), as
@@ -608,9 +831,12 @@ the answer.
608
831
  - `notes`: the lots file's `gates` text, as written; only on the cards printed before a run (the
609
832
  written card, a rehearsal's), never on the card after a real run.
610
833
 
611
- Its closing rule reads `dialecte handover --legend · details: dialecte tdd status` (in a box too narrow
612
- for it, that text is printed inside, above a plain closing rule). The command stays
613
- under the box until every lot is committed. `dialecte handover --legend` prints every term the card can
834
+ Its closing rule names the hand-over, so a part of the card copied alone still says which one it is:
835
+ `dialecte handover show <id> · run <id> · --legend · details: dialecte tdd status`, `<id>` the
836
+ hand-over's registered name, or its folder's absolute path when it has no entry (a folder written by an
837
+ earlier cli; in a box too narrow for it, that
838
+ text is printed inside, above a plain closing rule) - on the written card, `show`'s, a run's and a
839
+ rehearsal's. The command stays under the box until every lot is committed. `dialecte handover --legend` prints every term the card can
614
840
  print, each in two lines: what it means, and whether to look.
615
841
 
616
842
  - `dialecte handover run <folder>` is what `commit.sh` runs. Each guard prints one line with its result
@@ -663,8 +889,11 @@ the answer.
663
889
  `hook ✗`) and the log's path; a repository with no commit hook prints none of it (in husky's `.husky/_`,
664
890
  which holds a wrapper for every hook name, a hook counts only when its script exists in `.husky/`). Then the commit with
665
891
  its stat; the total time and the card at the end. A lot whose `git add` or commit fails is unstaged again: once the cause is fixed, the same command
666
- finds the lots already committed on top of the recorded HEAD (same message, same paths, same content)
667
- and resumes at the next one; anything else on top of HEAD is refused with what was found. It never
892
+ finds the lots already committed on top of the recorded HEAD (same message, same paths, the bytes of the
893
+ reviewed snapshot `files.sha256`, not the working tree) and resumes at the next one; anything else on top
894
+ of HEAD is refused with what was found. When every lot is committed, the `head` line says the hand-over is
895
+ already committed and the guards after it (they read the working tree, which later work may change) are
896
+ not run: the run exits 0. It never
668
897
  pushes. `--rehearse` first decides, per lot and before any clone, whether rehearsing it can find
669
898
  something new, and prints one line per lot: `lot <n>/<N> reused <reason>` or
670
899
  `lot <n>/<N> rehearse <reason>`. A plain lot is reused when the store holds a green `gate --full` of
@@ -701,7 +930,11 @@ the answer.
701
930
  repository's package.json that leaves the repository, to the folder the same path reaches from the
702
931
  repository (`file:../core`: `<rehearsal folder>/core` -> the repository's `../core`), so the clone
703
932
  resolves it as the checkout does; one line names the links, and a path that leaves the rehearsal
704
- folder too, or whose target is missing, is not linked (a line says why). The whole rehearsal folder is
933
+ folder too, or whose target is missing, is not linked (a line says why). In a workspace (the
934
+ repository's parent holds `.worktrees/`) the clone stays fresh but its `node_modules` is taken from the
935
+ pool when an entry matches its lockfile (`node_modules: pooled _pool-<repository>-<n>`), parked back at
936
+ the end, and the rehearsal folder goes to `.worktrees/_trash/`, removed in the background (removed here
937
+ when the trash is on another file system). Elsewhere the whole rehearsal folder is
705
938
  removed at the end - its links unlinked, never what they reach - (`--keep` keeps it and names it:
706
939
  `kept the rehearsal folder: <path>`), and on Ctrl-C or SIGTERM, with the hook and every process it
707
940
  started stopped. The clone's git folder holds a marker naming the process that made it
@@ -750,19 +983,86 @@ the answer.
750
983
  (`{}`) in its place, saying so in one line (`lot file archived: <folder>/lot.json`): the next lot on
751
984
  the branch does not inherit its entries. No lot file, an empty one, a rehearsal, a stopped run, or a
752
985
  folder that holds a `lot.json` already (a second run) leave the lot file as it is.
986
+ - `dialecte handover show [<name|folder>] [--json]` prints a hand-over's card again, recomputed from its
987
+ folder (the lots file, the snapshot) and the records - the lots found committed from the lots file's HEAD
988
+ to the tip of its branch, `DONE` when every lot is - and writes nothing: not in the folder, the store,
989
+ the worktree or its index, nor a lock or a run marker. A word without a path separator that names an
990
+ entry of the store is that entry's folder; else a number (`0171`, or unpadded `171`) names the newest
991
+ entry of the worktree of that index (ranked by name as below, never by when it was written) - `run` and
992
+ `abandon` take it the same way; anything else is a path (relative to the current folder: `./0171` is a
993
+ folder), and
994
+ a registered folder given by its path still gets its name on the card. Without an argument: the newest
995
+ registered hand-over of the current branch (the latest date, then the highest counter, from the name),
996
+ whatever its state; none for the branch: the store's entries, one `name branch state` line each, exit
997
+ 1 (an empty or missing store says so, exit 1). While the folder exists its state is the folder's own
998
+ (abandoned, pending, partly committed, committed, stale); a folder removed is `gone`: listed, never run,
999
+ never shown as a card (exit 1, naming the missing folder). After the box, when a file of a lot not yet committed
1000
+ (or `lots.json`) differs from what was reviewed, a deleted one included:
1001
+ `<n> file(s) differ from the reviewed snapshot: re-gate, then dialecte handover <folder>/lots.json --rehash`;
1002
+ then the run command on its own line, none once done or abandoned. Colour and width as the written
1003
+ card. An unknown name, or a folder that is no hand-over: exit 2, naming it. `--json` answers the card
1004
+ as data with its `folder` and `name`, as `dialecte handover --json` does, and `changedSinceReview` (the
1005
+ count of that line).
1006
+ - `dialecte handover run` without a folder runs the one registered hand-over still to run (its folder
1007
+ pending or partly committed; `--rehearse` too): an abandoned, committed, stale or gone one is skipped.
1008
+ Two or more: refused, nothing run and no run marker, one `name branch verdict` line each (`READY` or
1009
+ `BLOCKED`, computed as `show` does), exit 2; none: says so, exit 1. `handover run <name>` runs that
1010
+ registered hand-over (a gone one: exit 2, naming its folder). A hand-over in the folder of a `canceled` lot
1011
+ is not run, however it is named (exit 2 before any guard, naming the lot, nothing written).
1012
+ - `dialecte handover abandon [<name|folder>]` gives up a hand-over that will not run: it writes
1013
+ `abandoned.json` (when) in its folder, records its entry `abandoned`, then removes the lock of its worktree when the lock names this
1014
+ folder's `commit.sh` (a lock naming another hand-over is left, said in one line). Without an argument:
1015
+ the hand-over the current worktree's lock names; no lock: says nothing is held, exit 1. Refused (exit 2,
1016
+ nothing written) while a real run of it is in progress, and once every lot is committed; a partly
1017
+ committed one may be abandoned, its commits stay. A lot folder is refused too (exit 2, nothing written):
1018
+ `<full name> is a lot: its hand-over is redone with dialecte handover write --rehash --out <full name>; to
1019
+ end the lot: dialecte lot stop <full name>`. It never touches the index, a ref or a commit. An
1020
+ abandoned hand-over is `abandoned` in `list` and `show`'s listing, `ABANDONED` on its card (no run
1021
+ command); `run` without a folder skips it, `run <it>` refuses (exit 2, naming the marker); abandoning it
1022
+ again says it already is (exit 0), and `dialecte handover <lots.json> --rehash` of its folder is refused
1023
+ (exit 2, nothing written, naming `abandoned.json`): write a new hand-over into a new folder instead. A run
1024
+ and an abandon started at the same moment never both go on: each reads the other's marker again after
1025
+ writing its own, and one that finds it refuses (exit 2), nothing committed or abandoned.
753
1026
  - `dialecte handover list [--root <dir>] [--json]` lists every hand-over folder under the workspace's
754
1027
  `_commit-plan/` (or the folder given, or the current one): repository, worktree, branch, lots, age, and
755
- its state - pending, partly committed, committed, or stale when something else moved the branch. A
1028
+ its state - pending, partly committed, committed, abandoned, or stale when something else moved the branch. A
756
1029
  folder holding a hand-written `commit*.sh` and no lots file shows as "legacy script, state unknown".
757
1030
  - `dialecte worktree add <repository> <branch> [--from <ref>] [--json]` makes a worktree under the
758
- workspace's `.worktrees/<repository>-<branch tail>` (the last segment of the branch: `core-depth` for
759
- `feat/depth`; a new branch starts from `--from`, else the base
760
- branch): it copies the hooks folder `core.hooksPath` names (husky's `.husky/_` is ignored by git, so a
761
- plain worktree misses it), copies the main checkout's `node_modules` copy-on-write where the file system
1031
+ workspace's `.worktrees/<index>-<repository>-<branch tail>` (the last segment of the branch:
1032
+ `0171-core-depth` for `feat/depth`; a new branch starts from `--from`, else the base
1033
+ branch; a `<repository>` that is no folder, or a folder in no git repository, is refused in one line, exit
1034
+ 2): it copies the hooks folder `core.hooksPath` names (husky's `.husky/_` is ignored by git, so a
1035
+ plain worktree misses it), takes a `node_modules` from the workspace's pool when one matches (below), else
1036
+ copies the main checkout's `node_modules` copy-on-write where the file system
762
1037
  can (links kept, a relative link to a sibling re-pointed so it still reaches it) - from the worktree that
763
1038
  has the `--from` branch checked out when it has one, else from the main checkout - lists `.dialecte/`
764
1039
  once in the exclude file of the repository's common git folder (so for the main checkout and every
765
1040
  worktree of it), and writes the hygiene baseline `gate --fast` compares with; it prints a card.
1041
+ The index is 4 digits at least (`0001`, past `9999` it grows), one counter per workspace so the latest
1042
+ worktree sorts last: 1 + the highest of the claims in `.worktrees/.index/` (one empty file per index ever
1043
+ taken) and the numbered folders and links of `.worktrees/`. A claim is created only where none exists,
1044
+ so two runs at the same moment, of any repositories, never take the same index (the other takes the
1045
+ next), and a number stays taken after its worktree is removed. Unnumbered folders and the sibling links
1046
+ (`.worktrees/core`) count for nothing and are never renamed. `--json` carries `index`.
1047
+ The pool: a finished checkout's `node_modules` waits in `.worktrees/_pool-<repository>-<n>/node_modules`,
1048
+ with a `pool.json` beside it (`{ repository, lockHash, parkedAt }`, `lockHash` the sha256 of the
1049
+ `package-lock.json` it was checked against), at most two entries per repository (parking a third sends
1050
+ the oldest to the trash). A park (`lot close`, the end of a rehearsal) takes only a `node_modules` that
1051
+ matches its `package-lock.json` (as `worktree add` reads it), rewrites absolute, in place, every link inside
1052
+ it whose relative target leaves its checkout (a sibling repository; a link into the checkout itself, an npm
1053
+ workspace package, stays relative and reaches the taker's own package), renames the folder into a new entry (no file is copied),
1054
+ sends `node_modules/.vite` and `node_modules/.cache` to the trash (or leaves them in the folder already
1055
+ going there), then writes `pool.json`; a `_pool-*` folder without one is a park that never finished,
1056
+ never taken, and `worktree prune` names it as left over. `worktree add` takes the newest entry of the
1057
+ repository whose `lockHash` is the new worktree's `package-lock.json` hash (a rename: two takers never
1058
+ share one, the second goes on to the next entry), then reads it against the lockfile as it reads a copy.
1059
+ No match, an empty pool or a rename across file systems: the copy. The card's `node_modules` row says
1060
+ which and how long (`pooled _pool-cli-1 0.1 s`, `copy-on-write 46.2 s`); `--json` carries
1061
+ `nodeModules: { method, from?, seconds }`. The trash: `.worktrees/_trash/` - a worktree goes there by
1062
+ `git worktree move` (git keeps it registered) then a background `git worktree remove --force`, a folder
1063
+ by a rename then a background `rm -rf` of that one path; nobody waits for either. A folder left there (a
1064
+ sleep, a crash) stays for you to look at. The pool and the trash are used only where the repository's
1065
+ parent holds `.worktrees/`.
766
1066
  Before the copy it makes the links the worktree's `file:` and `link:` dependencies need (`dependencies`,
767
1067
  `devDependencies`, `optionalDependencies`, `peerDependencies`): a relative path that leaves the worktree
768
1068
  into the workspace's `.worktrees/` (`file:../core` from `.worktrees/cli-x` reaches `.worktrees/core`)
@@ -790,6 +1090,96 @@ the answer.
790
1090
  (`lockfile`, `notChecked`, `problems`: `package`, `problem`; `command` when there are problems). The
791
1091
  exit code stays 0 whatever the links and the lockfile say: the worktree exists, and its card says what
792
1092
  to run.
1093
+ - `dialecte lot start <brief.json> [--effort low|medium|high] [--dry-run] [--simulate <scenario>] [--json]` starts a lot from its brief
1094
+ (`schema`, `feature`, `repository`, `branch`, `base`, `goal`, `plan`, `scope`, `steps`, `lots`, `effort`).
1095
+ Every check runs first and every refusal is printed at once (`<field>: <rule> - <detail>`, `{ refused }` with
1096
+ `--json`, exit 2), before anything is created: the fields, the repository's main checkout, a new valid branch,
1097
+ a base that resolves to a commit, the plan and each step's heading in it, the scope and the lots covering it
1098
+ (a lot path is inside a scope entry by path segments: `lib/x` is inside `lib/`, `lib-other/x` and `libx` are
1099
+ not; an entry whose glob cuts a name, `src/data*`, compares by string prefix), no
1100
+ overlap with an open lot of the same store. Then it claims the next worktree index, publishes the lot folder
1101
+ `<git common folder>/dialecte-lots/<index>-<repository>-<branch tail>/` (the brief, a copy of the plan, the
1102
+ first transition, `identity.json` last; every record written once, read-only), makes the numbered worktree at
1103
+ the recorded base commit and its `.dialecte/lot` link to the lot folder. The store is appended to the user's
1104
+ store list (`$XDG_STATE_HOME/dialecte/lot-stores`, else `~/.local/state/dialecte/lot-stores`), refused when
1105
+ that list sits inside a git work tree. `--dry-run` runs the checks (the store-list refusal included, no
1106
+ hard-link probe), names the lot and the start to run next (`next: dialecte lot start <brief path as given>`),
1107
+ writing and claiming nothing. A worktree that cannot be made leaves the lot
1108
+ `failed` (exit 1), nothing removed, with `next: dialecte lot stop <full name> --reason <text>`; a link that
1109
+ cannot be made leaves the lot working (exit 0, a `note:` line, `notes` in JSON; `lot status` reports the link
1110
+ missing). Every `--json` exit is JSON: `{ lot, folder, worktree, runner, notes, next }` started,
1111
+ `{ dryRun: true, lot, worktree, next }` dry run, `{ lot, folder, state, reason, next }` failed,
1112
+ `{ refused, next: null }` a refused brief, `{ error, usage, next: null }` a usage error (exit 2),
1113
+ `{ error, next: null }` any other exit before a lot exists.
1114
+ - `dialecte lot status <id> [--json]` derives the lot's state from its records (`working`, `input-required`,
1115
+ `ready`, `committed`, `canceled`, `failed`), with the worktree and link checks and the exact next command (the
1116
+ text form adds an `also:` line when there is one, five lines at most); it
1117
+ reads files only, runs no git and writes nothing. Exit 0 for a lot found, 2 for an unknown or ambiguous id
1118
+ (`{ error, next: null }` with `--json`) or a usage error (`{ error, usage, next: null }`). An
1119
+ `<id>` is an index (`171` = `0171`), a full name, a lot folder or `.dialecte/lot`; a word naming an existing
1120
+ folder is that folder. The review rounds' verbs take `<id|folder>` the same way (a write needs an index
1121
+ unique across every store of the list), and a lot folder is accepted as their hand-over folder although it
1122
+ sits in the git folder.
1123
+ - The host loop: `lot start -> lot wait -> (lot answer -> lot wait)* -> lot result`. Every output names the exact
1124
+ next command with the lot's full name, and the exit code says what the host does next (section below). Every
1125
+ answer of `status`, `wait`, `answer`, `result` and `stop` goes to standard output, whatever its exit code; only
1126
+ a usage error or a refusal (exit 2), and an answer hook that threw (exit 1 of `answer`), go to standard error.
1127
+ `inbox` follows the same rule (its exit 1, nothing waits, is an answer). `lot start` stays outside it: a
1128
+ refused start (exit 2) or a failed one (exit 1, the lot `failed`) is an error on standard error, naming the lot
1129
+ and its next command. The answer line of a caller's question carries no `--by` (it defaults to `caller`); a person's names
1130
+ `--by <who>`.
1131
+ - `dialecte lot wait <id> [--timeout <seconds>] [--json]` returns the status as soon as the lot needs someone:
1132
+ exit 0 `ready` or `committed`, 1 `failed` or `canceled`, 3 `input-required` (at once, every time, costing
1133
+ nothing), 4 when the last transition is a limit (run again), 5 when `--timeout` is reached while the lot still
1134
+ works. A real lot is looked at every second, by a stat of its folders and of the registry, and read again only
1135
+ when one changed, nothing written; on a terminal a `waiting <name> (<state>,
1136
+ <elapsed>)` line refreshes (never under `--json`). A simulated lot is played up to its next blocking point.
1137
+ - `dialecte lot answer <id> <question> "<answer>" [--by <who>] [--json]` records the answer to an open question
1138
+ once, then prints the status with `next: dialecte lot wait <name>`. The answer is one line; a question with
1139
+ options takes one of them (compared trimmed, case-folded, recorded as the option is written); the same answer
1140
+ again is `already`, another one is refused. A person's question needs `--by <who>` (not `caller`); a caller's
1141
+ defaults to `caller`. `--by` is one line, not empty, checked before the lot is read (exit 2 naming `--by`).
1142
+ A refusal's text form escapes the options, answer and `--by` it quotes (a line feed in them prints as
1143
+ `\u{a}`, the refusal stays one line); `--json` carries them as stored.
1144
+ - `dialecte lot result <id> [--json]` never blocks and writes nothing. A `ready` or `committed` lot exits 0 with
1145
+ `{ lot, state, handover: { name, folder, state, card, show, run }, worktree, branch, questions, simulated }`:
1146
+ the card is the one `handover show --json` computes, `handover.state` the hand-over's own state read from git
1147
+ (`committed` once its lots are committed, even before the registry says so), `questions` the answered ones
1148
+ (`{ id, text, answer, by }`); a simulated lot's `handover` is `{ simulated: true }`, nothing to show or run.
1149
+ `failed` and `canceled` exit 1 with `{ state, reason, at, position }` of the last transition, `input-required`
1150
+ exits 3 with the open questions, `working` exits 5. The text form prints agent text escaped.
1151
+ - `dialecte lot stop <id> --reason <text> [--by <who>] [--json]` ends a lot. A `committed` lot is refused
1152
+ (exit 2). A pending hand-over is abandoned first, as `handover abandon` does (`abandoned.json`, the registry
1153
+ entry `abandoned`, the lock released when it names that hand-over); while its run is in progress, or once it is
1154
+ committed, the stop is refused (exit 2) and publishes nothing. Then a `canceled` transition (cause `stop`, the
1155
+ reason, `--by` or `caller`), and the registry is read once more: a hand-over registered meanwhile is abandoned
1156
+ at once. A lot already `canceled` exits 0 writing nothing; one whose entry is still `pending` (a crash inside an
1157
+ earlier stop) is repaired. It moves no worktree and deletes nothing; `lot close` and `worktree prune` let the
1158
+ worktree go once the lot is canceled. The reason and `--by` are one line, not empty (exit 2).
1159
+ - `dialecte lot start --simulate <scenario>` starts a simulated lot that plays one of the scenarios (`ready`,
1160
+ `question`, `person`, `two-questions`, `limit`, `failure`, `slow`) under `lot wait`, publishing the records a
1161
+ real run would: it writes only its lot folder, one line of the store list and one index claim, never a branch,
1162
+ a worktree or a registry entry, and never blocks a real lot. A host proves its loop on it before a real run.
1163
+ With `--dry-run` it is the dry run of that simulated start: exit 0, the findings a real start would refuse for
1164
+ listed (`wouldRefuse` in JSON, `worktree: null`), no worktree named, and `next` the same start with
1165
+ `--simulate <scenario>`; nothing claimed or written.
1166
+ - `dialecte inbox [--repository <name>] [--simulated] [--json]` lists what waits on someone across every store of
1167
+ the store list and the store of the current folder: one line per open question (person questions first, then
1168
+ caller questions), then the ready lots, then the failed ones, by index within a group, each line
1169
+ `<index> <repository> <branch> <what> <next command>`, where `<what>` is `question q<k> (person|caller)
1170
+ <question text>`, `READY` or `FAILED <reason>` and the next command is the lot's own (the answer line of that
1171
+ question, `handover show`, `lot result` or `lot stop`); then `working <n> · simulated <m> (listed with
1172
+ --simulated)`. `--repository` keeps the lots whose repository folder has that name, `--simulated` lists the
1173
+ simulated lots that wait. A lot folder whose `identity.json` does not read, or whose records do not hold, is a
1174
+ `damaged <folder>: <reason>` line. The records are checked once, on read: a question id is `q<k>` (k 1 or
1175
+ more), an audience `caller` or `person`, a position's step, of and round non-negative integers, a transition's
1176
+ `at` a time, an answer file's question its file's `q<k>`. Every lot verb refuses such a lot (exit 2), so no
1177
+ forged field reaches a line or a `next`. It reads files only (each registry once per store), runs no process, writes nothing. `--json`:
1178
+ `{ waiting: [<status of each waiting lot>], working, simulated, damaged }`. Exit 0 when something waits or is
1179
+ damaged, 1 when nothing does, 2 for a usage error.
1180
+ - `.dialecte/lot` reaches the lot folder, whose `round-<n>/` snapshots hold copies of the lot's files, tests
1181
+ included. Leave `.dialecte/` out of every tool that walks the worktree: a test runner whose globs include dot
1182
+ folders, a formatter, a linter. Git already leaves it out (`worktree add` excludes it).
793
1183
  - `dialecte lot exempt <reason>`, `lot accept <case> <reason>`, `lot revised <case|file|glob> <reason>`,
794
1184
  `lot gone <file|glob> <reason>` write the lot declaration `.dialecte/lot.json` at the package root (the
795
1185
  nearest package.json above the current folder) as tab-indented JSON, keeping what it holds; the same
@@ -798,6 +1188,74 @@ the answer.
798
1188
  - `dialecte lot mutation <off|changed|audit|gate>` writes the lot's mutation switch (`"mutation"`, no
799
1189
  reason). Without it, `dialecte mutants run` mutates the changed lines when the lot's diff touches the
800
1190
  declared scope and nothing otherwise; `audit` mutates the whole scope; `gate` runs as `changed`.
1191
+ - `dialecte lot standard <id|folder> consulted <note> | not-consulted <reason>` writes `<folder>/standard.json`
1192
+ (`{ state, note, at }`, the note's words joined by single spaces) for the card's `standard` line; the line
1193
+ references of what was read stay in the findings ledger. Another state, or no note, is a usage error
1194
+ (exit 2); a folder inside a repository is refused as below.
1195
+ - `dialecte lot finding`, `decide`, `snapshot`, `choice` and `delta` keep a lot's review rounds in its
1196
+ lot folder, or in a hand-over folder (`_commit-plan/<topic>-<date>/`) that stays outside every repository:
1197
+ each refuses any other folder inside a git work tree or a git folder (`.git/`, a bare repository). `--` ends the options: the
1198
+ words after it are taken as they are, so a finding or a reason may start with `--`. Each writes its file
1199
+ whole (a temporary file renamed over it), so a reader never sees half a ledger.
1200
+ - `lot finding <id|folder> --round <n> --severity <blocking|should-fix|nit> --at <file:line> <finding>`
1201
+ appends the row `| R<n>-<k> | <n> | <severity> | <file:line> | <finding> | open |` to
1202
+ `<folder>/findings-ledger.md` (the folder, the file and its table made when absent; k one past the
1203
+ highest of the round). A `|` is written `\|`; a line break is refused. A hand-written ledger keeps
1204
+ every other byte.
1205
+ - `lot decide <id|folder> <finding> <state>` rewrites that row's state cell: `open`, `fix-to-verify`,
1206
+ `fixed <round> [note]` (a round after the one that raised it), `accepted <reason>`, `logged <where>`.
1207
+ An id not in the ledger is refused, naming the ids it holds.
1208
+ - `lot choice <id|folder> --by <who> <decision>` appends `| <decision> | <who> | <yyyy-mm-dd> |` to
1209
+ `<folder>/decisions.md` (made with its title and table when absent): a decision made outside the
1210
+ findings ledger, the user's above all. A `|` is written `\|`; an empty `--by`, a line break, or more
1211
+ than one decision word (quote it) is refused.
1212
+ - `lot snapshot <id|folder> --round <n>` copies every file `git status --porcelain -z
1213
+ --untracked-files=all` lists at the worktree root (the old path of a rename included) to
1214
+ `round-<n>/` at its repository-relative path - bytes, mode, a symlink as a symlink; a path gone from
1215
+ disk (or now a folder) that HEAD holds goes in `round-<n>.deleted`, NUL-separated, sorted; HEAD in
1216
+ `round-<n>.base`. An existing round, an untracked nested repository and a submodule (a gitlink in the
1217
+ index or at HEAD) are refused; a run that
1218
+ stops part-way leaves only `.partial` names, which the next run removes. `.dialecte/lot.json` is
1219
+ never part of it.
1220
+ - `lot delta <id|folder> --round <n> [--worktree] [--json]` (n ≥ 2) prints, for each file of
1221
+ `round-<n-1>/`, of `round-<n-1>.deleted` or of the worktree's status, what changed since round n-1,
1222
+ in the form that fits where the file is: the snapshot copy against the worktree file (or
1223
+ `/dev/null` when it is gone), `/dev/null` against a file deleted then and back now or new and absent
1224
+ from the base, `git diff HEAD` for a file round n-1 had at the base. Files unchanged since round n-1
1225
+ are left out; colour, external diff and textconv settings never apply. It refuses when HEAD moved
1226
+ since `round-<n-1>.base`, and refuses a nested repository or a submodule as `lot snapshot` does. `--worktree` adds a throwaway worktree on the branch
1227
+ `<lot branch>-round-<n-1>` from the lot's branch tip, in `.worktrees/<index>-<repository>-<branch
1228
+ tail>-round-<n-1>` with the lot's own index when its worktree is numbered (no new claim; else the
1229
+ workspace's next): the deletions applied with `git rm
1230
+ --pathspec-from-file`, then `round-<n-1>/` copied over, so a new test can run on the old code; it
1231
+ prints its path and the removal command with its absolute `cd`. The lot's worktree is never
1232
+ changed. Its `node_modules` comes from the pool, or a copy, as for `worktree add`.
1233
+ - `lot close <hand-over name|index>... [--json]` closes finished lots: for each hand-over of the registry
1234
+ named (by its name or its worktree's index) whose state is `committed` or `abandoned`, its worktree (the
1235
+ path the registry entry holds) is closed: every decision first, for every argument with every rule, its
1236
+ own state and branch included (one worktree reached by several names or indexes closes only when every
1237
+ one of them may close, and then once, the other arguments answered "the same worktree as ..."; when one
1238
+ keeps it, every one of them is kept, each line with the reason), its
1239
+ `node_modules` read against the lockfile where it is; then the links of its `node_modules`
1240
+ made absolute where they are, the worktree moved to the trash (`.worktrees/_trash/`, by
1241
+ `git worktree move`), its `node_modules` parked in the pool (`.worktrees/_pool-<repository>-<n>`) from
1242
+ there, its caches left in the trashed folder, and the trashed worktree removed in the background. Kept,
1243
+ with why and nothing done for that hand-over: first, a worktree a lot of the repository's store names
1244
+ (by real path) while the lot is not `committed` nor `canceled`, reason `lot <full name> <state>` (the
1245
+ store read once, no git process per lot); a hand-over still `pending`; its worktree is the main
1246
+ checkout (never parked, moved or trashed); no registered worktree at that path (closed already, or one
1247
+ in the trash or the pool: never a target again); a worktree on another branch than the hand-over's
1248
+ (both branches named: it holds other work now); a `locked` worktree (`git worktree lock`); a mutation
1249
+ run started from it that still runs or died before reporting; `lot close` itself run from inside it
1250
+ (run it from another folder); a process whose working folder is in it;
1251
+ the processes not known (`lsof` failed or took longer than 20 s); a `dirty` worktree (anything
1252
+ `git status --porcelain --untracked-files=normal` lists, untracked files included whatever
1253
+ `status.showUntrackedFiles` says). The branch is never touched (`worktree prune` still lists the merged
1254
+ ones). Each line names the folder it moved and where `node_modules` went (`closed <name>: 0007-cli-x;
1255
+ node_modules pooled in _pool-cli-1`, or `trashed: <why it was not parked>`); a failure part-way keeps
1256
+ that hand-over with the error and what was already moved, the others go on. Exit 0 when every named
1257
+ hand-over closed, 1 when one was kept, 2 for a name or index the registry does not hold (then nothing is
1258
+ closed); `--json` prints `[{ handover, closed: true } | { handover, kept }]`.
801
1259
  - `dialecte mutants run [--mode changed|audit] [--base <ref>]` runs StrykerJS (resolved from the package,
802
1260
  its devDependency) on the scope `package.json` declares:
803
1261
  `"dialecte": { "mutation": { "scope": [...], "exclude": [...], "errorFactories": [...], "fast": { "vitestConfig": "..." }, "full": { "command": "..." } } }`.
@@ -876,7 +1334,9 @@ the answer.
876
1334
  earlier cli versions made in the system's temporary folder, each judged by its marker - with the
877
1335
  command that removes each (its absolute `cd` first).
878
1336
  `--yes` runs them after a confirmation on a terminal; without a terminal it refuses, so hand the
879
- commands (or the `--yes` command) to a person. Kept, each with why: an unmerged branch; the branch the
1337
+ commands (or the `--yes` command) to a person. Kept, each with why: first, a worktree a lot of the
1338
+ repository's store names (by real path) while the lot is not `committed` nor `canceled`
1339
+ (`<branch>: lot <full name> <state>`; the store read once per repository, no git process per lot); an unmerged branch; the branch the
880
1340
  main checkout is on; a worktree a mutation run was started from while that run still runs
881
1341
  (`mutation run <id> still running (pid <pid>)`) or after it died before reporting
882
1342
  (`mutation run <id> died before reporting: rerun or dialecte mutants abandon <id>`; a reported or
@@ -896,47 +1356,11 @@ the answer.
896
1356
  checkout, a link's too: while a registered worktree of the repository is a link, a worktree deleted
897
1357
  from disk is kept, naming that link, and no `git worktree prune` is offered. The sibling links
898
1358
  `worktree add` makes (`.worktrees/core -> ../core`) are in no item. It reads each worktree with
899
- `git --no-optional-locks`, so it never rewrites an index. `handover list` follows a link to a hand-over
900
- folder and lists a folder reached by its path and through a link once.
901
- - `dialecte record standard <folder> consulted <note> | not-consulted <reason>` writes `<folder>/standard.json`
902
- (`{ state, note, at }`, the note's words joined by single spaces) for the card's `standard` line; the line
903
- references of what was read stay in the findings ledger. Another state, or no note, is a usage error
904
- (exit 2); a folder inside a repository is refused as below.
905
- - `dialecte record review|decision|snapshot` and `dialecte review delta` keep a lot's review rounds in its
906
- hand-over folder (`_commit-plan/<topic>-<date>/`), which stays outside every repository: each refuses a
907
- folder inside a git work tree or a git folder (`.git/`, a bare repository). `--` ends the options: the
908
- words after it are taken as they are, so a finding or a reason may start with `--`.
909
- - `record review <folder> --round <n> --severity <blocking|should-fix|nit> --at <file:line> <finding>`
910
- appends the row `| R<n>-<k> | <n> | <severity> | <file:line> | <finding> | open |` to
911
- `<folder>/findings-ledger.md` (the folder, the file and its table made when absent; k one past the
912
- highest of the round). A `|` is written `\|`; a line break is refused. A hand-written ledger keeps
913
- every other byte.
914
- - `record decision <folder> <id> <state>` rewrites that row's state cell: `open`, `fix-to-verify`,
915
- `fixed <round> [note]` (a round after the one that raised it), `accepted <reason>`, `logged <where>`.
916
- An id not in the ledger is refused, naming the ids it holds.
917
- - `record choice <folder> --by <who> <decision>` appends `| <decision> | <who> | <yyyy-mm-dd> |` to
918
- `<folder>/decisions.md` (made with its title and table when absent): a decision made outside the
919
- findings ledger, the user's above all. A `|` is written `\|`; an empty `--by`, a line break, or more
920
- than one decision word (quote it) is refused.
921
- - `record snapshot <folder> --round <n>` copies every file `git status --porcelain -z
922
- --untracked-files=all` lists at the worktree root (the old path of a rename included) to
923
- `round-<n>/` at its repository-relative path - bytes, mode, a symlink as a symlink; a path gone from
924
- disk (or now a folder) that HEAD holds goes in `round-<n>.deleted`, NUL-separated, sorted; HEAD in
925
- `round-<n>.base`. An existing round, an untracked nested repository and a submodule (a gitlink in the
926
- index or at HEAD) are refused; a run that
927
- stops part-way leaves only `.partial` names, which the next run removes. `.dialecte/lot.json` is
928
- never part of it.
929
- - `review delta <folder> --round <n> [--worktree] [--json]` (n ≥ 2) prints, for each file of
930
- `round-<n-1>/`, of `round-<n-1>.deleted` or of the worktree's status, what changed since round n-1,
931
- in the form that fits where the file is: the snapshot copy against the worktree file (or
932
- `/dev/null` when it is gone), `/dev/null` against a file deleted then and back now or new and absent
933
- from the base, `git diff HEAD` for a file round n-1 had at the base. Files unchanged since round n-1
934
- are left out; colour, external diff and textconv settings never apply. It refuses when HEAD moved
935
- since `round-<n-1>.base`, and refuses a nested repository or a submodule as `record snapshot` does. `--worktree` adds a throwaway worktree on the branch
936
- `<lot branch>-round-<n-1>` from the lot's branch tip: the deletions applied with `git rm
937
- --pathspec-from-file`, then `round-<n-1>/` copied over, so a new test can run on the old code; it
938
- prints its path and the removal command with its absolute `cd`. The lot's worktree is never
939
- changed.
1359
+ `git --no-optional-locks`, so it never rewrites an index. Each hand-over's repository is read once for
1360
+ the whole workspace, and its state once, never once per repository. `handover list` follows a link to a
1361
+ hand-over folder and lists a folder reached by its path and through a link once. The pool entries and the
1362
+ trash (a worktree in `_trash/` included) are never listed nor touched: one line each,
1363
+ `pool: 2 entries (cli 1, core 1)` and `trash: 3 folders, being deleted or left over`.
940
1364
 
941
1365
  `gate --fast` starts with the hygiene of the worktree: nothing staged; no stash entry pushed on this
942
1366
  worktree's branch since `worktree add` made it (the baseline keeps every stash entry it saw, so another
@@ -964,7 +1388,9 @@ changed since the base (test files, helpers, fixtures, snapshots) must be as the
964
1388
  others fail the gate with the list. The flags of the receipts and the deleted cases are printed under the
965
1389
  step. The lot file may also accept cases without a red - a new test of behaviour that already exists, an honest
966
1390
  cut of an assertion: `"accept": [{ "case": "<file>::<name> [project]", "reason": "..." }]`. An accepted
967
- case passes `tdd red` as accepted and does not block its file; the gate lists each acceptance with its
1391
+ case passes `tdd red` as accepted and does not block its file (a case already proven red then green keeps
1392
+ its proof: an acceptance never overrides one, and an accepted receipt counts only while its entry stays in
1393
+ the file); the gate lists each acceptance with its
968
1394
  reason, the hand-over card counts them by reason from the receipts (those of earlier lots, which the file
969
1395
  no longer names, counted on one line), and both report an acceptance or a `revised` entry no case used. The card
970
1396
  lists every `gone` entry with its reason; only the gate reports a `gone` entry that covers no finding. The file is strict: an unknown key, at the top or in
@@ -1008,13 +1434,48 @@ allows every tag already, so `allowReferences` changes nothing there (`dialecte
1008
1434
  folder included: it is hashed and scanned as its target text and committed as a link, the way git stores it (a
1009
1435
  rehearsal copies it as the same relative link).
1010
1436
 
1011
- ### GitHub text: recap and text check
1437
+ **Scoped steps, heavy steps, the release list.** A step of `fast`, `full` or `release` may say `"scoped": true`
1438
+ (never with `changedOnly`, never in `contrib.steps`): the gate resolves one base per run - `--base <ref>`, else the
1439
+ merge-base of HEAD and `baseBranch` (local, else `origin/`), else the empty tree (everything changed) - and hands the
1440
+ step `DIALECTE_GATE_BASE`, `DIALECTE_GATE_TREE`, `DIALECTE_GATE_CHANGED` (a file of the changed paths byte for byte,
1441
+ NUL-separated, both paths of a rename, relative to the repository top as `git diff --name-only` names them, while a
1442
+ declared `failing` path is relative to the package root) and `DIALECTE_GATE_SELECTION` (a path to write). The step writes there
1443
+ `{ "schema": 1, "base", "tree", "changed": <paths judged>, "selected": [{ "id", "reasons": [...] }], "skipped": [{ "id", "reason" }] }`:
1444
+ `selected` and `skipped` are both required lists, each selected id has at least one reason, the file is at most 1 MiB
1445
+ and an id matches `[A-Za-z0-9][A-Za-z0-9._-]{0,63}`. A missing or invalid selection, another base or tree, or another
1446
+ count fails the step. An empty selection should exit 0 without starting vitest: it passes with
1447
+ `nothing selected since <base> (<n> paths changed)` (`1 path changed` for one); a non-empty selection on a
1448
+ `counts: "tests"` step that runs no test fails (`no test ran`). The step selects from the working files (never
1449
+ `git show <tree>:`), so what it selects and what it runs are the same code. A failing step counting tests is rerun
1450
+ once, serially, with its failing files appended as plain arguments (after one added `--` only when the step runs
1451
+ through `npm run` and its command holds none), then `--no-file-parallelism`, with the same base, tree and changed file
1452
+ and a new selection path: the rerun must select the same ids, and a script running vitest more than once passes
1453
+ `--passWithNoTests` to each invocation (or runs one). A scoped step whose command (or the npm script it runs) does not
1454
+ name vitest is rerun whatever runs it, when it exited non-zero on a test failure (a failed test counted, a `FAIL` line,
1455
+ vitest's `Unhandled Errors` or `Errors <n> error` summary); for such a step a plain script error fails as itself. A
1456
+ scoped step that names vitest keeps the rule of any vitest step: rerun on any failure. A first run whose selection is
1457
+ not valid is never rerun.
1458
+ The selection may declare `"failing": ["<path>", ...]` (relative to the package root, no `..`, no backslash; a leading
1459
+ `./` and repeated `/` are normalised away): a failed step records those files with the ones its output names
1460
+ (`failing` in the record and in `--json`; the card's row ends `· failing <n>: <first 3>`).
1461
+ Run outside the gate (no `DIALECTE_GATE_SELECTION`), a scoped script selects everything. The base enters the record's
1462
+ key, so a run at another base never reuses. `"heavy": true` marks a heavy suite (a browser suite); it is outside the
1463
+ command hash. `gate.release` is the list `gate --release` runs (default: the `full` steps, derived ones included),
1464
+ every scoped step against the empty tree (`--base` with `--release` feeds only the tdd step); it _covers full_ when
1465
+ every `full` step is in it with the same `name`, `run`, `counts` and `changedOnly`, and only then does its green
1466
+ record answer a commit hook, a rehearsal, contrib and the card. An environment switch that changes what runs belongs
1467
+ in the step's `run`. A gate config the cli cannot run (a list that
1468
+ is no list of steps, a step without `name` or `run`, a `scoped` or `heavy` that is no boolean, `scoped` with
1469
+ `changedOnly`) is refused naming the list and the step: `gate`, `contrib` and `handover run` exit 2, `gate --hook`
1470
+ exits 1, the card prints `✗ gate invalid gate config: <message>`.
1471
+
1472
+ ### GitHub text: lot recap and text check
1012
1473
 
1013
1474
  Text written with an assistant tends to retell the diff and grow long. The pull request splits in two:
1014
1475
  an expandable part made from records, and a short human part that is checked before it is posted. Both
1015
1476
  commands only print; the user posts.
1016
1477
 
1017
- - `dialecte recap <hand-over folder>` prints the expandable part (`<details>`) as GitHub markdown, from the
1478
+ - `dialecte lot recap <id|folder>` prints the expandable part (`<details>`) as GitHub markdown, from the
1018
1479
  records only: the commits of the lots (or `not committed yet`), the test cases the newest gate record of the
1019
1480
  current tree judged red then green, counted per test file, the gate and rules lines (and `mutation`), the
1020
1481
  lot's mutation runs (`Mutation`: each run of the branch and of the branches it merges, oldest first, with
@@ -1022,7 +1483,9 @@ commands only print; the user posts.
1022
1483
  on those branches and scheduled, with its follow-up; `No mutation run.`, or `No mutation scope declared.`
1023
1484
  for a package without one), the review rounds from
1024
1485
  the findings ledger, the decisions (accepted findings, the lot declaration's `accept` and `revised` entries,
1025
- the rows of `decisions.md`), the logged findings as follow-ups, and who reviewed and posted it (`git config
1486
+ the rows of `decisions.md`, then, in a lot folder, one row per answer `answers/q<k>.json` in `k` order:
1487
+ `q<k> <question text> -> <answer>`, by who answered, on the UTC day of the answer; an answer is never copied
1488
+ into `decisions.md`), the logged findings as follow-ups, and who reviewed and posted it (`git config
1026
1489
  user.name`; no name set is refused). Every section is always there, saying so in one line when empty; a
1027
1490
  branch that does not hold the lots on top of the recorded base lists none as committed and says so. Each
1028
1491
  finding is printed with its id, its text without one leading reviewer tag `[...]`. The ledger is read whole: