@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
@@ -62,11 +62,11 @@ Behavior-trace logging is permanent (always on). Resolve `log_dir`
62
62
  `../_shared/phases/trace.md`; the marker set is in "Behavior trace"
63
63
  below. Weave the **Trace:** steps in as each event happens.
64
64
 
65
- 1. **Topic pick (wiki-first).** Read `wiki/INDEX.md` +
66
- `.claude/orc/wiki-meta.json` and compute the freshness tier
67
- (`../orc-wiki/references/staleness.md` — computed on read, never stored).
68
- **Trace:** `WIKI-CONSULT tier=<FRESH|AGING|STALE|none> :: topic-pick`
69
- (emitted even when the wiki is absent, with `none`).
65
+ 1. **Topic pick (wiki-first).** Read the tier from `orc wiki status --json`
66
+ (`state`, then `tier`) — the CLI is its only executor; never compute it from
67
+ `.claude/orc/wiki-meta.json` yourself. Then read `wiki/INDEX.md`.
68
+ **Trace:** `WIKI-CONSULT <fresh|aging|stale|absent> :: docs=<topic doc|none>`
69
+ (emitted even when the wiki is absent, with `absent`).
70
70
  - Wiki FRESH/AGING → present its feature areas as a pick-list; the chosen
71
71
  area's `covers` globs seed the writer's file set.
72
72
  - No wiki / STALE / topic not covered → ask the user to point at the
@@ -83,7 +83,7 @@ below. Weave the **Trace:** steps in as each event happens.
83
83
  `wiki_tier`, `focus_hint|null`, and the paths to
84
84
  `references/deepen.md`, `references/template-learning.md`,
85
85
  `references/template-knowledge.md`. **Trace:**
86
- `DISPATCH orc-learn-writer :: init <slug> expect=opus-5/low` just
86
+ `DISPATCH orc-learn-writer :: init <slug> expect=opus-5-5/low` just
87
87
  before the spawn (the hook adds `SPAWN`/`RETURN` on its own).
88
88
  4. On return, check `actual_model`/`actual_effort` against the pinned tier —
89
89
  mismatch → prepend a tier-downgrade warning to the report. **Trace:**
@@ -108,9 +108,9 @@ below. Weave the **Trace:** steps in as each event happens.
108
108
  selected → stop, no writes.
109
109
  4. **Trace:** write `log_dir/.current` = `run-learn-<slug>-<DDMMYY>-<HHMMSS>.txt`. For each
110
110
  selected feature, spawn the writer with `mode=refresh` and that feature's
111
- slice (re-deepen just that feature; a FRESH/AGING wiki may again seed the
112
- boundary — emit one `WIKI-CONSULT tier=<tier> :: refresh` when the wiki is
113
- read). One `DISPATCH`/`VERIFY` pair per feature, same markers as INIT.
111
+ slice (re-deepen just that feature; a FRESH/AGING tier from
112
+ `orc wiki status --json` may again seed the boundary — emit one
113
+ `WIKI-CONSULT <tier> :: docs=<doc|none>` when the wiki is read). One `DISPATCH`/`VERIFY` pair per feature, same markers as INIT.
114
114
  5. The (last) writer re-derives `learning-docs/INDEX.md` from all current
115
115
  feature headers. Relay the combined report. **Trace:**
116
116
  `FINISH :: refresh <n> features`, then delete `log_dir/.current`.
@@ -130,8 +130,8 @@ Dispatch-only lane: emit ONLY the markers it can truthfully witness — no
130
130
  `PHASE`/`SCORE`/`FINDING`/`VERDICT`, because deepening and writing happen
131
131
  inside the writer, which self-traces nothing and returns only
