@orkestrel/scaffold 0.0.105 → 0.0.107

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.
@@ -52,6 +52,19 @@ The harness's own engine orchestrates: Claude Fable 5.1 or Claude Opus 5.5 in Cl
52
52
  - Route gates to `verifier`. A writer's self-reported gate is not evidence.
53
53
  - Work directly on a one-file change or a one-line fix, subject to the preceding routing rules. Route standalone lookups through `scout`. Dispatch when isolation, parallelism, a second engine, or a large read pays for the brief.
54
54
 
55
+ ## Sessions and consultation
56
+
57
+ - Before launching a unit, check the roster for an existing session whose responsibility, model, permissions, workspace, and retained context fit the task, and resume it. Keep related tasks for one responsibility in that session.
58
+ - Start a fresh session when no suitable session survives, the work is unrelated, or retained context would compromise the judgment. Use fresh contexts for independent review and the blind design round. An agent that helped design or implement the subject cannot independently review that contribution.
59
+ - Record the session identity separately from its task, turn, process, and message address. Record each session's harness, provider, model, options, workspace, responsibility, owned paths, continuation address, latest task, and evidence paths in the roster, and preserve its prior task results.
60
+ - Treat a live writer as an agent with an active assignment and edit authority. A retained session without an assignment holds no resource merely by existing. Preserve an explicit hold until its owner releases it.
61
+ - Continue a unit through compaction. Before a handoff or context limit, record decisions, changed instructions, source identity, unresolved questions, failed and passing evidence, active process identities, ownership, and the next action. Compaction neither completes a task nor releases its files or processes.
62
+ - On continuation, the Orchestrator sends the next bounded objective and the facts changed after the last turn. The continued agent reads changed or missing authority and the source regions that objective needs, and rechecks mutable facts such as source state and process liveness. Do not repeat unchanged bulk reads merely because a unit resumes.
63
+ - Consult a suitable peer when a consequential approach remains open, evidence conflicts, or repeated attempts stop narrowing a failure. Give the peer the question, relevant evidence, attempted approaches, constraints, and requested answer. Use an existing specialist when its context helps and a fresh peer when the question needs an independent challenge.
64
+ - Keep consultation read-only and bounded. Ask for a recommendation, its evidence, uncertainty, and a concrete next check. The executor retains the work; the Orchestrator rules on scope and acceptance. Advice grants no authority and does not satisfy an independent review gate.
65
+ - Resolve conflicting advice against the contract and observable evidence. Do not add consultation to routine steps or repeat it without a changed question or evidence.
66
+ - When a requested transport fails, record the failure and whether a child was created. Before retrying an uncertain launch, inspect the recorded task or session. Use a permitted fallback with its actual model and options disclosed; retry a refused route only after a relevant condition changes.
67
+
55
68
  ## Size gate
56
69
 
57
70
  `AGENTS.md` § Work loop sizes a change and fixes the precedence (large, then medium, then small). This file adds who runs what.
@@ -82,23 +95,25 @@ A large change runs these phases once each, in order, and ends when the exit cri
82
95
 
83
96
  ## Parallelism
84
97
 
85
- - Fan out when the work is many small, fully specified, disjoint units: one cheap agent per unit with minimal context. Give the agents the same model, effort, agent type, tools, schema, and working directory when isolation and routing allow it, so their prompts share one cache prefix.
98
+ - Parallelize independently owned work when useful progress can overlap. Reuse suitable sessions per § Sessions and consultation, bound each objective, and count coordination and verification costs when choosing the lanes. § Cache governs model and tool settings.
86
99
  - Judgment stays narrow: a design or review pass is at most the two lanes the size gate names, each in a clean context, blind to the other, and it runs once. Never fan judgment out further, and never run it as a loop.
87
100
  - One writer per checkout, except under `orkestrel-parallel`: there, at most three writers share one checkout, each owns disjoint files and disjoint regions of shared files, and one runner lane owns every test, check, and build process. Otherwise give parallel writers disjoint owned files, and give a writer its own worktree under `tmp/worktrees/` only when two units must write the same files at once. Commit a checkpoint before a writing dispatch.
88
101
  - Shared files are report-only; a unit returns an exact patch. Under `orkestrel-parallel`, a writer edits its owned regions of a shared file directly.
89
- - Concurrent units validate read-only and scoped to their owned files; under `orkestrel-parallel`, the runner also runs read-only root checks and reports each finding to the lane that owns its file. Never run tree-wide `format`, lint `--fix`, or `build` beside a live unit.
102
+ - Scope validation by the claim and its input dependencies, not by writer ownership alone. Under `orkestrel-parallel`, the runner owns checks and obtains the required write holds. Preserve valid receipts; rerun a check when its inputs, configuration, environment, or claim changed. Never run tree-wide `format`, lint `--fix`, or `build` beside a live writer.
90
103
  - One Grok lane at a time; queue the rest. An empty lane beside a live probe is starvation, not darkness.
91
104
  - The Orchestrator's own sweep is a writing dispatch: run it before or after the units, never beside them.
92
105
 
93
106
  ## Permission floor
94
107
 
95
- - Read-only roles carry no edit or write tool. The Orchestrator supplies the diff and status to every review dispatch.
108
+ - Restrict read-only roles to read tools when the harness supports that restriction. Otherwise state the read-only boundary in the brief and record its enforcement limit. The Orchestrator supplies the diff and status to every review dispatch.
109
+ - Permit a verifier to write its assigned evidence artifacts and the generated outputs its dispatch declares; never permit source repairs. A declaration names the command and each path the command writes or replaces. Declare a path only when the command regenerates it and no lane authors it, such as a build directory or a generated inventory file; an authored path is source, whichever command rewrites it. Declare no path for a command that only deletes. Keep each declared output outside every other lane's owned files and recorded fixtures, and hold it with the command's inputs for the run. Under this floor, the declared command can remove and rewrite its declared outputs, and that replacement is neither a destructive command nor a deletion.
110
+ - Record `git status --porcelain` before and after a declared command. Report each declared output that git tracks and the run changed; never revert it. When the run changed a path outside its declarations, stop and report the path.
96
111
  - No role commits, pushes, tags, publishes, installs, or runs a destructive command.
