@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,339 +1,369 @@
1
1
  ---
2
2
  title: Implementation Execution
3
- description: 'Phase-subagent dispatch, tier detection, runtime dispatch selection, bounded fix loop, plan-declared parallelism, and dry-run mode in oat-project-implement v2.0.'
3
+ description: 'Phase coordination, exact task-worker dispatch, named maximum ceilings, reviews, bounded fixes, plan-declared parallel worktrees, and resumption in oat-project-implement.'
4
4
  ---
5
5
 
6
6
  # Implementation Execution
7
7
 
8
- This page covers how `oat-project-implement` actually runs a plan: tier selection, phase-level subagent dispatch, runtime dispatch selection, the review + fix loop, plan-declared parallelism with worktree fan-in, and dry-run.
8
+ This page describes how `oat-project-implement` executes a plan after planning
9
+ has established a complete ordered candidate ladder and a project named
10
+ ceiling.
9
11
 
10
12
  ## Quick Look
11
13
 
12
- - **When to use:** you have a plan ready and want to understand what happens during `oat-project-implement`.
13
- - **Unit of dispatch:** one phase at a time (not one task). A phase implementer executes all tasks in the phase, commits per task, and returns a single summary.
14
- - **Two tiers, one lock:** capability detection picks Tier 1 (native subagents) or Tier 2 (inline) at start. The tier is locked for the whole run — no mid-run downgrades.
15
- - **Dispatch policy:** implementation resolves an OAT-owned dispatch policy before work starts. Managed policies are `Economy`, `Balanced`, `High`, `Frontier`, and `Uncapped`; `Inherit Host Defaults` explicitly leaves model/effort controls to the host.
16
- - **Runtime dispatch:** each phase uses the lowest available model/effort/control that can confidently complete the work. Capped managed policies cap preferred selections, managed `Uncapped` uses preferred selections directly, and inherit/default mode uses no OAT-selected control.
14
+ - **Phase boundary:** one phase coordinator owns dependency order, integration,
15
+ and the phase summary.
16
+ - **Task boundary:** the coordinator dispatches one exact task worker per task.
17
+ Each worker receives one bounded Task Scope and creates one verified commit.
18
+ - **Named maximum:** a project or narrower phase named ceiling is a maximum over
19
+ configured candidates, not an exact model-family preference.
20
+ - **Serial worktree rule:** task workers run serially in the same worktree.
21
+ Parallelism is limited to plan-declared phase worktrees.
22
+ - **Fail closed:** a missing, above-ceiling, or uninvokable managed candidate
23
+ blocks. OAT does not substitute the coordinator target, a base role, or a
24
+ provider default.
17
25
 
18
- ## Execution model
26
+ ## Execution Layers
19
27
 
20
- ### Tier selection
28
+ ### Orchestrator
21
29
 
22
- At skill start, `oat-project-implement` detects whether the host supports native subagent dispatch for `oat-phase-implementer` and `oat-reviewer`.
30
+ The root `oat-project-implement` workflow resolves project state, chooses Tier
31
+ 1 or Tier 2 mechanics, builds the phase schedule, dispatches coordinators and
32
+ reviewers, owns the review/fix loop, updates artifacts, and performs worktree
33
+ fan-in.
23
34
 
24
- - **Claude Code / Cursor:** native subagent dispatch → Tier 1.
25
- - **Codex multi-agent:** Tier 1 if `spawn_agent` is allowed without authorization, or after an explicit single prompt at skill start if authorization is required. Codex subagent dispatch should use self-contained scope packets with fresh context; do not assume pinned OAT roles can also inherit the full parent thread.
26
- - **Authorization declined or agents do not resolve:** Tier 2 (inline). The orchestrator reads `.agents/agents/oat-phase-implementer.md` and `.agents/agents/oat-reviewer.md` as reference and executes that process itself.
35
+ ### Phase coordinator
27
36
 
28
- The approval decision covers both phase implementation and checkpoint review for the run. The orchestrator should not drift into a mixed mode based on conversational emphasis alone; if Tier 1 was not approved, stay inline throughout unless the user explicitly requests mixed execution.
37
+ A Phase Scope selects coordinator mode in `oat-phase-implementer`. The
38
+ coordinator reads the phase artifacts once, retains task dependency order,
39
+ selects one exact configured target for each task, waits for and verifies every
40
+ worker result and commit, then performs phase-wide integration verification and
41
+ self-review.
29
42
 
30
- The selected tier is reported to the user and locked for the remainder of the run:
43
+ The coordinator must not implement ordinary plan tasks itself. Its execution
44
+ target is not a task target and cannot be reused as a fallback.
31
45
 
32
- ```text
33
- [preflight] Checking subagent availability…
34
- → oat-phase-implementer + oat-reviewer: available
35
- → Selected: Tier 1 — Subagents
36
- ```
46
+ ### Task worker
37
47
 
