@open-agent-toolkit/cli 0.1.45 → 0.1.48

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 (112) hide show
  1. package/assets/agents/oat-phase-implementer.md +202 -191
  2. package/assets/agents/oat-reviewer.md +12 -2
  3. package/assets/config/dispatch-matrix-recommendation.json +120 -13
  4. package/assets/docs/cli-utilities/config-and-local-state.md +7 -0
  5. package/assets/docs/cli-utilities/configuration.md +183 -84
  6. package/assets/docs/cli-utilities/workflow-gates.md +161 -27
  7. package/assets/docs/contributing/skills.md +14 -8
  8. package/assets/docs/provider-sync/config.md +5 -1
  9. package/assets/docs/provider-sync/manifest-and-drift.md +6 -1
  10. package/assets/docs/provider-sync/providers.md +42 -5
  11. package/assets/docs/provider-sync/scope-and-surface.md +3 -2
  12. package/assets/docs/reference/cli-reference.md +3 -1
  13. package/assets/docs/reference/oat-directory-structure.md +27 -26
  14. package/assets/docs/workflows/projects/artifacts.md +31 -1
  15. package/assets/docs/workflows/projects/dispatch-ceiling.md +235 -174
  16. package/assets/docs/workflows/projects/implementation-execution.md +283 -253
  17. package/assets/docs/workflows/projects/lifecycle.md +26 -5
  18. package/assets/docs/workflows/projects/reviews.md +27 -2
  19. package/assets/migration/pjm-restructure.md +1 -1
  20. package/assets/public-package-versions.json +4 -4
  21. package/assets/skills/oat-project-implement/SKILL.md +347 -178
  22. package/assets/skills/oat-project-import-plan/SKILL.md +173 -16
  23. package/assets/skills/oat-project-next/SKILL.md +2 -2
  24. package/assets/skills/oat-project-plan/SKILL.md +122 -92
  25. package/assets/skills/oat-project-plan-writing/SKILL.md +246 -15
  26. package/assets/skills/oat-project-quick-start/SKILL.md +156 -94
  27. package/assets/skills/oat-project-review-provide/SKILL.md +94 -22
  28. package/dist/commands/config/index.d.ts +2 -2
  29. package/dist/commands/config/index.d.ts.map +1 -1
  30. package/dist/commands/config/index.js +129 -53
  31. package/dist/commands/doctor/index.d.ts +2 -2
  32. package/dist/commands/doctor/index.d.ts.map +1 -1
  33. package/dist/commands/doctor/index.js +102 -31
  34. package/dist/commands/gate/index.d.ts +7 -1
  35. package/dist/commands/gate/index.d.ts.map +1 -1
  36. package/dist/commands/gate/index.js +544 -67
  37. package/dist/commands/gate/review-verdict.d.ts +16 -0
  38. package/dist/commands/gate/review-verdict.d.ts.map +1 -1
  39. package/dist/commands/gate/review-verdict.js +72 -9
  40. package/dist/commands/project/dispatch-ceiling/index.d.ts.map +1 -1
  41. package/dist/commands/project/dispatch-ceiling/index.js +586 -23
  42. package/dist/commands/providers/codex/index.d.ts +4 -0
  43. package/dist/commands/providers/codex/index.d.ts.map +1 -0
  44. package/dist/commands/providers/codex/index.js +7 -0
  45. package/dist/commands/providers/codex/materialize.d.ts +5 -0
  46. package/dist/commands/providers/codex/materialize.d.ts.map +1 -0
  47. package/dist/commands/providers/codex/materialize.js +157 -0
  48. package/dist/commands/providers/index.d.ts +2 -2
  49. package/dist/commands/providers/index.d.ts.map +1 -1
  50. package/dist/commands/providers/index.js +4 -2
  51. package/dist/commands/providers/providers.types.d.ts +23 -0
  52. package/dist/commands/providers/providers.types.d.ts.map +1 -1
  53. package/dist/commands/shared/codex-strays.d.ts.map +1 -1
  54. package/dist/commands/shared/codex-strays.js +11 -1
  55. package/dist/commands/shared/frontmatter.d.ts +4 -0
  56. package/dist/commands/shared/frontmatter.d.ts.map +1 -1
  57. package/dist/commands/shared/frontmatter.js +23 -0
  58. package/dist/commands/status/index.d.ts +5 -1
  59. package/dist/commands/status/index.d.ts.map +1 -1
  60. package/dist/commands/status/index.js +10 -4
  61. package/dist/commands/sync/index.d.ts.map +1 -1
  62. package/dist/commands/sync/index.js +10 -3
  63. package/dist/commands/sync/sync.types.d.ts +5 -1
  64. package/dist/commands/sync/sync.types.d.ts.map +1 -1
  65. package/dist/config/dispatch-ceiling-preset.d.ts +4 -0
  66. package/dist/config/dispatch-ceiling-preset.d.ts.map +1 -1
  67. package/dist/config/dispatch-ceiling-preset.js +3 -0
  68. package/dist/config/dispatch-policy-options.d.ts +20 -0
  69. package/dist/config/dispatch-policy-options.d.ts.map +1 -0
  70. package/dist/config/dispatch-policy-options.js +96 -0
  71. package/dist/config/oat-config.d.ts +25 -2
  72. package/dist/config/oat-config.d.ts.map +1 -1
  73. package/dist/config/oat-config.js +154 -24
  74. package/dist/config/resolve.d.ts +8 -0
  75. package/dist/config/resolve.d.ts.map +1 -1
  76. package/dist/config/resolve.js +66 -2
  77. package/dist/engine/index.d.ts +1 -1
  78. package/dist/engine/index.d.ts.map +1 -1
  79. package/dist/engine/index.js +1 -1
  80. package/dist/engine/scanner.d.ts +1 -0
  81. package/dist/engine/scanner.d.ts.map +1 -1
  82. package/dist/engine/scanner.js +17 -1
  83. package/dist/fs/paths.d.ts +4 -0
  84. package/dist/fs/paths.d.ts.map +1 -1
  85. package/dist/fs/paths.js +18 -1
  86. package/dist/providers/ceiling/registry.d.ts +8 -5
  87. package/dist/providers/ceiling/registry.d.ts.map +1 -1
  88. package/dist/providers/ceiling/registry.js +25 -7
  89. package/dist/providers/codex/codec/catalog.d.ts +14 -0
  90. package/dist/providers/codex/codec/catalog.d.ts.map +1 -0
  91. package/dist/providers/codex/codec/catalog.js +21 -0
  92. package/dist/providers/codex/codec/config-merge.d.ts +6 -0
  93. package/dist/providers/codex/codec/config-merge.d.ts.map +1 -1
  94. package/dist/providers/codex/codec/config-merge.js +7 -0
  95. package/dist/providers/codex/codec/materialize.d.ts +16 -0
  96. package/dist/providers/codex/codec/materialize.d.ts.map +1 -0
  97. package/dist/providers/codex/codec/materialize.js +58 -0
  98. package/dist/providers/codex/codec/shared.d.ts +20 -0
  99. package/dist/providers/codex/codec/shared.d.ts.map +1 -1
  100. package/dist/providers/codex/codec/shared.js +107 -6
  101. package/dist/providers/codex/codec/sync-extension.d.ts +7 -1
  102. package/dist/providers/codex/codec/sync-extension.d.ts.map +1 -1
  103. package/dist/providers/codex/codec/sync-extension.js +299 -52
  104. package/dist/providers/identity/availability.d.ts +24 -1
  105. package/dist/providers/identity/availability.d.ts.map +1 -1
  106. package/dist/providers/identity/availability.js +253 -19
  107. package/dist/providers/identity/stamp.d.ts.map +1 -1
  108. package/dist/providers/identity/stamp.js +4 -0
  109. package/dist/shared/types.d.ts +1 -0
  110. package/dist/shared/types.d.ts.map +1 -1
  111. package/dist/shared/types.js +4 -0
  112. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: oat-project-implement
3
- version: 2.0.28
4
- description: Use when plan.md is ready for execution. Dispatches phase-level subagents with bounded fix loops; supports plan-declared parallel phase groups with worktree-isolated execution and ordered fan-in.
3
+ version: 2.0.33
4
+ description: Use when plan.md is ready for execution. Dispatches phase coordinators that select one exact target-pinned worker per task; supports bounded fix loops and plan-declared worktree-isolated parallel phases.
5
5
  oat_gateable: true
6
6
  argument-hint: '[--retry-limit <N>] [--dry-run]'
7
7
  disable-model-invocation: true
@@ -104,6 +104,23 @@ PROJECTS_ROOT="${PROJECTS_ROOT%/}"
104
104
 
105
105
  ### Step 0.5: Capability Detection and Tier Selection
106
106
 
107
+ **Mandatory target-first order:** Complete Dispatch Policy Preflight and resolve
108
+ the concrete managed Codex target before probing generic agent availability or
109
+ locking Tier 1/Tier 2. A concrete target takes precedence over tier selection:
110
+ use the exact registered role, or an explicitly pinned fresh Codex child when
111
+ that role is unavailable. If neither route is possible, inline execution is
112
+ allowed only with verified equivalent current-host model and effort controls;
113
+ otherwise block before work starts. Explicit inherit/default and documented
114
+ managed-uncapped reviewer behavior remain the only base-role exceptions.
115
+
116
+ When a concrete managed Codex role is unavailable or the host cannot select
117
+ it, launch a fresh Codex child pinned to the resolver-returned model and effort
118
+ with canonical role instructions. If that fresh child cannot be launched, fail
119
+ closed and block; never substitute the coordinator or base role.
120
+
121
+ Use base `oat-phase-implementer` only for the allowed exceptions above:
122
+ explicit inherit/default behavior. It is never a managed task-worker fallback.
123
+
107
124
  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).
108
125
 
109
126
  Detection logic:
@@ -124,7 +141,10 @@ Detection logic:
124
141
  - Approved → Tier 1.
