@open-agent-toolkit/cli 0.1.46 → 0.1.50

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 (98) hide show
  1. package/assets/agents/oat-phase-implementer.md +202 -191
  2. package/assets/agents/oat-reviewer.md +11 -1
  3. package/assets/config/dispatch-matrix-recommendation.json +120 -13
  4. package/assets/docs/cli-utilities/configuration.md +213 -113
  5. package/assets/docs/cli-utilities/workflow-gates.md +178 -27
  6. package/assets/docs/contributing/skills.md +14 -8
  7. package/assets/docs/provider-sync/providers.md +46 -8
  8. package/assets/docs/provider-sync/scope-and-surface.md +2 -2
  9. package/assets/docs/reference/cli-reference.md +3 -1
  10. package/assets/docs/reference/oat-directory-structure.md +27 -26
  11. package/assets/docs/workflows/projects/artifacts.md +31 -1
  12. package/assets/docs/workflows/projects/dispatch-ceiling.md +297 -197
  13. package/assets/docs/workflows/projects/implementation-execution.md +306 -249
  14. package/assets/docs/workflows/projects/lifecycle.md +26 -5
  15. package/assets/docs/workflows/projects/reviews.md +27 -2
  16. package/assets/migration/pjm-restructure.md +1 -1
  17. package/assets/public-package-versions.json +4 -4
  18. package/assets/skills/oat-project-implement/SKILL.md +290 -149
  19. package/assets/skills/oat-project-import-plan/SKILL.md +173 -16
  20. package/assets/skills/oat-project-next/SKILL.md +2 -2
  21. package/assets/skills/oat-project-plan/SKILL.md +122 -92
  22. package/assets/skills/oat-project-plan-writing/SKILL.md +246 -15
  23. package/assets/skills/oat-project-quick-start/SKILL.md +157 -107
  24. package/assets/skills/oat-project-review-provide/SKILL.md +110 -22
  25. package/assets/skills/oat-project-review-provide-remote/SKILL.md +28 -1
  26. package/dist/commands/config/index.d.ts +3 -0
  27. package/dist/commands/config/index.d.ts.map +1 -1
  28. package/dist/commands/config/index.js +92 -125
  29. package/dist/commands/doctor/index.d.ts +3 -0
  30. package/dist/commands/doctor/index.d.ts.map +1 -1
  31. package/dist/commands/doctor/index.js +57 -95
  32. package/dist/commands/gate/index.d.ts +7 -1
  33. package/dist/commands/gate/index.d.ts.map +1 -1
  34. package/dist/commands/gate/index.js +615 -67
  35. package/dist/commands/gate/review-verdict.d.ts +16 -0
  36. package/dist/commands/gate/review-verdict.d.ts.map +1 -1
  37. package/dist/commands/gate/review-verdict.js +72 -9
  38. package/dist/commands/project/dispatch-ceiling/index.d.ts.map +1 -1
  39. package/dist/commands/project/dispatch-ceiling/index.js +567 -99
  40. package/dist/commands/providers/codex/materialize.d.ts.map +1 -1
  41. package/dist/commands/providers/codex/materialize.js +6 -1
  42. package/dist/commands/shared/frontmatter.d.ts +4 -0
  43. package/dist/commands/shared/frontmatter.d.ts.map +1 -1
  44. package/dist/commands/shared/frontmatter.js +23 -0
  45. package/dist/commands/status/index.d.ts +1 -0
  46. package/dist/commands/status/index.d.ts.map +1 -1
  47. package/dist/commands/status/index.js +10 -4
  48. package/dist/commands/sync/index.d.ts.map +1 -1
  49. package/dist/commands/sync/index.js +10 -3
  50. package/dist/commands/sync/sync.types.d.ts +1 -0
  51. package/dist/commands/sync/sync.types.d.ts.map +1 -1
  52. package/dist/config/dispatch-matrix.d.ts +59 -0
  53. package/dist/config/dispatch-matrix.d.ts.map +1 -0
  54. package/dist/config/dispatch-matrix.js +264 -0
  55. package/dist/config/oat-config.d.ts +9 -18
  56. package/dist/config/oat-config.d.ts.map +1 -1
  57. package/dist/config/oat-config.js +99 -120
  58. package/dist/config/resolve.d.ts +8 -0
  59. package/dist/config/resolve.d.ts.map +1 -1
  60. package/dist/config/resolve.js +66 -1
  61. package/dist/engine/index.d.ts +1 -1
  62. package/dist/engine/index.d.ts.map +1 -1
  63. package/dist/engine/index.js +1 -1
  64. package/dist/engine/scanner.d.ts +1 -0
  65. package/dist/engine/scanner.d.ts.map +1 -1
  66. package/dist/engine/scanner.js +17 -1
  67. package/dist/fs/paths.d.ts +4 -0
  68. package/dist/fs/paths.d.ts.map +1 -1
  69. package/dist/fs/paths.js +18 -1
  70. package/dist/providers/ceiling/registry.d.ts +1 -0
  71. package/dist/providers/ceiling/registry.d.ts.map +1 -1
  72. package/dist/providers/ceiling/registry.js +12 -5
  73. package/dist/providers/codex/codec/catalog.d.ts +14 -0
  74. package/dist/providers/codex/codec/catalog.d.ts.map +1 -0
  75. package/dist/providers/codex/codec/catalog.js +21 -0
  76. package/dist/providers/codex/codec/materialize.d.ts.map +1 -1
  77. package/dist/providers/codex/codec/materialize.js +6 -5
  78. package/dist/providers/codex/codec/shared.d.ts +19 -0
  79. package/dist/providers/codex/codec/shared.d.ts.map +1 -1
  80. package/dist/providers/codex/codec/shared.js +98 -5
  81. package/dist/providers/codex/codec/sync-extension.d.ts.map +1 -1
  82. package/dist/providers/codex/codec/sync-extension.js +142 -32
  83. package/dist/providers/identity/availability.d.ts +12 -0
  84. package/dist/providers/identity/availability.d.ts.map +1 -1
  85. package/dist/providers/identity/availability.js +72 -29
  86. package/dist/providers/identity/dispatch-report.d.ts +124 -0
  87. package/dist/providers/identity/dispatch-report.d.ts.map +1 -0
  88. package/dist/providers/identity/dispatch-report.js +285 -0
  89. package/dist/providers/identity/dispatch-validation.d.ts +28 -0
  90. package/dist/providers/identity/dispatch-validation.d.ts.map +1 -0
  91. package/dist/providers/identity/dispatch-validation.js +149 -0
  92. package/dist/providers/identity/stamp.d.ts +2 -0
  93. package/dist/providers/identity/stamp.d.ts.map +1 -1
  94. package/dist/providers/identity/stamp.js +7 -1
  95. package/dist/shared/types.d.ts +1 -0
  96. package/dist/shared/types.d.ts.map +1 -1
  97. package/dist/shared/types.js +4 -0
  98. package/package.json +2 -2