38
- ### Dispatch policy preflight
48
+ A Task Scope selects worker mode in the same canonical agent instructions. The
49
+ worker implements exactly one task, runs that task's verification, creates one
50
+ commit, returns a compact result, and stops. It does not dispatch another worker
51
+ or coordinate the phase.
39
52
 
40
- Before phase work starts, `oat-project-implement` resolves and prints the dispatch policy for the current provider. For the conceptual model and per-provider enforcement (Codex vs Claude vs unsupported), see [Dispatch Policy](dispatch-ceiling.md).
53
+ This dual-mode contract lets every materialized Codex
54
+ `oat-phase-implementer-<model>-<effort>` role act as either the coordinator or
55
+ the exact bounded worker without recursive coordinator dispatch.
41
56
 
42
- The resolver is the source of truth. The command name remains `dispatch-ceiling` for compatibility:
57
+ ## Tier Selection
43
58
 
44
- ```bash
45
- oat project dispatch-ceiling resolve --provider codex --preflight --json
46
- ```
59
+ At skill start, OAT detects whether the host can run the coordinator,
60
+ task-worker, and reviewer routes:
61
+
62
+ - **Tier 1:** native provider subagent dispatch.
63
+ - **Tier 2:** guarded sequential coordinator mechanics when native role
64
+ selection is unavailable.
47
65
 
48
- Resolution order:
66
+ Tier 2 does not authorize inline task implementation by the coordinator. A
67
+ managed task still requires an exact registered role, an exact provider model
68
+ argument, or a fresh Codex child pinned to the resolver-returned model and
69
+ effort. If the current context cannot dispatch that worker, implementation
70
+ blocks.
49
71
 
50
- 1. `workflow.dispatchPolicy.mode` / `workflow.dispatchPolicy.policy` from effective config
51
- 2. Compatibility `workflow.dispatchCeiling.providers.<provider>` from effective config
52
- 3. `oat_dispatch_policy` in project `state.md` frontmatter
53
- 4. Legacy `oat_dispatch_ceiling` in project `state.md` frontmatter
54
- 5. Interactive implementation preflight prompt
55
- 6. Non-interactive unresolved state blocks before work starts
72
+ Codex may require one explicit authorization prompt for multi-agent dispatch.
73
+ That approval covers coordinators, task workers, and reviewers for the run. Tier
74
+ mechanics remain locked after selection; they never change the target contract.
56
75
 
57
- Runtime dispatch reads the resolved policy and provider-specific selection only. If no policy is configured, the interactive preflight prompt offers the policy choices; non-interactive mode blocks.
76
+ ## Dispatch Readiness
58
77
 
59
- **Policy options (interactive prompt):**
78
+ Planning through spec-driven, quick-start, import-plan, or provider-plan-via-
79
+ import performs the same readiness setup:
60
80
 
61
- | Option | Mode | Codex | Claude |
62
- | --------------------- | ------- | -------- | -------- |
63
- | Economy | managed | `medium` | `sonnet` |
64
- | Balanced | managed | `high` | `sonnet` |
65
- | High | managed | `xhigh` | `opus` |
66
- | Frontier | managed | `xhigh` | `fable` |
67
- | Uncapped | managed | none | none |
68
- | Inherit Host Defaults | inherit | none | none |
81
+ 1. Inspect the effective ordered candidate ladders.
82
+ 2. If incomplete, show the complete bundled recommendation and ask whether
83
+ `--shared`, `--local`, or `--user` should own adoption.
84
+ 3. Recheck after non-destructive adoption. Remaining gaps block readiness.
85
+ 4. Record the active project named maximum in project `state.md`, not user
86
+ config.
87
+ 5. Optionally record a narrower phase named maximum in plan Dispatch Profile.
69
88
 
70
- For Codex, provider default effort is displayed when available but is not treated as managed `Uncapped` or as a cap. Provider defaults apply only to explicit inherit/default behavior or base/unpinned fallback paths.
89
+ See [Dispatch Policy](dispatch-ceiling.md) for ladder shapes and ownership.
71
90
 