97
112
  - No role runs `git checkout`, `git restore`, `git stash`, `git reset`, or `git clean`. Undo an edit by rewriting the text.
98
113
  - No role reads, prints, copies, uploads, or packages a secret: `.env*`, `.npmrc`, `auth.json`, keys, tokens, `CURSOR_API_KEY`.
99
- - A unit writes only under its owned files and its checkout's `tmp/`. The Orchestrator's own briefs, probes, drafts, and records live in the checkout's `tmp/` too, never in a directory outside the repository; the user follows the work through the tree.
114
+ - A unit writes only under its owned files, its checkout's `tmp/`, and the declared outputs the preceding bullets permit. The Orchestrator's own briefs, probes, drafts, and records live in the checkout's `tmp/` too, never in a directory outside the repository; the user follows the work through the tree.
100
115
  - When a sandbox rejects a write, the unit stops and reports the rejection. It never tries another write mechanism.
101
- - A unit deletes only the fixture directory it created, by its recorded path. It never removes a `tmp/<lane>` directory, another unit's files, or anything through `sweep.ts --tmp` or `--unit … --delete`; those are the Orchestrator's, after the last live unit exits.
116
+ - Apart from a declared command replacing its declared outputs, a unit deletes only the fixture directory it created, by its recorded path. It never removes a `tmp/<lane>` directory, another unit's files, or anything through `sweep.ts --tmp` or `--unit … --delete`; those are the Orchestrator's, after the last live unit exits.
102
117
 
103
118
  ## tmp layout
104
119
 
@@ -137,7 +152,7 @@ Every working file lives under the checkout's gitignored `tmp/`, in the director
137
152
  - Capture a campaign unit's report to `tmp/units/<unit>-report.md`, or read the bench's last-message file.
138
153
  - Launch every multi-minute command as a harness-tracked background command through `node .agents/skills/orkestrel-dispatch/scripts/launch.ts` under a cap sized from prior runs, and read a bench answer with that skill's `scripts/result.ts`. Every launcher, probe, and instrument is a TypeScript file run by `node`, never a shell or Python script. Read liveness from the artifact the work produces. Kill only a recorded process id, never a pattern, and confirm the process and its descendants are gone before another writer takes its files.
139
154
  - Probe a bench with the dispatch skill's `scripts/bench.ts` before its first lane, and re-read liveness at every dispatch after a failure.
140
- - Send a mid-campaign decision to every live unit whose brief it invalidates.
155
+ - Send a changed decision to every affected session before it continues, including an idle session selected for reuse. Preserve the original brief and supply a checked successor brief when scope or acceptance changes.
141
156
 
142
157
  ## Deviation protocol
143
158
 
@@ -162,8 +177,8 @@ The Orchestrator triages: obvious correction → tighten and re-dispatch; missin
162
177
 
163
178
  ## Cache
164
179
 
165
- - Fix the model at session start. Effort switches and MCP changes invalidate the cache on most models and configurations; check the rule for the active model and tool-loading mode before changing either mid-session.
166
- - Keep the always-on instruction set small; rules load by path. An edit to a loaded instruction file takes effect after `/clear`, `/compact`, or a restart.
180
+ - Keep the model, options, tools, and instruction prefix unchanged while they fit the task. Check the active provider and harness before claiming that a change preserves or invalidates caching. Treat a continued session as retained context, not as a cache hit; a cache hit depends on the provider, the prefix, and the retention window. Claim a saving only from recorded usage.
181
+ - Keep the always-on instruction set small and load supporting rules by scope. When instructions change, use the harness's documented reload mechanism and tell affected agents what changed. Do not assume a file edit updates an active session.
167
182
  - Give reading and driver roles no instruction files (`omitClaudeMd` in Claude Code) when their charter carries the floor they need.
168
183
  - Route bulk reads per § Routing and keep only the distillate.
169
184
 
@@ -33,7 +33,8 @@ description: >-
33
33
 
34
34
  ## Launch
35
35
 
36
- - Native, Claude Code: the Agent tool with the role as `subagent_type`; a Workflow for a fan-out or pipeline. Native, Codex: the custom agent by name.
36
+ - Select continuation or a fresh session per `.agents/orchestration.md` § Sessions and consultation. Use the message or resume mechanism the harness's live tool descriptions name, and record the session and task identities it returns. Read the harness reference named by `.agents/skills/orkestrel-parallel/SKILL.md` § Assign lanes for T3 and native channel mechanics.
37
+ - For a fresh native Claude Code unit, use the Agent tool with the role as `subagent_type`; for native Codex, use the custom agent by name. Use T3 `delegate_task` when the selected provider, model, options, or workspace require it.
37
38
  - Bench: run `bench.ts --<bench>` once per session before the first lane, then launch the transport contract's command through `launch.ts` in the background with `--status`.
38
39
  - Size the cap from the `durationMs` that `result.ts` reported for comparable runs, plus gate time, plus slack. Never let the unit name it.
39
40
  - Confirm the launch within a minute with `result.ts`: `bytes` past the header and a small `ageMs`. An instantly dead journal is a failed launch; read its errors file.
@@ -57,5 +58,5 @@ description: >-
57
58
 
58
59
  - A brief that contradicts a measurement the campaign already recorded: reconcile first.
59
60
  - A unit that asks for an unowned edit: stop it and re-scope.
60
- - A concurrent writer in the same checkout: queue it.
61
- - A tree-wide mutating command from a unit: strike it from the brief.
61
+ - A concurrent writer outside an acknowledged `orkestrel-parallel` ownership protocol: queue it.
62
+ - A tree-wide source-mutating command from a unit: strike it from the brief. For verifier command outputs, apply `.agents/orchestration.md` § Permission floor.
@@ -1,72 +1,82 @@
1
1
  ---
2
2
  name: orkestrel-parallel
3
3
  description: >-