125
142
  - Declined → Tier 2.
126
143
 
127
- - If the host does not resolve either agent Tier 2.
144
+ - If the host does not resolve either generic agent, first attempt the exact
145
+ registered role or explicitly pinned fresh-child route for any concrete
146
+ managed target. Select Tier 2 only when inline execution is allowed by the
147
+ target-first rule above.
128
148
 
129
149
  **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.
130
150
 
@@ -147,7 +167,7 @@ Do not print `[0/N]` for this preflight step. The implementation denominator is
147
167
 
148
168
  **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.
149
169
 
150
- **Tier is locked for the remainder of the run.** Subsequent phase implementation and review dispatches use the same tier. No mid-run re-evaluation or downgrade unless the user explicitly asks to change execution mode.
170
+ **Tier is locked for the remainder of the run only after the dispatch target is resolved.** Subsequent coordinator, task-worker, fix, and review dispatches use the same tier. Tier controls mechanics only: every managed task worker still resolves its own exact target beneath the recorded project or phase named maximum. No mid-run downgrade is allowed.
151
171
 
152
172
  **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.
153
173
 
@@ -209,7 +229,9 @@ Resolution order:
209
229
  "value": "high",
210
230
  "mode": "enforced",
211
231
  "mechanism": "pinned-variant",
212
- "dispatchArgs": { "variant": "oat-phase-implementer-high" },
232
+ "dispatchArgs": {
233
+ "variant": "oat-phase-implementer-gpt-5-6-terra-high"
234
+ },
213
235
  "verifyOnDispatch": false,