72
- ```text
73
- Dispatch policy: balanced (codex, managed capped — pinned-variant)
74
- Resolved cap: high
75
- Source: project state
76
- Provider default effort: medium
77
- Note: OAT will use pinned subagent variants up to high. Base/unpinned roles resolve through the provider default only on fallback paths.
91
+ Before phase work, implementation runs provider preflight:
92
+
93
+ ```bash
94
+ oat project dispatch-ceiling resolve \
95
+ --provider <active-provider> \
96
+ --preflight \
97
+ --json
78
98
  ```
79
99
 
80
- **Enforcement modes** (from resolver):
100
+ An unresolved non-interactive preflight blocks. Managed `Uncapped` and
101
+ `Inherit Host Defaults` are explicit modes; omitted policy state is not an
102
+ implicit fallback.
81
103
 
82
- - `enforced` the adapter compiled concrete dispatch args and the provider accepted them (Codex: pinned variants; Claude: Task `model` parameter).
83
- - `advisory` — the provider is supported but no value resolved, or an upgrade request was not honored by the provider.
84
- - `unsupported` — the provider has no registered adapter; the policy is informational only. Dispatch follows provider behavior.
104
+ ## Resolve the Effective Named Maximum
85
105
 
86
- In non-interactive mode, an unresolved policy blocks before any implementation work:
106
+ For each phase, the orchestrator determines the task maximum:
87
107
 
88
- ```text
89
- BLOCKED: Codex dispatch policy is unresolved in non-interactive mode.
90
- Set workflow.dispatchPolicy.mode/workflow.dispatchPolicy.policy, workflow.dispatchCeiling.providers.codex, oat_dispatch_policy, or legacy oat_dispatch_ceiling.
91
- ```
108
+ 1. Read project `state.md:oat_dispatch_policy.policy`.
109
+ 2. Read the phase's optional Dispatch Profile row.
110
+ 3. An explicit `economy`, `balanced`, `high`, or `frontier` phase value narrows
111
+ the project maximum and records `task_ceiling_source: phase`.
112
+ 4. Blank, absent, or `auto` uses the project maximum and records
113
+ `task_ceiling_source: project`.
114
+ 5. Reject an unknown phase tier or one above the project maximum.
92
115
 
93
- Dry-run reports unresolved policy and planned behavior without writing project state.
94
-
95
- ### Runtime dispatch selection
96
-
97
- Tier selection decides whether OAT uses native subagents or inline fallback. Runtime dispatch selection is separate: it decides which provider-specific model and effort controls to use for a specific phase when the host exposes those axes.
98
-
99
- The default rule is conservative: use the lowest available model and/or effort that can confidently complete the phase. Escalate before dispatch when the phase is high-risk, broad, cross-cutting, or when retry evidence suggests the current control is underpowered.
100
-
101
- The orchestrator considers, in order:
102
-
103
- 1. A valid `## Dispatch Profile` override row in `plan.md`, if present and the host can honor it.
104
- 2. The phase's files, risk, requirements, and recent review/fix-loop evidence.
105
- 3. The host's actual control surface by axis.
106
-
107
- Model and effort are separate axes. Each axis logs one of these states:
108
-
109
- - `selected:<value>` — the host exposes the axis and the orchestrator chose a value.
110
- - `provider-default` — Codex base/unpinned role follows configured/provider default effort for explicit inherit/default behavior or fallback paths.
111
- - `inherited` — the host exposes the axis and the orchestrator deliberately defers to the parent session.
112
- - `not-applicable` — this host/API has no meaningful per-dispatch concept for that axis.
113
- - `host-auto` — exceptional; the host uses that axis internally but the orchestrator cannot read or pin it.
114
-
115
- In Codex, implementation and fix dispatch classify a preferred effort (`low`, `medium`, `high`, or `xhigh`) and pass it to `oat project dispatch-ceiling resolve --provider codex --role implementer --preferred <effort>`. For capped managed policies, the resolver selects `min(preferred, resolved_cap)` and returns the matching pinned role. For managed `Uncapped`, the resolver selects the preferred pinned role with no cap. For inherit/default mode, it returns no pinned role and OAT uses the base/unpinned role. Reviewer dispatch targets the configured cap only when a capped managed policy exists; managed `Uncapped` and inherit/default use base `oat-reviewer` fallback.
116
-
117
- In Claude Code, implementation and fix dispatch classify a preferred model tier (`haiku`, `sonnet`, `opus`, or `fable`) and pass it to `oat project dispatch-ceiling resolve --provider claude --role implementer --preferred <model> --orchestrator-tier <current-orchestrator-tier>`. Capped policies select `min(preferred, resolved_cap)`, managed `Uncapped` selects the preferred model, and inherit/default omits `model`. Reviewer dispatch passes a `model` only when the resolver returns one. The separate effort axis is `not-applicable`.
118
-
119
- Dispatch logs use a consistent structured block so provider behavior is comparable without flattening the model and effort axes:
120
-
121
- ```text
122
- OAT Dispatch: Phase p01 implementation
123
- Host: Claude Code
124
- Model axis: selected:sonnet
125
- Effort axis: not-applicable
126
- Dispatch target: oat-phase-implementer
127
- Rationale: multi-file integration with mock wiring; sonnet is the lowest sufficient Claude model.
128
-
129
- OAT Dispatch: Phase p02 implementation
130
- Host: Codex
131
- Preferred effort: high
132
- Dispatch policy: economy
133
- Resolved cap: medium
134
- Selected effort: medium
135
- Policy source: repo config
136
- Provider default effort: high
137
- Selection mode: capped
138
- Model axis: inherited
139
- Effort axis: selected:medium
140
- Dispatch target: oat-phase-implementer-medium
141
- Rationale: shared TypeScript/config substrate; high preferred due to integration risk, capped by configured policy.
142
-
143
- OAT Dispatch: Phase p03 review
144
- Host: Codex
145
- Dispatch policy: high
146
- Resolved cap: xhigh
147
- Selected effort: xhigh
148
- Policy source: project state
149
- Provider default effort: medium
150
- Selection mode: review-target
151
- Model axis: inherited
152
- Effort axis: selected:xhigh
153
- Dispatch target: oat-reviewer-xhigh
154
- Rationale: reviewer runs at the configured policy cap for deterministic quality gate behavior.
155
-
156
- OAT Dispatch: Phase p03 implementation
157
- Host: Codex
158
- Preferred effort: xhigh
159
- Dispatch policy: uncapped
160
- Resolved cap: none
161
- Selected effort: xhigh
162
- Policy source: project state
163
- Provider default effort: medium
164
- Selection mode: uncapped
165
- Model axis: inherited
166
- Effort axis: selected:xhigh
167
- Dispatch target: oat-phase-implementer-xhigh
168
- Rationale: high-risk phase; managed uncapped policy allows the preferred pinned variant.
169
-
170
- OAT Dispatch: Phase p04 implementation
171
- Host: Other
172
- Model axis: host-auto
173
- Effort axis: host-auto
174
- Dispatch target: host default
175
- Rationale: host does not expose readable or pinnable dispatch controls; rationale maps to standard effort.
176
-
177
- OAT Dispatch: p02-t10 sidecar exploration
178
- Host: Codex
179
- Preferred effort: provider-default
180
- Dispatch policy: high
181
- Resolved cap: xhigh
182
- Selected effort: provider-default
183
- Policy source: project state
184
- Provider default effort: xhigh
185
- Model axis: inherited
186
- Effort axis: provider-default
187
- Dispatch target: explorer
188
- Rationale: read-only sidecar exploration; generic explorer payload does not pin an OAT-managed effort variant.
116
+ Under a High maximum, configured Economy, Balanced, and High candidates remain
117
+ eligible. Different tasks in the same phase can therefore use different lower
118
+ candidates without changing project state.
119
+
120
+ ## Phase Scope
121
+
122
+ The orchestrator sends one coordinator a Phase Scope:
123
+
124
+ ```yaml
125
+ project: .oat/projects/shared/example
126
+ phase: p02
127
+ mode: implement
128
+ artifact_paths:
129
+ plan: .oat/projects/shared/example/plan.md
130
+ design: .oat/projects/shared/example/design.md
131
+ implementation: .oat/projects/shared/example/implementation.md
132
+ workflow_mode: quick
133
+ active_provider: codex
134
+ project_ceiling_tier: high
135
+ phase_ceiling_tier: balanced
136
+ task_ceiling_tier: balanced
137
+ task_ceiling_source: phase
138
+ commit_convention: 'feat({scope}): {description}'
139
+ coordinator_target: oat-phase-implementer-gpt-5-6-terra-high
189
140
  ```
190
141
 
191
- Phase and review scope packets include dispatch context when the orchestrator has resolved it: `model_axis`, `effort_axis`, `dispatch_policy`, `dispatch_ceiling`, `policy_source`, `ceiling_source` as a compatibility alias, `provider_default_effort`, and `dispatch_rationale`.
142
+ The coordinator target starts the coordinator only. It is never inherited by a
143
+ task.
192
144
 
193
- Generic sidecars such as built-in `explorer` are not OAT-managed implementer, reviewer, or fix roles. If a sidecar payload does not pin a reliable effort/model control, log it as provider-default rather than classifying the task complexity as a selected effort. Sidecar results are advisory context; implementation and review/fix gates still follow the OAT-managed dispatch rules above.
145
+ ## Per-Task Selection
194
146
 
195
- ### Dispatch Profile overrides
147
+ For every task in dependency order, the coordinator classifies only that
148
+ bounded task, chooses one exact candidate at or below the named maximum, and
149
+ calls the resolver with invocation-only `--ceiling-tier`.
196
150
 
197
- `plan.md` should omit `## Dispatch Profile` by default. Missing dispatch rows are normal, because runtime selection has fresher phase context and host capability information at execution time.
151
+ ```bash
152
+ # Codex
153
+ oat project dispatch-ceiling resolve \
154
+ --provider codex \
155
+ --role implementer \
156
+ --ceiling-tier balanced \
157
+ --candidate-model gpt-5.6-terra \
158
+ --candidate-effort medium \
159
+ --project-path .oat/projects/shared/example \
160
+ --json
161
+
162
+ # Claude
163
+ oat project dispatch-ceiling resolve \
164
+ --provider claude \
165
+ --role implementer \
166
+ --ceiling-tier balanced \
167
+ --candidate-model sonnet \
168
+ --json
169
+
170
+ # Cursor
171
+ oat project dispatch-ceiling resolve \
172
+ --provider cursor \
173
+ --role implementer \
174
+ --ceiling-tier balanced \
175
+ --candidate-model 'opaque:model/balanced [v2]' \
176
+ --json
177
+ ```
198
178
 