@@ -1,346 +1,403 @@
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:
47
61
 
48
- Resolution order:
62
+ - **Tier 1:** native provider subagent dispatch.
63
+ - **Tier 2:** guarded sequential coordinator mechanics when native role
64
+ selection is unavailable.
49
65
 
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
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.
56
71
 
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.
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.
58
75
 
59
- **Policy options (interactive prompt):**
76
+ ## Dispatch Readiness
60
77
 
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 |
78
+ Planning through spec-driven, quick-start, import-plan, or provider-plan-via-
79
+ import performs the same readiness setup:
69
80
 
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.
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.
71
88
 
72
- ```text
73
- Dispatch policy: balanced (codex, managed capped — materialized-role)
74
- Resolved cap: high
75
- Source: project state
76
- Provider default effort: medium
77
- Note: OAT will use resolver-returned materialized Codex role names up to high. Base/unpinned roles resolve through the provider default only on fallback paths.
78
- ```
79
-
80
- **Enforcement modes** (from resolver):
89
+ See [Dispatch Policy](dispatch-ceiling.md) for ladder shapes and ownership.
81
90
 
82
- - `enforced` the adapter compiled concrete dispatch args and the provider accepted them (Codex: materialized model+effort roles; 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.
91
+ ### Validating plan metadata
85
92
 
86
- In non-interactive mode, an unresolved policy blocks before any implementation work:
93
+ Before building the phase schedule, implementation validates plan parallelism:
87
94
 
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.
95
+ ```bash
96
+ oat project validate-plan --project-path .oat/projects/shared/example
91
97
  ```
92
98
 
93
- Dry-run reports unresolved policy and planned behavior without writing project state.
99
+ The command rejects malformed groups, unknown phase IDs, duplicate membership,
100
+ and singleton groups. Invalid metadata blocks execution rather than silently
101
+ falling back to a different schedule.
94
102
 
95
- ### Runtime dispatch selection
103
+ Before phase work, implementation runs provider preflight:
96
104
 
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.
105
+ ```bash
106
+ oat project dispatch-ceiling resolve \
107
+ --provider <active-provider> \
108
+ --preflight \
109
+ --json
110
+ ```
111
+
112
+ An unresolved non-interactive preflight blocks. Managed `Uncapped` and
113
+ `Inherit Host Defaults` are explicit modes; omitted policy state is not an
114
+ implicit fallback.
115
+
116
+ ## Resolve the Effective Named Maximum
98
117
 
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.
118
+ For each phase, the orchestrator determines the task maximum:
100
119
 
101
- The orchestrator considers, in order:
120
+ 1. Read project `state.md:oat_dispatch_policy.policy`.
121
+ 2. Read the phase's optional Dispatch Profile row.
122
+ 3. An explicit `economy`, `balanced`, `high`, or `frontier` phase value narrows
123
+ the project maximum and records `task_ceiling_source: phase`.
124
+ 4. Blank, absent, or `auto` uses the project maximum and records
125
+ `task_ceiling_source: project`.
126
+ 5. Reject an unknown phase tier or one above the project maximum.
102
127
 
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.
128
+ Under a High maximum, configured Economy, Balanced, and High candidates remain
129
+ eligible. Different tasks in the same phase can therefore use different lower
130
+ candidates without changing project state.
106
131
 
107
- Model and effort are separate axes. Each axis logs one of these states:
132
+ ## Phase Scope
108
133
 
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.
134
+ The orchestrator sends one coordinator a Phase Scope:
114
135
 
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 a materialized role name compiled from an explicit model+effort target. For managed `Uncapped`, the resolver selects the preferred materialized role with no cap. For inherit/default mode, it returns no materialized 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.
136
+ ```yaml
137
+ project: .oat/projects/shared/example
138
+ phase: p02
139
+ mode: implement
140
+ artifact_paths:
141
+ plan: .oat/projects/shared/example/plan.md
142
+ design: .oat/projects/shared/example/design.md
143
+ implementation: .oat/projects/shared/example/implementation.md
144
+ workflow_mode: quick
145
+ active_provider: codex
146
+ project_ceiling_tier: high
147
+ phase_ceiling_tier: balanced
148
+ task_ceiling_tier: balanced
149
+ task_ceiling_source: phase
150
+ commit_convention: 'feat({scope}): {description}'
151
+ coordinator_target: oat-phase-implementer-gpt-5-6-terra-high
152
+ ```
116
153
 
117
- Because Codex preferred values are effort names while dispatch matrix cells are
118
- keyed by OAT tiers, managed `Uncapped` maps preferred efforts through the
119
- managed tier table before resolving matrix targets. For example, `xhigh` maps to
120
- the highest matching tier, `frontier`, so `--preferred xhigh` can resolve a
121
- `frontier` Codex matrix target such as
122
- `oat-phase-implementer-gpt-5-6-sol-xhigh`.
154
+ The coordinator target starts the coordinator only. It is never inherited by a
155
+ task.
123
156
 
124
- 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`.
157
+ ## Per-Task Selection
125
158
 
126
- Dispatch logs use a consistent structured block so provider behavior is comparable without flattening the model and effort axes:
159
+ For every task in dependency order, the coordinator classifies only that
160
+ bounded task, chooses one exact candidate at or below the named maximum, and
161
+ calls the resolver with invocation-only `--ceiling-tier`.
127
162
 
128
- ```text
129
- OAT Dispatch: Phase p01 implementation
130
- Host: Claude Code
131
- Model axis: selected:sonnet
132
- Effort axis: not-applicable
133
- Dispatch target: oat-phase-implementer
134
- Rationale: multi-file integration with mock wiring; sonnet is the lowest sufficient Claude model.
135
-
136
- OAT Dispatch: Phase p02 implementation
137
- Host: Codex
138
- Preferred effort: high
139
- Dispatch policy: economy
140
- Resolved cap: medium
141
- Selected effort: medium
142
- Policy source: repo config
143
- Provider default effort: high
144
- Selection mode: capped
145
- Model axis: selected:gpt-5.6-terra
146
- Effort axis: selected:medium
147
- Dispatch target: oat-phase-implementer-gpt-5-6-terra-medium
148
- Rationale: shared TypeScript/config substrate; high preferred due to integration risk, capped by configured policy.
149
-
150
- OAT Dispatch: Phase p03 review
151
- Host: Codex
152
- Dispatch policy: high
153
- Resolved cap: xhigh
154
- Selected effort: xhigh
155
- Policy source: project state
156
- Provider default effort: medium
157
- Selection mode: review-target
158
- Model axis: selected:gpt-5.6-terra
159
- Effort axis: selected:xhigh
160
- Dispatch target: oat-reviewer-gpt-5-6-terra-xhigh
161
- Rationale: reviewer runs at the configured policy cap for deterministic quality gate behavior.
162
-
163
- OAT Dispatch: Phase p03 implementation
164
- Host: Codex
165
- Preferred effort: xhigh
166
- Dispatch policy: uncapped
167
- Resolved cap: none
168
- Selected effort: xhigh
169
- Policy source: project state
170
- Provider default effort: medium
171
- Selection mode: uncapped
172
- Model axis: selected:gpt-5.6-sol
173
- Effort axis: selected:xhigh
174
- Dispatch target: oat-phase-implementer-gpt-5-6-sol-xhigh
175
- Rationale: high-risk phase; managed uncapped policy allows the preferred materialized target.
176
-
177
- OAT Dispatch: Phase p04 implementation
178
- Host: Other
179
- Model axis: host-auto
180
- Effort axis: host-auto
181
- Dispatch target: host default
182
- Rationale: host does not expose readable or pinnable dispatch controls; rationale maps to standard effort.
183
-
184
- OAT Dispatch: p02-t10 sidecar exploration
185
- Host: Codex
186
- Preferred effort: provider-default
187
- Dispatch policy: high
188
- Resolved cap: xhigh
189
- Selected effort: provider-default
190
- Policy source: project state
191
- Provider default effort: xhigh
192
- Model axis: inherited
193
- Effort axis: provider-default
194
- Dispatch target: explorer
195
- Rationale: read-only sidecar exploration; generic explorer payload does not pin an OAT-managed effort variant.
163
+ ```bash
164
+ # Codex
165
+ oat project dispatch-ceiling resolve \
166
+ --provider codex \
167
+ --role implementer \
168
+ --ceiling-tier balanced \
169
+ --candidate-model gpt-5.6-terra \
170
+ --candidate-effort medium \
171
+ --project-path .oat/projects/shared/example \
172
+ --json
173
+
174
+ # Claude
175
+ oat project dispatch-ceiling resolve \
176
+ --provider claude \
177
+ --role implementer \
178
+ --ceiling-tier balanced \
179
+ --candidate-model sonnet \
180
+ --json
181
+
182
+ # Cursor
183
+ oat project dispatch-ceiling resolve \
184
+ --provider cursor \
185
+ --role implementer \
186
+ --ceiling-tier balanced \
187
+ --candidate-model 'opaque:model/balanced [v2]' \
188
+ --json
196
189
  ```
197
190
 
198
- 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`.
191
+ The override accepts `economy`, `balanced`, `high`, or `frontier`. It applies
192
+ only to that resolver call and never writes config or project state. JSON
193
+ reports `source: invocation` while `providers.<provider>.cellSource` identifies
194
+ the config layer that owns the candidate.
199
195
 
200
- 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.
196
+ The coordinator requires the requested candidate, `selection.candidateTier`,
197
+ `selection.ceilingTier`, exact target, and dispatch arguments to agree. A
198
+ candidate above the maximum or absent from the configured ladder blocks.
201
199
 
202
- ### Dispatch Profile overrides
200
+ ## Exact Provider Invocation
203
201
 
204
- `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.
202
+ Build the complete host payload before writing dispatch logs:
205
203
 
206
- 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.
204
+ - **Codex:** use `providers.codex.dispatchArgs.variant` as the actual
205
+ `agent_type`. If the registered role cannot be selected, launch a fresh Codex
206
+ child pinned to `selection.target.model` and `selection.target.effort` with
207
+ canonical `oat-phase-implementer` instructions and the Task Scope.
208
+ - **Claude:** pass `providers.claude.dispatchArgs.model` as the actual Task
209
+ `model`. Its separate effort axis is `not-applicable`.
210
+ - **Cursor:** pass `providers.cursor.dispatchArgs.model` byte-for-byte as the
211
+ actual invocation model. The string is opaque; do not normalize it or infer
212
+ family, effort, cost, or capability from its spelling. That opaque value is
213
+ the enforced model argument.
207
214
 
208
- ### Per-phase loop
215
+ If exact controls cannot be applied, fail closed. A transient retry reuses the
216
+ same complete provider payload. Substantive escalation re-resolves another
217
+ configured candidate within the same named maximum and bounded retry budget.
209
218
 
210
- For each phase in the plan (whether sequential or inside a parallel group):
219
+ ## Dispatch Reports During Execution
211
220
 
212
- 1. **Select runtime dispatch control** for the phase and log the chosen control plus rationale.
213
- 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, selected model+effort axes use the resolver-returned materialized role name, such as `oat-phase-implementer-gpt-5-6-terra-xhigh`. Base `oat-phase-implementer` means provider-default/unpinned fallback.
214
- 3. **Receive the summary:** `DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED`.
215
- - `BLOCKED` stops the run and surfaces the blocker to the user.
216
- 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 the resolver-returned materialized reviewer role 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.
217
- 5. **Parse the verdict:** zero Critical + zero Important findings → `pass`; otherwise `fail`.
218
- 6. **On fail, run the bounded fix loop** (see below).
219
- 7. **Update artifacts** (`implementation.md`, `plan.md` review row, `state.md`) and make the mandatory bookkeeping commit.
220
- 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).
221
- 9. **HiLL checkpoint** if the phase id is listed in `oat_plan_hill_phases`.
221
+ Every implementation, fix, and review resolver call supplies explicit report
222
+ context:
222
223
 
