@azure-id/orc 2.1.0 → 2.2.0

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 (153) hide show
  1. package/CHANGELOG.md +374 -0
  2. package/README.md +49 -36
  3. package/bin/build-agents.js +7 -5
  4. package/bin/cli.js +1006 -235
  5. package/bin/fix.js +21 -18
  6. package/bin/graph-extract.js +314 -6
  7. package/bin/graph-gain.js +83 -2
  8. package/bin/graph-map.js +23 -1
  9. package/bin/graph-notes.js +1 -1
  10. package/bin/graph-query.js +1362 -37
  11. package/bin/graph-resolve.js +1 -1
  12. package/bin/graph-shard.js +29 -6
  13. package/bin/graph-signals.js +5 -3
  14. package/bin/graph.js +7 -3
  15. package/bin/habit.js +1 -1
  16. package/bin/pricing.json +8 -1
  17. package/bin/trace-write.js +40 -11
  18. package/bin/verify-contracts.js +169 -60
  19. package/bin/verify-package.js +3 -3
  20. package/bin/webui/api.js +8 -0
  21. package/bin/webui/fixtures/extra.js +9 -9
  22. package/bin/webui/fixtures/flow.js +1 -1
  23. package/bin/webui/fixtures/index.js +2 -2
  24. package/bin/webui/fixtures/knowledge.js +8 -1
  25. package/bin/webui/fixtures/pact.js +112 -111
  26. package/bin/webui/fixtures/stats.js +2 -2
  27. package/bin/webui/i18n/en/knowledge.json +2 -0
  28. package/bin/webui/i18n/id/knowledge.json +2 -0
  29. package/bin/webui/js/panels/knowledge.js +17 -0
  30. package/guides/code-graph-benefit.md +116 -0
  31. package/guides/configuration.md +150 -0
  32. package/guides/documents.md +262 -0
  33. package/guides/extra-models.md +448 -0
  34. package/guides/habits-and-gotchas.md +152 -0
  35. package/guides/knowledge-reads.md +190 -0
  36. package/guides/model-selection.md +186 -0
  37. package/guides/rules.md +305 -0
  38. package/guides/status-line.md +344 -0
  39. package/mock-run/a-normal-day.md +2 -2
  40. package/mock-run/extra-slots.md +177 -177
  41. package/mock-run/orc-cli.md +3 -2
  42. package/mock-run/orc-doc.md +452 -448
  43. package/mock-run/orc-fast.md +2 -2
  44. package/mock-run/orc-quick.md +146 -146
  45. package/mock-run/orc.md +4 -4
  46. package/package.json +2 -1
  47. package/templates/agents/MODEL-MAPPING.md +12 -12
  48. package/templates/agents/{orc-executor-haiku-4-5.md → orc-executor-haiku-5-high.md} +21 -8
  49. package/templates/agents/orc-executor-opus-4-7-high.md +17 -5
  50. package/templates/agents/orc-executor-opus-4-7-med.md +17 -5
  51. package/templates/agents/orc-executor-opus-4-8-high.md +17 -5
  52. package/templates/agents/orc-executor-opus-5-high.md +17 -5
  53. package/templates/agents/orc-executor-opus-5-low.md +17 -5
  54. package/templates/agents/orc-executor-opus-5-med.md +17 -5
  55. package/templates/agents/orc-executor-sonnet-4-6-high.md +17 -5
  56. package/templates/agents/orc-executor-sonnet-5-high.md +17 -5
  57. package/templates/agents/orc-executor-sonnet-5-low.md +17 -5
  58. package/templates/agents/orc-executor-sonnet-5-med.md +17 -5
  59. package/templates/agents/{orc-graph-noter-sonnet-4-6-med.md → orc-graph-noter-haiku-5-high.md} +4 -4
  60. package/templates/agents/orc-planner-mini-opus-5-med.md +3 -1
  61. package/templates/agents/orc-planner-mini-sonnet-5-high.md +3 -1
  62. package/templates/agents/orc-planner-opus-5-med.md +3 -1
  63. package/templates/agents/{orc-recon-sonnet-4-6-med.md → orc-recon-sonnet-5-med.md} +4 -4
  64. package/templates/agents/{orc-trace-writer-haiku-4-5.md → orc-trace-writer-haiku-5-high.md} +4 -3
  65. package/templates/commands/orc-doc.md +128 -128
  66. package/templates/commands/orc-export.md +51 -46
  67. package/templates/commands/orc-fast.md +10 -10
  68. package/templates/hooks/README.md +8 -3
  69. package/templates/hooks/orc-effort-guard.js +105 -27
  70. package/templates/hooks/orc-graph-hook.js +252 -4
  71. package/templates/hooks/orc-statusline.js +13 -6
  72. package/templates/hooks/orc-trace.js +1 -1
  73. package/templates/skills/_shared/README.md +2 -2
  74. package/templates/skills/_shared/code-graph.md +185 -251
  75. package/templates/skills/_shared/extra-dispatch.md +4 -4
  76. package/templates/skills/_shared/lane-contract.md +7 -3
  77. package/templates/skills/_shared/opus5-only.md +3 -3
  78. package/templates/skills/_shared/phases/execution.md +13 -11
  79. package/templates/skills/_shared/phases/planning.md +27 -9
  80. package/templates/skills/_shared/phases/preflight.md +3 -3
  81. package/templates/skills/_shared/phases/review.md +4 -3
  82. package/templates/skills/_shared/phases/ship.md +7 -10
  83. package/templates/skills/_shared/phases/summary.md +2 -3
  84. package/templates/skills/_shared/phases/trace-verbs.md +21 -16
  85. package/templates/skills/_shared/phases/trace.md +3 -3
  86. package/templates/skills/_shared/phases/wiki-consult.md +2 -2
  87. package/templates/skills/_shared/pr-templates.md +108 -106
  88. package/templates/skills/_shared/read-ladder.md +8 -2
  89. package/templates/skills/_shared/return-validation.md +10 -6
  90. package/templates/skills/_shared/review-slice.md +1 -1
  91. package/templates/skills/_shared/stack-plan.md +135 -135
  92. package/templates/skills/_shared/wait.md +14 -2
  93. package/templates/skills/context-combiner/SKILL.md +2 -2
  94. package/templates/skills/orc/SKILL.md +7 -7
  95. package/templates/skills/orc/config.md +2 -2
  96. package/templates/skills/orc/examples/full-run-mock.md +7 -7
  97. package/templates/skills/orc/references/effort-and-mode.md +222 -222
  98. package/templates/skills/orc/schemas/planning-output.md +3 -0
  99. package/templates/skills/orc-aftermath/SKILL.md +15 -15
  100. package/templates/skills/orc-analyze/SKILL.md +2 -2
  101. package/templates/skills/orc-analyze-mini/SKILL.md +2 -2
  102. package/templates/skills/orc-boundary/SKILL.md +15 -15
  103. package/templates/skills/orc-boundary/references/card.md +81 -78
  104. package/templates/skills/orc-boundary/references/gate.md +113 -113
  105. package/templates/skills/orc-brainstorm/SKILL.md +15 -15
  106. package/templates/skills/orc-budget/SKILL.md +15 -15
  107. package/templates/skills/orc-challenge/README.md +1 -1
  108. package/templates/skills/orc-challenge/SKILL.md +16 -16
  109. package/templates/skills/orc-challenge/examples/council-full-roster.md +1 -1
  110. package/templates/skills/orc-claude/SKILL.md +4 -4
  111. package/templates/skills/orc-claude/examples/claude-run-mock.md +1 -1
  112. package/templates/skills/orc-diy/SKILL.md +2 -2
  113. package/templates/skills/orc-diy/references/blocks/wiki.md +26 -26
  114. package/templates/skills/orc-diy/references/flow-schema.md +2 -2
  115. package/templates/skills/orc-doc/README.md +2 -2
  116. package/templates/skills/orc-doc/SKILL.md +501 -490
  117. package/templates/skills/orc-doc/examples/orc-doc-prd-run.md +12 -1
  118. package/templates/skills/orc-doc/references/chunking.md +6 -4
  119. package/templates/skills/orc-doc/references/gates.md +311 -311
  120. package/templates/skills/orc-doc/references/resume-protocol.md +229 -228
  121. package/templates/skills/orc-explain/SKILL.md +88 -88
  122. package/templates/skills/orc-export/SKILL.md +190 -187
  123. package/templates/skills/orc-fast/SKILL.md +17 -14
  124. package/templates/skills/orc-grill/SKILL.md +16 -16
  125. package/templates/skills/orc-grill/references/grill-doc.md +1 -1
  126. package/templates/skills/orc-handoff/SKILL.md +11 -11
  127. package/templates/skills/orc-learn/SKILL.md +13 -13
  128. package/templates/skills/orc-learn/examples/learn-run-mock.md +2 -2
  129. package/templates/skills/orc-mini/SKILL.md +12 -12
  130. package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -5
  131. package/templates/skills/orc-pact/SKILL.md +15 -15
  132. package/templates/skills/orc-pact/references/gate.md +70 -70
  133. package/templates/skills/orc-pattern/SKILL.md +3 -3
  134. package/templates/skills/orc-poly/SKILL.md +4 -4
  135. package/templates/skills/orc-poly/examples/poly-run-mock.md +51 -51
  136. package/templates/skills/orc-pr-driver/SKILL.md +4 -3
  137. package/templates/skills/orc-pr-driver/references/orc-run-split.md +108 -99
  138. package/templates/skills/orc-pr-setup/SKILL.md +2 -2
  139. package/templates/skills/orc-quick/README.md +11 -12
  140. package/templates/skills/orc-quick/SKILL.md +29 -32
  141. package/templates/skills/orc-quick/references/context-doc.md +5 -5
  142. package/templates/skills/orc-quick/references/dispatch-gate.md +10 -10
  143. package/templates/skills/orc-quick/references/gh-mode.md +2 -1
  144. package/templates/skills/orc-quick/references/look.md +34 -12
  145. package/templates/skills/orc-retro/SKILL.md +2 -2
  146. package/templates/skills/orc-retro/examples/retro-mock.md +2 -2
  147. package/templates/skills/orc-route/SKILL.md +2 -2
  148. package/templates/skills/orc-test/SKILL.md +6 -3
  149. package/templates/skills/orc-verify/SKILL.md +2 -2
  150. package/templates/skills/orc-wait/SKILL.md +10 -2
  151. package/templates/skills/orc-wiki/SKILL.md +4 -4
  152. package/templates/skills/orc-wiki/references/pattern-prewarm.md +19 -19
  153. package/templates/agents/orc-executor-sonnet-4-6-med.md +0 -155
