@azure-id/orc 2.1.1 → 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 (145) hide show
  1. package/CHANGELOG.md +320 -0
  2. package/README.md +48 -23
  3. package/bin/build-agents.js +207 -205
  4. package/bin/cli.js +48188 -47417
  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 +5661 -5552
  19. package/bin/verify-package.js +716 -716
  20. package/bin/webui/api.js +8 -0
  21. package/bin/webui/fixtures/extra.js +2036 -2036
  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/orc-cli.md +3 -2
  40. package/mock-run/orc-doc.md +452 -448
  41. package/mock-run/orc.md +157 -157
  42. package/package.json +2 -1
  43. package/templates/agents/MODEL-MAPPING.md +176 -176
  44. package/templates/agents/{orc-executor-haiku-4-5.md → orc-executor-haiku-5-high.md} +21 -8
  45. package/templates/agents/orc-executor-opus-4-7-high.md +17 -5
  46. package/templates/agents/orc-executor-opus-4-7-med.md +17 -5
  47. package/templates/agents/orc-executor-opus-4-8-high.md +17 -5
  48. package/templates/agents/orc-executor-opus-5-high.md +17 -5
  49. package/templates/agents/orc-executor-opus-5-low.md +17 -5
  50. package/templates/agents/orc-executor-opus-5-med.md +17 -5
  51. package/templates/agents/orc-executor-sonnet-4-6-high.md +17 -5
  52. package/templates/agents/orc-executor-sonnet-5-high.md +17 -5
  53. package/templates/agents/orc-executor-sonnet-5-low.md +17 -5
  54. package/templates/agents/orc-executor-sonnet-5-med.md +17 -5
  55. package/templates/agents/{orc-graph-noter-sonnet-4-6-med.md → orc-graph-noter-haiku-5-high.md} +4 -4
  56. package/templates/agents/orc-planner-mini-opus-5-med.md +3 -1
  57. package/templates/agents/orc-planner-mini-sonnet-5-high.md +3 -1
  58. package/templates/agents/orc-planner-opus-5-med.md +3 -1
  59. package/templates/agents/{orc-trace-writer-haiku-4-5.md → orc-trace-writer-haiku-5-high.md} +4 -3
  60. package/templates/commands/orc-doc.md +128 -128
  61. package/templates/commands/orc-export.md +51 -46
  62. package/templates/hooks/README.md +8 -3
  63. package/templates/hooks/orc-effort-guard.js +105 -27
  64. package/templates/hooks/orc-graph-hook.js +252 -4
  65. package/templates/hooks/orc-statusline.js +13 -6
  66. package/templates/hooks/orc-trace.js +1 -1
  67. package/templates/skills/_shared/README.md +2 -2
  68. package/templates/skills/_shared/code-graph.md +185 -251
  69. package/templates/skills/_shared/extra-dispatch.md +1331 -1331
  70. package/templates/skills/_shared/lane-contract.md +7 -3
  71. package/templates/skills/_shared/opus5-only.md +137 -137
  72. package/templates/skills/_shared/phases/execution.md +13 -11
  73. package/templates/skills/_shared/phases/planning.md +27 -9
  74. package/templates/skills/_shared/phases/preflight.md +3 -3
  75. package/templates/skills/_shared/phases/review.md +4 -3
  76. package/templates/skills/_shared/phases/ship.md +7 -10
  77. package/templates/skills/_shared/phases/summary.md +2 -3
  78. package/templates/skills/_shared/phases/trace-verbs.md +21 -16
  79. package/templates/skills/_shared/phases/trace.md +3 -3
  80. package/templates/skills/_shared/phases/wiki-consult.md +2 -2
  81. package/templates/skills/_shared/pr-templates.md +108 -106
  82. package/templates/skills/_shared/read-ladder.md +8 -2
  83. package/templates/skills/_shared/return-validation.md +10 -6
  84. package/templates/skills/_shared/review-slice.md +1 -1
  85. package/templates/skills/_shared/stack-plan.md +135 -135
  86. package/templates/skills/_shared/wait.md +14 -2
  87. package/templates/skills/context-combiner/SKILL.md +2 -2
  88. package/templates/skills/orc/SKILL.md +227 -227
  89. package/templates/skills/orc/config.md +2 -2
  90. package/templates/skills/orc/examples/full-run-mock.md +74 -74
  91. package/templates/skills/orc/schemas/planning-output.md +3 -0
  92. package/templates/skills/orc-aftermath/SKILL.md +15 -15
  93. package/templates/skills/orc-analyze/SKILL.md +2 -2
  94. package/templates/skills/orc-analyze-mini/SKILL.md +2 -2
  95. package/templates/skills/orc-boundary/SKILL.md +15 -15
  96. package/templates/skills/orc-boundary/references/card.md +81 -78
  97. package/templates/skills/orc-boundary/references/gate.md +113 -113
  98. package/templates/skills/orc-brainstorm/SKILL.md +15 -15
  99. package/templates/skills/orc-budget/SKILL.md +15 -15
  100. package/templates/skills/orc-challenge/README.md +1 -1
  101. package/templates/skills/orc-challenge/SKILL.md +16 -16
  102. package/templates/skills/orc-challenge/examples/council-full-roster.md +1 -1
  103. package/templates/skills/orc-claude/SKILL.md +4 -4
  104. package/templates/skills/orc-claude/examples/claude-run-mock.md +1 -1
  105. package/templates/skills/orc-diy/SKILL.md +2 -2
  106. package/templates/skills/orc-diy/references/blocks/wiki.md +26 -26
  107. package/templates/skills/orc-diy/references/flow-schema.md +2 -2
  108. package/templates/skills/orc-doc/README.md +2 -2
  109. package/templates/skills/orc-doc/SKILL.md +501 -490
  110. package/templates/skills/orc-doc/examples/orc-doc-prd-run.md +12 -1
  111. package/templates/skills/orc-doc/references/chunking.md +6 -4
  112. package/templates/skills/orc-doc/references/gates.md +311 -311
  113. package/templates/skills/orc-doc/references/resume-protocol.md +229 -228
  114. package/templates/skills/orc-explain/SKILL.md +88 -88
  115. package/templates/skills/orc-export/SKILL.md +190 -187
  116. package/templates/skills/orc-fast/SKILL.md +213 -210
  117. package/templates/skills/orc-grill/SKILL.md +245 -245
  118. package/templates/skills/orc-handoff/SKILL.md +11 -11
  119. package/templates/skills/orc-learn/SKILL.md +13 -13
  120. package/templates/skills/orc-learn/examples/learn-run-mock.md +2 -2
  121. package/templates/skills/orc-mini/SKILL.md +12 -12
  122. package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -5
  123. package/templates/skills/orc-pact/SKILL.md +15 -15
  124. package/templates/skills/orc-pact/references/gate.md +70 -70
  125. package/templates/skills/orc-pattern/SKILL.md +3 -3
  126. package/templates/skills/orc-poly/SKILL.md +4 -4
  127. package/templates/skills/orc-poly/examples/poly-run-mock.md +51 -51
  128. package/templates/skills/orc-pr-driver/SKILL.md +4 -3
  129. package/templates/skills/orc-pr-driver/references/orc-run-split.md +108 -99
  130. package/templates/skills/orc-pr-setup/SKILL.md +2 -2
  131. package/templates/skills/orc-quick/README.md +535 -536
  132. package/templates/skills/orc-quick/SKILL.md +29 -32
  133. package/templates/skills/orc-quick/references/context-doc.md +145 -145
  134. package/templates/skills/orc-quick/references/dispatch-gate.md +220 -220
  135. package/templates/skills/orc-quick/references/gh-mode.md +2 -1
  136. package/templates/skills/orc-quick/references/look.md +34 -12
  137. package/templates/skills/orc-retro/SKILL.md +2 -2
  138. package/templates/skills/orc-retro/examples/retro-mock.md +2 -2
  139. package/templates/skills/orc-route/SKILL.md +2 -2
  140. package/templates/skills/orc-test/SKILL.md +6 -3
  141. package/templates/skills/orc-verify/SKILL.md +2 -2
  142. package/templates/skills/orc-wait/SKILL.md +10 -2
  143. package/templates/skills/orc-wiki/SKILL.md +4 -4
  144. package/templates/skills/orc-wiki/references/pattern-prewarm.md +19 -19
  145. package/templates/agents/orc-executor-sonnet-4-6-med.md +0 -155
