@azure-id/orc 1.8.1 → 1.9.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 (69) hide show
  1. package/CHANGELOG.md +386 -0
  2. package/README-id.md +110 -73
  3. package/README.md +96 -33
  4. package/bin/cli.js +45520 -44867
  5. package/bin/graph-extract.js +2409 -120
  6. package/bin/graph-gain.js +404 -0
  7. package/bin/graph-map.js +232 -0
  8. package/bin/graph-notes.js +49 -8
  9. package/bin/graph-query.js +1770 -808
  10. package/bin/graph-resolve.js +93 -16
  11. package/bin/graph-shard.js +325 -0
  12. package/bin/graph.js +658 -605
  13. package/bin/verify-contracts.js +297 -56
  14. package/bin/verify-package.js +29 -1
  15. package/bin/webui/api.js +6 -0
  16. package/bin/webui/fixtures/index.js +6 -1
  17. package/bin/webui/fixtures/knowledge.js +41 -1
  18. package/bin/webui/fixtures/stats.js +107 -104
  19. package/bin/webui/i18n/en/knowledge.json +16 -1
  20. package/bin/webui/i18n/id/knowledge.json +16 -1
  21. package/bin/webui/js/panels/knowledge.js +68 -3
  22. package/mock-run/orc-quick.md +141 -113
  23. package/package.json +1 -1
  24. package/templates/agents/MODEL-MAPPING.md +15 -5
  25. package/templates/agents/orc-executor-haiku-4-5.md +25 -13
  26. package/templates/agents/orc-executor-opus-4-7-high.md +25 -13
  27. package/templates/agents/orc-executor-opus-4-7-med.md +25 -13
  28. package/templates/agents/orc-executor-opus-4-8-high.md +25 -13
  29. package/templates/agents/orc-executor-opus-5-high.md +25 -13
  30. package/templates/agents/orc-executor-opus-5-low.md +25 -13
  31. package/templates/agents/orc-executor-opus-5-med.md +25 -13
  32. package/templates/agents/orc-executor-sonnet-4-6-high.md +25 -13
  33. package/templates/agents/orc-executor-sonnet-4-6-med.md +25 -13
  34. package/templates/agents/orc-executor-sonnet-5-high.md +25 -13
  35. package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +15 -12
  36. package/templates/agents/orc-planner-mini-opus-5-med.md +75 -69
  37. package/templates/agents/orc-planner-mini-sonnet-5-high.md +73 -67
  38. package/templates/agents/orc-recon-opus-5-low.md +99 -0
  39. package/templates/agents/orc-recon-sonnet-4-6-med.md +99 -0
  40. package/templates/commands/orc-mini.md +10 -12
  41. package/templates/commands/orc-quick.md +20 -33
  42. package/templates/hooks/README.md +13 -3
  43. package/templates/hooks/orc-graph-hook.js +148 -13
  44. package/templates/hooks/orc-trace.js +476 -471
  45. package/templates/skills/_shared/code-graph.md +148 -20
  46. package/templates/skills/_shared/phases/execution.md +13 -11
  47. package/templates/skills/_shared/phases/planning.md +8 -1
  48. package/templates/skills/_shared/phases/rules.md +172 -159
  49. package/templates/skills/_shared/phases/ship.md +5 -1
  50. package/templates/skills/_shared/phases/trace.md +4 -1
  51. package/templates/skills/_shared/phases/wiki-consult.md +10 -6
  52. package/templates/skills/_shared/read-ladder.md +10 -2
  53. package/templates/skills/_shared/return-validation.md +22 -0
  54. package/templates/skills/context-combiner/SKILL.md +13 -13
  55. package/templates/skills/orc/SKILL.md +1 -1
  56. package/templates/skills/orc/subskills/orc-execution/core.md +171 -159
  57. package/templates/skills/orc-analyze/SKILL.md +13 -13
  58. package/templates/skills/orc-diy/references/flow-schema.md +1 -1
  59. package/templates/skills/orc-mini/SKILL.md +148 -136
  60. package/templates/skills/orc-mini/examples/mini-run-mock.md +64 -50
  61. package/templates/skills/orc-mini/references/complexity.md +105 -0
  62. package/templates/skills/orc-quick/README.md +495 -423
  63. package/templates/skills/orc-quick/SKILL.md +157 -211
  64. package/templates/skills/orc-quick/references/context-doc.md +145 -114
  65. package/templates/skills/orc-quick/references/defect.md +101 -0
  66. package/templates/skills/orc-quick/references/dispatch-gate.md +55 -24
  67. package/templates/skills/orc-quick/references/gh-mode.md +148 -127
  68. package/templates/skills/orc-quick/references/look.md +107 -0
  69. package/templates/skills/orc-wiki/references/staleness.md +1 -1