132
132
  `actual_model`/`actual_effort`. The marker set, in order (actor `orc`, plus the
133
- hook's `SPAWN`/`RETURN`): `WIKI-CONSULT tier=<tier> :: <topic-pick|refresh>` at
134
- every wiki read · `DISPATCH orc-learn-writer :: <mode> <slug> expect=opus-5/low`
133
+ hook's `SPAWN`/`RETURN`): `WIKI-CONSULT <tier> :: docs=<doc|none>` at
134
+ every wiki read · `DISPATCH orc-learn-writer :: <mode> <slug> expect=opus-5-5/low`
135
135
  per spawn (REFRESH runs one per selected feature) · `VERIFY writer
136
136
  actual=<model>/<effort>` · `FINISH :: <init <slug>|refresh <n> features>`.
137
137
  `decisions` carries which feature was picked and why, plus the user's answer
@@ -167,11 +167,11 @@ preflight line and has no gate to honour.
167
167
  ## Calls
168
168
 
169
169
  **ONE catalogue, and it is not you:** `orc lane calls orc-learn --json` names every
170
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
170
+ SHARED CLI call this lane makes, each with its exit-code contract, its cost, when to run
171
171
  it, and what an EMPTY answer means. Never invent a spelling, never re-word an
172
172
  exit code, and never re-derive a state word — the CLI's state words are the only
173
173
  state words, and **an exit code is an ANSWER wherever that contract says so, not
174
- a failure**. A call the answer does not name is a call this lane does not make.
174
+ a failure**. A call that neither it nor this skill names is a call this lane does not make.
175
175
  Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
176
176
  command you are about to run, out loud, before running it.
177
177
 
@@ -47,8 +47,8 @@ single-dispatch lane — dispatches the trace writer ONCE at run end to append
47
47
  them (`SPAWN`/`RETURN` come from the `orc-trace.js` hook as they occur):
48
48
 
49
49
  ```
50
- [170726 10:02:01.050] writer WIKI-CONSULT tier=FRESH :: topic-pick
51
- [170726 10:02:44.310] writer DISPATCH orc-learn-writer :: init orders expect=opus-5/low
50
+ [170726 10:02:01.050] writer WIKI-CONSULT fresh :: docs=orders
51
+ [170726 10:02:44.310] writer DISPATCH orc-learn-writer :: init orders expect=opus-5-5/low
52
52
  [170726 10:02:44.420] hook SPAWN orc-learn-writer-opus-5-low
53
53
  [170726 10:06:12.900] hook RETURN
54
54
  [170726 10:06:13.010] writer VERIFY writer actual=claude-opus-5-5/low ✅ MATCH
@@ -53,7 +53,7 @@ Phase 1 planning (dispatch orc-planner-mini; analyst first only on real docs)
53
53
  Phase 3 dispatch ONE executor (orc-executor-sonnet-5-high) — slice carries the
54
54
  standing `house_rules` card (../_shared/phases/house-rules.md, literal) +
55
55
  the `rules_card` under it (`orc rules slice` → `text`, verbatim) + the cached
56
- `postgres` pattern (HIT only) + the --for-slice card + wiki PATHS
56
+ `postgres` pattern (HIT only) + graph_anchors (inline) + wiki PATHS
57
57
  Phase M SMOKE GATE — run build+test → GREEN proceed · RED block ship + surface
58
58
  Phase X MOCK EXAMPLE (config mock_example) — offer/build after a GREEN gate
59
59
  Phase T TEST-AUTHORING ASK (opt-in) — offer to write test cases (never run them)
@@ -72,13 +72,13 @@ returned `gotcha_recorded` YOURSELF. `.claude/orc/gotchas.md` and the mechanics:
72
72
 
73
73
  ## Code graph cache — consult, build, use, update (`../_shared/code-graph.md` §0)
74
74
 
75
- Never skipped. Every call carries `--if-enabled`: exit 3 = off → print `graph: off` once, make no other graph call. Print each JSON `line` in chat; put each `trace` in the next packet VERBATIM.
76
- 1. **Preflight, with the probes, before the planner:** `orc graph status --if-enabled --heal --json --brief` — it builds or updates the cache itself.
77
- 2. **Phase 0, before the tiered round:** `orc graph map --focus "<3–6 words from the request>" --budget 800 --if-enabled --json --brief`. Its ranked files pre-fill Q4's `➡️` recommendation. Never ask what the map already answered.
78
- 3. **Phase 1, ONE call:** `orc graph impact <declared_files> --complexity --risk=<facets.risk[] as class[@file:line],…> --if-enabled --json --brief`. Its `complexity.line` IS the complexity line — print it VERBATIM (`risk not given` → append the classes yourself); its `facts{}` IS `graph_facts` — paste it, then set `facts.map` to the `map --focus` card you already hold. No `complexity` in the answer (an older CLI) → count as `references/complexity.md` §2 says.
79
- 4. **Phase 3 slice:** ONE `orc graph ctx <declared_files> --for-slice --if-enabled --json --brief` → its `card` is the `graph` block, the OUTSIDE view. No card when the change stays inside one named file with no signature change (`../_shared/code-graph.md` §7). The return carries `graph_used`.
80
- 5. **Phase M, before the suite:** `orc graph changes --files=<actual_files> --if-enabled --json --brief` — print its `tests_line`, run the files its `tests[]` names first, then the suite, then its `blast_line` VERBATIM. The CLI attaches every `risk` word's `why`.
81
- 6. **Phase M GREEN:** `orc graph update --notes-pending --files <actual_files> --if-enabled --json --brief` — ONE call for the update AND the notes batch (§6) — then `orc graph gain --run <this run> --if-enabled --json --brief`, `line` copied VERBATIM into the card's `graph` row.
75
+ Never skipped. Every call carries `--if-enabled`. Exit 3 (`off` or `semi`) → print the probe line once, make no other graph call. Print each JSON `line` in chat; put each `trace` in the next packet VERBATIM.
76
+ 1. **Consult — preflight, before the planner:** print `probes["graph-status"].line` from `orc lane config orc-mini --json`. Run `orc graph status --if-enabled --heal --json --brief` only when `heal_needed` is true.
77
+ 2. **Orient — Phase 0, before the tiered round:** `orc graph map --focus=<3–6 words from the request> --budget 800 --if-enabled --json --brief`, ONCE. Its ranked files pre-fill Q4's `➡️` pick. Never re-ask it.
78
+ 3. **Phase 1, ONE call:** `orc graph impact <declared_files> --complexity --risk=<facets.risk[] as class[@file:line],…> --if-enabled --json --brief`. Its `complexity.line` IS the complexity line — print it VERBATIM (`risk not given` → append the classes yourself); its `facts{}` IS `graph_facts` — paste it, then set `facts.map` to the map card you already hold. No `complexity` in the answer → count as `references/complexity.md` §2 says.
79
+ 4. **Anchors — Phase 3 slice:** `orc graph ctx --for-slice <declared_files> --focus=<same words> [--refs=<task.precedent>] --anchors --if-enabled --json --brief`. Print its `line`; its WHOLE `card` (`read all:` + code) goes VERBATIM in the slice as `graph_anchors`. With `graph_anchors` in the slice, list at most ONE wiki page path (the one about the feature's intent), not 1–3. Exit 3/4, or one named file, no outside change → none; the return carries `graph_used`.
80
+ 5. **Affected tests — Phase M, before the suite:** `orc graph changes --files=<actual_files> --if-enabled --json --brief` — print its `tests_line`, run the files its `tests[]` names first, then the suite, then its `blast_line` VERBATIM. The CLI attaches every `risk` word's `why`.
81
+ 6. **Phase M GREEN:** `orc graph update --notes-pending --files <actual_files> --if-enabled --json --brief` ONLY when `probes["graph-status"].update_step` is `lane`. Else none; never a gain call.
82
82
 
83
83
  ## Phase M — Smoke gate (build + test; blocks ship on red)
84
84
 
@@ -148,9 +148,9 @@ mini skipped. Record the switch in the decision log.
148
148
 
149
149
  ## Dispatch via named agents (canonical name-map — dispatch BY these names)
150
150
 
151
- Models pinned in `.claude/agents/`; look one up here, never reconstruct a name (agent = skill-name + model-effort suffix). See `.claude/agents/MODEL-MAPPING.md`. `opus5_only: true` FORCES the right column and needs an Opus 5.5 main session — mini's cheap-lane premise is off while it is on (`../_shared/opus5-only.md`).
151
+ Models pinned in `.claude/agents/`; never reconstruct a name. See `.claude/agents/MODEL-MAPPING.md`. `opus5_only: true` FORCES the right column and needs an Opus 5.5 main session (`../_shared/opus5-only.md`).
152
152
 
153
- **Extra (`extra_enabled`, `../_shared/extra-dispatch.md` — the procedure):** mini's ONE executor may run off Claude. Resolve the pinned executor's **BAND, both edges, and require them to agree** — else the run stays on Claude and the preflight says so. Print the `extra:` line at intake whenever the gate is on (P0: `a lane that sends work off Claude without saying so`). The IDENTICAL slice goes via `orc extra dispatch --task <file> --json`; validate with `return-validation.md` **§2b, not §2** (⛔ SUBSTITUTION); a failure runs `orc extra reconcile <task_id>` FIRST (a moved worktree is RESUMED, never re-done), then the pinned Claude agent, announced. `extra_risk_tasks` still keeps a cited-risk change on Claude — the complexity read never replaces that gate.
153
+ **Extra (`extra_enabled`, `../_shared/extra-dispatch.md` — the procedure):** mini's ONE executor may run off Claude. Resolve the pinned executor's **BAND, both edges, and require them to agree** — else the run stays on Claude and the preflight says so. Print the `extra:` line at intake whenever the gate is on (P0: `a lane that sends work off Claude without saying so`). The IDENTICAL slice goes via `orc extra dispatch --task <file> --json`; validate with `return-validation.md` **§2b, not §2** (⛔ SUBSTITUTION); a failure runs `orc extra reconcile <task_id>` FIRST (a moved worktree is RESUMED, never re-done), then the pinned Claude agent, announced. `extra_risk_tasks` still keeps a cited-risk change on Claude.
154
154
 
155
155
  | Role | Agent (dispatch this) | Model / effort | When `opus5_only` |
156
156
  |------|-----------------------|----------------|-------------------|
@@ -161,8 +161,8 @@ Models pinned in `.claude/agents/`; look one up here, never reconstruct a name (
161
161
 
162
162
  ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
163
163
 
164
- - **Calls:** `orc lane calls orc-mini --json` names every call and its exit codes.
165
- **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
164
+ - **Calls:** `orc lane calls orc-mini --json` names shared calls and exit codes.
165
+ **An exit code is an ANSWER where it says so, not a failure.** Own calls are here; make no other.
166
166
  - **Config:** `orc lane config orc-mini --json`. Obey `effective`, print every line
167
167
  in `announce[]` VERBATIM at preflight, and honour `stops[]` before wave 1.
168
168
  Never merge `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
@@ -10,7 +10,7 @@ U: /orc-mini add a `--json` flag to the `report` CLI command
10
10
  O: Creates run folder run/report-json-flag/ FIRST.
11
11
  [reads repo: Python/poetry/pytest — asks nothing about stack]
12
12
  graph: FRESH — 6 files · 8 symbols
13
- GRAPH-MAP :: focus="report json flag" budget=800 → cli/report.py, tests/test_report.py
13
+ GRAPH-MAP focused :: files=6/6 focus=cli/report.py,tests/test_report.py gen=7 → cli/report.py, tests/test_report.py
14
14
  Batched round (medium tier): 1) What should exist? 2) Out of scope?