@@ -1,228 +1,229 @@
1
- # Resuming — the contract that makes a document survive a session
2
-
3
- > **The context is gathered once and frozen.** A resumed session reads
4
- > `context.md` from disk; it never re-interviews the user for what session 1
5
- > already settled. **a lane that re-asks a frozen question** has broken this
6
- > contract.
7
-
8
- ## Entry
9
-
10
- ```
11
- /orc-doc resume → lists every document with its status line
12
- /orc-doc resume prd-checkout-refund → prefix match; an ambiguous prefix lists candidates
13
- ```
14
-
15
- `orc doc list --json` supplies the list. It may only claim what the disk proves:
16
- `document.md` missing means **"not started"**, never "failed".
17
-
18
- ## The resumed session's first four moves
19
-
20
- 1. `orc doc status <slug> --json` (0 nothing to do · 1 something to do · 2
21
- unknown slug) and **`orc doc parts <slug> --json`** — which works BEFORE a
22
- single compile has ever run, because the section files ARE the progress.
23
- 2. **Read `context.md` and `outline.md`. NOT the document.**
24
- 3. **Detect the user's own edits.** Sections whose live hash ≠ the hash
25
- `doc.json` recorded are `user-edited`. Say so, **by section name**. A part
26
- with no recorded hash at all is `unconfirmed` — a wave killed mid-flight —
27
- and it is re-written, never shipped.
28
- 4. **HARD STOP and ask what should change.**
29
-
30
- ```
31
- Picking up: PRD — checkout refunds (started 13-08-2026, cycle 2).
32
- I have read the context you gave me — you do not need to repeat it.
33
-
34
- Sections: 17 planned · 14 written · wave 5 of 7
35
- You edited since last time: §02 Summary, §08 Requirements ← I will not touch these unless you say so
36
- Not written yet: §12 Risks · §13 Rollout
37
- document.md is 2 sections behind sections/ — rebuilding it is free.
38
-
39
- What should change? (a section to rewrite, something to add, a finding to fix,
40
- or "finish the rest")
41
- ```
42
-
43
- **No change request → no work.** The lane stops there. Regenerating a document
44
- nobody asked to change is the most expensive possible way to do nothing.
45
-
46
- ## `RESUME.md` — the P0 hand-back
47
-
48
- Written by **the lane itself, never by a dispatched agent** — a dispatch inside
49
- a stop sequence lets a stop fail because a subagent did.
50
-
51
- **v0.49.5 — the CLI writes it, and it is never behind.** `orc doc resume-file
52
- <slug>` composes the whole page from `doc.json`, and `doc.json` refreshes it on
53
- **every** write, so it exists from `orc doc init` onward. This replaces a rule
54
- the orchestrator had to remember at every stop, which is the bet this repo has
55
- already lost twice (the v0.32.0 narration lesson): a hand-back you are TOLD to
56
- write at every stop is the hand-back that goes missing on the one run that
57
- mattered — the one a usage limit killed.
58
-
59
- **Rule 16 — `every question points at RESUME.md`.** Before ORC asks the user
60
- anything, it runs `orc doc resume-file <slug>` and ends the message with that
61
- file's path and the line to paste. A user who has to remember where they were is
62
- a user who does not come back.
63
-
64
- The page is written for someone who does not read code: what this document is,
65
- where the files are, what is not written yet, what happens next, and the one
66
- line to paste. Nothing in it needs interpreting.
67
-
68
- **It lives at `{run_dir}/{slug}/RESUME.md`** — the registered v0.42.0 home, and
69
- the ONLY place `listRuns()` looks. It is not in the document folder, and there is
70
- no second copy there: two copies is two ideas, and they drift. Anyone browsing
71
- the folder gets the same line from `orc doc status`.
72
-
73
- ```markdown
74
- # Resume this document
75
-
76
- Paste this line into a new Claude Code session, in this project:
77
-
78
- /orc-doc resume prd-checkout-refund-130826
79
-
80
- Where it stands: /orc-doc · PRD · cycle 2 · 14 of 17 sections written · phase D6 · wave 5 of 7
81
-
82
- - Sections: orc/orc-doc/prd-checkout-refund-130826/sections/ ← the source of truth
83
- - Document: document.md is a BUILD ARTIFACT — `orc doc compile` rebuilds it, free
84
- - Context: context.md (the new session reads this first — you do not repeat yourself)
85
- - Not written yet: §12 Risks · §13 Rollout
86
-
87
- ## What the new session will do
88
- 1. Read context.md and doc.json. It will NOT re-ask what you already answered.
89
- 2. Start at wave 6, and re-read NOTHING it already wrote.
90
- 3. Ask you what should change. **It will not touch the document until you say.**
91
- ```
92
-
93
- **The `Where it stands:` line is at COLUMN 0.** Never `## Where it stands:` —
94
- `parseStands` is line-anchored, so a heading prefix means it never matches, and
95
- that single line is what `orc doc list`, `orc resume` and `orc run list` all
96
- parse. There is a test that feeds this exact template to the real parser.
97
-
98
- **One generator, not two.** The whole file comes from `orc doc resume-file`,
99
- which builds the `Where it stands:` line with the same function `orc doc status`
100
- uses. Never assemble your own copy of either. The CLI computes, the skill points
101
- at the result, and the two can then never disagree.
102
-
103
- ## The wave hand-back (P0, every wave)
104
-
105
- ```
106
- Wave 2 of 7 done — 6 of 17 sections written.
107
-
108
- orc/orc-doc/acme-prd-170826/sections/04-detailed-design/01-data-model.md 142 L
109
- orc/orc-doc/acme-prd-170826/sections/04-detailed-design/02-api-surface.md 118 L
110
- orc/orc-doc/acme-prd-170826/sections/05-rollout.md 96 L
111
-
112
- Read them now if you want to redirect — nothing later is bought yet.
113
- See it as one file (free): orc doc compile acme-prd-170826 --partial
114
-
115
- To carry on — new session, or after your usage limit resets:
116
-
117
- /orc-doc resume acme-prd-170826
118
-
119
- Everything needed is on disk. The next session starts at wave 3 and re-reads
120
- nothing it already wrote.
121
-
122
- The full picture, in plain words:
123
- .claude/orc/run/acme-prd-170826/RESUME.md
124
- ```
125
-
126
- **Every message that asks the user something ends with those last two lines**
127
- (rule 16) — a gate, a wave stop, a revision round, an offer. The path is what
128
- `orc doc resume-file` just printed; never type one from memory.
129
-
130
- ## The hand-back mention (P0, every cycle)
131
-
132
- After **every** cycle that touched the document — the first run and every
133
- resume — this is the last thing on screen, always in this shape:
134
-
135
- ```
136
- Saved to orc/orc-doc/prd-checkout-refund-130826/sections/ (the source of truth)
137
- orc/orc-doc/prd-checkout-refund-130826/document.md (rebuilt, free)
138
-
139
- Editing it yourself is expected — go ahead. When you want to carry on, even in a
140
- brand-new chat, paste this line:
141
-
142
- /orc-doc resume prd-checkout-refund-130826
143
-
144
- The full picture is in that folder's RESUME.md — it remembers the context, the
145
- audience and what is still open, so you never have to explain it twice.
146
- ```
147
-
148
- Then the two things this lane offers but never does:
149
-
150
- ```
151
- Not staged, not committed. If your team should see it:
152
- git add orc/orc-doc/prd-checkout-refund-130826/
153
-
154
- Want it graded before you send it? In a NEW session:
155
- /orc-challenge orc/orc-doc/prd-checkout-refund-130826/document.md
156
- ```
157
-
158
- `/orc-challenge` is offered and never run from here. It is the same separation
159
- its own contract already enforces from the other side: a session that wrote the
160
- thing cannot honestly grade it.
161
-
162
- ## The user's edits are sacred
163
-
164
- A `user-edited` section is **never** rewritten without an explicit instruction
165
- naming it. If a finding lands inside one, the finding is *reported* and the fix
166
- is *offered*, never applied. Overwriting a human's paragraph is unrecoverable
167
- from this lane's side — the part file is gone, and their wording with it.
168
-
169
- ## `changelog.md`
170
-
171
- One entry per cycle, appended, newest last. It is the answer to "what did the
172
- last session actually do", and it is written by the lane, not derived:
173
-
174
- ```markdown
175
- ## Cycle 2 — 14-08-2026
176
- - You asked: tighten §04 Goals and add the fraud limit to §12.
177
- - Changed: sections/04-goals-and-metrics.md (rewritten, 22 → 18 lines), sections/12-risks.md (one row added).
178
- - Untouched: §02 and §08 — you edited those yourself.
179
- - Not written yet: §13 Rollout.
180
- ```
181
-
182
- An Open question or an Assumption does NOT go here and does not go into the
183
- document. It goes into the journal as a gap —
184
- `orc doc log <slug> --kind gap --sections <id> --text "…"` — and the CLI derives
185
- `gaps.md` from that. The deliverable carries content only.
186
-
187
- ---
188
-
189
- ## The journal — what you asked for, in order (v0.48.1)
190
-
191
- `changelog.md` above is **lane-written prose**. The journal is the **derived**
192
- companion, and the two are not the same thing: one is a narrative someone wrote,
193
- the other is a merge of four sources with the provenance of every row attached.
194
-
195
- ```
196
- orc doc log <slug> --kind request|decision|gate|note|gap --text "…" [--sections a,b] [--source user|/orc-grill|/orc-brainstorm]
197
- orc doc journal <slug> [--json]
198
- ```
199
-
200
- | `origin` | source | what it is |
201
- |---|---|---|
202
- | `recorded` | `journal[]` | the user's own words, **verbatim** |
203
- | `derived` | `cycles[]` | a write / check / edit / compile cycle — a machine fact |
204
- | `derived` | the ship / unship records | a machine fact |
205
- | `observed` | a section that turned `user-edited` | a machine fact, no text |
206
-
207
- **It never invents an entry.** A cycle that ran with nothing logged renders as
208
- an explicit gap — *"cycle 2 ran · no request was recorded for it"* — and **never**
209
- a plausible reconstruction from file mtimes. **a lane that invents a journal entry**
210
- has broken this contract. Same honesty rule as `/orc-pact`'s
211
- **UNCHECKABLE**: not knowing is an answer, and faking it teaches people to
212
- distrust the rows that are real.
213
-
214
- **Call `orc doc log` at D1 with the user's words verbatim.** A resumed session
215
- reads the journal to answer *"what have I been asking for?"*, and a paraphrase
216
- there is the same failure as a paraphrase in `context.md` — it is where a
217
- resumed session quietly starts writing a different document.
218
-
219
- ## Resuming is a loop now, not a memory
220
-
221
- The resumed session's moves are unchanged — `orc doc status`, `orc doc parts`,
222
- read `context.md` and `outline.md` (**not the document**), name what the user
223
- edited, then HARD STOP and ask. After that, **`orc doc next <slug> --json` says
224
- what happens next** and this lane does exactly that, until it exits 1.
225
-
226
- Nothing about the pipeline is remembered across the gap any more. That is the
227
- point: a session resumed months later in a fresh context has the same
228
- information as the one that started it.
1
+ # Resuming — the contract that makes a document survive a session
2
+
3
+ > **The context is gathered once and frozen.** A resumed session reads
4
+ > `context.md` from disk; it never re-interviews the user for what session 1
5
+ > already settled. **a lane that re-asks a frozen question** has broken this
6
+ > contract.
7
+
8
+ ## Entry
9
+
10
+ ```
11
+ /orc-doc resume → lists every document with its status line
12
+ /orc-doc resume prd-checkout-refund → prefix match; an ambiguous prefix lists candidates
13
+ ```
14
+
15
+ `orc doc list --json` supplies the list. It may only claim what the disk proves:
16
+ `document.md` missing means **"not started"**, never "failed".
17
+
18
+ ## The resumed session's first four moves
19
+
20
+ 1. `orc doc status <slug> --json` (0 nothing to do · 1 something to do · 2
21
+ unknown slug) and **`orc doc parts <slug> --json`** — which works BEFORE a
22
+ single compile has ever run, because the section files ARE the progress.
23
+ 2. **Read `context.md` and `outline.md`. NOT the document.**
24
+ 3. **Detect the user's own edits.** Sections whose live hash ≠ the hash
25
+ `doc.json` recorded are `user-edited`. Say so, **by section name**. A part
26
+ with no recorded hash at all is `unconfirmed` — a wave killed mid-flight —
27
+ and it is re-written, never shipped.
28
+ 4. **HARD STOP and ask what should change.**
29
+
30
+ ```
31
+ Picking up: PRD — checkout refunds (started 13-08-2026, cycle 2).
32
+ I have read the context you gave me — you do not need to repeat it.
33
+
34
+ Sections: 17 planned · 14 written · wave 5 of 7
35
+ You edited since last time: §02 Summary, §08 Requirements ← I will not touch these unless you say so
36
+ Not written yet: §12 Risks · §13 Rollout
37
+ document.md is 2 sections behind sections/ — rebuilding it is free.
38
+
39
+ What should change? (a section to rewrite, something to add, a finding to fix,
40
+ or "finish the rest")
41
+ ```
42
+
43
+ **No change request → no work.** The lane stops there. Regenerating a document
44
+ nobody asked to change is the most expensive possible way to do nothing.
45
+
46
+ ## `RESUME.md` — the P0 hand-back
47
+
48
+ Written by **the lane itself, never by a dispatched agent** — a dispatch inside
49
+ a stop sequence lets a stop fail because a subagent did.
50
+
51
+ **v0.49.5 — the CLI writes it, and it is never behind.** `orc doc resume-file
52
+ <slug>` composes the whole page from `doc.json`, and `doc.json` refreshes it on
53
+ **every** write, so it exists from `orc doc init` onward. This replaces a rule
54
+ the orchestrator had to remember at every stop, which is the bet this repo has
55
+ already lost twice (the v0.32.0 narration lesson): a hand-back you are TOLD to
56
+ write at every stop is the hand-back that goes missing on the one run that
57
+ mattered — the one a usage limit killed.
58
+
59
+ **Rule 16 — `every question points at RESUME.md`.** Before ORC asks the user
60
+ anything, it runs `orc doc resume-file <slug>` and ends the message with that
61
+ file's path and the line to paste. A user who has to remember where they were is
62
+ a user who does not come back.
63
+
64
+ The page is written for someone who does not read code: what this document is,
65
+ where the files are, what is not written yet, what happens next, and the one
66
+ line to paste. Nothing in it needs interpreting.
67
+
68
+ **It lives at `{run_dir}/{slug}/RESUME.md`** — the registered v0.42.0 home, and
69
+ the ONLY place `listRuns()` looks. It is not in the document folder, and there is
70
+ no second copy there: two copies is two ideas, and they drift. Anyone browsing
71
+ the folder gets the same line from `orc doc status`.
72
+
73
+ ```markdown
74
+ # Resume this document
75
+
76
+ Paste this line into a new Claude Code session, in this project:
77
+
78
+ /orc-doc resume prd-checkout-refund-130826
79
+
80
+ Where it stands: /orc-doc · PRD · cycle 2 · 14 of 17 sections written · phase D6 · wave 5 of 7
81
+
82
+ - Sections: orc/orc-doc/prd-checkout-refund-130826/sections/ ← the source of truth
83
+ - Document: document.md is a BUILD ARTIFACT — `orc doc compile` rebuilds it, free
84
+ - Context: context.md (the new session reads this first — you do not repeat yourself)
85
+ - Not written yet: §12 Risks · §13 Rollout
86
+
87
+ ## What the new session will do
88
+ 1. Read context.md and doc.json. It will NOT re-ask what you already answered.
89
+ 2. Start at wave 6, and re-read NOTHING it already wrote.
90
+ 3. Ask you what should change. **It will not touch the document until you say.**
91
+ ```
92
+
93
+ **The `Where it stands:` line is at COLUMN 0.** Never `## Where it stands:` —
94
+ `parseStands` is line-anchored, so a heading prefix means it never matches, and
95
+ that single line is what `orc doc list`, `orc resume` and `orc run list` all
96
+ parse. There is a test that feeds this exact template to the real parser.
97
+
98
+ **One generator, not two.** The whole file comes from `orc doc resume-file`,
99
+ which builds the `Where it stands:` line with the same function `orc doc status`
100
+ uses. Never assemble your own copy of either. The CLI computes, the skill points
101
+ at the result, and the two can then never disagree.
102
+
103
+ ## The wave hand-back (P0, every wave)
104
+
105
+ ```
106
+ Wave 2 of 7 done — 6 of 17 sections written.
107
+
108
+ orc/orc-doc/acme-prd-170826/sections/04-detailed-design/01-data-model.md 142 L
109
+ orc/orc-doc/acme-prd-170826/sections/04-detailed-design/02-api-surface.md 118 L
110
+ orc/orc-doc/acme-prd-170826/sections/05-rollout.md 96 L
111
+
112
+ Read them now if you want to redirect — nothing later is bought yet.
113
+ See it as one file (free): orc doc compile acme-prd-170826 --partial
114
+
115
+ To carry on — new session, or after your usage limit resets:
116
+
117
+ /orc-doc resume acme-prd-170826
118
+
119
+ Everything needed is on disk. The next session starts at wave 3 and re-reads
120
+ nothing it already wrote.
121
+
122
+ The full picture, in plain words:
123
+ .claude/orc/run/acme-prd-170826/RESUME.md
124
+ ```
125
+
126
+ **Every message that asks the user something ends with those last two lines**
127
+ (rule 16) — a gate, a wave stop, a revision round, an offer. The path is what
128
+ `orc doc resume-file` just printed; never type one from memory.
129
+
130
+ ## The hand-back mention (P0, every cycle)
131
+
132
+ After **every** cycle that touched the document — the first run and every
133
+ resume — this is the last thing on screen, always in this shape:
134
+
135
+ ```
136
+ Saved to orc/orc-doc/prd-checkout-refund-130826/sections/ (the source of truth)
137
+ orc/orc-doc/prd-checkout-refund-130826/document.md (rebuilt, free)
138
+
139
+ Editing it yourself is expected — go ahead. When you want to carry on, even in a
140
+ brand-new chat, paste this line:
141
+
142
+ /orc-doc resume prd-checkout-refund-130826
143
+
144
+ The full picture is in that folder's RESUME.md — it remembers the context, the
145
+ audience and what is still open, so you never have to explain it twice.
146
+ ```
147
+
148
+ Then the two things this lane offers but never does:
149
+
150
+ ```
151
+ Not staged, not committed. If your team should see it:
152
+ git add orc/orc-doc/prd-checkout-refund-130826/
153
+
154
+ Want it graded before you send it? In a NEW session:
155
+ /orc-challenge orc/orc-doc/prd-checkout-refund-130826/document.md
156
+ ```
157
+
158
+ `/orc-challenge` is offered and never run from here. It is the same separation
159
+ its own contract already enforces from the other side: a session that wrote the
160
+ thing cannot honestly grade it.
161
+
162
+ ## The user's edits are sacred
163
+
164
+ A `user-edited` section is **never** rewritten without an explicit instruction
165
+ naming it. If a finding lands inside one, the finding is *reported* and the fix
166
+ is *offered*, never applied. Overwriting a human's paragraph is unrecoverable
167
+ from this lane's side — the part file is gone, and their wording with it.
168
+
169
+ ## `changelog.md`
170
+
171
+ One entry per cycle, appended, newest last. It is the answer to "what did the
172
+ last session actually do", and it is written by the lane, not derived:
173
+
174
+ ```markdown
175
+ ## Cycle 2 — 14-08-2026
176
+ - You asked: tighten §04 Goals and add the fraud limit to §12.
177
+ - Changed: sections/04-goals-and-metrics.md (rewritten, 22 → 18 lines), sections/12-risks.md (one row added).
178
+ - Untouched: §02 and §08 — you edited those yourself.
179
+ - Not written yet: §13 Rollout.
180
+ ```
181
+
182
+ An Open question or an Assumption does NOT go here and does not go into the
183
+ document. It goes into the journal as a gap —
184
+ `orc doc log <slug> --kind gap --sections <id> --text "…"` — and the CLI derives
185
+ `gaps.md` from that. The deliverable carries content only.
186
+
187
+ ---
188
+
189
+ ## The journal — what you asked for, in order (v0.48.1)
190
+
191
+ `changelog.md` above is **lane-written prose**. The journal is the **derived**
192
+ companion, and the two are not the same thing: one is a narrative someone wrote,
193
+ the other is a merge of four sources with the provenance of every row attached.
194
+
195
+ ```
196
+ orc doc log <slug> --kind request|decision|gate|note|gap --text "…" [--sections a,b] [--source user|/orc-grill|/orc-brainstorm]
197
+ orc doc journal <slug> [--json]
198
+ ```
199
+
200
+ | `origin` | source | what it is |
201
+ |---|---|---|
202
+ | `recorded` | `journal[]` | the user's own words, **verbatim** |
203
+ | `derived` | `cycles[]` | a write / check / edit / compile cycle — a machine fact |
204
+ | `derived` | the ship / unship records | a machine fact |
205
+ | `observed` | a section that turned `user-edited` | a machine fact, no text |
206
+
207
+ **It never invents an entry.** A cycle that ran with nothing logged renders as
208
+ an explicit gap — *"cycle 2 ran · no request was recorded for it"* — and **never**
209
+ a plausible reconstruction from file mtimes. **a lane that invents a journal entry**
210
+ has broken this contract. Same honesty rule as `/orc-pact`'s
211
+ **UNCHECKABLE**: not knowing is an answer, and faking it teaches people to
212
+ distrust the rows that are real.
213
+
214
+ **Call `orc doc log` right after `orc doc init` (D5) with the user's D1 words
215
+ verbatim.** The slug does not exist before D5. A resumed session
216
+ reads the journal to answer *"what have I been asking for?"*, and a paraphrase
217
+ there is the same failure as a paraphrase in `context.md` — it is where a
218
+ resumed session quietly starts writing a different document.
219
+
220
+ ## Resuming is a loop now, not a memory
221
+
222
+ The resumed session's moves are unchanged — `orc doc status`, `orc doc parts`,
223
+ read `context.md` and `outline.md` (**not the document**), name what the user
224
+ edited, then HARD STOP and ask. After that, **`orc doc next <slug> --json` says
225
+ what happens next** and this lane does exactly that, until it exits 1.
226
+
227
+ Nothing about the pipeline is remembered across the gap any more. That is the
228
+ point: a session resumed months later in a fresh context has the same
229
+ information as the one that started it.
@@ -1,88 +1,88 @@
1
- ---
2
- name: orc-explain
3
- description: >
4
- Say it again, so it lands. Use for "/orc-explain", "wait, what?", "I did not
5
- follow that", "explain that again". The user has just read something from ORC
6
- they did not understand — a preflight block, a scoring line, a gate result, a
7
- question. Re-pitch that message: add the background it assumed, use ordinary
8
- words, and define every ORC-only term it used. It reports a failure of
9
- UNDERSTANDING, not a request for fewer words. Explains only what was just said
10
- — it never re-does the work, never dispatches, never writes a file.
11
- ---
12
-
13
- # ORC-EXPLAIN
14
-
15
- The user just read something from ORC and it did not land. That is the whole
16
- trigger, and it is a specific one.
17
-
18
- **"Wait, what?" is not "be shorter".** It reports *my understanding failed* —
19
- which is answered by supplying what was missing, not by compressing what was
20
- already there. A summary of a message someone did not understand is the same
21
- message, shorter.
22
-
23
- ## What to do
24
-
25
- Take the message the user is pointing at (the last ORC output, unless they name
26
- an earlier one) and give it again:
27
-
28
- 1. **Say the point first**, in one sentence, in ordinary words.
29
- 2. **Add the background the message assumed.** This is almost always the real
30
- gap — the message was accurate and complete for someone who already knew what
31
- a wave is.
32
- 3. **Define every ORC-only term it used**, in this project's own terms: band,
33
- facet, disposition, P0–P3, freshness tier, wave, slice, gate, packet, lane.
34
- Use `wiki/orc-orientation.md` when a wiki exists, so the words match the words
35
- the rest of this repo's docs use.
36
- 4. **Say what it means for the user** — what decision, if any, is now theirs.
37
-
38
- Then stop, and return to exactly where the run was. Nothing about the run
39
- changes: no re-plan, no re-score, no undo, no new question.
40
-
41
- ## Keep this skill short
42
-
43
- Its brevity is the design. A long skill that says "be clear" produces a verbose
44
- model, because the model copies the length it sees. There is nothing else here on
45
- purpose.
46
-
47
- ## Rules
48
-
49
- - **Explain only.** Never dispatch an agent, never edit or write any file, never
50
- change a gate outcome or a phase.
51
- - **No trace.** This lane owns no run, writes no trace and deletes no pointer —
52
- it can fire many times in one session and tracing it would flood `log_dir` for
53
- zero signal. The consequence is accepted and stated: `/orc-explain` usage is
54
- invisible to `orc stats`, which says so in its own help text.
55
- - **User-invoked only.** No lane ever calls this for the user.
56
- - If the user actually wanted the work redone rather than restated, say so and
57
- point at the lane that does it — do not quietly become that lane.
58
-
59
- ## Config
60
-
61
- Resolve with `orc lane config orc-explain --json` and obey `effective`. Never merge
62
- `.claude/orc.config.yaml` yourself, and never re-derive a precedence. Exit ≠ 0 →
63
- say so and use `../_shared/config-precedence.md`'s documented defaults, out
64
- loud. Nothing this lane reads is contested, gated or a stop, so it owes no
65
- preflight line and has no gate to honour.
66
-
67
- ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
68
-
69
- `orc rules slice --lane orc-explain --json` is the ONLY assembler; never build
70
- the card here. It rides under the house rules and above the task —
71
- **house rules > your project's rules > ORC's own packs** — and its `line` prints
72
- VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
73
- never a silent choice) and `rules_overridden[]`.
74
- ## Calls
75
-
76
- **ONE catalogue, and it is not you:** `orc lane calls orc-explain --json` names every
77
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
78
- it, and what an EMPTY answer means. Never invent a spelling, never re-word an
79
- exit code, and never re-derive a state word — the CLI's state words are the only
80
- state words, and **an exit code is an ANSWER wherever that contract says so, not
81
- a failure**. A call the answer does not name is a call this lane does not make.
82
- Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
83
- command you are about to run, out loud, before running it.
84
-
85
- ## Waiting mid-run (`/orc-wait`)
86
-
87
- Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
88
- Checkpoint **none** · safe point **read-only, seconds long**. Nothing here to checkpoint, so all three modes behave identically — say so rather than asking. Never begin a wait between a dispatch and its validated return, or before the smoke gate has reported.
1
+ ---
2
+ name: orc-explain
3
+ description: >
4
+ Say it again, so it lands. Use for "/orc-explain", "wait, what?", "I did not
5
+ follow that", "explain that again". The user has just read something from ORC
6
+ they did not understand — a preflight block, a scoring line, a gate result, a
7
+ question. Re-pitch that message: add the background it assumed, use ordinary
8
+ words, and define every ORC-only term it used. It reports a failure of
9
+ UNDERSTANDING, not a request for fewer words. Explains only what was just said
10
+ — it never re-does the work, never dispatches, never writes a file.
11
+ ---
12
+
13
+ # ORC-EXPLAIN
14
+
15
+ The user just read something from ORC and it did not land. That is the whole
16
+ trigger, and it is a specific one.
17
+
18
+ **"Wait, what?" is not "be shorter".** It reports *my understanding failed* —
19
+ which is answered by supplying what was missing, not by compressing what was
20
+ already there. A summary of a message someone did not understand is the same
21
+ message, shorter.
22
+
23
+ ## What to do
24
+
25
+ Take the message the user is pointing at (the last ORC output, unless they name
26
+ an earlier one) and give it again:
27
+
28
+ 1. **Say the point first**, in one sentence, in ordinary words.
29
+ 2. **Add the background the message assumed.** This is almost always the real
30
+ gap — the message was accurate and complete for someone who already knew what
31
+ a wave is.
32
+ 3. **Define every ORC-only term it used**, in this project's own terms: band,
33
+ facet, disposition, P0–P3, freshness tier, wave, slice, gate, packet, lane.
34
+ Use `wiki/orc-orientation.md` when a wiki exists, so the words match the words
35
+ the rest of this repo's docs use.
36
+ 4. **Say what it means for the user** — what decision, if any, is now theirs.
37
+
38
+ Then stop, and return to exactly where the run was. Nothing about the run
39
+ changes: no re-plan, no re-score, no undo, no new question.
40
+
41
+ ## Keep this skill short
42
+
43
+ Its brevity is the design. A long skill that says "be clear" produces a verbose
44
+ model, because the model copies the length it sees. There is nothing else here on
45
+ purpose.
46
+
47
+ ## Rules
48
+
49
+ - **Explain only.** Never dispatch an agent, never edit or write any file, never
50
+ change a gate outcome or a phase.
51
+ - **No trace.** This lane owns no run, writes no trace and deletes no pointer —
52
+ it can fire many times in one session and tracing it would flood `log_dir` for
53
+ zero signal. The consequence is accepted and stated: `/orc-explain` usage is
54
+ invisible to `orc stats`, which says so in its own help text.
55
+ - **User-invoked only.** No lane ever calls this for the user.
56
+ - If the user actually wanted the work redone rather than restated, say so and
57
+ point at the lane that does it — do not quietly become that lane.
58
+
59
+ ## Config
60
+
61
+ Resolve with `orc lane config orc-explain --json` and obey `effective`. Never merge
62
+ `.claude/orc.config.yaml` yourself, and never re-derive a precedence. Exit ≠ 0 →
63
+ say so and use `../_shared/config-precedence.md`'s documented defaults, out
64
+ loud. Nothing this lane reads is contested, gated or a stop, so it owes no
65
+ preflight line and has no gate to honour.
66
+
67
+ ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
68
+
69
+ `orc rules slice --lane orc-explain --json` is the ONLY assembler; never build
70
+ the card here. It rides under the house rules and above the task —
71
+ **house rules > your project's rules > ORC's own packs** — and its `line` prints
72
+ VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
73
+ never a silent choice) and `rules_overridden[]`.
74
+ ## Calls
75
+
76
+ **ONE catalogue, and it is not you:** `orc lane calls orc-explain --json` names every
77
+ SHARED CLI call this lane makes, each with its exit-code contract, its cost, when to run
78
+ it, and what an EMPTY answer means. Never invent a spelling, never re-word an
79
+ exit code, and never re-derive a state word — the CLI's state words are the only
80
+ state words, and **an exit code is an ANSWER wherever that contract says so, not
81
+ a failure**. A call that neither it nor this skill names is a call this lane does not make.
82
+ Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
83
+ command you are about to run, out loud, before running it.
84
+
85
+ ## Waiting mid-run (`/orc-wait`)
86
+
87
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
88
+ Checkpoint **none** · safe point **read-only, seconds long**. Nothing here to checkpoint, so all three modes behave identically — say so rather than asking. Never begin a wait between a dispatch and its validated return, or before the smoke gate has reported.