@@ -1,159 +1,172 @@
1
- # Phase — Rules (id: `rules`)
2
-
3
- > **Library file.** New at v1.7.0 W5. Layers declared: `core` only — single-layer
4
- > for the same reason `house-rules.md` is: it is a standing card injected
5
- > VERBATIM into a slice, and a layered card would be a different card. What
6
- > varies between lanes is DATA (which packs, whether a task is front-end), not
7
- > prose. `orc lane phases <lane> --json` names the file and the layers to read.
8
- >
9
- > **What is NOT here:** the rules. They are `../rules/` — four packs, read-only,
10
- > shipped. This file is the SHAPE: who assembles the card, where it sits in a
11
- > slice, what comes back, and what the phase must never do.
12
- >
13
- > **`/orc-doc` does not run this phase.** That lane has its own ledger
14
- > (`orc doc rules`) and its own frozen-per-document mechanic. Excluded means
15
- > excluded, and `orc rules slice --lane orc-doc` refuses by name.
16
-
17
- <!-- orc:layer core -->
18
-
19
- ## One assembler, and it is not you
20
-
21
- ```
22
- orc rules slice --lane <lane> [--pack ui] [--json]
23
- ```
24
-
25
- That command is the **only** thing that builds this card. A lane never
26
- concatenates the packs itself, never re-orders them, never summarises a rule and
27
- never drops one it judges irrelevant.
28
-
29
- Two reasons, and both have cost this repo money elsewhere:
30
-
31
- 1. **Drift.** A card assembled in twenty-eight spines is twenty-eight ideas of
32
- the precedence order. The same argument as `orc lane phases`: *a second idea
33
- of the pipeline is the drift this exists to make impossible.*
34
- 2. **Cost.** This card rides on **every spawn**. One assembler is the only place
35
- its token weight can be measured, and therefore the only place it can be cut.
36
-
37
- Print the command's `line` VERBATIM at preflight. Never compute it:
38
-
39
- ```
40
- rules: ORC 65 (W 23 · C 22 · D 10 · U 10) · yours 9 lines (P0 4 · P1 2 · P2 3) · 1 override
41
- rules: ORC 65 (W 23 · C 22 · D 10 · U 10) · yours none
42
- ```
43
-
44
- **Both spellings are mandatory in their state.** `yours none` is an ANSWER — it
45
- says the project has not written its own rules, which is a different fact from
46
- the CLI failing to look.
47
-
48
- ## Where it sits in a slice — the order IS the contract
49
-
50
- ```
51
- 1 HOUSE RULES ./house-rules.md, injected verbatim
52
- 2 YOUR PROJECT'S RULES from the slice, P0 then P1 then P2, verbatim
53
- 3 ORC RULES from the slice, the packs this lane carries
54
- 4 the task the lane's own dispatch contract
55
- ```
56
-
57
- Nothing goes above 1. Nothing goes between 2 and 3. The assembler emits 2 and 3
58
- as one block in that order, so the lane's job is to place that block directly
59
- under the house card and before the task.
60
-
61
- **The slice field is `rules_card`, and it is the `text` field — not the `line`.**
62
- Run the command at DISPATCH, not only at preflight. The `line` tells the user
63
- which rules are in force; the `text` is what the agent reads. A lane that prints
64
- the line and injects only the house card has reported rules that no agent got.
65
-
66
- ## Precedence, and the one sentence that gets it wrong
67
-
68
- ```
69
- house rules > your rules > ORC rules
70
- ```
71
-
72
- **The house card is CODE and BEHAVIOUR only.** It governs how a change is made:
73
- surgical, simple, honest, in-slice. It says nothing about the words an agent
74
- writes, so it never overrules a writing rule — *it does not speak about prose at
75
- all.* A lane that presents the house card as beating `OSW-*` has misread it.
76
-
77
- **A project rule beats an ORC rule outright.** Not a waiver and not a
78
- negotiation: the ORC rule is removed from the slice, and the removal is stated
79
- inside it. The assembler does that. The lane does not decide it.
80
-
81
- Where a lane's preflight prints a report rather than a bare line, the report
82
- **names** each override. An override the user cannot see is an override they
83
- cannot audit.
84
-
85
- ## The `ui` pack rides per TASK, never per lane
86
-
87
- `ui` is in no lane's default set. Add it to a single slice, at dispatch time:
88
-
89
- > If a task's **declared files** are front-end — `.css`, `.scss`, `.html`,
90
- > `.jsx`, `.tsx`, `.vue`, `.svelte`, or a directory the wiki or the cached
91
- > pattern identifies as the UI layer — assemble that task's card with
92
- > `--pack ui`. Otherwise do not.
93
-
94
- A UI rule in a backend slice is tokens paid on every spawn for a rule that
95
- cannot apply. A lane that dispatches no tasks never passes `--pack ui` at all.
96
-
97
- ## What comes back
98
-
99
- Every return from a slice that carried this card gains three fields
100
- (`../return-validation.md`):
101
-
102
- | Field | What it holds |
103
- |---|---|
104
- | `rules_applied[]` | the ids the agent acted on |
105
- | `rules_conflicts[]` | two rules that disagree. **A gap, never a silent choice** |
106
- | `rules_overridden[]` | an ORC id a project rule replaced |
107
-
108
- A `rules_conflicts[]` entry is relayed to the user as a gap through the lane's
109
- own gap channel. Resolving it quietly is the failure the field exists to prevent.
110
-
111
- ## The boundary — declared, never validated
112
-
113
- Rules govern **what is written and how it reads**, and **what shape of code is
114
- acceptable**. They can never change how a lane **runs**: the scoring, the wave
115
- order, the gates, the dispatch contract, the ship rules, or any lane's
116
- structural and safety rules.
117
-
118
- A rule that asks for one of those comes back as `unsupported_request` and is
119
- relayed as a gap. **Never a guessed compromise.**
120
-
121
- **Do not build a detector for this.** The CLI declares the boundary and does not
122
- pretend to enforce it, for the reason `orc doc rules` already settled: a
123
- validator that sometimes works is worse than none, because a clean pass then
124
- means nothing. The agent is the only reader that can tell a content rule from a
125
- structural one, so the agent is where the answer comes from.
126
-
127
- ## The free lint
128
-
129
- ```
130
- orc rules lint <path…|--staged|--diff> [--pack w,c,d,u] [--json]
131
- ```
132
-
133
- Deterministic, zero tokens. Exit `0` clean · `1` findings · `2` nothing to lint.
134
-
135
- It checks only the rules a string match can prove, and it prints — in every
136
- mode — how many it did not check. **Relay that coverage line whenever you relay
137
- a lint result.** A clean exit allowed to stand in for a review nobody did is the
138
- whole failure that line prevents.
139
-
140
- Findings are ADVISORY. This phase adds no gate: a style preference that fails a
141
- build gets switched off within a week, and then nothing is enforced at all.
142
-
143
- An exemption is never silent either. The lint skips the rules packs themselves
144
- (a rule that bans a word has to print that word to define it) and any file
145
- marked `orc-rules-ignore-file`, and it reports the count of both.
146
-
147
- ## Cost, and where to cut it
148
-
149
- Measured at v1.7.0: roughly **3 600 tokens** per build-lane slice, **4 300** with
150
- the UI pack, **2 200** for a prose-only lane. The card already carries HARD rules
151
- in full and PURPOSE/LOCK rules as one line plus the file to open when one
152
- applies.
153
-
154
- If it must come down, the lever is the worked examples inside the HARD bodies,
155
- and the only place to pull it is `rulesSlice()` in `bin/cli.js`. **Never by a
156
- lane deciding to trim its own card** — that is the drift this phase exists to
157
- prevent, arriving disguised as a saving.
158
-
159
- <!-- /orc:layer -->
1
+ # Phase — Rules (id: `rules`)
2
+
3
+ > **Library file.** New at v1.7.0 W5. Layers declared: `core` only — single-layer
4
+ > for the same reason `house-rules.md` is: it is a standing card injected
5
+ > VERBATIM into a slice, and a layered card would be a different card. What
6
+ > varies between lanes is DATA (which packs, whether a task is front-end), not
7
+ > prose. `orc lane phases <lane> --json` names the file and the layers to read.
8
+ >
9
+ > **What is NOT here:** the rules. They are `../rules/` — four packs, read-only,
10
+ > shipped. This file is the SHAPE: who assembles the card, where it sits in a
11
+ > slice, what comes back, and what the phase must never do.
12
+ >
13
+ > **`/orc-doc` does not run this phase.** That lane has its own ledger
14
+ > (`orc doc rules`) and its own frozen-per-document mechanic. Excluded means
15
+ > excluded, and `orc rules slice --lane orc-doc` refuses by name.
16
+
17
+ <!-- orc:layer core -->
18
+
19
+ ## One assembler, and it is not you
20
+
21
+ ```
22
+ orc rules slice --lane <lane> [--pack ui] [--json]
23
+ ```
24
+
25
+ That command is the **only** thing that builds this card. A lane never
26
+ concatenates the packs itself, never re-orders them, never summarises a rule and
27
+ never drops one it judges irrelevant.
28
+
29
+ Two reasons, and both have cost this repo money elsewhere:
30
+
31
+ 1. **Drift.** A card assembled in twenty-eight spines is twenty-eight ideas of
32
+ the precedence order. The same argument as `orc lane phases`: *a second idea
33
+ of the pipeline is the drift this exists to make impossible.*
34
+ 2. **Cost.** This card rides on **every spawn**. One assembler is the only place
35
+ its token weight can be measured, and therefore the only place it can be cut.
36
+
37
+ Print the command's `line` VERBATIM at preflight. Never compute it:
38
+
39
+ ```
40
+ rules: ORC 65 (W 23 · C 22 · D 10 · U 10) · yours 9 lines (P0 4 · P1 2 · P2 3) · 1 override
41
+ rules: ORC 65 (W 23 · C 22 · D 10 · U 10) · yours none
42
+ ```
43
+
44
+ **Both spellings are mandatory in their state.** `yours none` is an ANSWER — it
45
+ says the project has not written its own rules, which is a different fact from
46
+ the CLI failing to look.
47
+
48
+ ## Where it sits in a slice — the order IS the contract
49
+
50
+ ```
51
+ 1 HOUSE RULES ./house-rules.md, injected verbatim
52
+ 2 YOUR PROJECT'S RULES from the slice, P0 then P1 then P2, verbatim
53
+ 3 ORC RULES from the slice, the packs this lane carries
54
+ 4 the task the lane's own dispatch contract
55
+ ```
56
+
57
+ Nothing goes above 1. Nothing goes between 2 and 3. The assembler emits 2 and 3
58
+ as one block in that order, so the lane's job is to place that block directly
59
+ under the house card and before the task.
60
+
61
+ **The slice field is `rules_card`, and it is the `text` field — not the `line`.**
62
+ Run the command at DISPATCH, not only at preflight. The `line` tells the user
63
+ which rules are in force; the `text` is what the agent reads. A lane that prints
64
+ the line and injects only the house card has reported rules that no agent got.
65
+
66
+ ## Precedence, and the one sentence that gets it wrong
67
+
68
+ ```
69
+ house rules > your rules > ORC rules
70
+ ```
71
+
72
+ **The house card is CODE and BEHAVIOUR only.** It governs how a change is made:
73
+ surgical, simple, honest, in-slice. It says nothing about the words an agent
74
+ writes, so it never overrules a writing rule — *it does not speak about prose at
75
+ all.* A lane that presents the house card as beating `OSW-*` has misread it.
76
+
77
+ **A project rule beats an ORC rule outright.** Not a waiver and not a
78
+ negotiation: the ORC rule is removed from the slice, and the removal is stated
79
+ inside it. The assembler does that. The lane does not decide it.
80
+
81
+ Where a lane's preflight prints a report rather than a bare line, the report
82
+ **names** each override. An override the user cannot see is an override they
83
+ cannot audit.
84
+
85
+ ## The `ui` pack rides per TASK, never per lane
86
+
87
+ `ui` is in no lane's default set. Add it to a single slice, at dispatch time:
88
+
89
+ > If a task's **declared files** are front-end — `.css`, `.scss`, `.html`,
90
+ > `.jsx`, `.tsx`, `.vue`, `.svelte`, or a directory the wiki or the cached
91
+ > pattern identifies as the UI layer — assemble that task's card with
92
+ > `--pack ui`. Otherwise do not.
93
+
94
+ A UI rule in a backend slice is tokens paid on every spawn for a rule that
95
+ cannot apply. A lane that dispatches no tasks never passes `--pack ui` at all.
96
+
97
+ ## What comes back
98
+
99
+ Every return from a slice that carried this card gains three fields
100
+ (`../return-validation.md`):
101
+
102
+ | Field | What it holds |
103
+ |---|---|
104
+ | `rules_applied[]` | the ids the agent acted on |
105
+ | `rules_conflicts[]` | two rules that disagree. **A gap, never a silent choice** |
106
+ | `rules_overridden[]` | an ORC id a project rule replaced |
107
+
108
+ A `rules_conflicts[]` entry is relayed to the user as a gap through the lane's
109
+ own gap channel. Resolving it quietly is the failure the field exists to prevent.
110
+
111
+ ## The boundary — declared, never validated
112
+
113
+ Rules govern **what is written and how it reads**, and **what shape of code is
114
+ acceptable**. They can never change how a lane **runs**: the scoring, the wave
115
+ order, the gates, the dispatch contract, the ship rules, or any lane's
116
+ structural and safety rules.
117
+
118
+ A rule that asks for one of those comes back as `unsupported_request` and is
119
+ relayed as a gap. **Never a guessed compromise.**
120
+
121
+ **Do not build a detector for this.** The CLI declares the boundary and does not
122
+ pretend to enforce it, for the reason `orc doc rules` already settled: a
123
+ validator that sometimes works is worse than none, because a clean pass then
124
+ means nothing. The agent is the only reader that can tell a content rule from a
125
+ structural one, so the agent is where the answer comes from.
126
+
127
+ ## The free lint
128
+
129
+ ```
130
+ orc rules lint <path…|--staged|--diff> [--pack w,c,d,u] [--json]
131
+ ```
132
+
133
+ Deterministic, zero tokens. Exit `0` clean · `1` findings · `2` nothing to lint.
134
+
135
+ It checks only the rules a string match can prove, and it prints — in every
136
+ mode — how many it did not check. **Relay that coverage line whenever you relay
137
+ a lint result.** A clean exit allowed to stand in for a review nobody did is the
138
+ whole failure that line prevents.
139
+
140
+ Findings are ADVISORY. This phase adds no gate: a style preference that fails a
141
+ build gets switched off within a week, and then nothing is enforced at all.
142
+
143
+ An exemption is never silent either. The lint skips the rules packs themselves
144
+ (a rule that bans a word has to print that word to define it) and any file
145
+ marked `orc-rules-ignore-file`, and it reports the count of both.
146
+
147
+ ## Cost, and where to cut it
148
+
149
+ Measured at v1.7.0: roughly **3 600 tokens** per build-lane slice, **4 300** with
150
+ the UI pack, **2 200** for a prose-only lane. The card already carries HARD rules
151
+ in full and PURPOSE/LOCK rules as one line plus the file to open when one
152
+ applies.
153
+
154
+ If it must come down, the lever is the worked examples inside the HARD bodies,
155
+ and the only place to pull it is `rulesSlice()` in `bin/cli.js`. **Never by a
156
+ lane deciding to trim its own card** — that is the drift this phase exists to
157
+ prevent, arriving disguised as a saving.
158
+
159
+ **v1.9.0 — the COMPACT form, and the CLI decides which lanes get it.** The
160
+ lever above is now pulled for **`orc-quick`** and for no one else: every HARD
161
+ rule keeps its id, its title and its first line — the instruction — and the
162
+ worked examples come out, with the pack file named beside them. Measured
163
+ **13 874 → 5 838 chars** (~3 470 → ~1 460 tokens) with every HARD id still
164
+ present. The lane that gets it is the lane with the smallest tasks under the
165
+ largest fixed card, and the card is re-sent on every executor turn.
166
+
167
+ The answer says which form it is: `compact: true` in the JSON. A reader that
168
+ cannot tell a short card from a stripped one cannot trust either. `line` is
169
+ IDENTICAL in both forms — it counts the rules in force, and compacting changes
170
+ how a rule is written, never whether it applies.
171
+
172
+ <!-- /orc:layer -->
@@ -53,7 +53,11 @@ subagent). The user must always know what the run cost. **Code graph
53
53
  (`../code-graph.md` §5–§6):** run `orc graph update --if-enabled` once more —