223
- ### Bounded fix loop
224
+ ```text
225
+ --report-scope <phase-or-task> --report-action <implementation|fix|review>
226
+ ```
224
227
 
225
- On a `fail` verdict:
228
+ The completed JSON must contain `dispatchReport.schemaVersion: 1` before the
229
+ provider invocation begins. The coordinator reads the requested candidate,
230
+ candidate tier, ceiling, exact selected target, requested controls, configured
231
+ defaults, and runtime identity from that report as distinct fields. It does not
232
+ infer any of them from a materialized role name or opaque Cursor string.
226
233
 
227
- - Read `oat_orchestration_retry_limit` from `state.md` frontmatter (default `2`, range `0–5`).
228
- - For each retry: re-dispatch the implementer in `fix` mode with the review artifact and findings, then re-dispatch the reviewer.
229
- - On `pass` exit the loop; the phase disposition becomes `merged` (sequential) or `merged` (parallel, after fan-in).
230
- - On retries exhausted:
231
- - **Sequential mode:** STOP the run with phase id, unresolved findings, and review artifact path.
232
- - **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.
234
+ The human dispatch block is rendered from the report. The formal `Dispatch:`
235
+ line is a compatibility view derived from the same report through the dispatch
236
+ stamp adapter. It is not a second schema and must not be assembled by hand.
237
+ Configured defaults and configured gate invocation remain distinct from runtime
238
+ identity; when runtime identity is not observed, the report says so without
239
+ weakening exact requested model or effort controls.
233
240
 
