orchestrator-workflow 0.27.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,63 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.29.0] - 2026-09-05
11
+
12
+ ### Added
13
+
14
+ - Native Codex custom agents under `.codex/agents/`, including profile-scoped
15
+ roles and optional effort-tier variants with explicit model and effort.
16
+ The initial routing uses Astra for review/advice and implementation
17
+ escalation, Sol for discovery/slicing, Terra for regular implementation,
18
+ and Luna for narrowly scoped low-tier work.
19
+ - Harness-specific role/tier routing overrides through `--routing <file>`
20
+ on `init`, `setup`, and `apply`, persisted alongside the legacy `models`
21
+ configuration. Optional `--codex-catalog <file>` checks selected Codex
22
+ model/effort pairs against a supplied catalog before installation writes.
23
+
24
+ ### Changed
25
+
26
+ - Agent-led installation and deliberate model refresh are the recommended
27
+ entry point. The agent inspects capabilities and existing preferences,
28
+ applies authorized scoped changes through the CLI, and reports verification
29
+ gaps. The CLI remains available as the reproducible installation backend.
30
+ - Codex workflow guidance uses native role delegation when supported, with an
31
+ explicit inline fallback for environments without native subagents. Normal
32
+ reinstallation preserves recorded routing; model changes use explicit
33
+ overrides or documented operator synchronization.
34
+
35
+
36
+ ## [0.28.0] - 2026-09-04
37
+
38
+ ### Added
39
+
40
+ - The explorer, reviewer, and implementer prompts, and `SKILL.md`'s
41
+ Discover step, each gained one tool-agnostic sentence pointing the role
42
+ at a connected structural code-search, verify, or mutation-probe runner
43
+ when one is available in the session, in place of raw grep, hand-editing
44
+ probe files, or reading full logs. Anchored by a pandora-workspace
45
+ measurement of subagent tool-call patterns (see run
46
+ `.ai/runs/2026-09-03-agent-tools-kit`).
47
+
48
+ ### Changed
49
+
50
+ - `init`'s interactive harnesses prompt on a target whose own manifest
51
+ recorded a real `harnesses: []` (a deliberate `--harness none`
52
+ templates-only install) now starts with nothing pre-checked, matching
53
+ `apply`'s existing semantics, instead of pre-checking whatever
54
+ `detectHarnesses(targetDir)` found on disk. Decision D-002 (agent-dx
55
+ 7669907c): the weak-signal argument that motivated `apply`'s own fix
56
+ (agent-tasks fe834823, a stray harness config left on disk, e.g. a
57
+ `.claude/` directory, is not the recorded intent, the manifest is)
58
+ applies to `init` identically, and the earlier fix's concern (ask
59
+ instead of silently falling back to templates-only) is preserved
60
+ because the prompt still appears and still annotates detection with a
61
+ " (detected)" label; only the pre-check now follows recorded intent
62
+ instead of on-disk detection. `init` and `apply` now share one
63
+ resolution inside `resolveInitInputs` (`stickyPreChecked ?? []`,
64
+ `stickyAnnotateDetected ?? detected`) instead of `init`'s own call site
65
+ relying on a different default.
66
+
10
67
  ## [0.27.0] - 2026-09-01
11
68
 
12
69
  ### Added
package/INSTALL-AGENT.md CHANGED
@@ -17,21 +17,23 @@ which is mutable. For a stable audit, pin the URL to a commit SHA instead
17
17
 
18
18
  ## What the linked instructions do
19
19
 
20
- 1. **Locate existing harness configs** in the repo root and report them to
21
- you (Claude Code, opencode, Codex marker files; full list in step 1
22
- below).
23
- 2. **Ask you, not guess**: which harnesses should get adapters, which role
24
- profile to install (`full` every role, or `minimal` — implementer and
25
- reviewer only; the reviewer is never optional), which model each
26
- installed subagent role should use, and whether to also render effort-tier
27
- subagent variants (`--tiers`; off by default, no per-tier model prompt
28
- since tier models are chosen automatically). Suggested defaults: profile
29
- `full`; explorer `sonnet`, task-slicer `sonnet`, implementer `sonnet`,
30
- reviewer `opus`, advisor `opus`; tiers off.
31
- 3. **Run the non-interactive installer** with your answers:
32
- `npx orchestrator-workflow init --yes --harness ... --profile ... --models ... [--tiers]`.
33
- If the installer reports conflicts with locally edited files, the agent
34
- shows them to you and asks before any `--force` re-run. **The operator
20
+ 1. **Inspect the repository and installed state**: detect harness configs,
21
+ read an existing workflow manifest, and inspect native model capabilities
22
+ where the harness provides them. Existing choices and authorization are
23
+ evidence; the agent does not make you answer them again.
24
+ 2. **Prepare a concrete configuration diff**: selected harnesses, profile,
25
+ tier variants, and the complete per-harness role/tier routing that will be
26
+ persisted. Existing routing leaves remain exact unless you asked to change
27
+ them. The agent records the prior routing in its handoff as the rollback
28
+ input and never treats "latest" or "newer" as a reason to change models.
29
+ 3. **Ask only when needed**, for a material preference, missing authority, or
30
+ a conflict that changes the result. Then run the non-interactive CLI with
31
+ `--routing <json-file>` for the reviewed deep patch and, when available,
32
+ `--codex-catalog <json-file>` for deterministic Codex capability checking.
33
+ If the installer reports conflicts with locally edited files, inspect the
34
+ concrete files and reuse any overwrite authority already granted for that
35
+ scope. Ask before a `--force` re-run only when authority or conflict scope
36
+ remains unresolved. **The operator
35
37
  path**: when an operator has already run `orchestrator-workflow setup`
