@zenera/cli 1.1.23 → 1.1.24

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 (57) hide show
  1. package/README.md +35 -2
  2. package/dist/ask.d.ts +51 -0
  3. package/dist/ask.js +143 -0
  4. package/dist/batch.d.ts +77 -0
  5. package/dist/batch.js +338 -0
  6. package/dist/command.d.ts +6 -0
  7. package/dist/commands/inspect.d.ts +11 -0
  8. package/dist/commands/inspect.js +388 -89
  9. package/dist/commands/list.js +128 -19
  10. package/dist/commands/memory.js +342 -12
  11. package/dist/commands/models.js +14 -2
  12. package/dist/commands/run.js +139 -34
  13. package/dist/commands/sandbox.js +72 -1
  14. package/dist/engine.d.ts +19 -0
  15. package/dist/engine.js +60 -8
  16. package/dist/liveness.js +6 -3
  17. package/dist/main.js +5 -2
  18. package/dist/podman.d.ts +16 -0
  19. package/dist/podman.js +115 -2
  20. package/dist/progress.d.ts +33 -0
  21. package/dist/progress.js +402 -0
  22. package/dist/request.d.ts +45 -0
  23. package/dist/request.js +300 -0
  24. package/dist/sandbox.js +10 -0
  25. package/dist/session.d.ts +26 -1
  26. package/dist/session.js +42 -3
  27. package/dist/term.d.ts +3 -0
  28. package/dist/term.js +17 -1
  29. package/dist/trace.d.ts +84 -0
  30. package/dist/trace.js +686 -0
  31. package/dist/validate.js +25 -3
  32. package/package.json +2 -2
  33. package/templates/editor/.github/copilot-instructions.md +11 -6
  34. package/templates/editor/.github/prompts/finetune.prompt.md +251 -0
  35. package/templates/editor/.github/skills/zen-cli/SKILL.md +9 -3
  36. package/templates/editor/.github/skills/zen-cli/references/check.md +7 -5
  37. package/templates/editor/.github/skills/zen-cli/references/inspect.md +262 -21
  38. package/templates/editor/.github/skills/zen-cli/references/memory.md +89 -19
  39. package/templates/editor/.github/skills/zen-cli/references/models.md +1 -1
  40. package/templates/editor/.github/skills/zen-cli/references/projects.md +12 -5
  41. package/templates/editor/.github/skills/zen-cli/references/run.md +201 -4
  42. package/templates/editor/.github/skills/zen-finetune/SKILL.md +1000 -0
  43. package/templates/editor/.github/skills/zen-finetune/scripts/collect.sh +432 -0
  44. package/templates/editor/.github/skills/zen-finetune/scripts/sample.sh +199 -0
  45. package/templates/editor/.github/skills/zen-inspect/SKILL.md +396 -0
  46. package/templates/editor/.github/skills/zen-memory/SKILL.md +74 -29
  47. package/templates/editor/.github/skills/zen-memory-warmup/SKILL.md +363 -531
  48. package/templates/editor/.github/skills/zen-sandbox/SKILL.md +19 -0
  49. package/templates/editor/.github/skills/zen-sandbox-capacity/SKILL.md +334 -0
  50. package/templates/editor/.github/skills/zen-sandbox-capacity/references/loadtest.md +181 -0
  51. package/templates/editor/.github/skills/zen-sandbox-capacity/scripts/preflight_sandbox.sh +457 -0
  52. package/templates/editor/.vscode/agents.schema.json +1 -1
  53. package/templates/editor/.vscode/settings.json +1 -0
  54. package/templates/project/agents/files-instructions.md +13 -0
  55. package/templates/project/agents/fork-instructions.md +27 -0
  56. package/templates/project/agents/memory-instructions.md +80 -7
  57. package/templates/project/gitignore +3 -0
@@ -7,7 +7,8 @@ requires: [memory]
7
7
  This project has a memory: a graph of what earlier runs worked out, kept with
8
8
  the project rather than with the session, and shared with every other agent that
9
9
  can see it. It is reached **only** through the `memory_*` tools - `memory_search`
10
- to find, `memory_load` to read.
10
+ to find by meaning, `memory_grep` to find an exact string, `memory_load` to
11
+ read.
11
12
 
