@azure-id/orc 2.0.2 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/CHANGELOG.md +455 -0
  2. package/README-id.md +52 -23
  3. package/README.md +36 -20
  4. package/bin/build-agents.js +205 -206
  5. package/bin/clear-logs.js +620 -0
  6. package/bin/cli.js +47417 -46420
  7. package/bin/fix.js +459 -0
  8. package/bin/gotcha.js +288 -8
  9. package/bin/habit.js +1538 -1453
  10. package/bin/mockrun-catalog.js +3 -0
  11. package/bin/onboarding-content.js +2 -1
  12. package/bin/pricing.json +28 -21
  13. package/bin/trace-write.js +869 -657
  14. package/bin/verify-contracts.js +5552 -5471
  15. package/bin/verify-package.js +716 -705
  16. package/bin/webui/api.js +125 -6
  17. package/bin/webui/css/panels/hookui.css +79 -0
  18. package/bin/webui/fixtures/behaviour.js +30 -0
  19. package/bin/webui/fixtures/extra.js +2036 -2036
  20. package/bin/webui/fixtures/flow.js +81 -81
  21. package/bin/webui/fixtures/hookui.js +506 -431
  22. package/bin/webui/fixtures/index.js +32 -3
  23. package/bin/webui/fixtures/knowledge.js +2 -2
  24. package/bin/webui/fixtures/maintenance.js +123 -42
  25. package/bin/webui/fixtures/rules.js +1007 -1002
  26. package/bin/webui/fixtures/settings.js +6 -7
  27. package/bin/webui/fixtures/stats.js +9 -6
  28. package/bin/webui/fixtures/wait.js +98 -97
  29. package/bin/webui/i18n/en/behaviour.json +13 -0
  30. package/bin/webui/i18n/en/hookui.json +290 -194
  31. package/bin/webui/i18n/en/maintenance.json +71 -52
  32. package/bin/webui/i18n/en/settings.json +60 -60
  33. package/bin/webui/i18n/id/behaviour.json +13 -0
  34. package/bin/webui/i18n/id/hookui.json +290 -194
  35. package/bin/webui/i18n/id/maintenance.json +71 -52
  36. package/bin/webui/i18n/id/settings.json +60 -60
  37. package/bin/webui/js/05-banners.js +181 -172
  38. package/bin/webui/js/06-edit.js +193 -183
  39. package/bin/webui/js/panels/behaviour.js +77 -12
  40. package/bin/webui/js/panels/hookui.js +2196 -1691
  41. package/bin/webui/js/panels/maintenance.js +336 -235
  42. package/bin/webui/js/panels/settings.js +726 -719
  43. package/mock-run/INDEX.md +1 -0
  44. package/mock-run/a-normal-day.md +2 -2
  45. package/mock-run/extra-slots.md +177 -177
  46. package/mock-run/habits.md +1 -1
  47. package/mock-run/orc-aftermath.md +392 -392
  48. package/mock-run/orc-budget.md +29 -33
  49. package/mock-run/orc-cli.md +200 -200
  50. package/mock-run/orc-explain.md +86 -86
  51. package/mock-run/orc-extra.md +389 -392
  52. package/mock-run/orc-fast.md +2 -2
  53. package/mock-run/orc-fix.md +87 -0
  54. package/mock-run/orc-pattern.md +112 -112
  55. package/mock-run/orc-quick.md +146 -146
  56. package/mock-run/orc.md +4 -4
  57. package/package.json +1 -1
  58. package/templates/agents/MODEL-MAPPING.md +176 -173
  59. package/templates/agents/orc-analyze-mini-sonnet-5-high.md +2 -2
  60. package/templates/agents/{orc-claude-writer-opus-5-med.md → orc-claude-writer-opus-5-low.md} +4 -4
  61. package/templates/agents/orc-executor-haiku-4-5.md +1 -1
  62. package/templates/agents/orc-executor-opus-5-low.md +1 -1
  63. package/templates/agents/orc-executor-sonnet-4-6-high.md +1 -1
  64. package/templates/agents/orc-executor-sonnet-4-6-med.md +1 -1
  65. package/templates/agents/orc-executor-sonnet-5-high.md +2 -2
  66. package/templates/agents/orc-executor-sonnet-5-low.md +155 -0
  67. package/templates/agents/orc-executor-sonnet-5-med.md +155 -0
  68. package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +2 -2
  69. package/templates/agents/orc-planner-mini-sonnet-5-high.md +2 -2
  70. package/templates/agents/{orc-recon-sonnet-4-6-med.md → orc-recon-sonnet-5-med.md} +4 -4
  71. package/templates/agents/orc-retro-sonnet-5-high.md +2 -2
  72. package/templates/agents/{orc-reviewer-opus-5-med.md → orc-reviewer-opus-5-low.md} +4 -4
  73. package/templates/agents/{orc-wiki-scanner-opus-5-med.md → orc-wiki-scanner-opus-5-low.md} +3 -3
  74. package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +2 -2
  75. package/templates/commands/orc-fast.md +10 -10
  76. package/templates/commands/orc-fix.md +18 -0
  77. package/templates/commands/orc-wiki.md +64 -64
  78. package/templates/hooks/README.md +75 -7
  79. package/templates/hooks/orc-session-hook.js +78 -3
  80. package/templates/hooks/orc-statusline-render.js +317 -23
  81. package/templates/hooks/orc-statusline.js +162 -49
  82. package/templates/hooks/orc-subagent-line.js +23 -5
  83. package/templates/hooks/orc-weather-fetch.js +123 -0
  84. package/templates/skills/_shared/extra-dispatch.md +1331 -1331
  85. package/templates/skills/_shared/gotchas.md +27 -7
  86. package/templates/skills/_shared/habits.md +2 -2
  87. package/templates/skills/_shared/opus5-only.md +137 -137
  88. package/templates/skills/_shared/phases/review.md +2 -2
  89. package/templates/skills/_shared/phases/trace-verbs.md +17 -3
  90. package/templates/skills/_shared/phases/trace.md +136 -136
  91. package/templates/skills/_shared/review-slice.md +28 -1
  92. package/templates/skills/_shared/wait.md +1 -0
  93. package/templates/skills/orc/README.md +2 -2
  94. package/templates/skills/orc/SKILL.md +227 -227
  95. package/templates/skills/orc/config.md +25 -27
  96. package/templates/skills/orc/examples/full-run-mock.md +74 -73
  97. package/templates/skills/orc/references/effort-and-mode.md +222 -222
  98. package/templates/skills/orc/references/preflight-report.md +3 -3
  99. package/templates/skills/orc/references/ultra-mode.md +1 -1
  100. package/templates/skills/orc/schemas/checkpoint.md +122 -122
  101. package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +3 -3
  102. package/templates/skills/orc/subskills/orc-review-verify/core.md +1 -1
  103. package/templates/skills/orc-analyze/SKILL.md +4 -2
  104. package/templates/skills/orc-claude/SKILL.md +14 -14
  105. package/templates/skills/orc-claude/examples/claude-run-mock.md +65 -65
  106. package/templates/skills/orc-diy/SKILL.md +5 -5
  107. package/templates/skills/orc-fast/SKILL.md +210 -208
  108. package/templates/skills/orc-fix/SKILL.md +110 -0
  109. package/templates/skills/orc-grill/SKILL.md +232 -232
  110. package/templates/skills/orc-grill/references/grill-doc.md +1 -1
  111. package/templates/skills/orc-mini/SKILL.md +4 -4
  112. package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -2
  113. package/templates/skills/orc-quick/README.md +536 -536
  114. package/templates/skills/orc-quick/SKILL.md +2 -2
  115. package/templates/skills/orc-quick/references/context-doc.md +145 -145
  116. package/templates/skills/orc-quick/references/dispatch-gate.md +220 -219
  117. package/templates/skills/orc-quick/references/gh-mode.md +4 -2
  118. package/templates/skills/orc-retro/SKILL.md +1 -1
  119. package/templates/skills/orc-retro/examples/retro-mock.md +16 -16
  120. package/templates/skills/orc-wiki/README.md +325 -325
  121. package/templates/skills/orc-wiki/SKILL.md +195 -195
  122. package/templates/skills/orc-wiki/examples/wiki-run-mock.md +37 -37
  123. package/templates/skills/orc-wiki/references/extra.md +2 -2
  124. package/templates/skills/orc-wiki/references/partial-refresh.md +276 -271
  125. package/templates/skills/orc-wiki/references/phases/phase-0.md +1 -1
  126. package/templates/skills/orc-wiki/references/phases/phase-2.md +3 -3
  127. package/templates/skills/orc-wiki/references/phases/phase-3c.md +3 -2
  128. package/templates/agents/orc-claude-writer-opus-4-8-high.md +0 -48
  129. package/templates/agents/orc-wiki-scanner-opus-4-8-high.md +0 -74
