@orkestrel/scaffold 0.0.21 → 0.0.22

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 (68) hide show
  1. package/dist/bin/scaffold.js +371 -140
  2. package/dist/bin/scaffold.js.map +1 -1
  3. package/dist/host/AGENTS.md +61 -42
  4. package/dist/host/CLAUDE.md +39 -408
  5. package/dist/host/agents/orchestration.md +454 -0
  6. package/dist/host/agents/skills/enterprise-bootstrap/SKILL.md +25 -7
  7. package/dist/host/agents/skills/orkestrel-align-packages/SKILL.md +2 -2
  8. package/dist/host/agents/skills/orkestrel-build-application/SKILL.md +42 -31
  9. package/dist/host/agents/skills/orkestrel-build-application/references/application.md +129 -0
  10. package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +3 -3
  11. package/dist/host/agents/skills/orkestrel-debrief/references/field-testing.md +2 -2
  12. package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +167 -0
  13. package/dist/host/agents/skills/orkestrel-falsify/references/brief.md +98 -0
  14. package/dist/host/agents/skills/orkestrel-falsify/references/reconcile.md +148 -0
  15. package/dist/host/agents/skills/orkestrel-harden-package/SKILL.md +4 -2
  16. package/dist/host/agents/skills/orkestrel-harden-package/references/centralization.md +5 -5
  17. package/dist/host/agents/skills/orkestrel-harden-package/references/research.md +2 -0
  18. package/dist/host/agents/skills/orkestrel-polish-surface/SKILL.md +11 -6
  19. package/dist/host/claude/agents/analyst.md +59 -0
  20. package/dist/host/claude/agents/application.md +1 -1
  21. package/dist/host/claude/agents/builder.md +1 -1
  22. package/dist/host/claude/agents/checker.md +5 -1
  23. package/dist/host/claude/agents/codex.md +120 -94
  24. package/dist/host/claude/agents/grok.md +44 -32
  25. package/dist/host/claude/agents/implementer.md +1 -1
  26. package/dist/host/claude/agents/orkestrel.md +1 -1
  27. package/dist/host/claude/agents/planner.md +9 -3
  28. package/dist/host/claude/agents/researcher.md +6 -5
  29. package/dist/host/claude/agents/reviewer.md +12 -6
  30. package/dist/host/claude/agents/scout.md +7 -4
  31. package/dist/host/claude/agents/verifier.md +1 -1
  32. package/dist/host/claude/rules/application.md +17 -16
  33. package/dist/host/claude/rules/architecture.md +41 -22
  34. package/dist/host/claude/rules/documentation.md +2 -1
  35. package/dist/host/claude/rules/names.md +7 -6
  36. package/dist/host/claude/rules/quality.md +65 -18
  37. package/dist/host/claude/rules/styles.md +1 -1
  38. package/dist/host/claude/rules/tests.md +12 -6
  39. package/dist/host/claude/rules/typescript.md +1 -1
  40. package/dist/host/claude/rules/workspace.md +6 -3
  41. package/dist/host/claude/settings.json +2 -0
  42. package/dist/host/claude/skills/orkestrel-falsify/SKILL.md +10 -0
  43. package/dist/host/codex/agents/analyst.toml +13 -4
  44. package/dist/host/codex/agents/checker.toml +1 -1
  45. package/dist/host/codex/agents/grok.toml +2 -1
  46. package/dist/host/codex/agents/opus.toml +1 -1
  47. package/dist/host/codex/agents/planner.toml +1 -1
  48. package/dist/host/codex/agents/researcher.toml +2 -2
  49. package/dist/host/codex/agents/reviewer.toml +1 -1
  50. package/dist/host/codex/agents/scout.toml +2 -2
  51. package/dist/host/codex/config.toml +23 -70
  52. package/dist/host/cursor/rules/orchestration.mdc +33 -0
  53. package/dist/host/guides/src/scaffold.md +301 -123
  54. package/dist/host/manifest.json +47 -1
  55. package/dist/host/tests/setupPolicy.ts +83 -3
  56. package/dist/src/core/index.cjs +404 -63
  57. package/dist/src/core/index.cjs.map +1 -1
  58. package/dist/src/core/index.d.cts +119 -41
  59. package/dist/src/core/index.d.ts +119 -41
  60. package/dist/src/core/index.js +401 -64
  61. package/dist/src/core/index.js.map +1 -1
  62. package/dist/src/server/index.cjs +83 -33
  63. package/dist/src/server/index.cjs.map +1 -1
  64. package/dist/src/server/index.d.cts +32 -16
  65. package/dist/src/server/index.d.ts +32 -16
  66. package/dist/src/server/index.js +84 -35
  67. package/dist/src/server/index.js.map +1 -1
  68. package/package.json +4 -4