54
54
  fix rounds move code — and emit `GRAPH-UPDATE`; then run `orc graph notes pending
55
55
  --files <every path the run changed> --at end --if-enabled` — exit 0 → one noter
56
- dispatch, exit 3 or 5 → nothing. Finally emit
56
+ dispatch, exit 3 or 5 → nothing. Then ONE line, once, copied VERBATIM from
57
+ `orc graph gain --run <this run's trace name> --if-enabled --json` (emit
58
+ `GRAPH-GAIN`): what the graph put in, and an ESTIMATE of the retrieval it kept
59
+ out. Exit 1 or 3 → no line. **Never restate it as one number** — the range and
60
+ the word "estimate" are the claim. Finally emit
57
61
  `PHASE ship end`, then the one-line `STATS lane=… dispatches=… downgrades=…`
58
62
  summary (trace.md — what `orc stats` reads), then `FINISH :: <detail>`,
59
63
  and in ONE step delete BOTH `log_dir/.current` and the run's `RESUME.md` (that
@@ -227,15 +227,17 @@ supplies the fact in a packet, the writer writes the line. `SPAWN`, `RETURN` and
227
227
  | Verb | Emitted by | Meaning |
228
228
  |------|-----------|---------|
229
229
  | `PHASE <name> start\|end` | orc → writer | phase transition |
