@samuelfaj/distill 1.4.6 → 1.4.8

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
@@ -23,6 +23,8 @@ D inspect remotes + MR meta
23
23
  R merge/update may block w/o token
24
24
  ```
25
25
 
26
+ Inline variables use dynamic `<term>=#<letter><digit>` assignments chosen by the model from repeated terms. They stay thread-local unless `distill dsl learn-thread --stdin` sees the explicit variable more than 5 times; learned entries are removed when absent from the next learned thread.
27
+
26
28
  `/distill` also has DSL memory:
27
29
 
28
30
  ```bash
package/bin/distill.js CHANGED
@@ -41,23 +41,23 @@ function resolveBinaryPath() {
41
41
  process.exit(1);
42
42
  }
43
43
 
44
+ const workspaceBinaryPath = path.resolve(
45
+ __dirname,
46
+ "..",
47
+ "..",
48
+ `distill-${target}`,
49
+ "bin",
50
+ targetSpec.binaryName
51
+ );
52
+
53
+ if (fs.existsSync(workspaceBinaryPath)) {
54
+ return workspaceBinaryPath;
55
+ }
56
+
44
57
  try {
45
58
  const packageJsonPath = requireFromHere.resolve(`${targetSpec.packageName}/package.json`);
46
59
  return path.join(path.dirname(packageJsonPath), "bin", targetSpec.binaryName);
47
60
  } catch (error) {
48
- const workspaceBinaryPath = path.resolve(
49
- __dirname,
50
- "..",
51
- "..",
52
- `distill-${target}`,
53
- "bin",
54
- targetSpec.binaryName
55
- );
56
-
57
- if (fs.existsSync(workspaceBinaryPath)) {
58
- return workspaceBinaryPath;
59
- }
60
-
61
61
  console.error(
62
62
  `[distill] Missing platform package ${targetSpec.packageName}. Reinstall @samuelfaj/distill for this platform.`
63
63
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samuelfaj/distill",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
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.6",
20
- "@samuelfaj/distill-darwin-x64": "1.4.6",
21
- "@samuelfaj/distill-linux-arm64": "1.4.6",
22
- "@samuelfaj/distill-linux-x64": "1.4.6",
23
- "@samuelfaj/distill-win32-x64": "1.4.6"
19
+ "@samuelfaj/distill-darwin-arm64": "1.4.8",
20
+ "@samuelfaj/distill-darwin-x64": "1.4.8",
21
+ "@samuelfaj/distill-linux-arm64": "1.4.8",
22
+ "@samuelfaj/distill-linux-x64": "1.4.8",
23
+ "@samuelfaj/distill-win32-x64": "1.4.8"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"
@@ -165,6 +165,37 @@ C PATH pkg bin => repo patch ignored
165
165
  R missing token => merge blocked
166
166
  ```
167
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 repeats or is likely to repeat.
173
+ The model chooses the variables dynamically from the current task; there is no fixed variable list.
174
+
175
+ ```text
176
+ S cache=#c1 warmed model=#m1
177
+ D inspect #c1 hit rate
178
+ D compare #m1 latency
179
+ N no extra vars for one-off nouns
180
+ ```
181
+
182
+ After definition, use the variable:
183
+
184
+ ```text
185
+ D tune #c1 ttl
186
+ D benchmark #m1 output
187
+ ```
188
+
189
+ Rules:
190
+
191
+ - variable key format: `#` + letter + digit
192
+ - one stable meaning per variable inside the thread
193
+ - do not define variables for secrets, people, IDs, paths, URLs, or one-off terms
194
+ - do not redefine an active variable; add a new key if meaning changed
195
+ - inline `#` variables are thread-local immediately after explicit assignment
196
+ - persist only variables used more than 5 times in a `distill dsl learn-thread --stdin` transcript
197
+ - remove a learned variable when it is absent from the next learned thread
198
+
168
199
  ## Good Response Forms
169
200
 
170
201
  Tiny status:
@@ -206,7 +237,12 @@ R not committed
206
237
 
207
238
  ## Glossary And Memory
208
239
 
209
- Keep an internal alias dict per conversation. Do not create files.
240
+ Use two memory layers:
241
+
242
+ - thread dict: internal aliases for the current conversation
243
+ - persisted dict: entries saved by `distill dsl learn`, `distill dsl learn-thread --stdin`, or explicit user action
244
+
245
+ Do not manually create memory files. Let the `distill` CLI own JSON memory writes.
210
246
 
211
247
  Use aliases only when they stay obvious:
212
248
 
@@ -245,7 +281,15 @@ Dict: S=state C=context D=action R=risk O=outcome N=no-go P=proof 1=failing-test
245
281
  Dict+: A1=authentication bug fix
246
282
  ```
247
283
 
248
- 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.
284
+ 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.
285
+
286
+ At every thread end or handoff, when transcript export is available, run:
287
+
288
+ ```bash
289
+ distill dsl learn-thread --stdin < transcript.txt
290
+ ```
291
+
292
+ This analyzes repeated usage, rejects sensitive/noisy terms, asks the configured reviewer model for strict JSON, and persists only compact candidates.
249
293
 
250
294
  ## Tool Calls
251
295