@open-agent-toolkit/cli 0.1.46 → 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.
- package/assets/agents/oat-phase-implementer.md +202 -191
- package/assets/agents/oat-reviewer.md +11 -1
- package/assets/config/dispatch-matrix-recommendation.json +120 -13
- package/assets/docs/cli-utilities/configuration.md +172 -113
- package/assets/docs/cli-utilities/workflow-gates.md +161 -27
- package/assets/docs/contributing/skills.md +14 -8
- package/assets/docs/provider-sync/providers.md +41 -7
- package/assets/docs/provider-sync/scope-and-surface.md +2 -2
- package/assets/docs/reference/cli-reference.md +3 -1
- package/assets/docs/reference/oat-directory-structure.md +27 -26
- package/assets/docs/workflows/projects/artifacts.md +31 -1
- package/assets/docs/workflows/projects/dispatch-ceiling.md +235 -187
- package/assets/docs/workflows/projects/implementation-execution.md +283 -260
- package/assets/docs/workflows/projects/lifecycle.md +26 -5
- package/assets/docs/workflows/projects/reviews.md +27 -2
- package/assets/migration/pjm-restructure.md +1 -1
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-project-implement/SKILL.md +247 -133
- package/assets/skills/oat-project-import-plan/SKILL.md +173 -16
- package/assets/skills/oat-project-next/SKILL.md +2 -2
- package/assets/skills/oat-project-plan/SKILL.md +122 -92
- package/assets/skills/oat-project-plan-writing/SKILL.md +246 -15
- package/assets/skills/oat-project-quick-start/SKILL.md +157 -107
- package/assets/skills/oat-project-review-provide/SKILL.md +94 -22
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +64 -39
- package/dist/commands/doctor/index.d.ts.map +1 -1
- package/dist/commands/doctor/index.js +21 -6
- package/dist/commands/gate/index.d.ts +7 -1
- package/dist/commands/gate/index.d.ts.map +1 -1
- package/dist/commands/gate/index.js +544 -67
- package/dist/commands/gate/review-verdict.d.ts +16 -0
- package/dist/commands/gate/review-verdict.d.ts.map +1 -1
- package/dist/commands/gate/review-verdict.js +72 -9
- package/dist/commands/project/dispatch-ceiling/index.d.ts.map +1 -1
- package/dist/commands/project/dispatch-ceiling/index.js +452 -16
- package/dist/commands/providers/codex/materialize.d.ts.map +1 -1
- package/dist/commands/providers/codex/materialize.js +6 -1
- package/dist/commands/shared/frontmatter.d.ts +4 -0
- package/dist/commands/shared/frontmatter.d.ts.map +1 -1
- package/dist/commands/shared/frontmatter.js +23 -0
- package/dist/commands/status/index.d.ts +1 -0
- package/dist/commands/status/index.d.ts.map +1 -1
- package/dist/commands/status/index.js +10 -4
- package/dist/commands/sync/index.d.ts.map +1 -1
- package/dist/commands/sync/index.js +10 -3
- package/dist/commands/sync/sync.types.d.ts +1 -0
- package/dist/commands/sync/sync.types.d.ts.map +1 -1
- package/dist/config/oat-config.d.ts +19 -2
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +139 -24
- package/dist/config/resolve.d.ts +8 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +66 -2
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +1 -1
- package/dist/engine/scanner.d.ts +1 -0
- package/dist/engine/scanner.d.ts.map +1 -1
- package/dist/engine/scanner.js +17 -1
- package/dist/fs/paths.d.ts +4 -0
- package/dist/fs/paths.d.ts.map +1 -1
- package/dist/fs/paths.js +18 -1
- package/dist/providers/ceiling/registry.d.ts +1 -0
- package/dist/providers/ceiling/registry.d.ts.map +1 -1
- package/dist/providers/ceiling/registry.js +12 -5
- package/dist/providers/codex/codec/catalog.d.ts +14 -0
- package/dist/providers/codex/codec/catalog.d.ts.map +1 -0
- package/dist/providers/codex/codec/catalog.js +21 -0
- package/dist/providers/codex/codec/materialize.d.ts.map +1 -1
- package/dist/providers/codex/codec/materialize.js +6 -5
- package/dist/providers/codex/codec/shared.d.ts +19 -0
- package/dist/providers/codex/codec/shared.d.ts.map +1 -1
- package/dist/providers/codex/codec/shared.js +98 -5
- package/dist/providers/codex/codec/sync-extension.d.ts.map +1 -1
- package/dist/providers/codex/codec/sync-extension.js +142 -32
- package/dist/providers/identity/stamp.d.ts.map +1 -1
- package/dist/providers/identity/stamp.js +4 -0
- package/dist/shared/types.d.ts +1 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.js +4 -0
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-implement
|
|
3
|
-
version: 2.0.
|
|
4
|
-
description: Use when plan.md is ready for execution. Dispatches phase-
|
|
3
|
+
version: 2.0.33
|
|
4
|
+
description: Use when plan.md is ready for execution. Dispatches phase coordinators that select one exact target-pinned worker per task; supports bounded fix loops and plan-declared worktree-isolated parallel phases.
|
|
5
5
|
oat_gateable: true
|
|
6
6
|
argument-hint: '[--retry-limit <N>] [--dry-run]'
|
|
7
7
|
disable-model-invocation: true
|
|
@@ -104,6 +104,23 @@ PROJECTS_ROOT="${PROJECTS_ROOT%/}"
|
|
|
104
104
|
|
|
105
105
|
### Step 0.5: Capability Detection and Tier Selection
|
|
106
106
|
|
|
107
|
+
**Mandatory target-first order:** Complete Dispatch Policy Preflight and resolve
|
|
108
|
+
the concrete managed Codex target before probing generic agent availability or
|
|
109
|
+
locking Tier 1/Tier 2. A concrete target takes precedence over tier selection:
|
|
110
|
+
use the exact registered role, or an explicitly pinned fresh Codex child when
|
|
111
|
+
that role is unavailable. If neither route is possible, inline execution is
|
|
112
|
+
allowed only with verified equivalent current-host model and effort controls;
|
|
113
|
+
otherwise block before work starts. Explicit inherit/default and documented
|
|
114
|
+
managed-uncapped reviewer behavior remain the only base-role exceptions.
|
|
115
|
+
|
|
116
|
+
When a concrete managed Codex role is unavailable or the host cannot select
|
|
117
|
+
it, launch a fresh Codex child pinned to the resolver-returned model and effort
|
|
118
|
+
with canonical role instructions. If that fresh child cannot be launched, fail
|
|
119
|
+
closed and block; never substitute the coordinator or base role.
|
|
120
|
+
|
|
121
|
+
Use base `oat-phase-implementer` only for the allowed exceptions above:
|
|
122
|
+
explicit inherit/default behavior. It is never a managed task-worker fallback.
|
|
123
|
+
|
|
107
124
|
Detect whether native subagent dispatch is available. The detection logic follows the same pattern used by `oat-project-review-provide` but produces a two-tier outcome (no fresh-session tier — this skill runs autonomously and cannot block on user-initiated fresh sessions mid-run).
|
|
108
125
|
|
|
109
126
|
Detection logic:
|
|
@@ -124,7 +141,10 @@ Detection logic:
|
|
|
124
141
|
- Approved → Tier 1.
|
|
125
142
|
- Declined → Tier 2.
|
|
126
143
|
|
|
127
|
-
- If the host does not resolve either agent
|
|
144
|
+
- If the host does not resolve either generic agent, first attempt the exact
|
|
145
|
+
registered role or explicitly pinned fresh-child route for any concrete
|
|
146
|
+
managed target. Select Tier 2 only when inline execution is allowed by the
|
|
147
|
+
target-first rule above.
|
|
128
148
|
|
|
129
149
|
**Approval scope rule:** this Tier selection applies to both phase implementation and checkpoint review. Do not infer a mixed mode from conversational emphasis on review checkpoints. If the user has not explicitly approved Tier 1 for the run, stay Tier 2 throughout. Mixed mode is only valid when the user explicitly requests it.
|
|
130
150
|
|
|
@@ -147,7 +167,7 @@ Do not print `[0/N]` for this preflight step. The implementation denominator is
|
|
|
147
167
|
|
|
148
168
|
**Hard pre-work guard:** before any code edit, test run, or implementation commit, print the selected tier and reason. If Tier 2 is selected, the reason must be one of the three allowed Tier 2 reasons above. Do not run tests, edit files, or create implementation commits until Step 0.5 has completed and the tier report has been printed.
|
|
149
169
|
|
|
150
|
-
**Tier is locked for the remainder of the run.** Subsequent
|
|
170
|
+
**Tier is locked for the remainder of the run only after the dispatch target is resolved.** Subsequent coordinator, task-worker, fix, and review dispatches use the same tier. Tier controls mechanics only: every managed task worker still resolves its own exact target beneath the recorded project or phase named maximum. No mid-run downgrade is allowed.
|
|
151
171
|
|
|
152
172
|
**Recovery if Step 0.5 was skipped:** If implementation work has already started inline before completing Step 0.5, STOP immediately. Preserve any work in progress, complete or revert to a clean task boundary, and re-run Step 0.5 before continuing. Do not silently continue in Tier 2.
|
|
153
173
|
|
|
@@ -242,7 +262,7 @@ OAT Dispatch Tier: balanced (codex, managed capped — pinned-variant)
|
|
|
242
262
|
Resolved cap: high
|
|
243
263
|
Source: project state
|
|
244
264
|
Provider default effort: medium
|
|
245
|
-
Note: OAT will use resolver-returned materialized Codex role names up to high. Base/unpinned roles resolve through the provider default only
|
|
265
|
+
Note: OAT will use resolver-returned materialized Codex role names up to high. Base/unpinned roles resolve through the provider default only for explicit inherit/default behavior or the documented managed-uncapped reviewer exception.
|
|
246
266
|
```
|
|
247
267
|
|
|
248
268
|
If no policy resolves and the session is interactive, present the dispatch
|
|
@@ -276,10 +296,10 @@ OAT applies managed policies where the provider exposes a reliable mechanism
|
|
|
276
296
|
(Codex: pinned variants; Claude: Task model parameter). Other providers may
|
|
277
297
|
treat managed policies as advisory.
|
|
278
298
|
|
|
279
|
-
**Managed capped policy selection** persists `mode: managed`,
|
|
280
|
-
`policy`, and
|
|
281
|
-
|
|
282
|
-
|
|
299
|
+
**Managed capped policy selection** persists only `mode: managed`, the named
|
|
300
|
+
maximum `policy`, and `source`. The named maximum leaves lower configured
|
|
301
|
+
candidates eligible; do not copy compiled provider/model targets into project
|
|
302
|
+
state. On selection, print the named maximum before proceeding.
|
|
283
303
|
|
|
284
304
|
**Uncapped** persists explicit managed uncapped state. OAT still manages
|
|
285
305
|
dispatch selection. It does not write provider caps, and it must not be
|
|
@@ -300,9 +320,6 @@ Persist in project `state.md` frontmatter using the normalized shape:
|
|
|
300
320
|
oat_dispatch_policy:
|
|
301
321
|
mode: managed
|
|
302
322
|
policy: balanced
|
|
303
|
-
providers:
|
|
304
|
-
codex: high
|
|
305
|
-
claude: sonnet
|
|
306
323
|
source: project-state
|
|
307
324
|
```
|
|
308
325
|
|
|
@@ -341,15 +358,17 @@ modifying project state.
|
|
|
341
358
|
|
|
342
359
|
### Runtime dispatch selection
|
|
343
360
|
|
|
344
|
-
Before each
|
|
345
|
-
|
|
346
|
-
Tier 1/Tier 2
|
|
347
|
-
|
|
361
|
+
Before coordinator bootstrap and before each task-worker, fix, or review
|
|
362
|
+
dispatch, choose and log runtime controls. Resolve these controls before
|
|
363
|
+
applying Tier 1/Tier 2 mechanics. A coordinator target never becomes a task
|
|
364
|
+
target: managed tasks use an exact resolver candidate beneath the recorded
|
|
365
|
+
project or phase named ceiling. Inline execution must preserve equivalent
|
|
366
|
+
controls or use a documented exception.
|
|
348
367
|
|
|
349
368
|
Use these inputs:
|
|
350
369
|
|
|
351
370
|
- resolved dispatch policy, source, and provider-specific selection
|
|
352
|
-
- phase ID and
|
|
371
|
+
- phase ID and the current bounded task scope
|
|
353
372
|
- optional `## Dispatch Profile` row in `plan.md`
|
|
354
373
|
- host-exposed provider controls, by axis
|
|
355
374
|
- prior outcomes for the phase, including review results and failed retries
|
|
@@ -381,21 +400,34 @@ Axis states:
|
|
|
381
400
|
|
|
382
401
|
Codex rules:
|
|
383
402
|
|
|
384
|
-
|
|
403
|
+
**Managed Codex execution invariant:** When the resolver returns a model+effort
|
|
404
|
+
target, prefer the exact registered role or variant from
|
|
405
|
+
`providers.codex.dispatchArgs.variant`. If the current host cannot select that
|
|
406
|
+
exact registered target, launch a fresh Codex child with the resolver target's
|
|
407
|
+
explicit model, reasoning effort, and canonical role instructions from
|
|
408
|
+
`.agents/agents/oat-phase-implementer.md` or
|
|
409
|
+
`.agents/agents/oat-reviewer.md`. Workflow correctness must not require provider
|
|
410
|
+
restart or hot reload. A managed base role is forbidden when a concrete target
|
|
411
|
+
was requested; never silently downgrade to it. Base roles remain valid only for
|
|
412
|
+
explicit inherit/default behavior and the documented managed-uncapped reviewer
|
|
413
|
+
fallback.
|
|
414
|
+
|
|
415
|
+
1. Codex effort order is `low < medium < high < xhigh < max`.
|
|
385
416
|
2. Classify preferred effort from scope:
|
|
386
417
|
- `low`: trivial docs-only, narrow single-file, or mechanical changes
|
|
387
418
|
- `medium`: normal multi-file implementation and moderate integration risk
|
|
388
419
|
- `high`: broad architecture, security/auth/redaction boundaries, subtle state behavior, or repeated substantive review failures
|
|
389
420
|
- `xhigh`: highest-risk work that requires a capped policy to allow xhigh or a managed `Uncapped` policy to select it
|
|
421
|
+
- `max`: exceptional frontier work whose risk or cross-cutting scope justifies the first-class maximum reasoning control
|
|
390
422
|
3. For capped managed implementer/fix work, selected effort is `min(preferred, resolved_cap)`.
|
|
391
423
|
4. For managed `Uncapped` implementer/fix work, selected effort is the preferred effort with no cap.
|
|
392
424
|
5. For inherit/default mode, the resolver returns no selected dispatch args. Use the base/unpinned Codex role, log `Selected effort: provider-default`, display provider default effort when known, and do not describe this as managed uncapped behavior.
|
|
393
|
-
6. For
|
|
425
|
+
6. For managed capped task-worker/fix dispatch, choose an exact configured candidate and call `oat project dispatch-ceiling resolve --provider codex --role implementer --ceiling-tier <project-or-phase-tier> --candidate-model <model> --candidate-effort <effort> --escalation-level <route-level> --json`. Read `providers.codex.dispatchArgs.variant` and `providers.codex.selection.target`; never reuse the coordinator role or a cap-only variant. `--preferred` remains compatibility behavior outside the exact task-worker path.
|
|
394
426
|
7. For review dispatch: call `oat project dispatch-ceiling resolve --provider codex --role reviewer`; read `providers.codex.dispatchArgs.variant` and `providers.codex.selection.target`.
|
|
395
427
|
- Capped managed policy: reviewer targets the configured cap for deterministic quality gate behavior.
|
|
396
428
|
- Managed `Uncapped`: no reviewer target exists; use base/unpinned reviewer fallback and log `selectionMode=no-review-target`, `selectedValue=null`, and `effort_axis=provider-default`.
|
|
397
429
|
- Inherit/default: no reviewer target exists; use base/unpinned reviewer fallback and log `selectionMode=inherit-default`, `selectedValue=null`, and `effort_axis=provider-default`.
|
|
398
|
-
8. Codex payload-first assertion applies
|
|
430
|
+
8. Codex payload-first assertion applies whenever the resolver returns a materialized model+effort target. If `providers.codex.dispatchArgs.variant` is present, the actual `spawn_agent` payload MUST use it as `agent_type`; when that variant came from a Codex model+effort target, log `model_axis=selected:<model>` and `effort_axis=selected:<effort>` from resolver output. If a concrete managed target has no usable variant, use the explicitly pinned fresh-child route or block. Use the base role and log provider-default only for explicit inherit/default behavior or the documented managed-uncapped reviewer exception. Always derive `model_axis` and `effort_axis` from resolver output, not from legacy role-name parsing.
|
|
399
431
|
9. Do not use top-level per-call `reasoning_effort` as the standard OAT selected-effort path; dogfooding showed that path can be inconsistent.
|
|
400
432
|
|
|
401
433
|
Claude rules:
|
|
@@ -408,10 +440,21 @@ Claude rules:
|
|
|
408
440
|
- Review dispatch:
|
|
409
441
|
- Capped managed policy: target the configured policy cap directly.
|
|
410
442
|
- Managed `Uncapped` or inherit/default: no reviewer target exists; omit `model` and log inherited/default model behavior.
|
|
411
|
-
- For
|
|
443
|
+
- For managed capped task-worker/fix dispatch, call `oat project dispatch-ceiling resolve --provider claude --role implementer --ceiling-tier <project-or-phase-tier> --candidate-model <model> --orchestrator-tier <current-orchestrator-tier> --escalation-level <route-level> --json`; for review dispatch, call the resolver with `--role reviewer` and no candidate flags. Read `providers.claude.dispatchArgs.model` and pass it exactly on the actual Task invocation.
|
|
412
444
|
- Pass `model: "<value>"` when `model_axis=selected:<value>` on the Task tool call.
|
|
413
445
|
- Keep `effort_axis=not-applicable`; Claude Code has no separate per-dispatch effort axis.
|
|
414
446
|
|
|
447
|
+
Cursor rules:
|
|
448
|
+
|
|
449
|
+
- Treat every configured Cursor candidate string as opaque. Do not normalize it
|
|
450
|
+
or infer capability from its spelling.
|
|
451
|
+
- For managed capped task-worker/fix dispatch, call the resolver with
|
|
452
|
+
`--provider cursor --role implementer --ceiling-tier
|
|
453
|
+
<project-or-phase-tier> --candidate-model <opaque-model> --json`.
|
|
454
|
+
- Require `providers.cursor.dispatchArgs.model` and pass that exact byte-for-byte
|
|
455
|
+
string as the actual Cursor invocation model. If the host cannot apply it,
|
|
456
|
+
fail closed.
|
|
457
|
+
|
|
415
458
|
Payload-first invariant:
|
|
416
459
|
|
|
417
460
|
- Build the actual host dispatch argument map before logging.
|
|
@@ -458,10 +501,10 @@ Route: {route label or target path | none}; level={0 | 1 | ... | none}
|
|
|
458
501
|
Requested controls: {model=<value|none>, effort=<value|none>, target=<value|unknown>}
|
|
459
502
|
Configured defaults: {provider default effort/model | unknown | not-applicable}
|
|
460
503
|
Runtime confirmation: {observed:<slug> | declared:<slug> | not-observable | mismatch:<detail>}
|
|
461
|
-
Preferred effort: {low | medium | high | xhigh | provider-default | not-applicable}
|
|
504
|
+
Preferred effort: {low | medium | high | xhigh | max | provider-default | not-applicable}
|
|
462
505
|
OAT Dispatch Tier: {economy | balanced | high | frontier | uncapped | inherit host defaults | legacy capped}
|
|
463
506
|
Resolved cap: {resolved cap value | none}
|
|
464
|
-
Selected effort: {low | medium | high | xhigh | provider-default | not-applicable}
|
|
507
|
+
Selected effort: {low | medium | high | xhigh | max | provider-default | not-applicable}
|
|
465
508
|
Policy source: {repo config | project state | preflight prompt}
|
|
466
509
|
Provider default effort: {value | unknown | not-applicable}
|
|
467
510
|
Selection mode: {capped | uncapped | review-target | no-review-target | inherit-default}
|
|
@@ -565,7 +608,7 @@ Generic sidecar/explorer dispatch:
|
|
|
565
608
|
|
|
566
609
|
- Built-in or generic sidecars such as `explorer` are not OAT-managed implementer, reviewer, or fix roles.
|
|
567
610
|
- If a sidecar spawn payload does not explicitly pin a reliable effort/model control, log `Preferred effort: provider-default`, `Selected effort: provider-default`, and `Effort axis: provider-default`.
|
|
568
|
-
- Do not classify a generic sidecar as `Preferred effort: low|medium|high|xhigh` unless the actual host invocation contains the corresponding reliable selection. If the host has no reliable effort control for that sidecar, use provider-default wording instead.
|
|
611
|
+
- Do not classify a generic sidecar as `Preferred effort: low|medium|high|xhigh|max` unless the actual host invocation contains the corresponding reliable selection. If the host has no reliable effort control for that sidecar, use provider-default wording instead.
|
|
569
612
|
- Sidecar outputs are advisory context only. Implementation work and review/fix gates still follow the OAT-managed dispatch rules above.
|
|
570
613
|
|
|
571
614
|
Codex generic explorer example:
|
|
@@ -628,13 +671,14 @@ Dispatch policy: {policy}; selected={selected value | none}; cap={value | none}
|
|
|
628
671
|
**Log examples (matching resolver output):**
|
|
629
672
|
|
|
630
673
|
```text
|
|
631
|
-
Dispatch policy: balanced; selected=
|
|
632
|
-
Dispatch policy: high; selected=
|
|
674
|
+
Dispatch policy: balanced; selected=xhigh; cap=xhigh (codex, enforced — variant oat-phase-implementer-gpt-5-6-terra-xhigh)
|
|
675
|
+
Dispatch policy: high; selected=high; cap=high (codex, enforced — variant oat-reviewer-gpt-5-6-sol-high)
|
|
676
|
+
Dispatch policy: frontier; selected=max; cap=max (codex, enforced — variant oat-reviewer-gpt-5-6-sol-max)
|
|
633
677
|
Dispatch policy: uncapped; selected=xhigh; cap=none (codex, enforced — variant oat-phase-implementer-gpt-5-6-terra-xhigh)
|
|
634
678
|
Dispatch policy: inherit host defaults; selected=none; cap=none (codex, advisory — base role follows provider default)
|
|
635
679
|
Dispatch policy: balanced; selected=sonnet; cap=sonnet (claude, enforced — Task model arg)
|
|
636
680
|
Dispatch policy: frontier; selected=fable; cap=fable (claude, enforced — Task model arg)
|
|
637
|
-
Dispatch policy:
|
|
681
|
+
Cursor opaque model-string example: Dispatch policy: frontier; selected=gpt-5.6-sol-max; cap=gpt-5.6-sol-max (cursor, enforced — model arg gpt-5.6-sol-max)
|
|
638
682
|
Dispatch policy: unresolved; selected=none; cap=none (codex, advisory — policy set but no value resolved)
|
|
639
683
|
```
|
|
640
684
|
|
|
@@ -952,98 +996,137 @@ Initialize project state so other skills (e.g., `oat-project-progress`) reflect
|
|
|
952
996
|
|
|
953
997
|
### Step 5: Per-Phase Execution
|
|
954
998
|
|
|
955
|
-
For each phase `pNN` in the plan (or each phase in
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
1. Build the Phase Scope block:
|
|
960
|
-
|
|
961
|
-
```
|
|
962
|
-
project: {PROJECT_PATH}
|
|
963
|
-
phase: {pNN}
|
|
964
|
-
mode: implement
|
|
965
|
-
artifact_paths:
|
|
966
|
-
plan: {PROJECT_PATH}/plan.md
|
|
967
|
-
design: {PROJECT_PATH}/design.md
|
|
968
|
-
spec: {PROJECT_PATH}/spec.md
|
|
969
|
-
implementation: {PROJECT_PATH}/implementation.md
|
|
970
|
-
discovery: {PROJECT_PATH}/discovery.md
|
|
971
|
-
delta_recording: record any intentional divergence from spec/design/plan in implementation.md with rationale, source of truth, and follow-up artifact disposition
|
|
972
|
-
commit_convention: {from plan.md header}
|
|
973
|
-
workflow_mode: {from state.md or plan.md frontmatter}
|
|
974
|
-
model_axis: {selected:<value> | inherited | not-applicable | host-auto; omit if unknown}
|
|
975
|
-
effort_axis: {selected:<value> | provider-default | inherited | not-applicable | host-auto; omit if unknown}
|
|
976
|
-
dispatch_policy: {economy | balanced | high | frontier | uncapped | inherit host defaults | legacy capped; omit if unknown}
|
|
977
|
-
dispatch_ceiling: {resolved cap value; omit if none or unknown}
|
|
978
|
-
policy_source: {repo config | project state | preflight prompt; omit if unknown}
|
|
979
|
-
ceiling_source: {repo config | project state | preflight prompt; omit if unknown; compatibility alias for policy_source}
|
|
980
|
-
provider_default_effort: {value | unknown | not-applicable; omit if unknown}
|
|
981
|
-
dispatch_route_level: {integer route level; omit when no ordered route is in play}
|
|
982
|
-
dispatch_target: {resolver target or host-specific dispatch target; omit if unknown}
|
|
983
|
-
dispatch_stamp: {exact `Dispatch: ...` line written to Dispatch Notes; omit if not yet written}
|
|
984
|
-
dispatch_rationale: {short rationale; omit if unknown}
|
|
985
|
-
```
|
|
986
|
-
|
|
987
|
-
2. Perform a pre-dispatch assertion against the host invocation parameters. The Phase Scope fields are audit/context fields; selected axes must also be represented in the actual host dispatch call.
|
|
988
|
-
- Codex implementer/fix dispatch:
|
|
989
|
-
- Before building the `spawn_agent` argument map, classify the phase complexity and choose preferred effort (`low`, `medium`, `high`, or `xhigh`), determine the current route level (Dispatch Profile floor or `0`), then call `oat project dispatch-ceiling resolve --provider codex --role implementer --preferred <preferred-effort> --escalation-level <route-level>`.
|
|
990
|
-
- Build the `spawn_agent` argument map from `providers.codex.selection.selectedValue`, `providers.codex.dispatchArgs.variant`, and `providers.codex.selection.target` before logging the dispatch. If `providers.codex.target.crossHarness` is true, the resolver intentionally returns no native dispatch args; log the deferred target and use provider-default/base fallback only when that is the explicit selected fallback. If `effort_axis=selected:<value>`, the argument map MUST use the materialized Codex role name returned in `providers.codex.dispatchArgs.variant` as `agent_type`; do not re-derive an effort-only role name from the selected effort. Then derive the `OAT Dispatch:` block `Model axis:` and `Effort axis:` fields from resolver output and that same argument map.
|
|
991
|
-
- Example selected payload shape: `agent_type: "oat-phase-implementer-gpt-5-6-sol-low"` and a Phase Scope message containing `model_axis: selected:gpt-5.6-sol` and `effort_axis: selected:low`.
|
|
992
|
-
- Immediately after spawning, compare the returned Codex status line with the selected effort before waiting on the agent. If the spawned status reports a different effort than the selected value (for example, the log says `effort_axis=selected:medium` but the spawn result reports `gpt-5.5 high`), treat this as an orchestration deviation. Stop, record the deviation in `implementation.md`, and redispatch with corrected parameters before continuing. Do not use work from the mismatched dispatch.
|
|
993
|
-
- If the resolver returns no `dispatchArgs.variant`, use base `agent_type: "oat-phase-implementer"` only for provider-default/base fallback and omit `reasoning_effort`. The dispatch rationale MUST say this is a base/unpinned fallback and include provider default effort when known. Use base `oat-phase-implementer` only when the resolver returns no `dispatchArgs.variant`.
|
|
994
|
-
- Claude Code implementer/fix dispatch:
|
|
995
|
-
- If `model_axis=selected:<value>`, the Task tool call MUST include `model: "<value>"`.
|
|
996
|
-
- If `model_axis=inherited`, omit `model`.
|
|
999
|
+
For each phase `pNN` in the plan (or each phase in a plan-declared parallel
|
|
1000
|
+
worktree group), dispatch exactly one phase coordinator. The coordinator reads
|
|
1001
|
+
the phase once and dispatches one exact task worker per task. It must not
|
|
1002
|
+
implement ordinary plan tasks in its own context.
|
|
997
1003
|
|
|
998
|
-
|
|
1004
|
+
#### Resolve the Task Maximum
|
|
999
1005
|
|
|
1000
|
-
|
|
1006
|
+
Before coordinator dispatch, read the project named ceiling from
|
|
1007
|
+
`state.md:oat_dispatch_policy.policy`. Then inspect the optional plan
|
|
1008
|
+
`## Dispatch Profile` row for this phase:
|
|
1001
1009
|
|
|
1002
|
-
|
|
1010
|
+
1. An explicit phase `economy`, `balanced`, `high`, or `frontier` narrows the
|
|
1011
|
+
project maximum and sets `task_ceiling_source: phase`.
|
|
1012
|
+
2. Blank, absent, or `auto` uses the project maximum and sets
|
|
1013
|
+
`task_ceiling_source: project`.
|
|
1014
|
+
3. Reject an unknown tier or a phase tier above the project tier.
|
|
1015
|
+
4. `uncapped` and explicit inherit/default retain their existing policy
|
|
1016
|
+
semantics and have no named `--ceiling-tier`; never synthesize one.
|
|
1003
1017
|
|
|
1004
|
-
|
|
1018
|
+
The project or phase named ceiling is a maximum, not the coordinator target or
|
|
1019
|
+
an exact family preference. Under High, lower configured Economy, Balanced, and
|
|
1020
|
+
High candidates remain available for different tasks.
|
|
1005
1021
|
|
|
1006
|
-
|
|
1007
|
-
2. Execute that process yourself against the same Phase Scope.
|
|
1008
|
-
3. Produce an equivalent summary in your own context.
|
|
1022
|
+
#### Build and Dispatch Phase Scope
|
|
1009
1023
|
|
|
1010
|
-
|
|
1024
|
+
```yaml
|
|
1025
|
+
project: {PROJECT_PATH}
|
|
1026
|
+
phase: {pNN}
|
|
1027
|
+
mode: implement
|
|
1028
|
+
artifact_paths:
|
|
1029
|
+
plan: {PROJECT_PATH}/plan.md
|
|
1030
|
+
design: {PROJECT_PATH}/design.md
|
|
1031
|
+
spec: {PROJECT_PATH}/spec.md
|
|
1032
|
+
implementation: {PROJECT_PATH}/implementation.md
|
|
1033
|
+
discovery: {PROJECT_PATH}/discovery.md
|
|
1034
|
+
workflow_mode: {spec-driven|quick|import}
|
|
1035
|
+
active_provider: {codex|claude|cursor|other}
|
|
1036
|
+
project_ceiling_tier: {named project maximum; omit when none}
|
|
1037
|
+
phase_ceiling_tier: {explicit narrower phase maximum; omit for auto/blank}
|
|
1038
|
+
task_ceiling_tier: {effective project or phase named ceiling}
|
|
1039
|
+
task_ceiling_source: {project|phase}
|
|
1040
|
+
commit_convention: {from plan.md}
|
|
1041
|
+
coordinator_target: {resolver-selected coordinator target}
|
|
1042
|
+
```
|
|
1011
1043
|
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
- Recommended next step (plan fix, external resolution, user guidance)
|
|
1019
|
-
Do not proceed to subsequent phases while a phase is blocked.
|
|
1044
|
+
Tier 1 uses the already resolved exact coordinator role/model payload and sends
|
|
1045
|
+
the Phase Scope. A concrete Codex coordinator uses
|
|
1046
|
+
`providers.codex.dispatchArgs.variant`; when the registered role cannot be
|
|
1047
|
+
selected, use the fresh child pinned to the resolver's model and effort with
|
|
1048
|
+
canonical coordinator instructions. Claude and Cursor coordinator calls pass
|
|
1049
|
+
their exact resolver model argument.
|
|
1020
1050
|
|
|
1021
|
-
|
|
1051
|
+
Tier 2 may run the coordinator instructions in the current context only when
|
|
1052
|
+
that context can still dispatch every exact task worker. Tier 2 never permits
|
|
1053
|
+
the coordinator to edit ordinary task files. If no exact worker route exists,
|
|
1054
|
+
block before phase work.
|
|
1022
1055
|
|
|
1023
|
-
|
|
1056
|
+
#### Per-Task Coordinator Contract
|
|
1024
1057
|
|
|
1025
|
-
|
|
1026
|
-
- implementer reports a reasoning or capability blockage
|
|
1027
|
-
- the same phase fails substantive review twice
|
|
1028
|
-
- the fix loop repeats the same class of error
|
|
1058
|
+
For each task in dependency order, the coordinator must:
|
|
1029
1059
|
|
|
1030
|
-
|
|
1060
|
+
1. Classify only that bounded task and choose one configured candidate at or
|
|
1061
|
+
below `task_ceiling_tier`.
|
|
1062
|
+
2. Call the exact candidate resolver with the invocation-only named maximum:
|
|
1031
1063
|
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
- `Dispatch: scope=p02 action=implementation role=implementer producer=unknown provenance=unknown model_axis=host-auto effort_axis=host-auto dispatch_policy=unknown dispatch_ceiling=none target=unknown`
|
|
1042
|
-
4. If the phase is already at the strongest available control, do not invent a stronger tier. Provide more context, split the phase, revise the plan, or stop for user direction.
|
|
1064
|
+
```bash
|
|
1065
|
+
oat project dispatch-ceiling resolve \
|
|
1066
|
+
--provider <active-provider> \
|
|
1067
|
+
--role implementer \
|
|
1068
|
+
--ceiling-tier <project-or-phase-named-tier> \
|
|
1069
|
+
--candidate-model <exact-model> \
|
|
1070
|
+
--project-path "$PROJECT_PATH" \
|
|
1071
|
+
--json
|
|
1072
|
+
```
|
|
1043
1073
|
|
|
1044
|
-
|
|
1074
|
+
Codex also passes `--candidate-effort <exact-effort>`. The returned top-level
|
|
1075
|
+
`source` must be `invocation`; `providers.<provider>.cellSource` continues to
|
|
1076
|
+
identify the config layer that owns the candidate definition. This command
|
|
1077
|
+
is read-only and must never persist its override.
|
|
1078
|
+
|
|
1079
|
+
3. Build the actual provider invocation before logging:
|
|
1080
|
+
- Codex uses `providers.codex.dispatchArgs.variant` as `agent_type`, or the
|
|
1081
|
+
exact fresh pinned-child model/effort route when native role selection is
|
|
1082
|
+
unavailable.
|
|
1083
|
+
- Claude passes `providers.claude.dispatchArgs.model` as the actual Task
|
|
1084
|
+
`model`.
|
|
1085
|
+
- Cursor passes `providers.cursor.dispatchArgs.model` byte-for-byte as the
|
|
1086
|
+
actual invocation model. Treat the string as opaque and never normalize or
|
|
1087
|
+
infer capability from it.
|
|
1088
|
+
4. Send one bounded Task Scope, never the full phase task list:
|
|
1089
|
+
|
|
1090
|
+
```yaml
|
|
1091
|
+
mode: task-worker
|
|
1092
|
+
task_id: { one pNN-tNN ID }
|
|
1093
|
+
task_name: { task title }
|
|
1094
|
+
task_plan: { only this task's steps }
|
|
1095
|
+
file_boundary: { only this task's files }
|
|
1096
|
+
verification: { only this task's verification commands }
|
|
1097
|
+
commit_convention: { exact expected task commit }
|
|
1098
|
+
ceiling_tier: { effective named maximum }
|
|
1099
|
+
ceiling_source: { project|phase }
|
|
1100
|
+
dispatch_target: { resolver-returned exact target }
|
|
1101
|
+
dispatch_args: { complete actual provider payload }
|
|
1102
|
+
```
|
|
1045
1103
|
|
|
1046
|
-
|
|
1104
|
+
5. Dispatch one exact task worker and wait for its terminal result before the
|
|
1105
|
+
next task. Workers in the same worktree run serially; task fan-out is
|
|
1106
|
+
forbidden. Parallelism remains limited to plan-declared phase/worktree
|
|
1107
|
+
groups.
|
|
1108
|
+
6. Verify the worker's task ID, result, tests, file boundary, clean worktree,
|
|
1109
|
+
and reported commit against `git rev-parse HEAD` and the pre-task HEAD. A
|
|
1110
|
+
worker must contribute exactly one verified task commit.
|
|
1111
|
+
7. Record each task's exact target, result, and commit in the returned **Task
|
|
1112
|
+
Dispatch Summary**, then perform phase-wide verification and integration
|
|
1113
|
+
self-review without editing ordinary task files.
|
|
1114
|
+
|
|
1115
|
+
If a candidate is missing or absent, exceeds or is above the named ceiling, or
|
|
1116
|
+
cannot be invoked with exact controls, fail closed and block the phase. Never
|
|
1117
|
+
fall back or downgrade to the coordinator target, base role, or inferred
|
|
1118
|
+
provider default. A transient retry reuses the same complete provider payload;
|
|
1119
|
+
a substantive escalation re-resolves within the same named maximum and bounded
|
|
1120
|
+
retry limit.
|
|
1121
|
+
|
|
1122
|
+
#### Handling Coordinator Status
|
|
1123
|
+
|
|
1124
|
+
- **DONE:** verify the Task Dispatch Summary, then proceed to phase review.
|
|
1125
|
+
- **DONE_WITH_CONCERNS:** correctness concerns require a new bounded exact fix
|
|
1126
|
+
worker before review; advisory concerns are recorded.
|
|
1127
|
+
- **NEEDS_CONTEXT:** supply only the missing context and retry within the bound.
|
|
1128
|
+
- **BLOCKED:** stop and surface the phase, task, exact target, and reason. Do not
|
|
1129
|
+
proceed to later phases.
|
|
1047
1130
|
|
|
1048
1131
|
### Per-Phase Review
|
|
1049
1132
|
|
|
@@ -1053,8 +1136,11 @@ After the implementer returns DONE (or DONE_WITH_CONCERNS without correctness co
|
|
|
1053
1136
|
|
|
1054
1137
|
- Use the same tier that was selected at start.
|
|
1055
1138
|
- For Codex with a capped managed policy, dispatch the materialized reviewer role returned in `providers.codex.dispatchArgs.variant` for deterministic quality gates.
|
|
1139
|
+
- If that exact registered reviewer role is not selectable in the current host session, launch a fresh Codex child with explicit model, reasoning effort, and canonical role instructions from `.agents/agents/oat-reviewer.md`; never substitute the managed base role and never require restart/hot reload.
|
|
1056
1140
|
- For Codex with managed `Uncapped` or inherit/default mode, no reviewer target exists; use base `oat-reviewer`, log `effort_axis=provider-default`, and explain that the base role follows the provider default.
|
|
1057
|
-
- For Claude Code with a capped managed policy, pass
|
|
1141
|
+
- For Claude Code with a capped managed policy, require `providers.claude.dispatchArgs.model` and pass that exact value as the review `model`; managed `Uncapped` or inherit/default mode omits `model` because no reviewer target exists. Always keep `effort_axis=not-applicable`.
|
|
1142
|
+
- For Cursor with a concrete managed reviewer target, require `providers.cursor.dispatchArgs.model` and pass that exact opaque, unnormalized string as the actual review invocation's `model` argument.
|
|
1143
|
+
- Build the actual provider invocation before logging the reviewer target. If the host cannot apply the required Claude or Cursor model argument, fail closed or block unless inline execution has verified equivalent current-host controls.
|
|
1058
1144
|
- Tier 1: dispatch the selected reviewer target via provider-native subagent mechanism with Review Scope:
|
|
1059
1145
|
|
|
1060
1146
|
```
|
|
@@ -1077,11 +1163,11 @@ After the implementer returns DONE (or DONE_WITH_CONCERNS without correctness co
|
|
|
1077
1163
|
```
|
|
1078
1164
|
|
|
1079
1165
|
- For Codex Tier 1 dispatches, send the Review Scope block as a self-contained packet and keep fresh context (`fork_context: false`). The reviewer is expected to reconstruct context from git state and the OAT artifacts listed above.
|
|
1080
|
-
- For Codex Tier 1 review dispatches, use the materialized Codex role name from `providers.codex.dispatchArgs.variant` only when the resolver returns a reviewer variant for a capped managed policy. A Codex materialized reviewer role selected from a model+effort target must carry `model_axis=selected:<model>` and `effort_axis=selected:<effort>` from resolver output. Use base `oat-reviewer` only when the resolver returns no `dispatchArgs.variant` for managed `Uncapped`, inherit/default mode, or provider-default fallback, and log `effort_axis=provider-default`. For Claude Code
|
|
1166
|
+
- For Codex Tier 1 review dispatches, use the materialized Codex role name from `providers.codex.dispatchArgs.variant` only when the resolver returns a reviewer variant for a capped managed policy. A Codex materialized reviewer role selected from a model+effort target must carry `model_axis=selected:<model>` and `effort_axis=selected:<effort>` from resolver output. Use base `oat-reviewer` only when the resolver returns no `dispatchArgs.variant` for managed `Uncapped`, inherit/default mode, or provider-default fallback, and log `effort_axis=provider-default`. For Claude Code, pass `model: providers.claude.dispatchArgs.model` for a concrete managed reviewer and never pass a per-review effort override. For Cursor, pass `model: providers.cursor.dispatchArgs.model` byte-for-byte for a concrete managed reviewer.
|
|
1081
1167
|
- Treat the commit range as authoritative for review scope. `files_changed` is optional orientation metadata only.
|
|
1082
|
-
- If a
|
|
1168
|
+
- If a reviewer does not return a terminal result on the first wait, poll once more. If it still has not concluded, send one concise nudge to return immediately with current findings. If the reviewer still does not conclude, treat the target-preserving review dispatch as failed for this phase. Retry the same exact role, pinned fresh-child route, or complete Claude/Cursor invocation payload within the retry bound, preserving the exact model argument; never downgrade a timed-out managed reviewer to unpinned inline execution.
|
|
1083
1169
|
|
|
1084
|
-
- Tier 2:
|
|
1170
|
+
- Tier 2: read `.agents/agents/oat-reviewer.md` and review inline only with verified equivalent current-host model and effort controls, explicit inherit/default behavior, or the documented managed-uncapped reviewer behavior. Otherwise block.
|
|
1085
1171
|
|
|
1086
1172
|
**Verdict outcomes:**
|
|
1087
1173
|
|
|
@@ -1098,9 +1184,9 @@ On reviewer verdict `fail`, run a bounded fix loop.
|
|
|
1098
1184
|
|
|
1099
1185
|
1. Read `oat_orchestration_retry_limit` from `state.md` frontmatter (default: `2`, range 0–5).
|
|
1100
1186
|
2. For each retry (up to the limit):
|
|
1101
|
-
a.
|
|
1102
|
-
b.
|
|
1103
|
-
c. Receive
|
|
1187
|
+
a. Convert Critical/Important findings into bounded fix scopes associated with one planned task/file boundary at a time. Do not hand one worker the full phase finding list.
|
|
1188
|
+
b. Reuse the phase coordinator in `fix` mode. It selects an exact candidate under the same project or phase named ceiling with `--ceiling-tier`, then emits one Task Scope per bounded fix. Codex uses `providers.codex.dispatchArgs.variant`; Claude and Cursor pass their exact `providers.<provider>.dispatchArgs.model` value on the actual invocation. Every fix worker writes the formal `Dispatch: scope=<phase-or-task> action=fix role=fix producer=<slug|unknown> provenance=<declared|observed|inferred|unknown> model_axis=<axis> effort_axis=<axis> dispatch_policy=<policy|unknown> dispatch_ceiling=<value|none> target=<target|unknown>` stamp before execution.
|
|
1189
|
+
c. Receive and verify each fix result and commit. The coordinator must not apply fixes itself, and Tier 2 does not authorize inline task edits.
|
|
1104
1190
|
d. Re-dispatch the reviewer with the updated commit range.
|
|
1105
1191
|
e. Parse the new verdict.
|
|
1106
1192
|
f. If pass → exit the loop successfully.
|
|
@@ -1134,10 +1220,10 @@ If the gate is enabled and the current phase is selected:
|
|
|
1134
1220
|
- Do not pass `--target` in normal execution; the existing gate config selects the cross-provider target.
|
|
1135
1221
|
- The gate CLI injects gate context into the review prompt. The produced review artifact must use `oat_review_invocation: gate`.
|
|
1136
1222
|
|
|
1137
|
-
2. Parse the JSON result. The gate verdict (`exit_nonzero_on: {threshold}`) decides whether the phase **stops**; it does not decide whether sub-threshold findings are ignored.
|
|
1138
|
-
- `status: "ok"` / exit code `0` means the phase gate passed at the configured threshold, so the phase does not stop.
|
|
1139
|
-
- `status: "blocked"` / non-zero exit due to review findings means blocking findings exist. Run `oat-project-review-receive` for the reported artifact path (blocking disposition) before treating the gate review as consumed.
|
|
1140
|
-
-
|
|
1223
|
+
2. Parse the JSON result. Before invoking review-receive, all three receive-eligibility conditions must hold: `status` is `ok` or `blocked`, the envelope explicitly sets `receiveEligible: true`, and `handoff` is non-null. A missing or contradictory field is an operational failure even when `artifactPath` is present. The gate verdict (`exit_nonzero_on: {threshold}`) decides whether the phase **stops**; it does not decide whether sub-threshold findings are ignored. Once eligibility is established, the produced artifact must be **consumed** — passing gate artifacts are not left unprocessed at the top level of `reviews/`.
|
|
1224
|
+
- With eligibility established, `status: "ok"` / exit code `0` means the phase gate passed at the configured threshold, so the phase does not stop. Run `oat-project-review-receive` for the reported artifact path in non-pausing **judgment-sweep** mode (pass gate-passed context so receive selects sweep disposition). The sweep makes a per-finding judgment for each Medium/Minor — defer to final (default), address now (small/contained/low-risk fixes only), or reject with rationale — writes those durable dispositions into `implementation.md`, and archives the artifact. Then continue without pausing. Address-now fixes from a passing gate do **not** re-trigger the standard reviewer or re-gate the phase.
|
|
1225
|
+
- With eligibility established, `status: "blocked"` / non-zero exit due to review findings means blocking findings exist. Run `oat-project-review-receive` for the reported artifact path (blocking disposition) before treating the gate review as consumed.
|
|
1226
|
+
- Any other status, or a non-zero exit caused by target execution failure, artifact validation failure, or missing review artifact, is an operational failure. Stop and surface the gate output; do not continue as if the gate passed.
|
|
1141
1227
|
|
|
1142
1228
|
3. If `oat-project-review-receive` adds fix tasks (blocking gate, or a sweep address-now fix that revealed a Critical/Important concern):
|
|
1143
1229
|
- Return to task execution for the newly added review-fix tasks.
|
|
@@ -1153,18 +1239,18 @@ For a parallel group, run selected phase gates after fan-in and bookkeeping, one
|
|
|
1153
1239
|
|
|
1154
1240
|
When the current schedule entry is a multi-phase group, execute as follows.
|
|
1155
1241
|
|
|
1156
|
-
**Tier 2 degradation:** If Tier 2 was selected at skill start, Tier 2 cannot run concurrent subagents. Degrade the
|
|
1242
|
+
**Tier 2 degradation:** If Tier 2 was selected at skill start, Tier 2 cannot run concurrent subagents. Degrade the group to sequential target-preserving execution on the orchestration branch. Do not create worktrees. For every phase, retain the exact role or pinned fresh child; inline is permitted only by the verified-equivalent-controls or documented-exception guard. Proceed through the per-phase loop in plan order.
|
|
1157
1243
|
|
|
1158
1244
|
**Tier 1 parallel execution:**
|
|
1159
1245
|
|
|
1160
1246
|
1. **Bootstrap worktrees:** for each phase in the group, invoke `oat-worktree-bootstrap-auto` with branch name `{project-name}/{pNN}` and base = orchestration branch.
|
|
1161
1247
|
|
|
1162
1248
|
> ⚠️ **CRITICAL — DO NOT substitute host-native worktree primitives.** Bootstrap MUST go through `oat-worktree-bootstrap-auto` with an explicit `--base` set to the current orchestration branch HEAD (capture `EXPECTED_HEAD=$(git rev-parse HEAD)` from the orchestration cwd before dispatching). Do not use Claude Code's `Agent({ isolation: "worktree" })`, Cursor's equivalent, or any other host-native isolation primitive in lieu of this skill — those mechanisms may use the primary repo's checkout (often `main`) as the base regardless of the orchestrator's current branch, silently producing a worktree that cannot see prior phase commits and forcing the entire group to degrade to sequential.
|
|
1163
|
-
- If **any** bootstrap fails, cancel any worktrees that bootstrapped successfully for this group and degrade the whole group to sequential
|
|
1249
|
+
- If **any** bootstrap fails, cancel any worktrees that bootstrapped successfully for this group and degrade the whole group to sequential target-preserving execution. Log the degradation reason to `implementation.md` Outstanding Items.
|
|
1164
1250
|
|
|
1165
|
-
2. **Verify worktree HEAD before dispatch (base-mismatch gate):** After bootstrap, verify each worktree is at the expected orchestration HEAD. From the orchestration cwd, capture `EXPECTED_HEAD=$(git rev-parse HEAD)` _before_ invoking bootstrap. After bootstrap, for each new worktree path, run `git -C {worktree-path} rev-parse HEAD` and confirm it matches `EXPECTED_HEAD`, or run `git -C {worktree-path} merge-base --is-ancestor "$EXPECTED_HEAD" HEAD` and confirm it succeeds (exit 0). If either check fails for any phase, treat the bootstrap as failed for that phase, cancel any successful sibling worktrees in this group, and degrade the entire group to sequential
|
|
1251
|
+
2. **Verify worktree HEAD before dispatch (base-mismatch gate):** After bootstrap, verify each worktree is at the expected orchestration HEAD. From the orchestration cwd, capture `EXPECTED_HEAD=$(git rev-parse HEAD)` _before_ invoking bootstrap. After bootstrap, for each new worktree path, run `git -C {worktree-path} rev-parse HEAD` and confirm it matches `EXPECTED_HEAD`, or run `git -C {worktree-path} merge-base --is-ancestor "$EXPECTED_HEAD" HEAD` and confirm it succeeds (exit 0). If either check fails for any phase, treat the bootstrap as failed for that phase, cancel any successful sibling worktrees in this group, and degrade the entire group to sequential target-preserving execution — same mechanism as a primary bootstrap failure. Log the mismatch to `implementation.md` Outstanding Items, including the observed and expected SHAs (`expected={EXPECTED_HEAD}, observed={observed-head-sha}, phase={pNN}, worktree={path}`).
|
|
1166
1252
|
|
|
1167
|
-
3. **Concurrent dispatch:** for each successfully bootstrapped worktree (passing the base-mismatch gate above), dispatch `oat-phase-implementer`
|
|
1253
|
+
3. **Concurrent phase dispatch:** for each successfully bootstrapped worktree (passing the base-mismatch gate above), dispatch one `oat-phase-implementer` coordinator with the worktree as its working directory. Coordinators may run concurrently across these plan-declared phase worktrees, but every coordinator dispatches its own task workers serially in that one worktree. The outer orchestration loop retains review and bounded-fix handling.
|
|
1168
1254
|
|
|
1169
1255
|
4. **Wait for all phases:** do not proceed until every phase in the group reports a terminal verdict (pass or excluded).
|
|
1170
1256
|
|
|
@@ -1209,7 +1295,7 @@ When the current schedule entry is a multi-phase group, execute as follows.
|
|
|
1209
1295
|
|
|
1210
1296
|
d. Parse the subagent's return status: - `RESOLVED` → subagent has committed the merge; orchestrator proceeds to integration verification (Step 6) and the next phase in the group. - `UNRESOLVABLE` or `VERIFICATION_FAILED` → STOP the run. Surface to user with phase ID, conflicting files, worktree path, subagent's reasoning summary. Do not merge remaining phases.
|
|
1211
1297
|
|
|
1212
|
-
**Tier 2
|
|
1298
|
+
**Tier 2 conflict exception:** In Tier 2 runs, parallel groups already degrade to sequential, so fan-in conflicts do not arise from this code path. If a conflict surfaces from another operation, inline resolution is allowed only when the current-host controls satisfy the same verified-equivalence or documented-exception guard; otherwise stop for a target-preserving route.
|
|
1213
1299
|
|
|
1214
1300
|
6. **Integration verification after each merge:**
|
|
1215
1301
|
|
|
@@ -1567,12 +1653,27 @@ echo "$FINAL_ROW"
|
|
|
1567
1653
|
|
|
1568
1654
|
**Workflow preference check (before prompting):**
|
|
1569
1655
|
|
|
1656
|
+
First resolve the final reviewer target with the same target-first contract as
|
|
1657
|
+
per-phase review. A concrete managed Codex target must use its exact registered
|
|
1658
|
+
reviewer or an explicitly pinned fresh child. A concrete managed Claude or
|
|
1659
|
+
Cursor target must put `providers.claude.dispatchArgs.model` or
|
|
1660
|
+
`providers.cursor.dispatchArgs.model` respectively into the actual provider
|
|
1661
|
+
invocation as the exact `model` argument; Cursor strings remain opaque. On
|
|
1662
|
+
timeout or retry, preserve the same exact role or complete invocation payload,
|
|
1663
|
+
including the model argument. If the host cannot apply the required role or
|
|
1664
|
+
model argument, fail closed or block unless verified equivalent current-host
|
|
1665
|
+
controls permit inline execution. The preference below chooses only among
|
|
1666
|
+
routes that preserve that target; it cannot authorize generic inline or base
|
|
1667
|
+
execution. Inline remains available only with verified equivalent current-host
|
|
1668
|
+
controls or an allowed explicit inherit/default or managed-uncapped reviewer
|
|
1669
|
+
base-role exception.
|
|
1670
|
+
|
|
1570
1671
|
```bash
|
|
1571
1672
|
REVIEW_MODEL=$(oat config get workflow.reviewExecutionModel 2>/dev/null || true)
|
|
1572
1673
|
```
|
|
1573
1674
|
|
|
1574
1675
|
- **If `REVIEW_MODEL` is `subagent`:** Print `Review execution: subagent (from workflow.reviewExecutionModel).` Dispatch the review subagent directly via the Task tool. No prompt.
|
|
1575
|
-
- **If `REVIEW_MODEL` is `inline`:**
|
|
1676
|
+
- **If `REVIEW_MODEL` is `inline`:** Honor it only when the inline route satisfies the verified-equivalent-controls or documented-exception guard. Otherwise use the exact/pinned route or block. When allowed, print `Review execution: inline (from workflow.reviewExecutionModel).` and run the review in-context per `oat-project-review-provide`.
|
|
1576
1677
|
- **If `REVIEW_MODEL` is `fresh-session`:** This is a **soft preference with escape hatch** because the agent cannot run the review in a fresh session on the user's behalf. Print the guidance block below, then handle the user's response per the three outcomes listed after it.
|
|
1577
1678
|
- **If unset or invalid:** Fall through to the standard 3-tier prompt below.
|
|
1578
1679
|
|
|
@@ -1595,7 +1696,7 @@ Enter 1 or 2 to run the review here, or press Enter to wait.
|
|
|
1595
1696
|
**Fresh-session response outcomes:**
|
|
1596
1697
|
|
|
1597
1698
|
- User enters `1` → dispatch the subagent review (same behavior as `REVIEW_MODEL=subagent`).
|
|
1598
|
-
- User enters `2` →
|
|
1699
|
+
- User enters `2` → apply the same guarded inline behavior as `REVIEW_MODEL=inline`; this choice does not waive managed target controls.
|
|
1599
1700
|
- User presses Enter (or equivalent no-input confirmation) → pause the session and wait for the fresh-session review to complete before continuing.
|
|
1600
1701
|
|
|
1601
1702
|
**Standard prompt (when preference is unset):**
|
|
@@ -1608,7 +1709,7 @@ Implementation complete. Final review required.
|
|
|
1608
1709
|
Review options:
|
|
1609
1710
|
1. Run review in this session via a subagent (recommended if provider supported)
|
|
1610
1711
|
2. Run review in a fresh session and return to this session to receive review
|
|
1611
|
-
3. Run review inline
|
|
1712
|
+
3. Run review inline when current-host controls are verified equivalent
|
|
1612
1713
|
|
|
1613
1714
|
To run in a separate session use: oat-project-review-provide code final
|
|
1614
1715
|
```
|
|
@@ -1617,7 +1718,7 @@ To run in a separate session use: oat-project-review-provide code final
|
|
|
1617
1718
|
|
|
1618
1719
|
- If subagent (option 1): Agent spawns the review via Task tool — no command needed from user
|
|
1619
1720
|
- If fresh session (option 2): User runs `oat-project-review-provide code final` in a separate session, then returns here
|
|
1620
|
-
- If inline (option 3): Agent executes the review
|
|
1721
|
+
- If inline (option 3): Agent first verifies equivalent current-host controls or an allowed exception, then executes the review per `oat-project-review-provide`; otherwise it uses the exact/pinned route or blocks
|
|
1621
1722
|
- After review: User runs `oat-project-review-receive` to process findings
|
|
1622
1723
|
- If Critical/Important findings: Fix tasks added, re-run the `oat-project-implement` skill
|
|
1623
1724
|
- Loop until final review passes (max 3 cycles per oat-project-review-receive)
|
|
@@ -1721,24 +1822,37 @@ Before reporting this skill as complete, run the configured gate as the final st
|
|
|
1721
1822
|
|
|
1722
1823
|
If the command returns JSON `null`, no gate is configured; the skill is complete.
|
|
1723
1824
|
|
|
1724
|
-
2.
|
|
1825
|
+
2. Export the resolved project path into the command shell:
|
|
1826
|
+
|
|
1827
|
+
```bash
|
|
1828
|
+
export PROJECT_PATH
|
|
1829
|
+
```
|
|
1830
|
+
|
|
1831
|
+
If the resolved command invokes `oat gate review`, the configured review command must already include `--project "$PROJECT_PATH"` and must not include `--target <id>`. A valid reusable shape is `oat gate review --project "$PROJECT_PATH" ...`. If the declaration is missing, stop and migrate the stored gate command; do not inject or append arguments at execution time.
|
|
1832
|
+
|
|
1833
|
+
3. Execute the resolved command exactly as configured. Capture stdout, stderr, the exit code, and the structured JSON result. A zero exit code means the review passed its threshold, but it does not by itself authorize artifact receipt or complete the handoff.
|
|
1725
1834
|
|
|
1726
|
-
|
|
1727
|
-
-
|
|
1728
|
-
-
|
|
1835
|
+
4. Review-artifact handoff:
|
|
1836
|
+
- Parse the structured gate result. An exit code or artifact path alone never authorizes `oat-project-review-receive`.
|
|
1837
|
+
- Invoke receive only when all three conditions hold: `status` is `ok` or `blocked`, the envelope explicitly sets `receiveEligible: true`, and a non-null `handoff` confirms the artifact was corroborated.
|
|
1838
|
+
- `receiveEligible: false` is a hard stop even when `artifactPath` is present. Never receive `targeting_correlation_failed`; correct the project/run routing and run a new gate.
|
|
1839
|
+
- Keep `artifact_validation_failed` outside receive until the artifact is corrected and the gate successfully revalidates it. Treat `review_failed`, unknown statuses, null handoffs, and contradictory eligibility fields as operational failures.
|
|
1840
|
+
- `blocked` exits nonzero but is receive-eligible; `ok` exits zero and still requires durable receive disposition. Route by structured status and eligibility, not by exit code.
|
|
1729
1841
|
|
|
1730
|
-
|
|
1842
|
+
5. If the command exits nonzero, use `description` to orient the next steps and handle `onFailure`:
|
|
1731
1843
|
- `block`: read gate feedback, remediate, and re-run the gate up to `maxAttempts` attempts (default `2`). If attempts are exhausted, escalate to the human with accumulated feedback and append that feedback to `implementation.md`. Treat a launch failure, missing CLI, or no eligible runtime as escalation-biased and do not spend it as a remediation attempt.
|
|
1732
1844
|
- `prompt`: surface the gate failure and ask the human how to proceed.
|
|
1733
1845
|
- `warn`: record the gate failure and continue.
|
|
1734
1846
|
|
|
1735
|
-
|
|
1847
|
+
6. Runtime selection note (V1): the step runs the gate `command` as-is and reads no OAT runtime env var. By default, `oat gate review` and `oat gate cross-provider-exec` resolve the current host from built-in `hostDetectionCommand`s and avoid the same runtime when no exact target is supplied. Reusable lifecycle skill-gate commands must not include `--target <id>` so independent review stays provider-neutral. Use explicit targets only for manual/debug commands or deliberate local/user-specific overrides; do not hardcode provider/model targets in bundled skill guidance or shared lifecycle gate examples.
|
|
1736
1848
|
|
|
1737
1849
|
## Success Criteria
|
|
1738
1850
|
|
|
1739
|
-
-
|
|
1851
|
+
- One exact target-pinned worker executed each task in dependency order
|
|
1852
|
+
- The phase coordinator did not implement ordinary task work in its own context
|
|
1853
|
+
- Same-worktree task workers ran serially; only plan-declared phase worktrees ran in parallel
|
|
1740
1854
|
- TDD discipline followed
|
|
1741
|
-
- Each task
|
|
1855
|
+
- Each task result and commit was verified against HEAD and its file boundary
|
|
1742
1856
|
- Implementation.md tracks all progress
|
|
1743
1857
|
- Final verification passes
|
|
1744
1858
|
- Final review passes (no Critical/Important findings)
|