199
- Add Dispatch Profile rows only when the user has an explicit constraint or preference, such as "use high reasoning effort for the security implementation phase" or "keep documentation-only phases on the lowest tier." Override rows should include a rationale explaining why runtime selection should not decide on its own.
179
+ The override accepts `economy`, `balanced`, `high`, or `frontier`. It applies
180
+ only to that resolver call and never writes config or project state. JSON
181
+ reports `source: invocation` while `providers.<provider>.cellSource` identifies
182
+ the config layer that owns the candidate.
200
183
 
201
- ### Per-phase loop
184
+ The coordinator requires the requested candidate, `selection.candidateTier`,
185
+ `selection.ceilingTier`, exact target, and dispatch arguments to agree. A
186
+ candidate above the maximum or absent from the configured ladder blocks.
202
187
 
203
- For each phase in the plan (whether sequential or inside a parallel group):
188
+ ## Exact Provider Invocation
204
189
 
205
- 1. **Select runtime dispatch control** for the phase and log the chosen control plus rationale.
206
- 2. **Dispatch the selected implementer role** with a Phase Scope block (project path, phase id, artifact paths, commit convention, workflow mode, and dispatch context when known). In Codex, `effort_axis=selected:low|medium|high|xhigh` uses `oat-phase-implementer-low|medium|high|xhigh`. Base `oat-phase-implementer` means provider-default/unpinned fallback.
207
- 3. **Receive the summary:** `DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED`.
208
- - `BLOCKED` stops the run and surfaces the blocker to the user.
209
- 4. **Dispatch the selected reviewer role** with a Review Scope block (phase id, commit range, optional files-changed hint, and dispatch context). The commit range is authoritative; the file list is only orientation metadata. In Codex, pass this as a self-contained packet with `fork_context: false`; use an `oat-reviewer-<value>` variant only for capped managed policies, and use base `oat-reviewer` for managed `Uncapped` or inherit/default. In Claude Code, pass a review `model` only when the resolver returns one and always record `effort_axis=not-applicable`. If the reviewer does not conclude on the first wait, poll once more, then send a concise "return now with current findings" nudge before falling back inline for that phase.
210
- 5. **Parse the verdict:** zero Critical + zero Important findings → `pass`; otherwise `fail`.
211
- 6. **On fail, run the bounded fix loop** (see below).
212
- 7. **Update artifacts** (`implementation.md`, `plan.md` review row, `state.md`) and make the mandatory bookkeeping commit.
213
- 8. **Phase review gate** — when `oat_phase_review_gate` selects the phase, run the optional non-pausing external gate (`oat gate review`) after the step 7 bookkeeping commit and before the HiLL check. A passing gate continues automatically; a blocking gate is received and fixed, reusing the bounded fix loop's `oat_orchestration_retry_limit`. See [Reviews → Phase review gate](reviews.md#phase-review-gate).
214
- 9. **HiLL checkpoint** if the phase id is listed in `oat_plan_hill_phases`.
190
+ Build the complete host payload before writing dispatch logs:
215
191
 