@@ -12,7 +12,7 @@ description: >
12
12
 
13
13
  The quick lane. You ask for something. It looks, asks you **one** set of
14
14
  questions, dispatches one agent, and writes down what happened. **Three steps
15
- per request, one user turn. Fewer than any other lane. Do not add steps.**
15
+ per request, one user turn. Do not add steps.**
16
16
 
17
17
  **You never implement — you spawn.** You read only to FIND the right files. To
18
18
  UNDERSTAND something, you dispatch an agent.
@@ -21,7 +21,7 @@ UNDERSTAND something, you dispatch an agent.
21
21
  decide if it only READS or also WRITES → pick what to dispatch → **ask the
22
22
  user** → dispatch → check the return → write the doc entry. No request is "not
23
23
  supported"; a request can only be **too big**, and then you OFFER `/orc-mini`.
24
- **What this lane is NOT** — no teaching doc, no repo scan, no spec, no plan, no
24
+ **What this lane is NOT** — no repo scan, no spec, no plan, no
25
25
  waves, no scoring, no acceptance pass (`README.md` §2).
26
26
 
27
27
  ---
@@ -34,10 +34,9 @@ without the manifest (`../_shared/lane-contract.md` §Phases).
34
34
 
35
35
  ## Q0 — Preflight (ONE time per session, silent, nothing can stop the run)