230
- | `PHASE-EDGE <role-family> :: first=<agent>` | hook | **deterministic phase inference.** ORC agent names encode their role, so when a SPAWN's role family differs from the previous SPAWN's, the hook segments the run itself — families: `analyst\|scout → analysis`, `planner → planning`, `executor → execution`, `reviewer → review`, `verifier → verify`, `test-author → testgen`, `advisor\|judge → ultra-gate` (the trace writer never opens an edge). Zero model dependence: even a run where every writer dispatch was forgotten still reads planning → execution → review → verify, and `/orc-retro` computes NARRATION COVERAGE from edges with vs without a writer `SPAWN` between them |
230
+ | `PHASE-EDGE <role-family> :: first=<agent>` | hook | **deterministic phase inference.** ORC agent names encode their role, so when a SPAWN's role family differs from the previous SPAWN's, the hook segments the run itself — families: `recon → recon` (v1.9.0 — /orc-quick's read-only half; a question answered for a person is not an analysis), `analyst\|scout → analysis`, `planner → planning`, `executor → execution`, `reviewer → review`, `verifier → verify`, `test-author → testgen`, `advisor\|judge → ultra-gate` (the trace writer never opens an edge). Zero model dependence: even a run where every writer dispatch was forgotten still reads planning → execution → review → verify, and `/orc-retro` computes NARRATION COVERAGE from edges with vs without a writer `SPAWN` between them |
231
231
  | `CONFIG <key=value …>` | orc → writer | Phase 1 — the resolved config values this run will consume (ALWAYS `opus5_only` — it selects the executor table AND every fixed role, so retro can segment outcomes by dispatch mode). Runtime proof that the run honored the config; `/orc-retro` audits it against behavior |
232
232
  | `WIKI-CONSULT <tier> :: docs=<list>` | orc → writer | project wiki consulted for grounding (full/mini at planning; fast at slice-build) — tier ∈ `fresh` \| `aging` \| `stale` \| `absent` \| `empty`; `docs=` the pages pulled/handed to the executor (comma list) or `none`. Records whether the run grounded in the wiki and whether it was stale (surfaces grounding + staleness for later audit) |
233
233
  | `CROSSLINK <state> :: boundaries=<n> peers=<names>` | orc → writer | cross-repo peer-knowledge state at the consult point — state ∈ `cached` (peer cache present) \| `configured-no-cache` (crosslink configured but the cache is not built) \| `none`. Per-task `CROSSLINK inject task=<id> :: <boundary>` when a slice receives a linked contract. Records whether peer contracts were injected this run (full orc consumes only the pre-built crosslink cache — it never reads peer source live; mechanism in `wiki-consult.md`) |
234
234
  | `GRAPH-CONSULT <state> :: files=<n> symbols=<n>` | orc → writer | the code graph's preflight state (`code-graph.md` §4) — state ∈ `fresh` \| `updated` \| `built` \| `drifted` \| `none` \| `off`. Copied VERBATIM from the `trace` field of `orc graph status --heal --json`; a `GATE` line that describes the graph in other words does not replace it. Plus `GRAPH-CONSULT card task=<id> :: targets=<…>` (the `trace` of `orc graph ctx --json`, with `task=` added) when a slice receives cards |
235
235
  | `GRAPH-UPDATE <state> :: parsed=<n> reused=<n> deleted=<n> gen=<n> route=<n> ms=<n>` | orc → writer | one graph update at a wave close, a green smoke gate, a code-writing `/orc-quick` request, or ship — the `trace` field of `orc graph update --json`, verbatim. The graph HOOK writes its own `GRAPH-UPDATE … :: by=hook …` lines directly; never copy one of those, it is already in the file |
236
+ | `GRAPH-MAP <repo|focused> :: files=<shown>/<total> [focus=<a,b>] gen=<n>` | orc → writer | ONE line at the START of planning (and at a `/orc-quick` Q1 look that had no file to name) — the `trace` field of `orc graph map --json`, verbatim. `files=` is how many the budget SHOWED over how many the repository has, so a short map can be told from a small repository. `focused` means `--focus` re-ranked the repository around what the request named. RANK is a hint about where to look first and the trace never says more than that |
236
237
  | `GRAPH-CHANGES <found\|none> :: symbols=<n> high=<n> medium=<n> low=<n> gen=<n>` | orc → writer | one line at review — the `trace` field of `orc graph changes --json`, verbatim. `high` counts symbols that are exported, have three or more callers and NO test reaching them |
237
238
  | `GRAPH-COCHANGE <found\|none> :: rows=<n> commits=<n>` | orc → writer | one line per planning batch, not per file — the `trace` field of `orc graph cochange --json` for the file that produced the widest answer |
238
239
  | `GRAPH-HINT injected=<n> subagent_start=<n> read_notes=<n> updates=<n>` | orc → writer | ONE line per phase close, not one per hint — the counters `orc-graph-hook.js` keeps in `<log_dir>/<run>.graph-hook.json`. Omitted when the file does not exist (the hook is off, or it never had anything to say) |
240
+ | `GRAPH-GAIN paid=<n> low=<n> high=<n> calls=<n>` | orc → writer | ONE line per run, at ship — the `trace` field of `orc graph gain --run <trace name> --json`, verbatim. `paid` is exact (the tokens the graph put in); `low`/`high` are an ESTIMATE of the retrieval it kept out, and they are never collapsed into one number. Omitted when the ledger is empty or the graph is off |
239
241
  | `GRAPH-NOTES <applied\|below-min\|none\|deferred\|off\|skipped> :: <detail>` | orc → writer | one notes batch: the noter's ONE-line return copied verbatim (`applied`), the `trace` field of `orc graph notes pending --json` when it exited 3 or 5, `skipped` under the Opus-5-only mode |
240
242
  | `SPAWN <agent>` | hook | an agent dispatch was observed (skeleton) |
241
243
  | `RETURN <agent> :: <desc> dur=<m>m<s>s [model=<id>]` | hook | a subagent finished (skeleton). The hook attributes the RETURN to the finishing agent from the SubagentStop payload (`~<agent>` = approximate FIFO match on older Claude Code that omits `agent_type`; `~agent :: unattributed` = ≥2 agents in flight, so it deliberately claimed NO pending record rather than starve the right one), echoes the SPAWN's desc + wall-clock duration, and appends `model=<id>` when the return's `actual_model` is visible in the last message. A duplicate stop for an agent whose record was already consumed is DROPPED, never written as a desc-less RETURN. Still hook-written skeleton — NOT an orchestrator obligation; the authoritative model check is the `VERIFY` line |
@@ -254,6 +256,7 @@ supplies the fact in a packet, the writer writes the line. `SPAWN`, `RETURN` and
254
256
  | `DRIFT loop=<n> :: <user description, compressed>` | orc → writer | mock-example drift-recovery loop opened (`PHASE mock-example`; canonical `_shared/drift-recovery.md`; hard cap 2 loops) |
255
257
  | `TDD-RED task=<id> iter=<n> :: <failing tests>` | executor→orc → writer | TDD repair-loop iteration — the plan's acceptance tests still red (cap `tdd_loop_max`; a paired TDD task's red proof also emits iter=0) |
