@azure-id/orc 1.9.2 → 2.0.2
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/CHANGELOG.md +321 -0
- package/README-id.md +21 -36
- package/README.md +25 -36
- package/bin/build-agents.js +117 -20
- package/bin/cli.js +725 -29
- package/bin/gotcha-import.js +1081 -0
- package/bin/gotcha.js +1286 -0
- package/bin/graph-query.js +1 -1
- package/bin/graph.js +717 -717
- package/bin/habit.js +1453 -0
- package/bin/mockrun-catalog.js +281 -276
- package/bin/run-undo.js +398 -0
- package/bin/trace-write.js +657 -0
- package/bin/verify-contracts.js +525 -79
- package/bin/verify-package.js +51 -4
- package/bin/webui/api.js +26 -0
- package/bin/webui/app.html +239 -232
- package/bin/webui/css/00-tokens.css +110 -92
- package/bin/webui/css/04-motion.css +87 -0
- package/bin/webui/css/06-responsive.css +203 -178
- package/bin/webui/css/panels/behaviour.css +205 -0
- package/bin/webui/fixtures/behaviour.js +532 -0
- package/bin/webui/fixtures/index.js +34 -0
- package/bin/webui/fixtures/knowledge.js +7 -1
- package/bin/webui/fixtures/stats.js +16 -0
- package/bin/webui/i18n/en/behaviour.json +143 -0
- package/bin/webui/i18n/en/nav.json +25 -24
- package/bin/webui/i18n/en/tour.json +37 -35
- package/bin/webui/i18n/id/behaviour.json +143 -0
- package/bin/webui/i18n/id/nav.json +25 -24
- package/bin/webui/i18n/id/tour.json +37 -35
- package/bin/webui/js/01-i18n.js +155 -154
- package/bin/webui/js/90-tour.js +498 -494
- package/bin/webui/js/91-shortcuts.js +126 -126
- package/bin/webui/js/99-boot.js +121 -118
- package/bin/webui/js/panels/behaviour.js +1022 -0
- package/mock-run/INDEX.md +109 -107
- package/mock-run/gotcha-import.md +118 -0
- package/mock-run/habits.md +129 -0
- package/mock-run/orc-quick.md +6 -1
- package/package.json +1 -1
- package/templates/agents/MODEL-MAPPING.md +7 -7
- package/templates/agents/orc-advisor-opus-5-xhigh.md +1 -7
- package/templates/agents/orc-analyze-mini-opus-5-med.md +1 -6
- package/templates/agents/orc-analyze-mini-sonnet-5-high.md +1 -4
- package/templates/agents/orc-claude-writer-opus-4-8-high.md +48 -53
- package/templates/agents/orc-claude-writer-opus-5-med.md +1 -8
- package/templates/agents/orc-context-combiner-opus-5-high.md +1 -11
- package/templates/agents/orc-executor-haiku-4-5.md +14 -6
- package/templates/agents/orc-executor-opus-4-7-high.md +14 -6
- package/templates/agents/orc-executor-opus-4-7-med.md +14 -6
- package/templates/agents/orc-executor-opus-4-8-high.md +14 -6
- package/templates/agents/orc-executor-opus-5-high.md +14 -6
- package/templates/agents/orc-executor-opus-5-low.md +14 -6
- package/templates/agents/orc-executor-opus-5-med.md +14 -6
- package/templates/agents/orc-executor-sonnet-4-6-high.md +14 -6
- package/templates/agents/orc-executor-sonnet-4-6-med.md +14 -6
- package/templates/agents/orc-executor-sonnet-5-high.md +14 -6
- package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +1 -10
- package/templates/agents/orc-judge-opus-5-xhigh.md +5 -9
- package/templates/agents/orc-learn-writer-opus-5-low.md +1 -7
- package/templates/agents/orc-pattern-codifier-opus-5-med.md +1 -8
- package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +58 -63
- package/templates/agents/orc-planner-mini-opus-5-med.md +1 -4
- package/templates/agents/orc-planner-mini-sonnet-5-high.md +1 -2
- package/templates/agents/orc-planner-opus-5-med.md +1 -4
- package/templates/agents/orc-recon-opus-5-low.md +1 -8
- package/templates/agents/orc-recon-sonnet-4-6-med.md +1 -8
- package/templates/agents/orc-retro-opus-5-med.md +6 -8
- package/templates/agents/orc-retro-sonnet-5-high.md +6 -7
- package/templates/agents/orc-reviewer-opus-5-med.md +52 -16
- package/templates/agents/orc-scout-opus-5-low.md +1 -6
- package/templates/agents/orc-scout-sonnet-4-6-high.md +35 -39
- package/templates/agents/orc-system-analyst-opus-5-high.md +1 -6
- package/templates/agents/orc-test-author-opus-5-med.md +4 -5
- package/templates/agents/orc-trace-writer-haiku-4-5.md +3 -7
- package/templates/agents/orc-verifier-opus-5-med.md +16 -8
- package/templates/agents/orc-wiki-scanner-opus-4-8-high.md +74 -79
- package/templates/agents/orc-wiki-scanner-opus-5-med.md +1 -8
- package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +97 -106
- package/templates/commands/orc-analyze.md +13 -21
- package/templates/commands/orc-fast.md +10 -15
- package/templates/commands/orc-poly.md +12 -21
- package/templates/commands/orc-pr-driver.md +11 -30
- package/templates/commands/orc-pr-setup.md +10 -31
- package/templates/commands/orc-route.md +11 -41
- package/templates/commands/orc-test.md +5 -60
- package/templates/hooks/README.md +34 -0
- package/templates/hooks/orc-session-hook.js +264 -0
- package/templates/hooks/orc-statusline.js +3 -1
- package/templates/skills/_shared/README.md +9 -0
- package/templates/skills/_shared/code-graph.md +47 -55
- package/templates/skills/_shared/config-precedence.md +3 -1
- package/templates/skills/_shared/extra-dispatch.md +73 -88
- package/templates/skills/_shared/gotchas.md +228 -177
- package/templates/skills/_shared/habits.md +101 -0
- package/templates/skills/_shared/lane-contract.md +84 -0
- package/templates/skills/_shared/phases/README.md +142 -83
- package/templates/skills/_shared/phases/analyst-gates.md +10 -21
- package/templates/skills/_shared/phases/execution.md +8 -14
- package/templates/skills/_shared/phases/house-rules.md +27 -32
- package/templates/skills/_shared/phases/intake.md +127 -133
- package/templates/skills/_shared/phases/mock-example.md +46 -56
- package/templates/skills/_shared/phases/plan-handoff.md +91 -97
- package/templates/skills/_shared/phases/planning.md +7 -17
- package/templates/skills/_shared/phases/preflight.md +19 -42
- package/templates/skills/_shared/phases/review.md +23 -27
- package/templates/skills/_shared/phases/rules.md +18 -42
- package/templates/skills/_shared/phases/scoring.md +55 -65
- package/templates/skills/_shared/phases/security-checklist.md +46 -50
- package/templates/skills/_shared/phases/security.md +45 -55
- package/templates/skills/_shared/phases/ship.md +6 -15
- package/templates/skills/_shared/phases/stop-resume.md +2 -5
- package/templates/skills/_shared/phases/summary.md +73 -48
- package/templates/skills/_shared/phases/testgen.md +41 -51
- package/templates/skills/_shared/phases/trace-verbs.md +433 -0
- package/templates/skills/_shared/phases/trace.md +136 -367
- package/templates/skills/_shared/phases/verify.md +62 -70
- package/templates/skills/_shared/phases/wave-grouping.md +128 -133
- package/templates/skills/_shared/phases/wiki-consult.md +10 -6
- package/templates/skills/_shared/read-ladder.md +2 -55
- package/templates/skills/_shared/return-validation.md +17 -70
- package/templates/skills/_shared/review-slice.md +79 -0
- package/templates/skills/_shared/smoke-gate.md +46 -28
- package/templates/skills/context-combiner/SKILL.md +15 -44
- package/templates/skills/orc/SKILL.md +34 -62
- package/templates/skills/orc/references/pattern-gate.md +89 -89
- package/templates/skills/orc/references/phases/intake.md +41 -47
- package/templates/skills/orc/references/phases/integration.md +13 -19
- package/templates/skills/orc/references/preflight-report.md +8 -9
- package/templates/skills/orc/references/ultra-mode.md +8 -6
- package/templates/skills/orc/subskills/orc-execution/SKILL.md +27 -73
- package/templates/skills/orc/subskills/orc-execution/core.md +12 -99
- package/templates/skills/orc/subskills/orc-execution/subagent.md +14 -13
- package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +11 -52
- package/templates/skills/orc/subskills/orc-review-verify/core.md +52 -135
- package/templates/skills/orc/subskills/orc-review-verify/subagent.md +7 -7
- package/templates/skills/orc/subskills/orc-testgen/SKILL.md +11 -22
- package/templates/skills/orc/subskills/orc-testgen/core.md +20 -59
- package/templates/skills/orc/subskills/orc-testgen/subagent.md +7 -7
- package/templates/skills/orc-advisor/SKILL.md +56 -60
- package/templates/skills/orc-analyze/SKILL.md +30 -66
- package/templates/skills/orc-analyze/schemas/report-audit.md +2 -1
- package/templates/skills/orc-analyze/schemas/report-prose.md +2 -1
- package/templates/skills/orc-analyze-mini/SKILL.md +35 -70
- package/templates/skills/orc-diy/README.md +31 -0
- package/templates/skills/orc-diy/SKILL.md +23 -74
- package/templates/skills/orc-diy/references/blocks/pattern.md +18 -18
- package/templates/skills/orc-fast/SKILL.md +44 -72
- package/templates/skills/orc-judge/SKILL.md +77 -82
- package/templates/skills/orc-mini/SKILL.md +61 -109
- package/templates/skills/orc-pattern/SKILL.md +27 -48
- package/templates/skills/orc-poly/SKILL.md +32 -61
- package/templates/skills/orc-pr-driver/SKILL.md +25 -51
- package/templates/skills/orc-pr-driver/references/green-gate.md +113 -105
- package/templates/skills/orc-pr-setup/SKILL.md +20 -45
- package/templates/skills/orc-quick/README.md +43 -2
- package/templates/skills/orc-quick/SKILL.md +76 -107
- package/templates/skills/orc-quick/references/dispatch-gate.md +16 -5
- package/templates/skills/orc-quick/references/gh-mode.md +48 -1
- package/templates/skills/orc-quick/references/look.md +3 -1
- package/templates/skills/orc-retro/SKILL.md +19 -18
- package/templates/skills/orc-retro/examples/retro-mock.md +1 -1
- package/templates/skills/orc-route/SKILL.md +25 -45
- package/templates/skills/orc-test/SKILL.md +16 -37
- package/templates/skills/orc-verify/SKILL.md +14 -32
- package/templates/skills/orc-wait/SKILL.md +156 -163
- package/templates/skills/orc-wiki/references/phases/phase-0.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-1.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-2.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-3.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-3c.md +1 -6
|
@@ -1,367 +1,136 @@
|
|
|
1
|
-
# Phase — Behavior trace (id: `trace`)
|
|
2
|
-
|
|
3
|
-
> **Library file.**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
slug
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
here is a lane some entry point actually opens — keep it that way: this
|
|
138
|
-
list IS the lane vocabulary `orc stats` and `/orc-retro` count against.
|
|
139
|
-
- `slug` — kebab-cased short user context from the intent (`[a-z0-9-]`, ≤32
|
|
140
|
-
chars, filesystem-safe, no trailing hyphen) — same derivation as the
|
|
141
|
-
run-folder slug.
|
|
142
|
-
- `HHMMSS` — so two same-day runs never collide.
|
|
143
|
-
- e.g. `run-orc-cas-multi-exchange-withdrawal-240726-002352.txt`.
|
|
144
|
-
- The name is DATA: `/orc-retro` aggregates per lane straight from it, without
|
|
145
|
-
parsing content.
|
|
146
|
-
- Run pointer: at run start, write `log_dir/.current` containing just the trace
|
|
147
|
-
filename **and `touch the trace file` of that name in the SAME step**. Both, or
|
|
148
|
-
neither — a pointer naming a file that does not exist yet is indistinguishable
|
|
149
|
-
from a dangling one by content alone, and that is what used to split a run
|
|
150
|
-
across two files (a generic bootstrap holding the hook skeleton + a rich file
|
|
151
|
-
holding every narrated line, each looking correct alone). Delete the pointer at
|
|
152
|
-
run end (success or abort). The `orc-trace.js` hook reads it to know which file
|
|
153
|
-
to append to, and since v0.34.2 it also honors a POINTER whose mtime is fresh
|
|
154
|
-
even when the file is not there yet — the two fixes are independent on purpose.
|
|
155
|
-
- **A SUSPENDED lane re-writes its pointer on RESUME.** When a lane hands control
|
|
156
|
-
to another lane and expects it back (`_shared/lane-suspend.md`, `RETURN-TO`),
|
|
157
|
-
the receiving lane DELETES `.current` at its own `FINISH`. So on return the
|
|
158
|
-
suspending lane re-writes `.current` and must `touch the trace file` it names,
|
|
159
|
-
in the SAME step — both, or neither. Otherwise every line it writes after the
|
|
160
|
-
return goes nowhere: the v0.34.2 split-run signature, reached by a different
|
|
161
|
-
road. Two traces for a suspend is CORRECT — two lanes ran, and `orc stats`
|
|
162
|
-
counts two.
|
|
163
|
-
- **Rename repair (deterministic-with-repair, not memory-only).** When no usable
|
|
164
|
-
pointer exists as the first ORC-agent dispatch fires, the hook creates the
|
|
165
|
-
folder + a generic `run-<DDMMYY>-<HHMMSS>.txt` and points at it. The FIRST
|
|
166
|
-
writer dispatch repairs that. **The trigger is a DISK COMPARISON, not a
|
|
167
|
-
remembered state:** repair when `.current` on disk DISAGREES with the packet's
|
|
168
|
-
`run_meta.trace_path` — a rich packet name beside a generic pointer IS the
|
|
169
|
-
clobber signature, every time — regardless of whether the pointer was ever
|
|
170
|
-
missing. (Stated the old way — "if the pointer is missing" — writers correctly
|
|
171
|
-
declined to repair, because that is not the state the hook actually leaves.)
|
|
172
|
-
The repair is a **MOVE** of the `.txt` plus its `.pending.json` / `.jsonl`
|
|
173
|
-
siblings, then a rewrite of `.current` — never a fresh create beside the
|
|
174
|
-
bootstrap file, which splits the run's evidence in two. Non-ORC Tasks never
|
|
175
|
-
trace — the hook only bootstraps for agent names starting with `orc`.
|
|
176
|
-
|
|
177
|
-
## Structured companion (`<trace>.jsonl`)
|
|
178
|
-
|
|
179
|
-
The `.txt` stays the canonical, human-skimmable trace. The writer ALSO appends
|
|
180
|
-
each packet event as one JSON line to `<trace>.jsonl`:
|
|
181
|
-
`{ts, actor, phase, verb, tail, …verb-specific fields}`. `/orc-retro` mines the
|
|
182
|
-
`.jsonl` when present — `SCORE`/`OUTCOME`/`VERIFY` aggregation becomes robust
|
|
183
|
-
without regex over free tail text — and falls back to `.txt` parsing for older
|
|
184
|
-
traces. Hook lines stay `.txt`-only; the two are read together.
|
|
185
|
-
|
|
186
|
-
## Write cadence — append AS THE RUN GOES, never in one batch at the end
|
|
187
|
-
|
|
188
|
-
The trace is a **running record**, not an end-of-run report. Each phase's packet
|
|
189
|
-
goes out AT that phase's close — coupled to the next phase's first dispatch:
|
|
190
|
-
|
|
191
|
-
| Moment | Packet carries |
|
|
192
|
-
|--------|----------------|
|
|
193
|
-
| a phase closes | that phase's events + the decisions behind them |
|
|
194
|
-
| dispatching an agent | the `DISPATCH` line (folded into the closing phase's packet) |
|
|
195
|
-
| a return validates | its `VERIFY` + any subagent-returned marker |
|
|
196
|
-
| a task closes | its `OUTCOME` |
|
|
197
|
-
| review/verify verdict | `FINDING` / `VERDICT` |
|
|
198
|
-
| run end | `FINISH` — dispatched SOLO and returned before `.current` is deleted |
|
|
199
|
-
|
|
200
|
-
**Self-check:** a phase that ends with
|
|
201
|
-
`zero new trace lines is a protocol violation`.
|
|
202
|
-
The failure this prevents is a fully-executed run behind a one-line trace. If a
|
|
203
|
-
phase went by without its packet, dispatch the writer NOW with the events' real
|
|
204
|
-
timestamps rather than skipping them — a late block with true stamps is a late
|
|
205
|
-
record; a block stamped "now" is a FALSE one. Batching everything at `FINISH` is
|
|
206
|
-
the classic failure: by then the run's context is compacted and the detail is gone.
|
|
207
|
-
|
|
208
|
-
## Line format
|
|
209
|
-
|
|
210
|
-
`[DDMMYY HH:MM:SS.mmm] <actor> <VERB> :: <free tail>`
|
|
211
|
-
|
|
212
|
-
Fixed columns → human-skimmable now, column-parseable by a future mining tool.
|
|
213
|
-
Actors: `hook`, `orc` (the default for a packet event with no actor), a role/agent
|
|
214
|
-
short name (`analyst`, `planner`, `reviewer`, `verifier`, `T<n>` for an executor
|
|
215
|
-
task), or `writer` — which means the narration agent speaking for ITSELF (its
|
|
216
|
-
`NOTE` line), never a blanket stamp on events it was handed. **The actor is
|
|
217
|
-
per-EVENT.** The writer copies `events[].actor` into both the `.txt` column and
|
|
218
|
-
the `.jsonl` `actor` field, so the pair can never disagree about the same event
|
|
219
|
-
(they did, and retro reads the `.jsonl` first).
|
|
220
|
-
|
|
221
|
-
## Verb set (CLOSED — never invent new verbs)
|
|
222
|
-
|
|
223
|
-
"Emitted by" now reads **orc → writer** for the narrated verbs: the orchestrator
|
|
224
|
-
supplies the fact in a packet, the writer writes the line. `SPAWN`, `RETURN` and
|
|
225
|
-
`PHASE-EDGE` stay hook-owned and need no cooperation at all.
|
|
226
|
-
|
|
227
|
-
| Verb | Emitted by | Meaning |
|
|
228
|
-
|------|-----------|---------|
|
|
229
|
-
| `PHASE <name> start\|end` | orc → writer | phase transition |
|
|
230
|
-
| `PHASE-EDGE <role-family> :: first=<agent>` | hook | **deterministic phase inference.** ORC agent names encode their role, so when a SPAWN's role family differs from the previous SPAWN's, the hook segments the run itself — families: `recon → recon` (v1.9.0 — /orc-quick's read-only half; a question answered for a person is not an analysis), `analyst\|scout → analysis`, `planner → planning`, `executor → execution`, `reviewer → review`, `verifier → verify`, `test-author → testgen`, `advisor\|judge → ultra-gate` (the trace writer never opens an edge). Zero model dependence: even a run where every writer dispatch was forgotten still reads planning → execution → review → verify, and `/orc-retro` computes NARRATION COVERAGE from edges with vs without a writer `SPAWN` between them |
|
|
231
|
-
| `CONFIG <key=value …>` | orc → writer | Phase 1 — the resolved config values this run will consume (ALWAYS `opus5_only` — it selects the executor table AND every fixed role, so retro can segment outcomes by dispatch mode). Runtime proof that the run honored the config; `/orc-retro` audits it against behavior |
|
|
232
|
-
| `WIKI-CONSULT <tier> :: docs=<list>` | orc → writer | project wiki consulted for grounding (full/mini at planning; fast at slice-build) — tier ∈ `fresh` \| `aging` \| `stale` \| `absent` \| `empty`; `docs=` the pages pulled/handed to the executor (comma list) or `none`. Records whether the run grounded in the wiki and whether it was stale (surfaces grounding + staleness for later audit) |
|
|
233
|
-
| `CROSSLINK <state> :: boundaries=<n> peers=<names>` | orc → writer | cross-repo peer-knowledge state at the consult point — state ∈ `cached` (peer cache present) \| `configured-no-cache` (crosslink configured but the cache is not built) \| `none`. Per-task `CROSSLINK inject task=<id> :: <boundary>` when a slice receives a linked contract. Records whether peer contracts were injected this run (full orc consumes only the pre-built crosslink cache — it never reads peer source live; mechanism in `wiki-consult.md`) |
|
|
234
|
-
| `GRAPH-CONSULT <state> :: files=<n> symbols=<n>[ density=<n>[ thin=1]]` | orc → writer | the code graph's preflight state (`code-graph.md` §4) — state ∈ `fresh` \| `updated` \| `built` \| `drifted` \| `none` \| `off`. Copied VERBATIM from the `trace` field of `orc graph status --heal --json --brief`; `density=` is the named symbols per file and `thin=1` means most files hold none, so most questions asked of the graph will not find one (v1.9.1); a `GATE` line that describes the graph in other words does not replace it. Plus `GRAPH-CONSULT card task=<id> :: targets=<…>` (the `trace` of `orc graph ctx --json`, with `task=` added) when a slice receives cards |
|
|
235
|
-
| `GRAPH-UPDATE <state> :: parsed=<n> reused=<n> deleted=<n> gen=<n> route=<n> ms=<n>` | orc → writer | one graph update at a wave close, a green smoke gate, a code-writing `/orc-quick` request, or ship — the `trace` field of `orc graph update --json`, verbatim. The graph HOOK writes its own `GRAPH-UPDATE … :: by=hook …` lines directly; never copy one of those, it is already in the file |
|
|
236
|
-
| `GRAPH-MAP <repo|focused> :: files=<shown>/<total> [focus=<a,b>] gen=<n>` | orc → writer | ONE line at the START of planning (and at a `/orc-quick` Q1 look that had no file to name) — the `trace` field of `orc graph map --json`, verbatim. `files=` is how many the budget SHOWED over how many the repository has, so a short map can be told from a small repository. `focused` means `--focus` re-ranked the repository around what the request named. RANK is a hint about where to look first and the trace never says more than that |
|
|
237
|
-
| `GRAPH-CHANGES <found\|none> :: symbols=<n> high=<n> medium=<n> low=<n> gen=<n>` | orc → writer | one line at review — the `trace` field of `orc graph changes --json`, verbatim. `high` counts symbols that are exported, have three or more callers and NO test reaching them |
|
|
238
|
-
| `GRAPH-COMPLEXITY <mini-ok\|recommend-orc> :: files=<n> callers=<n> caller_files=<n> maybe=<n> tests=<n> risk=<n> cochange=<n> gen=<n>` | orc → writer | one line per `/orc-mini` run — the `trace` field of `orc graph impact … --complexity --json`, verbatim. The CLI computes the verdict from the four thresholds in `bin/graph-signals.js`; `maybe` is reported and never trips one. Mini's own `GATE complexity :: <the line>` is separate: it records what the USER chose after the offer |
|
|
239
|
-
| `GRAPH-COCHANGE <found\|none> :: rows=<n> commits=<n>` | orc → writer | one line per planning batch, not per file — the `trace` field of `orc graph cochange --json` for the file that produced the widest answer |
|
|
240
|
-
| `GRAPH-HINT injected=<n> subagent_start=<n> read_notes=<n> updates=<n>` | orc → writer | ONE line per phase close, not one per hint — the counters `orc-graph-hook.js` keeps in `<log_dir>/<run>.graph-hook.json`. Omitted when the file does not exist (the hook is off, or it never had anything to say) |
|
|
241
|
-
| `GRAPH-GAIN paid=<n> low=<n> high=<n> calls=<n>` | orc → writer | ONE line per run, at ship — the `trace` field of `orc graph gain --run <trace name> --json`, verbatim. `paid` is exact (the tokens the graph put in); `low`/`high` are an ESTIMATE of the retrieval it kept out, and they are never collapsed into one number. Omitted when the ledger is empty or the graph is off |
|
|
242
|
-
| `GRAPH-NOTES <applied\|below-min\|none\|deferred\|off\|skipped> :: <detail>` | orc → writer | one notes batch: the noter's ONE-line return copied verbatim (`applied`), the `trace` field of `orc graph notes pending --json` when it exited 3 or 5, `skipped` under the Opus-5-only mode |
|
|
243
|
-
| `SPAWN <agent>` | hook | an agent dispatch was observed (skeleton) |
|
|
244
|
-
| `RETURN <agent> :: <desc> dur=<m>m<s>s [model=<id>]` | hook | a subagent finished (skeleton). The hook attributes the RETURN to the finishing agent from the SubagentStop payload (`~<agent>` = approximate FIFO match on older Claude Code that omits `agent_type`; `~agent :: unattributed` = ≥2 agents in flight, so it deliberately claimed NO pending record rather than starve the right one), echoes the SPAWN's desc + wall-clock duration, and appends `model=<id>` when the return's `actual_model` is visible in the last message. A duplicate stop for an agent whose record was already consumed is DROPPED, never written as a desc-less RETURN. Still hook-written skeleton — NOT an orchestrator obligation; the authoritative model check is the `VERIFY` line |
|
|
245
|
-
| `DISPATCH <agent> :: <task> expect=<model>/<effort>` | orc → writer | orchestrator dispatched a named agent (the claim). **A FOREIGN dispatch appends `via=extra:<profile>`** and its `expect=` names the profile's model rather than a Claude tier — additive, the way `/orc-doc`'s `sections=` was. A foreign worker is not a Claude subagent, so the hook emits NO `SPAWN` and NO `RETURN` for it (P7, the `/orc-quick` ad-hoc-recon precedent): this line and `EXTRA` are the whole record, which is why neither is optional. **The `/orc-doc` lane's tail NAMES ITS SECTIONS** (v0.49.2) — `doc write sections=03-scope,04-risks part=sections/03-scope.md`, `doc check sections=03-goals`, `doc digest source=<path>` — which is the only thing that makes `orc doc cost`'s per-section attribution honest rather than a guess. It is additive: the tail was already captured whole |
|
|
246
|
-
| `SCORE task=<id> score=<n> band=<range> model=<m> facets=<compact-vector> :: <reason>` | orc → writer | scoring decision (tunes the rubric). **A task the resolver sent foreign appends `via=extra:<profile>`**, and `model=` is the foreign model id — so `/orc-retro` can segment a band's outcomes by WHO ran it. `facets=` is the planner-emitted vector (breadth·novelty·logic·test·fan·unc·risk) the score was computed from — `/orc-retro` reads it to recalibrate the formula. Fix-cycle dispatches emit `SCORE task=fix-<n> …` the same way |
|
|
247
|
-
| `VERIFY <task> actual=<model>/<effort> ✅ MATCH` / `⛔ DOWNGRADE expected=<m>/<e>` | orc → writer | claimed-vs-actual model check (the COMPARISON stays the orchestrator's obligation — surface a downgrade to the user, not just the trace) |
|
|
248
|
-
| `QUESTION count=<n> :: <topic>` | subagent→orc → writer | stopped to ask the user |
|
|
249
|
-
| `CONTEXT-GAP :: <what was already known>` | subagent→orc → writer | asked/re-derived something already in context |
|
|
250
|
-
| `REPLAN wave=<n> :: <reason>` | orc → writer | re-planned after a conflict/failure |
|
|
251
|
-
| `GATE <name> pass\|bounce\|escalate :: <detail>` | orc → writer | exit-gate result — name ∈ grounding \| coverage \| graph \| evidence \| derivation \| facet (the plan's facet-vocabulary check, `effort-and-mode.md`) \| schema (the plan-handoff schema check) \| judgment (ultra; `escalate` is judgment-only) \| wave-boundary \| budget (the Phase-1 `run_budget_dispatches` forecast gate — `pass` or the `stop` that blocks wave 1; emitted only when the key is > 0) \| stack-gate (Phase 8 stacked-PR threshold + handoff) \| stack-certainty (a stacked-PR seam decision) \| layer-green (one layer's green-gate ladder). The shared-band SIBLING-CONSISTENCY determination is NOT a gate name — carry it in the packet's `decisions`, never as an invented verb. Bounce detail lists the misses (feeds `/orc-retro` gate-bounce rates) |
|
|
252
|
-
| `ADVISE :: brief=<path> questions=<n>` | orc → writer | ultra Phase U0 — advisor brief received, clarification round relayed |
|
|
253
|
-
| `JUDGE <gate> <verdict> round=<n> blocking=<n> advisory=<n> downgraded=<n>` | orc → writer | ultra judgment verdict (gate ∈ analysis \| plan \| implementation) |
|
|
254
|
-
| `OUTCOME task=<id> score=<n> band=<range> model=<m> retries=<n> requeues=<n> needs_context=<n> unmet=<n>` | orc → writer | task closed — links the scoring band to what it actually took (feeds `/orc-retro` calibration) |
|
|
255
|
-
| `FINDING p0=<n> p1=<n> p2=<n> p3=<n>` | reviewer→orc → writer | review outcome (P0–P3 severity ladder) |
|
|
256
|
-
| `VERDICT pass\|fail :: <detail>` | verifier→orc → writer | verification outcome |
|
|
257
|
-
| `DRIFT loop=<n> :: <user description, compressed>` | orc → writer | mock-example drift-recovery loop opened (`PHASE mock-example`; canonical `_shared/drift-recovery.md`; hard cap 2 loops) |
|
|
258
|
-
| `TDD-RED task=<id> iter=<n> :: <failing tests>` | executor→orc → writer | TDD repair-loop iteration — the plan's acceptance tests still red (cap `tdd_loop_max`; a paired TDD task's red proof also emits iter=0) |
|
|
259
|
-
| `TDD-GREEN task=<id> iter=<n>` | executor→orc → writer | the task's TDD acceptance tests pass (the non-exempt definition-of-done) |
|
|
260
|
-
| `REPRO red\|green :: <cmd> exit=<n>` | executor→orc → writer | a DEFECT task's reproduction, before and after the fix (`_shared/return-validation.md` §5d). TWO lines per reproduced defect, in this order: the `before` run must be RED and the `after` run GREEN, or the return was malformed. `REPRO none :: <reason>` when no reproduction could be written — an honest answer, never a missing line. A reproduction is NOT a plan-time acceptance test, so it never reuses `TDD-RED`/`TDD-GREEN`: `/orc-retro` counts "we proved the bug first" apart from "we drove the plan's acceptance tests" |
|
|
261
|
-
| `NOTE :: <decisions>` | writer | the packet's `decisions` field — the WHY layer (scoring rationale, user answers verbatim, what was rejected). One line per packet, only when `decisions` is non-empty |
|
|
262
|
-
| `STATS lane=<l> slug=<s> dispatches=<n> waves=<n> tasks=<n> bands=<h:n,m:n,l:n> downgrades=<n> duration_ms=<n>` | orc → writer | ONE deterministic summary line per run, in the `FINISH` packet, immediately BEFORE the `FINISH` line. This is what `orc stats` reads — one line per file, never a parse of the whole trace. Omit a field you genuinely do not have (a lane with no waves omits `waves=`); never guess one. Every trace-owning lane emits it, not just `orc` |
|
|
263
|
-
| `PACT <state> :: <ids>` | orc → writer | invariant-ledger state at the Phase-1 probe (`pact_gate`), and `PACT inject task=<id> :: <PACT-id>` when a DRIFTED/BROKEN promise is appended to a task's `constraints[]`. `PACT recheck pass\|fail :: <ids>` at Phase 6. Records whether last month's decisions constrained this month's plan |
|
|
264
|
-
| `BOUNDARY <verdict> task=<id> :: <area>` | orc → writer | per-task boundary verdict (verdict ∈ `EXECUTE` \| `ESCALATE` \| `REFUSE` \| `unknown` — an uncarded area is UNKNOWN, never REFUSE), plus `BOUNDARY lift task=<id> :: <area>` when `boundary_gate: block` removes ONE task from a wave (the wave still runs). `/orc-retro` reads these to answer the question the lane exists for: how much work did we stop attempting, and was that right |
|
|
265
|
-
| `CHALLENGE iter=<n> findings=P0:<n>/P1:<n>/P2:<n> coverage=<n>% verdict=PASS\|FAIL` | orc → writer | one line per completed `/orc-challenge` iteration boundary. **Copy `orc challenge record`'s `trace_line` verbatim** — the CLI assembles it so the lane never composes a second wording for the same number. Plus `CHALLENGE accept :: <id>` and `CHALLENGE rebut :: <id>` when an escape valve is used, and `CHALLENGE regoal\|retemplate :: v<n>` on a re-freeze. `/orc-retro` reads the sequence to answer whether a cycle converged or stalled |
|
|
266
|
-
| `EXTRA <profile>/<model> engine=<api\|claude-shim\|cli> task=<id> band=[lo,hi) tok=in/cw/cr/out outcome=<done\|partial\|failed\|fallback> dur=<m>m<s>s` | orc → writer | one line per FOREIGN dispatch — a slice that executed on a non-Claude worker (`_shared/extra-dispatch.md`). **Copy `orc extra dispatch`'s `trace_line` verbatim** — the CLI assembles it, exactly as `orc challenge record` does, so the lane never composes a second wording for the same numbers. Plus `EXTRA fallback task=<id> :: <reason> → <agent>` when a failed foreign dispatch re-dispatches to Claude (P6), `EXTRA substitution task=<id> :: requested=<m> reported=<m>` / `EXTRA reroute task=<id> :: <providers>` when the endpoint answered with a different model, or the same model served by a different company, and — v0.54.0 — `EXTRA resume task=<id> attempt=<n> :: from=<reason> attribution=<verdict> target=<extra:profile\|agent> files_preexisting=<n>` when a dispatch CONTINUES a position an earlier attempt left on disk, plus `EXTRA orphan task=<id> :: attempt=<n> lease-expired files_changed=<n> state=<state>` when preflight reports a dispatch that never reported back, and — v1.0.0 — `EXTRA demote run=<slug> :: profile=<p> reason=<consecutive-stall\|stale-live-attempt\|manual> n=<k> → <ladder>` when this run DROPS a foreign profile to the bottom of the ladder after two consecutive stalls, a stale live attempt, or `orc extra demote`. **A demotion that leaves no line cannot be counted** either — copy `orc extra demotion`’s `trace_line` VERBATIM and emit it before the next dispatch, beside the mandatory announce line. A demotion is RUN state: it never writes the config and it is never promoted back on its own. **A resume that leaves no line cannot be counted** — neither `orc extra stats` nor `/orc-retro` can then learn whether resuming works, or which providers ignore the resume preamble. `EXTRA resume` rides in the resumed dispatch's own `trace_extras[]`; `EXTRA orphan` is the LANE's to emit after it reports, the same ownership rule as `EXTRA fallback`. **`tok=none` is a real value** and the ONLY correct one when the worker reported no counts (engine `cli` often does not): `tok=0/0/0/0` would tell `/orc-budget` the run was free, while a measured zero — engine `api`'s `cw`, always — is a different fact. **On a lane with no score `band=` carries `slot:<slot>`** (v0.55.0 — `slot:doc-writer`, `slot:wiki-scanner-light`): the field NAME is unchanged, so this parser, the eight-field dedupe and the ` :: ` tolerance are untouched, and `orc extra stats` gives each POSITION its own row for free. This is the verb `/orc-retro` reads to answer the only question that matters: is the cheap model actually cheaper once you count the repairs |
|
|
267
|
-
| `FINISH :: <detail>` | orc → writer | run ended |
|
|
268
|
-
|
|
269
|
-
`SPAWN`/`RETURN`/`PHASE-EDGE` come from the hook automatically. Every other verb
|
|
270
|
-
reaches the file through a packet — you never append lines by hand.
|
|
271
|
-
|
|
272
|
-
### Why `STATS` exists as its own line (v0.42.0)
|
|
273
|
-
|
|
274
|
-
`orc stats` counts usage from these files. Lane and date are free — they are in
|
|
275
|
-
the filename, which is already DATA. Everything else would cost a full parse of
|
|
276
|
-
a 20-minute trace, per run, forever. One deterministic line at a step that
|
|
277
|
-
already exists makes the depth free instead: `orc stats` reads the tail of each
|
|
278
|
-
file and nothing more.
|
|
279
|
-
|
|
280
|
-
Two consequences to keep true, because a counting tool built on a drifting log
|
|
281
|
-
produces confident WRONG numbers, which is worse than no numbers:
|
|
282
|
-
|
|
283
|
-
- **A run with no `FINISH` is counted as unfinished, permanently.** That is
|
|
284
|
-
correct behaviour and it is why `FINISH` is mandatory even on an abort.
|
|
285
|
-
- **A trace older than v0.42.0 has no `STATS` line.** `orc stats` falls back to
|
|
286
|
-
counting `DISPATCH` lines — orchestrator-written and present in every lane
|
|
287
|
-
(including `/orc-quick`, whose ad-hoc recon emits no `SPAWN`/`RETURN`). Old
|
|
288
|
-
traces still count, with less detail. Never back-fill a `STATS` line into an
|
|
289
|
-
old trace: the numbers would be invented, and the trace is append-only.
|
|
290
|
-
|
|
291
|
-
**Skeleton caveat (read every retro metric with it):** the hook only sees a NEW
|
|
292
|
-
dispatch. CONTINUING an already-running agent fires no PreToolUse/SubagentStop
|
|
293
|
-
pair, so a lane driven by continuing one agent produces fewer `SPAWN`/`RETURN`
|
|
294
|
-
lines than it did real work. The skeleton is a FLOOR on dispatch volume, never a
|
|
295
|
-
census — narration coverage computed from it reads low, not wrong.
|
|
296
|
-
|
|
297
|
-
## Model source of truth — the claimed-vs-actual check
|
|
298
|
-
|
|
299
|
-
A hook cannot read a subagent's model id (it lives only in the subagent's system
|
|
300
|
-
prompt). So each dispatched agent returns two fields (see each agent's return
|
|
301
|
-
contract):
|
|
302
|
-
|
|
303
|
-
- `actual_model` — **quoted verbatim** from the agent's injected system-prompt
|
|
304
|
-
model-id line ("The exact model ID is …"). Never a guess; `unknown` if absent.
|
|
305
|
-
- `actual_effort` — the value of `$CLAUDE_EFFORT` (env var, read via Bash).
|
|
306
|
-
|
|
307
|
-
For each spawn the orchestrator:
|
|
308
|
-
1. Derives the **expected** `(model, effort)` from the dispatched agent NAME via
|
|
309
|
-
the `config.md` score→model table / `MODEL-MAPPING.md`.
|
|
310
|
-
2. Compares against the returned `actual_*` and puts a `VERIFY` line in the next
|
|
311
|
-
packet — `✅ MATCH` or `⛔ DOWNGRADE`. A downgrade (the harness capped a high
|
|
312
|
-
pin to the main-session tier) is surfaced to the user, not just logged.
|
|
313
|
-
|
|
314
|
-
## Announce-on-spawn
|
|
315
|
-
|
|
316
|
-
When dispatching, announce the model to the user, derived from the agent NAME
|
|
317
|
-
(e.g. "Spawning orc-executor-opus-5-low → claude-opus-5-5 / low"). Derive it
|
|
318
|
-
from the name — do NOT pass the coarse `sonnet|opus|haiku` dispatch arg, which
|
|
319
|
-
cannot express 4-7 vs 4-8 and would override the frontmatter pin.
|
|
320
|
-
|
|
321
|
-
## Compaction safety
|
|
322
|
-
|
|
323
|
-
The checkpoint carries `logging_enabled` + `trace_path`. On resume, re-read them
|
|
324
|
-
and continue dispatching packets against the same file. The hook backbone keeps
|
|
325
|
-
emitting `SPAWN`/`RETURN`/`PHASE-EDGE` regardless of orchestrator memory, so a
|
|
326
|
-
compacted run is never blind — at worst it loses the WHY layer for one phase.
|
|
327
|
-
`/orc-ultra` is the `orc` skill with `ultra_mode: true`; its packets are just
|
|
328
|
-
orc's plus the U0/judge ones.
|
|
329
|
-
|
|
330
|
-
## Write discipline
|
|
331
|
-
|
|
332
|
-
- Append-only; one whole block per append (never edit prior lines).
|
|
333
|
-
- The trace records behavior faithfully — including the ugly bits (over-asking,
|
|
334
|
-
downgrades, failed waves). That honesty is the whole value.
|
|
335
|
-
|
|
336
|
-
<!-- /orc:layer -->
|
|
337
|
-
|
|
338
|
-
<!-- orc:layer composed -->
|
|
339
|
-
|
|
340
|
-
## Behavior trace (PERMANENT — always on, no flow key)
|
|
341
|
-
|
|
342
|
-
Tracing is NOT composable: every ORC run traces, this one included. Follow
|
|
343
|
-
`.claude/skills/_shared/phases/trace.md` (load it at run start) — this
|
|
344
|
-
block is stitched into every compiled flow so a user-composed pipeline can never
|
|
345
|
-
be the one lane that runs blind.
|
|
346
|
-
|
|
347
|
-
**Run start:** create `log_dir`, write `log_dir/.current` =
|
|
348
|
-
`run-diy-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
|
|
349
|
-
in the SAME step (a pointer naming a file that does not exist reads as dangling —
|
|
350
|
-
the hook rotates away from it and the run splits across two files), then store
|
|
351
|
-
`trace_path` in the checkpoint. The lane token is `diy`, whatever the flow is
|
|
352
|
-
named.
|
|
353
|
-
|
|
354
|
-
**Narration is dispatched, never remembered:** record each event with its REAL
|
|
355
|
-
timestamp into a phase packet (`PHASE`, `DISPATCH`/`VERIFY` per spawn —
|
|
356
|
-
`actual_model`/`actual_effort` vs expected, surface any ⛔ DOWNGRADE to the user
|
|
357
|
-
— `SCORE`, `OUTCOME`, `GATE`, `FINDING`/`VERDICT` for whichever gates this flow
|
|
358
|
-
enabled, `FINISH`, plus `decisions` = the WHY), then dispatch
|
|
359
|
-
`orc-trace-writer-haiku-4-5` with it, PAIRED with the next phase's first
|
|
360
|
-
dispatch. **One packet per ENABLED phase group, minimum 2** — the flow shape is
|
|
361
|
-
composed, so the packet count is too; a phase this flow turned OFF owes nothing.
|
|
362
|
-
A phase ending with `zero new trace lines is a protocol violation`.
|
|
363
|
-
|
|
364
|
-
**Run end:** the `FINISH` packet goes out and RETURNS, then delete
|
|
365
|
-
`log_dir/.current`.
|
|
366
|
-
|
|
367
|
-
<!-- /orc:layer -->
|
|
1
|
+
# Phase — Behavior trace (id: `trace`)
|
|
2
|
+
|
|
3
|
+
> **Library file.** `orc lane phases <lane> --json` → `trace_grammar` gives this lane's verbs. **A verb not in `trace_grammar` → read `trace-verbs.md`** (the CLOSED set, on demand). Never invent a verb.
|
|
4
|
+
|
|
5
|
+
<!-- orc:layer core -->
|
|
6
|
+
|
|
7
|
+
**Behavior-trace logging is PERMANENT (always on) — there is no config toggle.**
|
|
8
|
+
Every ORC run traces, to a **persistent** file that is NOT the decision log. The
|
|
9
|
+
`orc-trace.js` hook bootstraps `log_dir` + the run pointer on the first ORC-agent
|
|
10
|
+
dispatch and writes the `SPAWN`/`RETURN`/`PHASE-EDGE` skeleton itself. Only
|
|
11
|
+
`log_dir` (default `.claude/orc/logs`) is configurable.
|
|
12
|
+
|
|
13
|
+
## Narration is WRITTEN BY THE CLI, not remembered (v2.0.0 — the core rule)
|
|
14
|
+
|
|
15
|
+
> **Phase close = pipe the phase packet to `orc trace write --packet -`.**
|
|
16
|
+
> Exit ≠ 0 → dispatch `orc-trace-writer-haiku-4-5` with the SAME packet.
|
|
17
|
+
|
|
18
|
+
You supply the facts; the CLI holds the pen. You never append lines by hand.
|
|
19
|
+
|
|
20
|
+
- **Pairing rule.** The write for phase N goes **in the same tool block as
|
|
21
|
+
phase N+1's first dispatch**. A phase with no next dispatch (FINISH, an
|
|
22
|
+
abort, a pure-question phase) writes SOLO, before its user-facing output.
|
|
23
|
+
- **First write is solo** — before the planner/analyst goes out. It carries
|
|
24
|
+
`run_meta`.
|
|
25
|
+
- **Last write (run end).** The FINISH packet is written BEFORE you delete
|
|
26
|
+
`.current`. It carries ONE `STATS` line immediately BEFORE `FINISH`.
|
|
27
|
+
|
|
28
|
+
### Phase packet (the command's stdin — small, plain YAML or JSON)
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
phase: execution wave 2
|
|
32
|
+
run_meta: # FIRST packet of the run ONLY; omit thereafter
|
|
33
|
+
lane: orc # orc | ultra | mini | fast | diy | wiki | analyze |
|
|
34
|
+
# plan | claude | poly | learn | verify | pattern |
|
|
35
|
+
# prsetup | prdriver | quick | grill | route |
|
|
36
|
+
# brainstorm | pact | boundary | handoff | budget |
|
|
37
|
+
# aftermath | export | challenge | doc | test
|
|
38
|
+
slug: cas-multi-exchange-withdrawal
|
|
39
|
+
trace_path: .claude/orc/logs/run-orc-cas-multi-exchange-withdrawal-240726-002352.txt
|
|
40
|
+
events: # each {ts, verb, tail}; verb = the WHOLE head (`GATE grounding pass`), tail = detail only
|
|
41
|
+
- {ts: "240726 00:30:39.881", verb: "VERIFY T2", tail: "actual=claude-sonnet-4-6/high ✅ MATCH"}
|
|
42
|
+
decisions: > # free text — the WHY layer
|
|
43
|
+
User answered "no new deps" verbatim; rejected the adapter split.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- Build it from the phase's **actual working state as the phase closes**, never
|
|
47
|
+
from memory later. `ts` is each event's REAL time. An absent field is omitted.
|
|
48
|
+
- Subagent-returned markers (`QUESTION`, `FINDING`, `VERDICT`, a return's
|
|
49
|
+
`actual_model`) are folded into the NEXT packet, never written directly.
|
|
50
|
+
|
|
51
|
+
### How many packets per lane (three tiers — EVERY trace-owning lane narrates)
|
|
52
|
+
|
|
53
|
+
| Tier | Lanes | Packets |
|
|
54
|
+
|------|-------|---------|
|
|
55
|
+
| Build lanes | `orc` (incl. ultra), `orc-mini`, `orc-fast` | per phase — full orc ≈ 7–9 (ultra adds U0 + judge packets); orc-mini batches to 3, orc-fast to 2 |
|
|
56
|
+
| Multi-dispatch | `orc-wiki`, `orc-pr-driver` | one per scan-batch (wiki) or LAYER (pr-driver) boundary + the end-of-run packet |
|
|
57
|
+
| Composed | `orc-diy` | one per ENABLED phase group, **minimum 2** |
|
|
58
|
+
| Iterative | `orc-quick`, `orc-challenge`, `orc-doc`, `orc-test` | **one per completed unit** (entry · iteration · wave · cycle — each spine names its unit) + the end-of-run `FINISH` packet. Several trace files for one cycle is CORRECT |
|
|
59
|
+
| Single-dispatch | `orc-claude`, `orc-plan`, `orc-analyze`, `orc-analyze-mini`, `orc-pattern`, `orc-verify`, `orc-learn`, `orc-poly`, `orc-pr-setup`, `orc-grill`, `orc-route`, `orc-brainstorm`, `orc-pact`, `orc-boundary`, `orc-handoff`, `orc-budget`, `orc-aftermath`, `orc-export` | **exactly ONE mandatory end-of-run packet** |
|
|
60
|
+
|
|
61
|
+
**The single-packet obligation is defined HERE, once.** That packet goes out
|
|
62
|
+
SOLO after the main return validates and BEFORE `.current` is deleted, with
|
|
63
|
+
`run_meta` plus the whole event list (intake decisions, the user's answers,
|
|
64
|
+
`DISPATCH`/`VERIFY`, gate/verdict lines, `FINISH`). `context-combiner` is a
|
|
65
|
+
PHASE of the analyze run, not a lane. `/orc-retro` writes no trace.
|
|
66
|
+
|
|
67
|
+
## Files & lifecycle
|
|
68
|
+
|
|
69
|
+
- `log_dir` is **never deleted**. One append-only file per run:
|
|
70
|
+
**`run-<lane>-<slug>-<DDMMYY>-<HHMMSS>.txt`** — `lane` from the enum above,
|
|
71
|
+
`slug` `[a-z0-9-]`, ≤32 chars, no trailing hyphen.
|
|
72
|
+
- Run pointer: at run start, write `log_dir/.current` containing just the trace
|
|
73
|
+
filename **and `touch the trace file` of that name in the SAME step**. Both, or
|
|
74
|
+
neither — a pointer to a missing file reads as dangling and splits the run.
|
|
75
|
+
A lane that writes code also runs `orc run snapshot --run <run-slug>` in that
|
|
76
|
+
step (what `orc undo` goes back to). Delete the pointer at run end (success or abort).
|
|
77
|
+
- **A SUSPENDED lane re-writes its pointer on RESUME** (`_shared/lane-suspend.md`,
|
|
78
|
+
`RETURN-TO`): the receiving lane deletes `.current` at its `FINISH`, so the
|
|
79
|
+
suspending lane re-writes `.current` and must `touch the trace file` it names,
|
|
80
|
+
in the SAME step.
|
|
81
|
+
|
|
82
|
+
## Write cadence — append AS THE RUN GOES, never in one batch at the end
|
|
83
|
+
|
|
84
|
+
Each phase's packet goes out AT that phase's close, with that phase's events
|
|
85
|
+
and the decisions behind them.
|
|
86
|
+
|
|
87
|
+
**Self-check:** a phase that ends with
|
|
88
|
+
`zero new trace lines is a protocol violation`.
|
|
89
|
+
If a phase went by without its packet, write it NOW with the events'
|
|
90
|
+
real timestamps — a block stamped "now" is a FALSE record. Never batch
|
|
91
|
+
everything at `FINISH`. **A run with no `FINISH` counts as unfinished,
|
|
92
|
+
permanently** — `FINISH` is mandatory even on an abort.
|
|
93
|
+
|
|
94
|
+
## Model check, announce, compaction
|
|
95
|
+
|
|
96
|
+
- **Claimed vs actual.** Compare each return's `actual_model` / `actual_effort`
|
|
97
|
+
with the pair the agent NAME implies; put a `VERIFY` line in the next packet
|
|
98
|
+
and surface a ⛔ DOWNGRADE to the user in chat.
|
|
99
|
+
- **Announce-on-spawn** from the agent NAME ("Spawning orc-executor-opus-5-low →
|
|
100
|
+
claude-opus-5-5 / low"); never pass the coarse `sonnet|opus|haiku` arg.
|
|
101
|
+
- **Compaction.** The checkpoint carries `logging_enabled` + `trace_path`; on
|
|
102
|
+
resume, keep writing to the same file. `/orc-ultra` = `orc` + `ultra_mode: true`.
|
|
103
|
+
- Append-only, one whole block per append. Record the ugly bits too.
|
|
104
|
+
|
|
105
|
+
<!-- /orc:layer -->
|
|
106
|
+
|
|
107
|
+
<!-- orc:layer composed -->
|
|
108
|
+
|
|
109
|
+
## Behavior trace (PERMANENT — always on, no flow key)
|
|
110
|
+
|
|
111
|
+
Tracing is NOT composable: every ORC run traces, this one included. Follow
|
|
112
|
+
`.claude/skills/_shared/phases/trace.md` (load it at run start) — this
|
|
113
|
+
block is stitched into every compiled flow so a user-composed pipeline can never
|
|
114
|
+
be the one lane that runs blind.
|
|
115
|
+
|
|
116
|
+
**Run start:** create `log_dir`, write `log_dir/.current` =
|
|
117
|
+
`run-diy-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
|
|
118
|
+
in the SAME step (a pointer naming a file that does not exist reads as dangling —
|
|
119
|
+
the hook rotates away from it and the run splits across two files), then store
|
|
120
|
+
`trace_path` in the checkpoint and run `orc run snapshot --run <run-slug>`. The lane token is `diy`, whatever the flow is
|
|
121
|
+
named.
|
|
122
|
+
|
|
123
|
+
**Narration is written by the CLI, never remembered:** record each event with
|
|
124
|
+
its REAL timestamp into a phase packet (`PHASE`, `DISPATCH`/`VERIFY` per spawn —
|
|
125
|
+
`actual_model`/`actual_effort` vs expected, surface any ⛔ DOWNGRADE to the user
|
|
126
|
+
— `SCORE`, `OUTCOME`, `GATE`, `FINDING`/`VERDICT` for whichever gates this flow
|
|
127
|
+
enabled, `FINISH`, plus `decisions` = the WHY), then pipe it to
|
|
128
|
+
`orc trace write --packet -` (exit ≠ 0 → `orc-trace-writer-haiku-4-5`), PAIRED
|
|
129
|
+
with the next phase's first dispatch. **One packet per ENABLED phase group, minimum 2** — the flow shape is
|
|
130
|
+
composed, so the packet count is too; a phase this flow turned OFF owes nothing.
|
|
131
|
+
A phase ending with `zero new trace lines is a protocol violation`.
|
|
132
|
+
|
|
133
|
+
**Run end:** write the `FINISH` packet, then delete
|
|
134
|
+
`log_dir/.current`.
|
|
135
|
+
|
|
136
|
+
<!-- /orc:layer -->
|