36
36
 
37
- 1. **Config.** Read `log_dir` only. Read no other key. **One exception, and it
37
+ 1. **Config.** Read `log_dir` only. **One exception, and it
38
38
  is a PROBE, not a key read:** `probes["extra-slot"]` in the `orc lane config`
39
- answer (`resolved`: extra or claude) answers the master gate, the position and the
40
- routing in one, so the code-writing menu can offer line 3. Do not call
39
+ answer (`resolved`: extra or claude) answers the gate and the routing, so the code-writing menu can offer line 3. Do not call
41
40
  `orc extra resolve --slot quick-executor`. **A gate that is never probed is a
42
41
  gate that is always off.** Keep the answer for this session; it is an OPTION
43
42
  on a menu, never a default (`references/dispatch-gate.md`). **`habits{}` in
@@ -61,7 +60,7 @@ without the manifest (`../_shared/lane-contract.md` §Phases).
61
60
  4. **Code graph cache — never skipped** (`../_shared/code-graph.md` §0). Print
62
61
  `probes["graph-status"].line`; run
63
62
  `orc graph status --if-enabled --heal --json --brief` only when `heal_needed` is true. Put the `trace` (`GRAPH-CONSULT …`) in
64
- the packet VERBATIM. Exit 3 = off → no other graph call this session. Every graph
63
+ the packet VERBATIM. Exit 3 (`off` or `semi`) → no other graph call this session. Every graph
65
64
  call carries `--if-enabled`, so the CLI reads the `code_graph` keys —
66
65
  this lane still reads `log_dir` and nothing else.