4
- Run several writer lanes in one checkout at the same time, coordinated by messages: writers edit owned regions in phases, one runner lane owns every test and check process, and the Orchestrator rules and mediates. Use when a campaign has three or more units whose files are mostly disjoint and whose shared files are a few kind files, guides, or entry tests. Do not use it when two units rewrite the same region, when a unit needs a quiet tree for a measurement, or when the harness gives lanes no shared file system or no message channel that wakes an idle lane.
4
+ Coordinate independently owned writer lanes in one checkout through messages, with one runner for checks and an Orchestrator for decisions. Use when implementation units can progress in parallel with disjoint files or explicit regions of shared files. Serialize overlapping edits and hold every input needed for a reliable measurement. Require shared files and a channel that can wake an idle lane.
5
5
  ---
6
6
 
7
7
  # Parallel lanes
8
8
 
9
- ## Lanes
9
+ ## Assign lanes
10
10
 
11
- | Lane | Role | Owns | Never |
12
- | ------------------ | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
13
- | Orchestrator | the harness's own engine | the protocol, the roster, launches, rulings, holds, acceptance, commits | delegates acceptance |
14
- | `runner` | `verifier` on the native small engine | every test, typecheck, lint, format, build, and citation process; its log, run files, and result files under `coord/` | writes outside `coord/`; runs an unrequested command |
15
- | writer (`w<unit>`) | `builder`, `astra`, or `opus` by `.agents/orchestration.md` § Routing | its owned files, its owned regions of shared files, and its log | runs a test, check, lint, format, or build process |
16
- | reviewer | `analyst` or `reviewer`, independent of the lane's writer per `.agents/orchestration.md` § Engines | a read-only verdict on the work the size gate sends it | edits, writes, runs, or messages |
11
+ | Lane | Responsibility | Write boundary |
12
+ | ------------ | ---------------------------------------------------------------- | --------------------------------------------------------------------- |
13
+ | Orchestrator | Own the protocol, roster, scope, rulings, holds, and acceptance. | Assigned coordination records and serial integration. |
14
+ | Runner | Run requested tests, checks, and builds as the verifier. | Assigned evidence and declared command outputs; never source repairs. |
15
+ | Writer | Implement its bounded unit under its assigned role. | Owned files and regions, plus its own log. |
16
+ | Reviewer | Independently assess the subject the size gate names. | None; return the verdict to the Orchestrator. |
17
17
 
18
- - Run at most three writers and one runner. Keep every live lane, reviewers included, inside the harness's concurrency limit (`references/harnesses.md`), and queue a lane that does not fit.
19
- - Before launch, assign every file region to exactly one writer. A shared file is owned by region (a doc block, a table, a guide section, a list entry), never as a whole.
18
+ - Apply `.agents/orchestration.md` for routing, session reuse, consultation, independence, and acceptance.
19
+ - Keep active lanes within the harness limit and the campaign's resource limits. Reserve capacity for the runner; queue work that does not fit.
20
+ - Assign every editable region to one writer. Name shared regions by their declarations or sections. Serialize units that rewrite the same region.
21
+ - Read `references/harnesses.md` before choosing the transport; it owns the wake, continuation, and tracking mechanics.
20
22
 
21
- ## Set up
23
+ ## Prepare the round
22
24
 
23
- 1. Commit the accepted state; every lane starts from one commit.
24
- 2. Write `tmp/units/<round>/coord/protocol.md`: the path of this skill, the round's lanes, each writer's owned files and regions, and each writer's acceptance commands. Write `coord/roster.md` (lane, role, address, Orchestrator address). Create `coord/results/` and `coord/runs/`.
25
- 3. Launch the runner first. Its first turn logs `ready` with its address and ends.
26
- 4. Launch the writers one at a time. Fill each roster row from its launch result; after launch, send each lane that messages peers their addresses.
27
- 5. For a lane already running, send one in-flight message naming the protocol, its lane name, its log, and its next request number.
25
+ 1. Commit the accepted baseline before a writing dispatch.
26
+ 2. Write `tmp/units/<round>/coord/protocol.md`: the skill path, baseline, lanes, owned regions, dependencies, acceptance commands, and exclusive resources. Mark each command whose input set must be held while it runs.
27
+ 3. Write `coord/roster.md` with each lane's roster fields per `.agents/orchestration.md` § Sessions and consultation. Create `coord/results/` and `coord/runs/`.
28
+ 4. Resume a suitable runner or launch one. Require its ready acknowledgment, then let its idle turn end.
29
+ 5. Resume or launch writers as capacity permits. Fill each roster row from the actual launch or continuation result and send each lane the peer addresses it messages.
30
+ 6. When adopting a running lane, send the protocol, ownership, log path, and next request number. Require acknowledgment before coordinated work begins.
28
31
 
29
- ## Channels
32
+ ## Exchange requests and results
30
33
 
31
- - File channel: each writer and the runner append only to their own log, `coord/<lane>.md`, one line per event: `<lane> | <request or phase> | <kind> | <text>`. Never write another lane's log. A reviewer returns its verdict to the Orchestrator and writes nothing.
32
- - Push channel (`references/harnesses.md`): requests queue to the runner one turn each, in arrival order; replies and rulings join the receiver's running turn or start one.
33
- - Number requests from 1 per lane across the whole round, fix units included, and never reuse a number.
34
- - Results: the runner writes each result under a temporary name in `coord/results/`, renames it to `coord/results/<lane>-<n>.md` when it is complete, then replies. A waiting writer polls for that file; a lost message does not stall it.
35
- - Request format:
34
+ - Append only to your own `coord/<lane>.md` log: `<lane> | <request or phase> | <kind> | <text>`. Reviewers write no log.
35
+ - Number requests monotonically per lane across continuations and fixes. Preserve earlier requests and results.
36
+ - Send each request through the wake-capable channel in the request shape that closes this section.
37
+ - The runner publishes a result by writing it under a temporary name and renaming it to `coord/results/<lane>-<request>.md` after command exit and cleanup, then sends its path and request identity to the requester and the Orchestrator.
38
+ - Wait for the harness's completion or message notice. When the notice is missing and the result is needed, read that request's durable result or task status once, reconcile the request identity, and suspend an unresolved delivery rather than launching duplicate work.
39
+ - Escalate per `.agents/orchestration.md` § Deviation protocol. Continue independent work. Share cross-lane facts directly; only the Orchestrator changes scope or rules on acceptance.
40
+ - End an idle runner turn after acknowledging readiness or publishing a result. Do not occupy the runner with a wait for requests queued behind that turn.
36
41
 