12
13
  Not every agent may write to it. Read what follows against the tools you
13
14
  actually have: if `memory_commit` is not among them, everything under
@@ -99,8 +100,9 @@ its own source.
99
100
  ## Reading it
100
101
 
101
102
  `memory_search` hands back an outline of a subgraph with each node's text cut to
102
- 160 characters. `memory_load` is what reads a node whole, by id - load anything
103
- you are going to rely on.
103
+ 160 characters. `memory_grep` hands back the nodes containing an exact string,
104
+ with the lines it matched on. `memory_load` is what reads a node whole, by id -
105
+ load anything you are going to rely on.
104
106
 
105
107
  ### The shape of a recollection
106
108
 
@@ -133,13 +135,18 @@ at that path through `memory_load`, never by looking around in the directory.
133
135
  `vectors.json` and `manifest.json` - its internal format. Do not open, list,
134
136
  grep, `cat` or `find` them, and do not point a shell command at that directory:
135
137
 
136
- - it is ranked by **meaning**, so substring matching misses the hits;
137
138
  - `graph.json` is every node ever committed, as one line;
138
139
  - a raw read bypasses the audience mask and serves **superseded** nodes -
139
140
  corrections that were withdrawn - as if they were current;
140
141
  - it records no use, so the ranking that decides what gets recalled next decays;
141
142
  - another run may be writing, and the manifest is written last.
142
143
 
144
+ **`memory_grep` is that search, done properly.** It reads every node exactly -
145
+ the text, the metadata and the bytes of remembered files - and hands back the
146
+ matching lines with the node they belong to. It applies the mask, it leaves out
147
+ what has been superseded unless you ask for it, and it names any file it could
148
+ not read, so a file that went unsearched never passes for one with no match.
149
+
143
150
  A memory is a record, not an authority - but checking one is not the same as
144
151
  redoing it. Every node names where its content came from, so confirm the
145
152
  recollection there: the named lines still say what the node says, the route
@@ -148,6 +155,31 @@ that check fails, when the source is one that changes under you, or when being
148
155
  wrong is expensive. A check that costs what the original investigation cost is
149
156
  not a check - it is the investigation again, and the memory bought nothing.
150
157
 
158
+ ### None of it appears in an answer
159
+
160
+ The store is your apparatus, not your subject. An answer says what was found and
161
+ where it can be checked - the sources, the commands, the files the work left
162
+ behind. It never says that a recollection was what put you on to them.
163
+
164
+ Never write `/memory`, a node id, or the words "memory", "recalled" or
165
+ "remembered" into an answer. Read your text before you send it: if it holds
166
+ `/memory` or a node id, cut the sentence around it and say what was done
167
+ instead. "Loaded the script from memory (`/memory/01J….py`) and ran it" is
168
+ "ran `<path>`" with your working left in by mistake.
169
+
170
+ Two reasons, and both hold even where the reader would find it interesting. A
171
+ node id names nothing the reader can open, so it reads as a citation and cannot
172
+ be followed; and it stops being true the moment the node is superseded, while
173
+ the source it was drawn from does not. Cite the source, never the memory of it.
174
+
175
+ This binds on a branch's answer exactly as it binds on the final one. A branch
176
+ rejoins as a single result that the agent above writes its own answer from, so
177
+ an id that survives the join is an id in the reply.
178
+
179
+ The one exception is a question about the store itself - what is known about
180
+ something, whether it was seen before, what to forget. Then it is the subject,
181
+ and ids are what the reader needs.
182
+
151
183
  ## Searching it
152
184
 
153
185
  Search **before** paying for anything: an investigation, an index query, a
@@ -177,8 +209,32 @@ would use - node texts are written to be found that way. Narrow with `kinds`,
177
209
  `newer_than`, `limit`, `max_hops` and `max_nodes` when a recollection comes back
178
210
  broad rather than wrong.
179
211
 
