@open-agent-toolkit/cli 0.1.54 → 0.1.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/assets/agents/oat-phase-implementer.md +195 -238
  2. package/assets/docs/cli-utilities/configuration.md +7 -6
  3. package/assets/docs/contributing/index.md +1 -0
  4. package/assets/docs/contributing/smoke-testing.md +284 -0
  5. package/assets/docs/provider-sync/providers.md +11 -11
  6. package/assets/docs/provider-sync/scope-and-surface.md +2 -2
  7. package/assets/docs/workflows/projects/dispatch-ceiling.md +29 -26
  8. package/assets/docs/workflows/projects/evidence-layers.md +123 -0
  9. package/assets/docs/workflows/projects/implementation-execution.md +160 -406
  10. package/assets/docs/workflows/projects/index.md +8 -0
  11. package/assets/docs/workflows/projects/orchestration-model.md +190 -0
  12. package/assets/docs/workflows/projects/programmatic-execution.md +137 -0
  13. package/assets/docs/workflows/projects/review-flavors.md +129 -0
  14. package/assets/docs/workflows/skills/repo-improve.md +14 -0
  15. package/assets/public-package-versions.json +4 -4
  16. package/assets/skills/oat-agent-instructions-analyze/references/docs/provider-reference.md +5 -4
  17. package/assets/skills/oat-agent-instructions-apply/references/docs/provider-reference.md +5 -4
  18. package/assets/skills/oat-dispatch-subagents/SKILL.md +6 -1
  19. package/assets/skills/oat-dispatch-subagents/references/record-schema.md +5 -0
  20. package/assets/skills/oat-project-dispatch-subagents/SKILL.md +37 -15
  21. package/assets/skills/oat-project-implement/SKILL.md +63 -1904
  22. package/assets/skills/oat-project-implement/references/completion-and-closeout.md +431 -0
  23. package/assets/skills/oat-project-implement/references/dispatch-and-dry-run.md +715 -0
  24. package/assets/skills/oat-project-implement/references/phase-execution.md +270 -0
  25. package/assets/skills/oat-project-implement/references/plan-and-resume.md +279 -0
  26. package/assets/skills/oat-project-import-plan/SKILL.md +16 -8
  27. package/assets/skills/oat-project-plan/SKILL.md +15 -7
  28. package/assets/skills/oat-project-plan-writing/SKILL.md +74 -40
  29. package/assets/skills/oat-project-quick-start/SKILL.md +16 -8
  30. package/assets/skills/oat-project-review-provide/SKILL.md +8 -5
  31. package/assets/skills/oat-repo-improve/SKILL.md +17 -2
  32. package/assets/skills/oat-repo-improve/references/audit-playbook.md +6 -0
  33. package/assets/skills/oat-worktree-bootstrap/SKILL.md +22 -12
  34. package/assets/skills/oat-worktree-bootstrap/references/worktree-conventions.md +8 -8
  35. package/assets/skills/oat-worktree-bootstrap-auto/SKILL.md +233 -44
  36. package/dist/commands/docs/index-generate/index.d.ts.map +1 -1
  37. package/dist/commands/docs/index-generate/index.js +10 -5
  38. package/dist/commands/doctor/index.d.ts.map +1 -1
  39. package/dist/commands/doctor/index.js +7 -4
  40. package/dist/commands/gate/index.d.ts +9 -1
  41. package/dist/commands/gate/index.d.ts.map +1 -1
  42. package/dist/commands/gate/index.js +62 -2
  43. package/dist/commands/project/dispatch-ceiling/index.js +2 -2
  44. package/package.json +4 -4
  45. package/assets/skills/oat-worktree-bootstrap-auto/scripts/bootstrap.sh +0 -236