67
66
  5. **`gh` probe — only when the request names a PR** (`pr <n>`, `PR <n>`, a
@@ -96,16 +95,15 @@ Print it on ONE line:
96
95
 
97
96
  **The dig — graph first** (`references/look.md`). Ask the graph BEFORE any
98
97
  Grep; Grep only for what the graph does not know.
99
- - Names a file or symbol → `orc graph ctx <targets> --if-enabled --json --brief`, 5 at
100
- most. Names none → `orc graph map --focus "<3–6 words>" --budget 800
101
- --if-enabled --json --brief`, then `ctx` on the files it ranks first. Asks what breaks
102
- or who uses something → `ctx <symbol> --depth 2` and `orc graph coverage
103
- <files> --if-enabled --json --brief` before you call anything absent. Exit 3 →
104
- Grep/Glob. Exit 4 → Grep the name, carry EVERY candidate into your question.
105
- Copy each `line` into chat, each `trace` into the running record. A `map`
106
- answer is ONE call; a card never replaces reading the range it names.
98
+ - Names a symbol → ONE `orc graph ctx <symbol> --anchors --focus=<words> --if-enabled
99
+ --json --brief`: callers, tests (also via a caller), coverage — no Grep of that name,
100
+ `coverage` only on `partial`; `anchors_card` = the slice's `graph_anchors` (no
101
+ `--for-slice`), declared = target file + its caller files. Files → `ctx <files>` (≤ 5).
102
+ None → `orc graph map --focus=<3–6 words> --budget 800 …`, then ONE `ctx` (≤ 5), not
103
+ `cat`/`grep`. Exit 3 → Grep/Glob. Exit 4 → Grep the name, carry EVERY candidate.
104
+ `line` → chat, `trace` → the record. A card never replaces reading its range.
107
105
  - Wiki exists → pick 1–3 pages from `wiki/INDEX.md` and keep their **PATHS**