256
258
  | `TDD-GREEN task=<id> iter=<n>` | executor→orc → writer | the task's TDD acceptance tests pass (the non-exempt definition-of-done) |
259
+ | `REPRO red\|green :: <cmd> exit=<n>` | executor→orc → writer | a DEFECT task's reproduction, before and after the fix (`_shared/return-validation.md` §5d). TWO lines per reproduced defect, in this order: the `before` run must be RED and the `after` run GREEN, or the return was malformed. `REPRO none :: <reason>` when no reproduction could be written — an honest answer, never a missing line. A reproduction is NOT a plan-time acceptance test, so it never reuses `TDD-RED`/`TDD-GREEN`: `/orc-retro` counts "we proved the bug first" apart from "we drove the plan's acceptance tests" |
257
260
  | `NOTE :: <decisions>` | writer | the packet's `decisions` field — the WHY layer (scoring rationale, user answers verbatim, what was rejected). One line per packet, only when `decisions` is non-empty |
258
261
  | `STATS lane=<l> slug=<s> dispatches=<n> waves=<n> tasks=<n> bands=<h:n,m:n,l:n> downgrades=<n> duration_ms=<n>` | orc → writer | ONE deterministic summary line per run, in the `FINISH` packet, immediately BEFORE the `FINISH` line. This is what `orc stats` reads — one line per file, never a parse of the whole trace. Omit a field you genuinely do not have (a lane with no waves omits `waves=`); never guess one. Every trace-owning lane emits it, not just `orc` |