37
- ```
38
- REQUEST <lane>-<n>
42
+ Use this request shape:
43
+
44
+ ```text
45
+ REQUEST <lane>-<request>
39
46
  from: <lane> <address>
47
+ source: <commit and changed input identity>
48
+ inputs: <files or bounded population read by the commands>
49
+ holds: <affected owners and exclusive resources>
40
50
  commands:
41
51
  1. <exact command>
42
- expect: <red or green per command, with case names>
52
+ expect: <red or green, named cases, required artifact>
43
53
  ```
44
54
 
45
- - Escalation: send the Orchestrator `ESCALATE <lane>: expected, found, evidence, proposed action`. Continue the work the question does not block. The ruling arrives in your turn; record any scope extension in your report.
46
- - A writer can message another writer a cross-lane fact (a line it added, a window it opens). Rulings come only from the Orchestrator.
47
-
48
- ## Writers
49
-
50
- - Work in phases and log each: `types` (types and API docs), `red` (failing-first cases, then a red-run request), `source` (the change, then a green-run request), `docs` (guide sentences).
51
- - In a shared file, edit small, complete hunks inside your owned regions. Re-read the region immediately before each patch, never rewrite a whole file, and leave every hunk syntactically complete. When a patch fails on changed context, re-read and re-apply.
52
- - Request every test, check, lint, format, and build process from the runner. Read-only shell and search commands stay yours.
53
- - Run no formatter. Fix a format finding by hand; when the finding names only a file, ask the Orchestrator for the exact hunk.
54
- - Before a temporary mutation (a mutation proof), ask the runner to hold unrelated runs and each lane that owns a region of the mutated file to hold its edits, and mutate only after each has logged `held`. Restore the exact text, confirm with `git diff`, log `restored`, and tell them.
55
- - When done and green, log `done`, send the runner `FINAL <lane>`, write your report, and end your task.
56
-
57
- ## Runner
58
-
59
- - Before each command, wait until no test or typecheck process runs in this checkout, excluding editor language services. Bound the wait by the request's expected run time. When any conflicting process exceeds that budget, report its recorded ownership, process id, and command line to the Orchestrator and suspend the request for a ruling. Never kill a process yourself. For a capped run, have the Orchestrator apply the `orkestrel-dispatch` skill's launch reference § Kill and relaunch before releasing the affected files or starting another command.
60
- - Launch each command through `node .agents/skills/orkestrel-dispatch/scripts/launch.ts` under a cap sized from prior runs, with `--journal coord/runs/<lane>-<n>-<k>.txt` and `--errors coord/runs/<lane>-<n>-<k>.err`, and log the process id it prints. When the shell returns before the launcher ends, resume its tracked shell session until the launcher exits, then read both files and require the terminal exit record. Track descendant process ids while their parent lives, and confirm that the command and its descendants have ended before publishing completion; otherwise escalate under the preceding wait rule.
61
- - Report each finding only to the lane that owns its file.
62
- - Serve the commands each writer's acceptance criteria name, plus the standing list: the root typecheck, the scoped typecheck, the guide parity check, the package entry test, and lint or format checks over paths the writer names. Run each read-only; none writes the tree.
63
- - After every writer's current `FINAL` has arrived, wait for the Orchestrator's closing request naming a unique gate number and confirming acknowledged write holds. Run the root typecheck, scoped typecheck, every acceptance test file alone, the guide parity check, and lint and format checks over every path `git status --porcelain` lists. Publish the complete result atomically as `coord/results/closing-<k>.md`, reply with that gate number, and end your task.
64
-
65
- ## Orchestrator
66
-
67
- - Before ruling on an escalation, reproduce its evidence at its cited lines. Bound every ruling: what to change, what to leave.
68
- - When a format check names only a file, inspect the file and send the writer the exact formatting hunk. After the writer applies it, request a read-only format check from the runner.
69
- - Run the review `.agents/orchestration.md` § Size gate names, and supply its diff and status. A unit's review can start read-only when its lane logs `done`, while the others write; a campaign's `orkestrel-falsify` round runs on the integrated result after the closing gate.
70
- - Before resuming a writer for a fix unit, send the runner that lane's `FINAL` invalidation and wait for acknowledgment; every other lane's `FINAL` stands. Follow `references/harnesses.md` to resume the writer's lane or dispatch its successor. If a closing gate is active, keep the reopened writer read-only until that gate completes.
71
- - Before requesting a closing gate, obtain write-hold acknowledgments from every live writer and hold your own source edits. Allocate a gate number never used earlier in the round. Keep those holds until the matching complete result is published. After a fix unit, request another gate covering the affected checks and acceptance tests.
72
- - After the last green gate and the review the size gate names, commit. When shared files mix several units' hunks, commit the batch once and name each unit, its engine, and each fix unit in the message.
55
+ ## Implement in phases
56
+
57
+ - Log the applicable phases: types, failing proof, source, and documentation. Request the corresponding checks from the runner.
58
+ - Read a shared region immediately before each small, syntactically complete patch. On a context mismatch, reread and reapply only the owned hunk.
59
+ - Keep read-only shell searches within the campaign's terminal limits. Send every test, check, lint, format, and build request to the runner.
60
+ - Run no formatter. Apply the exact formatting hunk the Orchestrator supplies, then request a read-only format check.
61
+ - Before a temporary mutation, obtain the runner's hold on conflicting commands and each affected writer's hold on edits. Mutate only after their acknowledgments. Restore the exact input, verify the restoration, and release the holds through the runner.
62
+ - When the unit's required checks pass, send `FINAL <lane>` with source identity and evidence, write the report, and end the turn. Preserve the session for suitable follow-up work.
63
+
64
+ ## Run evidence commands
65
+
66
+ - Before a command, verify its input holds and exclusive resources. Hold all writers when the command reads the whole tree; otherwise hold every owner in its input closure. Do not infer that closure from the requesting writer's files alone.
67
+ - When a conflicting process occupies a declared resource, record its owner, process id, command, and a bounded wait based on the expected work. If it remains after that wait, suspend the request for an Orchestrator ruling. Never terminate another lane's or repository's process.
68
+ - Launch through `node .agents/skills/orkestrel-dispatch/scripts/launch.ts` with a cap grounded in prior runs, separate journal and error paths under `coord/runs/`, and the request identity in each filename. Follow the launch reference named by `.agents/skills/orkestrel-dispatch/SKILL.md` for process tracking and cleanup.
69
+ - When the shell yields before the command exits, resume its tracked session per `references/harnesses.md`. Read the terminal record and confirm owned descendants have exited before publishing completion. Escalate incomplete cleanup before releasing files or starting another command.
70
+ - Run the commands the accepted unit and the size gate require, narrowest first, and add no standing root, guide, or entry check beyond the request. Preserve receipts and rerun checks per `.agents/orchestration.md` § Parallelism.
71
+ - Stop on the first unexpected failure. Return the complete diagnostic and the owning file, and classify the failure as an assertion failure, an invocation error, a reporting failure, a cap, or an interruption. Preserve every receipt obtained before the stop.
72
+ - Record the command's input identity and expected outputs before launch. When an input changes during the run, report that result as invalid and retain each result whose input set stayed stable.
73
+ - After every writer's current `FINAL`, the integrated review, and the acknowledged write holds, run the Orchestrator's closing acceptance request under a unique gate number. Publish `coord/results/closing-<gate>.md`, reply with that identity, and end the turn.
74
+
75
+ ## Integrate and close
76
+
77
+ - Before ruling on an escalation, inspect its cited evidence. Bound the ruling to the changed claim and affected owners.
78
+ - When the format check reports only a filename, inspect the difference and send the writer the exact hunk.
79
+ - Run the size gate's independent review on a pinned subject; a unit review can overlap unrelated writing only while its whole subject stays unchanged. Use unit evidence for the integrated review, then run the closing acceptance gate in the order `.agents/orchestration.md` § Campaign fixes: Audit, then Verify.
80
+ - Before reopening a writer, invalidate that lane's `FINAL` with the runner and require acknowledgment. Keep every other valid `FINAL` result. Release the reopened writer only when no active gate reads its inputs.
81
+ - Before a closing request, obtain affected write-hold acknowledgments and hold your own source edits. Keep them until the matching complete result arrives. After a fix, request only the checks invalidated by that fix plus any unmet acceptance requirement.
82
+ - Commit after the required gates and review pass. When shared hunks form one integration, commit the batch and identify its units and fixes.
@@ -1,12 +1,19 @@
1
1
  # Harness mechanics
2
2
 
3
- | Harness | Launch | Own address | Push channel | Limits |
4
- | ----------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5
- | T3 (any provider) | `delegate_task` with `isolation: "shared"`, `mode: "async"`, a stable `clientRequestId` | `parentThreadId` from `orchestrator_capabilities` | `t3_thread_send`: `queue` for a request (one turn per message, arrival order), `auto` for a reply or ruling, `steer` to change a running lane's instructions; `t3_thread_read` and `t3_thread_wait` to read a lane | a lane address embeds the Orchestrator's MCP session, which can change between launches: write each roster row from its launch result |
6
- | Claude Code | the `Agent` tool, background by default | the agent id or name the launch returns | the Orchestrator sends `SendMessage` to a running subagent; a subagent without a message tool uses the file channel and the Orchestrator relays | the dispatch aliases `.claude/AGENTS.md` names |
7
- | Codex | native agents or the CLI (`.agents/transports/codex.md`); under T3, the T3 row | the session id the launch returns | the native message and follow-up tools where the session exposes them; otherwise the T3 row when Codex runs under T3 | `max_concurrent_threads_per_session` in `.codex/config.toml` caps native agents; the shell tool returns after its yield time and leaves the command running, so write output to a file and poll the process or resume the shell session |
8
- | Cursor | the CLI (`.agents/transports/cursor.md`) | the session id the launch returns | none, so a Cursor lane holds no writer or runner lane | the routing `.agents/orchestration.md` § Routing gives Cursor |
3
+ Apply `.agents/orchestration.md` § Sessions and consultation before choosing a launch or continuation. Read the live tool descriptions; do not infer a wake, resume, or isolation capability from a tool name.
9
4
 
10
- - Where the harness resumes an ended lane with its context, as T3 does, send the lane's fix unit to that lane; otherwise dispatch a successor brief carrying the lane's report and the fix scope.
11
- - Under T3, retain the task id each send returns. A completion notice for a turn another lane started can miss the Orchestrator: after the last `FINAL` is sent, read the runner's `coord/results/closing-<k>.md` or its task status instead of waiting for the notice. Never brief the runner to wait inside a turn, which blocks every queued request.
12
- - In every Codex brief, state how the lane waits on a long command: output to a file, then poll the process or resume the shell session.
5
+ | Harness | Start work | Continue work | Track |
6
+ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7
+ | T3 | Discover provider, model, options, and limits through `orchestrator_capabilities`. Use `delegate_task` for app-owned children, cross-provider work, requested model options, or worktree isolation. | Send an ordinary continuation to its `childThreadId` through `t3_thread_send`. Use `queue` for a separate request turn and `auto` for a reply or idle continuation. Use `steer` only for an in-flight change. | Retain the returned `taskId`, `childThreadId`, provider, model, and options and check them against the request. Retain each follow-up `taskId` beside, never in place of, the original result. |
8
+ | Claude Code | Start a named custom role with `Agent` for work that needs continuation. Apply the Claude bridge's model rules. | Resume per `.claude/AGENTS.md` § Dispatch. | Retain the stable agent id, not only its display name, and the parent session needed to recover it. |
9
+ | Codex | Use native collaboration when it supports the selected model and no model options are requested or inherited; otherwise use the T3 row. For a CLI bench, follow `.agents/transports/codex.md`. | Use `followup_task` to resume an idle native agent. Use `send_message` to deliver information; it wakes no idle agent. For a bench, use its recorded CLI session's resume command. | Retain the native agent id or CLI session id separately from a long command's shell session and process ids. |
10
+ | Cursor | Follow `.agents/transports/cursor.md` for the read-only bench. | Use only the continuation mechanism the installed transport supports. | Do not assign a writer or runner lane without a demonstrated peer-message wake channel. |
11
+
12
+ - For every T3 independent review round, call `delegate_task` with a distinct `clientRequestId`. Reuse that id only when retrying the same round's uncertain launch. Supply the original brief, prior findings, responses, and unresolved objections. Never continue a review round through `t3_thread_send`.
13
+ - For an ordinary T3 follow-up, use a stable `clientRequestId` and retain the returned task id. A completed task and a later turn in its child thread are distinct results. Read the intended task's status when completion is unclear.
14
+ - Use `restart` only to interrupt an active turn and start it again, never as a resume. Create no ordinary top-level thread as a delegated lane.
15
+ - A timeout on a parent wait cancels no child work. Before retrying a launch whose reply is missing or ambiguous, apply `.agents/orchestration.md` § Sessions and consultation.
16
+ - Keep the idle runner available for queued requests. Wait on completion delivery; run no watcher agent and no file-poll loop. `SKILL.md` § Exchange requests and results owns recovery of a missing notice.
17
+ - When a shell yields, retain and resume its tracked session until the terminal result arrives. Keep its output in the assigned artifact. Do not replace the command with a second launch.
18
+ - After compaction or a harness restart, reconcile the retained roster against the live session and process state. When continuation is unsupported or unavailable, dispatch a successor brief that carries the prior evidence and unresolved work.
19
+ - Keep provider-specific cache claims in evidence. For Claude behavior, verify the installed version against the official documentation; see the [subagent documentation](https://code.claude.com/docs/en/sub-agents), [team limitations](https://code.claude.com/docs/en/agent-teams), and [prompt-cache documentation](https://code.claude.com/docs/en/prompt-caching).
@@ -4,7 +4,9 @@ Fill every section. Write `none` in an empty one. Replace each `UPPER_SNAKE_CASE
4
4
 