@@ -0,0 +1,454 @@
1
+ # Orchestration
2
+
3
+ How agents are dispatched, supervised, and accepted. Every harness follows this file.
4
+
5
+ ## Authority
6
+
7
+ Read in this order before acting:
8
+
9
+ 1. The user's current instruction. It wins over everything below.
10
+ 2. `AGENTS.md` and the applicable `.claude/rules/*.md` files. They govern code substance.
11
+ 3. This file. It governs agent operation only and cannot weaken the coding contract.
12
+ 4. The dispatch-named skill and the references it requires.
13
+ 5. The governing guide or spec.
14
+
15
+ `CLAUDE.md`, `.codex/config.toml`, and `.cursor/rules/` are bridges. Each points here and adds
16
+ only what its harness needs. None of them restates this file.
17
+
18
+ Every dispatch tells its executor to read items 2 through 5 before acting.
19
+
20
+ ## The three engines
21
+
22
+ One workflow runs across all providers. Each engine has one job and never takes another's.
23
+
24
+ | Engine | Job | Posture |
25
+ | --------------- | ----------------------------------------------------- | -------------------------------------------- |
26
+ | **Cursor Grok** | Absorption, distillation, scouting, bounded research | Read-only; returns evidence, never decisions |
27
+ | **Opus 5** | Subjective design, design-fit review, implementation | Proposes, audits, implements; never accepts |
28
+ | **GPT-5.6 Sol** | Objective analysis, correctness audit, implementation | Proposes, audits, implements; never accepts |
29
+
30
+ - Route each nontrivial implementation unit to Opus or Sol. Objective, constraint-heavy,
31
+ mechanical-precision work goes to Sol. API-shape, naming, and documentation-voice work goes to
32
+ Opus. Cursor Composer is not an implementation route, and no `composer` role exists.
33
+ - Design and audit always run the two-lane adversarial pass below.
34
+
35
+ ## Orchestration by harness
36
+
37
+ The harness's own engine orchestrates. Run it on the latest version of that model at high
38
+ reasoning effort.
39
+
40
+ | Harness | Orchestrator engine |
41
+ | ----------- | ------------------- |
42
+ | Claude Code | Opus 5 |
43
+ | Codex | GPT-5.6 Sol |
44
+ | Cursor | Cursor Grok |
45
+
46
+ - The Orchestrator reconciles. No engine reconciles itself or accepts its own work.
47
+ - The Orchestrator shares its engine with one lane: Opus in Claude Code, Sol in Codex. That lane is
48
+ still dispatched as a separate subagent with a clean context, never run inline.
49
+ - In a fix round the auditor is an engine that did not write it. When the writer's engine is the
50
+ Orchestrator's engine, the auditor is the other lane.
51
+ - Each harness reaches the engines it does not host through its own bridge file. The bridge owns
52
+ the invocation mechanics and their cost constraints; this file owns the routing.
53
+
54
+ ## The adversarial pass
55
+
56
+ Two lanes run on every design round and every audit round.
57
+
58
+ | Lane | Argues |
59
+ | -------------- | --------------------------------------------------------------------------- |
60
+ | **Subjective** | Shape, taste, naming, ergonomics, design fit, what the API should feel like |
61
+ | **Objective** | Correctness, constraints, and what the code and contracts actually permit |
62
+
63
+ **Both lanes always run.** Never collapse them into one. Never let an engine's absence stand in for
64
+ a lane.
65
+
66
+ ### Clean contexts
67
+
68
+ - Dispatch each lane as a fresh subagent. Never run a lane inside the Orchestrator's own context.
69
+ - Give each subagent the brief and its evidence slice, and nothing else. Do not carry the
70
+ Orchestrator's conversation, its working hypothesis, or the other lane's answer.
71
+ - A lane run in the Orchestrator's context is the Orchestrator assessing itself, whatever model
72
+ name it carries. The clean context is what makes the lane independent and unbiased, and it is
73
+ what keeps the main context at decision level.
74
+ - Run both lanes in parallel, blind to each other. Reconcile them yourself.
75
+
76
+ ### Engine assignment
77
+
78
+ By default Opus 5 holds the subjective lane and Sol holds the objective lane.
79
+
80
+ When one engine is unavailable, the remaining engine runs **both** lanes — still two separate
81
+ subagents, still clean contexts, still blind to each other, each told which perspective it holds.
82
+ Record the substitution.
83
+
84
+ | Harness | Engine unavailable | Runs both lanes |
85
+ | ----------- | ------------------------ | --------------- |
86
+ | Claude Code | Sol (Codex bench dark) | Opus 5 |
87
+ | Codex | Opus 5 (Claude CLI dark) | GPT-5.6 Sol |
88
+ | Cursor | Both (MCP servers dark) | Cursor Grok |
89
+
90
+ - Never assign Grok to either lane in Claude Code or Codex. If the remaining native engine is also
91
+ unavailable there, the pass cannot run: stop and report rather than substituting Grok.
92
+ - Grok takes both lanes only in Cursor, and only when Opus 5 and Sol are both unavailable.
93
+
94
+ ## Tedious work goes to Grok
95
+
96
+ Absorption, distillation, repository scouting, and bounded primary-source research go to Grok
97
+ first, always. Grok returns distilled evidence with `file:line` pointers, never raw dumps.
98
+
99
+ Send it any task whose cost is reading: mapping terrain, surveying prior art, sweeping a large
100
+ diff, reconciling scattered sources.
101
+
102
+ Fall back in this order and record the substitution:
103
+
104
+ 1. **Cursor Grok.** The default.
105
+ 2. **Luna** (`gpt-5.6-luna`), when the Cursor bench is dark and Codex is available.
106
+ 3. **Sonnet**, when both benches are dark.
107
+
108
+ - Never route absorption to the Orchestrator itself, even when the Orchestrator is Grok. Keep the
109
+ main context at decision level; in Cursor that means a Grok executor session, not this one.
110
+ - Never spend Opus 5 or Sol on it.
111
+ - Grok is read-only, so a writing unit never routes there. Fully specified mechanical writing goes
112
+ to `builder` or `application` on the harness's cheap native tier.
113
+ - `verifier` runs commands and reports exit codes, so it stays on the native tier too.
114
+
115
+ ## Orchestrator and executor
116
+
117
+ - The top-level agent is the **Orchestrator**. It owns the goal, plan, decisions, cross-unit
118
+ state, integration, and final acceptance.
119
+ - A dispatched subagent is an **Executor**. It performs its bounded assignment directly, spawns
120
+ nothing, and returns the required distillate.
121
+ - Work directly on a typo, a one-line fix, or a single lookup. Orchestrate when isolation,
122
+ parallelism, independent review, or substantial context justifies it.
123
+
124
+ ## Roles
125
+
126
+ One role set, mirrored per provider. Name the role and state its engine in every dispatch, even
127
+ when the role file already pins it.
128
+
129
+ | Job | Claude role (`.claude/agents/`) | Codex role (`.codex/agents/`) | Engine |
130
+ | ---------------------------------------- | ------------------------------- | ----------------------------- | ----------------------------- |
131
+ | Absorption, distillation, scouting | `grok` | `grok` | Cursor Grok (bridge) |
132
+ | Creative design and alternatives | `planner` | `planner` | Opus 5 (native / bridge) |
133
+ | Design-fit review and audit | `reviewer` | `reviewer` | Opus 5 (native / bridge) |
134
+ | Objective analysis and correctness audit | `analyst` | `analyst` | GPT-5.6 Sol (bridge / native) |
135
+ | Nontrivial implementation (objective) | `codex` route `implementer` | `implementer` | GPT-5.6 Sol (bridge / native) |
136
+ | Nontrivial implementation (subjective) | `implementer` | `implementer` route `opus` | Opus 5 (native / bridge) |
137
+ | Bounded primary-source research | `researcher` | `researcher` | Grok → Luna → Sonnet |
138
+ | Repository reconnaissance | `scout` | `scout` | Grok → Luna → Sonnet |
139
+ | Mechanical conformance evidence | `checker` | `checker` | Grok → Luna → Sonnet |
140
+ | Ecosystem evidence | `orkestrel` | `orkestrel` | Sonnet / Terra |
141
+ | Fully specified mechanical unit | `builder` | `builder` | Sonnet / Terra |
142
+ | Fully specified app-layer unit | `application` | `application` | Sonnet / Terra |
143
+ | Gate evidence | `verifier` | `verifier` | Sonnet / Terra |
144
+
145
+ - A **bridge** role is a cheap driver whose only work is invoking another provider's CLI. It never
146
+ implements, judges, or endorses the result.
147
+ - Give every role a file on both sides. The role file is where engine, effort, tools, permissions,
148
+ and charter are pinned, and the tool allowlist is what makes the read-only floor real. A role
149
+ with no file has nowhere to pin either.
150
+ - Reach every role by its own name. Do not rely on a remembered route.
151
+ - `researcher`, `scout`, and `checker` are native lanes for jobs that belong to Grok first.
152
+ Dispatch `grok` with their brief before using them, and use the native role only once the ladder
153
+ has stepped past Grok. Record which step you are on.
154
+ - `orkestrel` stays native because it carries the package catalog in its own role file. Sending its
155
+ job to a bench means shipping that catalog across, which costs more than the bench saves.
156
+ - One gap is open and recorded rather than improvised: the Sol implementer is still `codex` route
157
+ `implementer` while its Codex mirror has a named `opus` bridge. Closing it means deciding where
158
+ the shared Sol transport contract lives once two bridges follow it.
159
+ - Opus and Sol roles use high effort. Native cheap-tier roles use low or medium. Bridge drivers use
160
+ the cheapest tier that can run a CLI.
161
+ - Never route orchestration or acceptance across a bridge.
162
+
163
+ ## Permission floor
164
+
165
+ Every role honours this floor. No dispatch may widen it.
166
+
167
+ - Agents run to completion. Constrain only genuine security or destruction risk. Do not gate
168
+ routine work behind approval prompts or turn budgets.
169
+ - Read-only roles carry no `Edit` and no `Write`. The tool allowlist is the guarantee. Because
170
+ those roles cannot inspect the tree by writing to it, the Orchestrator supplies the actual diff
171
+ and status evidence in every review dispatch.
172
+ - `verifier` has no edit or write tools and never fixes a failure.
173
+ - Run writing roles in the main checkout, strictly serialized: one writer at a time, dispatched
174
+ from a clean committed baseline, each owning disjoint files.
175
+ - Treat every shared file as report-only.
176
+ - No role commits, pushes, tags, publishes, installs dependencies, or runs a destructive command.
177
+ - No role reads, prints, copies, uploads, or packages a secret — `CURSOR_API_KEY`, Codex auth
178
+ files, `.env*`, `.npmrc`, `auth.json`, keys, or tokens.
179
+ - Concurrent executors never run tree-wide `format`, lint `--fix`, or `build`. They validate
180
+ read-only and scoped to their own files.
181
+ - Keep hooks light. A Stop hook may run cheap changed-file verification such as `git diff --check`.
182
+ It never duplicates the gate suite; gates belong to `verifier`.
183
+
184
+ ## Context and decomposition
185
+
186
+ - Keep the main context at decision level. Send large reads, repository scans, raw logs, diffs,
187
+ and exploratory sweeps to `grok` and consume the distillate.
188
+ - Settle a behavioural question by running it, including your own. This binds before a brief is
189
+ written, not only after a report arrives, and it needs no disagreement to trigger it. A round of
190
+ deliberation that a probe would have ended is the expensive failure, and it is invisible because
191
+ it feels like rigour.
192
+ - Check an assumption before it enters the plan. An unverified belief the Orchestrator states
193
+ becomes a fact for every unit downstream, and every one of them inherits the error.
194
+ - Break a repeating frame deliberately. When several rounds against one subject keep finding the
195
+ same class of defect through a new door, the search is following the frame rather than the
196
+ defect. Bound the scope, then fan out independent lenses over disjoint slices in one pass.
197
+ Parallelism is worth more here for the framing it breaks than for the wall-clock it saves.
198
+ - Decompose by required context and independently verifiable acceptance criteria, not by task type.
199
+ - Send instructions down fully specified. Return findings smaller than the context consumed.
200
+ - Parallelize independent work. Serialize dependencies and shared-file contention.
201
+ - The Orchestrator owns the plan and every final decision. Design engines propose, writers execute,
202
+ auditors advise.
203
+
204
+ ## Writing concurrency
205
+
206
+ Concurrent executors share a filesystem unless isolated. Follow these six rules to prevent
207
+ clobbered edits, formatter and build races, cache phantoms, and validation cross-talk.
208
+
209
+ 1. Serialize writing executors in the main checkout. Commit a checkpoint before each writing
210
+ dispatch so git is the rollback mechanism.
211
+ 2. Assign disjoint owned files plus explicit shared and off-limits files.
212
+ 3. Keep shared files report-only. Executors return exact patches for serial integration.
213
+ 4. Restrict concurrent executors to read-only, scoped validation. A tree-wide result may contain a
214
+ sibling's in-flight failure, so an executor reports only its owned scope.
215
+ 5. Give concurrent audit lanes worktree isolation whenever the campaign is uncommitted. Two lanes
216
+ sharing one working tree contaminate each other's readings in both directions.
217
+ 6. After integration, clear shared caches if needed, then have one independent `verifier` run the
218
+ authoritative tree-wide sweep. A writer's self-report never establishes green.
219
+
220
+ ## Execution loop
221
+
222
+ At session start, before planning, probe bench liveness with the two cheap commands
223
+ (`codex --version`; `agent --version`, falling back to `agent.cmd --version`) and plan routing
224
+ against the result. Probes are read-only. Record a dark bench with its fallback and the lane
225
+ substitution it forces; never absorb it silently.
226
+
227
+ 1. **Absorb.** Dispatch `grok` for terrain, prior art, and the reading the decision needs. In an
228
+ Orkestrel repo dispatch `orkestrel` alongside it for live package state. Skip only when the
229
+ ground is already known.
230
+ 2. **Design adversarially.** Run the two-lane adversarial pass on one design brief: `planner` for
231
+ the subjective lane and `analyst` for the objective lane. Reconcile them yourself into one plan:
232
+ units, dependencies, ownership, parallel and serial order, acceptance criteria, risks.
233
+ - Surface the plan before dispatch, including a routing ledger naming each unit's role **and**
234
+ engine. Routing a unit to a Claude-native agent when its work class belongs to a bench —
235
+ reading-heavy to Grok, objective audit or objective implementation to Sol — without a recorded
236
+ bench-dark deviation is a dispatch deviation.
237
+ - State the goal's exit criterion beside the units: the enumerated capabilities whose closure
238
+ ends the campaign, each to end implemented, repaired, retained, or intentionally excluded on
239
+ evidence. A plan that names work but not its end can only be abandoned, never finished.
240
+ 3. **Implement.** Route each nontrivial objective unit to the Sol `implementer` and each nontrivial
241
+ subjective unit to the Opus `implementer`, in the main checkout, one writer at a time. Route a
242
+ fully specified taste-free unit to `builder`. Never route implementation to an engine the unit's
243
+ judgment load exceeds.
244
+ 4. **Integrate.** Evaluate each distillate against its acceptance criteria, apply shared-file
245
+ patches serially, and route cross-cutting findings.
246
+ 5. **Audit adversarially.** Run the two-lane adversarial pass on every nontrivial implementation:
247
+ `reviewer` for the subjective lane and `analyst` for the objective lane, plus `checker` for
248
+ mechanical conformance.
249
+ - State the audit's subject as numbered falsifiable claims and require per-claim verdicts with
250
+ evidence, per the Falsification law in `.claude/rules/quality.md` and the value set the
251
+ dispatch-named skill fixes.
252
+ - In a fix round, give the unit to an auditor engine that did not write it.
253
+ - Run the `orkestrel-falsify` skill for multi-round audits. It owns the brief anatomy, the
254
+ successor-brief rule, the verdict shape and its single terminal line, and the reconciliation
255
+ discipline.
256
+ - Reconcile their evidence. Drop, on the record, any finding neither engine can substantiate.
257
+ 6. **Verify.** Have one independent `verifier` run the authoritative gates.
258
+ 7. **Accept.** Decide, then report outcomes, decisions, evidence, and remaining risk concisely.
259
+ When step 2's exit criterion is met and the gates are green, accept. The next goal is the
260
+ deliverable.
261
+
262
+ ## Deviation protocol
263
+
264
+ When reality diverges from a writing dispatch:
265
+
266
+ 1. The writer stops and reports: expected, found, exact evidence, done or not done, and at most one
267
+ short hypothesis. It does not investigate, improvise, or alter the plan.
268
+ 2. The Orchestrator triages:
269
+ - obvious correction → tighten and re-dispatch;
270
+ - missing mechanical evidence → dispatch `verifier`;
271
+ - unknown terrain → dispatch `grok` with the report and the plan slice;
272
+ - unknown design or root cause → dispatch `planner` and `analyst` on the question.
273
+ 3. The Orchestrator decides, updates the plan, and re-dispatches.
274
+
275
+ Workflow failures use the same ladder. Do not absorb their raw logs into the main context.
276
+
277
+ ## Dispatch anatomy
278
+
279
+ ### Native first
280
+
281
+ Launch a model through the running harness's own mechanism whenever that harness hosts it: Claude
282
+ subagents and workflows in Claude Code, Codex-native agents in a Codex session, Cursor-native
283
+ sessions in Cursor. MCP and CLI transports exist only to reach a model the harness does not host.
284
+ Never route a native model through its own CLI or an MCP loopback.
285
+
286
+ - Use a single-agent dispatch when later control flow depends on the previous result.
287
+ - Use a workflow for a known deterministic fan-out, staged pipeline, or loop. Serialize writing
288
+ nodes; never run two concurrent writers in the tree.
289
+ - Name a role and its engine in every node.
290
+
291
+ The harness bridge names the concrete mechanism for each of these.
292
+
293
+ ### Every dispatch is a file before it is a launch
294
+
295
+ - Write the brief to a file under `tmp/`, named for its unit, before launching the unit, whatever
296
+ engine executes it. A brief composed only inside a launch argument cannot be corrected, resumed,
297
+ or re-run once that call ends.
298
+ - Capture the unit's returned report to a file beside its brief under the same unit name, so a
299
+ unit's instruction and its outcome are one pair on disk.
300
+ - Amend a brief on re-run rather than restating it. A mid-campaign correction produces a successor
301
+ file recording what changed and why, and the original stays. A fix round's brief names the
302
+ findings it carries and where each came from.
303
+ - Treat brief and report files as unit evidence, not deliverables. Never commit them, and sweep
304
+ them when the campaign that produced them is accepted.
305
+ - Promote anything that must outlive the campaign into a durable artifact before the sweep — a
306
+ commit message, a guide, a rule, a retrospective. What is only in a swept file did not survive.
307
+
308
+ ### Required sections
309
+
310
+ - **Role and engine.** The named role and its explicit engine.
311
+ - **Objective.** One concrete outcome.
312
+ - **Context.** The evidence slice, paths, decisions, `AGENTS.md`, applicable rules, the skill name
313
+ and its required references (or an explicit none), and the guide or spec. Include the host
314
+ environment facts the unit will hit — the shell, path, and network constraints its commands run
315
+ under — because an executor that rediscovers them pays for the discovery in round trips.
316
+ - **Unknowns.** What the Orchestrator does not yet know that the unit needs, named as unknown, with
317
+ how the unit reports back on it. A brief that cannot be fully specified says so instead of
318
+ shipping a guess the executor would have to invent an answer around.
319
+ - **Scope.** Owned files, shared and off-limits files, allowed tools, permission limits.
320
+ - **Execution.** State that the executor performs the assignment directly and spawns nothing. Put
321
+ it in every brief; an executor deep in a task does not re-read this contract.
322
+ - **Output.** The exact distilled return shape. No process diary.
323
+ - **Deviation contract.** The required stop-and-report behaviour for writers.
324
+ - **Acceptance criteria.** Independently checkable completion conditions.
325
+ - **Review evidence.** What the subject type requires, per the table in `orkestrel-falsify`. For a
326
+ code change that is the actual diff and the actual status output; omitting either is a dispatch
327
+ deviation. For any claim about a rendered or externally driven surface, the capture portfolio is
328
+ the review input and source is corroboration. A subject may occupy more than one row — a ruling
329
+ whose fixes already landed as edits is both a proposal and a code change — and it gets the
330
+ evidence of every row it occupies.
331
+
332
+ ### Carry every finding
333
+
334
+ After reconciling findings into briefs, walk the retained finding list once. Every finding names
335
+ the brief item that carries it. A finding with no carrier is a dropped finding.
336
+
337
+ ## Bench laws
338
+
339
+ External engines widen capacity. They never inherit authority. Treat every bench output as a
340
+ proposal or hypothesis until it is verified against source and accepted by the Orchestrator.
341
+
342
+ A bench is cross-provider reach only. Never send a model across a bridge when the running harness
343
+ hosts it natively.
344
+
345
+ Every bridge verifies its CLI is present before running, and stops with a deviation report naming
346
+ the fallback when it is not. The role file owns the exact invocation, flags, paths, and recovery
347
+ ladder; these four laws bind every bench regardless of transport.
348
+
349
+ 1. **Transport by work class.** Use an MCP transport only for a short interactive exchange — one
350
+ bounded question or a follow-up on a live thread, finishing in roughly two minutes. Use the
351
+ journaled CLI for audits, implementation units, and anything else multi-minute. An interrupted
352
+ MCP call loses its session invisibly; a journal survives any client-side failure.
353
+ 2. **Journal first.** Every bench invocation leaves a tailable on-disk record beside its brief
354
+ under `tmp/<bench>/`: the event stream or output log, and the final answer. Arm exactly one
355
+ Monitor per long exec, filtered to milestones — commands run, files changed, agent messages,
356
+ terminal states — never the raw event stream. Exit the filter on the exec's terminal event so no
357
+ watcher outlives its subject. The journal's mtime is the liveness signal; the session id in its
358
+ head is the recovery handle.
359
+ 3. **Tracked, never loose.** Register every bench unit in the session task registry at launch with
360
+ its subject, journal path, and session id, and complete it there at acceptance. "What is
361
+ running" always has a first-class answer instead of a recollection of a command.
362
+ 4. **Ephemeral streams, durable records.** A journal proves a bench is alive and recovers an
363
+ interrupted session. Keep journals under `tmp/`, never commit them, and sweep them at acceptance
364
+ after the final gate evidence is recorded. The **brief**, the returned **distillate**, the
365
+ **audit verdict**, and the **acceptance evidence** are not streams. Commit each one as its unit
366
+ is dispatched and as it returns, because each encodes knowledge that costs real money to
367
+ re-derive and none of it is reproducible from the diff.
368
+
369
+ ### Where campaign artifacts live
370
+
371
+ - Put every campaign artifact in the **orchestrator's** repository under `.orkestrel/<package>/`,
372
+ named for the package the campaign is about.
373
+ - Never put them in the package they are about. A published package's tree is its product.
374
+ - Claim nothing outside `.orkestrel/` unless Orkestrel scaffold mandates it. Everything Orkestrel
375
+ owns in a consumer's tree lives beneath that folder, so a convention can be settled there without
376
+ colliding with a convention that is not Orkestrel's.
377
+ - Keep the campaign narrative and every ruling in the durable artifact that owns it — the guide for
378
+ product truth, a rule or role file for process truth, the commit message for the decision itself.
379
+ Use `ROADMAP.md` only where the repository already keeps one.
380
+ - Prune the campaign folder in a commit at acceptance. The tree ends clean and the record stays
381
+ recoverable by hash. Git history is the archive; the working tree is the workspace.
382
+
383
+ ### Launching a long exec
384
+
385
+ - The Orchestrator launches every long bench exec as a harness-tracked background command under a
386
+ hard time cap. Never detach one from inside a bridge agent. The harness owns the lifecycle,
387
+ completion re-invokes the session, and the cap kills a wedged bench loudly instead of trusting
388
+ the bridge to report its own failure. A wedged bridge is silent, and silence must never read as
389
+ progress.
390
+ - A Workflow journals identically and dies identically, so give it the same watch — with one
391
+ correction. A workflow journal writes only at agent start and result, so its mtime goes quiet for
392
+ minutes during healthy work, and the liveness signal is the newest subagent transcript instead. A
393
+ watch that reports only new events cannot report a death, because silence and progress look the
394
+ same; the filter must fire on absence. Recover with `resumeFromRunId`, which returns every
395
+ completed agent from cache and re-runs only what never finished.
396
+ - Size the cap from the observed high mark of comparable units, plus an independently budgeted gate
397
+ allowance, plus explicit slack. Never size it from the estimate alone.
398
+ - Run the first use of any CLI flag, subcommand, quoting form, or stdin combination in a throwaway
399
+ probe. Never inside a dispatched unit.
400
+ - A launch is not a launch until the journal grows past its header. Confirm the event stream
401
+ advanced beyond the session-configured head before recording that the exec started, and treat an
402
+ instantly-dead journal as a failed launch whose tail is the evidence.
403
+ - Keep network-dependent work out of sandboxed bench execs. Bench sandboxes deny network, so
404
+ lockfile generation, real installs, and live fetches belong to the Orchestrator's own tracked
405
+ commands or a network-capable native agent. A bench exec hanging on `npm` until its cap fires is
406
+ the signature of this misroute, not of a slow bench.
407
+
408
+ ### Recovering a dark bench
409
+
410
+ - A probe that finds a bench binary present but authentication unavailable starts recovery in the
411
+ same turn. Do not record the bench dark and wait.
412
+ - Background the login command with its output captured under `tmp/<bench>/`, surface the
413
+ verification URL and one-time code to the user the moment they appear there, arm a watcher on
414
+ completion, and re-probe when it fires. The bench comes live mid-session with no restart.
415
+ - A session that sits dark until the user asks for the login has failed the probe, not the bench.
416
+ - Never substitute an API key, access token, copied auth file, or another login flow. If recovery
417
+ cannot complete, record the bench dark, name the fallback in the plan, and say so.
418
+ - The role file owns each bench's exact login command and probe.
419
+
420
+ ### Reading liveness
421
+
422
+ Read liveness from the artifact the work produces, never from its wrapper. A subagent's transcript
423
+ file can report zero bytes while the agent is working normally, so an empty or stale wrapper proves
424
+ nothing.
425
+
426
+ - Judge a unit by what it has changed in the tree: modification times on the files it owns, the
427
+ counts its suite reports, the report it was told to write.
428
+ - Check that before killing anything. A healthy unit killed on a false signal loses everything it
429
+ had not yet written down, and the loss is charged to the orchestrator, not the unit.
430
+ - If a unit must be stopped, say plainly that it was stopped and why, then assess the tree it left
431
+ rather than assuming its partial bytes are either good or worthless.
432
+ - Follow the deviation ladder for a stalled journal or a cap-killed exec, using the session id from
433
+ the journal head as the recovery handle.
434
+
435
+ ## Acceptance laws
436
+
437
+ - No writer's and no external engine's self-assessment is authoritative.
438
+ - Never spend Opus 5 or Sol on absorption, distillation, scouting, or mechanical edits. Never route
439
+ judgment-bearing implementation away from Opus 5 or Sol.
440
+ - Substitute an engine only when the same session records the bench dark — CLI missing, auth
441
+ expired, model unavailable. Name the fallback in the plan; never improvise it silently. The
442
+ tedious-work ladder is the only pre-approved substitution, and each step down it is still recorded.
443
+ - Never run the two lanes on different briefs, and never show either one the other's answer before
444
+ both have returned.
445
+ - Never run a lane inline in the Orchestrator's context, and never drop a lane because its default
446
+ engine is unavailable. Substitute the engine, keep the lane.
447
+ - Never accept unreviewed implementation, unverified hypotheses, shared-tree writing races,
448
+ implicit engines, fixed Claude model IDs, or verbose completed-work residue.
449
+ - Evidence a claim about a rendered or externally driven surface with its capture or a real foreign
450
+ client driving it, never with source alone. Where no such surface exists this law is inert.
451
+ - Final acceptance belongs only to the Orchestrator, after independent audit and gate evidence.
452
+ - Accept when the plan's exit criterion is met and the gates are green, not when the last engine
453
+ runs out of appetite. Reopening an accepted criterion is the user's instruction, not an auditor's
454
+ finding.
@@ -97,10 +97,26 @@ Brainstorm privately; show higher-confidence directions.
97
97
 