234
- 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.
241
+ ## Task Scope and Commit Verification
235
242
 
236
- ### Escalation termini
243
+ Each worker receives only one task:
237
244
 
238
- When escalation re-dispatches at a stronger control, the ladder is provider-specific:
245
+ ```yaml
246
+ mode: task-worker
247
+ task_id: p02-t03
248
+ task_name: Add correlation validation
249
+ task_plan: |
250
+ Implement only p02-t03 using its RED/GREEN steps.
251
+ file_boundary:
252
+ - packages/cli/src/commands/gate/index.ts
253
+ - packages/cli/src/commands/gate/index.test.ts
254
+ verification:
255
+ - pnpm --filter @open-agent-toolkit/cli exec vitest run src/commands/gate/index.test.ts
256
+ commit_convention: 'feat(gate): validate correlation'
257
+ ceiling_tier: balanced
258
+ ceiling_source: phase
259
+ dispatch_target: oat-phase-implementer-gpt-5-6-terra-medium
260
+ dispatch_args:
261
+ agent_type: oat-phase-implementer-gpt-5-6-terra-medium
262
+ ```
239
263
 
240
- - **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.
241
- - **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.
264
+ The Task Scope never contains the whole phase task list. Before dispatch, the
265
+ coordinator records `PRE_TASK_HEAD`. After the worker returns, it verifies:
242
266
 
