@azure-id/orc 1.7.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +3649 -3339
  2. package/README-id.md +923 -844
  3. package/README.md +836 -860
  4. package/bin/build-agents.js +43 -27
  5. package/bin/cli.js +701 -3
  6. package/bin/graph-extract.js +927 -0
  7. package/bin/graph-notes.js +188 -0
  8. package/bin/graph-query.js +808 -0
  9. package/bin/graph-resolve.js +178 -0
  10. package/bin/graph-signals.js +277 -0
  11. package/bin/graph.js +605 -0
  12. package/bin/verify-contracts.js +4669 -4527
  13. package/bin/verify-package.js +626 -616
  14. package/bin/webui/api.js +1419 -1414
  15. package/bin/webui/fixtures/index.js +579 -576
  16. package/bin/webui/fixtures/knowledge.js +316 -291
  17. package/bin/webui/i18n/en/knowledge.json +167 -151
  18. package/bin/webui/i18n/en/overview.json +101 -100
  19. package/bin/webui/i18n/id/knowledge.json +167 -151
  20. package/bin/webui/i18n/id/overview.json +101 -100
  21. package/bin/webui/js/panels/knowledge.js +1065 -1006
  22. package/bin/webui/js/panels/overview.js +492 -488
  23. package/package.json +39 -39
  24. package/templates/agents/MODEL-MAPPING.md +163 -158
  25. package/templates/agents/orc-executor-haiku-4-5.md +133 -113
  26. package/templates/agents/orc-executor-opus-4-7-high.md +134 -114
  27. package/templates/agents/orc-executor-opus-4-7-med.md +134 -114
  28. package/templates/agents/orc-executor-opus-4-8-high.md +134 -114
  29. package/templates/agents/orc-executor-opus-5-high.md +134 -114
  30. package/templates/agents/orc-executor-opus-5-low.md +134 -114
  31. package/templates/agents/orc-executor-opus-5-med.md +134 -114
  32. package/templates/agents/orc-executor-sonnet-4-6-high.md +134 -114
  33. package/templates/agents/orc-executor-sonnet-4-6-med.md +134 -114
  34. package/templates/agents/orc-executor-sonnet-5-high.md +134 -114
  35. package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +86 -0
  36. package/templates/hooks/README.md +444 -396
  37. package/templates/hooks/orc-graph-hook.js +336 -0
  38. package/templates/hooks/orc-statusline-render.js +922 -921
  39. package/templates/hooks/orc-statusline.js +1596 -1545
  40. package/templates/skills/_shared/README.md +4 -0
  41. package/templates/skills/_shared/code-graph.md +220 -0
  42. package/templates/skills/_shared/extra-dispatch.md +1 -1
  43. package/templates/skills/_shared/opus5-only.md +4 -0
  44. package/templates/skills/_shared/phases/execution.md +166 -145
  45. package/templates/skills/_shared/phases/planning.md +142 -135
  46. package/templates/skills/_shared/phases/preflight.md +132 -118
  47. package/templates/skills/_shared/phases/review.md +63 -53
  48. package/templates/skills/_shared/phases/rules.md +5 -0
  49. package/templates/skills/_shared/phases/ship.md +96 -88
  50. package/templates/skills/_shared/phases/trace.md +6 -0
  51. package/templates/skills/_shared/phases/wiki-consult.md +194 -189
  52. package/templates/skills/_shared/read-ladder.md +124 -102
  53. package/templates/skills/_shared/return-validation.md +259 -250
  54. package/templates/skills/orc/SKILL.md +255 -254
  55. package/templates/skills/orc/references/preflight-report.md +6 -0
  56. package/templates/skills/orc/subskills/orc-execution/SKILL.md +2 -1
  57. package/templates/skills/orc/subskills/orc-execution/core.md +9 -1
  58. package/templates/skills/orc-diy/references/flow-schema.md +101 -100
  59. package/templates/skills/orc-fast/SKILL.md +236 -229
  60. package/templates/skills/orc-mini/SKILL.md +267 -259
  61. package/templates/skills/orc-quick/SKILL.md +378 -360
  62. package/templates/skills/orc-quick/references/dispatch-gate.md +6 -0
  63. package/templates/skills/orc-wiki/references/staleness.md +294 -288