15
15
  3) How do we know it's done? 4) Patterns/files to avoid?
16
16
  [Q4's ➡️ already names cli/report.py and tests/test_report.py — the map
@@ -30,21 +30,20 @@ O: GATE complexity :: complexity: mini-ok — 2 files · confident callers 1 in
30
30
  3+ co-commits would have made this "recommend /orc" — an offer, never a switch.)
31
31
 
32
32
  ## Phase 3 — Execute (ONE subagent)
33
- O: graph: --for-slice card (2 files) · wiki: 1 path (pointer, body never read here)
33
+ O: graph: graph_anchors (2 files) · wiki: 1 path (pointer, body never read here)
34
34
  O: → claude-sonnet-5-5 / high :: DISPATCH orc-executor-sonnet-5-high :: add --json flag
35
35
  [executor edits cli/report.py + updates tests, returns actual_files + actual_model
36
36
  + evidence {`pytest tests/test_report.py`, exit 0, tail quoted} + empty unmet[]]
37
37
  O: VERIFY actual=claude-sonnet-5-5/high ✅ MATCH · evidence present ✓
38
38
 
39
39
  ## Phase M — Smoke gate (build + test; blocks ship on red)
40
- O: GRAPH-CHANGES → tests reached 1 file (call 1)
40
+ O: GRAPH-CHANGES found :: symbols=1 high=0 medium=0 low=1 gen=7 → tests reached 1 file (call 1)
41
41
  [runs `pytest tests/test_report.py` FIRST] ⛔ RED — 1 failure: JSON missing trailing key.
