create-lathe 0.0.0-stage → 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 (87) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +135 -2
  3. package/bin/create-lathe.js +80 -0
  4. package/dist/framework.lock +113 -0
  5. package/dist/package/crates/instrument/Cargo.lock +415 -0
  6. package/dist/package/crates/instrument/Cargo.toml +27 -0
  7. package/dist/package/crates/instrument/examples/instrument.rs +73 -0
  8. package/dist/package/crates/instrument/src/client.rs +128 -0
  9. package/dist/package/crates/instrument/src/lib.rs +32 -0
  10. package/dist/package/crates/instrument/src/logging.rs +109 -0
  11. package/dist/package/crates/instrument/src/protocol.rs +49 -0
  12. package/dist/package/crates/instrument/src/registry.rs +166 -0
  13. package/dist/package/crates/instrument/src/selftest.rs +314 -0
  14. package/dist/package/crates/instrument/src/server.rs +303 -0
  15. package/dist/package/crates/instrument/tests/command_log.rs +60 -0
  16. package/dist/package/crates/instrument/tests/round_trip.rs +134 -0
  17. package/dist/package/crates/instrument/tests/selftest_fail.rs +25 -0
  18. package/dist/package/crates/instrument/tests/selftest_pass.rs +24 -0
  19. package/dist/package/crates/instrument/tests/support/mod.rs +38 -0
  20. package/dist/package/pi/context/journal-de-lot.md +24 -0
  21. package/dist/package/pi/context/tech-skill.md +19 -0
  22. package/dist/package/pi/context/ticket-closed.md +18 -0
  23. package/dist/package/scripts/framework.py +1314 -0
  24. package/dist/package/scripts/gates.py +1134 -0
  25. package/dist/package/scripts/setup.py +195 -0
  26. package/dist/package/skills/bootstrap/SKILL.md +110 -0
  27. package/dist/package/skills/documentation/SKILL.md +110 -0
  28. package/dist/package/skills/documentation/references/agents-md.md +70 -0
  29. package/dist/package/skills/documentation/references/corpus.md +112 -0
  30. package/dist/package/skills/journal/SKILL.md +81 -0
  31. package/dist/package/skills/journal/references/entry.md +172 -0
  32. package/dist/package/skills/lathe/SKILL.md +168 -0
  33. package/dist/package/skills/lathe/evals/routing.md +196 -0
  34. package/dist/package/skills/lathe/references/install.md +128 -0
  35. package/dist/package/skills/lathe/references/invariants.md +31 -0
  36. package/dist/package/skills/mutants/SKILL.md +85 -0
  37. package/dist/package/skills/mutants/references/cargo-mutants.md +176 -0
  38. package/dist/package/skills/mutants/references/triage.md +88 -0
  39. package/dist/package/skills/optimize/SKILL.md +87 -0
  40. package/dist/package/skills/optimize/references/codspeed.md +126 -0
  41. package/dist/package/skills/probe/SKILL.md +82 -0
  42. package/dist/package/skills/probe/references/wait-and-read.md +53 -0
  43. package/dist/package/skills/replicate-ui/SKILL.md +64 -0
  44. package/dist/package/skills/rust/SKILL.md +147 -0
  45. package/dist/package/skills/rust/references/errors.md +63 -0
  46. package/dist/package/skills/rust/references/unsafe.md +65 -0
  47. package/dist/package/skills/scaffold/SKILL.md +78 -0
  48. package/dist/package/skills/scaffold/profiles/rust-cli/.cargo/config.toml +2 -0
  49. package/dist/package/skills/scaffold/profiles/rust-cli/AGENTS.md +22 -0
  50. package/dist/package/skills/scaffold/profiles/rust-cli/Cargo.lock +7 -0
  51. package/dist/package/skills/scaffold/profiles/rust-cli/Cargo.toml +17 -0
  52. package/dist/package/skills/scaffold/profiles/rust-cli/README.md +15 -0
  53. package/dist/package/skills/scaffold/profiles/rust-cli/deny.toml +14 -0
  54. package/dist/package/skills/scaffold/profiles/rust-cli/rustfmt.toml +2 -0
  55. package/dist/package/skills/scaffold/profiles/rust-cli/src/main.rs +38 -0
  56. package/dist/package/skills/scaffold/profiles/rust-cli/tests/cli.rs +27 -0
  57. package/dist/package/skills/scaffold/profiles/rust-library/.cargo/config.toml +2 -0
  58. package/dist/package/skills/scaffold/profiles/rust-library/AGENTS.md +21 -0
  59. package/dist/package/skills/scaffold/profiles/rust-library/Cargo.lock +7 -0
  60. package/dist/package/skills/scaffold/profiles/rust-library/Cargo.toml +18 -0
  61. package/dist/package/skills/scaffold/profiles/rust-library/README.md +15 -0
  62. package/dist/package/skills/scaffold/profiles/rust-library/deny.toml +14 -0
  63. package/dist/package/skills/scaffold/profiles/rust-library/rustfmt.toml +2 -0
  64. package/dist/package/skills/scaffold/profiles/rust-library/src/lib.rs +25 -0
  65. package/dist/package/skills/scaffold/profiles/rust-native-desktop/.cargo/config.toml +2 -0
  66. package/dist/package/skills/scaffold/profiles/rust-native-desktop/AGENTS.md +23 -0
  67. package/dist/package/skills/scaffold/profiles/rust-native-desktop/Cargo.lock +9252 -0
  68. package/dist/package/skills/scaffold/profiles/rust-native-desktop/Cargo.toml +24 -0
  69. package/dist/package/skills/scaffold/profiles/rust-native-desktop/README.md +15 -0
  70. package/dist/package/skills/scaffold/profiles/rust-native-desktop/deny.toml +35 -0
  71. package/dist/package/skills/scaffold/profiles/rust-native-desktop/rustfmt.toml +2 -0
  72. package/dist/package/skills/scaffold/profiles/rust-native-desktop/src/main.rs +74 -0
  73. package/dist/package/skills/scaffold/references/gates.md +29 -0
  74. package/dist/package/skills/scaffold/references/profiles.md +36 -0
  75. package/dist/package/skills/update/SKILL.md +115 -0
  76. package/dist/package/skills/verify-visual/SKILL.md +82 -0
  77. package/dist/package/skills/verify-visual/references/baseline.md +46 -0
  78. package/dist/package/skills/visual-loop/SKILL.md +72 -0
  79. package/dist/package/workflows/batch-to-review.md +41 -0
  80. package/dist/package/workflows/framework-improvement.md +38 -0
  81. package/dist/package/workflows/hard-bug.md +37 -0
  82. package/dist/package/workflows/new-rust-cli.md +33 -0
  83. package/dist/package/workflows/new-rust-desktop-app.md +41 -0
  84. package/dist/package/workflows/new-rust-library.md +34 -0
  85. package/dist/package/workflows/performance-work.md +41 -0
  86. package/dist/package/workflows/ui-change.md +40 -0
  87. package/package.json +33 -4
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: journal
3
+ description: Write the journal entry for a delivered lot. Use when every ticket of a lot is checked and the review came back green, or when the user asks to close a lot.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Journal
8
+
9
+ Record one delivered lot in one entry, after the reviewer has spoken and the tree is clean. The entry
10
+ puts what was asked beside what was done, lists the files the lot moved, and gives the reason behind
11
+ every gap. It is a record of the lot as it happened, so it is written once and read later without
12
+ trusting memory.
13
+
14
+ An entry is not a summary: a summary says the lot is done, an entry says what doing it changed. The
15
+ template and three worked shapes are in `references/entry.md`; this file holds the rules they obey.
16
+
17
+ ## Non-negotiables
18
+
19
+ - **One entry per lot, written once.** An entry is a record, not a draft: it is never rewritten. A
20
+ correction is a new entry that names the one it corrects and the fact it fixes.
21
+ - **After the verdict, on a clean tree.** The review verdict is green and quoted, and
22
+ `git status --short` is empty before the first line is written. Uncommitted code belongs to
23
+ `code-review`, and journal is not a way past it.
24
+ - **The main session writes it.** A subagent's brief carries one ticket, not the lot, so its entry
25
+ would be a fraction presented as the whole. Working as a subagent: write nothing, and report that
26
+ the entry is owed.
27
+ - **The gap is the information.** *Asked* is quoted from the ticket, *done* is read from the diff. A
28
+ done cell that restates the ask is a copy, and the gap is the one thing the next reader cannot
29
+ reconstruct.
30
+ - **Three sections, in this order.** The lot's tickets, the files touched, the decisions and their
31
+ reasons. Anything else — a mood, a plan, a wish — belongs in `retro`.
32
+ - **Every source was opened.** The header's `sources` lists the tickets and files this entry was
33
+ written from, and `type: journal` marks which of the eight kinds it is (the eight live in the
34
+ `documentation` skill, `references/corpus.md`).
35
+
36
+ ## 1. Read the lot
37
+
38
+ The tickets under `.scratch/<feature>/issues/` carry *asked*, criterion by criterion. The history
39
+ between the lot's first commit and the review carries *done*. The reviewer's verdict is the third
40
+ input, and it is a text, not a memory: quote it.
41
+
42
+ ## 2. Check the three conditions
43
+
44
+ - the review verdict is green, and its own sentence is quoted;
45
+ - `git status --short` is empty;
46
+ - `ls documentation/changelog/` shows no entry for this lot.
47
+
48
+ One failing condition ends the step: name it and hand off to the step that owns it — `code-review`
49
+ for an uncommitted or unreviewed tree, `implement` for a ticket that is still open.
50
+
51
+ ## 3. Fill the three sections
52
+
53
+ Use `references/entry.md`: the first table pairs each ticket's demand with what the diff actually
54
+ did, the second names each file or directory and what changed there, the third records every decision
55
+ with its reason and where the reason is written — a ticket, an ADR, a `Non vérifié` section.
56
+
57
+ A lot with no gap is normal and the third table stays short. A lot with a gap is the interesting one:
58
+ the ticket said one thing, the work found another, and the entry keeps both.
59
+
60
+ ## 4. Place and name the entry
61
+
62
+ `documentation/changelog/`, one file per lot. Take the naming already in use there — `ls
63
+ documentation/changelog/` is the source, not this page — and write the header the template shows,
64
+ with `verifie_le` set to today.
65
+
66
+ ## 5. Report
67
+
68
+ Name the entry, the tickets it covers, and every row that carries a gap. Writing an entry leaves one
69
+ uncommitted file; that is the state a closed lot is read in, so name it and stop. The commit is the
70
+ user's.
71
+
72
+ ## Done when
73
+
74
+ - The entry exists under `documentation/changelog/`, carries `type: journal` and today's
75
+ `verifie_le`, and its name follows the entries already there.
76
+ - Its three sections are present in order, and the first table has one row per ticket of the lot.
77
+ - Every row that carries a gap has its reason in the third table.
78
+ - `gates.py docs --project .` ran on the written entry and exits `0` for it — headers, `sources` paths, relative links, no back-reference, no code block over 15 lines. A red it reports elsewhere in the corpus is named in the report as somebody else's, never claimed as cleared by this entry.
79
+ - Each path in `sources` was opened during this session and exists on disk.
80
+ - No earlier entry changed: `git status --short documentation/changelog/` names the new file only.
81
+ - The tree's only uncommitted change is that entry, and the report says so in one line.
@@ -0,0 +1,172 @@
1
+ # The entry
2
+
3
+ The template an entry follows, and three lots written into it. The rules above the template live in
4
+ `../SKILL.md`; this file is the form.
5
+
6
+ ## Template
7
+
8
+ ```markdown
9
+ ---
10
+ titre: Lot <name> — <YYYY-MM-DD>
11
+ type: journal
12
+ public: agent
13
+ verifie_le: <YYYY-MM-DD, the day the entry is written>
14
+ sources:
15
+ - .scratch/<feature>/issues/<NN>-<slug>.md
16
+ - <each file the entry's third table cites>
17
+ ---
18
+
19
+ # Lot <name>
20
+
21
+ <One sentence: what the lot delivered, and the review verdict it closed on.>
22
+
23
+ ## Les tickets du lot
24
+
25
+ | Ticket | Ce qui était demandé | Ce qui a été fait |
26
+ |---|---|---|
27
+ | <NN>-<slug> | <the demand, quoted from the ticket> | <what the diff did, in the same terms> |
28
+
29
+ ## Les fichiers touchés
30
+
31
+ | Fichier ou dossier | Ce qui a changé |
32
+ |---|---|
33
+ | <path> | <the change, one line; a rename says both names> |
34
+
35
+ ## Les décisions et leurs raisons
36
+
37
+ | Décision | Raison | Où elle est écrite |
38
+ |---|---|---|
39
+ | <what was decided> | <why, in one clause> | <ticket, ADR, `Non vérifié` section, or `none`> |
40
+ ```
41
+
42
+ The template's three headings are the reference project's, which writes in French: `Les tickets du
43
+ lot`, `Les fichiers touchés`, `Les décisions et leurs raisons` — in English, *The lot's tickets*,
44
+ *The files touched*, *The decisions and their reasons*. `D-35` decides the language of the project you
45
+ write for, so translate the headings there and keep this order. `type: journal` is one of the eight
46
+ values the `documentation` skill defines, and an entry is a document like any other: the header is
47
+ checked, the links resolve, the body has no block over 15 lines.
48
+
49
+ ## Three shapes
50
+
51
+ ### A clean lot
52
+
53
+ ```markdown
54
+ ---
55
+ titre: Lot claim — 2026-11-14
56
+ type: journal
57
+ public: agent
58
+ verifie_le: 2026-11-14
59
+ sources:
60
+ - .scratch/claim/issues/02-claim.md
61
+ - src/store/claim.rs
62
+ ---
63
+
64
+ # Lot claim
65
+
66
+ The claim ticket shipped idempotent, and the review closed green on the first pass.
67
+
68
+ ## Les tickets du lot
69
+
70
+ | Ticket | Ce qui était demandé | Ce qui a été fait |
71
+ |---|---|---|
72
+ | 02-claim | claim returns the existing id when called twice with the same key | `claim()` reads before it writes; the same key returns the stored id |
73
+
74
+ ## Les fichiers touchés
75
+
76
+ | Fichier ou dossier | Ce qui a changé |
77
+ |---|---|
78
+ | src/store/claim.rs | `claim()` added, with the read-before-write branch |
79
+
80
+ ## Les décisions et leurs raisons
81
+
82
+ | Décision | Raison | Où elle est écrite |
83
+ |---|---|---|
84
+ | no index on `key` yet | the table holds one row per test run; an index would be measured first | 02-claim, `Non vérifié` |
85
+ ```
86
+
87
+ ### A lot with a gap between asked and done
88
+
89
+ The interesting shape: the ticket asked for one thing, the work found another, and the third table
90
+ carries the reason for the gap.
91
+
92
+ ```markdown
93
+ ---
94
+ titre: Lot claim — 2026-11-16
95
+ type: journal
96
+ public: agent
97
+ verifie_le: 2026-11-16
98
+ sources:
99
+ - .scratch/claim/issues/03-expiry.md
100
+ - src/store/claim.rs
101
+ - docs/adr/0002-expiry-owns-the-clock.md
102
+ ---
103
+
104
+ # Lot claim
105
+
106
+ The expiry ticket shipped with the clock injected, which the ticket did not ask for; the review closed
107
+ green after the change was written down.
108
+
109
+ ## Les tickets du lot
110
+
111
+ | Ticket | Ce qui était demandé | Ce qui a été fait |
112
+ |---|---|---|
113
+ | 03-expiry | a claim older than 24 h is not returned | the age is computed from an injected clock; `claim()` takes the clock as an argument |
114
+
115
+ ## Les fichiers touchés
116
+
117
+ | Fichier ou dossier | Ce qui a changé |
118
+ |---|---|
119
+ | src/store/claim.rs | `claim()` takes a `Clock`; the 24 h comparison moved into it |
120
+ | docs/adr/0002-expiry-owns-the-clock.md | added: why the clock is a parameter |
121
+
122
+ ## Les décisions et leurs raisons
123
+
124
+ | Décision | Raison | Où elle est écrite |
125
+ |---|---|---|
126
+ | the clock is injected, not read inside | the expiry test would sleep for 24 h otherwise, so the ticket as written could not have a fast test | ADR 0002 |
127
+ | the 24 h constant stays in `claim.rs` | one call site in the project; moving it to a settings type would be scaffolding | `none` |
128
+ ```
129
+
130
+ ### A cancelled lot
131
+
132
+ A lot that stopped still owes an entry: what it was asked for, and why it did not land.
133
+
134
+ ```markdown
135
+ ---
136
+ titre: Lot claim — 2026-11-19
137
+ type: journal
138
+ public: agent
139
+ verifie_le: 2026-11-19
140
+ sources:
141
+ - .scratch/claim/issues/04-batch.md
142
+ ---
143
+
144
+ # Lot claim
145
+
146
+ The batch ticket was cancelled at the grilling, before any code was written; the review never ran.
147
+
148
+ ## Les tickets du lot
149
+
150
+ | Ticket | Ce qui était demandé | Ce qui a été fait |
151
+ |---|---|---|
152
+ | 04-batch | claim accepts a batch and returns a vector | nothing: cancelled, the ticket is closed without a criterion checked |
153
+
154
+ ## Les fichiers touchés
155
+
156
+ | Fichier ou dossier | Ce qui a changé |
157
+ |---|---|
158
+ | — | no file was touched |
159
+
160
+ ## Les décisions et leurs raisons
161
+
162
+ | Décision | Raison | Où elle est écrite |
163
+ |---|---|---|
164
+ | cancel rather than defer | the batch shape changes `claim()`'s signature, and the single-key API has one caller today | 04-batch, closing comment |
165
+ | no spec edit | the spec never mentioned batches, so nothing in it is now wrong | `none` |
166
+ ```
167
+
168
+ ## Non vérifié
169
+
170
+ - The 24 h figure and the batch signature above are illustrations, not facts of any project.
171
+ - No entry is measured for how often its third table stays empty; the two shapes that carry content
172
+ were taken from the reference project read in `EVIDENCE.md` E-27, which keeps 135 entries.
@@ -0,0 +1,168 @@
1
+ ---
2
+ name: lathe
3
+ disable-model-invocation: true
4
+ description: One entry point for a Rust project — say what you want and it names the next step, installs Lathe here, or explains what Lathe enforces. Use when the user says "lathe", asks where to start, what to do next, how to install this framework, or which rule governs the work.
5
+ ---
6
+
7
+ # Lathe
8
+
9
+ A lathe holds the work and guides the tool: one pass at a time, and it stops between passes. This
10
+ framework does the same to an agent run — one step at a time, a gate between steps, a written record
11
+ of what was measured.
12
+
13
+ **You are the only skill the user has to remember.** They say what they want; you read the project,
14
+ name the step that does it, and hand off in one line. You never do that step yourself.
15
+
16
+ ## If Lathe is not installed here
17
+
18
+ No `.framework/installed.json` in the project root. Do not route, do not improvise a workflow — say,
19
+ in one sentence, that Lathe is not installed, then give this command:
20
+
21
+ ```bash
22
+ npx create-lathe
23
+ ```
24
+
25
+ Then stop. The installer checks the prerequisites, installs the two upstream sources, copies the
26
+ framework, and prints the verdict. Everything the agent needs is on the package page, so a user who
27
+ only pastes the link gets a correct install: `npm view create-lathe readme`.
28
+
29
+ ## Non-negotiables
30
+
31
+ - **Name, do not run.** One step per call, in text: no subagent, no tool that changes anything, and
32
+ never the step you just named. Reading `.agents/skills/<step>/SKILL.md` turns this skill into that
33
+ step's executor: you end up answering the design question, writing the spec, or drafting the ticket
34
+ yourself. Name the step, do not read it. If you have already opened one, say so in one clause and
35
+ emit the line anyway — the reading is the defect, the route is still owed.
36
+ - **This skill decides.** When invoked, the chain below is the only catalogue. A skill from
37
+ `~/.agents/skills` that is unrelated to this chain is out of scope, however well it seems to fit.
38
+ A step that is not installed is named and left alone, never simulated. Never scaffold, install or
39
+ build anything from a routing run.
40
+ - **Read before naming.** The state on disk decides, not how the user described the task.
41
+ - **Earlier wins.** Intent first, then the ladder, top to bottom. Stop at the first row that matches;
42
+ never weigh two rows against each other.
43
+ - **The local artifact is the source; a tracker is a projection.** A spec or ticket that exists only
44
+ in GitHub or Linear is not routable. Ask for the local mirror in `.scratch/<feature>/` first.
45
+
46
+ ## Read the state
47
+
48
+ ```bash
49
+ head -5 AGENTS.md 2>/dev/null # Profile: rust-library | rust-cli | rust-native-desktop
50
+ ls docs/GLOSSARY.md .scratch/*/spec.md .scratch/*/issues/*.md docs/shots 2>/dev/null
51
+ ls documentation/llm/*.md documentation/changelog/*.md 2>/dev/null
52
+ git status --short 2>/dev/null
53
+ ```
54
+
55
+ A corpus document carries `verifie_le` and `sources`; when a source's last commit is later than that
56
+ date, the corpus is stale. The comparison is two commands: `head -5` the document for its
57
+ `verifie_le`, and `git log -1 --format=%cs -- <source>` for the date of the file it names.
58
+
59
+ No `Profile:` line: detect it. `gpui-kit` in `Cargo.toml` is `rust-native-desktop`; a `bin` target
60
+ without a `lib` target is `rust-cli`; a `lib` target is `rust-library`. Two matches or none: ask, but
61
+ only when the ladder actually needs the profile — rungs 1 to 3 do not, and a project with no files
62
+ legitimately has no profile yet. Never guess — every gate from rung 4 onward depends on it.
63
+
64
+ A declared `Profile:` that contradicts the repository is a defect, not a preference: name the file and
65
+ the line, and stop. That stop is `no-step`, not the first ladder match — a state that contradicts
66
+ itself cannot be routed, and routing it anyway hides the defect behind a plausible step.
67
+
68
+ ## 1. Intent
69
+
70
+ Choose a row only when the user is *asking* for it. Silence is not intent.
71
+
72
+ | The user is asking for | You |
73
+ |---|---|
74
+ | what Lathe is, what it installs, or which rule governs the work at hand | answer here, from `references/invariants.md`, and stop |
75
+ | Lathe installed or brought up to date in this project | `bootstrap` (first install) or `update` |
76
+ | a design or UX decision ("sheet or window?", "how should this look?") | `gpui-kit-design-guides` (upstream) |
77
+ | whether prior art, a crate or a paper already solves this | `research` |
78
+ | a failure with no reproduction | `diagnosing-bugs` |
79
+ | the code made faster, or where the time goes | `optimize` |
80
+ | a choice that needs evidence before coding | `prototype` |
81
+ | a screen to rebuild from captures of another app | `replicate-ui` |
82
+ | a lesson to capture after a release or a bad week | `retro` |
83
+ | a small bounded change to existing code | `implement` |
84
+ | the delivered lot written down, with the review green and the tree clean | `journal` |
85
+ | the agent corpus created or refreshed, with every ticket closed | `documentation` |
86
+
87
+ `update` and `bootstrap` are operational steps, not project rungs: an explicit ask reaches them and
88
+ the ladder below never does. `journal` and `documentation` are asked for at the end of a lot, which is
89
+ also where their rungs sit.
90
+
91
+ ## 2. The ladder
92
+
93
+ First match wins. Read top to bottom, stop.
94
+
95
+ | # | Condition on disk | Step |
96
+ |---|---|---|
97
+ | 1 | no `docs/GLOSSARY.md` and no `.scratch/*/spec.md` | `grill-with-docs` |
98
+ | 2 | no `.scratch/<feature>/spec.md` | `to-spec` |
99
+ | 3 | no `.scratch/<feature>/issues/*.md` | `to-tickets` |
100
+ | 4 | no `Cargo.toml`, or no `src/` | `scaffold` |
101
+ | 5 | two or more ready tickets (no `Blocked by`) and the profile is desktop | `visual-loop` |
102
+ | 6 | a ticket with an unchecked criterion `- [ ]` | `implement` |
103
+ | 7 | desktop, a ticket fully checked `- [x]`, no `docs/shots/<ticket>-light.png` | `verify-visual` |
104
+ | 8 | every ticket checked, `.lathe/mutants/verdict` does not name the current `HEAD` | `mutants` |
105
+ | 9 | every ticket checked, the campaign certified `HEAD`, working tree dirty with anything but the journal entry for this lot | `code-review` |
106
+ | 10 | every ticket checked, `documentation/llm/` holds a document older than a source it names | `documentation` |
107
+ | 11 | every ticket checked, the project keeps a journal, no entry for this lot | `journal` |
108
+ | 12 | every ticket checked, working tree clean or holding only this lot's journal entry | `retro` |
109
+
110
+ The corpus and the journal are rungs only in a project that keeps them: `documentation/llm/` for the
111
+ one, `documentation/changelog/` for the other. A project with neither reaches rung 11, and starting a
112
+ corpus is an explicit ask, not a rung.
113
+
114
+ A tree holding only this lot's journal entry is the state `journal` leaves behind, and it routes: the
115
+ entry is written and uncommitted, rung 9 does not match, and `retro` is the step that remains.
116
+
117
+ Rung 8 exists because a review of a batch is a review of what the tests can prove, and mutation
118
+ testing is the only step that asks whether they could fail at all. Its verdict is a file, not a
119
+ recollection: `gates.py mutants` writes which commit range it certified, so the ladder reads the
120
+ state instead of trusting that someone ran it.
121
+
122
+ Desktop-only steps are rungs 5 and 7. In `rust-library` and `rust-cli`, `verify-visual`, `probe`,
123
+ `replicate-ui` and `visual-loop` do not exist. When the user asks for one anyway, say so in one
124
+ sentence, then route by the ladder as if the request had not been made — never invent a screen, never
125
+ stop at the refusal.
126
+
127
+ ## Parcours
128
+
129
+ `.agents/workflows/` ships eight full paths. A parcours is not a step: it names steps in order.
130
+ Read one only when the user names a project shape or a whole job, never in place of a step.
131
+
132
+ | The user says | Parcours |
133
+ |---|---|
134
+ | "start a new Rust library" | `.agents/workflows/new-rust-library.md` |
135
+ | "start a new Rust CLI" | `.agents/workflows/new-rust-cli.md` |
136
+ | "start a new desktop app" | `.agents/workflows/new-rust-desktop-app.md` |
137
+ | "this bug is hard", no reproduction | `.agents/workflows/hard-bug.md` |
138
+ | "it is too slow" | `.agents/workflows/performance-work.md` |
139
+ | "change this screen" | `.agents/workflows/ui-change.md` |
140
+ | "improve the framework itself" | `.agents/workflows/framework-improvement.md` |
141
+ | "finish the batch", "review the batch" | `.agents/workflows/batch-to-review.md` |
142
+
143
+ When a parcours applies, name it in the first sentence and route its **first** unsatisfied step.
144
+ The parcours tells you the order; the ladder tells you where you are. They must agree — if they do
145
+ not, the state wins and you say so.
146
+
147
+ ## Hand off
148
+
149
+ You cannot invoke another skill: `/skill:<name>` is a user command, not something a model runs. So
150
+ hand off in text, in this exact shape:
151
+
152
+ 1. one sentence: the state you read and the step you chose;
153
+ 2. one line, alone: `/skill:<step>`;
154
+ 3. one sentence: the artifact that step must produce.
155
+
156
+ Nothing after that line. Naming the step in prose does not count: the line is the route. A run that
157
+ ends without it has not routed.
158
+
159
+ **When the route depends on the user.** If two rows could match and only the user can tell which —
160
+ `implement` versus `visual-loop` on a desktop project, `optimize` versus `implement` on a slow path —
161
+ ask inside sentence 1 and route the default you would take. Never spend a turn asking alone: the
162
+ question and the route go out together, so a user who says nothing still has a step to run.
163
+
164
+ ## Done when
165
+
166
+ The reply carries the three parts of the hand-off, and the step it names is the first match of intent,
167
+ then ladder. A question about Lathe itself is answered from `references/invariants.md` and is not a
168
+ route.
@@ -0,0 +1,196 @@
1
+ # Routing evals
2
+
3
+ Each case declares the project state on disk, a prompt, the step Lathe must name first, and the steps that would be wrong. A run passes when the first skill opened is `expect`, and fails outright on any `disqualify`.
4
+
5
+ State uses Matt Pocock's conventions, because D-04 adopted them: the spec is `.scratch/<feature>/spec.md`, the tickets are `.scratch/<feature>/issues/<NN>-<slug>.md`, and `docs/GLOSSARY.md` marks a finished grilling. A tracker is a projection of those files, never the thing Lathe reads.
6
+
7
+ Format is strict; `scripts/eval_routing.py` parses it.
8
+
9
+ - `state:` — `path=line1;line2 | dir/` — files and empty directories created before the prompt.
10
+ - `git:` — `dirty` leaves an uncommitted change on top of the initial commit.
11
+ - `expect:` — a skill name, or `no-step` when Lathe must refuse or ask instead of routing.
12
+ - `disqualify:` — comma-separated skill names that make the case fail even if `expect` is also named.
13
+
14
+ Every case runs in a fresh temp directory with the installed skills linked in, on a fresh context, with Lathe invoked explicitly.
15
+
16
+ ## Cases
17
+
18
+ ### 01. Idea, nothing on disk [DEFERRED: a global skill wins the request even with Lathe invoked — see EVIDENCE H-06]
19
+
20
+ - state: no files
21
+ - prompt: "I want an app that keeps my clipboard history."
22
+ - expect: grill-with-docs
23
+ - disqualify: to-spec, scaffold
24
+
25
+ ### 02. Grilling done, no spec
26
+
27
+ - state: AGENTS.md=Profile: rust-library | docs/GLOSSARY.md=# Clipboard keeper | src/lib.rs=pub fn keep() {}
28
+ - prompt: "Write the spec for this."
29
+ - expect: to-spec
30
+ - disqualify: scaffold, to-tickets, grill-with-docs
31
+
32
+ ### 03. Spec exists, no tickets
33
+
34
+ - state: AGENTS.md=Profile: rust-library | docs/GLOSSARY.md=# Keeper;manifest: one clipboard row | .scratch/keeper/spec.md=# Spec;;The keeper stores clipboard entries (text, created_at, pinned) in a local SQLite file and survives restart.;;Acceptance: an entry added before restart is listed after restart. | src/lib.rs=pub fn keep() {}
35
+ - prompt: "Break this into tickets."
36
+ - expect: to-tickets
37
+ - disqualify: implement, scaffold, to-spec
38
+
39
+ ### 04. Tickets exist, no code
40
+
41
+ - state: AGENTS.md=Profile: rust-native-desktop | docs/GLOSSARY.md=# Keeper | .scratch/keeper/spec.md=# Spec | .scratch/keeper/issues/01-store.md=Blocked by: none;;- [ ] store survives restart
42
+ - prompt: "Start building."
43
+ - expect: scaffold
44
+ - disqualify: implement, verify-visual, to-spec
45
+
46
+ ### 05. One open ticket, code exists
47
+
48
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {} | .scratch/claim/spec.md=# Spec | .scratch/claim/issues/02-claim.md=Blocked by: none;;- [ ] claim is idempotent
49
+ - prompt: "Implement the claim ticket."
50
+ - expect: implement
51
+ - disqualify: scaffold, to-tickets, visual-loop
52
+
53
+ ### 06. Desktop ticket checked, no visual proof
54
+
55
+ - state: AGENTS.md=Profile: rust-native-desktop | Cargo.toml=[package];name="keeper";[dependencies];gpui-kit="0.11" | src/main.rs=fn main() {} | .scratch/keeper/spec.md=# Spec | .scratch/keeper/issues/03-settings.md=Blocked by: none;;- [x] settings screen opens
56
+ - prompt: "The settings screen is done, what now?"
57
+ - expect: verify-visual
58
+ - disqualify: code-review, implement, to-spec
59
+
60
+ ### 07. Library ticket checked, no gate run [DEFERRED: needs a profile to name a gate command]
61
+
62
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {} | .scratch/claim/spec.md=# Spec | .scratch/claim/issues/02-claim.md=- [x] claim is idempotent
63
+ - prompt: "I finished the ticket, anything left?"
64
+ - expect: no-step
65
+ - disqualify: verify-visual
66
+
67
+ ### 08. Everything checked, tree dirty
68
+
69
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="keeper" | src/lib.rs=pub fn keep() {} | .scratch/keeper/spec.md=# Spec;;keep stores one row. | .scratch/keeper/issues/03-store.md=Blocked by: none;;- [x] keep stores a row
70
+ - git: dirty
71
+ - prompt: "I think it's done, merge it."
72
+ - expect: code-review
73
+ - disqualify: implement, verify-visual, scaffold
74
+
75
+ ### 09. A UI decision to make
76
+
77
+ - state: AGENTS.md=Profile: rust-native-desktop | Cargo.toml=[package];name="keeper";[dependencies];gpui-kit="0.11" | src/main.rs=fn main() {} | docs/GLOSSARY.md=# Keeper | .scratch/keeper/spec.md=# Spec
78
+ - prompt: "Should the settings live in a sheet or a separate window?"
79
+ - expect: gpui-kit-design-guides
80
+ - disqualify: to-spec, scaffold, grill-with-docs
81
+
82
+ ### 10. Failure with no reproduction
83
+
84
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {}
85
+ - prompt: "Sometimes claim() panics on CI. I can't reproduce it."
86
+ - expect: diagnosing-bugs
87
+ - disqualify: implement, tdd
88
+
89
+ ### 11. Lesson to capture
90
+
91
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {} | CHANGELOG.md=## 0.2.0
92
+ - prompt: "That release hurt. Let's do a retro."
93
+ - expect: retro
94
+ - disqualify: to-spec, improve-architecture
95
+
96
+ ### 12. No profile line, one detectable profile
97
+
98
+ - state: Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {}
99
+ - prompt: "Where do I start?"
100
+ - expect: grill-with-docs
101
+ - disqualify: verify-visual, replicate-ui, scaffold
102
+
103
+ ### 13. Declared profile contradicts the repository
104
+
105
+ - state: AGENTS.md=Profile: rust-cli | Cargo.toml=[lib];name="keeper";[dependencies];gpui-kit="0.11" | src/lib.rs=pub fn keep() {}
106
+ - prompt: "Keep going."
107
+ - expect: no-step
108
+ - disqualify: implement, verify-visual
109
+
110
+ ### 14. Desktop step requested inside a library profile
111
+
112
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {} | docs/GLOSSARY.md=# Claim;claim: one idempotent write | .scratch/claim/spec.md=# Spec;;claim returns the existing id when called twice with the same key. | .scratch/claim/issues/02-claim.md=Blocked by: none;;- [ ] claim is idempotent
113
+ - prompt: "Take a screenshot of the app and check the layout."
114
+ - expect: implement
115
+ - disqualify: verify-visual, replicate-ui, probe, visual-loop
116
+
117
+ ### 15. Plenty of independent tickets
118
+
119
+ - state: AGENTS.md=Profile: rust-native-desktop | Cargo.toml=[package];name="keeper";[dependencies];gpui-kit="0.11" | src/main.rs=fn main() {} | .scratch/keeper/spec.md=# Spec | .scratch/keeper/issues/04-a.md=Blocked by: none;;- [ ] a | .scratch/keeper/issues/05-b.md=Blocked by: none;;- [ ] b | .scratch/keeper/issues/06-c.md=Blocked by: none;;- [ ] c
120
+ - prompt: "Three independent tickets are ready, go."
121
+ - expect: visual-loop
122
+ - disqualify: scaffold, to-tickets
123
+
124
+ ### 16. A screen to rebuild from captures
125
+
126
+ - state: AGENTS.md=Profile: rust-native-desktop | Cargo.toml=[package];name="keeper";[dependencies];gpui-kit="0.11" | src/main.rs=fn main() {} | docs/refs/thing-light.png=b64:iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAEUlEQVR42mP49u0HVsQwtCQASIC5Ab4FqdIAAAAASUVORK5CYII=
127
+ - prompt: "Rebuild this screen from the screenshots of the app I like."
128
+ - expect: replicate-ui
129
+ - disqualify: scaffold, implement
130
+
131
+ ### 17. Prior art unknown
132
+
133
+ - state: AGENTS.md=Profile: rust-library | docs/GLOSSARY.md=# Fast approximate index | .scratch/index/spec.md=# Spec
134
+ - prompt: "I don't know if anyone solved the index problem already."
135
+ - expect: research
136
+ - disqualify: to-spec, prototype
137
+
138
+ ### 18. Small bounded change inside an established flow
139
+
140
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {} | .scratch/claim/spec.md=# Spec | .scratch/claim/issues/02-claim.md=- [ ] claim is idempotent
141
+ - prompt: "Fix the typo in the error message on line 12."
142
+ - expect: implement
143
+ - disqualify: grill-with-docs, to-spec, research
144
+
145
+ ### 19. Everything checked, tree clean
146
+
147
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {} | .scratch/claim/spec.md=# Spec | .scratch/claim/issues/02-claim.md=- [x] claim is idempotent
148
+ - prompt: "All tickets are closed. What is left?"
149
+ - expect: retro
150
+ - disqualify: implement, code-review
151
+
152
+ ### 20. Question about the framework itself
153
+
154
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {}
155
+ - prompt: "What does this framework actually install, and which rule stops an untested guess from becoming a hard constraint?"
156
+ - expect: lathe
157
+ - disqualify: grill-with-docs, to-spec, scaffold
158
+
159
+ ### 21. Lot closed on a clean tree, journal kept, no entry for this lot
160
+
161
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {} | .scratch/claim/spec.md=# Spec | .scratch/claim/issues/02-claim.md=Blocked by: none;;- [x] claim is idempotent | documentation/changelog/2026-11-01-store.md=---;titre: Lot store;type: journal;public: agent;verifie_le: 2026-11-01;sources:; - .scratch/store/issues/01-store.md;---;;## Les tickets du lot;;- 01-store: the row survives restart
162
+ - prompt: "All tickets are closed and the review came back green. What is left?"
163
+ - expect: journal
164
+ - disqualify: retro, documentation, code-review
165
+
166
+ ### 22. Code moved, the corpus is a version behind
167
+
168
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {} | .scratch/claim/spec.md=# Spec | .scratch/claim/issues/02-claim.md=Blocked by: none;;- [x] claim is idempotent | documentation/llm/README.md=---;titre: Index;type: index;public: agent;verifie_le: 2025-01-01;sources:; - src/lib.rs;---;;# Index;;- [claim](../llm/claim.md) — the claim store · load when the claim API changes | documentation/llm/claim.md=---;titre: claim;type: reference;public: agent;verifie_le: 2025-01-01;sources:; - src/lib.rs;---;;claim writes one row and returns its id.
169
+ - prompt: "Everything is merged. Anything to do before I close the lot?"
170
+ - expect: documentation
171
+ - disqualify: journal, retro, code-review
172
+
173
+ ### 23. Journal asked while the tree is still dirty
174
+
175
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {} | .scratch/claim/spec.md=# Spec | .scratch/claim/issues/02-claim.md=Blocked by: none;;- [x] claim is idempotent | documentation/changelog/2026-11-01-store.md=---;titre: Lot store;type: journal;public: agent;verifie_le: 2026-11-01;sources:; - .scratch/store/issues/01-store.md;---;;## Les tickets du lot;;- 01-store: the row survives restart
176
+ - git: dirty
177
+ - prompt: "Write the journal entry for this lot."
178
+ - expect: code-review
179
+ - disqualify: journal, documentation, retro
180
+
181
+ ### 24. Corpus stale, but a ticket is still open
182
+
183
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {} | .scratch/claim/spec.md=# Spec | .scratch/claim/issues/02-claim.md=Blocked by: none;;- [ ] claim is idempotent | documentation/llm/README.md=---;titre: Index;type: index;public: agent;verifie_le: 2025-01-01;sources:; - src/lib.rs;---;;# Index;;- [claim](../llm/claim.md) — the claim store · load when the claim API changes | documentation/llm/claim.md=---;titre: claim;type: reference;public: agent;verifie_le: 2025-01-01;sources:; - src/lib.rs;---;;claim writes one row and returns its id.
184
+ - prompt: "The docs are out of date, fix them before I merge."
185
+ - expect: implement
186
+ - disqualify: documentation, journal, code-review
187
+
188
+ ### 25. Lot closed, the tree holds only this lot's journal entry
189
+
190
+ - state: AGENTS.md=Profile: rust-library | Cargo.toml=[lib];name="claim" | src/lib.rs=pub fn claim() {} | .scratch/claim/spec.md=# Spec | .scratch/claim/issues/02-claim.md=Blocked by: none;;- [x] claim is idempotent | documentation/changelog/2026-11-01-store.md=---;titre: Lot store;type: journal;public: agent;verifie_le: 2026-11-01;sources:; - .scratch/store/issues/01-store.md;---;;## Les tickets du lot;;- 01-store: the row survives restart | documentation/changelog/2026-11-12-claim.md=---;titre: Lot claim;type: journal;public: agent;verifie_le: 2026-11-12;sources:; - .scratch/claim/issues/02-claim.md;---;;## Les tickets du lot;;- 02-claim: claim is idempotent
191
+ - prompt: "The entry is written and nothing else changed. What is next?"
192
+ - expect: retro
193
+ - disqualify: code-review, journal
194
+
195
+ The harness commits every declared file, so the entry arrives committed; a tree whose only uncommitted
196
+ change is that same entry reads the same way — rung 8 does not match, rung 11 does.