243
- Escalation re-dispatches still count against the bounded retry budget; escalation changes the dispatch control, it does not grant extra retry attempts.
267
+ - returned task ID and terminal result
268
+ - verification status
269
+ - reported commit equals current `HEAD`
270
+ - exactly one new commit follows `PRE_TASK_HEAD`
271
+ - changed paths stay inside `file_boundary`
272
+ - the worktree is clean
244
273
 
245
- ## Plan-declared parallelism
274
+ Only then does it select the next candidate. Workers run one at a time,
275
+ serially in the same worktree.
246
276
 
247
- Phases whose task file sets do not overlap may execute concurrently. Declare this in `plan.md` frontmatter:
277
+ ## Phase Integration and Review
248
278
 
249
- ```yaml
250
- oat_plan_parallel_groups: [['p02', 'p03'], ['p04', 'p05']]
251
- ```
279
+ After all task commits are verified, the coordinator runs phase-wide
280
+ verification and integration self-review without editing ordinary task files.
281
+ Its summary records each task's exact target, result, commit, and verification.
252
282
 
253
- - Each inner array is a group of phases that run concurrently — one worktree per phase.
254
- - Phases not listed in any group run sequentially in plan order.
255
- - Groups themselves run sequentially — group `[p02, p03]` merges before group `[p04, p05]` starts.
256
- - Empty or missing field → fully sequential, no worktrees created, behavior identical to today's `oat-project-implement`.
283
+ The root orchestrator then dispatches the phase reviewer:
257
284
 