42
42
  Not offering commit. Auto-fix ONCE → re-dispatch executor with the failure output.
43
43
  [re-run] ✅ GREEN — tests reached 1 file → 4 passed · suite 12 passed · build ok.
44
44
  blast radius 1 symbol touched · callers 1 in 1 file · tests reach 1 · risk none
45
45
  VERDICT pass
46
- O: GRAPH-UPDATE :: gen 8 · 2 files · 1 note pending → noter batch dispatched
47
- graph gain: paid 0.8K tokens · avoided an estimated 2–5K · measured: not yet (N=1)
46
+ O: graph update: none — update_step is `hook` (the graph hook updates the index)
48
47
 
49
48
  ## Phase T — Test-authoring ask (opt-in; writes, never runs)
50
49
  O: Write test cases for these changes? (I author them — files + TEST-PLAN.md — but
@@ -241,22 +241,22 @@ preflight line and has no gate to honour.
241
241
  ## Calls
242
242
 
243
243
  **ONE catalogue, and it is not you:** `orc lane calls orc-pact --json` names every
244
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
244
+ SHARED CLI call this lane makes, each with its exit-code contract, its cost, when to run
245
245
  it, and what an EMPTY answer means. Never invent a spelling, never re-word an
246
246
  exit code, and never re-derive a state word — the CLI's state words are the only
247
247
  state words, and **an exit code is an ANSWER wherever that contract says so, not
248
- a failure**. A call the answer does not name is a call this lane does not make.
248
+ a failure**. A call that neither it nor this skill names is a call this lane does not make.
249
249
  Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
250
- command you are about to run, out loud, before running it.
251
-
252
- ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
253
-
254
- `orc rules slice --lane orc-pact --json` is the ONLY assembler; never build
255
- the card here. It rides under the house rules and above the task —
256
- **house rules > your project's rules > ORC's own packs** — and its `line` prints
257
- VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
258
- never a silent choice) and `rules_overridden[]`.
259
- ## Waiting mid-run (`/orc-wait`)
260
-
261
- Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
262
- 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.
250
+ command you are about to run, out loud, before running it.
251
+
252
+ ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
253
+
254
+ `orc rules slice --lane orc-pact --json` is the ONLY assembler; never build
255
+ the card here. It rides under the house rules and above the task —
256
+ **house rules > your project's rules > ORC's own packs** — and its `line` prints
257
+ VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
258
+ never a silent choice) and `rules_overridden[]`.
259
+ ## Waiting mid-run (`/orc-wait`)
260
+
261
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
262
+ 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,70 +1,70 @@
1
- # Reference — the pact gate inside `/orc` (`pact_gate`)
2
-
3
- Loaded by the spine at Phase 1. This is the CONSUMER half: `/orc` reads the
4
- ledger, it never writes one. Writing is `/orc-pact`'s alone.
5
-
6
- `pact_gate: off | warn` — default `warn`. **There is no `block`.** A promise is
7
- advice with a receipt; a run it stops is a run that learns to switch it off.
8
-
9
- ## Phase 1 — preflight, one line
10
-
11
- Run `orc pact status --json` with the other preflight probes. Print the `line`
12
- field VERBATIM:
13
-
14
- ```
15
- pact : 11 holding · 2 drifted · 3 uncheckable
16
- ```
17
-
18
- Never re-word it and never compute the counts yourself — one wording, one engine.
19
- Exit 3 (no ledger) prints:
20
-
21
- ```
22
- pact : none — /orc-pact harvests one from this run's spec_invariants[]
23
- ```
24
-
25
- ## Phase 2 — planning injection (the payoff)
26
-
27
- After the plan exists and before the exit gate:
28
-
29
- 1. Take every entry whose state is `DRIFTED` or `BROKEN`.
30
- 2. Intersect its `anchors` (file part only) with the union of every task's
31
- `declared_files`.
32
- 3. For each hit, append the entry's `statement` VERBATIM to that task's
33
- `constraints[]` — the same channel `spec_invariants[]` uses, so no new
34
- plumbing and no new slice field.
35
- 4. Print what was injected, per task. An injected constraint the user never saw is
36
- a constraint the run cannot be held to.
37
-
38
- ```
39
- pact → plan: 1 promise constrains this plan
40
- T04 (src/payments/ledger.ts) PACT-014 DRIFTED
41
- "A payment is never written to the ledger twice for one idempotency key."
42
- ```
43
-
44
- **HOLDING entries are NOT injected.** Injecting all of them would put the whole
45
- ledger in every slice, which is how a slice stops being read. The signal is
46
- "this promise is already in doubt AND you are about to touch it".
47
-
48
- ## Phase 6 — verify recheck (`pact_recheck_on_verify`, default `true`)
49
-
50
- After the verifier returns GREEN, run `orc pact check` **scoped to the promises
51
- the change touched** — the same intersection as Phase 2, computed against the
52
- run's actual changed files rather than the plan's declared ones.
53
-
54
- - A promise that flips to BROKEN here is a **P1 finding**, not a ship blocker by
55
- itself: it is reported with its check output and the user decides. The run broke
56
- something it had promised not to; that is worth stopping to look at, and it is
57
- not worth an automatic abort on a check the ledger may simply have outgrown.
58
- - A promise that re-anchors (pass at the new HEAD) prints one line and nothing
59
- else. That is the ordinary outcome.
60
-
61
- ## Ship
62
-
63
- If any promise went BROKEN during the run, name it in the summary and offer
64
- `/orc-pact` to reconcile. Never edit the ledger from the spine.
65
-
66
- ## The trace verb
67
-
68
- `PACT <state> :: <ids>` at the preflight point, and `PACT recheck <pass|fail> ::
69
- <ids>` at Phase 6. Carried in the phase packet like every other verb — the
70
- orchestrator hands it to `orc-trace-writer-haiku-4-5`, never writes it directly.
1
+ # Reference — the pact gate inside `/orc` (`pact_gate`)
2
+
3
+ Loaded by the spine at Phase 1. This is the CONSUMER half: `/orc` reads the
4
+ ledger, it never writes one. Writing is `/orc-pact`'s alone.
5
+
6
+ `pact_gate: off | warn` — default `warn`. **There is no `block`.** A promise is
7
+ advice with a receipt; a run it stops is a run that learns to switch it off.
8
+
9
+ ## Phase 1 — preflight, one line
10
+
11
+ Run `orc pact status --json` with the other preflight probes. Print the `line`
12
+ field VERBATIM:
13
+
14
+ ```
15
+ pact : 11 holding · 2 drifted · 3 uncheckable
16
+ ```
17
+
18
+ Never re-word it and never compute the counts yourself — one wording, one engine.
19
+ Exit 3 (no ledger) prints:
20
+
21
+ ```
22
+ pact : none — /orc-pact harvests one from this run's spec_invariants[]
23
+ ```
24
+
25
+ ## Phase 2 — planning injection (the payoff)
26
+
27
+ After the plan exists and before the exit gate:
28
+
29
+ 1. Take every entry whose state is `DRIFTED` or `BROKEN`.
30
+ 2. Intersect its `anchors` (file part only) with the union of every task's
31
+ `declared_files`.
32
+ 3. For each hit, append the entry's `statement` VERBATIM to that task's
33
+ `constraints[]` — the same channel `spec_invariants[]` uses, so no new
34
+ plumbing and no new slice field.
35
+ 4. Print what was injected, per task. An injected constraint the user never saw is
36
+ a constraint the run cannot be held to.
37
+
38
+ ```
39
+ pact → plan: 1 promise constrains this plan
40
+ T04 (src/payments/ledger.ts) PACT-014 DRIFTED
41
+ "A payment is never written to the ledger twice for one idempotency key."
42
+ ```
43
+
44
+ **HOLDING entries are NOT injected.** Injecting all of them would put the whole
45
+ ledger in every slice, which is how a slice stops being read. The signal is
46
+ "this promise is already in doubt AND you are about to touch it".
47
+
48
+ ## Phase 6 — verify recheck (`pact_recheck_on_verify`, default `true`)
49
+
50
+ After the verifier returns GREEN, run `orc pact check` **scoped to the promises
51
+ the change touched** — the same intersection as Phase 2, computed against the
52
+ run's actual changed files rather than the plan's declared ones.
53
+
54
+ - A promise that flips to BROKEN here is a **P1 finding**, not a ship blocker by
55
+ itself: it is reported with its check output and the user decides. The run broke
56
+ something it had promised not to; that is worth stopping to look at, and it is
57
+ not worth an automatic abort on a check the ledger may simply have outgrown.
58
+ - A promise that re-anchors (pass at the new HEAD) prints one line and nothing
59
+ else. That is the ordinary outcome.
60
+
61
+ ## Ship
62
+
63
+ If any promise went BROKEN during the run, name it in the summary and offer
64
+ `/orc-pact` to reconcile. Never edit the ledger from the spine.
65
+
66
+ ## The trace verb
67
+
68
+ `PACT <state> :: <ids>` at the preflight point, and `PACT recheck <pass|fail> ::
69
+ <ids>` at Phase 6. Carried in the phase packet like every other verb — the
70
+ orchestrator hands it to `orc-trace-writer-haiku-5-high`, never writes it directly.
@@ -54,7 +54,7 @@ Reconciliation is therefore cheap: you only ever override the *soft* half.
54
54
 