@@ -0,0 +1,715 @@
1
+ # Dispatch And Dry Run
2
+
3
+ This reference preserves the route-specific implementation contract. Load it only when the entry skill routes execution here.
4
+
5
+ ### Step 0.5: Capability Detection and Tier Selection
6
+
7
+ **Mandatory target-first order:** Complete Dispatch Policy Preflight and resolve
8
+ the concrete managed Codex target before probing generic agent availability or
9
+ locking Tier 1/Tier 2. A concrete target takes precedence over tier selection:
10
+ first send the exact registered role through native dispatch. Only a native
11
+ role-selection rejection permits an explicitly pinned fresh Codex child. If
12
+ neither exact route is possible, inline execution is allowed only with verified
13
+ equivalent current-host model and effort controls; otherwise block before work
14
+ starts. Explicit inherit/default and documented managed-uncapped reviewer
15
+ behavior remain the only base-role exceptions.
16
+
17
+ For a concrete managed Codex role, first send the resolver-returned Codex
18
+ variant through the native spawn API as `agent_type`. Spawn acceptance plus the
19
+ constructed launcher payload is configured invocation evidence; independent
20
+ runtime telemetry or agent self-report is not required. Launch a fresh Codex
21
+ child pinned to the resolver-returned model and effort with canonical role
22
+ instructions only after a native role-selection rejection as defined below. If
23
+ that fresh child cannot be launched, fail closed and block; never substitute
24
+ the coordinator or base role.
25
+
26
+ Use base `oat-phase-implementer` only for the allowed exceptions above:
27
+ explicit inherit/default behavior. It is never a managed phase-target fallback.
28
+
29
+ Detect whether native subagent dispatch is available. The detection logic follows the same pattern used by `oat-project-review-provide` but produces a two-tier outcome (no fresh-session tier — this skill runs autonomously and cannot block on user-initiated fresh sessions mid-run).
30
+
31
+ Detection logic:
32
+
33
+ - If the host is Claude Code, check Task-tool availability with `subagent_type: "oat-phase-implementer"` and `subagent_type: "oat-reviewer"`. Available → Tier 1.
34
+ - If the host is Cursor, use Cursor-native invocation. Available → Tier 1.
35
+ - If the host is Codex multi-agent, verify `[features] multi_agent = true` and whether `spawn_agent` requires explicit authorization.
36
+ - Codex Tier 1 dispatches for `oat-phase-implementer` and `oat-reviewer` must use self-contained scope packets and fresh context. Do not rely on forked full-thread context when pinning a specialized OAT role.
37
+ - Available without auth → Tier 1.
38
+ - Available with auth required → fail closed. You MUST ask the user once at skill start before selecting Tier 2 or starting implementation work:
39
+
40
+ ```
41
+ This OAT implementation skill normally delegates phase implementation and review to subagents. Authorize subagent delegation for this run?
42
+
43
+ Yes authorizes both oat-phase-implementer and oat-reviewer across every phase in this run.
44
+ ```
45
+
46
+ - Approved → Tier 1.
47
+ - Declined → Tier 2.
48
+
49
+ - If the host does not resolve either generic agent, first attempt the exact
50
+ registered role natively for any concrete managed target. Use the explicitly
51
+ pinned fresh-child route only after a native role-selection rejection. Select
52
+ Tier 2 only when inline execution is allowed by the target-first rule above.
53
+
54
+ **Approval scope rule:** this Tier selection applies to both phase implementation and checkpoint review. Do not infer a mixed mode from conversational emphasis on review checkpoints. If the user has not explicitly approved Tier 1 for the run, stay Tier 2 throughout. Mixed mode is only valid when the user explicitly requests it.
55
+
56
+ **Codex fail-closed rule:** after this skill is invoked, "user did not separately ask for subagents" is not a valid Tier 2 reason. If Codex can spawn agents but requires explicit user authorization, the implementation MUST NOT continue until the delegation question above is answered. Tier 2 is allowed only when:
57
+
58
+ - `user declined delegation`
59
+ - `spawn_agent unavailable`
60
+ - `required agent role unresolved`
61
+
62
+ Report the selected tier to the user:
63
+
64
+ ```
65
+ [preflight] Checking subagent availability…
66
+ → oat-phase-implementer + oat-reviewer: {available | authorization required | not resolved}
67
+ → Selected: Tier {1 | 2} — {Subagents | Inline}
68
+ → Reason: {authorized | available without auth | user declined delegation | spawn_agent unavailable | required agent role unresolved}
69
+ ```
70
+
71
+ Do not print `[0/N]` for this preflight step. The implementation denominator is not established by capability detection; use the literal `[preflight]` label above.
72
+
73
+ **Hard pre-work guard:** before any code edit, test run, or implementation commit, print the selected tier and reason. If Tier 2 is selected, the reason must be one of the three allowed Tier 2 reasons above. Do not run tests, edit files, or create implementation commits until Step 0.5 has completed and the tier report has been printed.
74
+
75
+ **Tier is locked for the remainder of the run only after the dispatch target is
76
+ resolved.** Subsequent phase-implementer, optional nested, fix-continuation,
77
+ and review dispatches use the same tier. Tier controls mechanics only: every
78
+ managed phase implementer resolves one exact target beneath the recorded
79
+ project or phase named maximum. No mid-run downgrade is allowed.
80
+
81
+ **Recovery if Step 0.5 was skipped:** If implementation work has already started inline before completing Step 0.5, STOP immediately. Preserve any work in progress, complete or revert to a clean task boundary, and re-run Step 0.5 before continuing. Do not silently continue in Tier 2.
82
+
83
+ **Codex authorization example:**
84
+
85
+ ```
86
+ User invokes: $oat-project-implement
87
+ Detected: Codex multi-agent support available; explicit authorization required.
88
+ Expected: ask "This OAT implementation skill normally delegates phase implementation and review to subagents. Authorize subagent delegation for this run?"
89
+ If approved: Selected: Tier 1 — Subagents
90
+ Forbidden: Selected: Tier 2 — Inline because the user did not separately mention subagents.
91
+ ```
92
+
93
+ **Native role-selection rejection:** This means the native host explicitly
94
+ reports that the requested `agent_type` is unsupported, unknown, unregistered,
95
+ or rejected before the child or agent starts. Missing runtime telemetry,
96
+ missing agent self-report, a timeout after spawn acceptance, or any terminal
97
+ result from an accepted child — including `BLOCKED` — is not role
98
+ unavailability and is not a native role-selection rejection. Self-report is
99
+ optional diagnostic data and cannot populate or overwrite launcher-owned
100
+ `target`, `model_axis`, or `effort_axis` fields. An accepted child cannot
101
+ trigger a fresh pinned-child, CLI fallback, or second launch on the same route.
102
+ If an accepted native reviewer remains active, poll, nudge, or continue only
103
+ through its existing handle. A terminal timeout records review failure and
104
+ stops or escalates without another launch. A new launch is eligible only when
105
+ the original attempt received explicit pre-start rejection before any child
106
+ started.
107
+
108
+ **Legacy state migration:** If `state.md` contains `oat_execution_mode: subagent-driven`, silently ignore it. On the next bookkeeping write, remove that key. Do not redirect to `oat-project-subagent-implement` — that skill is deprecated.
109
+
110
+ ### Dispatch Policy Preflight
111
+
112
+ Before any phase work, resolve and print the OAT dispatch policy. This is a
113
+ preflight gate, not a mid-run question.
114
+
115
+ Use the CLI resolver as the source of truth. The command name remains
116
+ `dispatch-ceiling` for compatibility, but the returned contract is dispatch
117
+ policy:
118
+
119
+ ```bash
120
+ oat project dispatch-ceiling resolve --provider <active-provider> --preflight --report-scope implementation-preflight --report-action implementation --json
121
+ ```
122
+
123
+ If `oat` is not in PATH, use:
124
+
125
+ ```bash
126
+ pnpm run cli -- project dispatch-ceiling resolve --provider <active-provider> --preflight --report-scope implementation-preflight --report-action implementation --json
127
+ ```
128
+
129
+ Resolution order:
130
+
131
+ 1. Config keys `workflow.dispatchPolicy.mode` / `workflow.dispatchPolicy.policy` (local > shared > user)
132
+ 2. Compatibility config keys `workflow.dispatchCeiling.providers.<provider>` (local > shared > user)
133
+ 3. Project `state.md` frontmatter key `oat_dispatch_policy`
134
+ 4. Legacy project `state.md` frontmatter key `oat_dispatch_ceiling`
135
+ 5. Interactive implementation preflight prompt (below)
136
+ 6. Non-interactive unresolved: block before work starts
137
+
138
+ **JSON response shape** (from `--json`):
139
+
140
+ ```json
141
+ {
142
+ "status": "resolved",
143
+ "provider": "codex",
144
+ "value": "high",
145
+ "policyMode": "managed",
146
+ "policy": "balanced",
147
+ "source": "project-state",
148
+ "preset": "balanced",
149
+ "unresolved": false,
150
+ "providerDefaultEffort": "medium",
151
+ "providers": {
152
+ "codex": {
153
+ "value": "high",
154
+ "mode": "enforced",
155
+ "mechanism": "pinned-variant",
156
+ "dispatchArgs": {
157
+ "variant": "oat-phase-implementer-gpt-5-6-terra-high"
158
+ },
159
+ "verifyOnDispatch": false,
160
+ "selection": {
161
+ "role": "implementer",
162
+ "preferredValue": null,
163
+ "selectedValue": "high",
164
+ "capped": false,
165
+ "selectionMode": "capped",
166
+ "policyMode": "managed",
167
+ "policy": "balanced"
168
+ }
169
+ }
170
+ }
171
+ }
172
+ ```
173
+
174
+ Read `providers.<active-provider>` for the concrete dispatch controls. The
175
+ `dispatchArgs` field carries the provider-specific argument to pass through
176
+ (Codex: `variant` name; Claude: `model` string). For implementer/fix dispatch,
177
+ pass `--preferred <preferred-effort>` and use `selection.selectedValue` as the
178
+ selected axis value when it is present. Never re-derive these from the policy
179
+ label or a ceiling-only variant - the resolver is the single compilation/join
180
+ point.
181
+
182
+ Print before phase work:
183
+
184
+ ```text
185
+ OAT Dispatch Tier: balanced (codex, managed capped — pinned-variant)
186
+ Resolved cap: high
187
+ Source: project state
188
+ Provider default effort: medium
189
+ Note: OAT will use resolver-returned materialized Codex role names up to high. Base/unpinned roles resolve through the provider default only for explicit inherit/default behavior or the documented managed-uncapped reviewer exception.
190
+ ```
191
+
192
+ If no policy resolves and the session is interactive, present the dispatch
193
+ policy prompt once before starting work:
194
+
195
+ Print the unresolved-policy heading, then generate the choice text from
196
+ canonical CLI metadata immediately before presenting it:
197
+
198
+ ```bash
199
+ oat project dispatch-ceiling choices --format markdown
200
+ ```
201
+
202
+ Do not hand-type the dispatch policy menu or omit canonical choices. If the CLI
203
+ is unavailable in this environment, derive the same labels and descriptions from
204
+ `packages/cli/src/config/dispatch-policy-options.ts`; include every managed
205
+ policy returned by `VALID_MANAGED_DISPATCH_POLICIES` plus `Uncapped`, `Inherit
206
+ Host Defaults`, and `Leave Unresolved`.
207
+
208
+ At minimum, preserve these semantics in any fallback text:
209
+
210
+ - `Uncapped`: OAT still manages dispatch selection, but stores no maximum cap.
211
+ It is not host/default behavior and must not be represented by absent policy
212
+ state.
213
+ - `Inherit Host Defaults`: OAT does not choose model or effort controls; the
214
+ executing host/provider owns implementation, fix, and review defaults.
215
+ - `Leave Unresolved`: planning/preflight deferral only. It records no runtime
216
+ policy and is not a runnable implementation setting. Implementation preflight
217
+ must block until a policy resolves.
218
+
219
+ OAT applies managed policies where the provider exposes a reliable mechanism
220
+ (Codex: pinned variants; Claude: Task model parameter). Other providers may
221
+ treat managed policies as advisory.
222
+
223
+ **Managed capped policy selection** persists only `mode: managed`, the named
224
+ maximum `policy`, and `source`. The named maximum leaves lower configured
225
+ candidates eligible; do not copy compiled provider/model targets into project
226
+ state. On selection, print the named maximum before proceeding.
227
+
228
+ **Uncapped** persists explicit managed uncapped state. OAT still manages
229
+ dispatch selection. It does not write provider caps, and it must not be
230
+ represented by leaving dispatch policy state absent.
231
+
232
+ **Inherit Host Defaults** persists explicit inherit/default state. Use this only
233
+ when the user wants OAT to leave implementation, fix, and review model/effort
234
+ controls to the executing host/provider. OAT does not choose model or effort in
235
+ this mode.
236
+
237
+ **Leave Unresolved** records no runtime policy for implementation. Stop before
238
+ phase work and report the unresolved state; Implementation preflight must block
239
+ until a policy resolves.
240
+
241
+ Persist in project `state.md` frontmatter using the normalized shape:
242
+
243
+ ```yaml
244
+ oat_dispatch_policy:
245
+ mode: managed
246
+ policy: balanced
247
+ source: project-state
248
+ ```
249
+
250
+ For `Uncapped`:
251
+
252
+ ```yaml
253
+ oat_dispatch_policy:
254
+ mode: managed
255
+ policy: uncapped
256
+ source: project-state
257
+ ```
258
+
259
+ For `Inherit Host Defaults`:
260
+
261
+ ```yaml
262
+ oat_dispatch_policy:
263
+ mode: inherit
264
+ source: project-state
265
+ ```
266
+
267
+ If no policy resolves and `OAT_NON_INTERACTIVE=1` or no user-response channel
268
+ exists, rerun the resolver with non-interactive behavior and stop before work
269
+ starts if it blocks:
270
+
271
+ ```bash
272
+ oat project dispatch-ceiling resolve --provider <active-provider> --preflight --non-interactive --report-scope implementation-preflight --report-action implementation
273
+ ```
274
+
275
+ ```text
276
+ BLOCKED: Codex dispatch policy is unresolved in non-interactive mode.
277
+ Set workflow.dispatchPolicy.mode/workflow.dispatchPolicy.policy, workflow.dispatchCeiling.providers.codex, oat_dispatch_policy, or legacy oat_dispatch_ceiling.
278
+ ```
279
+
280
+ Dry-run mode must report the unresolved policy and planned behavior without
281
+ modifying project state.
282
+
283
+ ### Runtime dispatch selection
284
+
285
+ Before each phase-implementer, optional nested, fix-continuation, or review
286
+ dispatch, choose and log runtime controls. Resolve these controls before
287
+ applying Tier 1/Tier 2 mechanics. A phase target applies to the phase
288
+ implementer, which directly owns its planned tasks. Optional children resolve
289
+ their own exact bounded target beneath the phase ceiling. Inline execution must
290
+ preserve equivalent controls or use a documented exception.
291
+
292
+ Use these inputs:
293
+
294
+ - resolved dispatch policy, source, and provider-specific selection
295
+ - phase ID and the current bounded phase or optional-child scope
296
+ - optional `## Dispatch Profile` row in `plan.md`
297
+ - host-exposed provider controls, by axis
298
+ - prior outcomes for the phase, including review results and failed retries
299
+
300
+ Route selection is part of runtime dispatch selection when the resolver returns
301
+ an ordered matrix route:
302
+
303
+ - Start every implementation/fix scope at route level `0` unless the plan's
304
+ `## Dispatch Profile` names a different starting route level for that
305
+ phase/task. Level `0` is the route floor.
306
+ - Pass `--escalation-level <route-level>` on implementer/fix resolver calls.
307
+ Single-axis providers ignore this flag and keep their normal capped `min()`
308
+ behavior.
309
+ - Read `providers.<provider>.target` and `providers.<provider>.selection.target`
310
+ from resolver JSON when present. A target with `crossHarness: true` is an
311
+ explicit deferred cross-harness target: log it as advisory and do not invent a
312
+ same-harness fallback.
313
+ - On repeated review failure or retry-loop escalation, advance by one route
314
+ entry before retrying, up to the last available route entry and within
315
+ `oat_orchestration_retry_limit`.
316
+
317
+ #### Dispatch Report V1 contract
318
+
319
+ Every implementation, fix, and review resolver invocation MUST pass explicit
320
+ report context:
321
+
322
+ - implementation: `--report-scope <phase> --report-action implementation`
323
+ - optional nested work: `--report-scope <phase-or-bounded-child> --report-action implementation`
324
+ - fix: `--report-scope <phase-or-bounded-fix> --report-action fix`
325
+ - review: `--report-scope <phase-or-review-scope> --report-action review`
326
+
327
+ Require `dispatchReport.schemaVersion: 1` in the completed resolver JSON before
328
+ dispatch. Consume the report as the human/audit source: render the versioned
329
+ block with `formatDispatchReport(dispatchReport)` semantics, and derive the
330
+ formal compatibility line only through
331
+ `formatDispatchStamp(dispatchReport)` / `toDispatchStampRecord(dispatchReport)`.
332
+ Never hand-assemble a second `Dispatch:` schema from policy labels, role names,
333
+ candidate strings, or target names.
334
+
335
+ The exact provider invocation remains authoritative in
336
+ `providers.<provider>.dispatchArgs` and `providers.<provider>.selection.target`;
337
+ the report does not replace or weaken target-pinned dispatch. Add independently
338
+ observed runtime identity to `dispatchReport.runtimeIdentity` only when such an
339
+ observation exists. Requested/configured controls are not runtime observation.
340
+ For gate-originated review, keep `dispatchReport.gateInvocation`, existing
341
+ work-producer `diversity`, and reviewer `runtimeIdentity` as three distinct
342
+ facts; producer stamps or self-report never overwrite configured invocation.
343
+
344
+ Axis states:
345
+
346
+ - `selected:<value>` - host exposes the axis and the orchestrator chose a value.
347
+ - `provider-default` - Codex base/unpinned role follows configured/provider default effort.
348
+ - `inherited` - host/API explicitly inherits the parent setting and OAT can trust that behavior.
349
+ - `not-applicable` - this host/API has no meaningful per-dispatch concept for that axis.
350
+ - `host-auto` - exceptional; the host uses that axis internally but OAT cannot read or pin it.
351
+
352
+ Codex rules:
353
+
354
+ **Managed Codex execution invariant:** When the resolver returns a model+effort
355
+ target, the resolver-returned Codex variant from
356
+ `providers.codex.dispatchArgs.variant` must first be sent through the native
357
+ spawn API as `agent_type`. Spawn acceptance plus the launcher payload is
358
+ configured invocation evidence with launcher-selected/config-declared
359
+ provenance. If and only if the host returns a native role-selection rejection,
360
+ launch a fresh Codex child with the resolver target's explicit model, reasoning
361
+ effort, and canonical role instructions from
362
+ `.agents/agents/oat-phase-implementer.md` or
363
+ `.agents/agents/oat-reviewer.md`. Missing runtime telemetry or agent self-report
364
+ is not role unavailability, and an accepted child result such as `BLOCKED`
365
+ cannot trigger fallback. Workflow correctness must not require provider restart
366
+ or hot reload. A managed base role is forbidden when a concrete target was
367
+ requested; never silently downgrade to it. Base roles remain valid only for
368
+ explicit inherit/default behavior and the documented managed-uncapped reviewer
369
+ fallback.
370
+
371
+ 1. Codex effort order is `low < medium < high < xhigh < max`.
372
+ 2. Classify preferred effort from scope:
373
+ - `low`: trivial docs-only, narrow single-file, or mechanical changes
374
+ - `medium`: normal multi-file implementation and moderate integration risk
375
+ - `high`: broad architecture, security/auth/redaction boundaries, subtle state behavior, or repeated substantive review failures
376
+ - `xhigh`: highest-risk work that requires a capped policy to allow xhigh or a managed `Uncapped` policy to select it
377
+ - `max`: exceptional frontier work whose risk or cross-cutting scope justifies the first-class maximum reasoning control
378
+ 3. For capped managed implementer/fix work, selected effort is `min(preferred, resolved_cap)`.
379
+ 4. For managed `Uncapped` implementer/fix work, selected effort is the preferred effort with no cap.
380
+ 5. For inherit/default mode, the resolver returns no selected dispatch args. Use the base/unpinned Codex role, log `Selected effort: provider-default`, display provider default effort when known, and do not describe this as managed uncapped behavior.
381
+ 6. For managed capped phase-implementer/fix dispatch, choose an exact
382
+ configured candidate. For implementation, call
383
+ `oat project dispatch-ceiling resolve --provider codex --role implementer --ceiling-tier <project-or-phase-tier> --candidate-model <model> --candidate-effort <effort> --escalation-level <route-level> --report-scope <phase-id> --report-action implementation --json`.
384
+ For a bounded fix, use the same phase target with
385
+ `--report-scope <phase-or-fix-scope> --report-action fix`. Read
386
+ `providers.codex.dispatchArgs.variant` and
387
+ `providers.codex.selection.target`; never reuse a cap-only variant.
388
+ Optional children resolve only when actually launched.
389
+ 7. For review dispatch: call `oat project dispatch-ceiling resolve --provider codex --role reviewer --report-scope <phase-or-review-scope> --report-action review --json`; read `providers.codex.dispatchArgs.variant` and `providers.codex.selection.target`.
390
+ - Capped managed policy: reviewer targets the configured cap for deterministic quality gate behavior.
391
+ - Managed `Uncapped`: no reviewer target exists; use base/unpinned reviewer fallback and log `selectionMode=no-review-target`, `selectedValue=null`, and `effort_axis=provider-default`.
392
+ - Inherit/default: no reviewer target exists; use base/unpinned reviewer fallback and log `selectionMode=inherit-default`, `selectedValue=null`, and `effort_axis=provider-default`.
393
+ 8. Codex payload-first assertion applies whenever the resolver returns a materialized model+effort target. If `providers.codex.dispatchArgs.variant` is present, the actual `spawn_agent` payload MUST first use it as native `agent_type`; when that variant came from a Codex model+effort target, log `model_axis=selected:<model>` and `effort_axis=selected:<effort>` from resolver output and the constructed launcher payload. Spawn acceptance is sufficient configured invocation evidence. Missing telemetry or self-report does not make the variant unusable. If native role selection explicitly rejects the variant, use the explicitly pinned fresh-child route or block. Use the base role and log provider-default only for explicit inherit/default behavior or the documented managed-uncapped reviewer exception. Always derive `model_axis` and `effort_axis` from resolver output, not from legacy role-name parsing or agent self-report.
394
+ 9. Do not use top-level per-call `reasoning_effort` as the standard OAT selected-effort path; dogfooding showed that path can be inconsistent.
395
+
396
+ Claude rules:
397
+
398
+ - Claude policy selection is model-based: `haiku < sonnet < opus < fable`.
399
+ - Implementer/fix dispatch: classify the preferred model (`haiku`, `sonnet`, `opus`, or `fable`) and pass it to the resolver as `--preferred <preferred-model>`.
400
+ - Capped managed policy: the resolver selects `min(preferred, resolved_cap)`.
401
+ - Managed `Uncapped`: the resolver selects the preferred model with no cap.
402
+ - Inherit/default: the resolver returns no selected model; omit `model` so Claude Code inherits host/default behavior.
403
+ - Review dispatch:
404
+ - Capped managed policy: target the configured policy cap directly.
405
+ - Managed `Uncapped` or inherit/default: no reviewer target exists; omit `model` and log inherited/default model behavior.
406
+ - For managed capped phase-implementer/fix dispatch, call
407
+ `oat project dispatch-ceiling resolve --provider claude --role implementer --ceiling-tier <project-or-phase-tier> --candidate-model <model> --orchestrator-tier <current-orchestrator-tier> --escalation-level <route-level> --report-scope <phase-id> --report-action implementation --json`.
408
+ For bounded fixes, reuse the exact phase target with a bounded fix scope.
409
+ For review dispatch, call the resolver with
410
+ `--role reviewer --report-scope <phase-or-review-scope> --report-action review --json`
411
+ and no candidate flags. Read `providers.claude.dispatchArgs.model` and pass it
412
+ exactly on the actual Task invocation.
413
+ - Pass `model: "<value>"` when `model_axis=selected:<value>` on the Task tool call.
414
+ - Keep `effort_axis=not-applicable`; Claude Code has no separate per-dispatch effort axis.
415
+
416
+ Cursor rules:
417
+
418
+ - Treat every configured Cursor candidate string as opaque. Do not normalize it
419
+ or infer capability from its spelling.
420
+ - For managed capped phase-implementer/fix dispatch, call
421
+ `oat project dispatch-ceiling resolve --provider cursor --role implementer --ceiling-tier <project-or-phase-tier> --candidate-model <opaque-model> --report-scope <phase-id> --report-action implementation --json`.
422
+ For bounded fixes, reuse the exact phase target with a bounded fix scope.
423
+ - Require `providers.cursor.dispatchArgs.model` and pass that exact byte-for-byte
424
+ string as the actual Cursor invocation model. If the host cannot apply it,
425
+ fail closed.
426
+
427
+ Payload-first invariant:
428
+
429
+ - Build the actual host dispatch argument map before logging.
430
+ - Do not emit `selected:<value>` unless the host invocation contains the corresponding role/model selection.
431
+ - For every phase-implementer, optional nested, fix, and review launch, record
432
+ `target`,
433
+ `model_axis`, and `effort_axis` from resolver output and the actual launcher
434
+ payload after payload construction.
435
+ - Record `selection_reason` and `candidates_considered` beside those axes.
436
+ Allowed reasons are `native-catalog`, `native-catalog-unsatisfying`,
437
+ `pre-start-rejection`, `inherit`, and `gate-target`. Derive the values from
438
+ the shared selection decision and Dispatch Report; never reconstruct them
439
+ from a child self-report.
440
+ - Those fields are launcher-owned. Agent self-report cannot populate or
441
+ overwrite them; it may only be retained separately as optional diagnostics.
442
+ - Derive `Dispatch target` and `Effort axis` / `Model axis` from the payload.
443
+ - After the payload is built, append the compatibility stamp returned from
444
+ `formatDispatchStamp(dispatchReport)` to Dispatch Notes for every
445
+ implementation, fix, and review dispatch. The derived line retains the p01
446
+ grammar exactly:
447
+ `Dispatch: scope=<phase-or-task> action=<implementation|fix|review> role=<implementer|fix|reviewer> producer=<slug|unknown> provenance=<declared|observed|inferred|unknown> model_axis=<axis> effort_axis=<axis> dispatch_policy=<policy|unknown> dispatch_ceiling=<value|none> target=<target|unknown>`.
448
+ Populate the report from the completed resolver and actual host arguments.
449
+ Only independently observed or otherwise supported runtime evidence may
450
+ populate runtime producer identity. Codex materialized model+effort variants
451
+ retain selected model/effort controls while keeping runtime identity
452
+ not-reported unless evidence exists. Do not write prose-only, hand-built, or
453
+ legacy comma-separated stamp forms.
454
+
455
+ Human-facing dispatch display rules:
456
+
457
+ - Lead with route, OAT dispatch tier, requested controls, configured defaults, and runtime confirmation. These are the fields humans use to understand what OAT asked for and what the host appears to be running.
458
+ - Do not headline `producer=unknown` or `provenance=unknown`. Those values are
459
+ audit fields for the formal stamp, not the primary status. Put unknown
460
+ producer/provenance only in `Dispatch stamp:` or in a low-priority note after
461
+ the route and runtime confirmation.
462
+ - Separate requested controls from configured defaults. For example, a Codex
463
+ materialized role may request `model_axis=selected:<model>` and
464
+ `effort_axis=selected:<effort>` while the provider default effort remains a
465
+ separate fallback/default fact.
466
+ - Separate configured policy/cap from runtime confirmation. A resolver payload
467
+ can declare a target before the host has confirmed it; an observed mismatch
468
+ must be called out as `Runtime confirmation: mismatch:<detail>` and handled as
469
+ an orchestration deviation.
470
+ - Keep the `Dispatch stamp: Dispatch: ...` line parseable and grammar-stable.
471
+ Do not move display-only prose into the formal stamp.
472
+
473
+ Structured dispatch log:
474
+
475
+ ```text
476
+ OAT Dispatch: Phase {phase_id} {implementation | fix | review}
477
+ Host: {Claude Code | Codex | Cursor | other host}
478
+ Route: {route label or target path | none}; level={0 | 1 | ... | none}
479
+ Requested controls: {model=<value|none>, effort=<value|none>, target=<value|unknown>}
480
+ Configured defaults: {provider default effort/model | unknown | not-applicable}
481
+ Runtime confirmation: {observed:<slug> | declared:<slug> | not-observable | mismatch:<detail>}
482
+ Preferred effort: {low | medium | high | xhigh | max | provider-default | not-applicable}
483
+ OAT Dispatch Tier: {economy | balanced | high | frontier | uncapped | inherit host defaults | legacy capped}
484
+ Resolved cap: {resolved cap value | none}
485
+ Selected effort: {low | medium | high | xhigh | max | provider-default | not-applicable}
486
+ Policy source: {repo config | project state | preflight prompt}
487
+ Provider default effort: {value | unknown | not-applicable}
488
+ Selection mode: {capped | uncapped | review-target | no-review-target | inherit-default}
489
+ Route level: {0 | 1 | ... | none}
490
+ Model axis: { selected:<value> | inherited | not-applicable | host-auto }
491
+ Effort axis: { selected:<value> | provider-default | inherited | not-applicable | host-auto }
492
+ Dispatch target: {host-specific subagent/role/tool target}
493
+ Dispatch stamp: Dispatch: scope=<phase-or-task> action=<implementation|fix|review> role=<implementer|fix|reviewer> producer=<slug|unknown> provenance=<declared|observed|inferred|unknown> model_axis=<axis> effort_axis=<axis> dispatch_policy=<policy|unknown> dispatch_ceiling=<value|none> target=<target|unknown>
494
+ Rationale: {short rationale grounded in phase scope and any policy cap/uncapped/default behavior}
495
+ ```
496
+
497
+ Codex capped example:
498
+
499
+ ```text
500
+ OAT Dispatch: Phase p02 implementation
501
+ Host: Codex
502
+ Route: codex/implementer/gpt-5.6-sol/medium; level=0
503
+ Requested controls: model=gpt-5.6-sol, effort=medium, target=oat-phase-implementer-gpt-5-6-sol-medium
504
+ Configured defaults: provider default effort=high
505
+ Runtime confirmation: declared:gpt-5.6-sol/medium
506
+ Preferred effort: high
507
+ OAT Dispatch Tier: economy
508
+ Resolved cap: medium
509
+ Selected effort: medium
510
+ Policy source: repo config
511
+ Provider default effort: high
512
+ Selection mode: capped
513
+ Model axis: selected:gpt-5.6-sol
514
+ Effort axis: selected:medium
515
+ Dispatch target: oat-phase-implementer-gpt-5-6-sol-medium
516
+ Rationale: normal multi-file implementation; high preferred due to integration risk, capped by configured policy.
517
+ ```
518
+
519
+ Codex uncapped implementer example:
520
+
521
+ ```text
522
+ OAT Dispatch: Phase p02 implementation
523
+ Host: Codex
524
+ Route: codex/implementer/gpt-5.6-terra/xhigh; level=0
525
+ Requested controls: model=gpt-5.6-terra, effort=xhigh, target=oat-phase-implementer-gpt-5-6-terra-xhigh
526
+ Configured defaults: provider default effort=medium
527
+ Runtime confirmation: declared:gpt-5.6-terra/xhigh
528
+ Preferred effort: xhigh
529
+ OAT Dispatch Tier: uncapped
530
+ Resolved cap: none
531
+ Selected effort: xhigh
532
+ Policy source: project state
533
+ Provider default effort: medium
534
+ Selection mode: uncapped
535
+ Model axis: selected:gpt-5.6-terra
536
+ Effort axis: selected:xhigh
537
+ Dispatch target: oat-phase-implementer-gpt-5-6-terra-xhigh
538
+ Rationale: high-risk phase; managed uncapped policy allows the preferred pinned variant. Actual host support for upward effort selection must be verified by the dispatching host.
539
+ ```
540
+
541
+ Codex capped reviewer example:
542
+
543
+ ```text
544
+ OAT Dispatch: Phase p02 review
545
+ Host: Codex
546
+ Route: codex/reviewer/gpt-5.6-terra/xhigh; level=0
547
+ Requested controls: model=gpt-5.6-terra, effort=xhigh, target=oat-reviewer-gpt-5-6-terra-xhigh
548
+ Configured defaults: provider default effort=medium
549
+ Runtime confirmation: declared:gpt-5.6-terra/xhigh
550
+ Preferred effort: high
551
+ OAT Dispatch Tier: high
552
+ Resolved cap: xhigh
553
+ Selected effort: xhigh
554
+ Policy source: project state
555
+ Provider default effort: medium
556
+ Selection mode: review-target
557
+ Model axis: selected:gpt-5.6-terra
558
+ Effort axis: selected:xhigh
559
+ Dispatch target: oat-reviewer-gpt-5-6-terra-xhigh
560
+ Rationale: reviewer runs at the configured policy cap for deterministic quality gate behavior.
561
+ ```
562
+
563
+ Codex inherit/default fallback example:
564
+
565
+ ```text
566
+ OAT Dispatch: Phase p02 review
567
+ Host: Codex
568
+ Route: none; level=none
569
+ Requested controls: model=none, effort=provider-default, target=oat-reviewer
570
+ Configured defaults: provider default effort=medium
571
+ Runtime confirmation: not-observable
572
+ Preferred effort: provider-default
573
+ OAT Dispatch Tier: inherit host defaults
574
+ Resolved cap: none
575
+ Selected effort: provider-default
576
+ Policy source: project state
577
+ Provider default effort: medium
578
+ Selection mode: inherit-default
579
+ Model axis: inherited
580
+ Effort axis: provider-default
581
+ Dispatch target: oat-reviewer
582
+ Rationale: explicit inherit/default policy; base unpinned role follows Codex provider default.
583
+ ```
584
+
585
+ Generic sidecar/explorer dispatch:
586
+
587
+ - Built-in or generic sidecars such as `explorer` are not OAT-managed implementer, reviewer, or fix roles.
588
+ - If a sidecar spawn payload does not explicitly pin a reliable effort/model control, log `Preferred effort: provider-default`, `Selected effort: provider-default`, and `Effort axis: provider-default`.
589
+ - Do not classify a generic sidecar as `Preferred effort: low|medium|high|xhigh|max` unless the actual host invocation contains the corresponding reliable selection. If the host has no reliable effort control for that sidecar, use provider-default wording instead.
590
+ - Sidecar outputs are advisory context only. Implementation work and review/fix gates still follow the OAT-managed dispatch rules above.
591
+
592
+ Codex generic explorer example:
593
+
594
+ ```text
595
+ OAT Dispatch: p02-t10 sidecar exploration
596
+ Host: Codex
597
+ Route: sidecar/explorer; level=none
598
+ Requested controls: model=none, effort=provider-default, target=explorer
599
+ Configured defaults: provider default effort=xhigh
600
+ Runtime confirmation: not-observable
601
+ Preferred effort: provider-default
602
+ OAT Dispatch Tier: high
603
+ Resolved cap: xhigh
604
+ Selected effort: provider-default
605
+ Policy source: project state
606
+ Provider default effort: xhigh
607
+ Model axis: inherited
608
+ Effort axis: provider-default
609
+ Dispatch target: explorer
610
+ Rationale: read-only sidecar exploration; generic explorer payload does not pin an OAT-managed effort variant.
611
+ ```
612
+
613
+ Include resolved dispatch context in scope packets when known:
614
+
615
+ ```yaml
616
+ model_axis: { selected:<value> | inherited | not-applicable | host-auto }
617
+ effort_axis:
618
+ {
619
+ selected:<value> | provider-default | inherited | not-applicable | host-auto,
620
+ }
621
+ dispatch_ceiling: { resolved ceiling value }
622
+ dispatch_policy:
623
+ {
624
+ economy | balanced | high | frontier | uncapped | inherit host defaults | legacy capped,
625
+ }
626
+ ceiling_source: { repo config | project state | preflight prompt }
627
+ policy_source: { repo config | project state | preflight prompt }
628
+ provider_default_effort: { value | unknown | not-applicable }
629
+ dispatch_route_level:
630
+ { integer route level; omit when no ordered route is in play }
631
+ dispatch_target:
632
+ { resolver target or host-specific dispatch target; omit if unknown }
633
+ dispatch_stamp: { exact `Dispatch: ...` line written to Dispatch Notes }
634
+ dispatch_rationale: { short rationale }
635
+ ```
636
+
637
+ ### Dispatch Policy Enforcement Log
638
+
639
+ After each phase dispatch (implementation, fix, or review), append one enforcement
640
+ log line. The log reflects the `mode` and `mechanism` returned by
641
+ `oat project dispatch-ceiling resolve` — do not compute these yourself.
642
+
643
+ **Three-state log format:**
644
+
645
+ ```text
646
+ Dispatch policy: {policy}; selected={selected value | none}; cap={value | none} ({provider}, {mode} — {mechanism detail})
647
+ ```
648
+
649
+ **Log examples (matching resolver output):**
650
+
651
+ ```text
652
+ Dispatch policy: balanced; selected=xhigh; cap=xhigh (codex, enforced — variant oat-phase-implementer-gpt-5-6-terra-xhigh)
653
+ Dispatch policy: high; selected=high; cap=high (codex, enforced — variant oat-reviewer-gpt-5-6-sol-high)
654
+ Dispatch policy: frontier; selected=max; cap=max (codex, enforced — variant oat-reviewer-gpt-5-6-sol-max)
655
+ Dispatch policy: uncapped; selected=xhigh; cap=none (codex, enforced — variant oat-phase-implementer-gpt-5-6-terra-xhigh)
656
+ Dispatch policy: inherit host defaults; selected=none; cap=none (codex, advisory — base role follows provider default)
657
+ Dispatch policy: balanced; selected=sonnet; cap=sonnet (claude, enforced — Task model arg)
658
+ Dispatch policy: frontier; selected=fable; cap=fable (claude, enforced — Task model arg)
659
+ Cursor opaque model-string example: Dispatch policy: frontier; selected=gpt-5.6-sol-max; cap=gpt-5.6-sol-max (cursor, enforced — model arg gpt-5.6-sol-max)
660
+ Dispatch policy: unresolved; selected=none; cap=none (codex, advisory — policy set but no value resolved)
661
+ ```
662
+
663
+ **Verify-on-upgrade (`verifyOnDispatch: true`):**
664
+
665
+ When the resolver returns `providers.<provider>.verifyOnDispatch: true`, the
666
+ requested tier is above the orchestrator tier (an upgrade request). Before
667
+ logging `enforced`, confirm the actual model/tier used by the dispatched agent.
668
+ If the provider honored the request, log `enforced`. If it did not:
669
+
670
+ ```text
671
+ Dispatch policy: high; selected=opus; cap=opus (claude, advisory — provider did not honor upgrade; ran sonnet)
672
+ ```
673
+
674
+ **`enforced`** — the adapter compiled concrete dispatch args and the provider
675
+ accepted them. Log value + provider + mechanism detail (variant name or "Task
676
+ model arg").
677
+
678
+ **`advisory`** — the adapter supports the policy but no concrete value resolved,
679
+ the policy intentionally inherits provider defaults, or the provider is known
680
+ but could not be verified. Log with note "policy set but no value resolved",
681
+ "base role follows provider default", or "provider did not honor upgrade; ran
682
+ \<tier\>".
683
+
684
+ **`unsupported`** — the provider has no registered adapter. Log with note "no
685
+ adapter; informational". Never block on unsupported — dispatch follows provider
686
+ defaults.
687
+
688
+ ### Dry-Run Mode
689
+
690
+ When the skill is invoked with `--dry-run`:
691
+
692
+ 1. Perform Steps 0–2 fully (resolve project, capability detection, read plan, validate metadata, build schedule).
693
+ 2. Skip all phase dispatches, merges, and artifact writes.
694
+ 3. Output the execution plan:
695
+
696
+ ```
697
+ OAT ▸ IMPLEMENT (dry-run)
698
+
699
+ Project: {PROJECT_PATH}
700
+ Tier: {1 | 2}
701
+ Retry: {N}
702
+
703
+ Schedule:
704
+ [1] p01 (sequential)
705
+ [2] p02, p03 (parallel group, worktrees)
706
+ [3] p04 (sequential)
707
+
708
+ Worktrees that would be created:
709
+ - {project-name}/p02
710
+ - {project-name}/p03
711
+
712
+ No commits, no artifact writes.
713
+ ```
714
+
715
+ 4. Exit without modifying any files.