216
- ### Bounded fix loop
192
+ - **Codex:** use `providers.codex.dispatchArgs.variant` as the actual
193
+ `agent_type`. If the registered role cannot be selected, launch a fresh Codex
194
+ child pinned to `selection.target.model` and `selection.target.effort` with
195
+ canonical `oat-phase-implementer` instructions and the Task Scope.
196
+ - **Claude:** pass `providers.claude.dispatchArgs.model` as the actual Task
197
+ `model`. Its separate effort axis is `not-applicable`.
198
+ - **Cursor:** pass `providers.cursor.dispatchArgs.model` byte-for-byte as the
199
+ actual invocation model. The string is opaque; do not normalize it or infer
200
+ family, effort, cost, or capability from its spelling. That opaque value is
201
+ the enforced model argument.
217
202
 
218
- On a `fail` verdict:
203
+ If exact controls cannot be applied, fail closed. A transient retry reuses the
204
+ same complete provider payload. Substantive escalation re-resolves another
205
+ configured candidate within the same named maximum and bounded retry budget.
219
206
 
220
- - Read `oat_orchestration_retry_limit` from `state.md` frontmatter (default `2`, range `0–5`).
221
- - For each retry: re-dispatch the implementer in `fix` mode with the review artifact and findings, then re-dispatch the reviewer.
222
- - On `pass` → exit the loop; the phase disposition becomes `merged` (sequential) or `merged` (parallel, after fan-in).
223
- - On retries exhausted:
224
- - **Sequential mode:** STOP the run with phase id, unresolved findings, and review artifact path.
225
- - **Parallel group mode:** mark the phase `excluded`, do not merge its worktree, continue the remaining phases in the group, and report it in Outstanding Items.
207
+ ## Task Scope and Commit Verification
226
208
 
