create-lathe 0.0.0-stage → 0.4.1

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 (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +168 -2
  3. package/bin/create-lathe.js +88 -0
  4. package/dist/framework.lock +115 -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 +375 -0
  14. package/dist/package/crates/instrument/src/server.rs +363 -0
  15. package/dist/package/crates/instrument/tests/command_log.rs +60 -0
  16. package/dist/package/crates/instrument/tests/erreurs.rs +167 -0
  17. package/dist/package/crates/instrument/tests/round_trip.rs +230 -0
  18. package/dist/package/crates/instrument/tests/selftest_fail.rs +25 -0
  19. package/dist/package/crates/instrument/tests/selftest_pass.rs +24 -0
  20. package/dist/package/crates/instrument/tests/selftest_temps.rs +43 -0
  21. package/dist/package/crates/instrument/tests/support/mod.rs +58 -0
  22. package/dist/package/pi/context/journal-de-lot.md +24 -0
  23. package/dist/package/pi/context/tech-skill.md +19 -0
  24. package/dist/package/pi/context/ticket-closed.md +18 -0
  25. package/dist/package/scripts/framework.py +1384 -0
  26. package/dist/package/scripts/gates.py +1158 -0
  27. package/dist/package/scripts/setup.py +251 -0
  28. package/dist/package/skills/bootstrap/SKILL.md +110 -0
  29. package/dist/package/skills/documentation/SKILL.md +110 -0
  30. package/dist/package/skills/documentation/references/agents-md.md +70 -0
  31. package/dist/package/skills/documentation/references/corpus.md +112 -0
  32. package/dist/package/skills/journal/SKILL.md +81 -0
  33. package/dist/package/skills/journal/references/entry.md +172 -0
  34. package/dist/package/skills/lathe/SKILL.md +185 -0
  35. package/dist/package/skills/lathe/evals/routing.md +231 -0
  36. package/dist/package/skills/lathe/references/install.md +161 -0
  37. package/dist/package/skills/lathe/references/invariants.md +31 -0
  38. package/dist/package/skills/mutants/SKILL.md +88 -0
  39. package/dist/package/skills/mutants/references/cargo-mutants.md +176 -0
  40. package/dist/package/skills/mutants/references/triage.md +88 -0
  41. package/dist/package/skills/optimize/SKILL.md +87 -0
  42. package/dist/package/skills/optimize/references/codspeed.md +126 -0
  43. package/dist/package/skills/probe/SKILL.md +82 -0
  44. package/dist/package/skills/probe/references/wait-and-read.md +53 -0
  45. package/dist/package/skills/replicate-ui/SKILL.md +64 -0
  46. package/dist/package/skills/rust/SKILL.md +147 -0
  47. package/dist/package/skills/rust/references/errors.md +63 -0
  48. package/dist/package/skills/rust/references/unsafe.md +65 -0
  49. package/dist/package/skills/scaffold/SKILL.md +78 -0
  50. package/dist/package/skills/scaffold/profiles/rust-cli/.cargo/config.toml +2 -0
  51. package/dist/package/skills/scaffold/profiles/rust-cli/AGENTS.md +22 -0
  52. package/dist/package/skills/scaffold/profiles/rust-cli/Cargo.lock +7 -0
  53. package/dist/package/skills/scaffold/profiles/rust-cli/Cargo.toml +17 -0
  54. package/dist/package/skills/scaffold/profiles/rust-cli/README.md +15 -0
  55. package/dist/package/skills/scaffold/profiles/rust-cli/deny.toml +14 -0
  56. package/dist/package/skills/scaffold/profiles/rust-cli/rustfmt.toml +2 -0
  57. package/dist/package/skills/scaffold/profiles/rust-cli/src/main.rs +38 -0
  58. package/dist/package/skills/scaffold/profiles/rust-cli/tests/cli.rs +27 -0
  59. package/dist/package/skills/scaffold/profiles/rust-library/.cargo/config.toml +2 -0
  60. package/dist/package/skills/scaffold/profiles/rust-library/AGENTS.md +21 -0
  61. package/dist/package/skills/scaffold/profiles/rust-library/Cargo.lock +7 -0
  62. package/dist/package/skills/scaffold/profiles/rust-library/Cargo.toml +18 -0
  63. package/dist/package/skills/scaffold/profiles/rust-library/README.md +15 -0
  64. package/dist/package/skills/scaffold/profiles/rust-library/deny.toml +14 -0
  65. package/dist/package/skills/scaffold/profiles/rust-library/rustfmt.toml +2 -0
  66. package/dist/package/skills/scaffold/profiles/rust-library/src/lib.rs +25 -0
  67. package/dist/package/skills/scaffold/profiles/rust-native-desktop/.cargo/config.toml +2 -0
  68. package/dist/package/skills/scaffold/profiles/rust-native-desktop/AGENTS.md +23 -0
  69. package/dist/package/skills/scaffold/profiles/rust-native-desktop/Cargo.lock +9252 -0
  70. package/dist/package/skills/scaffold/profiles/rust-native-desktop/Cargo.toml +24 -0
  71. package/dist/package/skills/scaffold/profiles/rust-native-desktop/README.md +15 -0
  72. package/dist/package/skills/scaffold/profiles/rust-native-desktop/deny.toml +35 -0
  73. package/dist/package/skills/scaffold/profiles/rust-native-desktop/rustfmt.toml +2 -0
  74. package/dist/package/skills/scaffold/profiles/rust-native-desktop/src/main.rs +74 -0
  75. package/dist/package/skills/scaffold/references/gates.md +29 -0
  76. package/dist/package/skills/scaffold/references/profiles.md +36 -0
  77. package/dist/package/skills/update/SKILL.md +115 -0
  78. package/dist/package/skills/verify-visual/SKILL.md +82 -0
  79. package/dist/package/skills/verify-visual/references/baseline.md +46 -0
  80. package/dist/package/skills/visual-loop/SKILL.md +72 -0
  81. package/dist/package/workflows/batch-to-review.md +41 -0
  82. package/dist/package/workflows/framework-improvement.md +38 -0
  83. package/dist/package/workflows/hard-bug.md +37 -0
  84. package/dist/package/workflows/new-rust-cli.md +33 -0
  85. package/dist/package/workflows/new-rust-desktop-app.md +41 -0
  86. package/dist/package/workflows/new-rust-library.md +34 -0
  87. package/dist/package/workflows/performance-work.md +41 -0
  88. package/dist/package/workflows/ui-change.md +40 -0
  89. package/package.json +33 -4
@@ -0,0 +1,230 @@
1
+ mod support;
2
+
3
+ use std::{
4
+ fs,
5
+ path::PathBuf,
6
+ thread,
7
+ time::{Duration, Instant},
8
+ };
9
+
10
+ use instrument::{
11
+ Client, ClientError, Instrument, Server, ServerError,
12
+ server::{MAX_SOCKET_PATH_BYTES, PathError, validate_socket_path},
13
+ };
14
+ use serde_json::{Value, json};
15
+ use support::TempDir;
16
+
17
+ #[test]
18
+ fn aller_retour_de_commande_sur_le_socket() {
19
+ let temp = TempDir::new("in-round").expect("répertoire temporaire");
20
+ let socket = temp.socket();
21
+
22
+ let mut instrument = Instrument::new();
23
+ instrument
24
+ .command("echo", |params| Ok(json!({ "echo": params })))
25
+ .expect("enregistrement de echo");
26
+ instrument
27
+ .command("boom", |_| Err("échec volontaire".to_owned()))
28
+ .expect("enregistrement de boom");
29
+
30
+ let mut server = Server::start(instrument, &socket).expect("démarrage du serveur");
31
+ assert_eq!(server.path(), socket.as_path());
32
+
33
+ let mut client = Client::connect(&socket, Duration::from_secs(1)).expect("connexion");
34
+
35
+ let listed = client
36
+ .call("list", Value::Null)
37
+ .expect("liste des commandes");
38
+ let names = listed["commands"]
39
+ .as_array()
40
+ .expect("tableau 'commands'")
41
+ .iter()
42
+ .filter_map(Value::as_str)
43
+ .collect::<Vec<_>>();
44
+ for expected in ["list", "state", "action", "wait", "echo", "boom"] {
45
+ assert!(names.contains(&expected), "commande absente: {expected}");
46
+ }
47
+
48
+ let initial = client.call("state", Value::Null).expect("état initial");
49
+ assert_eq!(initial["revision"], json!(0));
50
+ assert_eq!(initial["values"], json!({}));
51
+
52
+ let action = client
53
+ .call("action", json!({ "key": "compteur", "value": 3 }))
54
+ .expect("action");
55
+ assert_eq!(action["revision"], json!(1));
56
+
57
+ let after = client
58
+ .call("state", Value::Null)
59
+ .expect("état après action");
60
+ assert_eq!(after["revision"], json!(1));
61
+ assert_eq!(after["values"]["compteur"], json!(3));
62
+
63
+ let echoed = client
64
+ .call("echo", json!({ "x": [1, 2] }))
65
+ .expect("commande personnalisée");
66
+ assert_eq!(echoed, json!({ "echo": { "x": [1, 2] } }));
67
+
68
+ match client.call("boom", Value::Null) {
69
+ Err(ClientError::Remote(message)) => assert!(message.contains("échec volontaire")),
70
+ other => panic!("erreur distante attendue, reçu {other:?}"),
71
+ }
72
+
73
+ match client.call("inconnue", Value::Null) {
74
+ Err(ClientError::Remote(message)) => assert!(message.contains("inconnue")),
75
+ other => panic!("erreur de commande inconnue attendue, reçu {other:?}"),
76
+ }
77
+
78
+ #[cfg(unix)]
79
+ {
80
+ use std::os::unix::fs::PermissionsExt;
81
+
82
+ let mode = fs::metadata(&socket)
83
+ .expect("métadonnées du socket")
84
+ .permissions()
85
+ .mode()
86
+ & 0o777;
87
+ assert_eq!(mode, 0o600, "le socket doit être privé");
88
+ }
89
+
90
+ drop(client);
91
+ server.shutdown();
92
+ assert!(!socket.exists(), "le socket doit disparaître à l'arrêt");
93
+ }
94
+
95
+ #[test]
96
+ fn des_parametres_incomplets_nomment_le_champ_manquant() {
97
+ let temp = TempDir::new("in-params").expect("répertoire temporaire");
98
+ let socket = temp.socket();
99
+ let mut server = Server::start(Instrument::new(), &socket).expect("démarrage du serveur");
100
+
101
+ let mut client = Client::connect(&socket, Duration::from_secs(1)).expect("connexion");
102
+ match client.call("action", json!({})) {
103
+ Err(ClientError::Remote(message)) => assert!(
104
+ message.contains("key"),
105
+ "le refus doit nommer le champ manquant: {message}"
106
+ ),
107
+ other => panic!("refus de paramètres incomplets attendu, reçu {other:?}"),
108
+ }
109
+
110
+ drop(client);
111
+ server.shutdown();
112
+ }
113
+
114
+ #[test]
115
+ fn un_client_impatient_ne_bloque_pas_indefiniment() {
116
+ let temp = TempDir::new("in-timeout").expect("répertoire temporaire");
117
+ let socket = temp.socket();
118
+ let mut server = Server::start(Instrument::new(), &socket).expect("démarrage du serveur");
119
+
120
+ // 100 ms pour l'échange, mais une échéance de connexion : le serveur peut
121
+ // n'avoir encore rien accepté au moment où le client se présente.
122
+ let mut impatient = support::connect_avant_echeance(
123
+ &socket,
124
+ Duration::from_secs(5),
125
+ Duration::from_millis(100),
126
+ );
127
+ let started = Instant::now();
128
+ match impatient.call("wait", json!({ "milliseconds": 400 })) {
129
+ Err(ClientError::Timeout) => {}
130
+ other => panic!("timeout attendu, reçu {other:?}"),
131
+ }
132
+ assert!(
133
+ started.elapsed() < Duration::from_secs(1),
134
+ "le client a attendu trop longtemps"
135
+ );
136
+
137
+ drop(impatient);
138
+ server.shutdown();
139
+ }
140
+
141
+ #[test]
142
+ fn un_serveur_en_attente_sert_toujours() {
143
+ let temp = TempDir::new("in-waiting").expect("répertoire temporaire");
144
+ let socket = temp.socket();
145
+ let server = Server::start(Instrument::new(), &socket).expect("démarrage du serveur");
146
+
147
+ let waiting = thread::spawn(move || server.wait());
148
+ thread::sleep(Duration::from_millis(100));
149
+ assert!(
150
+ !waiting.is_finished(),
151
+ "wait a rendu la main alors que le serveur n'a pas été arrêté"
152
+ );
153
+
154
+ let mut client =
155
+ support::connect_avant_echeance(&socket, Duration::from_secs(5), Duration::from_secs(1));
156
+ client.call("state", Value::Null).expect("état servi");
157
+ }
158
+
159
+ #[test]
160
+ fn un_serveur_inactif_accepte_une_connexion_tardive() {
161
+ let temp = TempDir::new("in-late").expect("répertoire temporaire");
162
+ let socket = temp.socket();
163
+ let mut server = Server::start(Instrument::new(), &socket).expect("démarrage du serveur");
164
+
165
+ // Cinq tours de sondage d'acceptation passent avant que quiconque se
166
+ // présente : une file vide ne doit pas arrêter le serveur.
167
+ thread::sleep(Duration::from_millis(50));
168
+
169
+ let mut client =
170
+ support::connect_avant_echeance(&socket, Duration::from_secs(5), Duration::from_secs(1));
171
+ client.call("state", Value::Null).expect("état servi");
172
+
173
+ drop(client);
174
+ server.shutdown();
175
+ }
176
+
177
+ #[test]
178
+ fn un_serveur_detruit_libere_son_socket() {
179
+ let temp = TempDir::new("in-drop").expect("répertoire temporaire");
180
+ let socket = temp.socket();
181
+ {
182
+ let _server = Server::start(Instrument::new(), &socket).expect("démarrage du serveur");
183
+ assert!(socket.exists(), "le serveur doit avoir lié son socket");
184
+ }
185
+
186
+ for _ in 0..100 {
187
+ if !socket.exists() {
188
+ return;
189
+ }
190
+ thread::sleep(Duration::from_millis(10));
191
+ }
192
+ panic!("le socket subsiste après destruction du serveur");
193
+ }
194
+
195
+ #[test]
196
+ fn un_chemin_de_socket_a_la_limite_est_accepte() {
197
+ let at_limit = PathBuf::from("a".repeat(MAX_SOCKET_PATH_BYTES));
198
+ assert_eq!(
199
+ at_limit.as_os_str().as_encoded_bytes().len(),
200
+ MAX_SOCKET_PATH_BYTES
201
+ );
202
+ assert!(
203
+ validate_socket_path(&at_limit).is_ok(),
204
+ "un chemin de exactement {MAX_SOCKET_PATH_BYTES} octets doit être accepté"
205
+ );
206
+ }
207
+
208
+ #[test]
209
+ fn un_chemin_de_socket_trop_long_est_refuse_explicitement() {
210
+ let mut too_long = PathBuf::new();
211
+ too_long.push("a".repeat(MAX_SOCKET_PATH_BYTES + 20));
212
+ too_long.push("s");
213
+ let bytes = too_long.as_os_str().as_encoded_bytes().len();
214
+
215
+ match Server::start(Instrument::new(), &too_long) {
216
+ Err(ServerError::Path(PathError::TooLong { bytes: seen, limit })) => {
217
+ assert_eq!(seen, bytes);
218
+ assert_eq!(limit, MAX_SOCKET_PATH_BYTES);
219
+ }
220
+ Err(error) => panic!("refus de chemin trop long attendu, reçu {error}"),
221
+ Ok(_) => panic!("un serveur a démarré sur un chemin trop long"),
222
+ }
223
+
224
+ let message = ServerError::Path(PathError::TooLong {
225
+ bytes,
226
+ limit: MAX_SOCKET_PATH_BYTES,
227
+ })
228
+ .to_string();
229
+ assert!(message.contains("limite 100"), "message: {message}");
230
+ }
@@ -0,0 +1,25 @@
1
+ use instrument::selftest::{self, SelftestOptions};
2
+
3
+ #[test]
4
+ fn un_selftest_qui_echoue_rend_fail_et_un_rapport_faux() {
5
+ let options = SelftestOptions {
6
+ break_assertion: Some("state-initial".to_owned()),
7
+ };
8
+ let outcomes = selftest::run(&options);
9
+ let mut output = Vec::new();
10
+ let passed = selftest::report(&outcomes, &mut output);
11
+ let text = String::from_utf8(output).expect("sortie UTF-8");
12
+
13
+ assert!(
14
+ !passed,
15
+ "un échec injecté doit faire échouer le rapport:\n{text}"
16
+ );
17
+ assert!(
18
+ text.contains("FAIL state-initial — échec injecté"),
19
+ "ligne FAIL nommée absente:\n{text}"
20
+ );
21
+ assert!(
22
+ text.contains("PASS "),
23
+ "les autres assertions doivent tourner:\n{text}"
24
+ );
25
+ }
@@ -0,0 +1,24 @@
1
+ use instrument::selftest::{self, SelftestOptions};
2
+
3
+ #[test]
4
+ fn le_selftest_nominal_passe_et_rapporte_chaque_assertion() {
5
+ let outcomes = selftest::run(&SelftestOptions::default());
6
+ let mut output = Vec::new();
7
+ let passed = selftest::report(&outcomes, &mut output);
8
+ let text = String::from_utf8(output).expect("sortie UTF-8");
9
+
10
+ assert!(passed, "le selftest doit passer:\n{text}");
11
+ assert!(!outcomes.is_empty(), "aucune assertion exécutée");
12
+ assert!(
13
+ outcomes.iter().all(|outcome| outcome.result.is_ok()),
14
+ "assertion en échec:\n{text}"
15
+ );
16
+ for outcome in &outcomes {
17
+ assert!(
18
+ text.contains(&format!("PASS {}", outcome.name)),
19
+ "ligne PASS absente pour {}:\n{text}",
20
+ outcome.name
21
+ );
22
+ }
23
+ assert!(!text.contains("FAIL "), "sortie inattendue:\n{text}");
24
+ }
@@ -0,0 +1,43 @@
1
+ //! Le selftest travaille sur un état temporaire : il ne doit rien laisser
2
+ //! derrière lui. Un binaire de test à lui seul, pour qu'aucun autre test ne
3
+ //! crée de répertoire pendant l'observation.
4
+
5
+ use std::{fs, path::PathBuf};
6
+
7
+ use instrument::selftest::{self, SelftestOptions};
8
+
9
+ /// Les répertoires que `selftest` crée dans le répertoire temporaire du système.
10
+ /// Eux seuls portent le préfixe `in-` suivi du pid de ce processus.
11
+ fn leftovers() -> Vec<PathBuf> {
12
+ let prefix = format!("in-{}-", std::process::id());
13
+ let Ok(entries) = fs::read_dir(std::env::temp_dir()) else {
14
+ return Vec::new();
15
+ };
16
+ let mut paths = entries
17
+ .filter_map(Result::ok)
18
+ .filter(|entry| entry.file_name().to_string_lossy().starts_with(&prefix))
19
+ .map(|entry| entry.path())
20
+ .collect::<Vec<_>>();
21
+ paths.sort();
22
+ paths
23
+ }
24
+
25
+ #[test]
26
+ fn le_selftest_ne_laisse_pas_de_repertoire_temporaire() {
27
+ let before = leftovers();
28
+
29
+ let outcomes = selftest::run(&SelftestOptions::default());
30
+ let mut output = Vec::new();
31
+ let passed = selftest::report(&outcomes, &mut output);
32
+ assert!(
33
+ passed,
34
+ "le selftest doit passer:\n{}",
35
+ String::from_utf8_lossy(&output)
36
+ );
37
+
38
+ let after = leftovers();
39
+ assert_eq!(
40
+ after, before,
41
+ "le selftest a laissé un répertoire temporaire derrière lui"
42
+ );
43
+ }
@@ -0,0 +1,58 @@
1
+ #![allow(dead_code)] // chaque binaire de test n'utilise qu'une partie du module
2
+
3
+ use std::{
4
+ fs, io,
5
+ path::{Path, PathBuf},
6
+ sync::atomic::{AtomicU64, Ordering},
7
+ time::{Duration, Instant},
8
+ };
9
+
10
+ use instrument::Client;
11
+
12
+ static COUNTER: AtomicU64 = AtomicU64::new(0);
13
+
14
+ /// Répertoire temporaire propre à ce test, supprimé au Drop. Les noms restent
15
+ /// courts: un chemin de socket Unix est limité à une centaine d'octets.
16
+ pub struct TempDir {
17
+ path: PathBuf,
18
+ }
19
+
20
+ impl TempDir {
21
+ pub fn new(prefix: &str) -> io::Result<Self> {
22
+ let counter = COUNTER.fetch_add(1, Ordering::Relaxed);
23
+ let path = std::env::temp_dir().join(format!("{prefix}-{}-{counter}", std::process::id()));
24
+ fs::create_dir(&path)?;
25
+ Ok(Self { path })
26
+ }
27
+
28
+ pub fn path(&self) -> &Path {
29
+ &self.path
30
+ }
31
+
32
+ pub fn socket(&self) -> PathBuf {
33
+ self.path.join("s")
34
+ }
35
+ }
36
+
37
+ impl Drop for TempDir {
38
+ fn drop(&mut self) {
39
+ let _ = fs::remove_dir_all(&self.path);
40
+ }
41
+ }
42
+
43
+ /// Se connecte en réessayant jusqu'à l'échéance `window` : un serveur vivant
44
+ /// répond, un serveur arrêté ne répond jamais. Le client rendu garde `timeout`
45
+ /// comme délai de connexion et d'échange, donc un refus transitoire — celui d'un
46
+ /// serveur qui n'a pas encore appelé `accept` — n'est plus un verdict.
47
+ pub fn connect_avant_echeance(socket: &Path, window: Duration, timeout: Duration) -> Client {
48
+ let deadline = Instant::now() + window;
49
+ loop {
50
+ match Client::connect(socket, timeout) {
51
+ Ok(client) => return client,
52
+ Err(error) if Instant::now() >= deadline => {
53
+ panic!("connexion impossible au socket après {window:?}: {error}")
54
+ }
55
+ Err(_) => std::thread::sleep(Duration::from_millis(5)),
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: lathe-journal-de-lot
3
+ description: Inject the journal rule when someone asks for the lot's entry
4
+ events: [before_agent_start]
5
+ match:
6
+ input:
7
+ contains:
8
+ - "close the lot"
9
+ - "close out the lot"
10
+ - "the lot's journal"
11
+ - "write the journal"
12
+ - "fin du lot"
13
+ - "clôture du lot"
14
+ - "cloture du lot"
15
+ - "journal du lot"
16
+ - "bilan du lot"
17
+ action: {type: inject}
18
+ priority: high
19
+ ---
20
+
21
+ ## The lot's entry was asked for
22
+
23
+ Close it with the `journal` skill: that skill holds the form, the author and the one file a closed lot
24
+ leaves uncommitted. Read it rather than reconstructing it from memory.
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: lathe-tech-skill
3
+ description: Explain that an official skill comes before the first write in its technology
4
+ events: [tool_call]
5
+ match:
6
+ tool: [edit, write]
7
+ input:
8
+ regex: ["\"path\"\\s*:\\s*\"[^\"]*Cargo\\.toml\""]
9
+ action: {type: inject, once: true}
10
+ priority: normal
11
+ ---
12
+
13
+ ## The manifest is the moment
14
+
15
+ - The manifest names a technology that ships an official skill. Read that skill before the write that
16
+ touches the technology, the same way `rust` is read before a signature is shaped.
17
+ - Which technology owns which skill is written nowhere here: `gates.py deps` reads the pair, so the
18
+ command is what names the skill. The rule it applies is the `gates.py deps` clause of
19
+ `docs/execution/BACKLOG-WAVE.md`. When it comes back red, install the skill it names, then write.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: lathe-ticket-closed
3
+ description: Speak when a box in a ticket is ticked, at the moment a ticket closes
4
+ events: [tool_result]
5
+ match:
6
+ tool: [edit, write]
7
+ input:
8
+ regex: ["(?=[\\s\\S]*(?:issues?/|tickets?/|todos?/|\\.scratch/))(?=[\\s\\S]*- \\[x\\])"]
9
+ action: {type: inject}
10
+ priority: high
11
+ ---
12
+
13
+ ## A ticket box was just ticked
14
+
15
+ - A tick is a claim. Run the command that proves it, or untick it — the journal records what a command
16
+ showed, not what the session hoped.
17
+ - The journal is a lot, not a ticket. Read `journal` when the lot's last ticket closes; one entry per
18
+ ticket is the form the rule refuses.