@@ -1,135 +1,142 @@
1
- # Phase — Planning (id: `planning`)
2
-
3
- > **Shared phase file.** Moved out of `orc/SKILL.md` at v1.0.0 W12, and into
4
- > this library at W13 when `orc-diy` became its second reader. A spine is loaded
5
- > IN FULL when its skill activates; this is loaded when the phase fires, and most
6
- > runs skip most phases.
7
- >
8
- > **Two layers, and a lane reads exactly one.** `full` is `/orc`'s procedure.
9
- > `composed` is what `orc diy compile` stitches — the same phase expressed as
10
- > `<!-- diy:when -->` variants over a composed flow, NOT a second copy of the
11
- > procedure. Reading the wrong one is the failure `README.md` names: a lane
12
- > doing a phase its product promise says it does differently.
13
- > `orc lane phases <lane> --json` names the layer for each lane.
14
-
15
- <!-- orc:layer full -->
16
-
17
- ## Planning
18
-
19
- Emit `PHASE planning start`, then emit ONE `CONFIG <key=value …>` line with the
20
- resolved values of every config key this run will consume (ALWAYS `opus5_only` — it selects the executor table AND every fixed role, so retro can segment per-band outcomes BY dispatch mode) — the runtime
21
- proof `/orc-retro` audits that the run honored the config.
22
- **Wiki consult (load `wiki-consult.md`;
23
- always report — no tier is silent):** read the FRESH/AGING/STALE tier from
24
- **`orc wiki status`** (v0.41.0 — deterministic; never hand-compute it from `wiki-meta.json`), pull the relevant pages (incl. cross-cutting maps like `orc-reference-api-surface`), apply
25
- `code > fresh wiki > stale wiki (hints) > model priors`, emit
26
- `WIKI-CONSULT <tier> :: docs=<pages>`, print the one-line tier report (every tier, `absent` included), and attribute per-dispatch too — `wiki:` on the `DISPATCH` line + a `wiki_used` return (wiki-consult.md Step 5). **Crosslink:** per wiki-consult.md, inject
27
- the cached `.claude/orc/crosslink/needs.json` contract into any boundary-touching
28
- task (advisory) and print + emit `CROSSLINK <state> :: boundaries=<n> peers=<names>`
29
- — `configured-no-cache` prints the "cache not built" warning (full orc reads
30
- only pre-built needs/cache, never peer source live). **Gotchas (repair memory,
31
- config `gotchas`):** probe ONCE with `orc gotcha status` (exit 0 = entries exist,
32
- 1 = none — never a `find`); canonical `_shared/gotchas.md`.
33
- **Pact / boundary / aftermath / wiki debt (v0.46.0 — all CONSUMED here, never
34
- written here):** probe `orc pact status --json` (`pact_gate`, default `warn`),
35
- `orc boundary status --json` (`boundary_gate`, default `warn`), `orc wiki debt
36
- --json`, and — only to decide whether the preflight's `after:` line fires at all —
37
- `orc aftermath status --json`. Print each probe's own `line` VERBATIM; never
38
- recount or re-word one. Gates: `../../orc-pact/references/gate.md` +
39
- `../../orc-boundary/references/gate.md`. **Challenge (v0.47.0, `challenge_gate`,
40
- default `warn`):** when the run's INPUT DOCUMENT has a cycle, print
41
- `orc challenge status <slug> --json`'s `preflight_line` verbatim — building from
42
- a document that has not passed its own review is worth one line. There is no
43
- `block` mode (the `/orc-pact` precedent). **Extra (v0.50.0, `extra_enabled`) —
44
- resolved HERE, announced HERE, never silent:** load `../extra-dispatch.md`;
45
- per task run `orc extra resolve <score> --role executor --risk <n> --json`, and
46
- before wave 1 settle its two pre-dispatch states, both PRINTED — a `needs_reping`
47
- profile (re-ping; a STALE profile still routes) and a vaulted credential, which is
48
- **LOCKED AT DISPATCH TIME whatever `credential.present` says** and falls back to
49
- Claude rather than stopping the run. **Preflight:** print the compact block per
50
- `../../orc/references/preflight-report.md` once wiki + crosslink (+ pattern/waves) resolve.
51
-
52
- Ask which planner: **Superpowers / OpenSpec / Requirement Planner / ORC
53
- (self)**. With an analyst requirement-spec present, the Requirement Planner
54
- is the natural choice (consumes the spec; does NOT re-question scope); apply
55
- the `git_head` staleness valve first (analyst-gates.md). Dispatch the planner
56
- as a subagent — never plan yourself.
57
-
58
- **CRITICAL — planning always hands back here.** However a plan was produced,
59
- control returns to THIS orchestrator, which runs Phase 2 → 3 → … → 8 — never
60
- jump from a plan straight to implementation. **ONE exception — a poly-spec
61
- (`orc-poly:spec`, from `/orc-poly`):** the planner runs poly-split mode (one
62
- plan per repo, each pinned to the frozen contract, each written into its own
63
- repo); present the per-repo plans + build handoff and STOP — a poly-spec is the
64
- only input that does NOT proceed to Phase 2 (each repo builds later, in its own
65
- `/orc` session). The plan must satisfy
66
- `../../orc/schemas/planning-output.md` (per-task `declared_files` incl. tests,
67
- `grounding[]`, `acceptance[]`, `requirements[]`, `spec_invariants[]`,
68
- `depends_on`, `owns_area`, `spec_ref`, + a `coverage` echo, + `tdd_spec` —
69
- TDD is ALWAYS ON in full orc/ultra but **SCOPED to what can actually fail (v0.41.0)**: a `disposition` per entry (`new-surface | behavior-change | covered-by-existing | no-behavior | no-runner`) DERIVED from the planner's facets — constants/translations/file-splits get NO test, a cited `risk[]` is never scoped out, and a PAIRED task materializes it, never a Wave 0 (schema notes 7-8; gate check 5);
70
- missing declared files → extract and confirm before leaving this phase.
71
-
72
- **Phase 1 exit gate** (deterministic — full checks in analyst-gates.md; emit
73
- `GATE` lines): Glob every `disposition: exists` path, recompute coverage (no
74
- `orphan` requirements), cycle + same-file collision checks. Any miss →
75
- bounce to the planner (one retry), then escalate. **After the gate passes,
76
- relay the plan's `open_questions[]` in ONE batch:** blocking questions must be
77
- answered before Phase 2; non-blocking show their `proposed_default` for tacit
78
- approval. **Step-back valve:** `plan_confidence: low` OR >3 blocking questions →
79
- recommend stepping back to `orc-analyze` (user may override and proceed).
80
- **Pact injection (`pact_gate: warn`) — the payoff, and it happens HERE:** a
81
- DRIFTED or BROKEN promise whose `anchors` intersect a task's `declared_files` is
82
- appended VERBATIM to that task's `constraints[]` (the `spec_invariants[]`
83
- channel — no new plumbing) and PRINTED per task. HOLDING entries are never
84
- injected. Last month's decision constrains this month's plan, automatically. On
85
- pass, emit `PHASE planning end`.
86
-
87
- **Then print the `forecast:` block, BEFORE the Phase-2 pause question**
88
- (`../../orc/references/preflight-report.md`) — tasks · waves · estimated subagents · model
89
- mix · a measured time RANGE · one cheaper lane and what it costs. This is the
90
- earliest instant every number is real and the last cheap moment to walk away.
91
- Presentation only, no new probes. When `config.run_budget_dispatches` > 0 and the
92
- forecast exceeds it, this is a **hard stop** with the batch pause's discipline
93
- (`GATE budget stop`) offering proceed · cheaper lane · re-plan smaller — never
94
- dispatch wave 1 past it.
95
-
96
- <!-- /orc:layer -->
97
-
98
- <!-- orc:layer composed -->
99
-
100
- ## Phase: Planning
101
-
102
- <!-- diy:when planning=auto -->
103
- Route planning exactly as the full lane does — Superpowers plan, OpenSpec
104
- change, or ORC's own planner, chosen by what exists in the project. Follow
105
- `.claude/skills/orc/subskills/orc-planner/SKILL.md` for the own-planner path
106
- and validate the planning output against
107
- `.claude/skills/orc/schemas/planning-output.md`.
108
- <!-- /diy:when -->
109
- <!-- diy:when planning=own-planner -->
110
- Always use ORC's own Requirement Planner, even when Superpowers/OpenSpec
111
- artifacts exist: follow `.claude/skills/orc/subskills/orc-planner/SKILL.md`
112
- and validate the planning output against
113
- `.claude/skills/orc/schemas/planning-output.md`.
114
- <!-- /diy:when -->
115
- <!-- diy:when planning=superpowers -->
116
- Plan via Superpowers: require a Superpowers-written plan as planning input
117
- (ask the user to produce one if absent), then convert it to ORC planning
118
- output validated against `.claude/skills/orc/schemas/planning-output.md` —
119
- same conversion the full lane applies on its Superpowers route.
120
- <!-- /diy:when -->
121
- <!-- diy:when planning=openspec -->
122
- Plan via OpenSpec: require an OpenSpec change as planning input (ask the user
123
- to produce one if absent), then convert it to ORC planning output validated
124
- against `.claude/skills/orc/schemas/planning-output.md` — same conversion the
125
- full lane applies on its OpenSpec route.
126
- <!-- /diy:when -->
127
- <!-- diy:when tdd=on -->
128
- TDD is ON for this flow: the plan must carry a `tdd_spec` per requirement
129
- (given/when/then + a runnable skeleton in the project's test framework, or
130
- `tdd: exempt — <reason>`; schema in
131
- `.claude/skills/orc/schemas/planning-output.md`). No test runner in the
132
- project → whole-run exemption, stated once at preflight.
133
- <!-- /diy:when -->
134
-
135
- <!-- /orc:layer -->
1
+ # Phase — Planning (id: `planning`)
2
+
3
+ > **Shared phase file.** Moved out of `orc/SKILL.md` at v1.0.0 W12, and into
4
+ > this library at W13 when `orc-diy` became its second reader. A spine is loaded
5
+ > IN FULL when its skill activates; this is loaded when the phase fires, and most
6
+ > runs skip most phases.
7
+ >
8
+ > **Two layers, and a lane reads exactly one.** `full` is `/orc`'s procedure.
9
+ > `composed` is what `orc diy compile` stitches — the same phase expressed as
10
+ > `<!-- diy:when -->` variants over a composed flow, NOT a second copy of the
11
+ > procedure. Reading the wrong one is the failure `README.md` names: a lane
12
+ > doing a phase its product promise says it does differently.
13
+ > `orc lane phases <lane> --json` names the layer for each lane.
14
+
15
+ <!-- orc:layer full -->
16
+
17
+ ## Planning
18
+
19
+ Emit `PHASE planning start`, then emit ONE `CONFIG <key=value …>` line with the
20
+ resolved values of every config key this run will consume (ALWAYS `opus5_only` — it selects the executor table AND every fixed role, so retro can segment per-band outcomes BY dispatch mode) — the runtime
21
+ proof `/orc-retro` audits that the run honored the config.
22
+ **Wiki consult (load `wiki-consult.md`;
23
+ always report — no tier is silent):** read the FRESH/AGING/STALE tier from
24
+ **`orc wiki status`** (v0.41.0 — deterministic; never hand-compute it from `wiki-meta.json`), pull the relevant pages (incl. cross-cutting maps like `orc-reference-api-surface`), apply
25
+ `code > fresh wiki > stale wiki (hints) > model priors`, emit
26
+ `WIKI-CONSULT <tier> :: docs=<pages>`, print the one-line tier report (every tier, `absent` included), and attribute per-dispatch too — `wiki:` on the `DISPATCH` line + a `wiki_used` return (wiki-consult.md Step 5). **Crosslink:** per wiki-consult.md, inject
27
+ the cached `.claude/orc/crosslink/needs.json` contract into any boundary-touching
28
+ task (advisory) and print + emit `CROSSLINK <state> :: boundaries=<n> peers=<names>`
29
+ — `configured-no-cache` prints the "cache not built" warning (full orc reads
30
+ only pre-built needs/cache, never peer source live). **Gotchas (repair memory,
31
+ config `gotchas`):** probe ONCE with `orc gotcha status` (exit 0 = entries exist,
32
+ 1 = none — never a `find`); canonical `_shared/gotchas.md`.
33
+ **Code graph (`../code-graph.md` §7):** with the graph on, run
34
+ `orc graph impact <candidate declared_files> --if-enabled --json` and hand its
35
+ callers to the planner — they sharpen `declared_files` and the `fan` and risk
36
+ facets. Also run `orc graph cochange <each candidate file> --if-enabled --json`:
37
+ it answers "what else will I have to touch" from HISTORY, which a static edge
38
+ cannot see. Co-change is a HINT about people, never a dependency — exit 4 means
39
+ this file changes alone, which is an answer. Exit 3 or 4 → plan exactly as before.
40
+ **Pact / boundary / aftermath / wiki debt (v0.46.0 — all CONSUMED here, never
41
+ written here):** probe `orc pact status --json` (`pact_gate`, default `warn`),
42
+ `orc boundary status --json` (`boundary_gate`, default `warn`), `orc wiki debt
43
+ --json`, and — only to decide whether the preflight's `after:` line fires at all —
44
+ `orc aftermath status --json`. Print each probe's own `line` VERBATIM; never
45
+ recount or re-word one. Gates: `../../orc-pact/references/gate.md` +
46
+ `../../orc-boundary/references/gate.md`. **Challenge (v0.47.0, `challenge_gate`,
47
+ default `warn`):** when the run's INPUT DOCUMENT has a cycle, print
48
+ `orc challenge status <slug> --json`'s `preflight_line` verbatim — building from
49
+ a document that has not passed its own review is worth one line. There is no
50
+ `block` mode (the `/orc-pact` precedent). **Extra (v0.50.0, `extra_enabled`) —
51
+ resolved HERE, announced HERE, never silent:** load `../extra-dispatch.md`;
52
+ per task run `orc extra resolve <score> --role executor --risk <n> --json`, and
53
+ before wave 1 settle its two pre-dispatch states, both PRINTED — a `needs_reping`
54
+ profile (re-ping; a STALE profile still routes) and a vaulted credential, which is
55
+ **LOCKED AT DISPATCH TIME whatever `credential.present` says** and falls back to
56
+ Claude rather than stopping the run. **Preflight:** print the compact block per
57
+ `../../orc/references/preflight-report.md` once wiki + crosslink (+ pattern/waves) resolve.
58
+
59
+ Ask which planner: **Superpowers / OpenSpec / Requirement Planner / ORC
60
+ (self)**. With an analyst requirement-spec present, the Requirement Planner
61
+ is the natural choice (consumes the spec; does NOT re-question scope); apply
62
+ the `git_head` staleness valve first (analyst-gates.md). Dispatch the planner
63
+ as a subagent — never plan yourself.
64
+
65
+ **CRITICAL — planning always hands back here.** However a plan was produced,
66
+ control returns to THIS orchestrator, which runs Phase 2 → 3 → … → 8 — never
67
+ jump from a plan straight to implementation. **ONE exception — a poly-spec
68
+ (`orc-poly:spec`, from `/orc-poly`):** the planner runs poly-split mode (one
69
+ plan per repo, each pinned to the frozen contract, each written into its own
70
+ repo); present the per-repo plans + build handoff and STOP — a poly-spec is the
71
+ only input that does NOT proceed to Phase 2 (each repo builds later, in its own
72
+ `/orc` session). The plan must satisfy
73
+ `../../orc/schemas/planning-output.md` (per-task `declared_files` incl. tests,
74
+ `grounding[]`, `acceptance[]`, `requirements[]`, `spec_invariants[]`,
75
+ `depends_on`, `owns_area`, `spec_ref`, + a `coverage` echo, + `tdd_spec` —
76
+ TDD is ALWAYS ON in full orc/ultra but **SCOPED to what can actually fail (v0.41.0)**: a `disposition` per entry (`new-surface | behavior-change | covered-by-existing | no-behavior | no-runner`) DERIVED from the planner's facets — constants/translations/file-splits get NO test, a cited `risk[]` is never scoped out, and a PAIRED task materializes it, never a Wave 0 (schema notes 7-8; gate check 5);
77
+ missing declared files → extract and confirm before leaving this phase.
78
+
79
+ **Phase 1 exit gate** (deterministic — full checks in analyst-gates.md; emit
80
+ `GATE` lines): Glob every `disposition: exists` path, recompute coverage (no
81
+ `orphan` requirements), cycle + same-file collision checks. Any miss →
82
+ bounce to the planner (one retry), then escalate. **After the gate passes,
83
+ relay the plan's `open_questions[]` in ONE batch:** blocking questions must be
84
+ answered before Phase 2; non-blocking show their `proposed_default` for tacit
85
+ approval. **Step-back valve:** `plan_confidence: low` OR >3 blocking questions →
86
+ recommend stepping back to `orc-analyze` (user may override and proceed).
87
+ **Pact injection (`pact_gate: warn`) — the payoff, and it happens HERE:** a
88
+ DRIFTED or BROKEN promise whose `anchors` intersect a task's `declared_files` is
89
+ appended VERBATIM to that task's `constraints[]` (the `spec_invariants[]`
90
+ channel — no new plumbing) and PRINTED per task. HOLDING entries are never
91
+ injected. Last month's decision constrains this month's plan, automatically. On
92
+ pass, emit `PHASE planning end`.
93
+
94
+ **Then print the `forecast:` block, BEFORE the Phase-2 pause question**
95
+ (`../../orc/references/preflight-report.md`) — tasks · waves · estimated subagents · model
96
+ mix · a measured time RANGE · one cheaper lane and what it costs. This is the
97
+ earliest instant every number is real and the last cheap moment to walk away.
98
+ Presentation only, no new probes. When `config.run_budget_dispatches` > 0 and the
99
+ forecast exceeds it, this is a **hard stop** with the batch pause's discipline
100
+ (`GATE budget stop`) offering proceed · cheaper lane · re-plan smaller — never
101
+ dispatch wave 1 past it.
102
+
103
+ <!-- /orc:layer -->
104
+
105
+ <!-- orc:layer composed -->
106
+
107
+ ## Phase: Planning
108
+
109
+ <!-- diy:when planning=auto -->
110
+ Route planning exactly as the full lane does — Superpowers plan, OpenSpec
111
+ change, or ORC's own planner, chosen by what exists in the project. Follow
112
+ `.claude/skills/orc/subskills/orc-planner/SKILL.md` for the own-planner path
113
+ and validate the planning output against
114
+ `.claude/skills/orc/schemas/planning-output.md`.
115
+ <!-- /diy:when -->
116
+ <!-- diy:when planning=own-planner -->
117
+ Always use ORC's own Requirement Planner, even when Superpowers/OpenSpec
118
+ artifacts exist: follow `.claude/skills/orc/subskills/orc-planner/SKILL.md`
119
+ and validate the planning output against
120
+ `.claude/skills/orc/schemas/planning-output.md`.
121
+ <!-- /diy:when -->
122
+ <!-- diy:when planning=superpowers -->
123
+ Plan via Superpowers: require a Superpowers-written plan as planning input
124
+ (ask the user to produce one if absent), then convert it to ORC planning
125
+ output validated against `.claude/skills/orc/schemas/planning-output.md` —
126
+ same conversion the full lane applies on its Superpowers route.
127
+ <!-- /diy:when -->
128
+ <!-- diy:when planning=openspec -->
129
+ Plan via OpenSpec: require an OpenSpec change as planning input (ask the user
130
+ to produce one if absent), then convert it to ORC planning output validated
131
+ against `.claude/skills/orc/schemas/planning-output.md` — same conversion the
132
+ full lane applies on its OpenSpec route.
133
+ <!-- /diy:when -->
134
+ <!-- diy:when tdd=on -->
135
+ TDD is ON for this flow: the plan must carry a `tdd_spec` per requirement
136
+ (given/when/then + a runnable skeleton in the project's test framework, or
137
+ `tdd: exempt — <reason>`; schema in
138
+ `.claude/skills/orc/schemas/planning-output.md`). No test runner in the
139
+ project → whole-run exemption, stated once at preflight.
140
+ <!-- /diy:when -->
141
+
142
+ <!-- /orc:layer -->
@@ -1,118 +1,132 @@
1
- # Phase — Preflight (id: `preflight`)
2
-
3
- > **Library file.** New at v1.0.0 W11, distilled from the eleven lane preflight
4
- > sections that had independently converged on the same four steps in the same
5
- > order. Layers: `core` (every lane with a silent preflight) and `full`
6
- > (`/orc` and `/orc-ultra`, whose preflight also PRINTS a report).
7
- >
8
- > **What is NOT here:** the probes themselves. Which artifacts a lane probes, and
9
- > which config keys it reads, are the lane's own — they are in the lane's spine
10
- > and in `orc lane config <lane> --json`. This file is the SHAPE: the order, and
11
- > the four rules that make the shape worth having.
12
-
13
- <!-- orc:layer core -->
14
-
15
- ## The order is the contract
16
-
17
- Four steps, always in this order, and a lane adds its own probes to step 3 —
18
- never a fifth step before step 2.
19
-
20
- 1. **Config.** Resolve every key this lane reads through **one** resolver:
21
- `orc lane config <lane> --json`. Never merge `.claude/orc.config.yaml`
22
- yourself. Print every line of `announce[]` VERBATIM — *a shadowed setting must
23
- never be silent*, and a lane that resolves silently cannot tell the user why
24
- the thing they configured did not happen. Precedence, gates, inertness and the
25
- CLI-absent floor are all in `../config-precedence.md`.
26
-
27
- 2. **Trace.** Write `log_dir/.current` = `run-<lane>-<slug>-<DDMMYY>-<HHMMSS>.txt`
28
- AND `touch the trace file` of that name in the SAME step. **Both, or neither.**
29
- A pointer naming a file that does not exist is indistinguishable from a
30
- dangling one — that split fifteen graded runs across two files each. The rest
31
- of the protocol is `trace.md`.
32
-
33
- 3. **Probes.** Use `../detecting-artifacts.md` — **never a raw `find`**, because
34
- `.claude/` is hidden and a filesystem search false-negatives a real artifact
35
- from the wrong CWD. Every probe is a documented exit-code contract, listed
36
- once in `orc lane calls <lane>`. Treat a positive probe as the source of truth
37
- and never second-guess it.
38
-
39
- 4. **One line each.** Print one line per probe, per resolved gate, per tier.
40
- **A probe whose answer is silent is a probe that gets skipped** — by the next
41
- maintainer, and eventually by the model. An empty result is an ANSWER and
42
- still gets its line.
43
-
44
- ## The four rules
45
-
46
- - **Preflight is SILENT in the sense that it asks nothing** — it prints, it never
47
- interviews. A question in preflight is a question asked before the lane knows
48
- enough to ask it well.
49
- - **Nothing here stops a run unless the lane's own spine says it does.** Most
50
- lanes treat missing knowledge as a helpful extra: it means more of the work is
51
- a question instead of a lookup. `/orc-fast` is the exception, and it says so.
52
- - **ONCE per run** (`/orc-quick`: once per session). A preflight that re-runs is
53
- a preflight nobody reads.
54
- - **An exit code is an answer, not a failure.** `orc pact status` exit 3 is "no
55
- ledger yet, this is a first run"; `orc gotcha status` exit 1 is an empty
56
- ledger. Say what it means, not that it failed.
57
-
58
- ## The rules line (v1.7.0) — printed by every lane that runs the `rules` phase
59
-
60
- `orc rules slice --lane <lane> --json` returns a `line`. Print it VERBATIM:
61
-
62
- ```
63
- rules: ORC 65 (W 23 · C 22 · D 10 · U 10) · yours 9 lines (P0 4 · P1 2 · P2 3) · 1 override
64
- rules: ORC 65 (W 23 · C 22 · D 10 · U 10) · yours none
65
- ```
66
-
67
- **Both spellings are mandatory in their state.** `yours none` says the project
68
- has not written its own rules — a different fact from the CLI failing to look,
69
- and the line is what keeps the two apart. Never compute the counts here.
70
-
71
- Where the lane's preflight prints a REPORT rather than a bare line, the report
72
- names each override under it. An override the user cannot see is an override
73
- they cannot audit. The rest of the mechanic is `./rules.md`.
74
-
75
- `/orc-doc` prints `house rules: …` instead, from `orc doc rules`. The two
76
- surfaces are different files and never mix.
77
-
78
- ## The usage line (v1.1.0) — printed whenever `usage_gate` is armed
79
-
80
- `usage_gate` resolves in step 1 like any other key. When it is anything but
81
- `off`, run `orc usage check --json` in step 3 and print ONE line:
82
-
83
- ```
84
- usage: 5h 71% · wk 38% · gate at 10% left · warn
85
- usage: unknown (no reading in the last 30 minutes) · a run is never stopped on this
86
- ```
87
-
88
- Both spellings are mandatory in their state. A gate that prints only when it
89
- fires is a gate the user cannot tell from a gate that is not running — and the
90
- `unknown` line is what stops someone believing they are protected when Claude
91
- Code is sending no usage headers at all.
92
-
93
- **Exit 2 (`unknown`) NEVER stops a run.** Absent is not low.
94
-
95
- A `blocked` run (`orc wait status --json`) prints the block and its AGE here too,
96
- and again at every gate it suppresses. The rest of the mechanic — the modes, the
97
- hops, what `stop` and `wait` actually do — is `../wait.md`; this file only says
98
- that the line is printed and when.
99
-
100
- <!-- /orc:layer -->
101
-
102
- <!-- orc:layer full -->
103
-
104
- ## `/orc` and `/orc-ultra` — preflight also REPORTS
105
-
106
- The full lane's preflight does everything in `core` and then prints the
107
- **preflight report**: tasks · waves · estimated subagents · model mix · the wiki
108
- tier · the resolved pattern · crosslink state · the pause schedule · the run
109
- budget. That format, its `GATE budget stop|pass` line and the FLOOR rule (repairs
110
- push the real count up, never down) live in the `orc` skill's own
111
- `references/preflight-report.md` — read it relative to that skill. It has ONE
112
- consumer, so it stays home rather than moving here.
113
-
114
- A trimmed lane must **not** read that file. `orc-mini` and `orc-fast` print their
115
- resolved lines and go; there is no forecast to report because there are no waves
116
- to forecast.
117
-
118
- <!-- /orc:layer -->
1
+ # Phase — Preflight (id: `preflight`)
2
+
3
+ > **Library file.** New at v1.0.0 W11, distilled from the eleven lane preflight
4
+ > sections that had independently converged on the same four steps in the same
5
+ > order. Layers: `core` (every lane with a silent preflight) and `full`
6
+ > (`/orc` and `/orc-ultra`, whose preflight also PRINTS a report).
7
+ >
8
+ > **What is NOT here:** the probes themselves. Which artifacts a lane probes, and
9
+ > which config keys it reads, are the lane's own — they are in the lane's spine
10
+ > and in `orc lane config <lane> --json`. This file is the SHAPE: the order, and
11
+ > the four rules that make the shape worth having.
12
+
13
+ <!-- orc:layer core -->
14
+
15
+ ## The order is the contract
16
+
17
+ Four steps, always in this order, and a lane adds its own probes to step 3 —
18
+ never a fifth step before step 2.
19
+
20
+ 1. **Config.** Resolve every key this lane reads through **one** resolver:
21
+ `orc lane config <lane> --json`. Never merge `.claude/orc.config.yaml`
22
+ yourself. Print every line of `announce[]` VERBATIM — *a shadowed setting must
23
+ never be silent*, and a lane that resolves silently cannot tell the user why
24
+ the thing they configured did not happen. Precedence, gates, inertness and the
25
+ CLI-absent floor are all in `../config-precedence.md`.
26
+
27
+ 2. **Trace.** Write `log_dir/.current` = `run-<lane>-<slug>-<DDMMYY>-<HHMMSS>.txt`
28
+ AND `touch the trace file` of that name in the SAME step. **Both, or neither.**
29
+ A pointer naming a file that does not exist is indistinguishable from a
30
+ dangling one — that split fifteen graded runs across two files each. The rest
31
+ of the protocol is `trace.md`.
32
+
33
+ 3. **Probes.** Use `../detecting-artifacts.md` — **never a raw `find`**, because
34
+ `.claude/` is hidden and a filesystem search false-negatives a real artifact
35
+ from the wrong CWD. Every probe is a documented exit-code contract, listed
36
+ once in `orc lane calls <lane>`. Treat a positive probe as the source of truth
37
+ and never second-guess it.
38
+
39
+ 4. **One line each.** Print one line per probe, per resolved gate, per tier.
40
+ **A probe whose answer is silent is a probe that gets skipped** — by the next
41
+ maintainer, and eventually by the model. An empty result is an ANSWER and
42
+ still gets its line.
43
+
44
+ ## The four rules
45
+
46
+ - **Preflight is SILENT in the sense that it asks nothing** — it prints, it never
47
+ interviews. A question in preflight is a question asked before the lane knows
48
+ enough to ask it well.
49
+ - **Nothing here stops a run unless the lane's own spine says it does.** Most
50
+ lanes treat missing knowledge as a helpful extra: it means more of the work is
51
+ a question instead of a lookup. `/orc-fast` is the exception, and it says so.
52
+ - **ONCE per run** (`/orc-quick`: once per session). A preflight that re-runs is
53
+ a preflight nobody reads.
54
+ - **An exit code is an answer, not a failure.** `orc pact status` exit 3 is "no
55
+ ledger yet, this is a first run"; `orc gotcha status` exit 1 is an empty
56
+ ledger. Say what it means, not that it failed.
57
+
58
+ ## The rules line (v1.7.0) — printed by every lane that runs the `rules` phase
59
+
60
+ `orc rules slice --lane <lane> --json` returns a `line`. Print it VERBATIM:
61
+
62
+ ```
63
+ rules: ORC 65 (W 23 · C 22 · D 10 · U 10) · yours 9 lines (P0 4 · P1 2 · P2 3) · 1 override
64
+ rules: ORC 65 (W 23 · C 22 · D 10 · U 10) · yours none
65
+ ```
66
+
67
+ **Both spellings are mandatory in their state.** `yours none` says the project
68
+ has not written its own rules — a different fact from the CLI failing to look,
69
+ and the line is what keeps the two apart. Never compute the counts here.
70
+
71
+ Where the lane's preflight prints a REPORT rather than a bare line, the report
72
+ names each override under it. An override the user cannot see is an override
73
+ they cannot audit. The rest of the mechanic is `./rules.md`.
74
+
75
+ `/orc-doc` prints `house rules: …` instead, from `orc doc rules`. The two
76
+ surfaces are different files and never mix.
77
+
78
+ ## The usage line (v1.1.0) — printed whenever `usage_gate` is armed
79
+
80
+ `usage_gate` resolves in step 1 like any other key. When it is anything but
81
+ `off`, run `orc usage check --json` in step 3 and print ONE line:
82
+
83
+ ```
84
+ usage: 5h 71% · wk 38% · gate at 10% left · warn
85
+ usage: unknown (no reading in the last 30 minutes) · a run is never stopped on this
86
+ ```
87
+
88
+ Both spellings are mandatory in their state. A gate that prints only when it
89
+ fires is a gate the user cannot tell from a gate that is not running — and the
90
+ `unknown` line is what stops someone believing they are protected when Claude
91
+ Code is sending no usage headers at all.
92
+
93
+ **Exit 2 (`unknown`) NEVER stops a run.** Absent is not low.
94
+
95
+ A `blocked` run (`orc wait status --json`) prints the block and its AGE here too,
96
+ and again at every gate it suppresses. The rest of the mechanic — the modes, the
97
+ hops, what `stop` and `wait` actually do — is `../wait.md`; this file only says
98
+ that the line is printed and when.
99
+
100
+ ## The graph line (v1.8.0) — code-changing lanes only
101
+
102
+ `/orc`, `/orc-ultra`, `/orc-diy`, `/orc-mini`, `/orc-fast` and `/orc-quick` run
103
+ `orc graph status --if-enabled --heal --json` in step 3, BEFORE the first
104
+ dispatch — never skipped. `--heal` builds a missing graph and updates a drifted
105
+ one in the same call (it is free), so there is no second call to forget. Print
106
+ its `line` (`off` included) and put its `trace` (`GRAPH-CONSULT …`) in the next
107
+ packet as it is — never as a `GATE` line in your own words. While the graph is
108
+ on, `orc lane config` prints the three graph steps in `announce[]` (`../code-graph.md`
109
+ §0). **The lane reads no `code_graph` key:** `--if-enabled`
110
+ makes the CLI decide, which is how `/orc-quick` takes part while its step 1 still
111
+ reads `log_dir` and nothing else. A graph that cannot be built never stops a run,
112
+ and `/orc-fast` gains no third gate. Every other lane prints nothing.
113
+
114
+ <!-- /orc:layer -->
115
+
116
+ <!-- orc:layer full -->
117
+
118
+ ## `/orc` and `/orc-ultra` — preflight also REPORTS
119
+
120
+ The full lane's preflight does everything in `core` and then prints the
121
+ **preflight report**: tasks · waves · estimated subagents · model mix · the wiki
122
+ tier · the resolved pattern · crosslink state · the pause schedule · the run
123
+ budget. That format, its `GATE budget stop|pass` line and the FLOOR rule (repairs
124
+ push the real count up, never down) live in the `orc` skill's own
125
+ `references/preflight-report.md` — read it relative to that skill. It has ONE
126
+ consumer, so it stays home rather than moving here.
127
+
128
+ A trimmed lane must **not** read that file. `orc-mini` and `orc-fast` print their
129
+ resolved lines and go; there is no forecast to report because there are no waves
130
+ to forecast.
131
+
132
+ <!-- /orc:layer -->