@@ -1,136 +1,136 @@
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 -->
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` stays until `orc clear logs --apply` or the `log_retention_auto`
70
+ sweep. One append-only file per run:
71
+ **`run-<lane>-<slug>-<DDMMYY>-<HHMMSS>.txt`** — `lane` from the enum above,
72
+ `slug` `[a-z0-9-]`, ≤32 chars, no trailing hyphen.
73
+ - Run pointer: at run start, write `log_dir/.current` containing just the trace
74
+ filename **and `touch the trace file` of that name in the SAME step**. Both, or
75
+ neither — a pointer to a missing file reads as dangling and splits the run.
76
+ A lane that writes code also runs `orc run snapshot --run <run-slug>` in that
77
+ step (what `orc undo` goes back to). Delete the pointer at run end (success or abort).
78
+ - **A SUSPENDED lane re-writes its pointer on RESUME** (`_shared/lane-suspend.md`,
79
+ `RETURN-TO`): the receiving lane deleted `.current`, so re-write it and
80
+ `touch the trace file` it names, 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 -->
@@ -5,7 +5,31 @@
5
5
  > `/orc-quick` review offer, the `/orc-mini` risk-high option, the `/orc-pr-driver`
6
6
  > per-layer gate, `/orc-ultra` gate 3). One slice, so a review in quick is the
7
7
  > same review as in `/orc`. The procedure and the return live in the agent file
8
- > (`.claude/agents/orc-reviewer-opus-5-med.md`), never here.
8
+ > (`.claude/agents/orc-reviewer-opus-5-low.md`), never here.
9
+
10
+ ## §0 Which review — only when the project names its own (v2.1.0)
11
+
12
+ When the `review-policy` probe of the lane config (or `orc review policy
13
+ --json`) says `policy: project`, a coding lane that changed code asks this ONCE
14
+ before ship — also `/orc-fast`, and `/orc-mini` without a risk-high row (DE-8).
15
+ A CLAUDE.md line never picks the reviewer: it adds an OPTION (H `any.review.which`).
16
+
17
+ ```text
18
+ Which review for this change?
19
+ 1. ORC review — orc-reviewer-opus-5-low (traced, gotcha card, Review Quality)
20
+ 2. <name> — the review <file>:<line> asks for ← recommended
21
+ 3. Skip review (not recommended: <file>:<line> asks for one)
22
+ ```
23
+
24
+ - Write `REVIEW-WHICH chose=<orc|project|skip> name=<the named review> by=user ::
25
+ <file>:<line>` ALWAYS (habits off too) — and ONLY under `policy: project`. With habits on, also the ASK line.
26
+ - **1** → this slice, as the lane already does. **2** → run the named skill or
27
+ command (the Skill tool takes both), then §3 on its findings with
28
+ `reviewer: "<name>"` on each observation — no ORC reviewer is dispatched.
29
+ **3** → no review; the summary says the project asked for one.
30
+ - An external review has no hook trace, no gotcha card and no required
31
+ `category`/`scenario`/`pre_existing`: §3 fills `category: uncategorized` where
32
+ it cannot map one, and Review Quality counts it in its own line.
9
33
 
10
34
  Slice fields: changed_files[] · diff_ranges[] · acceptance_criteria[] · constraints[] · code_pattern · invariants[] · validation_gate[] · fe_rules[] · security_checklist[] · graph_changes · tool_findings[] · gotcha_card · rules_card · previous_findings[] · mode
11
35
 
@@ -74,6 +98,9 @@ The reviewer reports EVERY finding. Then, before the ladder acts:
74
98
  5. At review close, record one observation per finding and emit the
75
99
  `FINDING-OUTCOME` line — `gotchas.md` §10 "Review close" (`/orc` Phase 7,
76
100
  `/orc-mini` after its risk option, `/orc-quick` after the review offer).
101
+ 6. In the same step, store the reviewed ranges (`diff_ranges`) with ONE
102
+ `orc gotcha observe -` call, body `{"kind": "review-scope", run, commit,
103
+ files}` (DE-13, "Review close"). The CLI computes a later fix's `miss` from it.
77
104
 
78
105
  **Superpowers path** (DE-13): after the Superpowers review skill returns, run
79
106
  this §3 on its findings too, outcomes included — never a second reviewer dispatch.
@@ -110,6 +110,7 @@ the other fails the suite.
110
110
  | `/orc-pattern` | none | single dispatch |
111
111
  | `/orc-claude` | none | single dispatch |
112
112
  | `/orc-explain` | none | read-only, seconds long |
113
+ | `/orc-fix` | none | after the record is written |
113
114
  | `/orc-route` | none | read-only, seconds long |
114
115
  | `/orc-boundary` | none | read-only, seconds long |
115
116
  | `/orc-budget` | none | read-only, seconds long |
@@ -97,8 +97,8 @@ codifier: 9 language playbooks + a11y/perf rule packs), `context-combiner`
97
97
  even for tiny tasks.** Orchestrator (Opus 4.8 high, or Opus 5.5 / Fable 5 at
98
98
  medium+) only coordinates; each task's 0–100 score (computed arithmetically
99
99
  from the planner's per-task `facets`) maps to a named executor agent via the
100
- single 6-band table in `config.md` (`rubric_bands` = report granularity only),
101
- Haiku 4.5 [0,30) → Opus 5.5 low [65,90) → Opus 5.5 medium [90,100].
100
+ single 5-band table in `config.md` (`rubric_bands` = report granularity only),
101
+ Sonnet 5 low [0,21) → Opus 5.5 low [41,90) → Opus 5.5 medium [90,100].
102
102
  - **Every executor slice carries** the intent-spec constraints, the task's
103
103
  sliced acceptance criteria, the standing
104
104
  house-rules card, and — when a code-pattern is resolved — your project's