98
98
  1. **Mobile first** — smallest screen first, then `sm` / `md` / `lg` / `xl` / `xxl`
99
99
  2. **Semantic HTML** — `nav`, `main`, `section`, heading order
100
- 3. **Combine utilities** — spacing/flex/display before custom CSS
101
- 4. **Don't override** — utilities/components before bespoke styles; extend via component `--bs-*` variables or the utilities API, not high-specificity rules
102
- 5. **Test responsiveness** — every breakpoint you claim
103
- 6. **Verify against the shipped cascade** — resolve every treatment in the CSS actually loaded (Bootstrap plus every skin and dependency stylesheet the page pulls in), never against docs memory. A class with no rule of its own may still inherit one, and a token pair that passes in stock Bootstrap can fail under a compatible skin. Measure, don't assume — including the `*-subtle` / `*-emphasis` recipes, once per theme.
100
+ 3. **Work down the styling ladder below** — component classes, then utilities, then Bootstrap's own extension points
101
+ 4. **Test responsiveness** — every breakpoint you claim
102
+ 5. **Verify against the shipped cascade** — resolve every treatment in the CSS actually loaded (Bootstrap plus every skin and dependency stylesheet the page pulls in), never against docs memory. A class with no rule of its own may still inherit one, and a token pair that passes in stock Bootstrap can fail under a compatible skin. Measure, don't assume — including the `*-subtle` / `*-emphasis` recipes, once per theme.
103
+
104
+ ### The styling ladder
105
+
106
+ Work down these rungs in order. Reach a lower rung only when the one above genuinely cannot express the need.
107
+
108
+ 1. **The component's own classes, in its documented structure.** Build the element the way Bootstrap defines it: the right elements, the right nesting, the right class names, the required ARIA. A card is `.card` wrapping `.card-body` wrapping `.card-title` — not a `div` with borrowed padding. The best result is an element styled entirely by correct component classes, because variants, states, colour modes, and responsive behaviour all hang off that structure.
109
+ 2. **Bootstrap utilities, for refinement.** Spacing, flex, display, sizing, text, borders, colour. This is where the creative range is — compose utilities rather than reaching past them. Use only classes that exist in [utilities.md](references/utilities.md); an invented one ships a silent no-op.
110
+ 3. **Bootstrap's own extension points.** Component `--bs-{component}-*` variables and the utilities API, when a real gap remains after rungs 1 and 2.
111
+ 4. **Anything beyond Bootstrap's conventions is the developer's call, not yours.** Stop at rung 3, and say plainly what rung 4 would require. Leaving that decision with the developer keeps the surface conventional, reviewable, and themeable.
112
+
113
+ Never open at rung 4. Specifically, do not reach first for:
114
+
115
+ - a `style="..."` attribute;
116
+ - a `<style>` block in a page or component;
117
+ - a new stylesheet rule for something a utility already does.
118
+
119
+ Each of those ends the cascade for that element: it outranks the utilities, it ignores `--bs-*` retheming, and it does not change across breakpoints or colour modes. Fighting utilities with high-specificity custom rules is the usual source of padding and margin cancel bugs.
104
120
 