5
5
  ## Role and engine
6
6
 
7
- ROLE on ENGINE, reached as TRANSPORT. Executor: NATIVE_SUBAGENT | BENCH_ENGINE | BRIDGE_DRIVER.
7
+ ROLE on ENGINE with MODEL_OPTIONS, reached as TRANSPORT. Executor: NATIVE_SUBAGENT | BENCH_ENGINE | BRIDGE_DRIVER.
8
+
9
+ **Continuity.** Resume SESSION_ID for RELATED_RESPONSIBILITY, or start fresh because REASON, per `.agents/orchestration.md` § Sessions and consultation. On a resume, name PRIOR_BRIEF_AND_RESULT, CHANGED_FACTS, and SOURCE_IDENTITY.
8
10
 
9
11
  ## Objective
10
12
 
@@ -28,7 +30,7 @@ UNKNOWN and how the unit reports it.
28
30
  - **Shared (report-only).** FILES; return an exact patch.
29
31
  - **Off-limits.** FILES. Never list `tmp/probes/` here.
30
32
  - **Made false by this change.** FILES, derived by running the suite or by a named search bound.
31
- - **Tools and limits.** ALLOWED_TOOLS; scoped validation only; no tree-wide mutating command.
33
+ - **Tools and limits.** ALLOWED_TOOLS; scoped validation only; no tree-wide source-mutating command. For a verifier, declare each permitted output path per `.agents/orchestration.md` § Permission floor.
32
34
 