259
262
  | `PACT <state> :: <ids>` | orc → writer | invariant-ledger state at the Phase-1 probe (`pact_gate`), and `PACT inject task=<id> :: <PACT-id>` when a DRIFTED/BROKEN promise is appended to a task's `constraints[]`. `PACT recheck pass\|fail :: <ids>` at Phase 6. Records whether last month's decisions constrained this month's plan |
@@ -74,19 +74,23 @@ in play.
74
74
  whenever the request uses project jargon, `orc-reference-config-env` for
75
75
  config/env work.
76
76
 
77
- **Lane delta — orc-fast passes POINTERS, not content:** fast selects 1–3 page
78
- PATHS from `wiki/INDEX.md` and puts the paths in the executor slice with the
77
+ **Lane delta — orc-fast and orc-mini pass POINTERS, not content:** each selects
78
+ 1–3 page PATHS from `wiki/INDEX.md` and puts the paths in its slices with the
79
79
  instruction to READ them first (TL;DR for orientation, `Contracts & shapes` for
80
- specifics). Fast never pastes wiki bodies into a slice (a Sonnet-medium
81
- orchestrator curating wiki prose defeats the lane). Full/mini read the content
82
- themselves at planning time.
80
+ specifics). Neither pastes a wiki body into a slice, and neither reads one into
81
+ its OWN context — for fast, a Sonnet-medium orchestrator curating wiki prose
82
+ defeats the lane; for mini (v1.9.0), the orchestrator's context is the surface
83
+ that fills up first, and the planner and the executor can read a page far more
84
+ cheaply than it can carry one. The FULL lane still reads the content itself at
85
+ planning time, because it has a reviewer and a verifier to spend that context
86
+ on.
83
87
 