214
236
  "selection": {
215
237
  "role": "implementer",
@@ -236,50 +258,61 @@ point.
236
258
  Print before phase work:
237
259
 
238
260
  ```text
239
- Dispatch policy: balanced (codex, managed capped — pinned-variant)
261
+ OAT Dispatch Tier: balanced (codex, managed capped — pinned-variant)
240
262
  Resolved cap: high
241
263
  Source: project state
242
264
  Provider default effort: medium
243
- Note: OAT will use pinned subagent variants up to high. Base/unpinned roles resolve through the provider default only on fallback paths.
265
+ 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.
244
266
  ```
245
267
 
246
268
  If no policy resolves and the session is interactive, present the dispatch
247
269
  policy prompt once before starting work:
248
270
 
249
- ```text
250
- No dispatch policy is configured for this project.
271
+ Print the unresolved-policy heading, then generate the choice text from
272
+ canonical CLI metadata immediately before presenting it:
251
273
 
252
- Set the dispatch policy — how OAT should choose subagent model/effort controls.
274
+ ```bash
275
+ oat project dispatch-ceiling choices --format markdown
276
+ ```
253
277
 
254
- Managed capped policies:
255
- 1. Economy — Codex: medium · Claude: sonnet
256
- 2. Balanced — Codex: high · Claude: sonnet (recommended)
257
- 3. High — Codex: xhigh · Claude: opus
258
- 4. Frontier — Codex: xhigh · Claude: fable
278
+ Do not hand-type the dispatch policy menu or omit canonical choices. If the CLI
279
+ is unavailable in this environment, derive the same labels and descriptions from
280
+ `packages/cli/src/config/dispatch-policy-options.ts`; include every managed
281
+ policy returned by `VALID_MANAGED_DISPATCH_POLICIES` plus `Uncapped`, `Inherit
282
+ Host Defaults`, and `Leave Unresolved`.
259
283
 
260
- Managed uncapped:
261
- 5. Uncapped — OAT selects the preferred implementer/fix target without a stored maximum cap.
284
+ At minimum, preserve these semantics in any fallback text:
262
285
 
263
- Host defaults:
264
- 6. Inherit Host Defaults OAT does not select model/effort controls.
286
+ - `Uncapped`: OAT still manages dispatch selection, but stores no maximum cap.
287
+ It is not host/default behavior and must not be represented by absent policy
288
+ state.
289
+ - `Inherit Host Defaults`: OAT does not choose model or effort controls; the
290
+ executing host/provider owns implementation, fix, and review defaults.
291
+ - `Leave Unresolved`: planning/preflight deferral only. It records no runtime
292
+ policy and is not a runnable implementation setting. Implementation preflight
293
+ must block until a policy resolves.
265
294
 
266
295
  OAT applies managed policies where the provider exposes a reliable mechanism
267
296
  (Codex: pinned variants; Claude: Task model parameter). Other providers may
268
297
  treat managed policies as advisory.
269
- ```
270
298
 
271
- **Managed capped policy selection (options 1-4)** persists `mode: managed`,
272
- `policy`, and the compiled provider targets. On selection, print the exact
273
- compiled result (e.g., "Dispatch policy set: balanced -> Codex: high · Claude:
274
- sonnet") before proceeding.
299
+ **Managed capped policy selection** persists only `mode: managed`, the named
300
+ maximum `policy`, and `source`. The named maximum leaves lower configured
301
+ candidates eligible; do not copy compiled provider/model targets into project
302
+ state. On selection, print the named maximum before proceeding.
303
+
304
+ **Uncapped** persists explicit managed uncapped state. OAT still manages
305
+ dispatch selection. It does not write provider caps, and it must not be
306
+ represented by leaving dispatch policy state absent.
275
307
 
276
- **Uncapped (option 5)** persists explicit managed uncapped state. It does not
277
- write provider caps, and it must not be represented by leaving dispatch policy
278
- state absent.
308
+ **Inherit Host Defaults** persists explicit inherit/default state. Use this only
309
+ when the user wants OAT to leave implementation, fix, and review model/effort
310
+ controls to the executing host/provider. OAT does not choose model or effort in
311
+ this mode.
279
312
 
280
- **Inherit Host Defaults (option 6)** persists explicit inherit/default state.
281
- Use this only when the user wants OAT to leave implementation, fix, and review
282
- model/effort controls to the executing host/provider.
313
+ **Leave Unresolved** records no runtime policy for implementation. Stop before
314
+ phase work and report the unresolved state; Implementation preflight must block
315
+ until a policy resolves.
283
316
 
284
317
  Persist in project `state.md` frontmatter using the normalized shape:
285
318
 
@@ -287,9 +320,6 @@ Persist in project `state.md` frontmatter using the normalized shape:
287
320
  oat_dispatch_policy:
288
321
  mode: managed
289
322
  policy: balanced
290
- providers:
291
- codex: high
292
- claude: sonnet
293
323
  source: project-state
294
324
  ```
295
325
 
@@ -328,15 +358,17 @@ modifying project state.
328
358
 
329
359
  ### Runtime dispatch selection
330
360
 
331
- Before each phase implementation, fix, or review dispatch, choose and log the
332
- runtime dispatch controls. This is separate from Tier 1/Tier 2 execution mode:
333
- Tier 1/Tier 2 decides whether OAT uses subagents or inline fallback; runtime
334
- dispatch selection decides model/effort controls for the specific work.
361
+ Before coordinator bootstrap and before each task-worker, fix, or review
362
+ dispatch, choose and log runtime controls. Resolve these controls before
363
+ applying Tier 1/Tier 2 mechanics. A coordinator target never becomes a task
364
+ target: managed tasks use an exact resolver candidate beneath the recorded
365
+ project or phase named ceiling. Inline execution must preserve equivalent
366
+ controls or use a documented exception.
335
367
 
336
368
  Use these inputs:
337
369
 
338
370
  - resolved dispatch policy, source, and provider-specific selection
339
- - phase ID and phase scope
371
+ - phase ID and the current bounded task scope
340
372
  - optional `## Dispatch Profile` row in `plan.md`
341
373
  - host-exposed provider controls, by axis
342
374
  - prior outcomes for the phase, including review results and failed retries
@@ -368,21 +400,34 @@ Axis states:
368
400
 
369
401
  Codex rules:
370
402
 
371
- 1. Codex effort order is `low < medium < high < xhigh`.
403
+ **Managed Codex execution invariant:** When the resolver returns a model+effort
404
+ target, prefer the exact registered role or variant from
405
+ `providers.codex.dispatchArgs.variant`. If the current host cannot select that
406
+ exact registered target, launch a fresh Codex child with the resolver target's
407
+ explicit model, reasoning effort, and canonical role instructions from
408
+ `.agents/agents/oat-phase-implementer.md` or
409
+ `.agents/agents/oat-reviewer.md`. Workflow correctness must not require provider
410
+ restart or hot reload. A managed base role is forbidden when a concrete target
411
+ was requested; never silently downgrade to it. Base roles remain valid only for
412
+ explicit inherit/default behavior and the documented managed-uncapped reviewer
413
+ fallback.
414
+
415
+ 1. Codex effort order is `low < medium < high < xhigh < max`.
372
416
  2. Classify preferred effort from scope:
373
417
  - `low`: trivial docs-only, narrow single-file, or mechanical changes
374
418
  - `medium`: normal multi-file implementation and moderate integration risk
375
419
  - `high`: broad architecture, security/auth/redaction boundaries, subtle state behavior, or repeated substantive review failures
376
420
  - `xhigh`: highest-risk work that requires a capped policy to allow xhigh or a managed `Uncapped` policy to select it
421
+ - `max`: exceptional frontier work whose risk or cross-cutting scope justifies the first-class maximum reasoning control
377
422
  3. For capped managed implementer/fix work, selected effort is `min(preferred, resolved_cap)`.
378
423
  4. For managed `Uncapped` implementer/fix work, selected effort is the preferred effort with no cap.
379
424
  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.
380
- 6. For implementer/fix dispatch: call `oat project dispatch-ceiling resolve --provider codex --role implementer --preferred <preferred-effort> --escalation-level <route-level>`; read `providers.codex.selection.selectedValue`, `providers.codex.dispatchArgs.variant`, and any `providers.codex.target` for the selected role name or route target. Never pass a cap-only implementer variant when `selection.selectedValue` is lower.
381
- 7. For review dispatch: call `oat project dispatch-ceiling resolve --provider codex --role reviewer`; read `providers.codex.dispatchArgs.variant`.
425
+ 6. For managed capped task-worker/fix dispatch, choose an exact configured candidate and call `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> --json`. Read `providers.codex.dispatchArgs.variant` and `providers.codex.selection.target`; never reuse the coordinator role or a cap-only variant. `--preferred` remains compatibility behavior outside the exact task-worker path.
426
+ 7. For review dispatch: call `oat project dispatch-ceiling resolve --provider codex --role reviewer`; read `providers.codex.dispatchArgs.variant` and `providers.codex.selection.target`.
382
427
  - Capped managed policy: reviewer targets the configured cap for deterministic quality gate behavior.
383
428
  - Managed `Uncapped`: no reviewer target exists; use base/unpinned reviewer fallback and log `selectionMode=no-review-target`, `selectedValue=null`, and `effort_axis=provider-default`.
384
429
  - Inherit/default: no reviewer target exists; use base/unpinned reviewer fallback and log `selectionMode=inherit-default`, `selectedValue=null`, and `effort_axis=provider-default`.
385
- 8. Codex payload-first assertion applies only when the resolver returns a pinned variant. If `effort_axis=selected:<value>`, the actual `spawn_agent` payload MUST use the matching pinned `agent_type`. If the resolver returns no variant, use the base role and log provider-default.
430
+ 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 use it as `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. If a concrete managed target has no usable 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.
386
431
  9. Do not use top-level per-call `reasoning_effort` as the standard OAT selected-effort path; dogfooding showed that path can be inconsistent.
387
432
 
388
433
  Claude rules:
@@ -395,10 +440,21 @@ Claude rules:
395
440
  - Review dispatch:
396
441
  - Capped managed policy: target the configured policy cap directly.
397
442
  - Managed `Uncapped` or inherit/default: no reviewer target exists; omit `model` and log inherited/default model behavior.
398
- - For implementer/fix dispatch, call `oat project dispatch-ceiling resolve --provider claude --role implementer --preferred <preferred-model> --orchestrator-tier <current-orchestrator-tier> --escalation-level <route-level>`; for review dispatch, call the same resolver with `--role reviewer` and no `--preferred`. Read `providers.claude.selection.selectedValue`, `providers.claude.dispatchArgs.model`, and any `providers.claude.target` for the selected model string or route target. Pass `--orchestrator-tier` so the resolver can flag above-orchestrator upgrade requests and set `verifyOnDispatch` correctly.
443
+ - For managed capped task-worker/fix dispatch, call `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> --json`; for review dispatch, call the resolver with `--role reviewer` and no candidate flags. Read `providers.claude.dispatchArgs.model` and pass it exactly on the actual Task invocation.
399
444
  - Pass `model: "<value>"` when `model_axis=selected:<value>` on the Task tool call.
400
445
  - Keep `effort_axis=not-applicable`; Claude Code has no separate per-dispatch effort axis.
401
446
 
447
+ Cursor rules:
448
+
449
+ - Treat every configured Cursor candidate string as opaque. Do not normalize it
450
+ or infer capability from its spelling.
451
+ - For managed capped task-worker/fix dispatch, call the resolver with
452
+ `--provider cursor --role implementer --ceiling-tier
453
+ <project-or-phase-tier> --candidate-model <opaque-model> --json`.
454
+ - Require `providers.cursor.dispatchArgs.model` and pass that exact byte-for-byte
455
+ string as the actual Cursor invocation model. If the host cannot apply it,
456
+ fail closed.
457
+
402
458
  Payload-first invariant:
403
459
 
404
460
  - Build the actual host dispatch argument map before logging.
@@ -410,23 +466,45 @@ Payload-first invariant:
410
466
  `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>`.
411
467
  Derive `producer` and `provenance` from the resolver payload and actual host
412
468
  arguments. Only concrete model arguments, including same-harness route model
413
- args for model-arg providers, declare producer identity. Codex pinned
414
- variants declare the effort axis only; record `effort_axis=selected:<value>`
415
- and keep `producer=unknown provenance=unknown` unless an observed/inferred
416
- model identity is available. Base/unpinned or deferred cross-harness paths are
417
- also `producer=unknown provenance=unknown` unless an observed/inferred
418
- identity is available. Do not write prose-only or legacy comma-separated stamp
419
- forms.
469
+ args for model-arg providers, declare producer identity. Codex materialized
470
+ model+effort variants declare `model_axis=selected:<model>` and
471
+ `effort_axis=selected:<effort>` from resolver output, but keep
472
+ `producer=unknown provenance=unknown` unless an observed/inferred model
473
+ identity is available. Base/unpinned or deferred cross-harness paths are also
474
+ `producer=unknown provenance=unknown` unless an observed/inferred identity is
475
+ available. Do not write prose-only or legacy comma-separated stamp forms.
476
+
477
+ Human-facing dispatch display rules:
478
+
479
+ - 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.
480
+ - Do not headline `producer=unknown` or `provenance=unknown`. Those values are
481
+ audit fields for the formal stamp, not the primary status. Put unknown
482
+ producer/provenance only in `Dispatch stamp:` or in a low-priority note after
483
+ the route and runtime confirmation.
484
+ - Separate requested controls from configured defaults. For example, a Codex
485
+ materialized role may request `model_axis=selected:<model>` and
486
+ `effort_axis=selected:<effort>` while the provider default effort remains a
487
+ separate fallback/default fact.
488
+ - Separate configured policy/cap from runtime confirmation. A resolver payload
489
+ can declare a target before the host has confirmed it; an observed mismatch
490
+ must be called out as `Runtime confirmation: mismatch:<detail>` and handled as
491
+ an orchestration deviation.
492
+ - Keep the `Dispatch stamp: Dispatch: ...` line parseable and grammar-stable.
493
+ Do not move display-only prose into the formal stamp.
420
494
 
421
495
  Structured dispatch log:
422
496
 
423
497
  ```text
424
498
  OAT Dispatch: Phase {phase_id} {implementation | fix | review}
425
499
  Host: {Claude Code | Codex | Cursor | other host}
426
- Preferred effort: {low | medium | high | xhigh | provider-default | not-applicable}
427
- Dispatch policy: {economy | balanced | high | frontier | uncapped | inherit host defaults | legacy capped}
500
+ Route: {route label or target path | none}; level={0 | 1 | ... | none}
501
+ Requested controls: {model=<value|none>, effort=<value|none>, target=<value|unknown>}
502
+ Configured defaults: {provider default effort/model | unknown | not-applicable}
503
+ Runtime confirmation: {observed:<slug> | declared:<slug> | not-observable | mismatch:<detail>}
504
+ Preferred effort: {low | medium | high | xhigh | max | provider-default | not-applicable}
505
+ OAT Dispatch Tier: {economy | balanced | high | frontier | uncapped | inherit host defaults | legacy capped}
428
506
  Resolved cap: {resolved cap value | none}
429
- Selected effort: {low | medium | high | xhigh | provider-default | not-applicable}
507
+ Selected effort: {low | medium | high | xhigh | max | provider-default | not-applicable}
430
508
  Policy source: {repo config | project state | preflight prompt}
431
509
  Provider default effort: {value | unknown | not-applicable}
432
510
  Selection mode: {capped | uncapped | review-target | no-review-target | inherit-default}
@@ -443,16 +521,20 @@ Codex capped example:
443
521
  ```text
444
522
  OAT Dispatch: Phase p02 implementation
445
523
  Host: Codex
524
+ Route: codex/implementer/gpt-5.6-sol/medium; level=0
525
+ Requested controls: model=gpt-5.6-sol, effort=medium, target=oat-phase-implementer-gpt-5-6-sol-medium
526
+ Configured defaults: provider default effort=high
527
+ Runtime confirmation: declared:gpt-5.6-sol/medium
446
528
  Preferred effort: high
447
- Dispatch policy: economy
529
+ OAT Dispatch Tier: economy
448
530
  Resolved cap: medium
449
531
  Selected effort: medium
450
532
  Policy source: repo config
451
533
  Provider default effort: high
452
534
  Selection mode: capped
453
- Model axis: inherited
535
+ Model axis: selected:gpt-5.6-sol
454
536
  Effort axis: selected:medium
455
- Dispatch target: oat-phase-implementer-medium
537
+ Dispatch target: oat-phase-implementer-gpt-5-6-sol-medium
456
538
  Rationale: normal multi-file implementation; high preferred due to integration risk, capped by configured policy.
457
539
  ```
458
540
 
@@ -461,16 +543,20 @@ Codex uncapped implementer example:
461
543
  ```text
462
544
  OAT Dispatch: Phase p02 implementation
463
545
  Host: Codex
546
+ Route: codex/implementer/gpt-5.6-terra/xhigh; level=0
547
+ Requested controls: model=gpt-5.6-terra, effort=xhigh, target=oat-phase-implementer-gpt-5-6-terra-xhigh
548
+ Configured defaults: provider default effort=medium
549
+ Runtime confirmation: declared:gpt-5.6-terra/xhigh
464
550
  Preferred effort: xhigh
465
- Dispatch policy: uncapped
551
+ OAT Dispatch Tier: uncapped
466
552
  Resolved cap: none
467
553
  Selected effort: xhigh
468
554
  Policy source: project state
469
555
  Provider default effort: medium
470
556
  Selection mode: uncapped
471
- Model axis: inherited
557
+ Model axis: selected:gpt-5.6-terra
472
558
  Effort axis: selected:xhigh
473
- Dispatch target: oat-phase-implementer-xhigh
559
+ Dispatch target: oat-phase-implementer-gpt-5-6-terra-xhigh
474
560
  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.
475
561
  ```
476
562
 
@@ -479,16 +565,20 @@ Codex capped reviewer example:
479
565
  ```text
480
566
  OAT Dispatch: Phase p02 review
481
567
  Host: Codex
568
+ Route: codex/reviewer/gpt-5.6-terra/xhigh; level=0
569
+ Requested controls: model=gpt-5.6-terra, effort=xhigh, target=oat-reviewer-gpt-5-6-terra-xhigh
570
+ Configured defaults: provider default effort=medium
571
+ Runtime confirmation: declared:gpt-5.6-terra/xhigh
482
572
  Preferred effort: high
483
- Dispatch policy: high
573
+ OAT Dispatch Tier: high
484
574
  Resolved cap: xhigh
485
575
  Selected effort: xhigh
486
576
  Policy source: project state
487
577
  Provider default effort: medium
488
578
  Selection mode: review-target
489
- Model axis: inherited
579
+ Model axis: selected:gpt-5.6-terra
490
580
  Effort axis: selected:xhigh
491
- Dispatch target: oat-reviewer-xhigh
581
+ Dispatch target: oat-reviewer-gpt-5-6-terra-xhigh
492
582
  Rationale: reviewer runs at the configured policy cap for deterministic quality gate behavior.
493
583
  ```
494
584
 
@@ -497,8 +587,12 @@ Codex inherit/default fallback example:
497
587
  ```text
498
588
  OAT Dispatch: Phase p02 review
499
589
  Host: Codex
590
+ Route: none; level=none
591
+ Requested controls: model=none, effort=provider-default, target=oat-reviewer
592
+ Configured defaults: provider default effort=medium
593
+ Runtime confirmation: not-observable
500
594
  Preferred effort: provider-default
501
- Dispatch policy: inherit host defaults
595
+ OAT Dispatch Tier: inherit host defaults
502
596
  Resolved cap: none
503
597
  Selected effort: provider-default
504
598
  Policy source: project state
@@ -514,7 +608,7 @@ Generic sidecar/explorer dispatch:
514
608
 
515
609
  - Built-in or generic sidecars such as `explorer` are not OAT-managed implementer, reviewer, or fix roles.
516
610
  - 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`.
517
- - Do not classify a generic sidecar as `Preferred effort: low|medium|high|xhigh` 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.
611
+ - 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.
518
612
  - Sidecar outputs are advisory context only. Implementation work and review/fix gates still follow the OAT-managed dispatch rules above.
519
613
 
520
614
  Codex generic explorer example:
@@ -522,8 +616,12 @@ Codex generic explorer example:
522
616
  ```text
523
617
  OAT Dispatch: p02-t10 sidecar exploration
524
618
  Host: Codex
619
+ Route: sidecar/explorer; level=none
620
+ Requested controls: model=none, effort=provider-default, target=explorer
621
+ Configured defaults: provider default effort=xhigh
622
+ Runtime confirmation: not-observable
525
623
  Preferred effort: provider-default
526
- Dispatch policy: high
624
+ OAT Dispatch Tier: high
527
625
  Resolved cap: xhigh
528
626
  Selected effort: provider-default
529
627
  Policy source: project state
@@ -573,13 +671,14 @@ Dispatch policy: {policy}; selected={selected value | none}; cap={value | none}
573
671
  **Log examples (matching resolver output):**
574
672
 
575
673
  ```text
576
- Dispatch policy: balanced; selected=high; cap=high (codex, enforced — variant oat-phase-implementer-high)
577
- Dispatch policy: high; selected=xhigh; cap=xhigh (codex, enforced — variant oat-reviewer-xhigh)
578
- Dispatch policy: uncapped; selected=xhigh; cap=none (codex, enforced — variant oat-phase-implementer-xhigh)
674
+ Dispatch policy: balanced; selected=xhigh; cap=xhigh (codex, enforced — variant oat-phase-implementer-gpt-5-6-terra-xhigh)
675
+ Dispatch policy: high; selected=high; cap=high (codex, enforced — variant oat-reviewer-gpt-5-6-sol-high)
676
+ Dispatch policy: frontier; selected=max; cap=max (codex, enforced — variant oat-reviewer-gpt-5-6-sol-max)
677
+ Dispatch policy: uncapped; selected=xhigh; cap=none (codex, enforced — variant oat-phase-implementer-gpt-5-6-terra-xhigh)
579
678
  Dispatch policy: inherit host defaults; selected=none; cap=none (codex, advisory — base role follows provider default)
580
679
  Dispatch policy: balanced; selected=sonnet; cap=sonnet (claude, enforced — Task model arg)
581
680
  Dispatch policy: frontier; selected=fable; cap=fable (claude, enforced — Task model arg)
582
- Dispatch policy: high; selected=none; cap=high (cursor, unsupportedno adapter; informational)
681
+ Cursor opaque model-string example: Dispatch policy: frontier; selected=gpt-5.6-sol-max; cap=gpt-5.6-sol-max (cursor, enforcedmodel arg gpt-5.6-sol-max)
583
682
  Dispatch policy: unresolved; selected=none; cap=none (codex, advisory — policy set but no value resolved)
584
683
  ```
585
684
 
@@ -897,98 +996,137 @@ Initialize project state so other skills (e.g., `oat-project-progress`) reflect
897
996
 
898
997
  ### Step 5: Per-Phase Execution
899
998
 
900
- For each phase `pNN` in the plan (or each phase in the current parallel group), the orchestrator dispatches phase-level work as follows.
901
-
902
- **Tier 1 dispatch (native subagents):**
903
-
904
- 1. Build the Phase Scope block:
999
+ For each phase `pNN` in the plan (or each phase in a plan-declared parallel
1000
+ worktree group), dispatch exactly one phase coordinator. The coordinator reads
1001
+ the phase once and dispatches one exact task worker per task. It must not
1002
+ implement ordinary plan tasks in its own context.
905
1003
 
906
- ```
907
- project: {PROJECT_PATH}
908
- phase: {pNN}
909
- mode: implement
910
- artifact_paths:
911
- plan: {PROJECT_PATH}/plan.md
912
- design: {PROJECT_PATH}/design.md
913
- spec: {PROJECT_PATH}/spec.md
914
- implementation: {PROJECT_PATH}/implementation.md
915
- discovery: {PROJECT_PATH}/discovery.md
916
- delta_recording: record any intentional divergence from spec/design/plan in implementation.md with rationale, source of truth, and follow-up artifact disposition
917
- commit_convention: {from plan.md header}
918
- workflow_mode: {from state.md or plan.md frontmatter}
919
- model_axis: {selected:<value> | inherited | not-applicable | host-auto; omit if unknown}
920
- effort_axis: {selected:<value> | provider-default | inherited | not-applicable | host-auto; omit if unknown}
921
- dispatch_policy: {economy | balanced | high | frontier | uncapped | inherit host defaults | legacy capped; omit if unknown}
922
- dispatch_ceiling: {resolved cap value; omit if none or unknown}
923
- policy_source: {repo config | project state | preflight prompt; omit if unknown}
924
- ceiling_source: {repo config | project state | preflight prompt; omit if unknown; compatibility alias for policy_source}
925
- provider_default_effort: {value | unknown | not-applicable; omit if unknown}
926
- dispatch_route_level: {integer route level; omit when no ordered route is in play}
927
- dispatch_target: {resolver target or host-specific dispatch target; omit if unknown}
928
- dispatch_stamp: {exact `Dispatch: ...` line written to Dispatch Notes; omit if not yet written}
929
- dispatch_rationale: {short rationale; omit if unknown}
930
- ```
931
-
932
- 2. Perform a pre-dispatch assertion against the host invocation parameters. The Phase Scope fields are audit/context fields; selected axes must also be represented in the actual host dispatch call.
933
- - Codex implementer/fix dispatch:
934
- - Before building the `spawn_agent` argument map, classify the phase complexity and choose preferred effort (`low`, `medium`, `high`, or `xhigh`), determine the current route level (Dispatch Profile floor or `0`), then call `oat project dispatch-ceiling resolve --provider codex --role implementer --preferred <preferred-effort> --escalation-level <route-level>`.
935
- - Build the `spawn_agent` argument map from `providers.codex.selection.selectedValue` and `providers.codex.dispatchArgs.variant` before logging the dispatch. If `providers.codex.target.crossHarness` is true, the resolver intentionally returns no native dispatch args; log the deferred target and use provider-default/base fallback only when that is the explicit selected fallback. If `effort_axis=selected:low|medium|high|xhigh`, the argument map MUST use the matching `agent_type`: `"oat-phase-implementer-low"`, `"oat-phase-implementer-medium"`, `"oat-phase-implementer-high"`, or `"oat-phase-implementer-xhigh"`. Then derive the `OAT Dispatch:` block `Effort axis:` field from that same argument map.
936
- - Example selected low payload shape: `agent_type: "oat-phase-implementer-low"` and a Phase Scope message containing `effort_axis: selected:low`.
937
- - Immediately after spawning, compare the returned Codex status line with the selected effort before waiting on the agent. If the spawned status reports a different effort than the selected value (for example, the log says `effort_axis=selected:medium` but the spawn result reports `gpt-5.5 high`), treat this as an orchestration deviation. Stop, record the deviation in `implementation.md`, and redispatch with corrected parameters before continuing. Do not use work from the mismatched dispatch.
938
- - If `effort_axis=provider-default`, use base `agent_type: "oat-phase-implementer"` and omit `reasoning_effort`. The dispatch rationale MUST say this is a base/unpinned fallback and include provider default effort when known.
939
- - Claude Code implementer/fix dispatch:
940
- - If `model_axis=selected:<value>`, the Task tool call MUST include `model: "<value>"`.
941
- - If `model_axis=inherited`, omit `model`.
942
-
943
- 3. Dispatch the selected implementer role (Tier 1 via provider-native subagent mechanism) — the role asserted in the pre-dispatch step above (e.g., `oat-phase-implementer-low`, `oat-phase-implementer-medium`, `oat-phase-implementer-high`, `oat-phase-implementer-xhigh`, or base `oat-phase-implementer` only for provider-default fallback) — with the Phase Scope block as input and with the asserted host invocation parameters.
1004
+ #### Resolve the Task Maximum
944
1005
 
945
- 4. Receive the structured summary (DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED).
1006
+ Before coordinator dispatch, read the project named ceiling from
1007
+ `state.md:oat_dispatch_policy.policy`. Then inspect the optional plan
1008
+ `## Dispatch Profile` row for this phase:
946
1009
 
947
- **Tier 2 dispatch (inline fallback):**
1010
+ 1. An explicit phase `economy`, `balanced`, `high`, or `frontier` narrows the
1011
+ project maximum and sets `task_ceiling_source: phase`.
1012
+ 2. Blank, absent, or `auto` uses the project maximum and sets
1013
+ `task_ceiling_source: project`.
1014
+ 3. Reject an unknown tier or a phase tier above the project tier.
1015
+ 4. `uncapped` and explicit inherit/default retain their existing policy
1016
+ semantics and have no named `--ceiling-tier`; never synthesize one.
948
1017
 
949
- If Tier 2 is selected, do not dispatch. Instead:
1018
+ The project or phase named ceiling is a maximum, not the coordinator target or
1019
+ an exact family preference. Under High, lower configured Economy, Balanced, and
1020
+ High candidates remain available for different tasks.
950
1021
 
951
- 1. Read `.agents/agents/oat-phase-implementer.md` for the phase-execution process.
952
- 2. Execute that process yourself against the same Phase Scope.
953
- 3. Produce an equivalent summary in your own context.
1022
+ #### Build and Dispatch Phase Scope
954
1023
 
955
- #### Handling Implementer Status
1024
+ ```yaml
1025
+ project: {PROJECT_PATH}
1026
+ phase: {pNN}
1027
+ mode: implement
1028
+ artifact_paths:
1029
+ plan: {PROJECT_PATH}/plan.md
1030
+ design: {PROJECT_PATH}/design.md
1031
+ spec: {PROJECT_PATH}/spec.md
1032
+ implementation: {PROJECT_PATH}/implementation.md
1033
+ discovery: {PROJECT_PATH}/discovery.md
1034
+ workflow_mode: {spec-driven|quick|import}
1035
+ active_provider: {codex|claude|cursor|other}
1036
+ project_ceiling_tier: {named project maximum; omit when none}
1037
+ phase_ceiling_tier: {explicit narrower phase maximum; omit for auto/blank}
1038
+ task_ceiling_tier: {effective project or phase named ceiling}
1039
+ task_ceiling_source: {project|phase}
1040
+ commit_convention: {from plan.md}
1041
+ coordinator_target: {resolver-selected coordinator target}
1042
+ ```
956
1043
 
957
- - **DONE:** Proceed to phase review (Step below).
958
- - **DONE_WITH_CONCERNS:** Read the concerns block. If any concern is correctness-related (bug, wrong behavior, missing requirement), address it before review — re-dispatch implementer with a targeted fix instruction. If concerns are advisory (e.g., "this file is getting large"), note them in `implementation.md` and proceed to review.
959
- - **NEEDS_CONTEXT:** Provide the missing context (usually an artifact path or a cross-phase reference) and re-dispatch. This counts toward the retry limit.
960
- - **BLOCKED:** STOP the run. Surface the block to the user with:
961
- - Phase ID
962
- - What the implementer reported as blocking
963
- - Recommended next step (plan fix, external resolution, user guidance)
964
- Do not proceed to subsequent phases while a phase is blocked.
1044
+ Tier 1 uses the already resolved exact coordinator role/model payload and sends
1045
+ the Phase Scope. A concrete Codex coordinator uses
1046
+ `providers.codex.dispatchArgs.variant`; when the registered role cannot be
1047
+ selected, use the fresh child pinned to the resolver's model and effort with
1048
+ canonical coordinator instructions. Claude and Cursor coordinator calls pass
1049
+ their exact resolver model argument.
965
1050
 
966
- #### Confidence-Based Dispatch Escalation
1051
+ Tier 2 may run the coordinator instructions in the current context only when
1052
+ that context can still dispatch every exact task worker. Tier 2 never permits
1053
+ the coordinator to edit ordinary task files. If no exact worker route exists,
1054
+ block before phase work.
967
1055
 
968
- Escalate the runtime dispatch control when there is evidence that the current control is underpowered:
1056
+ #### Per-Task Coordinator Contract
969
1057
 
970
- - implementer reports low confidence
971
- - implementer reports a reasoning or capability blockage
972
- - the same phase fails substantive review twice
973
- - the fix loop repeats the same class of error
1058
+ For each task in dependency order, the coordinator must:
974
1059
 
975
- When escalation is needed:
1060
+ 1. Classify only that bounded task and choose one configured candidate at or
1061
+ below `task_ceiling_tier`.
1062
+ 2. Call the exact candidate resolver with the invocation-only named maximum:
976
1063
 
977
- 1. If a stronger available control exists, re-dispatch at the next stronger control and include the reason in the scope packet. The escalation ladder is provider-specific:
978
- - **Route-backed matrix cells:** increment `--escalation-level` by one and re-resolve before using provider-specific ladders. The resolver's `providers.<provider>.target.routeLength` is the route bound; never advance past the final route entry.
979
- - **Codex:** `selected:low -> selected:medium -> selected:high -> selected:xhigh`, capped by the resolved managed cap when one exists; managed `Uncapped` may select up to the preferred value; inherit/default mode has no OAT escalation control.
980
- - **Claude Code:** `selected:haiku -> selected:sonnet -> selected:opus -> selected:fable`, capped by the resolved managed cap when one exists; managed `Uncapped` may select up to the preferred model; inherit/default mode has no OAT escalation control.
981
- 2. Count the escalation redispatch against the existing bounded retry budget. Escalation changes the control; it does not create extra retry attempts.
982
- 3. Record a compact formal stamp in `implementation.md` when practical; surrounding prose may describe why the route advanced, but the `Dispatch:` line itself must stay parseable:
983
- - `Dispatch: scope=p03 action=implementation role=implementer producer=gpt-5.5-xhigh provenance=declared model_axis=selected:gpt-5.5-xhigh effort_axis=not-applicable dispatch_policy=high dispatch_ceiling=gpt-5.5-xhigh target=cursor`
984
- - `Dispatch: scope=p03 action=implementation role=implementer producer=opus provenance=declared model_axis=selected:opus effort_axis=not-applicable dispatch_policy=high dispatch_ceiling=opus target=claude`
985
- - `Dispatch: scope=p03 action=implementation role=implementer producer=unknown provenance=unknown model_axis=inherited effort_axis=selected:high dispatch_policy=high dispatch_ceiling=high target=oat-phase-implementer-high`
986
- - `Dispatch: scope=p02 action=implementation role=implementer producer=unknown provenance=unknown model_axis=host-auto effort_axis=host-auto dispatch_policy=unknown dispatch_ceiling=none target=unknown`
987
- 4. If the phase is already at the strongest available control, do not invent a stronger tier. Provide more context, split the phase, revise the plan, or stop for user direction.
1064
+ ```bash
1065
+ oat project dispatch-ceiling resolve \
1066
+ --provider <active-provider> \
1067
+ --role implementer \
1068
+ --ceiling-tier <project-or-phase-named-tier> \
1069
+ --candidate-model <exact-model> \
1070
+ --project-path "$PROJECT_PATH" \
1071
+ --json
1072
+ ```
988
1073
 
989
- #### Dispatch Retry (Transient Failures)
1074
+ Codex also passes `--candidate-effort <exact-effort>`. The returned top-level
1075
+ `source` must be `invocation`; `providers.<provider>.cellSource` continues to
1076
+ identify the config layer that owns the candidate definition. This command
1077
+ is read-only and must never persist its override.
1078
+
1079
+ 3. Build the actual provider invocation before logging:
1080
+ - Codex uses `providers.codex.dispatchArgs.variant` as `agent_type`, or the
1081
+ exact fresh pinned-child model/effort route when native role selection is
1082
+ unavailable.
1083
+ - Claude passes `providers.claude.dispatchArgs.model` as the actual Task
1084
+ `model`.
1085
+ - Cursor passes `providers.cursor.dispatchArgs.model` byte-for-byte as the
1086
+ actual invocation model. Treat the string as opaque and never normalize or
1087
+ infer capability from it.
1088
+ 4. Send one bounded Task Scope, never the full phase task list:
1089
+
1090
+ ```yaml
1091
+ mode: task-worker
1092
+ task_id: { one pNN-tNN ID }
1093
+ task_name: { task title }
1094
+ task_plan: { only this task's steps }
1095
+ file_boundary: { only this task's files }
1096
+ verification: { only this task's verification commands }
1097
+ commit_convention: { exact expected task commit }
1098
+ ceiling_tier: { effective named maximum }
1099
+ ceiling_source: { project|phase }
1100
+ dispatch_target: { resolver-returned exact target }
1101
+ dispatch_args: { complete actual provider payload }
1102
+ ```
990
1103
 
991
- If a Tier 1 dispatch fails (agent did not resolve, returned empty, etc.), retry exactly once. If the second attempt also fails, treat the phase as `failed` via the same mechanism as fix-loop retry exhaustion (see Step 7 below). Tier is never silently downgraded.
1104
+ 5. Dispatch one exact task worker and wait for its terminal result before the
1105
+ next task. Workers in the same worktree run serially; task fan-out is
1106
+ forbidden. Parallelism remains limited to plan-declared phase/worktree
1107
+ groups.
1108
+ 6. Verify the worker's task ID, result, tests, file boundary, clean worktree,
1109
+ and reported commit against `git rev-parse HEAD` and the pre-task HEAD. A
1110
+ worker must contribute exactly one verified task commit.
1111
+ 7. Record each task's exact target, result, and commit in the returned **Task
1112
+ Dispatch Summary**, then perform phase-wide verification and integration
1113
+ self-review without editing ordinary task files.
1114
+
1115
+ If a candidate is missing or absent, exceeds or is above the named ceiling, or
1116
+ cannot be invoked with exact controls, fail closed and block the phase. Never
1117
+ fall back or downgrade to the coordinator target, base role, or inferred
1118
+ provider default. A transient retry reuses the same complete provider payload;
1119
+ a substantive escalation re-resolves within the same named maximum and bounded
1120
+ retry limit.
1121
+
1122
+ #### Handling Coordinator Status
1123
+
1124
+ - **DONE:** verify the Task Dispatch Summary, then proceed to phase review.
1125
+ - **DONE_WITH_CONCERNS:** correctness concerns require a new bounded exact fix
1126
+ worker before review; advisory concerns are recorded.
1127
+ - **NEEDS_CONTEXT:** supply only the missing context and retry within the bound.
1128
+ - **BLOCKED:** stop and surface the phase, task, exact target, and reason. Do not
1129
+ proceed to later phases.
992
1130
 
993
1131
  ### Per-Phase Review
994
1132
 
@@ -997,9 +1135,12 @@ After the implementer returns DONE (or DONE_WITH_CONCERNS without correctness co
997
1135
  **Dispatch:**
998
1136
 
999
1137
  - Use the same tier that was selected at start.
1000
- - For Codex with a capped managed policy, dispatch the reviewer variant matching the resolved cap (`oat-reviewer-low|medium|high|xhigh`) for deterministic quality gates.
1138
+ - For Codex with a capped managed policy, dispatch the materialized reviewer role returned in `providers.codex.dispatchArgs.variant` for deterministic quality gates.
1139
+ - If that exact registered reviewer role is not selectable in the current host session, launch a fresh Codex child with explicit model, reasoning effort, and canonical role instructions from `.agents/agents/oat-reviewer.md`; never substitute the managed base role and never require restart/hot reload.
1001
1140
  - For Codex with managed `Uncapped` or inherit/default mode, no reviewer target exists; use base `oat-reviewer`, log `effort_axis=provider-default`, and explain that the base role follows the provider default.
1002
- - For Claude Code with a capped managed policy, pass the resolved cap as the review `model`; managed `Uncapped` or inherit/default mode omits `model` because no reviewer target exists. Always keep `effort_axis=not-applicable`.
1141
+ - For Claude Code with a capped managed policy, require `providers.claude.dispatchArgs.model` and pass that exact value as the review `model`; managed `Uncapped` or inherit/default mode omits `model` because no reviewer target exists. Always keep `effort_axis=not-applicable`.
1142
+ - For Cursor with a concrete managed reviewer target, require `providers.cursor.dispatchArgs.model` and pass that exact opaque, unnormalized string as the actual review invocation's `model` argument.
1143
+ - Build the actual provider invocation before logging the reviewer target. If the host cannot apply the required Claude or Cursor model argument, fail closed or block unless inline execution has verified equivalent current-host controls.
1003
1144
  - Tier 1: dispatch the selected reviewer target via provider-native subagent mechanism with Review Scope:
1004
1145
 
1005
1146
  ```
@@ -1016,17 +1157,17 @@ After the implementer returns DONE (or DONE_WITH_CONCERNS without correctness co
1016
1157
  policy_source: {repo config | project state | preflight prompt}
1017
1158
  ceiling_source: {repo config | project state | preflight prompt} # compatibility alias for policy_source
1018
1159
  provider_default_effort: {value | unknown | not-applicable}
1019
- model_axis: {inherited | selected:<Claude model>}
1160
+ model_axis: { selected:<value> | inherited | not-applicable | host-auto }
1020
1161
  effort_axis: {selected:<Codex value> | provider-default | not-applicable}
1021
1162
  dispatch_rationale: {capped reviewer target | uncapped/inherit reviewer fallback}
1022
1163
  ```
1023
1164
 
1024
1165
  - For Codex Tier 1 dispatches, send the Review Scope block as a self-contained packet and keep fresh context (`fork_context: false`). The reviewer is expected to reconstruct context from git state and the OAT artifacts listed above.
1025
- - For Codex Tier 1 review dispatches, use `agent_type: "oat-reviewer-low|medium|high|xhigh"` only when the resolver returns a pinned reviewer variant for a capped managed policy. Use base `oat-reviewer` for managed `Uncapped`, inherit/default mode, or provider-default fallback, and log `effort_axis=provider-default`. For Claude Code review dispatches, do not pass a per-review effort override because the effort axis is not applicable; pass `model` only when the resolver returns a selected review model.
1166
+ - For Codex Tier 1 review dispatches, use the materialized Codex role name from `providers.codex.dispatchArgs.variant` only when the resolver returns a reviewer variant for a capped managed policy. A Codex materialized reviewer role selected from a model+effort target must carry `model_axis=selected:<model>` and `effort_axis=selected:<effort>` from resolver output. Use base `oat-reviewer` only when the resolver returns no `dispatchArgs.variant` for managed `Uncapped`, inherit/default mode, or provider-default fallback, and log `effort_axis=provider-default`. For Claude Code, pass `model: providers.claude.dispatchArgs.model` for a concrete managed reviewer and never pass a per-review effort override. For Cursor, pass `model: providers.cursor.dispatchArgs.model` byte-for-byte for a concrete managed reviewer.
1026
1167
  - Treat the commit range as authoritative for review scope. `files_changed` is optional orientation metadata only.
1027
- - If a Codex reviewer does not return a terminal result on the first wait, poll once more. If it still has not concluded, send one concise nudge to return immediately with current findings. If the reviewer still does not conclude, treat the Tier 1 review dispatch as failed for this phase and perform the review inline instead of waiting indefinitely.
1168
+ - If a reviewer does not return a terminal result on the first wait, poll once more. If it still has not concluded, send one concise nudge to return immediately with current findings. If the reviewer still does not conclude, treat the target-preserving review dispatch as failed for this phase. Retry the same exact role, pinned fresh-child route, or complete Claude/Cursor invocation payload within the retry bound, preserving the exact model argument; never downgrade a timed-out managed reviewer to unpinned inline execution.
1028
1169
 
1029
- - Tier 2: inline — read `.agents/agents/oat-reviewer.md` and perform the review yourself.
1170
+ - Tier 2: read `.agents/agents/oat-reviewer.md` and review inline only with verified equivalent current-host model and effort controls, explicit inherit/default behavior, or the documented managed-uncapped reviewer behavior. Otherwise block.
1030
1171
 
1031
1172
  **Verdict outcomes:**
1032
1173
 
@@ -1043,9 +1184,9 @@ On reviewer verdict `fail`, run a bounded fix loop.
1043
1184
 
1044
1185
  1. Read `oat_orchestration_retry_limit` from `state.md` frontmatter (default: `2`, range 0–5).
1045
1186
  2. For each retry (up to the limit):
1046
- a. Select/log fix dispatch axes from the fix scope, advance the route level by one after repeated review failure when the resolver reports an ordered target route, then perform the same pre-dispatch assertion used for implementation dispatch. A Codex fix dispatch with `effort_axis=selected:low|medium|high|xhigh` MUST use matching `agent_type: "oat-phase-implementer-low|medium|high|xhigh"`; a Claude Code fix dispatch with `model_axis=selected:<value>` MUST pass `model: "<value>"` on the Task call. Every fix dispatch writes the formal `Dispatch: scope=<phase-or-task> action=fix role=fix 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>` stamp before waiting on the implementer result.
1047
- b. Dispatch the selected phase implementer role in `fix` mode (Tier 1) OR read the agent and apply fixes inline (Tier 2), with: - `review_artifact`: the path written by the reviewer - `findings`: the Critical + Important findings list - `prior_summary`: the last implementer summary
1048
- c. Receive the fix summary.
1187
+ a. Convert Critical/Important findings into bounded fix scopes associated with one planned task/file boundary at a time. Do not hand one worker the full phase finding list.
1188
+ b. Reuse the phase coordinator in `fix` mode. It selects an exact candidate under the same project or phase named ceiling with `--ceiling-tier`, then emits one Task Scope per bounded fix. Codex uses `providers.codex.dispatchArgs.variant`; Claude and Cursor pass their exact `providers.<provider>.dispatchArgs.model` value on the actual invocation. Every fix worker writes the formal `Dispatch: scope=<phase-or-task> action=fix role=fix 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>` stamp before execution.
1189
+ c. Receive and verify each fix result and commit. The coordinator must not apply fixes itself, and Tier 2 does not authorize inline task edits.
1049
1190
  d. Re-dispatch the reviewer with the updated commit range.
1050
1191
  e. Parse the new verdict.
1051
1192
  f. If pass → exit the loop successfully.
@@ -1079,10 +1220,10 @@ If the gate is enabled and the current phase is selected:
1079
1220
  - Do not pass `--target` in normal execution; the existing gate config selects the cross-provider target.
1080
1221
  - The gate CLI injects gate context into the review prompt. The produced review artifact must use `oat_review_invocation: gate`.
1081
1222
 
1082
- 2. Parse the JSON result. The gate verdict (`exit_nonzero_on: {threshold}`) decides whether the phase **stops**; it does not decide whether sub-threshold findings are ignored. Either way the produced artifact must be **consumed** — passing gate artifacts are not left unprocessed at the top level of `reviews/`.
1083
- - `status: "ok"` / exit code `0` means the phase gate passed at the configured threshold, so the phase does not stop. Still run `oat-project-review-receive` for the reported artifact path in non-pausing **judgment-sweep** mode (pass gate-passed context so receive selects sweep disposition). The sweep makes a per-finding judgment for each Medium/Minor — defer to final (default), address now (small/contained/low-risk fixes only), or reject with rationale — writes those durable dispositions into `implementation.md`, and archives the artifact. Then continue without pausing. Address-now fixes from a passing gate do **not** re-trigger the standard reviewer or re-gate the phase.
1084
- - `status: "blocked"` / non-zero exit due to review findings means blocking findings exist. Run `oat-project-review-receive` for the reported artifact path (blocking disposition) before treating the gate review as consumed.
1085
- - A non-zero exit caused by target execution failure, artifact validation failure, or missing review artifact is an operational failure. Stop and surface the gate output; do not continue as if the gate passed.
1223
+ 2. Parse the JSON result. Before invoking review-receive, all three receive-eligibility conditions must hold: `status` is `ok` or `blocked`, the envelope explicitly sets `receiveEligible: true`, and `handoff` is non-null. A missing or contradictory field is an operational failure even when `artifactPath` is present. The gate verdict (`exit_nonzero_on: {threshold}`) decides whether the phase **stops**; it does not decide whether sub-threshold findings are ignored. Once eligibility is established, the produced artifact must be **consumed** — passing gate artifacts are not left unprocessed at the top level of `reviews/`.
1224
+ - With eligibility established, `status: "ok"` / exit code `0` means the phase gate passed at the configured threshold, so the phase does not stop. Run `oat-project-review-receive` for the reported artifact path in non-pausing **judgment-sweep** mode (pass gate-passed context so receive selects sweep disposition). The sweep makes a per-finding judgment for each Medium/Minor — defer to final (default), address now (small/contained/low-risk fixes only), or reject with rationale — writes those durable dispositions into `implementation.md`, and archives the artifact. Then continue without pausing. Address-now fixes from a passing gate do **not** re-trigger the standard reviewer or re-gate the phase.
1225
+ - With eligibility established, `status: "blocked"` / non-zero exit due to review findings means blocking findings exist. Run `oat-project-review-receive` for the reported artifact path (blocking disposition) before treating the gate review as consumed.
1226
+ - Any other status, or a non-zero exit caused by target execution failure, artifact validation failure, or missing review artifact, is an operational failure. Stop and surface the gate output; do not continue as if the gate passed.
1086
1227
 
1087
1228
  3. If `oat-project-review-receive` adds fix tasks (blocking gate, or a sweep address-now fix that revealed a Critical/Important concern):
1088
1229
  - Return to task execution for the newly added review-fix tasks.
@@ -1098,18 +1239,18 @@ For a parallel group, run selected phase gates after fan-in and bookkeeping, one
1098
1239
 
1099
1240
  When the current schedule entry is a multi-phase group, execute as follows.
1100
1241
 
1101
- **Tier 2 degradation:** If Tier 2 was selected at skill start, Tier 2 cannot run concurrent subagents. Degrade the entire group to sequential inline execution — run each phase in the group sequentially on the orchestration branch. Do not create worktrees. Proceed through the per-phase loop (dispatch / review / fix-loop / bookkeeping) for each phase in plan order.
1242
+ **Tier 2 degradation:** If Tier 2 was selected at skill start, Tier 2 cannot run concurrent subagents. Degrade the group to sequential target-preserving execution on the orchestration branch. Do not create worktrees. For every phase, retain the exact role or pinned fresh child; inline is permitted only by the verified-equivalent-controls or documented-exception guard. Proceed through the per-phase loop in plan order.
1102
1243
 
1103
1244
  **Tier 1 parallel execution:**
1104
1245
 
1105
1246
  1. **Bootstrap worktrees:** for each phase in the group, invoke `oat-worktree-bootstrap-auto` with branch name `{project-name}/{pNN}` and base = orchestration branch.
1106
1247
 
1107
1248
  > ⚠️ **CRITICAL — DO NOT substitute host-native worktree primitives.** Bootstrap MUST go through `oat-worktree-bootstrap-auto` with an explicit `--base` set to the current orchestration branch HEAD (capture `EXPECTED_HEAD=$(git rev-parse HEAD)` from the orchestration cwd before dispatching). Do not use Claude Code's `Agent({ isolation: "worktree" })`, Cursor's equivalent, or any other host-native isolation primitive in lieu of this skill — those mechanisms may use the primary repo's checkout (often `main`) as the base regardless of the orchestrator's current branch, silently producing a worktree that cannot see prior phase commits and forcing the entire group to degrade to sequential.
1108
- - If **any** bootstrap fails, cancel any worktrees that bootstrapped successfully for this group and degrade the whole group to sequential inline execution. Log the degradation reason to `implementation.md` Outstanding Items.
1249
+ - If **any** bootstrap fails, cancel any worktrees that bootstrapped successfully for this group and degrade the whole group to sequential target-preserving execution. Log the degradation reason to `implementation.md` Outstanding Items.
1109
1250
 
1110
- 2. **Verify worktree HEAD before dispatch (base-mismatch gate):** After bootstrap, verify each worktree is at the expected orchestration HEAD. From the orchestration cwd, capture `EXPECTED_HEAD=$(git rev-parse HEAD)` _before_ invoking bootstrap. After bootstrap, for each new worktree path, run `git -C {worktree-path} rev-parse HEAD` and confirm it matches `EXPECTED_HEAD`, or run `git -C {worktree-path} merge-base --is-ancestor "$EXPECTED_HEAD" HEAD` and confirm it succeeds (exit 0). If either check fails for any phase, treat the bootstrap as failed for that phase, cancel any successful sibling worktrees in this group, and degrade the entire group to sequential inline execution — same mechanism as a primary bootstrap failure. Log the mismatch to `implementation.md` Outstanding Items, including the observed and expected SHAs (`expected={EXPECTED_HEAD}, observed={observed-head-sha}, phase={pNN}, worktree={path}`).
1251
+ 2. **Verify worktree HEAD before dispatch (base-mismatch gate):** After bootstrap, verify each worktree is at the expected orchestration HEAD. From the orchestration cwd, capture `EXPECTED_HEAD=$(git rev-parse HEAD)` _before_ invoking bootstrap. After bootstrap, for each new worktree path, run `git -C {worktree-path} rev-parse HEAD` and confirm it matches `EXPECTED_HEAD`, or run `git -C {worktree-path} merge-base --is-ancestor "$EXPECTED_HEAD" HEAD` and confirm it succeeds (exit 0). If either check fails for any phase, treat the bootstrap as failed for that phase, cancel any successful sibling worktrees in this group, and degrade the entire group to sequential target-preserving execution — same mechanism as a primary bootstrap failure. Log the mismatch to `implementation.md` Outstanding Items, including the observed and expected SHAs (`expected={EXPECTED_HEAD}, observed={observed-head-sha}, phase={pNN}, worktree={path}`).
1111
1252
 
1112
- 3. **Concurrent dispatch:** for each successfully bootstrapped worktree (passing the base-mismatch gate above), dispatch `oat-phase-implementer` (with the worktree as working directory) concurrently. Each dispatch runs the per-phase loop internally (implementer reviewer fix-loop).
1253
+ 3. **Concurrent phase dispatch:** for each successfully bootstrapped worktree (passing the base-mismatch gate above), dispatch one `oat-phase-implementer` coordinator with the worktree as its working directory. Coordinators may run concurrently across these plan-declared phase worktrees, but every coordinator dispatches its own task workers serially in that one worktree. The outer orchestration loop retains review and bounded-fix handling.
1113
1254
 
1114
1255
  4. **Wait for all phases:** do not proceed until every phase in the group reports a terminal verdict (pass or excluded).
1115
1256
 
@@ -1154,7 +1295,7 @@ When the current schedule entry is a multi-phase group, execute as follows.
1154
1295
 
1155
1296
  d. Parse the subagent's return status: - `RESOLVED` → subagent has committed the merge; orchestrator proceeds to integration verification (Step 6) and the next phase in the group. - `UNRESOLVABLE` or `VERIFICATION_FAILED` → STOP the run. Surface to user with phase ID, conflicting files, worktree path, subagent's reasoning summary. Do not merge remaining phases.
1156
1297
 
1157
- **Tier 2 (inline) exception:** In Tier 2 runs, parallel groups already degrade to sequential, so fan-in conflicts don't arise from this code path. If a conflict ever surfaces in Tier 2 (e.g., from another operation), the orchestrator resolves inline since the whole run is already inline consistent with Tier 2 semantics.
1298
+ **Tier 2 conflict exception:** In Tier 2 runs, parallel groups already degrade to sequential, so fan-in conflicts do not arise from this code path. If a conflict surfaces from another operation, inline resolution is allowed only when the current-host controls satisfy the same verified-equivalence or documented-exception guard; otherwise stop for a target-preserving route.
1158
1299
 
1159
1300
  6. **Integration verification after each merge:**
1160
1301
 
@@ -1271,7 +1412,7 @@ Before pausing at a checkpoint, check if auto-review is enabled:
1271
1412
  1. Read `oat_auto_review_at_hill_checkpoints` from plan.md frontmatter. If not present, fall back to legacy `oat_auto_review_at_checkpoints`. If neither is present, fall back to `oat config get workflow.autoReviewAtHillCheckpoints` (which itself falls back to legacy `.oat/config.json` `autoReviewAtCheckpoints` when unset).
1272
1413
 
1273
1414
  2. If enabled and this is a checkpoint phase:
1274
- a. **Determine review scope:** Find the highest completed implementation phase already covered by a **`passed`** code-review row in plan.md Reviews table. Count only whole-phase scopes: `pNN` or `pNN-pMM`. Ignore task scopes (`pNN-tNN`) and rows with `fixes_added` or `fixes_completed` because those reviews did not pass and must be re-covered. Scope = every implementation phase after that passed coverage through the current phase, inclusive. If no earlier passed whole-phase review exists, start from the first implementation phase. Use `pNN-pMM` when the scope spans multiple phases. If this is the final implementation phase checkpoint, use scope `final`.
1415
+ a. **Determine review scope:** Find the highest completed implementation phase already covered by a **`passed`** code-review row in plan.md Reviews table. Count only whole-phase scopes: `pNN` or `pNN-pMM`. Ignore task scopes (`pNN-tNN`) and rows with `fixes_added` or `fixes_completed` because those reviews did not pass and must be re-covered. Scope = every implementation phase after that passed coverage through the current phase, inclusive. If no earlier passed whole-phase review exists, start from the first implementation phase. Use `pNN-pMM` when the scope spans multiple phases. If this is the final implementation phase checkpoint, run `oat-project-review-provide code final`; use scope `final` and do not run a duplicate final phase-only lifecycle review, because Tier 1 already runs the standard per-phase reviewer before the final checkpoint branch.
1275
1416
  - Example: prior passed row `p01`, current checkpoint `p03` → review `p02-p03`
1276
1417
  - Example: no prior passed whole-phase review, current checkpoint `p03` → review `p01-p03`
1277
1418
  - Example: current checkpoint is the last implementation phase → review `final`
@@ -1512,12 +1653,27 @@ echo "$FINAL_ROW"
1512
1653
 
1513
1654
  **Workflow preference check (before prompting):**
1514
1655
 
1656
+ First resolve the final reviewer target with the same target-first contract as
1657
+ per-phase review. A concrete managed Codex target must use its exact registered
1658
+ reviewer or an explicitly pinned fresh child. A concrete managed Claude or
1659
+ Cursor target must put `providers.claude.dispatchArgs.model` or
1660
+ `providers.cursor.dispatchArgs.model` respectively into the actual provider
1661
+ invocation as the exact `model` argument; Cursor strings remain opaque. On
1662
+ timeout or retry, preserve the same exact role or complete invocation payload,
1663
+ including the model argument. If the host cannot apply the required role or
1664
+ model argument, fail closed or block unless verified equivalent current-host
1665
+ controls permit inline execution. The preference below chooses only among
1666
+ routes that preserve that target; it cannot authorize generic inline or base
1667
+ execution. Inline remains available only with verified equivalent current-host
1668
+ controls or an allowed explicit inherit/default or managed-uncapped reviewer
1669
+ base-role exception.
1670
+
1515
1671
  ```bash
1516
1672
  REVIEW_MODEL=$(oat config get workflow.reviewExecutionModel 2>/dev/null || true)
1517
1673
  ```
1518
1674
 
1519
1675
  - **If `REVIEW_MODEL` is `subagent`:** Print `Review execution: subagent (from workflow.reviewExecutionModel).` Dispatch the review subagent directly via the Task tool. No prompt.
1520
- - **If `REVIEW_MODEL` is `inline`:** Print `Review execution: inline (from workflow.reviewExecutionModel).` Run the review in-context per `oat-project-review-provide` skill. No prompt.
1676
+ - **If `REVIEW_MODEL` is `inline`:** Honor it only when the inline route satisfies the verified-equivalent-controls or documented-exception guard. Otherwise use the exact/pinned route or block. When allowed, print `Review execution: inline (from workflow.reviewExecutionModel).` and run the review in-context per `oat-project-review-provide`.
1521
1677
  - **If `REVIEW_MODEL` is `fresh-session`:** This is a **soft preference with escape hatch** because the agent cannot run the review in a fresh session on the user's behalf. Print the guidance block below, then handle the user's response per the three outcomes listed after it.
1522
1678
  - **If unset or invalid:** Fall through to the standard 3-tier prompt below.
1523
1679
 
@@ -1540,7 +1696,7 @@ Enter 1 or 2 to run the review here, or press Enter to wait.
1540
1696
  **Fresh-session response outcomes:**
1541
1697
 
1542
1698
  - User enters `1` → dispatch the subagent review (same behavior as `REVIEW_MODEL=subagent`).
1543
- - User enters `2` → run the review inline (same behavior as `REVIEW_MODEL=inline`).
1699
+ - User enters `2` → apply the same guarded inline behavior as `REVIEW_MODEL=inline`; this choice does not waive managed target controls.
1544
1700
  - User presses Enter (or equivalent no-input confirmation) → pause the session and wait for the fresh-session review to complete before continuing.
1545
1701
 
1546
1702
  **Standard prompt (when preference is unset):**
@@ -1553,7 +1709,7 @@ Implementation complete. Final review required.
1553
1709
  Review options:
1554
1710
  1. Run review in this session via a subagent (recommended if provider supported)
1555
1711
  2. Run review in a fresh session and return to this session to receive review
1556
- 3. Run review inline
1712
+ 3. Run review inline when current-host controls are verified equivalent
1557
1713
 
1558
1714
  To run in a separate session use: oat-project-review-provide code final
1559
1715
  ```
@@ -1562,7 +1718,7 @@ To run in a separate session use: oat-project-review-provide code final
1562
1718
 
1563
1719
  - If subagent (option 1): Agent spawns the review via Task tool — no command needed from user
1564
1720
  - If fresh session (option 2): User runs `oat-project-review-provide code final` in a separate session, then returns here
1565
- - If inline (option 3): Agent executes the review directly per oat-project-review-provide skill
1721
+ - If inline (option 3): Agent first verifies equivalent current-host controls or an allowed exception, then executes the review per `oat-project-review-provide`; otherwise it uses the exact/pinned route or blocks
1566
1722
  - After review: User runs `oat-project-review-receive` to process findings
1567
1723
  - If Critical/Important findings: Fix tasks added, re-run the `oat-project-implement` skill
1568
1724
  - Loop until final review passes (max 3 cycles per oat-project-review-receive)
@@ -1666,24 +1822,37 @@ Before reporting this skill as complete, run the configured gate as the final st
1666
1822
 
1667
1823
  If the command returns JSON `null`, no gate is configured; the skill is complete.
1668
1824
 
1669
- 2. If a gate config is returned, run its `command` exactly as configured. Capture stdout, stderr, and the exit code. A zero exit code means the gate passed and the skill is complete.
1825
+ 2. Export the resolved project path into the command shell:
1826
+
1827
+ ```bash
1828
+ export PROJECT_PATH
1829
+ ```
1830
+
1831
+ If the resolved command invokes `oat gate review`, the configured review command must already include `--project "$PROJECT_PATH"` and must not include `--target <id>`. A valid reusable shape is `oat gate review --project "$PROJECT_PATH" ...`. If the declaration is missing, stop and migrate the stored gate command; do not inject or append arguments at execution time.
1832
+
1833
+ 3. Execute the resolved command exactly as configured. Capture stdout, stderr, the exit code, and the structured JSON result. A zero exit code means the review passed its threshold, but it does not by itself authorize artifact receipt or complete the handoff.
1670
1834
 
1671
- 3. Review-artifact handoff:
1672
- - If the gate reports a produced review artifact, the host must run `oat-project-review-receive` to receive and disposition that artifact before treating the review as consumed.
1673
- - This applies to `oat gate review ...` outputs regardless of whether the gate ultimately exits zero or nonzero; the command output owns the exact artifact path, and receive-review owns disposition and archival.
1835
+ 4. Review-artifact handoff:
1836
+ - Parse the structured gate result. An exit code or artifact path alone never authorizes `oat-project-review-receive`.
1837
+ - Invoke receive only when all three conditions hold: `status` is `ok` or `blocked`, the envelope explicitly sets `receiveEligible: true`, and a non-null `handoff` confirms the artifact was corroborated.
1838
+ - `receiveEligible: false` is a hard stop even when `artifactPath` is present. Never receive `targeting_correlation_failed`; correct the project/run routing and run a new gate.
1839
+ - Keep `artifact_validation_failed` outside receive until the artifact is corrected and the gate successfully revalidates it. Treat `review_failed`, unknown statuses, null handoffs, and contradictory eligibility fields as operational failures.
1840
+ - `blocked` exits nonzero but is receive-eligible; `ok` exits zero and still requires durable receive disposition. Route by structured status and eligibility, not by exit code.
1674
1841
 
1675
- 4. If the command exits nonzero, use `description` to orient the next steps and handle `onFailure`:
1842
+ 5. If the command exits nonzero, use `description` to orient the next steps and handle `onFailure`:
1676
1843
  - `block`: read gate feedback, remediate, and re-run the gate up to `maxAttempts` attempts (default `2`). If attempts are exhausted, escalate to the human with accumulated feedback and append that feedback to `implementation.md`. Treat a launch failure, missing CLI, or no eligible runtime as escalation-biased and do not spend it as a remediation attempt.
1677
1844
  - `prompt`: surface the gate failure and ask the human how to proceed.
1678
1845
  - `warn`: record the gate failure and continue.
1679
1846
 
1680
- 5. Runtime selection note (V1): the step runs the gate `command` as-is and reads no OAT runtime env var. By default, `oat gate review` and `oat gate cross-provider-exec` resolve the current host from built-in `hostDetectionCommand`s and avoid the same runtime when no exact target is supplied. Reusable lifecycle skill-gate commands should normally omit `--target <id>` so independent review stays provider-neutral. Use explicit targets only for manual/debug commands or deliberate local/user-specific overrides; do not hardcode provider/model targets in bundled skill guidance or shared lifecycle gate examples.
1847
+ 6. Runtime selection note (V1): the step runs the gate `command` as-is and reads no OAT runtime env var. By default, `oat gate review` and `oat gate cross-provider-exec` resolve the current host from built-in `hostDetectionCommand`s and avoid the same runtime when no exact target is supplied. Reusable lifecycle skill-gate commands must not include `--target <id>` so independent review stays provider-neutral. Use explicit targets only for manual/debug commands or deliberate local/user-specific overrides; do not hardcode provider/model targets in bundled skill guidance or shared lifecycle gate examples.
1681
1848
 
1682
1849
  ## Success Criteria
1683
1850
 
1684
- - All tasks executed in order
1851
+ - One exact target-pinned worker executed each task in dependency order
1852
+ - The phase coordinator did not implement ordinary task work in its own context
1853
+ - Same-worktree task workers ran serially; only plan-declared phase worktrees ran in parallel
1685
1854
  - TDD discipline followed
1686
- - Each task has a commit
1855
+ - Each task result and commit was verified against HEAD and its file boundary
1687
1856
  - Implementation.md tracks all progress
1688
1857
  - Final verification passes
1689
1858
  - Final review passes (no Critical/Important findings)