258
- ### How a parallel group runs
285
+ - A capped managed reviewer uses the final candidate at its configured review
286
+ ceiling.
287
+ - Codex uses the exact materialized reviewer role or a fresh pinned child.
288
+ - Claude and Cursor bind the exact resolver-returned model argument.
289
+ - Managed `Uncapped` and explicit inherit/default retain their documented base
290
+ reviewer behavior.
291
+ - Timeout retries preserve the exact role or complete model payload.
259
292
 
260
- 1. **Bootstrap worktrees** via `oat-worktree-bootstrap-auto`, one per phase, branch name `{project-name}/{pNN}`.
261
- - The bootstrap checks inherited git cleanliness before the all-scope provider sync sweep.
262
- - 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`.
263
- - If any bootstrap fails, cancel successful worktrees and **degrade the entire group** to sequential inline execution.
264
- 2. **Concurrent dispatch** of `oat-phase-implementer` into each worktree (Tier 1 only — Tier 2 cannot run concurrently and also degrades to sequential).
265
- 3. **Wait for terminal verdicts** (`pass` or `failed`) across every phase in the group.
266
- 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.
267
- 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).
268
- 6. **Worktree cleanup** runs for merged phases; preserved for excluded phases.
269
- 7. **Bookkeeping commit** + HiLL checkpoint check after the group finishes.
293
+ Inline review is allowed only with verified equivalent current-host model and
294
+ effort controls. That exception is limited to explicit inherit or
295
+ managed-uncapped base-role behavior; capped managed review never downgrades
296
+ inline. If a review timeout occurs, retry once with the same exact role or
297
+ pinned model payload. If exact dispatch still cannot conclude, fail closed and
298
+ block.
270
299
 
271
- ### Merge-conflict handling
300
+ The review commit range is authoritative. Zero Critical and zero Important
301
+ findings pass; otherwise the bounded fix loop begins.
272
302
 
273
- When a merge produces a conflict:
303
+ ## Bounded Fix Loop
274
304
 
275
- 1. `git merge --no-ff` is aborted.
276
- 2. `git cherry-pick` of the phase's commits is attempted.
277
- 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.
278
- 4. The subagent reads conflicted files and project artifacts (`plan.md`, `design.md`, `spec.md`), applies a resolution, runs integration verification, and returns:
279
- - `RESOLVED` → merge is committed; orchestrator proceeds.
280
- - `UNRESOLVABLE` or `VERIFICATION_FAILED` → STOP the run with phase id, conflicting files, worktree path, and the subagent's reasoning summary.
305
+ `oat_orchestration_retry_limit` defaults to `2` and accepts `0` through `5`.
306
+ For each retry:
281
307
 
282
- The orchestrator does not proceed past a broken merge.
308
+ 1. Group findings into bounded one-task fix scopes.
309
+ 2. Reuse the phase coordinator in fix mode.
310
+ 3. Resolve one exact candidate per fix under the same named maximum.
311
+ 4. Dispatch and verify one fix worker at a time.
312
+ 5. Re-dispatch the reviewer over the updated range.
283
313
 
284
- ## Validating plan metadata
314
+ The coordinator does not apply fixes itself. Retry exhaustion stops sequential
315
+ execution; in a parallel phase group, the failed phase is excluded and its
316
+ worktree is preserved for diagnosis.
285
317
 
286
- Before dispatching, `oat-project-implement` invokes the validator CLI:
318
+ ## Plan-Declared Parallelism
287
319
 
288
- ```bash
289
- oat project validate-plan --project-path "${PROJECT_PATH}"
320
+ Parallelism applies across independent phases, not tasks in one worktree:
321
+
322
+ ```yaml
323
+ oat_plan_parallel_groups: [['p02', 'p03'], ['p04', 'p05']]
290
324
  ```