55
55
  1. **Lazy** — the `/orc` dispatch step, on a cache miss (governed by config
56
56
  `pattern_findings: ask | on | off`, default `ask`; see `../orc/config.md`).
57
- 2. **Eager** — invoked by `orc-wiki` when `orc_wiki_pattern_findings: on`: codify
57
+ 2. **Eager** — invoked by `orc-wiki` when `orc_wiki_pattern_findings: true`: codify
58
58
  ALL detected languages as a byproduct of the wiki's full scan (rides under the
59
59
  wiki's existing scan-consent — no separate ask).
60
60
  3. **Manual** — `/orc-pattern` (all detected langs, or a named one),
@@ -121,8 +121,8 @@ persists nothing. See `../orc/config.md`.
121
121
 
122
122
  ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
123
123
 
124
- - **Calls:** `orc lane calls orc-pattern --json` names every call and its exit codes.
125
- **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
124
+ - **Calls:** `orc lane calls orc-pattern --json` names shared calls and exit codes.
125
+ **An exit code is an ANSWER where it says so, not a failure.** Own calls are here; make no other.
126
126
  - **Config:** `orc lane config orc-pattern --json`. Obey `effective`, print every line
127
127
  in `announce[]` VERBATIM at preflight, and honour `stops[]` before wave 1.