84
88
  ## Step 3 — Precedence (everywhere the wiki is consumed)
85
89
 
86
90
  `code > fresh wiki > stale wiki (hints) > model priors`
87
91
 
88
92
  When the code graph is on, it slots in without changing that order —
89
- `code > graph structure (current blob) > fresh wiki > stale wiki (hints) > graph notes > model priors`
93
+ `code > graph structure (current blob) > fresh wiki > stale wiki (hints) > graph notes and doc notes > model priors`
90
94
  — canonical in `../code-graph.md`. The graph never needs a wiki: an absent wiki
91
95
  changes nothing about how the graph is consulted.
92
96
 
@@ -21,7 +21,7 @@ Escalate one step at a time. Stop at the step that answers the question.
21
21
  |------|----|----------------|
22
22
  | 1. Locate | `Grep` / `Glob` for the symbol, route, config key, or error string | You only needed to know WHERE it is |
23
23
  | 2. Outline | Read the file's declaration lines — imports, exports, top-level signatures | You needed the API surface |
24
- | 3. Range | Read the ±40 lines around the anchor found in step 1 | You needed one function's behaviour |
24
+ | 3. Range | Read the ±40 lines around the anchor found in step 1 — or let step 0 print them (`--source`) | You needed one function's behaviour |
25
25
  | 4. Full | Read the whole file | It is the subject of the task — or you will edit it |
26
26
 
27
27
  ## Step 0 — ask the graph (always first; the CLI decides if it is on)
@@ -32,6 +32,14 @@ answers step 1 and step 2 together: where the symbol is, its line range, who
32
32
  calls or uses it, what it calls, and which effects it has. Then continue at
33
33
  step 3 — read the RANGE the card names before you act on behaviour. The graph is
34
34
  a locator, never the truth: a card whose header says CHANGED is hints only.
35
+
36
+ **`--source [N]` answers step 3 in the SAME call** (v1.8.2). `orc graph ctx
37
+ <symbol> --source --if-enabled --json` prints the card and then the target's own
38
+ lines (default 80, hard cap 200), charged against the same `--budget`; the
39
+ footer says how many lines it cut. Use it for the CALLER'S range, the callee's,
40
+ the neighbour you will not touch. **It never replaces exception 1**: a file you
41
+ will EDIT is read IN FULL with `Read` first, because an `old_string` rebuilt
42
+ from a printed range is the same corruption bug as one rebuilt from an outline.
35
43
  Exit 3 (off) → skip step 0 for the rest of the task. Exit 1 (no index) or 4 (not
36
44
  in the graph) → step 1 as before. Name the card targets you used in
37
45
  `graph_used`. Both exceptions below apply unchanged.
@@ -117,7 +125,7 @@ The ladder governs HOW MUCH to read. It never decides WHETHER knowledge exists
117
125
  that is `detecting-artifacts.md` — and it never overrides precedence:
118
126
  `code > fresh wiki > stale wiki (hints) > model priors`. With the code graph on,
119
127
  the same order gains two rungs and loses none:
120
- `code > graph structure (current blob) > fresh wiki > stale wiki (hints) > graph notes > model priors`.
128
+ `code > graph structure (current blob) > fresh wiki > stale wiki (hints) > graph notes and doc notes > model priors`.
121
129
 
122
130
  What a lane INVOKES, and what each exit code means, is not here either: that is
123
131
  `orc lane calls <lane> --json`, whose catalogue is the one copy of every call
@@ -231,6 +231,28 @@ A rule the slice could not honour because this lane structurally cannot do it
231
231
  comes back as `unsupported_request`, relayed as a gap. **Never a guessed