227
- Tier is never silently downgraded. If a Tier 1 dispatch has a transient failure, the orchestrator retries exactly once; a second failure is treated the same as fix-loop exhaustion for that phase.
209
+ Each worker receives only one task:
228
210
 
229
- ### Escalation termini
211
+ ```yaml
212
+ mode: task-worker
213
+ task_id: p02-t03
214
+ task_name: Add correlation validation
215
+ task_plan: |
216
+ Implement only p02-t03 using its RED/GREEN steps.
217
+ file_boundary:
218
+ - packages/cli/src/commands/gate/index.ts
219
+ - packages/cli/src/commands/gate/index.test.ts
220
+ verification:
221
+ - pnpm --filter @open-agent-toolkit/cli exec vitest run src/commands/gate/index.test.ts
222
+ commit_convention: 'feat(gate): validate correlation'
223
+ ceiling_tier: balanced
224
+ ceiling_source: phase
225
+ dispatch_target: oat-phase-implementer-gpt-5-6-terra-medium
226
+ dispatch_args:
227
+ agent_type: oat-phase-implementer-gpt-5-6-terra-medium
228
+ ```
230
229
 
231
- When escalation re-dispatches at a stronger control, the ladder is provider-specific:
230
+ The Task Scope never contains the whole phase task list. Before dispatch, the
231
+ coordinator records `PRE_TASK_HEAD`. After the worker returns, it verifies:
232
232
 
233
- - **Codex:** `selected:low -> selected:medium -> selected:high -> selected:xhigh`, capped by the resolved managed cap when one exists. Managed `Uncapped` can select the preferred value; inherit/default mode has no OAT escalation control.
234
- - **Claude Code:** `selected:haiku -> selected:sonnet -> selected:opus -> selected:fable`, capped by the resolved managed cap when one exists. Managed `Uncapped` can select the preferred model; inherit/default mode has no OAT escalation control.
233
+ - returned task ID and terminal result
234
+ - verification status
235
+ - reported commit equals current `HEAD`
236
+ - exactly one new commit follows `PRE_TASK_HEAD`
237
+ - changed paths stay inside `file_boundary`
238
+ - the worktree is clean
235
239
 
236
- Escalation re-dispatches still count against the bounded retry budget; escalation changes the dispatch control, it does not grant extra retry attempts.
240
+ Only then does it select the next candidate. Workers run one at a time,
241
+ serially in the same worktree.
237
242
 
238
- ## Plan-declared parallelism
243
+ ## Phase Integration and Review
239
244
 
240
- Phases whose task file sets do not overlap may execute concurrently. Declare this in `plan.md` frontmatter:
245
+ After all task commits are verified, the coordinator runs phase-wide
246
+ verification and integration self-review without editing ordinary task files.
247
+ Its summary records each task's exact target, result, commit, and verification.
241
248
 
242
- ```yaml
243
- oat_plan_parallel_groups: [['p02', 'p03'], ['p04', 'p05']]
244
- ```
249
+ The root orchestrator then dispatches the phase reviewer:
245
250
 
246
- - Each inner array is a group of phases that run concurrently — one worktree per phase.
247
- - Phases not listed in any group run sequentially in plan order.
248
- - Groups themselves run sequentially group `[p02, p03]` merges before group `[p04, p05]` starts.
249
- - Empty or missing field fully sequential, no worktrees created, behavior identical to today's `oat-project-implement`.
251
+ - A capped managed reviewer uses the final candidate at its configured review
252
+ ceiling.
253
+ - Codex uses the exact materialized reviewer role or a fresh pinned child.
254
+ - Claude and Cursor bind the exact resolver-returned model argument.
255
+ - Managed `Uncapped` and explicit inherit/default retain their documented base
256
+ reviewer behavior.
257
+ - Timeout retries preserve the exact role or complete model payload.
250
258
 
251
- ### How a parallel group runs
259
+ Inline review is allowed only with verified equivalent current-host model and
260
+ effort controls. That exception is limited to explicit inherit or
261
+ managed-uncapped base-role behavior; capped managed review never downgrades
262
+ inline. If a review timeout occurs, retry once with the same exact role or
263
+ pinned model payload. If exact dispatch still cannot conclude, fail closed and
264
+ block.
252
265
 