291
325
 
292
- The command enforces:
326
+ - One worktree and one coordinator are created per phase.
327
+ - Coordinators in separate declared worktrees may run concurrently.
328
+ - Every coordinator still dispatches its task workers serially.
329
+ - Phases outside groups run sequentially in plan order.
330
+ - Groups themselves fan in before the next group starts.
331
+
332
+ ### Parallel group flow
293
333
 
294
- - `oat_plan_parallel_groups` is either missing/empty (treated as fully sequential) or a non-empty nested array of phase ID strings.
295
- - Every referenced phase id exists in the plan body.
296
- - No phase id appears in more than one group.
297
- - No singleton groups (each group must contain at least 2 phases).
298
- - Frontmatter YAML parses cleanly malformed frontmatter fails with exit 1.
334
+ 1. Bootstrap each worktree with `oat-worktree-bootstrap-auto` from the current
335
+ orchestration HEAD.
336
+ 2. Verify every worktree HEAD before dispatch. Any bootstrap/base mismatch
337
+ degrades the whole group to sequential target-preserving execution.
338
+ 3. Dispatch one phase coordinator per worktree.
339
+ 4. Wait for terminal phase results.
340
+ 5. Merge passing phases back in plan order with integration verification after
341
+ each merge.
342
+ 6. Preserve excluded worktrees and record them in Outstanding Items.
343
+ 7. Clean merged worktrees, commit bookkeeping, then evaluate HiLL checkpoints.
299
344
 
300
- Non-zero exit stops the run. The skill does not re-implement validation in prose — the CLI is the single source of truth.
345
+ If merge and cherry-pick both conflict, the orchestrator dispatches a bounded
346
+ conflict-resolution subagent. It does not resolve the conflict in the root
347
+ context. An unresolved or verification-failing conflict stops fan-in.
301
348
 
302
- ## Dry-run mode
349
+ ## Phase Review Gate and HiLL
303
350
 
304
- Run with `--dry-run` to preview a run without dispatching anything:
351
+ After standard review passes and bookkeeping is committed, an enabled
352
+ `oat_phase_review_gate` may run a target-neutral external review for the phase.
353
+ Passing artifacts are still received for durable disposition; blocking
354
+ findings return through the bounded fix loop. Reusable lifecycle gate commands
355
+ declare the project but do not pin a provider target.
356
+
357
+ HiLL pauses remain phase boundaries. They run only after the phase or parallel
358
+ group is integrated, reviewed, and tracked.
359
+
360
+ ## Dry Run
305
361
 