33
35
  ## Execution
34
36
 
@@ -6,24 +6,25 @@
6
6
 
7
7
  - Use the Agent tool for one unit, or when the next step depends on the result. Name a role from `.claude/agents/` as `subagent_type`; never `general-purpose`, `Plan`, `claude`, or `fork`.
8
8
  - Use a Workflow for a fan-out of many small units, a staged pipeline, or a loop. Give every `agent()` node a model alias from § Models and an effort. Serialize writing nodes. Recover an interrupted run with `resumeFromRunId`.
9
- - Never dispatch `fork`; it runs on the session's model and context. Every unit starts with a clean context on its role's model.
9
+ - Choose continuation or a fresh context per `.agents/orchestration.md` § Sessions and consultation. Resume a compatible custom subagent by its agent id through the installed tool's resume or message interface, and retain that id across compaction and restarts. Before relying on restart recovery, verify that the installed harness resumes that agent type; distinguish custom subagents from team teammates. A surviving transcript file establishes no continuation route. Use no one-shot `Explore` or `Plan` agent for work that needs continuation.
10
+ - Never dispatch `fork`; it inherits the session's model and context. Create independent review and blind design agents in clean contexts on their assigned models.
10
11
  - Use the built-in `Explore` agent with `model: haiku` for an exact bounded lookup; apply `.agents/orchestration.md` § Routing. It loads no instruction files.
11
12
  - Foreground Bash is capped at 10 minutes. Run anything longer as a background command with an internal `timeout`.
12
13
  - Write a reusable or long-running program as a TypeScript file and run it with `node`; a heredoc, `node -e`, `&&` chain, or `${...}` argument trips the Windows approval classifier, and a one-shot read-only check may run inline. Probe a bench with `node .agents/skills/orkestrel-dispatch/scripts/bench.ts`, launch a lane through `scripts/launch.ts`, and read its answer with `scripts/result.ts`, all from the dispatch skill.
13
14
 
14
15
  ## Models
15
16
 