105
121
  ### Hierarchy & actions
106
122
 
@@ -182,14 +198,15 @@ Markup: [components.md](references/components.md). Fine layout: [utilities.md](r
182
198
 
183
199
  ### When custom CSS is justified
184
200
 
185
- Only if Bootstrap cannot express the need and check the extension points first: component `--bs-{component}-*` variables for restyling, the utilities API for missing utility steps ([bootstrap-reference.md](references/bootstrap-reference.md) → Theming). Then:
201
+ This is rung 4 of the styling ladder, so it is the developer's decision. Propose it, name what it buys, and do not take it unprompted. Exhaust rungs 1–3 first: correct component structure, then utilities, then the extension points component `--bs-{component}-*` variables for restyling, the utilities API for missing utility steps ([bootstrap-reference.md](references/bootstrap-reference.md) → Theming).
202
+
203
+ When the developer does authorize it:
186
204
 
187
205
  - Name in Bootstrap vocabulary
188
206
  - Colors from `var(--bs-…)` / theme tokens so light and dark both work
189
207
  - Logical properties (`margin-inline-start`, not `margin-left`) so RTL works
190
208
  - Minimal surface area; document why
191
-
192
- Avoid fighting utilities with high-specificity custom rules (common padding/margin cancel bugs).
209
+ - A stylesheet rule, never a `style` attribute or a `<style>` block — those cannot be themed, overridden, or made responsive
193
210
 
194
211
  ### Anti-patterns
195
212
 
@@ -242,6 +259,7 @@ Progress:
242
259
  - [ ] Subject, audience, single job stated
243
260
  - [ ] Design plan: palette, type, layout, one signature (critiqued vs AI defaults)
244
261
  - [ ] Bootstrap shell from components.md; utilities from utilities.md (no invented classes)
262
+ - [ ] Styling ladder held: component structure, then utilities, then extension points — no `style` attribute, no `<style>` block, no custom rule doing a utility's job
245
263
  - [ ] Plan tokens mapped to theme / --bs-* (no hex scatter); light/dark if both ship
246
264
  - [ ] Copy: user language, consistent verbs, useful empty/error/loading
247
265
  - [ ] Five states per data surface: ideal / empty / loading / partial / error
@@ -11,7 +11,7 @@ Read the current authority in this order:
11
11
 
12
12
  1. `AGENTS.md` and applicable `.claude/rules/*.md`.
13
13
  2. The `integration.md` and `fleet.md` references selected below.
14
- 3. `CLAUDE.md` or `.codex/config.toml` for orchestration.
14
+ 3. `.agents/orchestration.md` for orchestration.
15
15
  4. Relevant package guides, `guides/src/scaffold.md`, and the configured Orkestrel specialist.
16
16
 
17
17
  Explicit user scope wins.
@@ -36,7 +36,7 @@ Invoke `$orkestrel-harden-package` for each package implementation unit. This sk
36
36
  8. **Prove the round trip.** Put integration coverage at the highest package that can exercise the real composed behavior. Retain focused deterministic coverage in lower packages.
37
37
  9. **Validate local changes safely.** When necessary, use built artifacts in an isolated consumer and prove the resolved graph. Restore temporary manifest/lockfile state.
38
38
  10. **Verify topologically.** Run local gates for touched packages from dependencies to dependents and inspect relevant generated outputs.
39
- 11. **Review the campaign.** Require independent correctness and conformance review per implementation unit plus one cross-package architecture/ergonomics review.
39
+ 11. **Review the campaign.** Run the two-lane adversarial pass plus a mechanical checker on each implementation unit, then one cross-package architecture and ergonomics review over the whole graph.
40
40
 
41
41
  ## Accept the result
42
42
 
@@ -52,40 +52,51 @@ includes app/core so the shared transport contracts have one host-independent ow
52
52
  placement and manifest laws. Parse the options container and its host and port leaves
53
53
  before mutation, rejecting wrong-shaped containers, empty hosts, and non-integer,
54
54
  negative, or out-of-range ports with a coded error and its guard.
55
- 5. **Own the shutdown contract.** Lifecycle transitions serialize in call order, an
56
- ephemeral restart re-requests port zero, stop closes hostile active connections
57
- deterministically, and runner stop idempotently releases its signal listeners. Runner
58
- generations isolate asynchronous failures so an older transition cannot release a
59
- newer run's listeners, and convenience startup returns the runner rather than hiding
60
- that cleanup.
61
- 6. **Keep boundary enforcement inside the configured toolchain,** each layer owning what
62
- it can express: Oxlint `no-restricted-imports` for literal-string declared package,
63
- alias, and conventional relative import direction; Oxfmt for formatting;
64
- `tests/setupPolicy.ts` as the narrow TypeScript compiler-API pass over computed and
65
- template-literal specifiers, declaration placement, and the barrel law; scoped
66
- TypeScript projects for host-global isolation; and Vite's real builds and
67
- environment-boundary plugin for Vue, CSS, assets, workers, runtime resolution, and
68
- physical workspace containment. Add no standalone boundary script and no second
69
- parser or source-language analyzer duplicating those layers. Disable the browser
70
- application's public directory so an unmanaged file copy cannot bypass the module
71
- graph. Keep browser-only runtime tooling development-only and require explicit
72
- authorization before adding a Sass compiler.
73
- 7. **Prove it on real hosts.** app/browser tests run on Playwright-backed Vitest Browser
74
- Mode against real DOM, probing the installed executable directly with
75
- `existsSync(chromium.executablePath())` rather than guessing a channel or reading an
76
- environment flag; app/server tests bind port zero on loopback and use real fetch;
77
- real child-process tests prove executable readiness, collision exit, signal
78
- termination, and port release, remembering that Windows reports
79
- `ChildProcess.kill('SIGTERM')` as OS termination by signal while POSIX delivery
80
- exercises the graceful listener and exits zero. A capability-dependent test probes the
81
- actual capability and scopes any skip narrowly.
55
+ 5. **Own the shutdown contract.**
56
+ - Serialize lifecycle transitions in call order.
57
+ - Re-request port zero on an ephemeral restart.
58
+ - Close hostile active connections deterministically on stop.
59
+ - Release the runner's signal listeners idempotently on stop.
60
+ - Isolate asynchronous failures by runner generation, so an older transition cannot
61
+ release a newer run's listeners.
62
+ - Return the runner from convenience startup rather than hiding that cleanup.
63
+ 6. **Keep boundary enforcement inside the configured toolchain.** Each layer owns what it
64
+ can express:
65
+ - Oxlint `no-restricted-imports` literal-string declared package, alias, and
66
+ conventional relative import direction.
67
+ - Oxfmt formatting.
68
+ - `tests/setupPolicy.ts` the narrow TypeScript compiler-API pass over computed and
69
+ template-literal specifiers, declaration placement, and the barrel law.
70
+ - Scoped TypeScript projects host-global isolation.
71
+ - Vite's real builds and environment-boundary plugin Vue, CSS, assets, workers,
72
+ runtime resolution, and physical workspace containment.
73
+
74
+ Then hold these four limits:
75
+ - Add no standalone boundary script, and no second parser or source-language analyzer
76
+ duplicating those layers.
77
+ - Disable the browser application's public directory, so an unmanaged file copy cannot
78
+ bypass the module graph.
79
+ - Keep browser-only runtime tooling development-only.
80
+ - Require explicit authorization before adding a Sass compiler.
81
+
82
+ 7. **Prove it on real hosts.**
83
+ - Run app/browser tests on Playwright-backed Vitest Browser Mode against real DOM.
84
+ Probe the installed executable directly with `existsSync(chromium.executablePath())`
85
+ rather than guessing a channel or reading an environment flag.
86
+ - Bind port zero on loopback in app/server tests and use real fetch.
87
+ - Prove executable readiness, collision exit, signal termination, and port release with
88
+ real child-process tests. Windows reports `ChildProcess.kill('SIGTERM')` as OS
89
+ termination by signal, while POSIX delivery exercises the graceful listener and exits
90
+ zero.
91
+ - Probe the actual capability in a capability-dependent test, and scope any skip
92
+ narrowly.
82
93
  8. **Document and prove parity** for every app export and behavioral method: guide,
83
94
  examples, manifest index, and the parity specifiers walking the existing `src` and
84
95
  `app` roots and every selected alias.
85
- 9. **Verify.** Run the rules' cleanup sweeps over source and tests, then one independent
86
- design audit, one independent objective audit, a mechanical conformance pass, and the
87
- repository gates in their required order. Generated CI runs those gates on the declared
88
- minimum Node release and on the current major.
96
+ 9. **Verify.** Run the rules' cleanup sweeps over source and tests. Then run the two-lane
97
+ adversarial pass, a mechanical conformance pass, and the repository gates in their
98
+ required order. Generated CI runs those gates on the declared minimum Node release and
99
+ on the current major.
89
100
 
90
101
  Do not add showcase, authentication, persistence, proxy, styling-system, or product
91
102
  policy unless the request requires it. Do not leave placeholders, compatibility shims,