212
+ ### Which of the two
213
+
214
+ `memory_search` ranks, so it returns what is closest and stops. That makes it
215
+ right for a question and wrong for a fact about the store itself: when nothing
216
+ comes back, you cannot tell whether the memory is empty on the subject or
217
+ merely worded differently.
218
+
219
+ `memory_grep` is exact and complete. Reach for it when the thing you are looking
220
+ for is a **string** rather than a subject, and when the answer has to be all of
221
+ them:
222
+
223
+ | Looking for | Use |
224
+ | --------------------------------------------------------------- | --------------- |
225
+ | what was learned about a subject, however it was phrased | `memory_search` |
226
+ | a name, path, id, host, flag or command, spelled exactly | `memory_grep` |
227
+ | whether something was already written down at all | `memory_grep` |
228
+ | everywhere a thing is mentioned, before changing or retiring it | `memory_grep` |
229
+ | a starting point, when you do not yet know the vocabulary | `memory_search` |
230
+
231
+ Either way, ids from one are ids for the other: grep a name, then `memory_load`
232
+ what it turned up.
233
+
180
234
  Recalling nothing is not proof of anything: work it out normally, then commit
181
- the result so the next run does not repeat it.
235
+ the result so the next run does not repeat it. A `memory_grep` that found
236
+ nothing is stronger - it means the string is not there - but it says nothing
237
+ about the subject under another name.
182
238
 
183
239
  ## Updating it
184
240
 
@@ -199,6 +255,12 @@ five paths.
199
255
  | The passage itself, when its source cannot change under you | A passage quoted out of something that can |
200
256
  | A proven absence - looked here and here, it is not there | Anything not actually verified |
201
257
 
258
+ A restatement is not merely wasted space. Recall seeds on text alone, so a run
259
+ that commits its own request as a task, a plan and a result has committed three
260
+ near-copies of one sentence - and on the next similar question those three take
261
+ the seed slots between them. Everything actually learned then ranks below them
262
+ and is never reached.
263
+
202
264
  A search over a schema or a documentation index costs a round trip and comes
203
265
  back ranked, so it is the thing most worth not paying for twice. Commit what it
204
266
  **resolved to** - the operation and its shape, or the document, heading and line
@@ -270,6 +332,17 @@ already in memory says is folded into it, and its existing id comes back under
270
332
  your ref - so the links you asked for still land, on the memory that was already
271
333
  there.
272
334
 
335
+ **Grep for an entity before minting a node for it.** An endpoint, a command, a
336
+ host, a tool, a file - anything that recurs across runs is one node the rest of
337
+ the graph hangs off, and folding by similarity will not catch a second copy
338
+ worded differently. `memory_grep` the exact string first, and attach your edges
339
+ to what comes back.
340
+
341
+ A duplicated hub is worse than a missing one. It splits the graph into islands:
342
+ the question reaches one copy, the artifact that answers it hangs off another,
343
+ and the walk out from a seed cannot cross between them - so a memory that is
344
+ present returns nothing, and nothing in the recollection says it happened.
345
+
273
346
  **Say where the content came from.** This is what lets an incomplete
274
347
  recollection be continued instead of believed:
275
348
 
@@ -305,8 +378,8 @@ whole of what you know is one line long.
305
378
  **The file must exist in the workspace first.** `memory_commit` copies an
306
379
  existing file from the workspace; it is not an upload channel and does not
307
380
  write file contents from raw arguments. Write the file to the workspace first
308
- (using `write_file`, `apply_patch`, or a command saving under `/workspace`),
309
- then pass its workspace path (e.g. `"file": "report.py"` or
381
+ (using `write_file`, `apply_patch`, `copy_file`, or a command saving under
382
+ `/workspace`), then pass its workspace path (e.g. `"file": "report.py"` or
310
383
  `"file": "/workspace/report.py"`).
311
384
 
312
385
  | Which files to commit | What belongs in them |
@@ -2,6 +2,9 @@
2
2
  # None of it is source.
3
3
  sessions/
4
4
 
5
+ # The same, one level up: a batch's workspaces, memory copies and answers.
6
+ batches/
7
+
5
8
  # Memory is worth keeping: `graph.json`, `files/` and the vectors are what the
6
9
  # agents learned. The vectors are binary, but nothing rebuilds them from the
7
10
  # graph, so a clone without them recalls by term overlap until every node is