@open-agent-toolkit/cli 0.1.55 → 0.1.60

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