36
38
  on this machine (an operator manifest exists at
37
39
  `<operator home>/manifest.json`, where the operator home is
@@ -48,9 +50,12 @@ which is mutable. For a stable audit, pin the URL to a commit SHA instead
48
50
  following the byte-precise rules in step 4 below. This manual path
49
51
  covers `init` only; there is no manual equivalent for `apply` or
50
52
  `adopt`, both of which require the installed CLI.
51
- 5. **Report back**: which harnesses were installed, which profile and model
52
- each role uses, whether effort-tier variants were rendered, and any
53
- conflicts left in place.
53
+ 5. **Verify and report back**: describe the applied routing, prior routing
54
+ rollback input, installed profile and variants, and the supported dispatch
55
+ path (named selection, explicit model/effort spawn from the installed TOML,
56
+ or inline/sequential fallback). Include checks run, unknown capability or
57
+ entitlement gaps, and conflicts left in place. The workflow never opens a
58
+ GUI or changes fleet or global harness configuration.
54
59
 
55
60
  ### Write surface
56
61
 
@@ -77,24 +82,26 @@ The install creates or touches only these paths:
77
82
  is created with a short heading when absent (Claude Code harness only)
78
83
  - `.claude/skills/orchestrator-workflow/SKILL.md` and
79
84
  `.claude/agents/{explorer,task-slicer,implementer,reviewer,advisor}.md` (Claude Code)
80
- - `.agents/skills/orchestrator-workflow/SKILL.md` (Codex)
85
+ - `.agents/skills/orchestrator-workflow/SKILL.md` and
86
+ `.codex/agents/{explorer,task-slicer,implementer,reviewer,advisor}.toml` (Codex)
81
87
  - `.opencode/skills/orchestrator-workflow/SKILL.md` and
82
88
  `.opencode/agents/{explorer,task-slicer,implementer,reviewer,advisor}.md` (opencode)
83
89
 
84
90
  The per-role agent files above are the `full` profile (the default); the
85
- `minimal` profile writes only the `implementer` and `reviewer` files for
86
- Claude Code and opencode and skips `task-slicer`, `explorer`, and `advisor`
87
- entirely. Codex has no per-role files, so the profile choice does not change
88
- what it gets. When `--tiers` is on, each installed Claude Code and opencode role
91
+ `minimal` profile writes only the `implementer` and `reviewer` files for all
92
+ three harnesses and skips `task-slicer`, `explorer`, and `advisor` entirely.
93
+ When `--tiers` is on, each installed role
89
94
  additionally gets one subagent file per non-default effort tier, named
90
- `<role>-<tier>.md` (never a file for the role's own default tier, which
91
- would collide with the plain `<role>.md` file); see the package README's
95
+ `<role>-<tier>.md` for Claude Code/opencode or `<role>-<tier>.toml` for Codex
96
+ (never a file for the role's own default tier, which would collide with the
97
+ plain role file); see the package README's
92
98
  "Effort tiers" section for the full role/tier table and the per-harness
93
99
  frontmatter shape. `--tiers` is off by default and has no interactive
94
100
  prompt equivalent in the manual fallback below (nor does its negation,
95
101
  `--no-tiers`): the automated installer is the only path that renders
96
102
  tier-variant files; a manual scaffold (step 4) does not cover them.
97
- Nothing else in the repository is modified. Locally edited files are
103
+ The manifest records the complete effective routing map, including exact
104
+ Codex model and effort selections. Nothing else in the repository is modified. Locally edited files are
98
105
  reported as conflicts and left alone, never overwritten silently; the
99
106
  exceptions are the kit-owned surfaces: `.ai/workflow/manifest.json` (the
100
107
  kit's state file, rewritten whenever the applied state changes) and the
@@ -103,52 +110,64 @@ is fully reversible: `npx orchestrator-workflow uninstall` removes exactly
103
110
  this write surface again, keeping run history under `.ai/runs/` and any
104
111
  locally edited files. Network access is limited to the npm registry (for
105
112
  `npx`) and, in the manual fallback, this repository on github.com /
106
- raw.githubusercontent.com.
113
+ raw.githubusercontent.com. Native harness capability inspection is read-only;
114
+ the workflow does not open a GUI or mutate global or fleet configuration.
107
115
 
108
116
  ## Instructions for the agent
109
117
 
110
118
  You are a coding agent that was pointed at this file. Execute the following
111
119
  steps in the repository you were asked to install into.
112
120
 
113
- 1. Detect existing harness configs in the repo root: `.claude/` or
114
- `CLAUDE.md` (Claude Code), `.opencode/`, `opencode.json` or
115
- `opencode.jsonc` (opencode), `.agents/` or `.codex/` (Codex). Tell the
116
- operator what you found.
121
+ 1. Inspect the target before proposing changes:
122
+ - Detect `.claude/` or `CLAUDE.md` (Claude Code), `.opencode/`,
123
+ `opencode.json` or `opencode.jsonc` (opencode), and `.agents/` or
124
+ `.codex/` (Codex).
125
+ - Read `.ai/workflow/manifest.json` when present. Treat its harnesses,
126
+ profile, tiers, legacy models, and exact routing as the reinstall
127
+ baseline. Preserve them unless the operator already requested a change.
128
+ - Inspect native model capabilities when the installed harness exposes a
129
+ read-only command. For Codex, a refreshed `codex debug models` catalog
130
+ can be supplied to the installer with `--codex-catalog`; a bundled-only
131
+ view does not prove account entitlement. Do not invent a minimum harness
132
+ version. If the catalog or entitlement is unavailable offline, report
133
+ that gap instead of claiming validation.
134
+ - Check for an operator manifest as described under "Operator path" below.
135
+ Existing authorization and preferences remain valid. Do not open a GUI
136
+ or change global or fleet configuration.
117
137
 
118
- 2. Ask the operator, do not guess:
119
- - Which harnesses should get adapters: claude, codex, opencode?
120
- Suggest the detected ones.
121
- - Which role profile: `full` (explorer, task-slicer, implementer,
122
- reviewer, advisor the default) or `minimal` (implementer and reviewer
123
- only; the reviewer is never optional under either profile)?
124
- - Which model for each role the chosen profile installs? Suggest the
125
- defaults: explorer `sonnet`, task-slicer `sonnet`, implementer
126
- `sonnet`, reviewer `opus`, advisor `opus`. Accept the aliases `sonnet`,
127
- `opus`, `haiku` or a full model id. Skip asking about a role's model
128
- when the chosen profile does not install that role.
129
- - Whether to also render effort-tier subagent variants (`--tiers`)?
130
- Default: off. There is no per-tier model question: tier models are
131
- chosen automatically from the tier (see the package README's "Effort
132
- tiers" section for the role/tier table and the model-class mapping).
138
+ 2. Prepare a concrete, reviewable configuration diff. Infer the harness set
139
+ from installed state and detected configs; infer the existing profile,
140
+ tiers, and routing from the manifests. Use `full` for a fresh install
141
+ unless the repository clearly calls for `minimal`. Build a routing JSON
142
+ deep patch only for leaves that need to change. Its shape is
143
+ `harness -> role -> tier -> {model, effort}`; the role's default-tier key
144
+ configures the unsuffixed file. Preserve every omitted leaf. Keep the prior
145
+ routing in the handoff as the rollback input. Never upgrade a model merely
146
+ because a newer one exists, and ask the operator only when a material
147
+ preference, authority boundary, or conflict remains unresolved.
133
148
 
134
- 3. Run the non-interactive installer with the operator's answers:
149
+ 3. Run the non-interactive installer with the reviewed configuration:
135
150
 
136
151
  ```bash
137
152
  npx orchestrator-workflow init --yes \
138
153
  --harness <claude,codex,opencode> \
139
154
  --profile <minimal|full> \
140
- --models "explorer=<model>,task-slicer=<model>,implementer=<model>,reviewer=<model>,advisor=<model>" \
155
+ [--models "explorer=<model>,task-slicer=<model>,implementer=<model>,reviewer=<model>,advisor=<model>"] \
156
+ [--routing <routing.json>] \
157
+ [--codex-catalog <codex-catalog.json>] \
141
158
  [--tiers | --no-tiers]
142
159
  ```
143
160
 
144
161
  Omit `--profile` to keep `full` (or, on a re-run, whatever profile was
145
- installed previously); omit the models for roles the chosen profile does
146
- not install. Add `--tiers` only when the operator asked for tier
162
+ installed previously). `--models` is a backward-compatible input for
163
+ Claude Code and opencode only; never use it to configure Codex. `--routing`
164
+ is the highest-precedence deep patch. Add `--tiers` only when the operator asked for tier
147
165
  variants; add `--no-tiers` only when the operator explicitly wants them
148
166
  turned off on a re-run that previously had them on; omit both to keep
149
167
  tiers off on a fresh install, or whatever value was previously installed
150
- on a re-run. If the command reports conflicts, show them to the operator
151
- and ask before re-running with --force.
168
+ on a re-run. If the command reports conflicts, inspect the concrete files,
169
+ reuse prior overwrite authority for the same scope, and ask before
170
+ `--force` only when authority or scope remains unresolved.
152
171
 
153
172
  **Operator path**: before running `init`, check whether an operator
154
173
  manifest already exists on this machine, at
@@ -166,9 +185,13 @@ steps in the repository you were asked to install into.
166
185
  4. Only if npx or the registry is unavailable, scaffold manually from
167
186
  https://github.com/LanNguyenSi/agent-dx/tree/master/packages/orchestrator-workflow/assets.
168
187
  This manual path does not cover `--tiers`: it never renders
169
- `<role>-<tier>.md` variant files, regardless of what the operator asked
188
+ tier variant files, regardless of what the operator asked
170
189
  for in step 2; tell the operator tier variants require the automated
171
- installer (step 3).
190
+ installer (step 3). It also cannot safely reproduce native Codex TOML from
191
+ the Markdown assets without duplicating the installer's serializer. For a
192
+ Codex manual fallback, install the shared skill only and state that roles
193
+ must run inline and sequentially until the automated CLI can generate
194
+ `.codex/agents/*.toml`.
172
195
 
173
196
  - `.ai/workflow/templates/00-goal.md` through `06-handoff.md` from
174
197
  `assets/templates/`, unchanged.
@@ -197,6 +220,8 @@ steps in the repository you were asked to install into.
197
220
  directly after the `effort:` line. Ensure `CLAUDE.md` exists and
198
221
  contains a line `@AGENTS.md`.
199
222
  - Codex: `.agents/skills/orchestrator-workflow/SKILL.md`, same skill file.
223
+ Do not hand-author `.codex/agents/*.toml`; report the native-agent
224
+ limitation above and use the inline/sequential role fallback.
200
225
  - opencode: `.opencode/skills/orchestrator-workflow/SKILL.md` from
201
226
  `assets/skill/SKILL.md`, unchanged.
202
227
  For each role in the chosen profile (same set as Claude Code above),
@@ -237,7 +262,7 @@ steps in the repository you were asked to install into.
237
262
  ---
238
263
  ```
239
264
  - `.ai/workflow/manifest.json`, exactly this shape (harnesses MUST be an
240
- array, `profile` is `"minimal"` or `"full"`, models keyed by role,
265
+ array, `profile` is `"minimal"` or `"full"`, legacy models keyed by role,
241
266
  version = the kit version you installed, read from this kit's own
242
267
  `packages/orchestrator-workflow/package.json` `version` field):
243
268
 
@@ -270,6 +295,8 @@ steps in the repository you were asked to install into.
270
295
  run then treats existing kit files conservatively and reports conflicts
271
296
  rather than overwriting them.
272
297
 
273
- 5. Report back to the operator: which harnesses were installed, which model
274
- each role uses, whether effort-tier variants were rendered, and any
275
- conflicts that were left in place.
298
+ 5. Verify the expected files and manifest entries, then report back: which
299
+ harnesses and roles were installed; the exact model and effort per routed
300
+ role/tier; whether variants were rendered; the prior routing to use for a
301
+ rollback; the commands actually run; any offline capability or entitlement
302
+ gap; and conflicts left in place.
package/README.md CHANGED
@@ -52,6 +52,25 @@ Two effects fall out of this shape:
52
52
 
53
53
  ## Install
54
54
 
55
+ ### Recommended: agent-led installation
56
+
57
+ Give a coding agent this line:
58
+
59
+ ```text
60
+ Follow the install instructions at https://raw.githubusercontent.com/LanNguyenSi/agent-dx/master/packages/orchestrator-workflow/INSTALL-AGENT.md
61
+ ```
62
+
63
+ The agent inspects installed harnesses, reusable preferences, authorization,
64
+ and available model capabilities. It presents the exact CLI invocation and
65
+ routing diff, asks only about unresolved material decisions, applies the
66
+ authorized change, and verifies the supported dispatch path. Existing routing
67
+ is preserved unless you explicitly change it, and a newer model is never an
68
+ automatic upgrade. [INSTALL-AGENT.md](INSTALL-AGENT.md) makes the write surface
69
+ and fallback behavior auditable. The link tracks `master`; pin it to a commit
70
+ SHA for a stable audit.
71
+
72
+ ### Manual and advanced CLI installation
73
+
55
74
  ```bash
56
75
  npx orchestrator-workflow init
57
76
  ```
@@ -62,14 +81,17 @@ resolved target (`Installing into ...`) before it writes anything and warns
62
81
  when the target is not a git repository root; pass `init <dir>` to install
63
82
  into a different directory. The installer is interactive by default: it
64
83
  locates existing harness configs (`.claude/`, `CLAUDE.md`, `.opencode/`,
65
- `opencode.json`, `.agents/`, `.codex/`), preselects what it found, and asks
66
- which model each subagent role should use.
84
+ `opencode.json`, `.agents/`, `.codex/`) and preselects what it found. For a
85
+ guided install, use the agent-led path above: the agent inspects the repository
86
+ and available harness capabilities, prepares the exact CLI invocation and
87
+ routing diff, and asks only about choices or authority it cannot infer safely.
67
88
 
68
89
  Non-interactive:
69
90
 
70
91
  ```bash
71
92
  npx orchestrator-workflow init --yes
72
93
  npx orchestrator-workflow init --harness claude,codex,opencode --models "implementer=sonnet,reviewer=opus" --yes
94
+ npx orchestrator-workflow init --harness codex --routing ./routing.json --codex-catalog ./codex-models.json --tiers --yes
73
95
  npx orchestrator-workflow init --profile minimal --yes
74
96
  ```
75
97
 
@@ -89,34 +111,22 @@ files on disk from something else; add a harness back with an explicit
89
111
  `--profile`/`--models`/`--tiers` use, applied to the no-harness case. An
90
112
  **interactive** re-run is different: it still prompts, with nothing forced
91
113
  pre-selected, instead of silently skipping straight back to templates-only
92
- without asking; deselect every checkbox to stay templates-only. `init`
93
- pre-checks whatever it detects on disk; `apply` pre-checks nothing at all
94
- (both still annotate what is detected with a " (detected)" label).
114
+ without asking; deselect every checkbox to stay templates-only. `init` and
115
+ `apply` both pre-check nothing at all on this prompt, and both still
116
+ annotate what is detected on disk with a " (detected)" label; select a
117
+ harness to install it.
95
118
 
96
119
  ```bash
97
120
  npx orchestrator-workflow init --harness none --yes
98
121
  ```
99
122
 
100
- To let a coding agent do the install, give it this single line:
101
-
102
- ```text
103
- Follow the install instructions at https://raw.githubusercontent.com/LanNguyenSi/agent-dx/master/packages/orchestrator-workflow/INSTALL-AGENT.md
104
- ```
105
-
106
- The agent then asks you the harness and model questions in chat and runs the
107
- non-interactive CLI (manual scaffolding where npx is unavailable).
108
- [INSTALL-AGENT.md](INSTALL-AGENT.md) documents, step by step, what the
109
- linked instructions make the agent do and which files it may touch, so the
110
- prompt can be audited before delegating. The link tracks `master`; pin it
111
- to a commit SHA for a stable audit.
112
-
113
123
  ## What gets installed
114
124
 
115
125
  ```text
116
126
  .ai/
117
127
  workflow/
118
128
  templates/ 00-goal.md ... 06-handoff.md (canonical run templates)
119
- manifest.json kit version, chosen harnesses, role profile, per-role models
129
+ manifest.json kit version, harnesses, profile, legacy models, exact routing
120
130
  runs/ one directory per unit of work, newest = active
121
131
  AGENTS.md marker-fenced "Agentic Coding Workflow" policy section
122
132
  ```
@@ -130,17 +140,19 @@ Per selected harness:
130
140
  | Harness | Files | Notes |
131
141
  |---|---|---|
132
142
  | Claude Code | `.claude/skills/orchestrator-workflow/SKILL.md`, `.claude/agents/{explorer,task-slicer,implementer,reviewer,advisor}.md`, `CLAUDE.md` | Claude Code reads `CLAUDE.md`, not `AGENTS.md`; the installer adds an additive `@AGENTS.md` import. Subagent models go into the `model:` frontmatter; the read-only explorer, reviewer, and advisor also get `disallowedTools: Edit, Write, NotebookEdit`. |
133
- | OpenAI Codex | `.agents/skills/orchestrator-workflow/SKILL.md` | Codex reads `AGENTS.md` natively. There is no standardized project-level subagent definition; the skill instructs running the roles inline with the same contracts. |
143
+ | OpenAI Codex | `.agents/skills/orchestrator-workflow/SKILL.md`, `.codex/agents/{explorer,task-slicer,implementer,reviewer,advisor}.toml` | Codex reads `AGENTS.md` natively. Native custom-agent files carry the canonical role instructions plus `model` and `model_reasoning_effort`. Explorer and advisor request a read-only sandbox; reviewer inherits the caller's sandbox so it can run temporary/build checks, while its prompt prohibits source edits. |
134
144
  | opencode | `.opencode/skills/orchestrator-workflow/SKILL.md`, `.opencode/agents/{explorer,task-slicer,implementer,reviewer,advisor}.md` | opencode reads `AGENTS.md` natively. Subagents get `mode: subagent`; the read-only explorer, reviewer, and advisor also get `permission: edit: deny`. Model resolution is described below. |
135
145
 
136
- **Read-only posture, honestly stated.** For the explorer, reviewer, and
137
- advisor the read-only posture is enforced at the tool level only for the
138
- file-mutation tools (`disallowedTools: Edit, Write, NotebookEdit` on Claude
139
- Code, `permission: edit: deny` on opencode). Bash stays available because
140
- these roles must run tests and linters, so shell-level mutation (`git checkout`,
146
+ **Read-only posture, honestly stated.** Claude Code disables file-mutation
147
+ tools for explorer, reviewer, and advisor; opencode denies edits for those
148
+ roles. Codex requests a read-only sandbox for explorer and advisor. Its
149
+ reviewer inherits the caller's sandbox so temporary/build checks remain
150
+ possible, while its prompt prohibits source edits. In inherited or otherwise
151
+ write-enabled sandboxes, shell-level mutation (`git checkout`,
141
152
  `git restore`, `git clean`, `git stash`, `git reset`, `sed -i`, redirecting
142
153
  output into a file) is guarded by instruction only: the agent prompts forbid
143
- it explicitly, but nothing technically prevents it. This residual has bitten in practice (a
154
+ it explicitly, but the role definition itself does not prevent it. A native
155
+ read-only sandbox can block those writes. This residual has bitten in practice (a
144
156
  reviewer ran `git checkout` and discarded uncommitted work), which is why the
145
157
  prompts now name the forbidden commands instead of just saying "read-only".
146
158
  Marker- or verdict-style enforcement of the Bash residual (sandboxing,
@@ -148,8 +160,8 @@ PreToolUse hooks) is harness territory and out of this kit's scope.
148
160
 
149
161
  ## Role profile
150
162
 
151
- `--profile` selects which subagent roles get installed (Claude Code and
152
- opencode only; Codex has no per-role files to select from):
163
+ `--profile` selects which subagent roles get installed for Claude Code, Codex,
164
+ and opencode:
153
165
 
154
166
  | Profile | Roles installed | When to use it |
155
167
  |---|---|---|
@@ -205,7 +217,33 @@ without reporting them at all.
205
217
 
206
218
  ## Model preselection
207
219
 
208
- Each subagent role gets a model, chosen interactively or via `--models`:
220
+ Routing is a harness-specific map from role and tier to a complete
221
+ `{model, effort}` selection. Pass a JSON file with `--routing`; the CLI deep
222
+ merges only the leaves you provide and records the resulting effective map in
223
+ `.ai/workflow/manifest.json`. The role's default-tier key configures its
224
+ unsuffixed file; another allowed key configures the corresponding
225
+ `<role>-<tier>` variant when `--tiers` is enabled. For example:
226
+
227
+ ```json
228
+ {
229
+ "codex": {
230
+ "implementer": {
231
+ "medium": { "model": "gpt-5.6-terra", "effort": "medium" },
232
+ "xhigh": { "model": "gpt-6-astra", "effort": "xhigh" }
233
+ }
234
+ }
235
+ }
236
+ ```
237
+
238
+ An omitted `--routing` preserves the exact persisted map on a re-install.
239
+ Changing one leaf leaves the others intact, which makes a previous manifest a
240
+ usable rollback record. Model updates are deliberate per role and tier: the
241
+ installer never interprets a newer model as automatically better and never
242
+ rewrites a preserved choice merely because another model exists.
243
+
244
+ `--models` remains as the backward-compatible, per-role input for Claude Code
245
+ and opencode. It does not configure Codex. Existing manifests that contain
246
+ only `models` continue to produce the same Claude Code and opencode defaults:
209
247
 
210
248
  | Role | Default | Why |
211
249
  |---|---|---|
@@ -215,9 +253,41 @@ Each subagent role gets a model, chosen interactively or via `--models`:
215
253
  | reviewer | `opus` | skeptical review benefits from the strongest model |
216
254
  | advisor | `opus` | escalations happen precisely when the situation is hard, so it shares the reviewer's strongest-model default |
217
255
 
218
- The orchestrator itself runs on the session's main model; use the strongest
219
- reasoning model available. The chosen mapping is recorded in
220
- `.ai/workflow/manifest.json` and reused as the default on later re-runs.
256
+ The orchestrator itself runs on the session's main model. For Codex, start the
257
+ orchestrator on `gpt-6-astra` at `high` effort; use `xhigh` for demanding work.
258
+ The installer does not mutate global or fleet Codex configuration to enforce
259
+ that recommendation.
260
+
261
+ **Codex defaults.** Codex uses native `.codex/agents/*.toml` custom agents.
262
+ The file shape follows the
263
+ [official Codex subagent configuration](https://learn.chatgpt.com/docs/agent-configuration/subagents).
264
+ The shipped routing is:
265
+
266
+ | Role | Tier | Model | Effort |
267
+ |---|---|---|---|
268
+ | explorer | low | `gpt-5.6-luna` | low |
269
+ | explorer | medium (default) | `gpt-5.6-sol` | medium |
270
+ | explorer | high | `gpt-5.6-sol` | high |
271
+ | task-slicer | low | `gpt-5.6-luna` | low |
272
+ | task-slicer | medium (default) | `gpt-5.6-sol` | medium |
273
+ | task-slicer | high | `gpt-5.6-sol` | high |
274
+ | implementer | low | `gpt-5.6-luna` | low |
275
+ | implementer | medium (default) | `gpt-5.6-terra` | medium |
276
+ | implementer | high | `gpt-5.6-terra` | high |
277
+ | implementer | xhigh | `gpt-6-astra` | xhigh |
278
+ | reviewer | medium | `gpt-5.6-terra` | medium |
279
+ | reviewer | high (default) | `gpt-6-astra` | high |
280
+ | reviewer | xhigh | `gpt-6-astra` | xhigh |
281
+ | advisor | high (default) | `gpt-6-astra` | high |
282
+ | advisor | xhigh | `gpt-6-astra` | xhigh |
283
+
284
+ When you have a deterministic Codex model catalog, pass it with
285
+ `--codex-catalog <json-file>`. The CLI validates the selected Codex model and
286
+ effort pairs before writing. Without a supplied catalog it performs no online
287
+ entitlement check; offline or account-specific availability remains unknown.
288
+ Use the harness's native capability commands, such as `codex debug models`, to
289
+ refresh a catalog before installation when appropriate. A bundled-capability
290
+ view describes what the binary knows and does not prove account entitlement.
221
291
 
222
292
  **opencode model resolution.** opencode requires fully-qualified `provider/model-id`
223
293
  strings (e.g. `github-copilot/claude-sonnet-4.6`). At install time the CLI
@@ -241,14 +311,14 @@ be supplied as a fully-qualified `--models` entry, e.g.
241
311
  `--tiers` renders an additional per-role subagent definition for each
242
312
  non-default effort tier, alongside the one default (unsuffixed) agent file
243
313
  `--profile` already installs. Each tier variant is a standalone subagent
244
- definition, not a modification of the default file: the default file
245
- (`<role>.md`) stays byte-identical to what a tiers-off install already
246
- produces, and each variant lives next to it as `<role>-<tier>.md`.
314
+ definition, not a modification of the default file. Claude Code and opencode
315
+ use `<role>.md` / `<role>-<tier>.md`; Codex uses `<role>.toml` /
316
+ `<role>-<tier>.toml`.
247
317
 
248
318
  **Every default file carries its own pinned effort, independent of
249
- `--tiers`.** Since 0.22.0, `composeClaudeAgent`/`composeOpencodeAgent` add
250
- the role's own `TIER_DEFS[DEFAULT_TIER[role]].effort` to the default
251
- (unsuffixed) file unconditionally: `effort: medium` for explorer,
319
+ `--tiers`.** The harness composers add the role's own default routing
320
+ selection to the unsuffixed file. In the legacy Claude/opencode path this is
321
+ `TIER_DEFS[DEFAULT_TIER[role]].effort`: `effort: medium` for explorer,
252
322
  task-slicer, and implementer; `effort: high` for reviewer and advisor
253
323
  (opencode: a `variant: high` line when the resolved model is Claude-family,
254
324
  following the same dispatch rule tier variants use, `reasoningEffort:
@@ -270,7 +340,8 @@ no variant files unless asked. `--tiers` turns the feature on for that run,
270
340
  `--no-tiers` turns it off; a plain re-run with neither flag keeps whatever
271
341
  the previous install had, the same override-vs-persist rule already used
272
342
  for `--profile` and `--models`. There is no interactive prompt for it:
273
- `tiers` is opt-in/off via the flags only.
343
+ `tiers` is opt-in/off via the flags only. Neither Codex nor the other harnesses
344
+ get `max` or `ultra` variants from this kit.
274
345
 
275
346
  ```bash
276
347
  npx orchestrator-workflow init --tiers --yes
@@ -345,6 +416,19 @@ warning are opencode-scoped only; Claude Code variants resolve `model:` from
345
416
  a plain alias (`haiku`/`sonnet`/`opus`) and need no live catalog lookup, so
346
417
  they are unaffected.
347
418
 
419
+ Codex variants carry `model` and `model_reasoning_effort` from their exact
420
+ routing leaf. The canonical role prompt becomes `developer_instructions`.
421
+ Runtime dispatch follows the client's actual capabilities: select the named
422
+ installed agent when supported; otherwise, if spawning supports explicit model
423
+ and effort, read the installed TOML and pass its selection, developer
424
+ instructions, and narrow task contract into a fresh task-local spawn. A
425
+ full-history spawn may not permit a model override. If that explicit spawn
426
+ cannot accept a sandbox override, explorer and advisor inherit the caller's
427
+ sandbox and their prompt is the edit guard. When native spawning is
428
+ unavailable, run the same contract inline and sequentially. The orchestrator
429
+ alone spawns agents. In particular, it must not choose `implementer-low` when
430
+ the task requires a test, typecheck, lint, build, or named mutation probe.
431
+
348
432
  **Warning: `CLAUDE_CODE_EFFORT_LEVEL` overrides every agent's frontmatter
349
433
  `effort:`, tier variants included.** Claude Code's `effort:` frontmatter
350
434
  field does work: it reaches the model request as `output_config.effort`.
@@ -378,12 +462,13 @@ orchestrator-workflow apply --target /path/to/repo
378
462
  ```
379
463
 
380
464
  **`setup`** writes or updates this operator's default install options
381
- (harnesses, profile, models, tiers) as the baseline for future installs; it
465
+ (harnesses, profile, legacy models, routing, tiers) as the baseline for future installs; it
382
466
  touches no repository. A flag always wins; a flag-less re-run keeps the
383
467
  previously stored values; a first-ever `setup` falls back to `claude` /
384
- `full` / the kit's default models / tiers off. `setup` takes the same
385
- option flags as `init` (`--harness`, `--profile`, `--models`, `--tiers` /
386
- `--no-tiers`, `--opencode-provider`, `--yes`). The defaults live in
468
+ `full` / the kit's default routing / tiers off. `setup` takes the same
469
+ option flags as `init` (`--harness`, `--profile`, `--models`, `--routing`,
470
+ `--codex-catalog`, `--tiers` / `--no-tiers`, `--opencode-provider`, `--yes`).
471
+ The defaults live in
387
472
  `<operator home>/manifest.json`, where the operator home is
388
473
  `~/.orchestrator-workflow/` unless the `ORCHESTRATOR_WORKFLOW_HOME`
389
474
  environment variable names a different directory.
@@ -399,22 +484,21 @@ what `init` would have auto-detected) -- except a target whose own
399
484
  manifest recorded a real `harnesses: []` (a deliberate templates-only
400
485
  install, see "Templates-only mode" above), which stays templates-only on
401
486
  a flagless run regardless of the operator's defaults or what is on disk;
402
- an **interactive** re-run on such a target still prompts, but with
403
- nothing pre-checked at all -- neither whatever `apply`'s harness fallback
404
- (recorded harnesses, else operator defaults, else detection) would
405
- otherwise have picked, nor a harness config left on disk from something
406
- else, which is a weak signal next to the target's own recorded
407
- `harnesses: []`.
487
+ an **interactive** re-run on such a target still prompts, with the same
488
+ nothing-pre-checked behaviour described in "Templates-only mode" above
489
+ (it applies identically to `apply`).
408
490
  Pass `--sync` to invert that for
409
- profile, tiers, and models: the operator's defaults then win over whatever
491
+ profile, tiers, legacy models, and routing: the operator's defaults then win over whatever
410
492
  the target already had recorded. A target pinned to a kit version other
411
493
  than the one being applied is skipped rather than touched (see the pin
412
494
  rule below). `apply` also takes the same install options as `init` (`--harness`,
413
- `--profile`, `--models`, `--tiers` / `--no-tiers`, `--opencode-provider`,
414
- `--force`, `--yes`), which feed the precedence rule above.
495
+ `--profile`, `--models`, `--routing`, `--codex-catalog`, `--tiers` /
496
+ `--no-tiers`, `--opencode-provider`, `--force`, `--yes`), which feed the
497
+ precedence rule above. An explicit routing file is the highest-precedence
498
+ deep patch; leaves it omits retain their resolved baseline values.
415
499
 
416
500
  **`doctor [--json] [--prune]`** reports every operator-registered target's
417
- status: `clean`, `divergent` (from the operator defaults), `version-lag`,
501
+ status: `clean`, `divergent` (from the operator defaults, including routing), `version-lag`,
418
502
  `drift` (installed files edited, deleted, or unreadable since install),
419
503
  `missing`, `no-manifest`, or `unverifiable`. It exits `2` when the operator
420
504
  manifest is missing or unreadable, or, with `--prune`, when the operator
@@ -426,6 +510,10 @@ version. `--prune` removes `missing` and `no-manifest` targets from the
426
510
  registry before reporting (never an `unverifiable` one, since that status
427
511
  means the check itself was inconclusive, not that the target is confirmed
428
512
  gone) and rewrites the manifest file in its normalized form.
513
+ For a legacy opencode leaf without a recorded provider-qualified model id,
514
+ doctor reports `Routing comparison incomplete` and includes
515
+ `routingComparisonGaps` in JSON instead of declaring a false routing
516
+ divergence. The gap alone does not change the target status.
429
517
 
430
518
  **`adopt [dir] [--json]`** brings a repository that already has the kit installed,
431
519
  by hand or by an earlier `init`, under the operator's management without
@@ -504,3 +592,11 @@ organizational guidance (when to use agents at all, review depth, risk tiers)
504
592
  live in the sibling package
505
593
  [agentic-coding-playbook](../agentic-coding-playbook), which the skill
506
594
  references.
595
+
596
+ ## okf-kit version pin
597
+
598
+ `test/docs-consistency.test.ts` pins the `okf-kit@<version>` this repo's own
599
+ `.github/workflows/` install against the sibling `packages/okf-kit`
600
+ package's version, so a release of `okf-kit` must bump those pins in the
601
+ same commit as the version cut; see `CONTRIBUTING.md`'s "Releasing okf-kit"
602
+ section (repo root) for the order.