108
- only. Never paste wiki text into a slice. Emit
106
+ only. With `graph_anchors` in the slice, list at most ONE wiki page path (the one about the feature's intent), not 1–3. Never paste wiki text into a slice. Emit
109
107
  `WIKI-CONSULT <tier> :: docs=<paths>`.
110
108
  - Pattern cached → keep it for the slice.
111
109
  - Always put this line in every slice, word for word:
@@ -157,12 +155,14 @@ Rules:
157
155
 
158
156
  ### 3.1 Dispatch and check the return
159
157
 
160
- Put in the slice: the change sketch, the Q2 answers, 2–3 acceptance bullets, the
161
- `graph` block from `orc graph ctx <declared files> --for-slice --if-enabled
162
- --json --brief` (the OUTSIDE view — `references/look.md` §5), the wiki **paths**, the
163
- cached pattern (whole text), the `house_rules` card
164
- (`../_shared/phases/house-rules.md`, whole text), the `rules_card` under it
165
- (`orc rules slice --lane orc-quick --json` → `text`, whole text), PR comments
158
+ Put in the slice: the change sketch, Q2 answers, 2–3 acceptance bullets, the
159
+ `graph_anchors` (WHOLE `card` VERBATIM, `read all:` + code) from ONE `orc graph ctx --for-slice <declared files>
160
+ --focus=<3–8 words: request, doc, copy-from name> [--refs=<copy-FROM files,
161
+ found first>] --anchors --if-enabled --json --brief`
162
+ (print `line`; exit 3/4 or one file, no outside change → none — `references/look.md`
163
+ §5), the wiki **paths**, the cached pattern, the `house_rules` card
164
+ (`../_shared/phases/house-rules.md`), the `rules_card` under it
165
+ (`orc rules slice --lane orc-quick --json` → `text`) — all three whole text, PR comments
166
166
  with their `file:line`, and a short-return rule. A `kind: defect` entry also
167
167
  carries `repro` — the EXECUTOR writes it red, then fixes it green, never you
168
168
  (`references/defect.md`). An **ad-hoc** dispatch is also told to report its own
@@ -170,7 +170,7 @@ carries `repro` — the EXECUTOR writes it red, then fixes it green, never you
170
170
 
171
171
  Check the return with `../_shared/return-validation.md` §1–§3 + each injected
172
172
  field's §: honest `unmet[]`, `pattern_version` + `invariants_checked`,
173
- `graph_used` (absent on a slice that carried a card = malformed), `repro` when
173
+ `graph_used` (absent on a slice that carried `graph_anchors` = malformed), `repro` when
174
174
  the slice asked for it, and `actual_model` / `actual_effort` → emit `VERIFY`, which names
175
175
  `graph_used=<n> targets gen <n>` and `repro red→green` beside the model match,
176
176
  and show ⛔ DOWNGRADE if they differ. Also compare `git status --short`
@@ -209,16 +209,13 @@ Never offer commit while tests are red.
209
209
 
210
210
  ### 3.3 Write the doc — ALWAYS, and BEFORE any offer
211
211
 
212
- **After a request that WROTE code** (never after a read-only one), so the next
213
- request and the next session start from a current cache, in this order:
212
+ **After a request that WROTE code** (never after a read-only one), and ONLY
213
+ when `probes["graph-status"].update_step` is `lane`:
214
214
  `orc graph update --notes-pending --files <actual_files> --if-enabled --json --brief`
215
215
  — ONE call that answers both (print its `line`, copy its `trace`). Exit 0 on
216
- `notes` → dispatch `orc-graph-noter-sonnet-4-6-med` in the SAME tool block as
217
- this doc write. It is ORC bookkeeping, like the trace writer — not a Q2 gate
218
- dispatch (`references/dispatch-gate.md` rule 8). Exit 3 or 5 → nothing. Then,
219
- after the entry is appended, `orc graph gain --run <this run> --if-enabled
220
- --json --brief` → print its `line` VERBATIM into chat and the entry. It is an estimate
221
- with a range; never restate it as a saving.
216
+ `notes` → dispatch `orc-graph-noter-haiku-5-high` in the SAME tool block as
217
+ this doc write — bookkeeping, not a Q2 gate dispatch (`references/dispatch-gate.md` rule 8). Exit 3 or 5 → nothing.
218
+ `hook`, `preflight` or `none` → no update call. No lane runs the gain meter.
222
219
 
223
220
  Append entry N to `orc-quick/<slug>/quick-context.md`
224
221
  (`references/context-doc.md`, only `## Entry shape` or `## A read-only entry`).
@@ -270,8 +267,8 @@ every event is a protocol violation. Pipe each packet to
270
267
 
271
268
  ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
272
269
 
273
- - **Calls:** `orc lane calls orc-quick --json` names every call and its exit codes.
274
- **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
270
+ - **Calls:** `orc lane calls orc-quick --json` names shared calls and exit codes.
271
+ **An exit code is an ANSWER where it says so, not a failure.** Own calls are here; make no other.
275
272
  - **Config:** `orc lane config orc-quick --json`. Obey `effective`, print every line
276
273
  in `announce[]` VERBATIM at preflight, and honour `stops[]` before wave 1.
277
274
  Never merge `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
@@ -1,145 +1,145 @@
1
- # The quick context doc — shape and rules
2
-
3
- This is the file orc-quick writes after every request. It is written for a
4
- HUMAN to read later, in this session or a different one.
5
-
6
- ## Where it goes
7
-
8
- ```
9
- <projectRoot>/orc-quick/<slug>/quick-context.md
10
- ```
11
-
12
- - `<slug>` is the slug of the **first** request in the thread. No date in the
13
- folder name.
14
- - **One file per folder. Never make a second `.md` file.** No `review.md`, no
15
- `diff.md`, no per-request files.
16
- - It sits at the project root, next to folders like `test-generator/` and
17
- `learning-docs/` — never inside `.claude/`.
18
-
19
- ## Rules
20
-
21
- 1. **Write it BEFORE the offers** (test / review / commit). If the user walks
22
- away, the entry is still complete.
23
- 2. **Every request gets an entry** — even a read-only dig. There, the answer IS
24
- the result.
25
- 3. **Never read the body of this file.** Only two exceptions:
26
- - the TOC block, when you re-open a thread;
27
- - the user asks you to read it.
28
- 4. **Never commit it.** It is not staged, ever. Do not edit `.gitignore`.
29
- 5. One entry can hold **several dispatches**. A dig that turns into a fix is ONE
30
- entry with two rows in its table.
31
-
32
- ## The TOC block
33
-
34
- The top of the file has a short list between markers:
35
-
36
- ```markdown
37
- <!-- orc-quick:toc -->
38
- 1. Change json payload A → B 05-08-2026 14:23:10 ✅ committed a1b2c3d
39
- 2. How does tenant scoping work? 05-08-2026 15:47:02 ℹ answered
40
- 3. Why does /orders 500? — found & fixed 10-08-2026 09:15:44 ✅ committed 7f2e1a9
41
- <!-- /orc-quick:toc -->
42
- ```
43
-
44
- **Why the markers matter.** When you open a thread again, you need to know the
45
- next number. You read ONLY this block — it is small and cheap. You do not read
46
- the entries below it. That is how "never read the doc" and "keep counting" can
47
- both be true.
48
-
49
- Inside one session, the count is also kept in
50
- `.claude/orc/run/<run-slug>/quick-checkpoint.md`. That file is run state, not
51
- the deliverable, so you may read it freely.
52
-
53
- **If the TOC is broken or missing:** rebuild it by scanning ONLY the lines that
54
- start with `## <number>.`. Do not read the text under them. Then write the block
55
- back between the markers. Never start a second thread because of a broken TOC.
56
-
57
- ## Entry shape
58
-
59
- Use as many of these as apply. Leave out what does not fit.
60
-
61
- ```markdown
62
- ## <n>. <short title>
63
- **asked** DD-MM-YYYY HH:MM:SS
64
- > the user's request, word for word
65
-
66
- **kind** code-change | context-dig | investigate → code-change | pr-comments | …
67
- **resolved intent** one or two sentences: what you actually decided to do.
68
-
69
- **clarified**
70
- - <question> → **Y**: <what won> · X was <what the user first said> ·
71
- Z was <the other idea, and why it lost>
72
-
73
- **knowledge** wiki FRESH · docs=<paths> · pattern express@v3
74
-
75
- **dispatches**
76
- | # | kind | agent / model | expect | actual | result |
77
- |---|---|---|---|---|---|
78
- | 1 | recon | `orc-recon-sonnet-5-med` | sonnet-5-5/medium | sonnet-5-5/medium ✅ | what it found |
79
- | 2 | executor | `orc-executor-sonnet-5-med` | sonnet-5-5/medium | sonnet-5-5/medium ✅ | 3 files |
80
-
81
- Only an **other** dispatch keeps the `*(ad-hoc, untraced-by-hook)*` mark. A
82
- dispatch of either pinned recon agent is a normal row with the agent's name.
83
-
84
- **files changed** path · path · path
85
-
86
- **repro** red → green · `npm test -- tests/orders.search.test.js` (before: exit 1 · after: exit 0)
87
- **blast radius** 3 symbols · callers 7 in 4 files · tests reach 2 · risk high: searchByItemPrefix (exported, fan-in 4, no test reaches it)
88
- **tests** reached 12 passed · suite 41 passed
89
- **graph** gen 42 · cards 2 · <the `orc graph gain` line, word for word>
90
-
91
- **how it was resolved** a short, plain explanation of the fix and WHY this way.
92
- Say what you did not do, and why. This is the most useful part later.
93
-
94
- **build** GREEN · **tests** 41 passed
95
- **unmet** things you did not do, on purpose or not
96
-
97
- **follow-through** tests · review result · commit hash · pushed or not
98
- ```
99
-
100
- For PR work, also add:
101
-
102
- ```markdown
103
- **pr** #142 "title" · branch · url
104
-
105
- **threads taken** 2 of 3
106
- | # | reviewer | anchor | comment |
107
- |---|---|---|---|
108
- | 1 | @dana | src/routes/export.js:34 | the comment text |
109
-
110
- **github writes** NONE — no reply, no resolve, no review.
111
- ```
112
-
113
- These four lines are optional and go in that order, after `**files changed**`.
114
- Leave out the ones that do not apply:
115
-
116
- - **`repro`** — only on a defect entry. `repro: none` writes
117
- `**repro** not reproduced — <the reason>` instead. Never leave it out to keep
118
- the entry tidy: an unreproduced fix is the thing the reader most needs to know.
119
- - **`blast radius`** — a `risk` word NEVER appears without its `why`. Nothing in
120
- the graph → `none indexed (<n> files not in the graph)`.
121
- - **`graph`** — the gain line is an estimate with a range. Copy it; never turn
122
- it into a saving.
123
-
124
- ## A read-only entry
125
-
126
- A dig has no files, no build and no tests. It still gets a full entry:
127
-
128
- - **`how it was resolved`** holds the recon `answer`.
129
- - **`unmet`** holds the recon `unresolved[]`.
130
- - A blast-radius dig lists the four caller classes apart — `direct`, `route`
131
- (reached through a URL), `via_alias`, `inherited` — and, when any list rests
132
- on the graph alone, the sentence the agent returned, word for word:
133
- *A card lists every caller that NAMES the symbol. A card's silence is not
134
- proof of absence.*
135
-
136
- ## Writing style for entries
137
-
138
- Write for a person who comes back in three weeks and forgot everything.
139
-
140
- - Use plain words. Short sentences.
141
- - Always name real files and line numbers.
142
- - Say **why** you chose one option and not the other. A rejected idea with its
143
- reason saves the next person from trying it again.
144
- - Record what you did NOT do. "Backfill not done — user asked to leave it" is
145
- more useful than silence.
1
+ # The quick context doc — shape and rules
2
+
3
+ This is the file orc-quick writes after every request. It is written for a
4
+ HUMAN to read later, in this session or a different one.
5
+
6
+ ## Where it goes
7
+
8
+ ```
9
+ <projectRoot>/orc-quick/<slug>/quick-context.md
10
+ ```
11
+
12
+ - `<slug>` is the slug of the **first** request in the thread. No date in the
13
+ folder name.
14
+ - **One file per folder. Never make a second `.md` file.** No `review.md`, no
15
+ `diff.md`, no per-request files.
16
+ - It sits at the project root, next to folders like `test-generator/` and
17
+ `learning-docs/` — never inside `.claude/`.
18
+
19
+ ## Rules
20
+
21
+ 1. **Write it BEFORE the offers** (test / review / commit). If the user walks
22
+ away, the entry is still complete.
23
+ 2. **Every request gets an entry** — even a read-only dig. There, the answer IS
24
+ the result.
25
+ 3. **Never read the body of this file.** Only two exceptions:
26
+ - the TOC block, when you re-open a thread;
27
+ - the user asks you to read it.
28
+ 4. **Never commit it.** It is not staged, ever. Do not edit `.gitignore`.
29
+ 5. One entry can hold **several dispatches**. A dig that turns into a fix is ONE
30
+ entry with two rows in its table.
31
+
32
+ ## The TOC block
33
+
34
+ The top of the file has a short list between markers:
35
+
36
+ ```markdown
37
+ <!-- orc-quick:toc -->
38
+ 1. Change json payload A → B 05-08-2026 14:23:10 ✅ committed a1b2c3d
39
+ 2. How does tenant scoping work? 05-08-2026 15:47:02 ℹ answered
40
+ 3. Why does /orders 500? — found & fixed 10-08-2026 09:15:44 ✅ committed 7f2e1a9
41
+ <!-- /orc-quick:toc -->
42
+ ```
43
+
44
+ **Why the markers matter.** When you open a thread again, you need to know the
45
+ next number. You read ONLY this block — it is small and cheap. You do not read
46
+ the entries below it. That is how "never read the doc" and "keep counting" can
47
+ both be true.
48
+
49
+ Inside one session, the count is also kept in
50
+ `.claude/orc/run/<run-slug>/quick-checkpoint.md`. That file is run state, not
51
+ the deliverable, so you may read it freely.
52
+
53
+ **If the TOC is broken or missing:** rebuild it by scanning ONLY the lines that
54
+ start with `## <number>.`. Do not read the text under them. Then write the block
55
+ back between the markers. Never start a second thread because of a broken TOC.
56
+
57
+ ## Entry shape
58
+
59
+ Use as many of these as apply. Leave out what does not fit.
60
+
61
+ ```markdown
62
+ ## <n>. <short title>
63
+ **asked** DD-MM-YYYY HH:MM:SS
64
+ > the user's request, word for word
65
+
66
+ **kind** code-change | context-dig | investigate → code-change | pr-comments | …
67
+ **resolved intent** one or two sentences: what you actually decided to do.
68
+
69
+ **clarified**
70
+ - <question> → **Y**: <what won> · X was <what the user first said> ·
71
+ Z was <the other idea, and why it lost>
72
+
73
+ **knowledge** wiki FRESH · docs=<paths> · pattern express@v3
74
+
75
+ **dispatches**
76
+ | # | kind | agent / model | expect | actual | result |
77
+ |---|---|---|---|---|---|
78
+ | 1 | recon | `orc-recon-sonnet-5-med` | sonnet-5-5/medium | sonnet-5-5/medium ✅ | what it found |
79
+ | 2 | executor | `orc-executor-sonnet-5-med` | sonnet-5-5/medium | sonnet-5-5/medium ✅ | 3 files |
80
+
81
+ Only an **other** dispatch keeps the `*(ad-hoc, untraced-by-hook)*` mark. A
82
+ dispatch of either pinned recon agent is a normal row with the agent's name.
83
+
84
+ **files changed** path · path · path
85
+
86
+ **repro** red → green · `npm test -- tests/orders.search.test.js` (before: exit 1 · after: exit 0)
87
+ **blast radius** 3 symbols · callers 7 in 4 files · tests reach 2 · risk high: searchByItemPrefix (exported, fan-in 4, no test reaches it)
88
+ **tests** reached 12 passed · suite 41 passed
89
+ **graph** gen 42 · <the pack `line`, word for word>
90
+
91
+ **how it was resolved** a short, plain explanation of the fix and WHY this way.
92
+ Say what you did not do, and why. This is the most useful part later.
93
+
94
+ **build** GREEN · **tests** 41 passed
95
+ **unmet** things you did not do, on purpose or not
96
+
97
+ **follow-through** tests · review result · commit hash · pushed or not
98
+ ```
99
+
100
+ For PR work, also add:
101
+
102
+ ```markdown
103
+ **pr** #142 "title" · branch · url
104
+
105
+ **threads taken** 2 of 3
106
+ | # | reviewer | anchor | comment |
107
+ |---|---|---|---|
108
+ | 1 | @dana | src/routes/export.js:34 | the comment text |
109
+
110
+ **github writes** NONE — no reply, no resolve, no review.
111
+ ```
112
+
113
+ These four lines are optional and go in that order, after `**files changed**`.
114
+ Leave out the ones that do not apply:
115
+
116
+ - **`repro`** — only on a defect entry. `repro: none` writes
117
+ `**repro** not reproduced — <the reason>` instead. Never leave it out to keep
118
+ the entry tidy: an unreproduced fix is the thing the reader most needs to know.
119
+ - **`blast radius`** — a `risk` word NEVER appears without its `why`. Nothing in
120
+ the graph → `none indexed (<n> files not in the graph)`.
121
+ - **`graph`** — the pack `line`, as the CLI printed it. Copy it; never
122
+ change it.
123
+
124
+ ## A read-only entry
125
+
126
+ A dig has no files, no build and no tests. It still gets a full entry:
127
+
128
+ - **`how it was resolved`** holds the recon `answer`.
129
+ - **`unmet`** holds the recon `unresolved[]`.
130
+ - A blast-radius dig lists the four caller classes apart — `direct`, `route`
131
+ (reached through a URL), `via_alias`, `inherited` — and, when any list rests
132
+ on the graph alone, the sentence the agent returned, word for word:
133
+ *A card lists every caller that NAMES the symbol. A card's silence is not
134
+ proof of absence.*
135
+
136
+ ## Writing style for entries
137
+
138
+ Write for a person who comes back in three weeks and forgot everything.
139
+
140
+ - Use plain words. Short sentences.
141
+ - Always name real files and line numbers.
142
+ - Say **why** you chose one option and not the other. A rejected idea with its
143
+ reason saves the next person from trying it again.
144
+ - Record what you did NOT do. "Backfill not done — user asked to leave it" is
145
+ more useful than silence.