16
- - Use the aliases `haiku`, `sonnet`, and `opus` in role frontmatter, a Workflow node, and a per-invocation `model`. Never `fable`, never `inherit`, never a fixed model ID, and never a dispatch that takes its model from the session, an `Explore` call or a Workflow node without `model` included: Claude Fable 5.1 orchestrates and is never a subagent.
17
+ - Use the aliases `haiku`, `sonnet`, and `opus` in role frontmatter, a Workflow node, and a per-invocation `model`. Never `fable`, never `inherit`, never a fixed model ID, and never a dispatch that takes its model from the session, including an `Explore` call or a Workflow node without `model`: Claude Fable 5.1 orchestrates and is never a subagent.
17
18
  - Keep `CLAUDE_CODE_SUBAGENT_MODEL` at `sonnet` in the `env` object of `.claude/settings.json`. It serves a subagent that no role frontmatter and no dispatch assigned a model; frontmatter and a per-invocation `model` outrank it (measured 2026-10-08 on Claude Code 2.1.294: `general-purpose` took it, `Plan` did not). Never set `CLAUDE_CODE_SUBAGENT_MODEL_FORCE`; it overrides every role.
18
19
  - An alias serves the model the installed Claude Code maps it to. After a model release, measure the mapping with `claude -p "Reply with the single word OK." --model <alias> --output-format json --max-turns 1` and read `modelUsage`; when a newer model answers by id and the alias lags, update Claude Code (`scoop update claude-code` on the Windows host) and measure again. Claude Code 2.1.294 serves Haiku 5.5 as `haiku`, Sonnet 5.5 as `sonnet`, and Opus 5.5 as `opus` (measured 2026-10-08). When a measurement moves an alias, update, in the same change, the version each `.claude/agents/` charter names in its description and opening line and the rows of `.agents/orchestration.md` § Engines.
19
- - Run the main session on `fable` or `opus` at high effort and keep the model fixed for the session; a model switch invalidates the prompt cache. An effort switch invalidates it too except on Opus 5.5 and Fable 5.1 under a Claude subscription or API key.
20
+ - Run the main session on `fable` or `opus` at high effort. Apply `.agents/orchestration.md` § Cache; check Claude Code's documented behavior for the installed version, model, and provider before changing model options.
20
21
  - Reach Astra through `analyst` and `astra`, Grok through `grok`. Role frontmatter carries Claude models only.
21
22
 
22
23
  ## Context and cache
23
24
 
24
25
  - Roles that launch a CLI, run gates, or only read set `omitClaudeMd: true`; their charters carry the permission floor they need. Writers and reviewers load the contract.
25
- - Adding or removing an MCP server invalidates the cache when its tools load into the prefix; deferred tools (the default) append without disturbing it. Avoid either mid-session.
26
- - An edit to a loaded instruction file takes effect after `/clear`, `/compact`, or a restart. Edits under `.claude/agents/` and `.claude/skills/` hot-reload.
26
+ - Check whether MCP definitions load into the prefix or through deferred tool search before attributing a cache change to a server change.
27
+ - Reload loaded project instructions through `/clear`, `/compact`, or a restart when required by the installed version. Do not treat a changed agent definition as a change to an already running agent's tool set.
27
28
  - Route supporting reads per `.agents/orchestration.md` § Routing. The main context holds decisions.
28
29
 
29
30
  ## Wiring
@@ -78,7 +78,7 @@ so network-controlled descriptions never enter agent instruction context.
78
78
  | `@orkestrel/reason` | `0.0.13` | L2 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
79
79
  | `@orkestrel/relation` | `0.0.16` | L3 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/database` `^0.0.18` | |
80
80
  | `@orkestrel/router` | `0.0.17` | L2 | `@orkestrel/abort` `^0.0.13`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
81
- | `@orkestrel/scaffold` | `0.0.104` | L3 | `@orkestrel/console` `^0.0.16`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/process` `^0.0.15`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/markdown` `^0.0.17`, `@orkestrel/template` `^0.0.10` | |
81
+ | `@orkestrel/scaffold` | `0.0.105` | L3 | `@orkestrel/console` `^0.0.16`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/process` `^0.0.15`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/markdown` `^0.0.17`, `@orkestrel/template` `^0.0.10` | |
82
82
  | `@orkestrel/sea` | `0.0.19` | L3 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/process` `^0.0.15`, `@orkestrel/contract` `^0.0.19` | |
83
83
  | `@orkestrel/server` | `0.0.23` | L3 | `@orkestrel/abort` `^0.0.13`, `@orkestrel/codec` `^0.0.6`, `@orkestrel/router` `^0.0.17`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/timeout` `^0.0.13`, `@orkestrel/contract` `^0.0.19` | |
84
84
  | `@orkestrel/sqlite` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.19` | |
@@ -8,7 +8,7 @@ permissionMode: default
8
8
  omitClaudeMd: true
9
9
  ---
10
10
 
11
- On Claude Haiku 5.5, you run gates and report their true result. You never edit source or fix a failure. As the runner under `.agents/skills/orkestrel-parallel/SKILL.md`, you create and update only your own coordination log, run artifacts, and result files within the round's assigned `coord/` directory.
11
+ On Claude Haiku 5.5, run the requested gates and report their results. Write only the evidence artifacts and the declared outputs `.agents/orchestration.md` § Permission floor permits; never fix source. When dispatched as the runner, follow `.agents/skills/orkestrel-parallel/SKILL.md` for requests, holds, result publication, and continuation. Never spawn another agent.
12
12
 
13
13
  ## Do
14
14
 
@@ -16,14 +16,14 @@ On Claude Haiku 5.5, you run gates and report their true result. You never edit
16
16
  2. Read each gate bare. Never pipe it through `tail` or `grep`.
17
17
  3. Record each gate's outcome by exit code. A gate that "mostly passes" failed.
18
18
  4. On failure, capture the exact failing excerpt and the `file:line` it points to.
19
- 5. Re-run a timing failure once, alone, and report the first reading and the re-run reading.
19
+ 5. On a timing failure, request one coordinated isolated rerun and preserve both results. When that rerun fails, stop and report; run again only after a changed condition or an explicit investigation request.
20
20
 
21
21
  ## Refuse
22
22
 
