@zenera/cli 1.1.23 → 1.1.25
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 +88 -2
- package/dist/ask.d.ts +51 -0
- package/dist/ask.js +166 -0
- package/dist/banner.js +2 -2
- package/dist/batch.d.ts +83 -0
- package/dist/batch.js +413 -0
- package/dist/catalog.d.ts +11 -1
- package/dist/catalog.js +80 -7
- package/dist/command.d.ts +6 -0
- package/dist/commands/inspect.d.ts +57 -0
- package/dist/commands/inspect.js +539 -91
- package/dist/commands/list.js +128 -19
- package/dist/commands/memory.js +461 -32
- package/dist/commands/meta.js +311 -21
- package/dist/commands/models.js +110 -14
- package/dist/commands/open.js +4 -4
- package/dist/commands/run.js +175 -36
- package/dist/commands/sandbox.js +148 -15
- package/dist/engine.d.ts +24 -0
- package/dist/engine.js +61 -8
- package/dist/eventlog.d.ts +59 -0
- package/dist/eventlog.js +146 -0
- package/dist/liveness.d.ts +7 -0
- package/dist/liveness.js +20 -3
- package/dist/main.js +5 -2
- package/dist/meta/editor.d.ts +9 -0
- package/dist/meta/editor.js +60 -0
- package/dist/meta/finetune/children.d.ts +8 -0
- package/dist/meta/finetune/children.js +76 -0
- package/dist/meta/finetune/command.d.ts +30 -0
- package/dist/meta/finetune/command.js +338 -0
- package/dist/meta/finetune/dataset/anchors.d.ts +41 -0
- package/dist/meta/finetune/dataset/anchors.js +239 -0
- package/dist/meta/finetune/dataset/changes.d.ts +36 -0
- package/dist/meta/finetune/dataset/changes.js +319 -0
- package/dist/meta/finetune/dataset/command.d.ts +17 -0
- package/dist/meta/finetune/dataset/command.js +1011 -0
- package/dist/meta/finetune/dataset/drift.d.ts +33 -0
- package/dist/meta/finetune/dataset/drift.js +71 -0
- package/dist/meta/finetune/dataset/export.d.ts +26 -0
- package/dist/meta/finetune/dataset/export.js +51 -0
- package/dist/meta/finetune/dataset/index.d.ts +2 -0
- package/dist/meta/finetune/dataset/index.js +2 -0
- package/dist/meta/finetune/dataset/sample.d.ts +50 -0
- package/dist/meta/finetune/dataset/sample.js +197 -0
- package/dist/meta/finetune/dataset/schema.d.ts +33 -0
- package/dist/meta/finetune/dataset/schema.js +216 -0
- package/dist/meta/finetune/dataset/store.d.ts +35 -0
- package/dist/meta/finetune/dataset/store.js +177 -0
- package/dist/meta/finetune/dataset/types.d.ts +125 -0
- package/dist/meta/finetune/dataset/types.js +39 -0
- package/dist/meta/finetune/failure.d.ts +15 -0
- package/dist/meta/finetune/failure.js +26 -0
- package/dist/meta/finetune/feedback.d.ts +45 -0
- package/dist/meta/finetune/feedback.js +85 -0
- package/dist/meta/finetune/improvements.d.ts +51 -0
- package/dist/meta/finetune/improvements.js +244 -0
- package/dist/meta/finetune/index.d.ts +2 -0
- package/dist/meta/finetune/index.js +2 -0
- package/dist/meta/finetune/journal.d.ts +35 -0
- package/dist/meta/finetune/journal.js +135 -0
- package/dist/meta/finetune/live.d.ts +74 -0
- package/dist/meta/finetune/live.js +226 -0
- package/dist/meta/finetune/loop.d.ts +3 -0
- package/dist/meta/finetune/loop.js +114 -0
- package/dist/meta/finetune/memories.d.ts +47 -0
- package/dist/meta/finetune/memories.js +154 -0
- package/dist/meta/finetune/report.d.ts +33 -0
- package/dist/meta/finetune/report.js +1284 -0
- package/dist/meta/finetune/retry.d.ts +24 -0
- package/dist/meta/finetune/retry.js +96 -0
- package/dist/meta/finetune/sampler.d.ts +18 -0
- package/dist/meta/finetune/sampler.js +41 -0
- package/dist/meta/finetune/system.d.ts +27 -0
- package/dist/meta/finetune/system.js +132 -0
- package/dist/meta/finetune/train.d.ts +39 -0
- package/dist/meta/finetune/train.js +391 -0
- package/dist/meta/finetune/tui.d.ts +16 -0
- package/dist/meta/finetune/tui.js +291 -0
- package/dist/meta/finetune/tuning.d.ts +167 -0
- package/dist/meta/finetune/tuning.js +289 -0
- package/dist/meta/finetune/usage.d.ts +62 -0
- package/dist/meta/finetune/usage.js +225 -0
- package/dist/meta/host.d.ts +14 -0
- package/dist/meta/host.js +20 -0
- package/dist/meta/index.d.ts +11 -0
- package/dist/meta/index.js +11 -0
- package/dist/meta/launch.d.ts +81 -0
- package/dist/meta/launch.js +286 -0
- package/dist/meta/model.d.ts +44 -0
- package/dist/meta/model.js +119 -0
- package/dist/meta/prompts.d.ts +18 -0
- package/dist/meta/prompts.js +61 -0
- package/dist/meta/relay.d.ts +20 -0
- package/dist/meta/relay.js +123 -0
- package/dist/meta/tokens.d.ts +52 -0
- package/dist/meta/tokens.js +226 -0
- package/dist/meta/window.d.ts +61 -0
- package/dist/meta/window.js +198 -0
- package/dist/meta/wire.d.ts +42 -0
- package/dist/meta/wire.js +129 -0
- package/dist/modelref.d.ts +16 -0
- package/dist/modelref.js +41 -0
- package/dist/narrate.js +5 -2
- package/dist/podman.d.ts +42 -0
- package/dist/podman.js +198 -5
- package/dist/progress.d.ts +33 -0
- package/dist/progress.js +402 -0
- package/dist/projects.d.ts +0 -5
- package/dist/projects.js +2 -15
- package/dist/request.d.ts +45 -0
- package/dist/request.js +300 -0
- package/dist/sandbox.d.ts +2 -0
- package/dist/sandbox.js +20 -3
- package/dist/scaffold.d.ts +15 -6
- package/dist/scaffold.js +5 -60
- package/dist/session.d.ts +26 -1
- package/dist/session.js +46 -32
- package/dist/term.d.ts +5 -0
- package/dist/term.js +28 -3
- package/dist/trace.d.ts +84 -0
- package/dist/trace.js +737 -0
- package/dist/tui/models.d.ts +33 -0
- package/dist/tui/models.js +389 -0
- package/dist/tui/wrap.d.ts +5 -0
- package/dist/tui/wrap.js +12 -0
- package/dist/usage.d.ts +78 -0
- package/dist/usage.js +51 -0
- package/dist/validate.js +25 -3
- package/package.json +3 -2
- package/templates/editor/.github/copilot-instructions.md +41 -107
- package/templates/editor/.github/prompts/analyze.prompt.md +31 -0
- package/templates/editor/.github/prompts/dataset.prompt.md +108 -0
- package/templates/editor/.github/prompts/finetune-apply.prompt.md +91 -0
- package/templates/editor/.github/prompts/finetune.prompt.md +744 -0
- package/templates/editor/.github/prompts/new-agent.prompt.md +3 -1
- package/templates/editor/.github/prompts/new-skill.prompt.md +2 -0
- package/templates/editor/.github/prompts/project-review.prompt.md +4 -3
- package/templates/editor/.github/skills/zen-analyze-run/SKILL.md +483 -0
- package/templates/editor/.github/skills/zen-cli/SKILL.md +18 -4
- package/templates/editor/.github/skills/zen-cli/references/check.md +7 -5
- package/templates/editor/.github/skills/zen-cli/references/dataset.md +34 -0
- package/templates/editor/.github/skills/zen-cli/references/finetune.md +77 -0
- package/templates/editor/.github/skills/zen-cli/references/inspect.md +300 -21
- package/templates/editor/.github/skills/zen-cli/references/memory.md +121 -28
- package/templates/editor/.github/skills/zen-cli/references/meta.md +61 -0
- package/templates/editor/.github/skills/zen-cli/references/models.md +6 -2
- package/templates/editor/.github/skills/zen-cli/references/projects.md +12 -5
- package/templates/editor/.github/skills/zen-cli/references/rag.md +24 -6
- package/templates/editor/.github/skills/zen-cli/references/run.md +201 -4
- package/templates/editor/.github/skills/zen-cli/references/sandbox.md +10 -1
- package/templates/editor/.github/skills/zen-code-python/SKILL.md +123 -0
- package/templates/editor/.github/skills/zen-code-python/references/code_python.md +48 -0
- package/templates/editor/.github/skills/zen-dataset/SKILL.md +253 -0
- package/templates/editor/.github/skills/zen-finetune/SKILL.md +1791 -0
- package/templates/editor/.github/skills/zen-finetune/references/readme-template.md +268 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/batch.mjs +390 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/difficult.mjs +243 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/memory.mjs +280 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/next.mjs +398 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/report.mjs +797 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/select.mjs +354 -0
- package/templates/editor/.github/skills/zen-finetune/scripts/usage.mjs +722 -0
- package/templates/editor/.github/skills/zen-inspect/SKILL.md +431 -0
- package/templates/editor/.github/skills/zen-inspect-ask/SKILL.md +270 -0
- package/templates/editor/.github/skills/zen-memory/SKILL.md +78 -29
- package/templates/editor/.github/skills/zen-memory-warmup/SKILL.md +363 -531
- package/templates/editor/.github/skills/zen-rag-docs/SKILL.md +20 -8
- package/templates/editor/.github/skills/zen-review/SKILL.md +5 -3
- package/templates/editor/.github/skills/zen-review/scripts/check-paths.sh +5 -4
- package/templates/editor/.github/skills/zen-sandbox/SKILL.md +25 -2
- package/templates/editor/.github/skills/zen-sandbox-capacity/SKILL.md +334 -0
- package/templates/editor/.github/skills/zen-sandbox-capacity/references/loadtest.md +181 -0
- package/templates/editor/.github/skills/zen-sandbox-capacity/scripts/preflight_sandbox.sh +457 -0
- package/templates/editor/.github/skills/zen-topology/SKILL.md +283 -0
- package/templates/editor/.vscode/agents.schema.json +1 -1
- package/templates/editor/.vscode/settings.json +2 -0
- package/templates/project/agents/files-instructions.md +35 -13
- package/templates/project/agents/fork-instructions.md +27 -0
- package/templates/project/agents/memory-instructions.md +106 -34
- package/templates/project/agents/tools-instructions.md +7 -4
- package/templates/project/gitignore +5 -0
- package/dist/meta.d.ts +0 -221
- package/dist/meta.js +0 -684
|
@@ -47,7 +47,11 @@ visible in `agents.yaml` and that `zen check` does not report.** Before
|
|
|
47
47
|
reviewing or changing a project, list the capabilities it has turned on and load
|
|
48
48
|
the editor skill for each one - `zen-memory` for a `memory:` block,
|
|
49
49
|
`zen-sandbox` for sandbox configuration or shell tools, `zen-rag-schema` or
|
|
50
|
-
`zen-rag-docs` for an index, `zen-
|
|
50
|
+
`zen-rag-docs` for an index, `zen-code-python` for an agent that writes or runs
|
|
51
|
+
code, `zen-topology` for `handoffs:` or `fork:` on any agent,
|
|
52
|
+
`zen-sandbox-capacity` before any `zen run batch`
|
|
53
|
+
(except under `zen-finetune`, which sets its own concurrency),
|
|
54
|
+
`zen-cli` always. A capability that is already
|
|
51
55
|
configured and already passing `zen check` is exactly the case that looks
|
|
52
56
|
finished and is not: the obligation lives in the skill, so a review that never
|
|
53
57
|
opens the skill cannot find what is missing. This applies whatever prompted the
|
|
@@ -62,6 +66,14 @@ three those are, where a project's own rules on the same subjects go instead,
|
|
|
62
66
|
how `requires:` conditions a document, and what filename order decides. None of
|
|
63
67
|
that is visible in the file being edited.
|
|
64
68
|
|
|
69
|
+
**Load `zen-code-python` before writing, editing or reviewing any prompt, skill
|
|
70
|
+
or house rule for an agent that writes or runs code** - any agent holding
|
|
71
|
+
`sandbox:*` or `run_command` - and before shipping a script inside a skill.
|
|
72
|
+
Code an agent writes must be a reusable tool, so that memory can keep it and the
|
|
73
|
+
next similar question runs it instead of writing it again. The skill holds the
|
|
74
|
+
coding rules and decides where they go: a section of a dedicated code agent's
|
|
75
|
+
system prompt, or a coding skill for generic agents that sometimes run code.
|
|
76
|
+
|
|
65
77
|
First determine whether the target project uses RAG: a `zen rag` command in an
|
|
66
78
|
agent prompt or skill, RAG tools supplied by its host, or a documentation or
|
|
67
79
|
schema index it is expected to consult all count. When it does, also load the
|
|
@@ -810,7 +822,7 @@ committed shows up as a skill with no files.
|
|
|
810
822
|
### 3.5 Tools
|
|
811
823
|
|
|
812
824
|
A tool is what an agent can _do_ rather than say. `zen run` provides three
|
|
813
|
-
groups - the
|
|
825
|
+
groups - the file tools (§3.6), the sandbox tools (§3.7) and the web tools
|
|
814
826
|
(§3.8) - and `agents.yaml` decides which agent holds which. Nothing else reaches
|
|
815
827
|
the machine, so `tools:` is the whole permission model: an agent that does not
|
|
816
828
|
name a tool cannot use it, whatever its prompt says.
|
|
@@ -846,6 +858,7 @@ them cannot see a file at all.
|
|
|
846
858
|
| `find_files` | Paths containing a substring, case-insensitive |
|
|
847
859
|
| `write_file` | Creates or overwrites a whole file, making parent directories |
|
|
848
860
|
| `apply_patch` | Edits by surrounding context rather than line numbers; several files atomically |
|
|
861
|
+
| `copy_file` | Copies, bytes never touching the context; the source may be a read-only mount |
|
|
849
862
|
| `move_file` | Moves or renames; refuses to clobber without `overwrite` |
|
|
850
863
|
| `delete_file` | Deletes; a directory needs `recursive` |
|
|
851
864
|
|
|
@@ -876,8 +889,8 @@ agents:
|
|
|
876
889
|
tools: [files:*]
|
|
877
890
|
|
|
878
891
|
- name: reviewer
|
|
879
|
-
# Everything except the
|
|
880
|
-
tools: [files:*, -write_file, -apply_patch, -move_file, -delete_file]
|
|
892
|
+
# Everything except the five that can change something.
|
|
893
|
+
tools: [files:*, -write_file, -apply_patch, -copy_file, -move_file, -delete_file]
|
|
881
894
|
```
|
|
882
895
|
|
|
883
896
|
Selectors apply in the order written, so a `-` line reads as an exception to the
|
|
@@ -1428,108 +1441,23 @@ multi-agent instinct suggests.
|
|
|
1428
1441
|
|
|
1429
1442
|
### 6.3 Handoffs
|
|
1430
1443
|
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
- **Every handoff must be returnable.** For every `A → B` there must be a path
|
|
1437
|
-
from `B` back to `A`. Indirect counts - `B → C → A` is a way home - so the
|
|
1438
|
-
rule is that every handoff edge lies on a cycle. `zen check` warns
|
|
1439
|
-
(`handoff.one-way`) on any edge that does not.
|
|
1440
|
-
- Handoff collapses history by policy: the receiving agent sees a selection, not
|
|
1441
|
-
the full transcript. Do not assume it saw a detail three turns back; if it
|
|
1442
|
-
matters, put it in the handoff.
|
|
1443
|
-
|
|
1444
|
-
**Why the return edge is not optional.** A handoff is a one-way door: control
|
|
1445
|
-
moves and stays moved. Nothing hands it back, so an agent reached by a dead-end
|
|
1446
|
-
edge owns the conversation for the rest of the session - the next question,
|
|
1447
|
-
whatever it is about, is answered by the specialist the router sent the user to.
|
|
1448
|
-
The drawn architecture holds for one turn and then quietly stops being the
|
|
1449
|
-
architecture.
|
|
1450
|
-
|
|
1451
|
-
**Forks are the exception, and the alternative.** A branch runs, answers, and
|
|
1452
|
-
control returns to the agent that forked it; the return is the mechanism, not an
|
|
1453
|
-
edge anyone has to declare. So there are two shapes and they are not
|
|
1454
|
-
interchangeable:
|
|
1455
|
-
|
|
1456
|
-
- The other agent should **own the conversation from here** → `handoffs:`, and
|
|
1457
|
-
something on the far side has to lead back.
|
|
1458
|
-
- This agent needs **an answer and then carries on** → `fork:`. Never a handoff:
|
|
1459
|
-
a handoff spends the conversation to get the answer. One branch is enough -
|
|
1460
|
-
a fork of one is exactly "ask the specialist and continue".
|
|
1461
|
-
|
|
1462
|
-
But the return is **condensed**: `A → fork → B` rejoins as one tool result
|
|
1463
|
-
holding B's answer, so A never sees the steps B took - no tool calls, no files
|
|
1464
|
-
read, no intermediate reasoning. That is what makes fanning out cheap, and it is
|
|
1465
|
-
what to design around: whatever A will need must be _in_ the answer, so say so in
|
|
1466
|
-
B's prompt. Work whose value is the trace rather than the conclusion does not
|
|
1467
|
-
survive a fork.
|
|
1444
|
+
`handoffs: [name, ...]` on an agent gives it one `transfer_to_<name>` tool per
|
|
1445
|
+
entry, described by the target's `description:`. Control moves to the target
|
|
1446
|
+
and **stays moved** - the target sees the whole transcript and answers every
|
|
1447
|
+
later turn until it hands off itself - so every edge needs a path back, and
|
|
1448
|
+
`zen check` warns `handoff.one-way` on one that has none.
|
|
1468
1449
|
|
|
1469
1450
|
### 6.4 Forking (fan-out / join)
|
|
1470
1451
|
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
agents:
|
|
1476
|
-
- name: trunk
|
|
1477
|
-
fork: true # unrestricted: any agent, any number of branches
|
|
1478
|
-
|
|
1479
|
-
- name: sweep
|
|
1480
|
-
fork:
|
|
1481
|
-
agents: [prober] # every branch runs the specialist
|
|
1482
|
-
maxBranches: 6
|
|
1483
|
-
```
|
|
1452
|
+
`fork:` on an agent - `true`, or `{ agents, maxBranches }` - gives it the `fork`
|
|
1453
|
+
tool: N branches, run at once, rejoin as one tool result holding each branch's
|
|
1454
|
+
answer. One branch is delegation; several are a fan-out. Without the key the
|
|
1455
|
+
agent cannot split, however obviously parallel the work looks.
|
|
1484
1456
|
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
The **model** decides the split: it names N branches, each with self-contained
|
|
1491
|
-
instructions. They run truly concurrently and rejoin as **one tool call and one
|
|
1492
|
-
tool result** in the parent's history - so N branches cost the parent
|
|
1493
|
-
O(N × summary), not O(N × full history).
|
|
1494
|
-
|
|
1495
|
-
Rules worth knowing before you write the key:
|
|
1496
|
-
|
|
1497
|
-
- `agents:` **may include the forking agent itself** - unlike `handoffs:`, that
|
|
1498
|
-
is not an error, and one role fanned out over ten items is the common shape.
|
|
1499
|
-
The list reaches the model as an `enum`, so a name outside it cannot even be
|
|
1500
|
-
decoded.
|
|
1501
|
-
- A fork of **one** branch is delegation, and it is valid: one assignment run
|
|
1502
|
-
elsewhere, its conclusion returned, its transcript left out of this
|
|
1503
|
-
conversation. Use it when another agent suits the job better, or when the job
|
|
1504
|
-
would fill the caller's context with material it has no use for afterwards.
|
|
1505
|
-
- **Branches cannot talk to each other.** If branch B needs branch A's answer,
|
|
1506
|
-
it is a sequence, not a fork - keep it in one conversation.
|
|
1507
|
-
- Nesting is capped by the run's `maxForkDepth` (2 by default), so a branch may
|
|
1508
|
-
fork again but not without bound.
|
|
1509
|
-
- Fork vs handoff: a handoff is _one_ conversation changing owner; a fork is the
|
|
1510
|
-
_same_ question asked N times at once and merged. **A fork returns; a handoff
|
|
1511
|
-
does not** - which is why a handoff needs a return path (§6.3) and a fork
|
|
1512
|
-
needs nothing.
|
|
1513
|
-
|
|
1514
|
-
Choose `context:` deliberately - the model sets it per call, so say in the
|
|
1515
|
-
agent's prompt which one this work wants:
|
|
1516
|
-
|
|
1517
|
-
- `inherit` - branch gets the full prefix. For work that depends on the case.
|
|
1518
|
-
- `compact` - prefix minus tool calls, tool results and recalls: _what was
|
|
1519
|
-
decided_, not the raw noise. **The default for wide fan-outs.**
|
|
1520
|
-
- `none` - system prompt plus instructions only. Cheapest; for independent
|
|
1521
|
-
lookups.
|
|
1522
|
-
|
|
1523
|
-
Declaring `fork:` only makes the tool available. What a fork costs and what
|
|
1524
|
-
survives the join is in `agents/fork-instructions.md`, which carries
|
|
1525
|
-
`requires: [fork]` and so reaches exactly the agents holding the key. That file
|
|
1526
|
-
is `zen`'s, not yours - `zen check --fix` replaces it, editing it or carrying an
|
|
1527
|
-
older copy is reported as `rules.stale`, and deleting it leaves your forking
|
|
1528
|
-
agents with the tool schema alone (`fork.uninstructed`). What is
|
|
1529
|
-
left to you is _when_, in the terms of this domain - _"When the request covers
|
|
1530
|
-
more than one region, fork one branch per region and merge their findings"_ - or
|
|
1531
|
-
a weaker model will work through the list serially and never call it. Project
|
|
1532
|
-
policy on forking goes in a topic file of your own beside it.
|
|
1457
|
+
**Load `zen-topology` before adding or changing either key, and before writing
|
|
1458
|
+
a prompt line that says when to delegate.** It holds the key reference, hand-off
|
|
1459
|
+
versus fork, which `context` a branch should start from, what each choice costs
|
|
1460
|
+
in tokens, prompt cache and time, and how a recorded run shows each mistake.
|
|
1533
1461
|
|
|
1534
1462
|
### 6.5 Termination
|
|
1535
1463
|
|
|
@@ -1638,7 +1566,9 @@ over one connection.
|
|
|
1638
1566
|
| `includeThoughts` | gemini | Thought summaries; default `true` |
|
|
1639
1567
|
| `routing` / `fallbacks` | openrouter | Upstream provider preferences, and models to fall back to - §7.5 |
|
|
1640
1568
|
|
|
1641
|
-
Knobs that do not apply to the chosen vendor are
|
|
1569
|
+
Knobs that do not apply to the chosen vendor are rejected, not dropped: the
|
|
1570
|
+
schema accepts every one on every model, and building it fails with `does not
|
|
1571
|
+
read "<knob>"`. `zen check` reports the same thing as `model.knob`.
|
|
1642
1572
|
`api:` exists only for the OpenAI protocol - naming it on a Gemini or Anthropic
|
|
1643
1573
|
model is an error.
|
|
1644
1574
|
|
|
@@ -1965,7 +1895,7 @@ Before finishing any change here:
|
|
|
1965
1895
|
- [ ] Each `agents/<topic>-instructions.md` is about one capability, and is true
|
|
1966
1896
|
of every agent it reaches - `requires:` if it is about one of them
|
|
1967
1897
|
- [ ] If any agent has file tools, `agents/files-instructions.md` is present - §3.6
|
|
1968
|
-
- [ ] If any agent has `fork:`, `agents/fork-instructions.md` is present - §
|
|
1898
|
+
- [ ] If any agent has `fork:`, `agents/fork-instructions.md` is present - zen-topology §8
|
|
1969
1899
|
- [ ] No `rules.stale`: the four files that are `zen`'s rather than yours say
|
|
1970
1900
|
what this version of the runtime does, and `zen check --fix` replaces them
|
|
1971
1901
|
- [ ] Any change to an `agents/*instructions.md` was made with the
|
|
@@ -2000,6 +1930,9 @@ candidates; these are the judgements to make about each one)**
|
|
|
2000
1930
|
- [ ] Catalog >~30 entries → `discovery: search`
|
|
2001
1931
|
- [ ] A skill that ships a script writes its `/skills/<name>/...` path, the agent
|
|
2002
1932
|
holds `sandbox:*`, and the sandbox image already has the interpreter
|
|
1933
|
+
- [ ] Every agent that writes or runs code has the `zen-code-python` rules -
|
|
1934
|
+
in its prompt if it is the dedicated code agent, as a skill otherwise -
|
|
1935
|
+
and nothing else restates or softens them - §0.1
|
|
2003
1936
|
- [ ] A skill whose procedure needs particular tools, an index or a mounted file
|
|
2004
1937
|
opens by naming them and says what to do without them - rather than naming
|
|
2005
1938
|
the agents allowed to load it, which `agents.yaml` already decides - §0.1
|
|
@@ -2012,7 +1945,8 @@ candidates; these are the judgements to make about each one)**
|
|
|
2012
1945
|
- [ ] No agent holds `write_file` without `apply_patch`, or `read_file` without
|
|
2013
1946
|
`list_dir` and `find_files`
|
|
2014
1947
|
- [ ] An agent that only reads is not holding `write_file`, `apply_patch`,
|
|
2015
|
-
`move_file` or `delete_file` - subtract them from `files:*`
|
|
1948
|
+
`copy_file`, `move_file` or `delete_file` - subtract them from `files:*`
|
|
1949
|
+
(or `workspace:*`)
|
|
2016
1950
|
- [ ] `sandbox:*` is granted only where a shell is actually needed
|
|
2017
1951
|
- [ ] `sandbox.persist: true`, unless a throwaway rootfs is wanted on purpose
|
|
2018
1952
|
- [ ] The `sandbox:` image carries what the work needs, rather than the prompt
|
|
@@ -2080,10 +2014,10 @@ candidates; these are the judgements to make about each one)**
|
|
|
2080
2014
|
| Answers instead of routing | Router prompt prohibition; check `handoffs:` |
|
|
2081
2015
|
| Routes to the wrong specialist | The target agents' `description:` fields |
|
|
2082
2016
|
| Gets stuck in the agent it routed to | The target needs a handoff back - §6.3 |
|
|
2083
|
-
| Loses a detail after a handoff |
|
|
2017
|
+
| Loses a detail after a handoff | The target sees the whole transcript; its prompt must say to use it |
|
|
2084
2018
|
| Works through N independent items serially | `fork:` on that agent, and a prompt line - §6.4 |
|
|
2085
2019
|
| Forks when the steps actually depend | Prompt line: branches cannot see each other |
|
|
2086
|
-
| Forks a sequence, or loses a branch's working | `agents/fork-instructions.md` is missing or empty - §
|
|
2020
|
+
| Forks a sequence, or loses a branch's working | `agents/fork-instructions.md` is missing or empty - zen-topology §8 |
|
|
2087
2021
|
| Edits files blindly or breaks patches | `agents/files-instructions.md` is missing or empty - §3.6 |
|
|
2088
2022
|
| Slow and expensive on trivial cases | Demote that agent's model tier / reasoning effort |
|
|
2089
2023
|
| Fails only on genuinely hard cases | Promote that agent's tier, or split the hard path out |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze one recorded run of this project - its health, what it wasted, and what to change in the instructions. Name the run (directory or id) after the command, or get the most recent one.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Load the **zen-analyze-run** skill and follow it to analyze one run of this
|
|
6
|
+
project. Everything about how to analyze it is in the skill. If `agents.yaml`
|
|
7
|
+
has a `memory:` key anywhere (`grep -n 'memory:' agents.yaml`), load the
|
|
8
|
+
**zen-memory** skill with it, before you read the run: the memory areas of the
|
|
9
|
+
audit cannot be graded without it.
|
|
10
|
+
|
|
11
|
+
## Which run
|
|
12
|
+
|
|
13
|
+
The last line of this prompt may name the run - a run directory or a run id.
|
|
14
|
+
If it does, use it. Words after it like `case=<id> ... feedback=<file>` mean
|
|
15
|
+
the tuning loop sent you: follow section 7 of the skill and write that file.
|
|
16
|
+
|
|
17
|
+
If it does not, list this project's most recent runs, newest first:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
zen list --runs --json --limit 500 \
|
|
21
|
+
| jq -r --arg p "$PWD/" '[.[] | select(.dir | startswith($p))][:5][]
|
|
22
|
+
| "\(.id) \(.agent // "-") \(.error // .stopReason // "-") \(.dir)"'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- If there are none, stop and say this project has no runs yet.
|
|
26
|
+
- If you can ask the user a question, show that list and ask which run to
|
|
27
|
+
analyze, with the newest as the default.
|
|
28
|
+
- If you cannot ask, take the newest. Say which run you picked, and that it was
|
|
29
|
+
picked as the most recent, at the top of the report.
|
|
30
|
+
|
|
31
|
+
Then give the run to the skill.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Build or refresh this project's dataset - every case read from its sources with a class, complexity, tags, a verbatim rubric and an anchor - re-reading only the sections that changed since the last revision. Name a source after the command to add it, `rebuild` to read everything again, or a case and what to fix.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Keep `dataset/` in step with its sources. **Load the `zen-dataset` skill before
|
|
6
|
+
anything else**, and `zen-cli` for the command reference. The skill holds the
|
|
7
|
+
extraction rules and every verb; this prompt is the order of the work. If
|
|
8
|
+
loading a skill fails, read `.github/skills/<name>/SKILL.md` with your file tool
|
|
9
|
+
before going on.
|
|
10
|
+
|
|
11
|
+
You never run cases, never edit `agents/`, and never edit a source. Only
|
|
12
|
+
`zen meta dataset` writes `dataset/` - never a file tool, never a script.
|
|
13
|
+
|
|
14
|
+
This prompt is **reentrant**: the state on disk says what to do, so running it
|
|
15
|
+
twice in a row does nothing the second time.
|
|
16
|
+
|
|
17
|
+
## 1. Where things stand
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
zen meta dataset status
|
|
21
|
+
zen meta dataset drift
|
|
22
|
+
zen meta dataset ls --note rubric-suspect
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Say in three lines: the revision and case count, the sources, and how many
|
|
26
|
+
sections are `changed`, `gone` or `uncovered`.
|
|
27
|
+
|
|
28
|
+
## 2. What to do
|
|
29
|
+
|
|
30
|
+
The last line of this prompt may hold words. Then read the table top down and
|
|
31
|
+
take the first row that fits:
|
|
32
|
+
|
|
33
|
+
| State | Do |
|
|
34
|
+
| ---------------------------------------- | --------------------------------------------------------------------- |
|
|
35
|
+
| the words name a case and a fix | that fix only, with `update`, `retire` or `reanchor` - then section 6 |
|
|
36
|
+
| the words say `rebuild` | read every source in full, as a whole proposal - section 3 |
|
|
37
|
+
| the words name a source file | read that file in full, add it as a `--partial` proposal - section 3 |
|
|
38
|
+
| no dataset, and no source named anywhere | **stop**: say which training set to name. The only stop |
|
|
39
|
+
| no dataset | read every source `SPECIFICATION.md` points at - section 3 |
|
|
40
|
+
| drift reports anything | read only the drifted sections - section 3 |
|
|
41
|
+
| drift is clean | nothing to do: report the status and stop |
|
|
42
|
+
|
|
43
|
+
Never ask a question mid-run - nobody is there to answer it. What you could not
|
|
44
|
+
decide goes into the report and onto the case as a note.
|
|
45
|
+
|
|
46
|
+
## 3. Read the sections
|
|
47
|
+
|
|
48
|
+
Read each section yourself and write the cases out by the skill's rules: the
|
|
49
|
+
rubric **verbatim**, class from the source's own distinctions, complexity from
|
|
50
|
+
the trajectory the query demands, an anchor on every case, and **the id a case
|
|
51
|
+
already has** when you re-read its section. Write them to
|
|
52
|
+
`.tmp/dataset/proposal.json`.
|
|
53
|
+
|
|
54
|
+
On a refresh, the proposal holds only the cases of the drifted sections, and is
|
|
55
|
+
applied `--partial`. A case whose section changed but which still asks, expects
|
|
56
|
+
and is judged the same goes in unchanged - that is how its drift is settled.
|
|
57
|
+
|
|
58
|
+
## 4. Settle what is gone and what is new
|
|
59
|
+
|
|
60
|
+
Every `gone` and `uncovered` line from step 1 gets an answer, or the next drift
|
|
61
|
+
check reports it again:
|
|
62
|
+
|
|
63
|
+
- **gone** - the section was deleted: `retire <id> --why "…"`. It was renamed
|
|
64
|
+
or moved: `reanchor <id> --heading "…" --why "…"`.
|
|
65
|
+
- **uncovered** - it holds queries: they are new cases in the proposal. It does
|
|
66
|
+
not (an introduction, a glossary): `ignore <file> --heading "…" --why "…"`.
|
|
67
|
+
|
|
68
|
+
## 5. Apply
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
zen meta dataset apply .tmp/dataset/proposal.json [--partial] --dry-run
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Check the dry run against what you meant before writing anything:
|
|
75
|
+
|
|
76
|
+
- nothing `retired` you did not intend - a whole proposal retires every case it
|
|
77
|
+
leaves out
|
|
78
|
+
- no id changed for a case you only re-read
|
|
79
|
+
- every `restarted` case is one whose input, rubric or expected answer really
|
|
80
|
+
changed in the source
|
|
81
|
+
|
|
82
|
+
Then the same command without `--dry-run`, with `--why` naming what changed in
|
|
83
|
+
the source.
|
|
84
|
+
|
|
85
|
+
## 6. Check
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
zen meta dataset drift
|
|
89
|
+
zen meta dataset status
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Drift must be clean. The count per class must match a count you take from the
|
|
93
|
+
source by hand. Every media path must exist - apply refuses one that does not,
|
|
94
|
+
so a refusal here is a path to fix, not a step to skip.
|
|
95
|
+
|
|
96
|
+
## 7. Report
|
|
97
|
+
|
|
98
|
+
- the revision, and what changed: added, updated, retired, restored and
|
|
99
|
+
**restarted** cases, by id
|
|
100
|
+
- cases per class and per complexity, and how many have a rubric
|
|
101
|
+
- what restarted means for whoever runs the cases next: their earlier results
|
|
102
|
+
are about a different question - `zen meta dataset sample --restarted` lists
|
|
103
|
+
them
|
|
104
|
+
- every case with an open `rubric-suspect` note, and what the source would
|
|
105
|
+
need to say
|
|
106
|
+
- what you could not decide, each with the case or section it is about; leave
|
|
107
|
+
each one on its case as well:
|
|
108
|
+
`zen meta dataset note <id> --kind observation -m "…"`
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Apply a batch of improvement requests from the tuning loop to the project's prose - merge them into patterns, edit prompts, skills and policy files, and record what was done with each. Run by `zen meta finetune`; the last line names the apply directory.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The tuning loop has collected improvement requests from several cases and
|
|
6
|
+
wants them applied **together**. The last line of this prompt names the apply
|
|
7
|
+
directory. Load the `zen-instructions` skill before you edit anything under
|
|
8
|
+
`agents/`, `zen-memory` when any request is from a run with memory, and
|
|
9
|
+
`zen-code-python` when any request touches an agent that writes or runs code.
|
|
10
|
+
|
|
11
|
+
## What you are given
|
|
12
|
+
|
|
13
|
+
- `<apply dir>/inputs.json` - the requests: each has `id` (`<case>@<phase>-<attempt>`),
|
|
14
|
+
`case`, `phase` (`nomem` or `mem`), `summary`, `improvements` (each with `id`,
|
|
15
|
+
`kind`, `file`, `change`, `why`, `expect`) and `file`, the feedback it came from.
|
|
16
|
+
The analysis behind each is `analysis.md` beside that file - read it when an
|
|
17
|
+
improvement is unclear.
|
|
18
|
+
- Every earlier `finetune/applies/*/decisions.json` and `changes.md` - what
|
|
19
|
+
was already tried. Do not re-apply a rule an earlier apply added and a later
|
|
20
|
+
run showed did not work; change it instead.
|
|
21
|
+
- `<apply dir>/check.log`, if it exists: your previous attempt left the project
|
|
22
|
+
failing `zen check`, and the edit was undone. Read it first.
|
|
23
|
+
|
|
24
|
+
## What to do
|
|
25
|
+
|
|
26
|
+
1. **Merge before editing.** Group the improvements by the behaviour they fix.
|
|
27
|
+
Several cases asking for the same thing in different words is one rule.
|
|
28
|
+
Two that contradict each other: decide, and say why.
|
|
29
|
+
2. **Generalise.** Every rule must hold for queries no case asked. Never write
|
|
30
|
+
a case's answer, its ids or its data into the prose - if a request only
|
|
31
|
+
makes sense for its one case, reject it.
|
|
32
|
+
3. **Edit** prompts under `agents/prompts/`, skills under `agents/skills/`,
|
|
33
|
+
`agents/instructions.md` and `agents/<topic>-policy-instructions.md`
|
|
34
|
+
(create the policy file when the rule belongs to one capability). Requests
|
|
35
|
+
from runs **with memory** change only the memory policy -
|
|
36
|
+
`agents/memory-policy-instructions.md` - or the memory paragraph a request
|
|
37
|
+
names.
|
|
38
|
+
4. **Never edit** `agents.yaml`, `agents/memory-instructions.md`,
|
|
39
|
+
`agents/tools-instructions.md`, `agents/fork-instructions.md` or
|
|
40
|
+
`agents/files-instructions.md`, nor anything outside `agents/`. A request
|
|
41
|
+
that needs one of those is **structural**: record it, do not apply it.
|
|
42
|
+
5. **Check**: `zen check --no-models --no-sandbox` must pass when you finish.
|
|
43
|
+
|
|
44
|
+
## What to write
|
|
45
|
+
|
|
46
|
+
- `<apply dir>/changes.md` - read by a person deciding whether to trust this
|
|
47
|
+
apply, so leave nothing out. One section per file you touched:
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
## agents/prompts/default.md
|
|
51
|
+
|
|
52
|
+
**Answers:** plan-day@nomem-1 i1, long-list-3@nomem-1 i1 (merged)
|
|
53
|
+
|
|
54
|
+
**The pattern:** what the cases did wrong, in one paragraph, with the node
|
|
55
|
+
ids from their analyses - not a case's answer.
|
|
56
|
+
|
|
57
|
+
**Before:** the sentence or section as it was, quoted (or "new section").
|
|
58
|
+
|
|
59
|
+
**After:** the text as it is now, quoted.
|
|
60
|
+
|
|
61
|
+
**Why it generalises:** which queries beyond these cases it changes, and
|
|
62
|
+
which it must not.
|
|
63
|
+
|
|
64
|
+
**Expect:** what the next run's graph should show if it worked.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Then a section **Not applied**: every rejected or structural improvement, with
|
|
68
|
+
why.
|
|
69
|
+
|
|
70
|
+
- `<apply dir>/decisions.json` - a decision for **every** improvement of every
|
|
71
|
+
request, nothing skipped:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"plan-day@nomem-1": {
|
|
76
|
+
"i1": { "decision": "applied", "note": "agents/prompts/default.md - planning section" },
|
|
77
|
+
"i2": { "decision": "merged", "note": "same rule as long-list-3@nomem-1 i1" }
|
|
78
|
+
},
|
|
79
|
+
"long-list-3@nomem-1": {
|
|
80
|
+
"i1": { "decision": "applied", "note": "agents/pagination-policy-instructions.md" },
|
|
81
|
+
"i2": { "decision": "structural", "note": "needs a tool in agents.yaml" },
|
|
82
|
+
"i3": { "decision": "rejected", "note": "only true for this case's data" }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`decision` is one of `applied`, `merged`, `rejected`, `structural`. The note is
|
|
88
|
+
one line a person reads in the case's FEEDBACK.md.
|
|
89
|
+
|
|
90
|
+
Your answer is a short summary: how many rules, which files, and anything
|
|
91
|
+
structural the user must decide.
|