306
362
  ```bash
307
363
  oat-project-implement --dry-run
308
364
  ```
309
365
 
310
- Dry-run:
311
-
312
- - Performs tier selection and plan validation.
313
- - Builds the execution schedule (singleton phases + parallel groups in plan order).
314
- - Prints the planned dispatches and worktree layout.
315
- - Exits 0 without dispatching subagents, creating worktrees, or modifying files.
316
-
317
- Use dry-run as a sanity check after editing `oat_plan_parallel_groups` to confirm the schedule matches your intent.
366
+ Dry-run performs preflight and plan validation, resolves the phase schedule and
367
+ named maxima, and prints planned coordinator/worktree routing. It does not
368
+ dispatch coordinators or workers, create worktrees, or modify files.
318
369
 
319
370
  ## Resumption
320
371
 
321
- On re-invocation after a partial run:
372
+ On re-invocation:
322
373
 
323
- 1. Read `implementation.md` for the most recent orchestration-runs entry.
324
- 2. Compare phase counts against the plan's phase list; phases not covered by any run are the resume targets.
325
- 3. Read `state.md` for `oat_current_task` and cross-check with git log.
326
- 4. If a phase committed implementer output but has no review verdict recorded, the reviewer is re-dispatched for that phase's current HEAD.
327
- 5. If un-cleaned worktrees remain from a prior parallel group, the orchestrator lists them and asks whether to resume or clean up.
374
+ 1. Read `implementation.md`, `plan.md`, and `state.md`.
375
+ 2. Advance a stale pointer to the first incomplete task.
376
+ 3. Cross-check the latest bookkeeping commit with Git.
377
+ 4. Resume an incomplete coordinator at the next unverified task commit.
378
+ 5. Re-dispatch a missing phase reviewer for the current committed phase range.
379
+ 6. Report leftover parallel worktrees before resuming or cleaning them.
328
380
 
329
- First-ever invocations skip resumption detection.
381
+ The one-task commit boundary lets resumption distinguish completed work from an
382
+ unverified worker return without rerunning the whole phase.
330
383
 
331
- ## State and artifact updates
384
+ ## State and Artifact Updates
332
385
 
333
- After each phase (or parallel group) completes, `oat-project-implement` updates:
386
+ After a phase or parallel group completes, `oat-project-implement` updates:
334
387
 
335
- - `implementation.md` appends a `### Run N` entry between the `<!-- orchestration-runs-start -->` markers with tier, dispatch rationale, phase outcomes, parallel groups, and outstanding items.
336
- - `plan.md` updates the reviews table lifecycle (`pending` → `passed` or `fixes_added` → `fixes_completed` → `passed`).
337
- - `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.
388
+ - `implementation.md`: task outcomes, exact targets, commits, verification,
389
+ phase summary, review results, and deviations
390
+ - `plan.md`: task status and review lifecycle
391
+ - `state.md`: current task, last commit, phase status, and timestamp
338
392
 
339
- Legacy `oat_execution_mode: subagent-driven` in existing projects is silently ignored and removed on the next bookkeeping write.
393
+ It creates a separate bookkeeping commit after implementation commits. Legacy
394
+ `oat_execution_mode: subagent-driven` is ignored and removed on the next write.
340
395
 
341
396
  ## Related
342
397
 
343
- - [Lifecycle](lifecycle.md) where implementation sits in the full project flow.
344
- - [Artifacts](artifacts.md) — `plan.md` frontmatter contract, including `oat_plan_parallel_groups`.
345
- - [HiLL Checkpoints](hill-checkpoints.md) orthogonal pause semantics; fires after a phase or group completes and merges.
346
- - [CLI Reference](../../reference/cli-reference.md) `oat project validate-plan` and other commands.
398
+ - [Dispatch Policy](dispatch-ceiling.md) - candidate ladders, named maxima, and
399
+ exact provider resolution.
400
+ - [Lifecycle](lifecycle.md) - implementation in the full project flow.
401
+ - [Artifacts](artifacts.md) - plan/state shapes and parallel groups.
402
+ - [Reviews](reviews.md) - standard and external phase reviews.
403
+ - [HiLL Checkpoints](hill-checkpoints.md) - phase pause semantics.