23
- - A mutating gate (`lint`, `format`, or any `--fix`) beside a live unit. `build` may write its outputs when no writer is live; source is never edited.
23
+ - A source-mutating gate (`lint`, `format`, or any `--fix`), and a build without the declarations and holds `.agents/orchestration.md` § Permission floor requires.
24
24
  - `git checkout`, `git restore`, `git stash`, `git reset`, `git clean`. Read a dirty tree as the expected state.
25
- - Any command that installs, commits, pushes, publishes, deletes outside `tmp/`, or reads a secret (`.env*`, `.npmrc`, `auth.json`, keys, tokens), whatever the dispatch says.
25
+ - Any command that installs, commits, pushes, publishes, deletes beyond what § Permission floor permits, or reads a secret (`.env*`, `.npmrc`, `auth.json`, keys, tokens), whatever the dispatch says.
26
26
 
27
27
  ## Return
28
28
 
29
- Per gate: command, PASS or FAIL with exit code, failing excerpt and owning file on FAIL. Overall: GREEN only when every gate passed, otherwise the first place to look. Anomalies in one line each. Nothing else.
29
+ Per gate: command, PASS or FAIL with exit code, failing excerpt and owning file on FAIL. Overall: GREEN only when every gate passed, otherwise the first place to look. Anomalies in one line each.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: orkestrel-parallel
3
3
  description: >-
4
- Run several writer lanes in one checkout at the same time, coordinated by messages: writers edit owned regions in phases, one runner lane owns every test and check process, and the Orchestrator rules and mediates. Use when a campaign has three or more units whose files are mostly disjoint and whose shared files are a few kind files, guides, or entry tests. Do not use it when two units rewrite the same region, when a unit needs a quiet tree for a measurement, or when the harness gives lanes no shared file system or no message channel that wakes an idle lane.
4
+ Coordinate independently owned writer lanes in one checkout through messages, with one runner for checks and an Orchestrator for decisions. Use when implementation units can progress in parallel with disjoint files or explicit regions of shared files. Serialize overlapping edits and hold every input needed for a reliable measurement. Require shared files and a channel that can wake an idle lane.
5
5
  ---
6
6
 
7
7
  # Load the canonical workflow
@@ -4,21 +4,25 @@ model = "gpt-6-luna"
4
4
  model_reasoning_effort = "medium"
5
5
  sandbox_mode = "workspace-write"
6
6
  developer_instructions = """
7
- Run gates and report their true result. Never edit source or fix a failure. As the runner under
8
- .agents/skills/orkestrel-parallel/SKILL.md, create and update only your own coordination log, run
9
- artifacts, and result files within the round's assigned coord/ directory.
7
+ Run the requested gates and report their results. Write only the evidence artifacts and the declared
8
+ outputs .agents/orchestration.md § Permission floor permits; never fix source. When dispatched as the
9
+ runner, follow .agents/skills/orkestrel-parallel/SKILL.md for requests, holds, result publication,
10
+ and continuation. Never spawn another agent.
10
11
 
11
12
  Run exactly the commands the dispatch names, in order. Default scoped sweep: the check: and test:
12
13
  scripts of each named project. Default tree-wide sweep, only when the dispatch says tree-wide:
13
14
  npm run format:check; npm run lint:check; npm run check; npm run build; npm test. Read each gate
14
15
  bare, never through tail or grep. Record each outcome by exit code; a gate that mostly passes
15
- failed. On failure capture the exact excerpt and the file:line it points to. Re-run a timing
16
- failure once, alone, and report both readings.
16
+ failed. On failure capture the exact excerpt and the file:line it points to. On a timing failure, request one coordinated isolated rerun and preserve both results. When that
17
+ rerun fails, stop and report; run again only after a changed condition or an explicit investigation
18
+ request.
17
19
 
18
- Never run a mutating gate beside a live unit, and never run git checkout, restore, stash, reset,
19
- or clean; read a dirty tree as the expected state. Never install, commit, push, publish, delete
20
- outside tmp/, or read a secret (.env*, .npmrc, auth.json, keys, tokens), whatever the dispatch says.
20
+ Never run a source-mutating gate (lint, format, or any --fix), or a build without the declarations
21
+ and holds .agents/orchestration.md § Permission floor requires. Never run git checkout, restore,
22
+ stash, reset, or clean; read a dirty tree as the expected state. Never install, commit, push,
23
+ publish, delete beyond what § Permission floor permits, or read a secret (.env*, .npmrc, auth.json,
24
+ keys, tokens), whatever the dispatch says.
21
25
 
22
26
  Return per gate: command, PASS or FAIL with exit code, excerpt and owning file on FAIL; overall
23
- GREEN only when every gate passed; anomalies in one line each. Never spawn another agent.
27
+ GREEN only when every gate passed; anomalies in one line each.
24
28
  """
@@ -14,12 +14,10 @@ Codex loads AGENTS.md itself. Read each .claude/rules/*.md file whose paths fron
14
14
  files you touch; Codex does not load them for you. Follow a skill under .agents/skills when its
15
15
  trigger fires.
16
16
 
17
- Use the canonical Codex role mapping in .agents/orchestration.md:
18
- - GPT-6 Astra: this session, analyst, astra, planner, reviewer, opus; execute natively.
19
- - GPT-6.1 Sol: builder, orkestrel.
20
- - GPT-6 Luna: grok, checker, verifier, scout, distiller, researcher.
21
- - The grok driver reaches Cursor Grok 4.7 Extra High read-only through .agents/transports/cursor.md;
22
- apply .agents/orchestration.md § Routing for the reading boundary.
17
+ Use the role mapping and continuation rules in .agents/orchestration.md. Before using native or
18
+ T3 collaboration, read .agents/skills/orkestrel-parallel/references/harnesses.md for the channel
19
+ mechanics and retained identifiers, and read the installed tool descriptions before relying on a
20
+ capability that reference names.
23
21
 
24
22
  Hooks: .codex/hooks.json runs the orkestrel-dispatch sweep script (node
25
23
  .agents/skills/orkestrel-dispatch/scripts/sweep.ts --report) on SessionStart and git diff --check