@zenera/cli 1.1.25 → 1.1.26
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 +13 -1
- package/dist/catalog.d.ts +20 -0
- package/dist/catalog.js +60 -0
- package/dist/commands/index.js +2 -0
- package/dist/commands/inspect.d.ts +5 -1
- package/dist/commands/inspect.js +54 -14
- package/dist/commands/memory.js +28 -3
- package/dist/commands/meta.js +24 -5
- package/dist/commands/models.js +2 -1
- package/dist/commands/sandbox.js +73 -3
- package/dist/commands/view.d.ts +8 -0
- package/dist/commands/view.js +114 -0
- package/dist/engine.d.ts +3 -1
- package/dist/engine.js +6 -0
- package/dist/eventlog.d.ts +5 -0
- package/dist/eventlog.js +25 -1
- package/dist/liveness.js +20 -2
- package/dist/main.js +0 -0
- package/dist/meta/editor.d.ts +1 -1
- package/dist/meta/editor.js +4 -21
- package/dist/meta/finetune/analyze-brief.d.ts +26 -0
- package/dist/meta/finetune/analyze-brief.js +131 -0
- package/dist/meta/finetune/apply-brief.d.ts +23 -0
- package/dist/meta/finetune/apply-brief.js +247 -0
- package/dist/meta/finetune/brief.d.ts +45 -0
- package/dist/meta/finetune/brief.js +158 -0
- package/dist/meta/finetune/command.d.ts +1 -1
- package/dist/meta/finetune/command.js +224 -46
- package/dist/meta/finetune/cost.d.ts +46 -0
- package/dist/meta/finetune/cost.js +105 -0
- package/dist/meta/finetune/dataset/types.d.ts +3 -1
- package/dist/meta/finetune/feedback.d.ts +14 -2
- package/dist/meta/finetune/feedback.js +22 -3
- package/dist/meta/finetune/guard.d.ts +29 -0
- package/dist/meta/finetune/guard.js +104 -0
- package/dist/meta/finetune/improvements.d.ts +50 -3
- package/dist/meta/finetune/improvements.js +290 -33
- package/dist/meta/finetune/live.d.ts +17 -7
- package/dist/meta/finetune/live.js +56 -10
- package/dist/meta/finetune/loop.js +59 -10
- package/dist/meta/finetune/recheck.d.ts +58 -0
- package/dist/meta/finetune/recheck.js +311 -0
- package/dist/meta/finetune/report.d.ts +9 -2
- package/dist/meta/finetune/report.js +551 -438
- package/dist/meta/finetune/sampler.js +8 -2
- package/dist/meta/finetune/train.d.ts +6 -2
- package/dist/meta/finetune/train.js +55 -21
- package/dist/meta/finetune/tui.d.ts +3 -3
- package/dist/meta/finetune/tui.js +37 -12
- package/dist/meta/finetune/tuning.d.ts +27 -1
- package/dist/meta/finetune/tuning.js +21 -2
- package/dist/meta/finetune/usage.d.ts +4 -0
- package/dist/meta/finetune/usage.js +35 -0
- package/dist/meta/finetune/view.d.ts +9 -0
- package/dist/meta/finetune/view.js +27 -0
- package/dist/meta/host.d.ts +2 -1
- package/dist/meta/host.js +2 -1
- package/dist/meta.d.ts +291 -0
- package/dist/meta.js +981 -0
- package/dist/resources.d.ts +215 -0
- package/dist/resources.js +856 -0
- package/dist/scaffold.d.ts +3 -4
- package/dist/scaffold.js +21 -9
- package/dist/trace.d.ts +5 -0
- package/dist/trace.js +54 -5
- package/dist/tui/app.js +19 -5
- package/dist/tui/links.d.ts +27 -0
- package/dist/tui/links.js +142 -0
- package/dist/tui/models.d.ts +3 -1
- package/dist/tui/models.js +65 -7
- package/dist/tui/sandbox.d.ts +10 -0
- package/dist/tui/sandbox.js +131 -0
- package/package.json +3 -2
- package/templates/editor/.github/copilot-instructions.md +29 -43
- package/templates/editor/.github/prompts/analyze.prompt.md +3 -1
- package/templates/editor/.github/prompts/finetune-apply.prompt.md +221 -42
- package/templates/editor/.github/prompts/project-review.prompt.md +1 -1
- package/templates/editor/.github/skills/zen-analyze-run/SKILL.md +162 -57
- package/templates/editor/.github/skills/zen-cli/references/finetune.md +74 -14
- package/templates/editor/.github/skills/zen-cli/references/inspect.md +16 -2
- package/templates/editor/.github/skills/zen-cli/references/projects.md +4 -6
- package/templates/editor/.github/skills/zen-cli/references/sandbox.md +25 -13
- package/templates/editor/.github/skills/zen-finetune/SKILL.md +74 -33
- package/templates/editor/.github/skills/zen-inspect/SKILL.md +14 -1
- package/templates/editor/.github/skills/zen-inspect-ask/SKILL.md +4 -3
- package/templates/editor/.github/skills/zen-instructions/SKILL.md +4 -12
- package/templates/editor/.github/skills/zen-memory/SKILL.md +64 -39
- package/templates/editor/.github/skills/zen-review/SKILL.md +6 -31
- package/templates/editor/.github/skills/zen-review/scripts/check-paths.sh +1 -2
- package/templates/editor/.github/skills/zen-review/scripts/review.sh +3 -12
- package/templates/editor/.github/skills/zen-sandbox/SKILL.md +2 -1
- package/templates/editor/.github/skills/zen-spec-sync/SKILL.md +2 -4
- package/templates/project/agents/fork-instructions.md +78 -28
- package/templates/project/agents/memory-instructions.md +222 -493
- package/templates/project/agents/tools-instructions.md +7 -0
- package/templates/editor/.github/skills/zen-memory/scripts/check-instructions.sh +0 -116
|
@@ -557,7 +557,7 @@ and why.
|
|
|
557
557
|
| `agents/prompts/<name>.md` | no memory | Yes — the usual place a per-agent finding lands |
|
|
558
558
|
| `agents/skills/<name>/SKILL.md` | no memory | Yes — when the fix is knowledge, not standing policy |
|
|
559
559
|
| `agents/instructions.md` | no memory | Yes — when the fix binds every agent in the project |
|
|
560
|
-
| `agents/<topic>-policy-instructions.md` | no memory | Yes —
|
|
560
|
+
| `agents/<topic>-policy-instructions.md` | no memory | Yes — edit the owner; create one only when the rule is absent |
|
|
561
561
|
| `agents/memory-policy-instructions.md` | both | Yes — what to commit without memory; recall and re-commit with it |
|
|
562
562
|
| the memory paragraph of a prompt or skill | with memory | Only where an ask's `why` line names it |
|
|
563
563
|
| `agents.yaml` | — | No — a structural finding is an open problem in the README |
|
|
@@ -1224,10 +1224,11 @@ across proposals_. Two cases proposing the same sentence in different words are
|
|
|
1224
1224
|
one pattern; two cases proposing opposite edits to one sentence are a conflict,
|
|
1225
1225
|
and the conflict is the finding. Write the merged table into `findings.md`,
|
|
1226
1226
|
under `## Proposals, merged`: one row per pattern, the cases and nodes behind
|
|
1227
|
-
it, the
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1227
|
+
it, the one-sentence obligation, intended audience, owner, existing locations,
|
|
1228
|
+
disposition, and edit. A cost pattern becomes a rule the same way a correctness
|
|
1229
|
+
one does: three cases listing a directory to find a file the skill could name
|
|
1230
|
+
is a line in that skill; three cases running independent lookups in sequence is
|
|
1231
|
+
a fan-out rule in the prompt.
|
|
1231
1232
|
|
|
1232
1233
|
**One case is an anecdote.** A rule written from a single failure fixes that
|
|
1233
1234
|
case and adds a line every other run has to read. Three cases missing the same
|
|
@@ -1266,6 +1267,30 @@ Prefer mechanical wording. "Put X before Y", "if the path does not end in `.py`,
|
|
|
1266
1267
|
stop", "copy this literal verbatim" are followed. "Be thorough", "generalise
|
|
1267
1268
|
appropriately" are followed about half the time and are not worth their tokens.
|
|
1268
1269
|
|
|
1270
|
+
### Prove the owner and the absence before editing
|
|
1271
|
+
|
|
1272
|
+
Do this for every merged pattern, including memory patterns:
|
|
1273
|
+
|
|
1274
|
+
1. State the behavioral obligation without using the wording of any proposed
|
|
1275
|
+
rule.
|
|
1276
|
+
2. Name exactly which agents must obey it. Choose the narrowest source that
|
|
1277
|
+
reliably reaches all of them: one agent's prompt, the workflow skill, a
|
|
1278
|
+
capability policy, or the project-wide instructions.
|
|
1279
|
+
3. Search every source those agents load for the same obligation: house rules,
|
|
1280
|
+
capability policies, their prompts, preloaded skills and relevant on-demand
|
|
1281
|
+
skills. Search distinctive verbs and nouns and obvious alternate wording,
|
|
1282
|
+
not only an exact quote. Use the assembled request from the inspected node
|
|
1283
|
+
to settle which sources actually reached the failing call.
|
|
1284
|
+
4. Put every matching or conflicting location in the merged table and choose
|
|
1285
|
+
exactly one disposition: `edit existing`, `move and delete`, `delete
|
|
1286
|
+
contradiction`, or `add because absent`.
|
|
1287
|
+
|
|
1288
|
+
An `add because absent` row is the only permission to append prose. If several
|
|
1289
|
+
sources express the obligation, consolidate them into the one owner and delete
|
|
1290
|
+
the others in the same round. If an existing broad rule caused the failure,
|
|
1291
|
+
rewrite or narrow it; do not leave it in place and add a case-specific
|
|
1292
|
+
exception elsewhere.
|
|
1293
|
+
|
|
1269
1294
|
## Phase 6 — Apply (step 6)
|
|
1270
1295
|
|
|
1271
1296
|
Route each rule by what kind of thing it is. When the pattern's `why` line
|
|
@@ -1274,22 +1299,32 @@ that file is where the change goes, whatever the table below would have
|
|
|
1274
1299
|
guessed; find it the way **zen-analyze-run** finds its sources of trouble, by
|
|
1275
1300
|
grepping the quote in the request and then in `agents.yaml` and `agents/`.
|
|
1276
1301
|
|
|
1277
|
-
| The finding is…
|
|
1278
|
-
|
|
|
1279
|
-
| One agent's behaviour, one agent's job
|
|
1280
|
-
| A fact, a format, an API shape, a procedure
|
|
1281
|
-
| A standing rule every agent must obey
|
|
1282
|
-
| A
|
|
1283
|
-
| The wrong agent had the tool, or no agent did
|
|
1284
|
-
| The dataset was wrong
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
`
|
|
1288
|
-
`
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1302
|
+
| The finding is… | It goes in |
|
|
1303
|
+
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
1304
|
+
| One agent's behaviour, one agent's job | `agents/prompts/<agent>.md` |
|
|
1305
|
+
| A fact, a format, an API shape, a procedure | A skill — extend one, or create one |
|
|
1306
|
+
| A standing rule every agent must obey | `agents/instructions.md` |
|
|
1307
|
+
| A project-wide rule every user of a capability must obey | its existing `agents/<topic>-policy-instructions.md`, or a new one only when the obligation is absent |
|
|
1308
|
+
| The wrong agent had the tool, or no agent did | not changed — structural: an open problem in the README, reported at the end |
|
|
1309
|
+
| The dataset was wrong | `finetune/dataset.json`, before the next run |
|
|
1310
|
+
|
|
1311
|
+
Policy files are a last destination, not the usual output of a batch. Create
|
|
1312
|
+
`memory-policy-`, `fork-policy-`, `tools-policy-` or
|
|
1313
|
+
`files-policy-instructions.md` only when the merged table proves the rule is
|
|
1314
|
+
absent and every agent with that capability must obey it. They sit beside
|
|
1315
|
+
`zen`'s own four, they are yours, and `zen check --fix` does not touch them.
|
|
1316
|
+
Load **zen-instructions** before writing one — in particular: `requires:` is
|
|
1317
|
+
_not_ inherited, so a policy file must repeat the condition of the file it sits
|
|
1318
|
+
next to (`requires: memory` beside `memory-instructions.md`), and the files are
|
|
1319
|
+
prepended in filename order, so `memory-policy-` reads after
|
|
1320
|
+
`memory-instructions.md`.
|
|
1321
|
+
|
|
1322
|
+
Apply the disposition from the merged table. Prefer editing an existing owner;
|
|
1323
|
+
when moving a rule, add it to the owner and delete every displaced copy in the
|
|
1324
|
+
same change. Do not keep a general rule and stack narrower exceptions under it.
|
|
1325
|
+
Before finishing, search again for the obligation's terms and read the affected
|
|
1326
|
+
assembled prefix in order. The remaining copies must either have different
|
|
1327
|
+
audiences or be deleted.
|
|
1293
1328
|
|
|
1294
1329
|
Never edit `agents/memory-instructions.md`, `agents/fork-instructions.md`,
|
|
1295
1330
|
`agents/tools-instructions.md` or `agents/files-instructions.md`. They are copies
|
|
@@ -1299,10 +1334,11 @@ change the master upstream in the CLI templates, and note it in the run.
|
|
|
1299
1334
|
|
|
1300
1335
|
Record what changed and why in the run's own `changes.md` —
|
|
1301
1336
|
`finetune/runs/batch01-nomem-run1/changes.md` — one entry per edit, each
|
|
1302
|
-
naming the merged pattern and the proposals behind it.
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1337
|
+
naming the merged pattern and the proposals behind it. Include the obligation,
|
|
1338
|
+
owner, searches, existing locations, disposition, rules removed or replaced,
|
|
1339
|
+
and the net line change. It is what makes the next run's difference
|
|
1340
|
+
interpretable, and it is what you read when a number goes _down_. `next.mjs`
|
|
1341
|
+
looks for it to tell whether a graded run is waiting to be confirmed.
|
|
1306
1342
|
|
|
1307
1343
|
Then:
|
|
1308
1344
|
|
|
@@ -1519,12 +1555,14 @@ Then the per-case grading, each case ending in its proposals, as in phase 4.
|
|
|
1519
1555
|
### Merge, update the memory policy, run again (steps 12–14)
|
|
1520
1556
|
|
|
1521
1557
|
Merge the proposals into patterns exactly as in phase 5, and write the merged
|
|
1522
|
-
table under `## Proposals, merged`.
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
and
|
|
1558
|
+
table under `## Proposals, merged`. Run the phase 5 ownership and duplicate
|
|
1559
|
+
check before applying anything. Apply a project-wide rule to
|
|
1560
|
+
`agents/memory-policy-instructions.md` only when every memory-enabled agent must
|
|
1561
|
+
obey it; apply one agent's behavior to its prompt and one workflow's behavior to
|
|
1562
|
+
its skill. These rules cover _when_ to recall, when to trust a recalled fact,
|
|
1563
|
+
when to go and look anyway, and when **not** to commit because memory already
|
|
1564
|
+
holds it. Edit or consolidate an existing rule before adding one. Record the
|
|
1565
|
+
disposition and removals in this run's `changes.md`, then run `zen check`.
|
|
1528
1566
|
|
|
1529
1567
|
A pattern that cannot be written as one of those is a no-memory finding that
|
|
1530
1568
|
escaped: the with-memory runs do not fix it. Write it under "Open problems" in
|
|
@@ -1730,8 +1768,11 @@ next one. Change them upstream, in the CLI's `templates/editor/.github/skills/`.
|
|
|
1730
1768
|
case is tuned against unless the user named a smaller limit.
|
|
1731
1769
|
13. **Patch the README after every step, by hand.** Exactly one `now` node on the
|
|
1732
1770
|
map. When `next.mjs` says `first: patch finetune/README.md`, do that first.
|
|
1733
|
-
14. **Never edit from one case's proposal
|
|
1734
|
-
|
|
1771
|
+
14. **Never edit from one case's proposal, and never apply a pattern by merely
|
|
1772
|
+
appending prose.** Merge every case's proposals first; then prove the owner,
|
|
1773
|
+
search loaded sources for semantic duplicates, and record `edit existing`,
|
|
1774
|
+
`move and delete`, `delete contradiction`, or `add because absent`. A rule
|
|
1775
|
+
needs a pattern unless the failure was catastrophic.
|
|
1735
1776
|
15. **Never edit `zen`'s four instruction files.** `zen check --fix` overwrites
|
|
1736
1777
|
them. Project policy goes in a `-policy-` file beside them.
|
|
1737
1778
|
16. **Never adjust a rubric after seeing the run.** Fix a wrong rubric before the
|
|
@@ -278,9 +278,22 @@ zen inspect node n11 --part thinking --part text --dir <run dir>
|
|
|
278
278
|
zen inspect node n11 --full --dir <run dir>
|
|
279
279
|
```
|
|
280
280
|
|
|
281
|
+
An `llm_call` carries two more parts read out of its request, held back the
|
|
282
|
+
same way: `tools`, the tool names that call was offered, one per line, and
|
|
283
|
+
`messages`, the conversation it saw, one clipped line per message with its
|
|
284
|
+
tool calls under it. They answer "was the tool offered" and "what had it seen"
|
|
285
|
+
without opening the request. For the request itself as JSON, `--raw` prints
|
|
286
|
+
one part of one node with no framing, ready for `jq`:
|
|
287
|
+
|
|
288
|
+
```sh
|
|
289
|
+
zen inspect node n11 --part tools --dir <run dir>
|
|
290
|
+
zen inspect node n11 --part request --raw --dir <run dir> | jq '.messages'
|
|
291
|
+
```
|
|
292
|
+
|
|
281
293
|
`--part` is repeatable and matches a **prefix**, so `--part call` catches a part
|
|
282
294
|
named `call run_command (toolu_01A…)` without your typing the id. A name that
|
|
283
|
-
matches nothing is
|
|
295
|
+
matches nothing is reported in a `#` line; when no name matches at all it is an
|
|
296
|
+
error listing the parts the nodes do carry.
|
|
284
297
|
|
|
285
298
|
```
|
|
286
299
|
# zen inspect node · 1/41 nodes of run 20260825-143012-a7f3 · ids from `zen inspect graph`
|
|
@@ -35,14 +35,14 @@ invented rationale.
|
|
|
35
35
|
|
|
36
36
|
| Check | How | If it fails, the cause is |
|
|
37
37
|
| -------------------------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------- |
|
|
38
|
-
| The tool was offered on that call |
|
|
38
|
+
| The tool was offered on that call | `--part tools` of that call (below) | `agents.yaml` - tool not granted, or depth cap hit |
|
|
39
39
|
| The instruction file was in the prompt | the `system_prompt` label lists files: `fork-instructions.md`, `memory-instructions.md` | missing file, or its `requires:` not met |
|
|
40
40
|
| The skill was loaded | a `load_skills` node naming it, or the skill index in `request` | binding in `agents.yaml` (`skills:`) |
|
|
41
41
|
| Memory was already recalled for it | a `memory_recall` node before the call; `recall 0 nodes` | memory content, not behaviour |
|
|
42
42
|
| The context still held what it needed | no `compaction` before the node, or the item is not `hidden by` one | compaction, not instructions |
|
|
43
43
|
|
|
44
44
|
```sh
|
|
45
|
-
zen inspect node n9 --part
|
|
45
|
+
zen inspect node n9 --part tools --dir <run-dir> | grep -xE 'fork|memory_search|memory_grep'
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
Only when every row passes is the question "which instruction stopped you".
|
|
@@ -144,7 +144,8 @@ zen inspect ask n9 --question-file .tmp/ask/<run-id>/n9-memory.md --dir <run-dir
|
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
- One file per question, at `.tmp/ask/<run-id>/<node>-<topic>.md`. `.tmp/` is
|
|
147
|
-
the project's git-ignored scratch.
|
|
147
|
+
the project's git-ignored scratch. A tuning loop's brief names its own `ask/`
|
|
148
|
+
folder instead: use that one.
|
|
148
149
|
- `--question-file` is the only way the question reaches `zen`. Never a quoted
|
|
149
150
|
argument, a heredoc, `$(cat ...)`, or a Python or Node script around `zen`.
|
|
150
151
|
- A retry (section 5, step 1) or a second opinion (step 4) reuses the same
|
|
@@ -185,7 +185,7 @@ open something, and a running agent sees four: `/workspace`, `/assets`,
|
|
|
185
185
|
|
|
186
186
|
It reads `agents/*instructions.md` and exits `1` on any candidate.
|
|
187
187
|
`agents/memory-instructions.md` is exempt: it is worked examples by design, and
|
|
188
|
-
`
|
|
188
|
+
`rules.stale` is the check it actually needs.
|
|
189
189
|
|
|
190
190
|
## What `zen check` reports
|
|
191
191
|
|
|
@@ -210,17 +210,9 @@ is quietly a project whose agents were never told how to call a tool. And
|
|
|
210
210
|
`rules.unreached` deliberately never fires for ours, because they land in every
|
|
211
211
|
project whether the capability is used or not.
|
|
212
212
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
```sh
|
|
217
|
-
.github/skills/zen-memory/scripts/check-instructions.sh # the verdict
|
|
218
|
-
.github/skills/zen-memory/scripts/check-instructions.sh diff # every differing line
|
|
219
|
-
.github/skills/zen-memory/scripts/check-instructions.sh fix # copy the reference over
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Never read the two against each other by eye, and never paraphrase the reference
|
|
223
|
-
into prose of your own.
|
|
213
|
+
`rules.stale` compares bytes, so it catches the usual drift - trailing
|
|
214
|
+
whitespace inside a table, invisible on screen. Never compare one of ours
|
|
215
|
+
against anything by eye, and never paraphrase one into prose of your own.
|
|
224
216
|
|
|
225
217
|
## Related
|
|
226
218
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zen-memory
|
|
3
|
-
description:
|
|
3
|
+
description: Agent memory in Zenera projects - the `memory:` block and per-agent `access`/`sees`/`writes`/`autoRecall`, the five `memory_*` tools (when to use `memory_grep` instead of `memory_search`), kinds, relations and how recall ranks, inspecting a graph with `zen memory`, designing a memory strategy, `agents/memory-instructions.md` vs `agents/memory-policy-instructions.md`, remembering files under `/memory`, and putting memory in front of a `zen rag` index.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Memory
|
|
@@ -142,8 +142,8 @@ node. It is house rules under `requires: [memory]`, so it reaches exactly the
|
|
|
142
142
|
agents that have the store and no others, and it gates its own advice on the
|
|
143
143
|
tools the reader actually holds. The runtime adds the preference block and
|
|
144
144
|
nothing else. Do not restate any of it in a prompt; state project-specific
|
|
145
|
-
policy instead, and
|
|
146
|
-
|
|
145
|
+
policy instead, and leave the file exactly as `zen` wrote it - `zen check`
|
|
146
|
+
reports any byte that differs as `rules.stale`.
|
|
147
147
|
|
|
148
148
|
## How it is organised
|
|
149
149
|
|
|
@@ -556,38 +556,20 @@ gets whether it loads the skill or not.
|
|
|
556
556
|
|
|
557
557
|
## The house rules
|
|
558
558
|
|
|
559
|
-
**Every project that enables memory carries `
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
worth having.
|
|
559
|
+
**Every project that enables memory carries `agents/memory-instructions.md`**,
|
|
560
|
+
as shipped by `zen`. That file is how the agent is told to use the store: read
|
|
561
|
+
and search it only through the tools, never through `/memory` itself, and what a
|
|
562
|
+
node must carry to still be worth having.
|
|
564
563
|
|
|
565
564
|
`zen init` writes it, because the projects it scaffolds have memory on from the
|
|
566
|
-
first run.
|
|
567
|
-
afterwards, and one whose copy has drifted from the reference or was deleted.
|
|
565
|
+
first run. `zen check` covers the two cases left over:
|
|
568
566
|
|
|
569
|
-
|
|
567
|
+
- `memory.uninstructed` - memory is on and the file is missing or empty.
|
|
568
|
+
- `rules.stale` - any byte differs from what this `zen` ships. The usual drift
|
|
569
|
+
is trailing whitespace inside a table, invisible on screen.
|
|
570
570
|
|
|
571
|
-
|
|
572
|
-
.
|
|
573
|
-
.github/skills/zen-memory/scripts/check-instructions.sh diff # every differing line
|
|
574
|
-
.github/skills/zen-memory/scripts/check-instructions.sh fix # copy the reference over
|
|
575
|
-
```
|
|
576
|
-
|
|
577
|
-
It says whether this project turns memory on at all, exits non-zero on a copy
|
|
578
|
-
that is missing or stale, and prints the `cp` that repairs it. When the only
|
|
579
|
-
difference is trailing whitespace it says so - that is the usual drift, it is
|
|
580
|
-
invisible on screen, and it is the reason reading the two files side by side
|
|
581
|
-
never caught it.
|
|
582
|
-
|
|
583
|
-
It is a copy, not a transcription - this reference already sits in the project,
|
|
584
|
-
because `zen init` and `zen open` write the whole `.github/` tree, and they write
|
|
585
|
-
it from the same file the project's copy came from. What `fix` runs, from the
|
|
586
|
-
project root, is exactly:
|
|
587
|
-
|
|
588
|
-
```sh
|
|
589
|
-
cp .github/skills/zen-memory/references/memory-instructions.md agents/memory-instructions.md
|
|
590
|
-
```
|
|
571
|
+
`zen check --fix` repairs both, writing the file from the version of `zen` in
|
|
572
|
+
hand. Never write or patch it by hand.
|
|
591
573
|
|
|
592
574
|
Everything the project keeps under `agents/` named `<topic>-instructions.md` is
|
|
593
575
|
prepended to every agent, in filename order, so this belongs in its own document
|
|
@@ -598,19 +580,55 @@ memory and it leaves with it.
|
|
|
598
580
|
|
|
599
581
|
| File | Is | Owned by |
|
|
600
582
|
| -------------------------------------- | ------------------------------------------------------------------ | ----------- |
|
|
601
|
-
| `agents/memory-instructions.md` | the DEFAULT rules - how the store works, and how any agent uses it |
|
|
583
|
+
| `agents/memory-instructions.md` | the DEFAULT rules - how the store works, and how any agent uses it | `zen` |
|
|
602
584
|
| `agents/memory-policy-instructions.md` | this PROJECT's customisations on top of them | the project |
|
|
603
585
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
586
|
+
### Keep project policy additive
|
|
587
|
+
|
|
588
|
+
`agents/memory-policy-instructions.md` is not a second memory manual and is not
|
|
589
|
+
the default destination for every memory finding. A rule belongs there only
|
|
590
|
+
when it changes how **every memory-enabled agent in this project** uses memory
|
|
591
|
+
and the default rules do not already say it.
|
|
592
|
+
|
|
593
|
+
| The rule is about | Owner |
|
|
594
|
+
| ------------------------------------------------------------------- | ------------------------------------------------------- |
|
|
595
|
+
| How the memory tools and graph work in every Zenera project | the upstream default; never repeat it in project policy |
|
|
596
|
+
| A project-wide restriction or obligation for every memory agent | `agents/memory-policy-instructions.md` |
|
|
597
|
+
| One agent's job, finish condition, recall timing or commit behavior | that agent's prompt |
|
|
598
|
+
| One workflow, index, API or body of domain knowledge | the skill that teaches that workflow or knowledge |
|
|
599
|
+
| One observed case with no repeated pattern yet | the tuning findings, not an instruction |
|
|
600
|
+
|
|
601
|
+
Before adding or changing a project memory rule:
|
|
602
|
+
|
|
603
|
+
1. Write the intended obligation in one sentence without naming a file.
|
|
604
|
+
2. Choose its owner from the table above and name the agents that must receive
|
|
605
|
+
it. If that set is smaller than every memory-enabled agent, policy is the
|
|
606
|
+
wrong owner.
|
|
607
|
+
3. Search the default memory rules, every project policy file, the affected
|
|
608
|
+
prompts and the affected skills for the obligation. Search distinctive
|
|
609
|
+
verbs and nouns plus obvious alternate wording; an exact-text search alone
|
|
610
|
+
does not find semantic duplicates.
|
|
611
|
+
4. Record one disposition: `edit existing`, `move and delete`, `delete
|
|
612
|
+
contradiction`, or `add because absent`. An addition without this record is
|
|
613
|
+
not ready to apply.
|
|
614
|
+
5. Make one source authoritative in the same change. Remove weaker copies and
|
|
615
|
+
rewrite a conflicting rule as one complete rule; never preserve the old rule
|
|
616
|
+
and append an exception beneath it.
|
|
617
|
+
|
|
618
|
+
The narrowest source that reliably reaches every intended agent owns the rule.
|
|
619
|
+
Several cases supporting one pattern do not make that pattern global; scope is
|
|
620
|
+
decided by who must obey it, not by how often it failed.
|
|
621
|
+
|
|
622
|
+
**Keep the first untouched.** It is predefined: it describes this version of
|
|
623
|
+
the runtime, not this project, and `zen check` compares it byte for byte.
|
|
624
|
+
Anything edited into it is lost the next time `zen check --fix` runs.
|
|
607
625
|
|
|
608
626
|
Everything a project decides for itself goes in the second - audiences, what
|
|
609
627
|
must never be written down, what an agent commits at the end of a job, which
|
|
610
628
|
index a recalled route is checked against. Filename order puts it directly
|
|
611
629
|
after the defaults, so it reads as the exceptions to them. Then keeping up with
|
|
612
|
-
a
|
|
613
|
-
|
|
630
|
+
a newer `zen` is `zen check --fix` again, rather than a hand-patch around prose
|
|
631
|
+
that has to be preserved.
|
|
614
632
|
|
|
615
633
|
**It must open with the same frontmatter**, or it is prepended to every agent in
|
|
616
634
|
the project, including the ones with no store to apply it to:
|
|
@@ -720,10 +738,17 @@ agents:
|
|
|
720
738
|
|
|
721
739
|
## Review checklist
|
|
722
740
|
|
|
723
|
-
- [ ]
|
|
724
|
-
`agents/memory-instructions.md` is
|
|
741
|
+
- [ ] `zen check` reports neither `memory.uninstructed` nor `rules.stale`, so
|
|
742
|
+
`agents/memory-instructions.md` is what `zen` ships byte for byte - and
|
|
725
743
|
project policy lives in `agents/memory-policy-instructions.md`, opening
|
|
726
744
|
with `requires: [memory]`.
|
|
745
|
+
- [ ] Every project memory-policy rule applies to every memory-enabled agent;
|
|
746
|
+
role-specific rules are in prompts and workflow-specific rules are in
|
|
747
|
+
skills.
|
|
748
|
+
- [ ] For every added or changed policy rule, the review records its one-sentence
|
|
749
|
+
obligation, owner, semantic searches, existing locations and disposition.
|
|
750
|
+
- [ ] No project policy rule restates a default memory rule, and no equivalent
|
|
751
|
+
or softer copy remains in another loaded prompt, skill or policy file.
|
|
727
752
|
- [ ] `memory.embedding` is set, and was set before the graph had content.
|
|
728
753
|
- [ ] Every agent that should learn has a `memory:` binding - the top-level
|
|
729
754
|
block alone enables nothing.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zen-review
|
|
3
|
-
description: Checking a project before committing - the
|
|
3
|
+
description: Checking a project before committing - the three mechanical checks `/project-review` makes before any judgement (`zen check`, the §2.5 path sweep, the spec-sync record), what each one owns, what their exit codes mean, which findings hand off to `zen-instructions`, and what deliberately has no check because no tool can make it. Load before running `/project-review`, before saying a project is ready, and whenever a review finding needs verifying rather than restating.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Reviewing a project
|
|
@@ -22,17 +22,16 @@ From the project root, or anywhere at all:
|
|
|
22
22
|
.github/skills/zen-review/scripts/review.sh
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
It runs
|
|
25
|
+
It runs three checks in the order a reviewer needs them and prints a summary:
|
|
26
26
|
|
|
27
27
|
| Step | Runs | Owns |
|
|
28
28
|
| ----------- | ------------------------------------------ | -------------------------------------------- |
|
|
29
29
|
| `zen check` | the CLI | everything decidable about the configuration |
|
|
30
30
|
| `paths` | `zen-review/scripts/check-paths.sh` | paths a running agent cannot open - §2.5 |
|
|
31
|
-
| `memory` | `zen-memory/scripts/check-instructions.sh` | the house-rules copy, byte for byte - §5.3 |
|
|
32
31
|
| `spec-sync` | `zen-spec-sync/scripts/snapshot.sh status` | whether the record of the last pass is sound |
|
|
33
32
|
|
|
34
33
|
Every step runs even when an earlier one fails, because a review that stops at
|
|
35
|
-
the first problem is one somebody has to run
|
|
34
|
+
the first problem is one somebody has to run three times. The exit code is `1` if
|
|
36
35
|
any step wants attention and `0` if none does. `review.sh fast` passes
|
|
37
36
|
`--no-models --no-sandbox` to `zen check`, which is the right call while
|
|
38
37
|
iterating and the wrong one before committing - a key that authenticates says
|
|
@@ -41,7 +40,7 @@ nothing about the model id it is spent on.
|
|
|
41
40
|
Nothing below matters while `zen check` fails. Report what it said and fix that
|
|
42
41
|
first.
|
|
43
42
|
|
|
44
|
-
## The
|
|
43
|
+
## The script this skill ships
|
|
45
44
|
|
|
46
45
|
### `check-paths.sh` - the §2.5 sweep
|
|
47
46
|
|
|
@@ -60,9 +59,8 @@ It exits `1` whenever it prints a candidate, because the list is meant to be
|
|
|
60
59
|
emptied or explained rather than skimmed. It strips urls before tokenising, skips
|
|
61
60
|
a handful of English constructions that contain a slash, and leaves the four
|
|
62
61
|
copies `zen` ships (`agents/{files,fork,memory,tools}-instructions.md`) out
|
|
63
|
-
entirely - they are worked examples by design, `zen check` keeps them
|
|
64
|
-
byte-identical (`rules.stale`)
|
|
65
|
-
actually needs.
|
|
62
|
+
entirely - they are worked examples by design, and `zen check` keeps them
|
|
63
|
+
byte-identical (`rules.stale`).
|
|
66
64
|
|
|
67
65
|
Everything it does print is either noise the script has not learned yet or a
|
|
68
66
|
real finding. There is no third case. A candidate that is genuinely noise is a
|
|
@@ -71,29 +69,6 @@ copy sitting in this project.
|
|
|
71
69
|
|
|
72
70
|
`raw` is the sweep with nothing filtered, for when you suspect the filter.
|
|
73
71
|
|
|
74
|
-
### `check-instructions.sh` - the memory house rules
|
|
75
|
-
|
|
76
|
-
Lives in the `zen-memory` skill, because it is about memory and it is read at
|
|
77
|
-
the moment that skill is:
|
|
78
|
-
|
|
79
|
-
```sh
|
|
80
|
-
.github/skills/zen-memory/scripts/check-instructions.sh # the verdict
|
|
81
|
-
.github/skills/zen-memory/scripts/check-instructions.sh diff # and every differing line
|
|
82
|
-
.github/skills/zen-memory/scripts/check-instructions.sh fix # copy the reference over
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
`agents/memory-instructions.md` must be a byte-identical copy of the `zen-memory`
|
|
86
|
-
skill's `references/memory-instructions.md`, and the reference is rewritten by
|
|
87
|
-
every `zen init` and `zen open`, so the copy goes stale without anyone touching
|
|
88
|
-
it. It drifts by **trailing whitespace inside tables**, which is invisible on
|
|
89
|
-
screen - this is the check no one should be asked to make by eye. When the
|
|
90
|
-
difference is whitespace alone the script says so, because that is the usual
|
|
91
|
-
cause and the least believable finding.
|
|
92
|
-
|
|
93
|
-
`fix` is the one-line `cp` and nothing else. Project policy belongs in
|
|
94
|
-
`agents/memory-policy-instructions.md`, which filename order puts directly after
|
|
95
|
-
the copy - see the `zen-memory` skill.
|
|
96
|
-
|
|
97
72
|
## Findings that are not yours to fix in place
|
|
98
73
|
|
|
99
74
|
`zen check` reports `rules.stale`, `files.uninstructed`, `memory.uninstructed`,
|
|
@@ -46,8 +46,7 @@ strip_urls() {
|
|
|
46
46
|
# The four copies `zen` ships (files-, fork-, memory-, tools-instructions.md)
|
|
47
47
|
# are left out on purpose. They are full of worked examples, so they fail this
|
|
48
48
|
# sweep by design, and the project cannot edit them anyway: `zen check` reports
|
|
49
|
-
# any byte that differs as `rules.stale`.
|
|
50
|
-
# .github/skills/zen-memory/scripts/check-instructions.sh
|
|
49
|
+
# any byte that differs as `rules.stale`.
|
|
51
50
|
files() {
|
|
52
51
|
{
|
|
53
52
|
if [ -d agents/prompts ]; then find agents/prompts -type f -name '*.md'; fi
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
#
|
|
3
3
|
# Every check a review can make without judgement, in the order it makes them.
|
|
4
4
|
#
|
|
5
|
-
# review.sh zen check, then paths
|
|
5
|
+
# review.sh zen check, then paths and the spec-sync record
|
|
6
6
|
# review.sh fast the same, with `zen check --no-models --no-sandbox`
|
|
7
7
|
#
|
|
8
8
|
# What it prints is findings. What it cannot see — whether an agent has one job,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
# the rest of /project-review, and the reason that prompt still exists.
|
|
11
11
|
#
|
|
12
12
|
# Every step runs even when an earlier one fails: a review that stops at the
|
|
13
|
-
# first problem is one somebody has to run
|
|
13
|
+
# first problem is one somebody has to run three times. The exit code is 1 if
|
|
14
14
|
# anything wants attention, 0 if nothing does.
|
|
15
15
|
#
|
|
16
16
|
# Run it from anywhere; it finds the project root from its own location.
|
|
@@ -58,7 +58,7 @@ if command -v zen >/dev/null 2>&1; then
|
|
|
58
58
|
verdict 'zen check' "exit $rc — nothing below matters until this passes" 1
|
|
59
59
|
fi
|
|
60
60
|
else
|
|
61
|
-
echo "zen is not on PATH — install it, or run the other
|
|
61
|
+
echo "zen is not on PATH — install it, or run the other two alone"
|
|
62
62
|
verdict 'zen check' 'not run' 1
|
|
63
63
|
fi
|
|
64
64
|
|
|
@@ -71,15 +71,6 @@ else
|
|
|
71
71
|
verdict 'paths' 'candidates to explain or fix' 1
|
|
72
72
|
fi
|
|
73
73
|
|
|
74
|
-
step 'memory'
|
|
75
|
-
"$SKILLS/zen-memory/scripts/check-instructions.sh"
|
|
76
|
-
rc=$?
|
|
77
|
-
if [ "$rc" -eq 0 ]; then
|
|
78
|
-
verdict 'memory' 'ok' 0
|
|
79
|
-
else
|
|
80
|
-
verdict 'memory' 'the house rules are missing or stale' 1
|
|
81
|
-
fi
|
|
82
|
-
|
|
83
74
|
step 'spec-sync'
|
|
84
75
|
if [ -f SPECIFICATION.md ]; then
|
|
85
76
|
# `status` reports a tampered baseline rather than failing on one, so the
|
|
@@ -18,7 +18,7 @@ and no argv length to overflow.
|
|
|
18
18
|
|
|
19
19
|
The container engine is **Podman** (rootless by default).
|
|
20
20
|
|
|
21
|
-
For the CLI subcommands (`zen sandbox status`, `up`, `pull`, `clean`, `disk`)
|
|
21
|
+
For the CLI subcommands (`zen sandbox status`, `top`, `up`, `pull`, `clean`, `disk`)
|
|
22
22
|
and command-line options, see the [zen-cli skill](../zen-cli/SKILL.md) and its
|
|
23
23
|
dedicated reference document [sandbox.md](../zen-cli/references/sandbox.md).
|
|
24
24
|
|
|
@@ -260,6 +260,7 @@ Use the `zen sandbox` commands via terminal to inspect and manage container stat
|
|
|
260
260
|
|
|
261
261
|
```sh
|
|
262
262
|
zen sandbox status # Check podman version, machine status, and active containers
|
|
263
|
+
zen sandbox top --once # Memory and cpu of the machine and every running container
|
|
263
264
|
zen sandbox up # Start VM (macOS) and pull or build the required image
|
|
264
265
|
zen sandbox pull # Re-pull base image or force build of sandbox/Dockerfile
|
|
265
266
|
zen sandbox clean # Force remove all zn-* containers created by this CLI
|
|
@@ -120,10 +120,8 @@ However small the diff:
|
|
|
120
120
|
3. **§9 of the copilot instructions, worked as a checklist**, group by group.
|
|
121
121
|
4. **The capability obligations in §0.1.** For every capability the project has
|
|
122
122
|
turned on, load that capability's skill and re-check what it requires - in
|
|
123
|
-
particular that `
|
|
124
|
-
|
|
125
|
-
`zen open` rewrite the reference, so this drifts without anybody editing the
|
|
126
|
-
project.
|
|
123
|
+
particular that `zen check` reports no `rules.stale`: a newer `zen` ships
|
|
124
|
+
newer house rules, so they drift without anybody editing the project.
|
|
127
125
|
5. **`zen-instructions` is loaded before any house rule is touched.** A pass
|
|
128
126
|
whose scope reaches `agents/*instructions.md` - and input 4 puts it there
|
|
129
127
|
whenever one of them moved - has to know that `tools-instructions.md`,
|