128
128
  Never merge `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
@@ -109,8 +109,8 @@ stops the chat and never falls back to another lane.
109
109
  (FRESH/AGING/STALE; the CLI computes it — never by hand).
110
110
  - **PEER wiki:** the same call with `--dir <peer>`; then read its
111
111
  `wiki/INDEX.md` at the peer path. `state: none` there → treat as no wiki.
112
- - `WIKI-CONSULT tier=<FRESH|AGING|STALE|none> :: <repo>` on every read (emit
113
- even for `none`). `GATE knowledge <repo>=<wiki|ask>` per repo.
112
+ - `WIKI-CONSULT <fresh|aging|stale|absent> :: repo=<repo>` on every read (emit
113
+ even for `absent`). `GATE knowledge <repo>=<wiki|ask>` per repo.
114
114
 
115
115
  **Both/all repos have a usable wiki** → read the relevant feature/reference
116
116
  pages, and read the **crosslink boundary tags** each repo publishes under its
@@ -206,8 +206,8 @@ builds.
206
206
 
207
207
  ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
208
208
 
209
- - **Calls:** `orc lane calls orc-poly --json` names every call and its exit codes.
210
- **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
209
+ - **Calls:** `orc lane calls orc-poly --json` names shared calls and exit codes.
210
+ **An exit code is an ANSWER where it says so, not a failure.** Own calls are here; make no other.
211
211
  - **Config:** `orc lane config orc-poly --json`. Obey `effective`. Never merge
212
212
  `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`). Nothing
213
213
  here is contested, gated or a stop: no preflight line, no gate to honour.
@@ -1,51 +1,51 @@
1
- # orc-poly — worked example (orient only; never execute from this)
2
-
3
- A mock run to show the shape of a poly-repo plan. Values are illustrative.
4
-
5
- **Setup.** The user is in `C:\dev\shop-api` (HOST, backend). The change: *add a
6
- "saved carts" feature* — a new `GET /carts/saved` endpoint (BE) and a new
7
- "Saved carts" screen (FE) that lists them. They run `/orc-poly` and paste the
8
- PEER path `C:\dev\shop-web`.
9
-
10
- **P0 — Intake.** HOST = `shop-api` (owns the endpoint). PEER = `shop-web` (owns
11
- the screen, consumes the endpoint). Slug = `saved-carts`.
12
-
13
- **P1 — Knowledge gate.**
14
- - `orc wiki status` in HOST → present, FRESH. `WIKI-CONSULT tier=FRESH ::
15
- shop-api`.
16
- - Reads `C:\dev\shop-web\wiki\wiki-meta.json` directly → AGING.
17
- `WIKI-CONSULT tier=AGING :: shop-web`. `GATE knowledge shop-api=wiki
18
- shop-web=wiki`.
19
- - Both have wikis → reads each repo's crosslink boundary tags: shop-web already
20
- consumes `GET /carts` from shop-api, so the new endpoint extends a known seam.
21
-
22
- **P2 — Recon + gather.** Reads `shop-api/src/routes/carts.ts` and
23
- `shop-web/src/features/cart/` (read-only). Open questions asked in one batch:
24
- response pagination? (yes, cursor) · empty state? (FE shows "No saved carts")
25
- · auth? (same bearer token as `/carts`) · does `saved` reuse the `Cart` type?
26
- (yes, plus a `savedAt` field). All pinned.
27
-
28
- **P3 — Doc set** written to `shop-api/poly-repo-implementation/saved-carts/`:
29
- - `poly-context.md` — the change, both repos' roles + touch points, decisions.
30
- - `interface-contract.md` — froze `GET /carts/saved`: request (bearer,
31
- `?cursor`), response (`{ items: Cart[] & { savedAt }, nextCursor }`), `401`
32
- unauth, `200` empty → `{ items: [], nextCursor: null }`. Additive, no
33
- breaking change.
34
- - `poly-spec.md` — `orc-poly:spec v1`, `repos[]` = shop-api (host, R1: add the
35
- endpoint) + shop-web (peer, R2: add the screen), each `contract_ref` pointing
36
- at the frozen response shape.
37
-
38
- **P4 — Iterate.** User picks **1) Pass to orc-plan**.
39
-
40
- **P5 — Split.** `DISPATCH orc-planner :: poly saved-carts`. The planner emits:
41
- - `shop-api/poly-repo-implementation/saved-carts/shop-api-implementation-plan.md`
42
- - `shop-web/poly-repo-implementation/saved-carts/shop-web-implementation-plan.md`
43
- (written INTO the peer — the only peer write)
44
-
45
- both embedding the frozen `interface-contract.md`. `VERIFY planner
46
- actual=opus-5/medium ✅ MATCH`. `FINISH`.
47
-
48
- **Handoff.** orc-poly tells the user: open `shop-api` and run `/orc` on its
49
- plan; separately open `shop-web` in a fresh session and run `/orc` on its plan.
50
- Both plans pin the same contract, so the FE screen and the BE endpoint fit on
51
- the first try. orc-poly built nothing itself.
1
+ # orc-poly — worked example (orient only; never execute from this)
2
+
3
+ A mock run to show the shape of a poly-repo plan. Values are illustrative.
4
+
5
+ **Setup.** The user is in `C:\dev\shop-api` (HOST, backend). The change: *add a
6
+ "saved carts" feature* — a new `GET /carts/saved` endpoint (BE) and a new
7
+ "Saved carts" screen (FE) that lists them. They run `/orc-poly` and paste the
8
+ PEER path `C:\dev\shop-web`.
9
+
10
+ **P0 — Intake.** HOST = `shop-api` (owns the endpoint). PEER = `shop-web` (owns
11
+ the screen, consumes the endpoint). Slug = `saved-carts`.
12
+
13
+ **P1 — Knowledge gate.**
14
+ - `orc wiki status` in HOST → present, FRESH. `WIKI-CONSULT fresh ::
15
+ repo=shop-api`.
16
+ - Reads `C:\dev\shop-web\wiki\wiki-meta.json` directly → AGING.
17
+ `WIKI-CONSULT aging :: repo=shop-web`. `GATE knowledge shop-api=wiki
18
+ shop-web=wiki`.
19
+ - Both have wikis → reads each repo's crosslink boundary tags: shop-web already
20
+ consumes `GET /carts` from shop-api, so the new endpoint extends a known seam.
21
+
22
+ **P2 — Recon + gather.** Reads `shop-api/src/routes/carts.ts` and
23
+ `shop-web/src/features/cart/` (read-only). Open questions asked in one batch:
24
+ response pagination? (yes, cursor) · empty state? (FE shows "No saved carts")
25
+ · auth? (same bearer token as `/carts`) · does `saved` reuse the `Cart` type?
26
+ (yes, plus a `savedAt` field). All pinned.
27
+
28
+ **P3 — Doc set** written to `shop-api/poly-repo-implementation/saved-carts/`:
29
+ - `poly-context.md` — the change, both repos' roles + touch points, decisions.
30
+ - `interface-contract.md` — froze `GET /carts/saved`: request (bearer,
31
+ `?cursor`), response (`{ items: Cart[] & { savedAt }, nextCursor }`), `401`
32
+ unauth, `200` empty → `{ items: [], nextCursor: null }`. Additive, no
33
+ breaking change.
34
+ - `poly-spec.md` — `orc-poly:spec v1`, `repos[]` = shop-api (host, R1: add the
35
+ endpoint) + shop-web (peer, R2: add the screen), each `contract_ref` pointing
36
+ at the frozen response shape.
37
+
38
+ **P4 — Iterate.** User picks **1) Pass to orc-plan**.
39
+
40
+ **P5 — Split.** `DISPATCH orc-planner :: poly saved-carts`. The planner emits:
41
+ - `shop-api/poly-repo-implementation/saved-carts/shop-api-implementation-plan.md`
42
+ - `shop-web/poly-repo-implementation/saved-carts/shop-web-implementation-plan.md`
43
+ (written INTO the peer — the only peer write)
44
+
45
+ both embedding the frozen `interface-contract.md`. `VERIFY planner
46
+ actual=opus-5/medium ✅ MATCH`. `FINISH`.
47
+
48
+ **Handoff.** orc-poly tells the user: open `shop-api` and run `/orc` on its
49
+ plan; separately open `shop-web` in a fresh session and run `/orc` on its plan.
50
+ Both plans pin the same contract, so the FE screen and the BE endpoint fit on
51
+ the first try. orc-poly built nothing itself.
@@ -85,7 +85,8 @@ without the manifest (`../_shared/lane-contract.md` §Phases).
85
85
  The change already exists in the worktree, so **preserve it before touching
86
86
  branches** — `references/orc-run-split.md` is the exact procedure: commit the
87
87
  whole change to a scratch snapshot branch, verify the snapshot contains every
88
- changed path from `git status --short`, and only then move to the trunk. Every
88
+ changed path from `git status --short`, and only then move to the trunk, which
89
+ must be an ancestor of the snapshot. Every
89
90
  layer is later materialized with `git checkout <snapshot> -- <that layer's
90
91
  files>`; deletions are applied as `git rm`. The snapshot branch stays until the
91
92
  last layer merges — it is the undo button.
@@ -169,8 +170,8 @@ answers verbatim).
169
170
 
170
171
  ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
171
172
 
172
- - **Calls:** `orc lane calls orc-pr-driver --json` names every call and its exit codes.
173
- **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
173
+ - **Calls:** `orc lane calls orc-pr-driver --json` names shared calls and exit codes.
174
+ **An exit code is an ANSWER where it says so, not a failure.** Own calls are here; make no other.
174
175
  - **Config:** `orc lane config orc-pr-driver --json`. Obey `effective`. Never merge
175
176
  `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`). Nothing
176
177
  here is contested, gated or a stop: no preflight line, no gate to honour.