232
232
  compromise.**
233
233
 
234
+ ## 5d. Reproduce-first attestation (when a `repro` was requested — v1.9.0)
235
+
236
+ A slice that carried `repro: {required: true, kind, hint}` must come back with a
237
+ `repro` field. Either both runs, quoted verbatim, or an honest `none`:
238
+
239
+ ```
240
+ repro: { command, before: {exit_code, tail}, after: {exit_code, tail} }
241
+ repro: none — <one line of reason>
242
+ ```
243
+
244
+ Two malformed shapes, and they are the whole point of the field. **`status=done`
245
+ with `before.exit_code` 0** means the "reproduction" never failed, so it proved
246
+ nothing; **`status=done` with a non-zero `after.exit_code`** means the bug is
247
+ still there. Either one is a failure of the return, not a finding about the
248
+ code. A `repro: none` is a valid answer — a defect with no reachable entry point
249
+ and no runner cannot be shown red — and the lane says **not reproduced** out
250
+ loud rather than letting a green suite imply a fixed bug.
251
+
252
+ `repro` is required ONLY when the slice carried `repro.required: true`. A slice
253
+ that asked for none gets none back, exactly like `tdd_spec`, `wiki_used` and
254
+ `graph_used`.
255
+
234
256
  ## 6. Worktree delta (post-wave, every lane that dispatches executors)
235
257
 
236
258
  Compare `git status --short` before and after each dispatch. A path that
@@ -11,10 +11,10 @@ description: >
11
11
  collapsed, conflicts, ordering) one issue at a time; proves NOTHING WAS LOST
12
12
  via a source coverage matrix and a 100% coverage gate before handoff;
13
13
  spot-checks inherited evidence and marks stale anchors; writes
14
- combined-report.md + combined-requirement-spec.md (the merged spec reuses the
15
- requirement-spec schema, so the planner/build pipeline is unchanged). Full
16
- lane only (Opus 5 high). The orchestrator DISPATCHES this to a subagent —
17
- it never combines itself, and the combiner never builds or spawns subagents.
14
+ combined-report.md + combined-requirement-spec.md, which reuse the
15
+ requirement-spec schema, so the planner/build pipeline is unchanged. Full
16
+ lane only. The orchestrator DISPATCHES this to a subagent — it never
17
+ combines itself, and the combiner never spawns subagents.
18
18
  ---
19
19
 
20
20
  # CONTEXT-COMBINER
@@ -211,12 +211,12 @@ exit code, and never re-derive a state word — the CLI's state words are the on
211
211
  state words, and **an exit code is an ANSWER wherever that contract says so, not
212
212
  a failure**. A call the answer does not name is a call this lane does not make.
213
213
  Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
214
- command you are about to run, out loud, before running it.
215
-
216
- ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
217
-
218
- `orc rules slice --lane context-combiner --json` is the ONLY assembler; never build
219
- the card here. It rides under the house rules and above the task —
220
- **house rules > your project's rules > ORC's own packs** — and its `line` prints
221
- VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
222
- never a silent choice) and `rules_overridden[]`.
214
+ command you are about to run, out loud, before running it.
215
+
216
+ ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
217
+
218
+ `orc rules slice --lane context-combiner --json` is the ONLY assembler; never build
219
+ the card here. It rides under the house rules and above the task —
220
+ **house rules > your project's rules > ORC's own packs** — and its `line` prints
221
+ VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
222
+ never a silent choice) and `rules_overridden[]`.
@@ -205,7 +205,7 @@ them; they are never dispatched as subagents).
205
205
  - Phase 5.5 → `../_shared/phases/security-checklist.md`; 6.5 → `subskills/orc-testgen/`
206
206
  - Phase 8 → `subskills/orc-pr/SKILL.md` (template `subskills/orc-pr/pr.md`);
207
207
  stack gate → `subskills/orc-pr/stack-gate.md` + `_shared/pr-templates.md`
208
- - Code graph cache, NEVER skipped (§0 of the contract) — `orc graph status --if-enabled --heal --json` at preflight BEFORE the first dispatch (builds or updates it) · ONE `orc graph ctx <declared files>` call per slice · `orc graph impact` + `orc graph cochange` at planning, `orc graph changes` at review · `orc graph coverage` before you trust a card's silence · `orc graph update` + `orc graph notes` at every wave close and ship · print each JSON `line`, copy each `trace` VERBATIM (CLI-resolved) → `../_shared/code-graph.md`
208
+ - Code graph cache, NEVER skipped (§0 of the contract) — `orc graph status --if-enabled --heal --json` at preflight BEFORE the first dispatch (builds or updates it) · ONE `orc graph ctx <declared files>` call per slice · `orc graph map` FIRST at planning (orientation — before any Glob, before `impact`) then `orc graph impact` + `orc graph cochange`, `orc graph changes` at review · `orc graph coverage` before you trust a card's silence · `orc graph update` + `orc graph notes` at every wave close and ship · print each JSON `line`, copy each `trace` VERBATIM (CLI-resolved) → `../_shared/code-graph.md`
209
209
  - Schemas (you own; pass slices only): `schemas/intent-spec.md`,
210
210
  `schemas/planning-output.md`, `schemas/checkpoint.md`
211
211
  - Worked example (orient only — never execute from it) → `examples/full-run-mock.md`