253
- 1. **Bootstrap worktrees** via `oat-worktree-bootstrap-auto`, one per phase, branch name `{project-name}/{pNN}`.
254
- - The bootstrap checks inherited git cleanliness before the all-scope provider sync sweep.
255
- - If that sync leaves `.oat/sync/manifest.json` or provider directories dirty, bootstrap commits only existing or tracked sync-managed paths (`.oat/sync/manifest.json`, `.claude`, `.cursor`, `.codex`) as `chore: run sync` and reports `sync_commit: pass | fail | skip`.
256
- - If any bootstrap fails, cancel successful worktrees and **degrade the entire group** to sequential inline execution.
257
- 2. **Concurrent dispatch** of `oat-phase-implementer` into each worktree (Tier 1 only — Tier 2 cannot run concurrently and also degrades to sequential).
258
- 3. **Wait for terminal verdicts** (`pass` or `failed`) across every phase in the group.
259
- 4. **Fan-in reconciliation in plan order:** for each passing phase, `git merge --no-ff {project-name}/{pNN}`. Integration verification (`pnpm test && pnpm lint && pnpm type-check`) runs after each merge.
260
- 5. **Failed phases are excluded** — their worktrees are preserved and logged in `implementation.md` Outstanding Items. Passing phases still merge (partial merge-back, not atomic).
261
- 6. **Worktree cleanup** runs for merged phases; preserved for excluded phases.
262
- 7. **Bookkeeping commit** + HiLL checkpoint check after the group finishes.
266
+ The review commit range is authoritative. Zero Critical and zero Important
267
+ findings pass; otherwise the bounded fix loop begins.
263
268
 
264
- ### Merge-conflict handling
269
+ ## Bounded Fix Loop
265
270
 
266
- When a merge produces a conflict:
271
+ `oat_orchestration_retry_limit` defaults to `2` and accepts `0` through `5`.
272
+ For each retry:
267
273
 
268
- 1. `git merge --no-ff` is aborted.
269
- 2. `git cherry-pick` of the phase's commits is attempted.
270
- 3. If cherry-pick also conflicts, an **inline conflict-resolution subagent** is dispatched via the Task tool. The orchestrator **never reads conflicted files itself** — that context belongs in a fresh subagent.
271
- 4. The subagent reads conflicted files and project artifacts (`plan.md`, `design.md`, `spec.md`), applies a resolution, runs integration verification, and returns:
272
- - `RESOLVED` merge is committed; orchestrator proceeds.
273
- - `UNRESOLVABLE` or `VERIFICATION_FAILED` → STOP the run with phase id, conflicting files, worktree path, and the subagent's reasoning summary.
274
+ 1. Group findings into bounded one-task fix scopes.
275
+ 2. Reuse the phase coordinator in fix mode.
276
+ 3. Resolve one exact candidate per fix under the same named maximum.
277
+ 4. Dispatch and verify one fix worker at a time.
278
+ 5. Re-dispatch the reviewer over the updated range.
274
279
 
275
- The orchestrator does not proceed past a broken merge.
280
+ The coordinator does not apply fixes itself. Retry exhaustion stops sequential
281
+ execution; in a parallel phase group, the failed phase is excluded and its
282
+ worktree is preserved for diagnosis.
276
283
 
277
- ## Validating plan metadata
284
+ ## Plan-Declared Parallelism
278
285
 
279
- Before dispatching, `oat-project-implement` invokes the validator CLI:
286
+ Parallelism applies across independent phases, not tasks in one worktree:
280
287
 
281
- ```bash
282
- oat project validate-plan --project-path "${PROJECT_PATH}"
288
+ ```yaml
289
+ oat_plan_parallel_groups: [['p02', 'p03'], ['p04', 'p05']]
283
290
  ```
284
291
 
285
- The command enforces:
292
+ - One worktree and one coordinator are created per phase.
293
+ - Coordinators in separate declared worktrees may run concurrently.
294
+ - Every coordinator still dispatches its task workers serially.
295
+ - Phases outside groups run sequentially in plan order.
296
+ - Groups themselves fan in before the next group starts.
297
+
298
+ ### Parallel group flow
299
+
300
+ 1. Bootstrap each worktree with `oat-worktree-bootstrap-auto` from the current
301
+ orchestration HEAD.
302
+ 2. Verify every worktree HEAD before dispatch. Any bootstrap/base mismatch
303
+ degrades the whole group to sequential target-preserving execution.
304
+ 3. Dispatch one phase coordinator per worktree.
305
+ 4. Wait for terminal phase results.
306
+ 5. Merge passing phases back in plan order with integration verification after
307
+ each merge.
308
+ 6. Preserve excluded worktrees and record them in Outstanding Items.
309
+ 7. Clean merged worktrees, commit bookkeeping, then evaluate HiLL checkpoints.
286
310
 
287
- - `oat_plan_parallel_groups` is either missing/empty (treated as fully sequential) or a non-empty nested array of phase ID strings.
288
- - Every referenced phase id exists in the plan body.
289
- - No phase id appears in more than one group.
290
- - No singleton groups (each group must contain at least 2 phases).
291
- - Frontmatter YAML parses cleanly — malformed frontmatter fails with exit 1.
311
+ If merge and cherry-pick both conflict, the orchestrator dispatches a bounded
312
+ conflict-resolution subagent. It does not resolve the conflict in the root
313
+ context. An unresolved or verification-failing conflict stops fan-in.
292
314
 
293
- Non-zero exit stops the run. The skill does not re-implement validation in prose — the CLI is the single source of truth.
315
+ ## Phase Review Gate and HiLL
294
316
 
295
- ## Dry-run mode
317
+ After standard review passes and bookkeeping is committed, an enabled
318
+ `oat_phase_review_gate` may run a target-neutral external review for the phase.
319
+ Passing artifacts are still received for durable disposition; blocking
320
+ findings return through the bounded fix loop. Reusable lifecycle gate commands
321
+ declare the project but do not pin a provider target.
296
322
 
297
- Run with `--dry-run` to preview a run without dispatching anything:
323
+ HiLL pauses remain phase boundaries. They run only after the phase or parallel
324
+ group is integrated, reviewed, and tracked.
325
+
326
+ ## Dry Run
298
327
 
299
328
  ```bash
