@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,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-plan-writing
3
- version: 1.2.6
3
+ version: 1.2.8
4
4
  description: Use when authoring or mutating plan.md in any OAT workflow. Defines canonical format invariants — stable task IDs, required sections, review table rules, and resume guardrails.
5
5
  disable-model-invocation: true
6
6
  user-invocable: false
@@ -23,6 +23,227 @@ This is a sub-phase indicator; the calling skill owns the top-level banner.
23
23
 
24
24
  - When invoked by a calling skill, print the sub-banner immediately before plan authoring begins.
25
25
 
26
+ ## Managed Dispatch Readiness and Review Contract
27
+
28
+ All plan-producing workflows and their artifact reviews use this contract:
29
+ spec-driven planning, quick-start, imported plans, and provider-plan-via-import.
30
+ The contract runs before a plan becomes implementation-ready and immediately
31
+ before each artifact review dispatch.
32
+
33
+ 1. Resolve the active provider through the CLI source of truth. For artifact
34
+ review, always request the reviewer contract:
35
+
36
+ ```bash
37
+ oat project dispatch-ceiling resolve --provider "$ACTIVE_PROVIDER" --role reviewer --preflight --json
38
+ ```
39
+
40
+ ### Complete Dispatch Ladder Adoption Contract
41
+
42
+ Before any plan becomes implementation-ready, inspect the effective
43
+ `workflow.dispatchCeiling.providers` value and compare its ordered candidate
44
+ ladders with the bundled
45
+ `packages/cli/config/dispatch-matrix-recommendation.json` source (or the
46
+ installed bundle's `config/dispatch-matrix-recommendation.json` asset). A
47
+ complete custom ladder is allowed, but every supported provider must have valid
48
+ ordered `candidates` cells through the named project ceiling. A legacy scalar,
49
+ single fallback route, missing tier, empty candidates array, or malformed
50
+ ordering is not a complete ladder.
51
+
52
+ When the effective ladder is missing or incomplete, show the complete bundled
53
+ recommendation before asking to write anything:
54
+
55
+ | Provider | Economy | Balanced | High | Frontier |
56
+ | --------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | -------------------------------------- |
57
+ | Codex | Luna/low, Luna/medium, Luna/high | Luna/xhigh, Terra/low, Terra/medium, Terra/high, Terra/xhigh | Sol/low, Sol/medium, Sol/high | Sol/xhigh, Sol/max |
58
+ | Claude | haiku, sonnet | sonnet | opus | fable |
59
+ | Cursor (opaque) | `gpt-5.6-luna-low`, `gpt-5.6-luna-medium`, `gpt-5.6-luna-high` | `gpt-5.6-luna-xhigh`, `gpt-5.6-terra-low`, `gpt-5.6-terra-medium`, `gpt-5.6-terra-high`, `gpt-5.6-terra-xhigh` | `gpt-5.6-sol-low`, `gpt-5.6-sol-medium`, `gpt-5.6-sol-high` | `gpt-5.6-sol-xhigh`, `gpt-5.6-sol-max` |
60
+
61
+ Ask the user to select the owning scope explicitly before any adoption write:
62
+
63
+ 1. **Shared repository** - team-owned `.oat/config.json`; run
64
+ `oat config adopt dispatch-matrix --shared`.
65
+ 2. **Repo-local checkout** - personal `.oat/config.local.json`; run
66
+ `oat config adopt dispatch-matrix --local`.
67
+ 3. **User** - cross-repository `~/.oat/config.json`; run
68
+ `oat config adopt dispatch-matrix --user`.
69
+ 4. **Do not adopt** - leave setup unresolved and block implementation
70
+ readiness.
71
+
72
+ The selected ownership scope owns only the reusable ladder. The active
73
+ project's named ceiling is a separate project-state constraint. A
74
+ project-specific active policy or ceiling must not be written to user
75
+ `~/.oat/config.json`.
76
+
77
+ Adoption preserves explicit cells. Re-run the resolver and re-check the full
78
+ ladder after adoption. If preserved legacy or partial cells still leave the
79
+ ladder incomplete or missing, identify those cells and block; do not overwrite,
80
+ infer, or mark the plan implementation-ready. In non-interactive mode, an
81
+ incomplete or missing ladder blocks readiness without choosing an ownership
82
+ scope.
83
+
84
+ ### Reviewer Ceiling Contract
85
+
86
+ A managed active-provider result is runnable only when the resolver returns
87
+ concrete native dispatch controls or an explicit deferred cross-harness target.
88
+ Otherwise treat the active-provider reviewer contract as unresolved.
89
+ Reviewer resolution uses the final candidate of the configured review ceiling:
90
+ call `--role reviewer` without an ephemeral implementer candidate request.
91
+ Do not select a lower candidate for artifact, phase, project, or final review
92
+ unless a separate reviewed contract explicitly authorizes reviewer lowering and
93
+ defines its bounds. A `## Dispatch Profile` row alone is not such a contract.
94
+
95
+ Bind every concrete managed reviewer target to the actual provider
96
+ invocation before probing generic reviewer availability or selecting an
97
+ execution tier. That target takes precedence over every availability, tier,
98
+ timeout, and inline fallback.
99
+ A concrete managed Codex target takes precedence over tier availability.
100
+
101
+ - Codex: use the exact registered reviewer variant returned by
102
+ `providers.codex.dispatchArgs.variant` when the host can select that role.
103
+ If the exact role is unavailable or the current host cannot select it,
104
+ launch a fresh Codex child with the resolver target's explicit model,
105
+ reasoning effort, and canonical role instructions from
106
+ `.agents/agents/oat-reviewer.md`. If the fresh child cannot preserve the
107
+ target, use only a verified-equivalent inline route or block the review.
108
+ - Claude: require a non-empty `providers.claude.dispatchArgs.model` and put
109
+ that exact value in the actual provider invocation as its `model` argument.
110
+ - Cursor: treat `providers.cursor.dispatchArgs.model` as opaque and put that
111
+ exact, unnormalized string in the actual provider invocation as its `model`
112
+ argument.
113
+
114
+ Build the actual host invocation payload before declaring the target enforced.
115
+ On timeout, retry, or artifact rewrite/re-dispatch, reuse the same exact role or
116
+ complete provider payload, including the exact model argument. If the host
117
+ cannot apply the required role or model argument, fail closed or block unless
118
+ the guarded inline-equivalence rule below applies. Never continue through a
119
+ generic tier fallback.
120
+
121
+ Workflow correctness must not require provider restart or hot reload.
122
+ Runtime materialization may be best effort, but it is not the correctness
123
+ boundary. Never use a managed base role because an exact target is missing or
124
+ unavailable in the current session. Base Codex roles are allowed only for
125
+ explicit inherit/default behavior and the documented managed-uncapped reviewer
126
+ fallback.
127
+
128
+ Inline review of a concrete managed target is permitted only after verifying
129
+ equivalent current-host model and effort controls. Otherwise inline or base
130
+ execution is limited to explicit inherit/default behavior or the documented
131
+ managed-uncapped reviewer fallback.
132
+
133
+ The Auto Artifact-Review Loop below consumes this reviewer dispatch contract.
134
+ Tier selection happens only after the target-preserving route is known and
135
+ changes execution mechanics, not the resolved model/effort contract.
136
+
137
+ ## Shared Phase-Review Setup Contract
138
+
139
+ Every plan-producing workflow invokes this procedure after the complete plan
140
+ has stable phase IDs and before the plan artifact review begins. The calling
141
+ skill owns the prompt and the write to `plan.md`; this section owns the shared
142
+ eligibility, preservation, validation, and non-interactive behavior.
143
+
144
+ ### 1. Preserve explicit plan state
145
+
146
+ Inspect `plan.md` frontmatter before probing configuration. If an explicit
147
+ existing `oat_phase_review_gate` key is present, preserve the complete value
148
+ unchanged. Do not probe targets, prompt, or mutate the setting. This applies to
149
+ enabled, disabled, resumed, and imported explicit values. Report:
150
+
151
+ ```text
152
+ Phase review: preserved existing oat_phase_review_gate setting.
153
+ ```
154
+
155
+ Implementation preflight remains responsible for rejecting a malformed
156
+ explicit value. Planning must not silently repair, replace, or disable it.
157
+
158
+ ### 2. Probe qualifying targets
159
+
160
+ When no explicit setting exists, run the canonical read-only probe:
161
+
162
+ ```bash
163
+ oat gate target list --json
164
+ ```
165
+
166
+ If `oat` is not available directly, use the repository source CLI with the
167
+ same arguments. Do not select or execute a reviewer during this probe. A target
168
+ qualifies only when all three JSON fields are literal booleans with these
169
+ values:
170
+
171
+ ```text
172
+ target.explicitlyConfigured === true
173
+ target.enabled === true
174
+ target.available === true
175
+ ```
176
+
177
+ Built-in-only, disabled, unavailable, missing, or malformed entries do not
178
+ qualify. Never infer qualification from target origin, runtime, invocation
179
+ metadata, command text, or a merely non-empty target list.
180
+
181
+ If the probe fails, emit exactly this concise warning and continue planning
182
+ without adding the setting:
183
+
184
+ ```text
185
+ Warning: phase review target probe failed; phase review remains disabled.
186
+ ```
187
+
188
+ If no qualifying target exists, emit:
189
+
190
+ ```text
191
+ Phase review: disabled (no qualifying target); phase review remains disabled.
192
+ ```
193
+
194
+ Do not invent enablement in either branch.
195
+
196
+ ### 3. Offer the canonical choice
197
+
198
+ When at least one target qualifies and an interactive user-response channel is
199
+ available, offer exactly these outcomes:
200
+
201
+ 1. **All phases** - enable review for every implementation phase.
202
+ 2. **Selected phases** - enable review only for chosen stable phase IDs.
203
+ 3. **Disabled** - leave phase review disabled.
204
+
205
+ For all phases, write the existing plan frontmatter shape:
206
+
207
+ ```yaml
208
+ oat_phase_review_gate:
209
+ enabled: true
210
+ phases: []
211
+ review_type: code
212
+ exit_nonzero_on: important
213
+ ```
214
+
215
+ For selected phases, use the same shape with `phases` populated. Validate the
216
+ selected phase IDs against the actual stable phase IDs in the finished plan.
217
+ Reject unknown IDs and re-prompt instead of persisting them; de-duplicate valid
218
+ IDs and serialize them in plan order, regardless of selection order. Require at
219
+ least one valid phase for this choice.
220
+
221
+ If the user declines or chooses Disabled, do not add
222
+ `oat_phase_review_gate`; emit:
223
+
224
+ ```text
225
+ Phase review: disabled (user declined); phase review remains disabled.
226
+ ```
227
+
228
+ ### 4. Handle non-interactive planning
229
+
230
+ Non-interactive mode includes `OAT_NON_INTERACTIVE=1` and any environment with
231
+ no user-response channel. Never prompt in this mode. Even when the probe finds
232
+ a qualifying target, do not guess all phases or selected phases and do not
233
+ invent enablement. Leave the setting absent and emit:
234
+
235
+ ```text
236
+ Phase review: disabled (non-interactive; no selection recorded); phase review remains disabled.
237
+ ```
238
+
239
+ ### 5. Keep review gates independent from HiLL
240
+
241
+ This setup is independent from HiLL checkpoints. It must not read or change
242
+ `oat_plan_hill_phases`, `oat_auto_review_at_hill_checkpoints`, or
243
+ `oat_hill_completed`. The qualifying target only controls whether the setup
244
+ choice is offered; normal lifecycle gate commands remain provider-neutral.
245
+ They must not add a provider/model `--target` argument.
246
+
26
247
  ## Auto Artifact-Review Loop
27
248
 
28
249
  This is the canonical contract for bounded automated reviews of generated OAT artifacts. Calling skills own the concrete edits, progress indicators, and commits; this section defines the shared loop they must follow.
@@ -45,10 +266,11 @@ Use this loop after an artifact has been written and before the calling skill ha
45
266
  - The bound controls rewrite/re-dispatch cycles after the initial review. A bound of `0` still permits the initial structured review, then surfaces residual findings without retrying.
46
267
 
47
268
  3. **Dispatch `oat-reviewer` in structured mode**
48
- - Tier 1: use the configured `oat-reviewer` subagent when available and authorized.
49
- - Tier 2: if Tier 1 is unavailable or declined, run the same reviewer prompt inline with the same payload and checklist.
269
+ - When the resolver returned a concrete managed Codex target, use its exact registered reviewer or a fresh child pinned to the same model, effort, and canonical instructions. If neither is possible, run inline only with verified equivalent current-host controls; otherwise block.
270
+ - When the resolver returned a concrete managed Claude or Cursor target, require `providers.claude.dispatchArgs.model` or `providers.cursor.dispatchArgs.model` respectively and pass that exact value in the actual provider invocation's `model` argument. Cursor values are opaque and must not be normalized. If the host cannot apply the model argument, fail closed unless inline execution has verified equivalent controls.
271
+ - For explicit inherit/default behavior or the documented managed-uncapped reviewer fallback, Tier 1 uses the configured `oat-reviewer` subagent when available and authorized; Tier 2 may run the same reviewer prompt inline.
50
272
  - Always set `oat_output_mode: structured`; the loop consumes `StructuredFindings` in-memory and the reviewer writes no artifact.
51
- - Do not downgrade the checklist when falling back inline. The fallback changes only execution tier, not review requirements.
273
+ - Do not downgrade the resolved target or checklist when changing execution mechanics.
52
274
 
53
275
  4. **Apply or offer fixes by severity**
54
276
  - If the structured review is clean, proceed to outcome recording.
@@ -57,7 +279,7 @@ Use this loop after an artifact has been written and before the calling skill ha
57
279
  - If a finding cannot be fixed within the artifact boundary, preserve it as residual and surface it before handoff.
58
280
 
59
281
  5. **Rewrite and re-dispatch within the bound**
60
- - After applying fixes, rewrite the artifact and re-dispatch `oat-reviewer` with the same target payload.
282
+ - After applying fixes, rewrite the artifact and re-dispatch `oat-reviewer` with the same complete target payload, including the exact Claude or Cursor `dispatchArgs.model` argument.
61
283
  - Each rewrite/re-dispatch cycle consumes one retry.
62
284
  - Stop when the reviewer returns no findings or when the retry bound is exhausted.
63
285
 
@@ -91,16 +313,22 @@ Runtime routing note:
91
313
 
92
314
  - Keep `oat_ready_for` canonical as `oat-project-implement`.
93
315
  - Declare parallelism via `oat_plan_parallel_groups` in plan.md frontmatter (empty = sequential; nested arrays of phase IDs = parallel groups). `oat-project-implement` reads this field to choose sequential vs worktree-isolated parallel execution.
94
- - Dispatch policies are not stored in `plan.md`. Plan-producing skills resolve
95
- them from `workflow.dispatchPolicy.*`, compatibility
96
- `workflow.dispatchCeiling.*` keys, or project `state.md` frontmatter, then
97
- persist interactive answers back to `state.md` as `oat_dispatch_policy`.
316
+ - Reusable candidate ladders are config-owned and are never copied into
317
+ `plan.md` or project state. Plan-producing skills resolve them from
318
+ `workflow.dispatchCeiling.*`.
319
+ - Project dispatch policy is a named maximum constraint. Persist interactive
320
+ project answers to `state.md` as `oat_dispatch_policy`; never copy
321
+ compiled provider/model targets into that project policy.
98
322
 
99
323
  Additional frontmatter keys (`oat_phase`, `oat_phase_status`, `oat_blockers`, `oat_last_updated`, `oat_generated`, `oat_template`, `oat_import_reference`, `oat_import_source_path`, `oat_import_provider`) are set by calling skills as needed.
100
324
 
101
325
  ### Dispatch Profile Overrides
102
326
 
103
- `## Dispatch Profile` is optional and should be omitted by default. Runtime selection chooses the lowest available tier/model/effort that can confidently complete each phase.
327
+ `## Dispatch Profile` is optional and should be omitted by default. A profile
328
+ may narrow a phase to a named ceiling at or below the project ceiling. The
329
+ named ceiling is a maximum candidate tier, not an exact model-family or effort
330
+ preference; the later coordinator chooses exact task targets from the complete
331
+ configured ladder.
104
332
 
105
333
  Only include the section when the user has explicit constraints or preferences. Routine hand-tuning can be worse than runtime selection because the orchestrator has fresher phase context and host capability information at dispatch time.
106
334
 
@@ -109,16 +337,19 @@ If a user-authored override is needed, use this table shape:
109
337
  ```markdown
110
338
  ## Dispatch Profile
111
339
 
112
- | Phase | Claude model | Codex effort | Rationale |
113
- | ----- | -------------------------------- | ------------------------------ | ----------------------------- |
114
- | pNN | haiku\|sonnet\|opus\|fable\|auto | low\|medium\|high\|xhigh\|auto | why this constraint is needed |
340
+ | Phase | Named ceiling | Rationale |
341
+ | ----- | --------------------------------------- | ----------------------------- |
342
+ | pNN | economy\|balanced\|high\|frontier\|auto | why this constraint is needed |
115
343
  ```
116
344
 
117
345
  Validation rules for explicit rows:
118
346
 
119
347
  - `Phase` must match a real `pNN` phase in the plan.
120
- - `Claude model` must be `haiku`, `sonnet`, `opus`, `fable`, `auto`, or blank.
121
- - `Codex effort` must be `low`, `medium`, `high`, `xhigh`, `auto`, or blank. In Codex, explicit effort values are preferred controls. `oat-project-implement` caps them when a capped managed policy exists, selects them directly under managed `Uncapped`, and maps selected efforts to pinned implementer variants when available. Provider default effort is informational only for explicit inherit/default behavior or base/unpinned fallback paths.
348
+ - `Named ceiling` must be `economy`, `balanced`, `high`, `frontier`,
349
+ `auto`, or blank, and it must not exceed the project named ceiling.
350
+ - Under a `High` ceiling, configured candidates from `Economy`, `Balanced`, and
351
+ `High` remain eligible and available; the row does not pin Sol, a Claude
352
+ family, a Cursor string, or an effort value.
122
353
  - Blank or `auto` means no explicit constraint for that provider.
123
354
  - `Rationale` is recommended and should explain why runtime selection should not decide on its own.
124
355
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-quick-start
3
- version: 2.1.10
3
+ version: 2.1.13
4
4
  description: Use when a task is small enough for quick mode or rapid iteration is preferred. Scaffolds a lightweight OAT project from discovery directly to a runnable plan, with optional brainstorming and lightweight design.
5
5
  argument-hint: '<project-name> ["project description"]'
6
6
  oat_gateable: true
@@ -434,20 +434,54 @@ git add "$PROJECT_PATH/discovery.md" "$PROJECT_PATH/state.md"
434
434
  git diff --cached --quiet || git commit -m "chore(oat): complete quick-start discovery for {project-name}"
435
435
  ```
436
436
 
437
+ ### Step 2.9: Snapshot Explicit Phase-Review Setting Before Plan Rewrite
438
+
439
+ Before any template-based create, update, replacement, or normalization of
440
+ `"$PROJECT_PATH/plan.md"`, inspect the existing plan frontmatter and snapshot:
441
+
442
+ 1. The key presence of `oat_phase_review_gate` as a separate boolean. Presence
443
+ is not truthiness: an explicit key is authoritative regardless of validity or
444
+ value.
445
+ 2. When the key is present, the complete explicit value as the exact YAML
446
+ frontmatter entry, including its full nested mapping or scalar form. Preserve
447
+ enabled, disabled, selected-phase, `null`, and malformed-for-contract values
448
+ verbatim; do not normalize, validate, or reconstruct the value while taking
449
+ the snapshot.
450
+
451
+ This snapshot protects a resumed explicit value from the template rewrite. Its
452
+ explicit presence must not trigger a target probe or re-prompt, even when the
453
+ preserved value is `null` or malformed for the phase-review contract.
454
+
437
455
  ### Step 3: Generate Plan Directly
438
456
 
439
457
  Create/update `"$PROJECT_PATH/plan.md"` from `.oat/templates/plan.md`.
440
458
 
459
+ Restore the exact snapshot into the resulting `plan.md` frontmatter as part of
460
+ the first resulting plan write, before any later frontmatter rewrite and before
461
+ Step 3.55 invokes the shared setup contract. Carry the snapshot losslessly
462
+ through every subsequent plan update. When the key was explicitly present, its
463
+ complete value must still be present exactly as captured; do not probe,
464
+ re-prompt, validate, or replace it here. When the key was absent, do not invent
465
+ one before the shared setup contract runs.
466
+
441
467
  Required frontmatter updates:
442
468
 
443
- - `oat_status: complete`
444
- - `oat_ready_for: oat-project-implement`
469
+ - `oat_status: in_progress`
470
+ - `oat_ready_for: null`
445
471
  - `oat_phase: plan`
446
- - `oat_phase_status: complete`
472
+ - `oat_phase_status: in_progress`
447
473
  - `oat_plan_source: quick`
448
474
  - `oat_import_reference: null`
449
475
  - `oat_import_source_path: null`
450
476
  - `oat_import_provider: null`
477
+ - `oat_template: true`
478
+
479
+ These values are the interruption-safe pre-review state. Here,
480
+ `oat_template: true` marks the generated plan as still owned by the current
481
+ planning workflow even after its substantive content has been written. If the
482
+ skill pauses, is interrupted, or cannot resolve dispatch before Step 3.7,
483
+ persist and commit this state. `oat-project-next` must route it back to the
484
+ current planning workflow and cannot advance it to implementation.
451
485
 
452
486
  Plan requirements — apply `oat-project-plan-writing` canonical format invariants:
453
487
 
@@ -470,112 +504,96 @@ Required parallelism pass before finalizing the plan:
470
504
  ### Step 3.5: Resolve Dispatch Policy Before Implementation Readiness
471
505
 
472
506
  Before moving the quick project to ready-for-implementation, resolve the
473
- dispatch policy.
474
-
475
- Resolution order:
476
-
477
- 1. Config keys `workflow.dispatchPolicy.mode` / `workflow.dispatchPolicy.policy` via the resolver CLI
478
- 2. Layered dispatch matrix / compatibility config under `workflow.dispatchCeiling.providers.<provider>` and `workflow.dispatchCeiling.providers.<provider>.<tier>`
479
- 3. Project `state.md` frontmatter key `oat_dispatch_policy`
480
- 4. Legacy project `state.md` frontmatter key `oat_dispatch_ceiling`
481
- 5. Interactive quick-planning prompt (below)
482
- 6. Leave unresolved for implementation preflight when non-interactive
507
+ complete dispatch ladder and the project named ceiling.
483
508
 
484
- If no policy resolves and the session is interactive, present the dispatch
485
- policy prompt once before finalizing `plan.md`:
509
+ Invoke the `Complete Dispatch Ladder Adoption Contract` from
510
+ `oat-project-plan-writing`. If the effective ladder is missing or incomplete,
511
+ show the full bundled recommendation and ask the user to select its owning
512
+ scope before running exactly one command:
486
513
 
487
- ```text
488
- Set the dispatch policy — how OAT should choose subagent model/effort controls.
514
+ ```bash
515
+ oat config adopt dispatch-matrix --shared
516
+ oat config adopt dispatch-matrix --local
517
+ oat config adopt dispatch-matrix --user
518
+ ```
489
519
 
490
- Managed capped policies:
491
- 1. Economy — Codex: medium · Claude: sonnet
492
- 2. Balanced — Codex: high · Claude: sonnet (recommended)
493
- 3. High — Codex: xhigh · Claude: opus
494
- 4. Frontier — Codex: xhigh · Claude: fable
520
+ The selected scope owns only the reusable ladders. A project-specific active
521
+ policy or ceiling must not be written to user `~/.oat/config.json`.
522
+ Adoption preserves explicit cells, so re-run the resolver and completeness
523
+ check. An incomplete or missing ladder after adoption blocks readiness; do not
524
+ overwrite explicit cells or silently infer a fallback. Non-interactive setup
525
+ also blocks on a missing or incomplete ladder.
495
526
 
496
- Managed uncapped:
497
- 5. Uncapped — OAT selects the preferred implementer/fix target without a stored maximum cap.
527
+ Then resolve the named ceiling in this order:
498
528
 
499
- Host defaults:
500
- 6. Inherit Host Defaults — OAT does not select model/effort controls.
529
+ 1. Project `state.md` frontmatter `oat_dispatch_policy`
530
+ 2. Legacy project `oat_dispatch_ceiling`
531
+ 3. Config `workflow.dispatchPolicy.*` as a proposed starting value
532
+ 4. Interactive quick-planning prompt
533
+ 5. Unresolved non-interactive state blocks implementation readiness
501
534
 
502
- OAT applies managed policies where the provider exposes a reliable mechanism
503
- (Codex: pinned variants; Claude: Task model parameter). Other providers may
504
- treat managed policies as advisory until their provider column has a resolvable
505
- matrix cell.
535
+ Generate the canonical prompt with:
506
536
 
507
- For multi-family providers such as Cursor, these options choose the abstract
508
- policy rung; concrete model values live in the dispatch matrix under
509
- `workflow.dispatchCeiling.providers.*`. If the user wants OAT's recommended
510
- starting matrix, offer `oat config adopt dispatch-matrix` for the chosen config
511
- layer before finalizing `plan.md`.
537
+ ```bash
538
+ oat project dispatch-ceiling choices --format markdown
512
539
  ```
513
540
 
514
- **Managed capped policy selection (options 1-4)** persists `mode: managed`,
515
- `policy`, and the compiled provider targets. On selection, print the exact
516
- compiled result (e.g., "Dispatch policy set: balanced Codex: high · Claude:
517
- sonnet") before proceeding.
518
-
519
- If the resolver reports that the selected policy has a missing matrix cell for
520
- the active provider/tier, run prompt-and-persist once before final review:
521
-
522
- 1. Ask for the exact provider value for the missing cell, using the provider's
523
- native vocabulary (for example, `composer-2.5`, `gpt-5.5-xhigh`, `opus`, or
524
- `xhigh`), or an ordered route when escalation needs multiple targets.
525
- 2. Persist the answer to the selected config layer with
526
- `workflow.dispatchCeiling.providers.<provider>.<tier>`. Use project
527
- `state.md` only for sparse project-specific matrix overrides.
528
- 3. Re-run the resolver. Do not silently treat a missing cell as uncapped,
529
- inherited, or provider-default behavior.
530
-
531
- **Uncapped (option 5)** persists explicit managed uncapped state. It does not
532
- write provider caps, and it must not be represented by leaving dispatch policy
533
- state absent.
541
+ Do not hand-type the dispatch policy menu.
542
+ `Uncapped`: OAT still manages dispatch selection. It has no named maximum.
543
+ `Inherit Host Defaults`: OAT does not choose model or effort.
544
+ `Leave Unresolved` is a planning deferral.
545
+ Implementation preflight must block until a runnable ceiling resolves.
534
546
 
535
- **Inherit Host Defaults (option 6)** persists explicit inherit/default state.
536
- Use this only when the user wants OAT to leave implementation, fix, and review
537
- model/effort controls to the executing host/provider.
538
-
539
- Persist the answer in `"$PROJECT_PATH/state.md"` frontmatter using the
540
- normalized shape:
547
+ The menu includes every named tier plus `Uncapped`, `Inherit Host
548
+ Defaults`, and `Leave Unresolved`. A named tier is a maximum, never an
549
+ enduring exact model-family or effort preference. A named `High` ceiling
550
+ keeps lower configured `Economy`, `Balanced`, and `High` candidates
551
+ available at or below that maximum. An optional phase Dispatch Profile may
552
+ narrow the maximum.
541
553
 
542
554
  ```yaml
543
555
  oat_dispatch_policy:
544
556
  mode: managed
545
- policy: balanced
546
- providers:
547
- codex: high
548
- claude: sonnet
557
+ policy: high
549
558
  source: project-state
550
559
  ```
551
560
 
552
- For `Uncapped`:
561
+ Persist the active project ceiling only in `"$PROJECT_PATH/state.md"`. Do not
562
+ copy compiled provider targets into this shape or user config. `Uncapped` and
563
+ `Inherit Host Defaults` remain explicit modes; `Leave Unresolved` and
564
+ non-interactive unresolved state are not implementation-ready.
553
565
 
554
- ```yaml
555
- oat_dispatch_policy:
556
- mode: managed
557
- policy: uncapped
558
- source: project-state
559
- ```
566
+ ### Step 3.55: Configure Optional Phase Review
560
567
 
561
- For `Inherit Host Defaults`:
568
+ After the generated quick plan has stable phase IDs and before Step 3.6 starts
569
+ the plan artifact review, invoke the `Shared Phase-Review Setup Contract` from
570
+ `oat-project-plan-writing`.
562
571
 
563
- ```yaml
564
- oat_dispatch_policy:
565
- mode: inherit
566
- source: project-state
567
- ```
568
-
569
- Do not prompt when `OAT_NON_INTERACTIVE=1` or when no user-response channel
570
- exists. In that case, leave the value unresolved. `oat-project-implement`
571
- must block before work starts if it still cannot resolve a policy.
572
+ If `plan.md` already contains an explicit `oat_phase_review_gate`, preserve it
573
+ through the shared contract without probing, prompting, or mutation. Otherwise
574
+ let the contract probe qualifying targets and offer all phases, selected
575
+ phases, or disabled. If the probe fails, no target qualifies, or the user
576
+ declines, leave phase review disabled and continue with the contract's concise
577
+ status output.
572
578
 
573
- Do not treat provider default effort as the OAT dispatch policy. Provider
574
- defaults apply only for explicit inherit/default behavior or base/unpinned
575
- fallback paths.
579
+ This phase-review setup is independent from HiLL checkpoints. Do not read or
580
+ change HiLL fields here, and do not add a provider/model `--target` to any
581
+ lifecycle command.
576
582
 
577
583
  ### Step 3.6: Run Plan Artifact Review Loop
578
584
 
585
+ Before dispatching the artifact reviewer, invoke the `Managed Dispatch
586
+ Readiness and Review Contract` from `oat-project-plan-writing`:
587
+
588
+ ```bash
589
+ oat project dispatch-ceiling resolve --provider "$ACTIVE_PROVIDER" --role reviewer --preflight --json
590
+ ```
591
+
592
+ If managed resolution or the complete ladder is unresolved, return to Step
593
+ 3.5, adopt the recommendation in the selected ownership scope, and re-run the
594
+ resolver. Do not hand the quick plan to implementation while either contract is
595
+ unresolved.
596
+
579
597
  Invoke the shared `Auto Artifact-Review Loop` from `oat-project-plan-writing` with target `plan` before syncing project state or handing off to implementation.
580
598
 
581
599
  Required payload:
@@ -590,11 +608,44 @@ Apply the shared loop exactly:
590
608
 
591
609
  - Resolve `workflow.autoArtifactReview.plan`; only an explicit `false` skips the loop.
592
610
  - Resolve `oat_orchestration_retry_limit` from project state, defaulting to `2`.
593
- - Dispatch `oat-reviewer` in structured mode using Tier 1 subagent when available and Tier 2 inline fallback otherwise.
611
+ - For a concrete managed target, dispatch the exact registered reviewer role. If the host cannot select it, launch a fresh Codex child pinned to the resolved model and reasoning effort with the canonical reviewer instructions.
612
+ - For Claude or Cursor, pass the exact resolver-returned
613
+ `providers.<provider>.dispatchArgs.model` as the actual invocation's model
614
+ argument. Preserve the same complete payload on timeout and retry; Cursor
615
+ strings remain opaque.
616
+ - Run inline only with verified equivalent current-host model and effort controls, or for explicit inherit/default behavior or the managed-uncapped reviewer exception. If none applies, fail closed before artifact review.
617
+ - If the reviewer times out or does not conclude, poll and nudge once, then retry the same exact role or pinned child within the retry bound. If that target-preserving retry still fails, fail closed; never downgrade the review to inline.
594
618
  - Apply Critical and Important artifact-local fixes when unambiguous; offer Medium and Minor fixes instead of silently applying them.
595
619
  - Re-dispatch after rewrites until clean or the retry bound is exhausted.
596
620
  - Update the `plan` artifact row in the `## Reviews` table to `passed` when clean. If residual findings remain, preserve the row and surface the residual findings before downstream handoff.
597
621
 
622
+ ### Step 3.7: Record Review Disposition and Mark Plan Complete
623
+
624
+ Before changing readiness, durably record the review outcome in `plan.md`:
625
+
626
+ - When review ran, update the `plan` review row in the `## Reviews` section to
627
+ the outcome reached by Step 3.6. Use `passed` only for a clean result. If
628
+ residual findings remain, retain their actual non-passed status and add a
629
+ concise residual-finding disposition in the same section.
630
+ - When `workflow.autoArtifactReview.plan` is explicitly `false`, record the
631
+ explicit skip in the `## Reviews` section as
632
+ `Plan artifact review: skipped (workflow.autoArtifactReview.plan=false)`.
633
+ Do not claim that the plan passed review.
634
+
635
+ The review row or explicit skip must be written to `plan.md`; chat or status
636
+ output alone is not durable. Only after that write succeeds, atomically update
637
+ the plan frontmatter:
638
+
639
+ - `oat_status: complete`
640
+ - `oat_ready_for: oat-project-implement`
641
+ - `oat_phase_status: complete`
642
+ - `oat_template: false`
643
+
644
+ If dispatch remains unresolved, review execution fails closed, or the outcome
645
+ cannot be recorded, leave the Step 3 pre-review values unchanged and commit
646
+ them before stopping. Never expose a partially reviewed quick plan to
647
+ `oat-project-implement`.
648
+
598
649
  ### Step 4: Sync Project State
599
650
 
600
651
  Update `"$PROJECT_PATH/state.md"`:
@@ -654,18 +705,29 @@ Before reporting this skill as complete, run the configured gate as the final st
654
705
 
655
706
  If the command returns JSON `null`, no gate is configured; the skill is complete.
656
707
 
657
- 2. If a gate config is returned, run its `command` exactly as configured. Capture stdout, stderr, and the exit code. A zero exit code means the gate passed and the skill is complete.
708
+ 2. Export the resolved project path into the command shell:
709
+
710
+ ```bash
711
+ export PROJECT_PATH
712
+ ```
713
+
714
+ If the resolved command invokes `oat gate review`, the configured review command must already include `--project "$PROJECT_PATH"` and must not include `--target <id>`. A valid reusable shape is `oat gate review --project "$PROJECT_PATH" ...`. If the declaration is missing, stop and migrate the stored gate command; do not inject or append arguments at execution time.
715
+
716
+ 3. Execute the resolved command exactly as configured. Capture stdout, stderr, the exit code, and the structured JSON result. A zero exit code means the review passed its threshold, but it does not by itself authorize artifact receipt or complete the handoff.
658
717
 
659
- 3. Review-artifact handoff:
660
- - If the gate reports a produced review artifact, the host must run `oat-project-review-receive` to receive and disposition that artifact before treating the review as consumed.
661
- - This applies to `oat gate review ...` outputs regardless of whether the gate ultimately exits zero or nonzero; the command output owns the exact artifact path, and receive-review owns disposition and archival.
718
+ 4. Review-artifact handoff:
719
+ - Parse the structured gate result. An exit code or artifact path alone never authorizes `oat-project-review-receive`.
720
+ - Invoke receive only when all three conditions hold: `status` is `ok` or `blocked`, the envelope explicitly sets `receiveEligible: true`, and a non-null `handoff` confirms the artifact was corroborated.
721
+ - `receiveEligible: false` is a hard stop even when `artifactPath` is present. Never receive `targeting_correlation_failed`; correct the project/run routing and run a new gate.
722
+ - Keep `artifact_validation_failed` outside receive until the artifact is corrected and the gate successfully revalidates it. Treat `review_failed`, unknown statuses, null handoffs, and contradictory eligibility fields as operational failures.
723
+ - `blocked` exits nonzero but is receive-eligible; `ok` exits zero and still requires durable receive disposition. Route by structured status and eligibility, not by exit code.
662
724
 
663
- 4. If the command exits nonzero, use `description` to orient the next steps and handle `onFailure`:
725
+ 5. If the command exits nonzero, use `description` to orient the next steps and handle `onFailure`:
664
726
  - `block`: read gate feedback, remediate, and re-run the gate up to `maxAttempts` attempts (default `2`). If attempts are exhausted, escalate to the human with accumulated feedback and append that feedback to `implementation.md`. Treat a launch failure, missing CLI, or no eligible runtime as escalation-biased and do not spend it as a remediation attempt.
665
727
  - `prompt`: surface the gate failure and ask the human how to proceed.
666
728
  - `warn`: record the gate failure and continue.
667
729
 
668
- 5. Runtime selection note (V1): the step runs the gate `command` as-is and reads no OAT runtime env var. By default, `oat gate review` and `oat gate cross-provider-exec` resolve the current host from built-in `hostDetectionCommand`s and avoid the same runtime when no exact target is supplied. Reusable lifecycle skill-gate commands should normally omit `--target <id>` so independent review stays provider-neutral. Use explicit targets only for manual/debug commands or deliberate local/user-specific overrides; do not hardcode provider/model targets in bundled skill guidance or shared lifecycle gate examples.
730
+ 6. Runtime selection note (V1): the step runs the gate `command` as-is and reads no OAT runtime env var. By default, `oat gate review` and `oat gate cross-provider-exec` resolve the current host from built-in `hostDetectionCommand`s and avoid the same runtime when no exact target is supplied. Reusable lifecycle skill-gate commands must not include `--target <id>` so independent review stays provider-neutral. Use explicit targets only for manual/debug commands or deliberate local/user-specific overrides; do not hardcode provider/model targets in bundled skill guidance or shared lifecycle gate examples.
669
731
 
670
732
  ### Step 7: Output Next Action
671
733
 
@@ -688,4 +750,4 @@ Report:
688
750
  - ✅ `plan.md` records the plan artifact review row unless `workflow.autoArtifactReview.plan` was explicitly disabled.
689
751
  - ✅ `implementation.md` is initialized for resumable execution.
690
752
  - ✅ Changed quick-start artifacts are committed before handoff or pause; `.oat/state.md` is refreshed locally when available.
691
- - ✅ Configured gate has run, and any produced review artifact has been handed off to `oat-project-review-receive` before it is treated as consumed.
753
+ - ✅ Configured gate has run, and only a corroborated, receive-eligible artifact has been handed off to `oat-project-review-receive` before it is treated as consumed.