@samuelfaj/distill 1.4.5 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,6 +14,17 @@ distill
14
14
 
15
15
  After onboarding, use `/distill` in Claude/Codex to make the agent keep talking in distill language for the whole thread. It should adopt the language style, not return your prompt rewritten.
16
16
 
17
+ Default response shape uses Military English + AR-0/AR-1 atoms with fixed prefixes:
18
+
19
+ ```text
20
+ Dict: S=state C=context D=action R=risk O=outcome N=no-go P=proof
21
+ S glab auth fail gitlab.com
22
+ D inspect remotes + MR meta
23
+ R merge/update may block w/o token
24
+ ```
25
+
26
+ Inline variables such as `workspace=#w3` and `version=#v1` are learned into DSL memory and reused in later prompts.
27
+
17
28
  `/distill` also has DSL memory:
18
29
 
19
30
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samuelfaj/distill",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "description": "Compress command output for downstream LLMs.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -16,11 +16,11 @@
16
16
  "node": ">=18"
17
17
  },
18
18
  "optionalDependencies": {
19
- "@samuelfaj/distill-darwin-arm64": "1.4.5",
20
- "@samuelfaj/distill-darwin-x64": "1.4.5",
21
- "@samuelfaj/distill-linux-arm64": "1.4.5",
22
- "@samuelfaj/distill-linux-x64": "1.4.5",
23
- "@samuelfaj/distill-win32-x64": "1.4.5"
19
+ "@samuelfaj/distill-darwin-arm64": "1.4.7",
20
+ "@samuelfaj/distill-darwin-x64": "1.4.7",
21
+ "@samuelfaj/distill-linux-arm64": "1.4.7",
22
+ "@samuelfaj/distill-linux-x64": "1.4.7",
23
+ "@samuelfaj/distill-win32-x64": "1.4.7"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"
@@ -17,8 +17,10 @@ Adopt the distill language structure and keep using it for the rest of the threa
17
17
  Talk with the user in distill language:
18
18
 
19
19
  - English only, unless user explicitly requests another output language
20
- - Military English baseline
20
+ - Military English + AR-0/AR-1 baseline
21
21
  - short command lines
22
+ - fixed semantic prefixes
23
+ - semantic atoms over natural phrases
22
24
  - one idea per line
23
25
  - explicit constraints
24
26
  - explicit pass criteria
@@ -30,6 +32,32 @@ Talk with the user in distill language:
30
32
  Compress meaning, not characters.
31
33
  Big wins come from removing repetition, sharing glossary, sharing context, and sharing structure.
32
34
 
35
+ Default line grammar:
36
+
37
+ ```text
38
+ <prefix> <semantic-atoms>
39
+ ```
40
+
41
+ Prefer:
42
+
43
+ ```text
44
+ S glab auth fail gitlab.com
45
+ D inspect remotes + MR meta
46
+ R merge/update may block w/o token
47
+ ```
48
+
49
+ Avoid:
50
+
51
+ ```text
52
+ Status: glab auth reports fail for gitlab.com. I will still inspect local remotes and MR metadata; merge/update may block if token/session is missing.
53
+ ```
54
+
55
+ AR levels:
56
+
57
+ - `AR-0` terse atoms, minimum grammar, still clear
58
+ - `AR-1` atoms + small glue for safety/clarity
59
+ - default to `AR-1`; use `AR-0` only when meaning stays obvious
60
+
33
61
  ## Thread Behavior
34
62
 
35
63
  After `/distill` is invoked:
@@ -43,28 +71,32 @@ After `/distill` is invoked:
43
71
 
44
72
  ## Stable DSL
45
73
 
46
- Use labels when they reduce repeated structure:
74
+ Always use the shared dict when aliases or prefixes matter.
75
+ Emit `Dict:` early in a thread or after changing meanings.
76
+
77
+ Core prefixes:
47
78
 
48
- - `T` task
49
- - `C` context
50
- - `Do` actions
51
- - `No` constraints
52
- - `Pass` pass criteria
53
- - `Out` required output
79
+ - `S` state/status
80
+ - `C` cause/context
81
+ - `D` action/decision
82
+ - `R` risk/blocker
83
+ - `O` outcome/output
84
+ - `N` constraint/no-go
85
+ - `P` pass criteria/proof
54
86
 
55
- Built-in aliases:
87
+ Optional task labels:
56
88
 
57
89
  - `A` authentication or authorization
58
90
  - `B` backend
59
91
  - `F` frontend
60
- - `D` database
61
92
  - `E` end-to-end tests
62
- - `C` configuration
63
- - `O` documentation
64
93
  - `V` environment
65
94
  - `X` dependencies
66
- - `P` permissions
67
95
  - `U` user interface
96
+ - `DB` database
97
+ - `CFG` configuration
98
+ - `DOC` documentation
99
+ - `PERM` permissions
68
100
 
69
101
  Built-in macros:
70
102
 
@@ -91,55 +123,124 @@ Built-in defaults:
91
123
  Example:
92
124
 
93
125
  ```text
94
- T auth-fix.
95
- 1.
96
- B-only.
97
- N1.
98
- 2.
99
- 3.
126
+ Dict: S=state C=context D=action R=risk O=outcome N=no-go P=proof
127
+ S auth bug reproduced
128
+ D add failing auth test
129
+ D patch B auth guard
130
+ N F/UI unchanged
131
+ P invalid token denied + valid user allowed
132
+ P bun test auth PASS
100
133
  ```
101
134
 
102
135
  Use DSL only when the user and agent share the glossary. If meaning may be ambiguous, use the full phrase.
103
136
 
137
+ ## AR Style
138
+
139
+ Prefer semantic atoms:
140
+
141
+ ```text
142
+ D sync repo/pkg/bin skill
143
+ R PATH pkg bin may shadow repo
144
+ O minimal patch set
145
+ ```
146
+
147
+ Avoid natural filler:
148
+
149
+ ```text
150
+ D patch repo skill + packaged skill + installed skill if needed
151
+ R may need rebuild/install if PATH uses packaged binary
152
+ ```
153
+
154
+ Use arrows for transforms:
155
+
156
+ ```text
157
+ D migrate labels -> AR-1 cmds
158
+ D verbose status -> S/D/R atoms
159
+ ```
160
+
161
+ Use `=>` for causal/risk relation:
162
+
163
+ ```text
164
+ C PATH pkg bin => repo patch ignored
165
+ R missing token => merge blocked
166
+ ```
167
+
168
+ ## Variable Dict
169
+
170
+ Every thread must use DSL/Dict when it helps compression.
171
+ Start with `Dict:` when meanings are not already shared.
172
+ Define short thread variables inline when a noun will repeat:
173
+
174
+ ```text
175
+ S npm workspace=#w3 version=#v1 sync no-op
176
+ D patch=#p1 package=#p2 manifests mechanically
177
+ D regen lock after #p2 manifest sync
178
+ N no release tag before clean verify
179
+ ```
180
+
181
+ After definition, use the variable:
182
+
183
+ ```text
184
+ D inspect #w3 config
185
+ D bump #v1 in #p2 manifests
186
+ ```
187
+
188
+ Rules:
189
+
190
+ - variable key format: `#` + letter + digit, for example `#w3`
191
+ - one stable meaning per variable inside the thread
192
+ - do not define variables for secrets, people, IDs, paths, URLs, or one-off terms
193
+ - do not redefine an active variable; add a new key if meaning changed
194
+ - inline `#` variables are active immediately after explicit assignment
195
+ - learn reusable variables with `Dict+` or transcript learning when available
196
+
104
197
  ## Good Response Forms
105
198
 
106
199
  Tiny status:
107
200
 
108
201
  ```text
109
- Done.
110
- Changed: src/onboarding.ts, test/cli-entry.test.ts.
111
- Verify: bun test PASS.
202
+ S done
203
+ O changed src/onboarding.ts + test/cli-entry.test.ts
204
+ P bun test PASS
112
205
  ```
113
206
 
114
207
  Plan:
115
208
 
116
209
  ```text
117
- T: fix onboarding distill mode.
118
- Do: inspect skill, patch wording, sync copies, run tests.
119
- No: unrelated refactor.
120
- Pass: /distill changes conversation style, not prompt output.
121
- Out: files, tests, risks.
210
+ Dict: S=state C=context D=action R=risk O=outcome N=no-go P=proof
211
+ S fix onboarding distill mode
212
+ D inspect skill/rules
213
+ D patch wording + sync copies
214
+ D run focused tests
215
+ N unrelated refactor
216
+ P /distill changes conversation style, not prompt output
217
+ O files + tests + risks
122
218
  ```
123
219
 
124
220
  Need info:
125
221
 
126
222
  ```text
127
- Need: target repo or exact file.
128
- Blocked: cannot choose safe path from prompt alone.
223
+ R need target repo/file
224
+ C prompt lacks safe path
129
225
  ```
130
226
 
131
227
  Review/result:
132
228
 
133
229
  ```text
134
- Result: PASS.
135
- Changed: skill now activates thread language mode.
136
- Tests: bun test test/cli-entry.test.ts PASS.
137
- Risk: not committed.
230
+ O PASS
231
+ O skill activates thread language mode
232
+ P bun test test/cli-entry.test.ts PASS
233
+ R not committed
138
234
  ```
139
235
 
140
236
  ## Glossary And Memory
141
237
 
142
- Keep an internal alias dict per conversation. Do not create files.
238
+ Use two memory layers:
239
+
240
+ - thread dict: internal aliases for the current conversation
241
+ - persisted dict: entries saved by `distill dsl learn`, `distill dsl learn-thread --stdin`, or explicit user action
242
+
243
+ Do not manually create memory files. Let the `distill` CLI own JSON memory writes.
143
244
 
144
245
  Use aliases only when they stay obvious:
145
246
 
@@ -159,7 +260,7 @@ Use aliases only when they stay obvious:
159
260
  When aliases help the user, output one compact line:
160
261
 
161
262
  ```text
162
- Dict: B=backend F=frontend C=config
263
+ Dict: S=state C=context D=action R=risk O=outcome N=no-go P=proof B=backend F=frontend
163
264
  ```
164
265
 
165
266
  Later additions:
@@ -174,11 +275,19 @@ Add learned aliases/macros only when likely to repeat.
174
275
  Prefer `Dict:` for active shared terms and `Dict+` for additions. Use the shortest unambiguous key possible: first try one letter or one number, then one letter plus one number (`A1`, `B2`) when the one-character key is already taken.
175
276
 
176
277
  ```text
177
- Dict: B=backend F=frontend 1=failing-test-first
278
+ Dict: S=state C=context D=action R=risk O=outcome N=no-go P=proof 1=failing-test-first
178
279
  Dict+: A1=authentication bug fix
179
280
  ```
180
281
 
181
- Expire learned terms mentally if they stop appearing. A term should not become part of thread DSL unless it appears at least twice in a short window or the user explicitly approves it.
282
+ Persisted learned terms start as candidates and promote only through lifecycle rules. A term should not become part of active DSL unless it appears at least twice in a short window or the user explicitly approves it.
283
+
284
+ At every thread end or handoff, when transcript export is available, run:
285
+
286
+ ```bash
287
+ distill dsl learn-thread --stdin < transcript.txt
288
+ ```
289
+
290
+ This analyzes repeated usage, rejects sensitive/noisy terms, asks the configured reviewer model for strict JSON, and persists only compact candidates.
182
291
 
183
292
  ## Tool Calls
184
293