300
329
  oat-project-implement --dry-run
301
330
  ```
302
331
 
303
- Dry-run:
304
-
305
- - Performs tier selection and plan validation.
306
- - Builds the execution schedule (singleton phases + parallel groups in plan order).
307
- - Prints the planned dispatches and worktree layout.
308
- - Exits 0 without dispatching subagents, creating worktrees, or modifying files.
309
-
310
- Use dry-run as a sanity check after editing `oat_plan_parallel_groups` to confirm the schedule matches your intent.
332
+ Dry-run performs preflight and plan validation, resolves the phase schedule and
333
+ named maxima, and prints planned coordinator/worktree routing. It does not
334
+ dispatch coordinators or workers, create worktrees, or modify files.
311
335
 
312
336
  ## Resumption
313
337
 
314
- On re-invocation after a partial run:
338
+ On re-invocation:
315
339
 
316
- 1. Read `implementation.md` for the most recent orchestration-runs entry.
317
- 2. Compare phase counts against the plan's phase list; phases not covered by any run are the resume targets.
318
- 3. Read `state.md` for `oat_current_task` and cross-check with git log.
319
- 4. If a phase committed implementer output but has no review verdict recorded, the reviewer is re-dispatched for that phase's current HEAD.
320
- 5. If un-cleaned worktrees remain from a prior parallel group, the orchestrator lists them and asks whether to resume or clean up.
340
+ 1. Read `implementation.md`, `plan.md`, and `state.md`.
341
+ 2. Advance a stale pointer to the first incomplete task.
342
+ 3. Cross-check the latest bookkeeping commit with Git.
343
+ 4. Resume an incomplete coordinator at the next unverified task commit.
344
+ 5. Re-dispatch a missing phase reviewer for the current committed phase range.
345
+ 6. Report leftover parallel worktrees before resuming or cleaning them.
321
346
 
322
- First-ever invocations skip resumption detection.
347
+ The one-task commit boundary lets resumption distinguish completed work from an
348
+ unverified worker return without rerunning the whole phase.
323
349
 
324
- ## State and artifact updates
350
+ ## State and Artifact Updates
325
351
 
326
- After each phase (or parallel group) completes, `oat-project-implement` updates:
352
+ After a phase or parallel group completes, `oat-project-implement` updates:
327
353
 
328
- - `implementation.md` appends a `### Run N` entry between the `<!-- orchestration-runs-start -->` markers with tier, dispatch rationale, phase outcomes, parallel groups, and outstanding items.
329
- - `plan.md` updates the reviews table lifecycle (`pending` → `passed` or `fixes_added` → `fixes_completed` → `passed`).
330
- - `state.md` updates `oat_current_task`, `oat_last_commit`, `oat_project_state_updated`, and persists `oat_orchestration_retry_limit` if the user overrode the default.
354
+ - `implementation.md`: task outcomes, exact targets, commits, verification,
355
+ phase summary, review results, and deviations
356
+ - `plan.md`: task status and review lifecycle
357
+ - `state.md`: current task, last commit, phase status, and timestamp
331
358
 
332
- Legacy `oat_execution_mode: subagent-driven` in existing projects is silently ignored and removed on the next bookkeeping write.
359
+ It creates a separate bookkeeping commit after implementation commits. Legacy
360
+ `oat_execution_mode: subagent-driven` is ignored and removed on the next write.
333
361
 
334
362
  ## Related
335
363
 
336
- - [Lifecycle](lifecycle.md) where implementation sits in the full project flow.
337
- - [Artifacts](artifacts.md) — `plan.md` frontmatter contract, including `oat_plan_parallel_groups`.
338
- - [HiLL Checkpoints](hill-checkpoints.md) orthogonal pause semantics; fires after a phase or group completes and merges.
339
- - [CLI Reference](../../reference/cli-reference.md) `oat project validate-plan` and other commands.
364
+ - [Dispatch Policy](dispatch-ceiling.md) - candidate ladders, named maxima, and
365
+ exact provider resolution.
366
+ - [Lifecycle](lifecycle.md) - implementation in the full project flow.
367
+ - [Artifacts](artifacts.md) - plan/state shapes and parallel groups.
368
+ - [Reviews](reviews.md) - standard and external phase reviews.
369
+ - [HiLL Checkpoints](hill-checkpoints.md) - phase pause semantics.