@open-agent-toolkit/cli 0.2.2 → 0.2.4

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 (33) hide show
  1. package/assets/agents/oat-reviewer.md +59 -3
  2. package/assets/docs/cli-utilities/project-log.md +16 -0
  3. package/assets/docs/cli-utilities/workflow-gates.md +69 -8
  4. package/assets/docs/workflows/projects/autonomy.md +20 -6
  5. package/assets/docs/workflows/projects/implementation-execution.md +46 -0
  6. package/assets/docs/workflows/projects/lifecycle.md +29 -6
  7. package/assets/docs/workflows/projects/reviews.md +88 -1
  8. package/assets/public-package-versions.json +4 -4
  9. package/assets/skills/oat-dispatch-subagents/SKILL.md +90 -15
  10. package/assets/skills/oat-dispatch-subagents/references/provider-claude.md +21 -0
  11. package/assets/skills/oat-dispatch-subagents/references/provider-codex.md +22 -0
  12. package/assets/skills/oat-dispatch-subagents/references/provider-cursor.md +66 -15
  13. package/assets/skills/oat-dispatch-subagents/references/record-schema.md +63 -2
  14. package/assets/skills/oat-project-autonomous/references/gate-inventory.md +147 -139
  15. package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +147 -139
  16. package/assets/skills/oat-project-implement/SKILL.md +17 -6
  17. package/assets/skills/oat-project-implement/references/completion-and-closeout.md +387 -58
  18. package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +147 -139
  19. package/assets/skills/oat-project-implement/references/phase-execution.md +35 -2
  20. package/assets/skills/oat-project-next/SKILL.md +59 -18
  21. package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +147 -139
  22. package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +147 -139
  23. package/assets/skills/oat-project-review-provide/SKILL.md +38 -2
  24. package/assets/skills/oat-wave-execute/SKILL.md +16 -1
  25. package/assets/skills/oat-wave-program/SKILL.md +16 -1
  26. package/assets/templates/state.md +32 -0
  27. package/dist/commands/gate/index.d.ts +1 -0
  28. package/dist/commands/gate/index.d.ts.map +1 -1
  29. package/dist/commands/gate/index.js +5 -1
  30. package/dist/commands/shared/frontmatter.d.ts +1 -1
  31. package/dist/commands/shared/frontmatter.d.ts.map +1 -1
  32. package/dist/commands/shared/frontmatter.js +1 -0
  33. package/package.json +2 -2
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: oat-reviewer
3
- version: 1.1.7
3
+ version: 1.1.8
4
4
  description: Unified reviewer for OAT projects - mode-aware verification of requirements/design alignment and code quality. Writes a review artifact to disk by default, or returns structured findings in-memory when dispatched in structured-output mode.
5
- tools: Read, Bash, Grep, Glob, Write
5
+ tools: Read, Bash, Grep, Glob, Write, Task
6
6
  color: yellow
7
7
  ---
8
8
 
@@ -73,6 +73,47 @@ For Codex, deterministic review dispatch under a capped managed policy uses the
73
73
 
74
74
  For Claude Code, review dispatch is model-axis based and the effort axis is `not-applicable`.
75
75
 
76
+ ## Bounded Reviewer Reconnaissance
77
+
78
+ The primary reviewer must establish the authoritative scope before considering delegation. Establish its authoritative commit range and read the mode-required discovery, spec, design, plan, and implementation artifacts that are available before decomposition or delegation. Understand the requirements, changed surfaces, and failure consequences in that authoritative scope before deciding whether lanes are independent. Delegation is optional and useful only when the resolved scope has multiple independent evidence lanes. Eligible broad reviews include final code reviews, broad phase/range reviews, docs sweeps, and provider-view audits. Narrow task or artifact reviews stay inline when coordination would cost as much as direct inspection.
79
+
80
+ When delegation is eligible:
81
+
82
+ 1. Use one bounded, read-only, non-recursive reconnaissance round with disjoint lane scopes. This is a one-level fan-out limit: lane workers must not spawn additional workers.
83
+ 2. Before launching any lane, read `.agents/skills/oat-dispatch-subagents/SKILL.md`, resolve the active provider, and read exactly one matching active-provider reference under `.agents/skills/oat-dispatch-subagents/references/`. Reviewer-local reconnaissance must not read or load `.agents/skills/oat-project-dispatch-subagents/SKILL.md`; that adapter is reserved for project lifecycle phase/task policy.
84
+ 3. Map every lane worker to the shared `recon` role class (`role.class: recon`); role authority stays read-only and advisory. Assign the independent `task_class`, `classification_source: caller`, and non-empty `classification_reason` fields after understanding the artifacts and diff. These task-class fields are required for reviewer-local reconnaissance even though the generic dispatch contract keeps them optional for other callers.
85
+ 4. Classify each lane as `mechanical-recon`, `intelligent-recon`, `default-implementation`, `hard-reasoning`, or `consequential`. Use the stronger floor when uncertain. Classification proceeds from deterministic verification to silent-miss risk, then dispersed context, ambiguity, and consequence; file count alone never justifies escalation.
86
+ - `mechanical-recon`: deterministic inventories, parity checks, and test/lint/format/build execution whose misses are visible and cheaply checked.
87
+ - `intelligent-recon`: interpretation, semantic completeness, policy-aware auditing, or unfamiliar-code review where a miss could be silent.
88
+ - `default-implementation`: rare, independently bounded dossier work that must retain and reconcile dispersed context; prefer keeping it with the root.
89
+ - `hard-reasoning`: ambiguity, novelty, architecture analysis, or competing interpretations dominate.
90
+ - `consequential`: security, release safety, irreversible impact, or expensive failure dominates.
91
+
92
+ Mechanical workers may execute checks and report exact output, but interpretation and policy judgment require stronger classes or stay with the root reviewer.
93
+
94
+ 5. The generic dispatch contract owns capability, catalog, model, effort, route, authorization, launch evidence, class-floor selection, and floor-satisfaction evidence. It applies active user and repository instructions, the active-provider reference, the live nested catalog, and the supplied policy/ceiling. Select an explicit target meeting the declared floor; never silently inherit the primary reviewer's model and never hard-code provider model names. Prefer a cheaper/faster worker only when the host reliably exposes that control and the target still satisfies the floor.
95
+ 6. Give each lane an exact scope and a compact return contract: coverage, checks performed, exact `file:line` evidence, gaps, and explicit uncertainty. Reports are advisory candidate observations, not accepted findings.
96
+ 7. Workers must not mutate files, emit final findings, assign severity, make validation decisions, write review artifacts or `StructuredFindings`, or otherwise write either output sink.
97
+
98
+ Lanes may share one homogeneous dispatch wave only when every existing dispatch axis, `task_class`, and `model_class_floor` match. Mixed task classes require separate records and waves. The one-level fan-out limit applies across all waves.
99
+
100
+ When delegated reconnaissance is attempted, artifact mode must include a
101
+ compact `## Review Orchestration` section. Record the waves, task classes,
102
+ classification rationale, selected targets, acceptance and outcomes, floor
103
+ satisfaction, fallback, and primary reconciliation. Condense the dispatch
104
+ evidence instead of copying every worker record. In structured-output mode,
105
+ summarize orchestration in the existing `summary`; do not add a field to the
106
+ `StructuredFindings` schema.
107
+
108
+ The primary reviewer owns source validation and verification, reconciliation, synthesis, severity, validation decisions, artifact writing, output ownership, and the final findings or `StructuredFindings`. Reopen authoritative sources and directly re-verify every load-bearing positive and negative claim; repeat relevant searches for absence claims before promotion to a finding. Reconcile overlap, disagreement, and cross-lane gaps across task classes before deduplicating and assigning severity.
109
+
110
+ Capability-check reviewer-local delegation once. A reviewer-local request must use `fallback.mode: caller-inline` and `allow_below_task_class_floor: false`. If the requested floor cannot be explicitly satisfied, record it as unsatisfied, do not launch a below-floor worker, and cover the affected lane inline without weakening review coverage, the checklist, or the output contract. The same inline fallback applies when nested dispatch is unsupported, unauthorized, failed, empty, or malformed. The inline and delegated paths preserve the existing artifact-mode, gate-parsing, and structured-output schemas unchanged.
111
+
112
+ The primary reviewer and lane workers must not write or modify
113
+ `project-log.md` and must not invoke `oat project log append`. The root project
114
+ workflow validates review orchestration evidence and owns any structural log
115
+ entry.
116
+
76
117
  ## Mode Contract
77
118
 
78
119
  Use workflow mode to determine required evidence:
@@ -338,6 +379,17 @@ oat_invocation_source: { exec-target-config|unknown }
338
379
 
339
380
  Findings: {N} critical, {N} important, {N} medium, {N} minor
340
381
 
382
+ ## Review Orchestration
383
+
384
+ {Include this section only when delegated reconnaissance was attempted.}
385
+
386
+ | Wave | Task class | Classification rationale | Selected target | Acceptance / outcome | Floor satisfaction | Fallback |
387
+ | ---- | ---------- | ------------------------ | ---------------- | -------------------- | ------------------ | -------- |
388
+ | {id} | {class} | {reason} | {target or none} | {status / outcome} | {status} | {route} |
389
+
390
+ **Primary reconciliation:** {independent verification, accepted/rejected
391
+ worker claims, and root-inline coverage}
392
+
341
393
  ## Findings
342
394
 
343
395
  ### Critical
@@ -414,6 +466,9 @@ For gate-originated artifacts, all six gate-only fields are required when the pr
414
466
  **Artifact mode only.** In structured-output mode (`oat_output_mode: structured`), return the `StructuredFindings` object instead — see **Structured-Output Mode** below.
415
467
 
416
468
  Return a brief confirmation. DO NOT include full review contents.
469
+ Return exactly one reconnaissance status line using only `attempted` or
470
+ `not-attempted`; this signal reports whether delegated reconnaissance was
471
+ attempted, including an attempted launch that fell back or failed.
417
472
 
418
473
  Format:
419
474
  ```
@@ -423,6 +478,7 @@ Format:
423
478
  **Scope:** {scope}
424
479
  **Findings:** {N} critical, {N} important, {N} medium, {N} minor
425
480
  **Review artifact:** {path}
481
+ **Reconnaissance:** {attempted | not-attempted}
426
482
 
427
483
  Return to your main session and run the `oat-project-review-receive` skill.
428
484
 
@@ -439,7 +495,7 @@ When the dispatch payload sets `oat_output_mode: structured`, the output sink ch
439
495
 
440
496
  ```typescript
441
497
  interface StructuredFindings {
442
- summary: string; // 2-3 sentence review summary
498
+ summary: string; // 2-3 sentence review summary; include compact orchestration when reconnaissance was attempted
443
499
  findings: Array<{
444
500
  id: string; // C1, I1, M1, m1 — stable per dispatch (C/I/M/m prefix matches the severity model)
445
501
  severity: 'critical' | 'important' | 'medium' | 'minor';
@@ -93,6 +93,22 @@ entries without asking agents to edit `project-log.md`:
93
93
  - `oat-project-implement` records accepted subagent dispatches, STOP or park
94
94
  events, phase outcomes, and parallel-group merge results. These entries point
95
95
  to the corresponding `implementation.md` record instead of copying it.
96
+ - When `oat-project-implement` or `oat-project-review-provide` receives an
97
+ artifact-mode review, the root workflow first consumes exactly one
98
+ `**Reconnaissance:** attempted` or
99
+ `**Reconnaissance:** not-attempted` signal from the reviewer's brief
100
+ confirmation. A missing, duplicate, or invalid signal fails closed before
101
+ artifact validation or bookkeeping.
102
+ - `attempted` requires a complete `Review Orchestration` section recording
103
+ waves, task classes, classification rationale, selected targets,
104
+ acceptance and outcomes, floor satisfaction, fallback, and primary
105
+ reconciliation. The root then invokes `oat project log append` exactly once
106
+ for one structural entry referencing the review artifact instead of copying
107
+ worker records.
108
+ - `not-attempted` forbids a `Review Orchestration` section and does not invoke
109
+ `oat project log append` for review orchestration.
110
+ Reviewers and reconnaissance workers never write `project-log.md`
111
+ themselves.
96
112
  - `oat gate review` records exactly one entry for every terminal outcome,
97
113
  including successful and blocking verdicts, child failure, timeout,
98
114
  targeting-correlation failure, and artifact-validation failure. A log append
@@ -33,7 +33,7 @@ Gate config lives under `workflow.gates.skills` and is keyed by skill name.
33
33
  "gates": {
34
34
  "skills": {
35
35
  "oat-project-implement": {
36
- "command": "oat gate review --project \"$PROJECT_PATH\" --review-type code --review-scope final \"Use oat-project-review-provide code final for the declared project\"",
36
+ "command": "oat --json gate review --project \"$PROJECT_PATH\" --review-type code --review-scope final \"Use oat-project-review-provide code final for the declared project\"",
37
37
  "description": "Run a fresh-runtime final review before implementation is considered done.",
38
38
  "onFailure": "block",
39
39
  "maxAttempts": 2
@@ -57,6 +57,52 @@ in skill frontmatter with `oat_gateable: true`, and
57
57
  `oat internal validate-oat-skills` warns when config targets a missing or
58
58
  non-gateable skill.
59
59
 
60
+ ### Implementation exit-gate closeout
61
+
62
+ For `oat-project-implement`, the configured skill gate is a final, resumable
63
+ closeout boundary. It is independent from the root-owned phase reviews, the
64
+ mandatory final lifecycle review, and the optional `oat_phase_review_gate`.
65
+ Passing or disabling one of those mechanisms never satisfies or disables the
66
+ configured implementation gate.
67
+
68
+ After final verification and the mandatory final lifecycle review pass, OAT
69
+ persists `oat_implement_exit_gate` in project state before it launches the
70
+ configured command. The state records:
71
+
72
+ - `pending`, `allowed`, `blocked`, or `stale` status;
73
+ - a `configured` or `no_gate` resolution;
74
+ - `passed`, `warned`, `prompt_approved`, or `no_gate` allowed dispositions;
75
+ - the resolved configuration fingerprint, reviewed HEAD, implementation
76
+ fingerprint, gate run, envelope, and receive provenance; and
77
+ - launch and receive reconciliation data needed to resume without duplicating
78
+ an accepted run or completed receive.
79
+
80
+ A `null` resolution is explicit success for that closeout generation:
81
+ `allowed/no_gate` with `disposition: no_gate`. Configured success becomes
82
+ `allowed/passed`; `warn` and an explicit `prompt` continuation persist their
83
+ own allowed dispositions only for a validated, receive-eligible `blocked`
84
+ envelope after eligible receive completes durably. Unresolved, malformed,
85
+ contradictory, validation, correlation, launch, or receive failures ignore
86
+ `onFailure` and remain blocked.
87
+
88
+ Resume correlates the persisted launch intent with the gate run marker, durable
89
+ JSON result receipt, and run-bound artifact. Eligible receive similarly
90
+ correlates the source and archived artifact, Reviews event, and bookkeeping
91
+ commit. Missing or ambiguous evidence fails closed instead of launching or
92
+ receiving again.
93
+
94
+ An allowed result remains fresh only while every commit after `reviewed_head`
95
+ contains recognized closeout-only work, such as gate receipts, project
96
+ tracking, summary/documentation/PR sequencing, final HiLL, or completion
97
+ bookkeeping. Implementation, test, skill, template, workflow configuration, or
98
+ unknown changed paths make the result stale and require a current final review
99
+ and a new gate generation.
100
+
101
+ Only an artifact with `oat_review_invocation: gate` and the matching
102
+ `oat_gate_run_id` can satisfy configured-gate provenance. A normal final
103
+ review, phase review, or manually produced independent review cannot substitute
104
+ for it.
105
+
60
106
  ## Review gates
61
107
 
62
108
  `oat gate review` is intentionally stateful. It is equivalent to running
@@ -424,7 +470,7 @@ Set or clear a skill gate:
424
470
 
425
471
  ```bash
426
472
  oat gate set oat-project-implement \
427
- --command 'oat gate review --project "$PROJECT_PATH" --review-type code --review-scope final "Use oat-project-review-provide code final for the declared project"' \
473
+ --command 'oat --json gate review --project "$PROJECT_PATH" --review-type code --review-scope final "Use oat-project-review-provide code final for the declared project"' \
428
474
  --description "Run final review in another runtime" \
429
475
  --on-failure block \
430
476
  --max-attempts 2 \
@@ -441,17 +487,18 @@ unset lets the dispatcher avoid the current runtime and choose the
441
487
  highest-priority available non-host target. Pin a target only for manual
442
488
  dispatch, debugging, or a deliberate local/user-specific override.
443
489
 
444
- ### Migrate ambient lifecycle commands
490
+ ### Migrate legacy lifecycle commands
445
491
 
446
492
  Older user-level lifecycle commands often asked a reviewer to inspect the
447
- "current project" but omitted a machine-readable declaration. Migrate each
448
- stored `oat gate review` command by inserting `--project "$PROJECT_PATH"` and
449
- retaining provider-neutral target selection. For example:
493
+ "current project", omitted a machine-readable project declaration, or emitted
494
+ human-oriented output. Migrate each stored command to the canonical global-JSON
495
+ shape `oat --json gate review --project "$PROJECT_PATH" ...` while retaining
496
+ provider-neutral target selection. For example:
450
497
 
451
498
  ```bash
452
499
  export PROJECT_PATH
453
500
  oat gate set oat-project-implement \
454
- --command 'oat gate review --project "$PROJECT_PATH" --review-type code --review-scope final "Use oat-project-review-provide code final for the declared project"' \
501
+ --command 'oat --json gate review --project "$PROJECT_PATH" --review-type code --review-scope final "Use oat-project-review-provide code final for the declared project"' \
455
502
  --description "Run final review in another runtime" \
456
503
  --on-failure block \
457
504
  --max-attempts 2 \
@@ -463,6 +510,12 @@ Apply the same command shape to `oat-project-plan`,
463
510
  skills have configured review gates. Do not add `--target`; explicit targets
464
511
  remain manual/debug or deliberate local/user-specific overrides.
465
512
 
513
+ Implementation closeout rejects a stored review command without global
514
+ `--json`, without `--project "$PROJECT_PATH"`, or with a shared `--target`
515
+ before launch. It does not rewrite configuration or inject, reorder, or append
516
+ arguments while executing. Migrate the declaration first; otherwise the
517
+ project remains blocked and resumable through `oat-project-implement`.
518
+
466
519
  Set or clear an exec target:
467
520
 
468
521
  ```bash
@@ -589,7 +642,9 @@ contributor fields are absent. The achieved level is one of:
589
642
 
590
643
  ## Failure behavior
591
644
 
592
- Gate failure behavior is owned by the gate-aware skill:
645
+ Gate failure behavior is owned by the gate-aware skill. The configured policy
646
+ applies only to a validated, receive-eligible `blocked` result after its
647
+ eligible receive completes durably:
593
648
 
594
649
  | `onFailure` | Meaning |
595
650
  | ----------- | ------------------------------------------------------------------------------------ |
@@ -597,6 +652,12 @@ Gate failure behavior is owned by the gate-aware skill:
597
652
  | `prompt` | Surface the failure and ask the user how to proceed. |
598
653
  | `warn` | Record the failure and continue. |
599
654
 
655
+ `review_failed`, `artifact_validation_failed`,
656
+ `targeting_correlation_failed`, unknown or contradictory envelopes, launch
657
+ failures, and receive failures are operational failures rather than validated
658
+ blocking findings. They remain blocked regardless of `onFailure`; even `warn`
659
+ cannot turn them into an allowed disposition.
660
+
600
661
  `cross-provider-exec` does fallback only before dispatch, while selecting an
601
662
  available target. Once a target actually runs, its exit code is the gate result;
602
663
  OAT does not try another target after a failed review.
@@ -84,6 +84,9 @@ Autonomous execution preserves independent review:
84
84
  bounded implement-and-re-review loop.
85
85
  - Critical findings and failed blocking reviews stop progression. Important
86
86
  findings follow the configured gate policy.
87
+ - A normal phase or final lifecycle review cannot satisfy a configured
88
+ implementation exit gate. Only gate invocation provenance with the matching
89
+ run ID can authorize that boundary.
87
90
 
88
91
  Project review artifacts and review rows reference launcher-owned dispatch
89
92
  records. The configured invocation is authoritative evidence; child
@@ -104,12 +107,23 @@ An existing valid explicit list is preserved. An existing `[]` is also
104
107
  preserved and means every phase, never no phases. At each configured checkpoint,
105
108
  autonomy runs and receives the review without waiting.
106
109
 
107
- At final closeout, pre-approval lifecycle steps run first. After a passing final
108
- review, autonomy records final HiLL approval and then runs post-approval steps.
109
- A failed blocking review stops before approval. The default autonomous tail is
110
- summary, documentation, and final PR when no post-implementation sequence is
111
- configured; stored legacy or structured sequences retain their documented
112
- meaning.
110
+ At final closeout, autonomy follows the same authoritative order as an
111
+ interactive run: final verification, mandatory final lifecycle review,
112
+ configured implementation exit gate, pre-approval sequence, final HiLL
113
+ approval, post-approval sequence, then implementation completion and success
114
+ output. A null gate resolution persists an explicit no-gate allowance before
115
+ the sequence starts.
116
+
117
+ Autonomy does not turn an ordinary independent review into configured-gate
118
+ provenance. A configured review must produce a gate-originated artifact with
119
+ the matching run ID, and eligible receive must be durably reconciled. Blocked,
120
+ ambiguous, malformed, or stale gate state is a boundary stop: the run remains
121
+ resumable through `oat-project-implement` and cannot continue to approval,
122
+ completion, or output.
123
+
124
+ The default autonomous tail is summary, documentation, and final PR when no
125
+ post-implementation sequence is configured; stored legacy or structured
126
+ sequences retain their documented meaning.
113
127
 
114
128
  ## Execution-learnings loop
115
129
 
@@ -20,6 +20,9 @@ and updates project state.
20
20
  phase report.
21
21
  - **Fix boundary:** blocking findings return to the original phase handle when
22
22
  possible.
23
+ - **Final exit-gate boundary:** after final verification and final lifecycle
24
+ review, the root resolves the configured implementation gate before
25
+ approval-aware sequencing, final HiLL, completion, or success output.
23
26
  - **Optional nesting:** a phase agent may dispatch bounded recon, fanout, or
24
27
  specialist work when that materially helps. Ordinary tasks do not require a
25
28
  third tier.
@@ -84,6 +87,49 @@ commit range, task IDs and boundaries, project artifacts, and verification
84
87
  evidence. The review passes with zero Critical and zero Important findings.
85
88
  Medium and Minor findings are recorded without blocking the phase.
86
89
 
90
+ ## Final Exit-Gate Boundary
91
+
92
+ After every planned phase and review round finishes, the project root runs final
93
+ verification and the mandatory final lifecycle review. It then resolves
94
+ `workflow.gates.skills.oat-project-implement` and persists the result in
95
+ `oat_implement_exit_gate`. This configured gate is separate from the phase
96
+ reviewer, final lifecycle reviewer, and optional phase gate; none can substitute
97
+ for another.
98
+
99
+ Resolution and policy outcomes are explicit:
100
+
101
+ - A null resolution persists `allowed/no_gate` for the current implementation
102
+ basis.
103
+ - A configured passing review persists `allowed/passed` after any eligible
104
+ review receive is durably completed.
105
+ - `warn` persists `allowed/warned`; `prompt` proceeds only after explicit
106
+ approval persists `allowed/prompt_approved`.
107
+ - `block`, an unresolved prompt, invalid or contradictory output, and
108
+ operational or receive failures remain blocked. Remediation retries follow
109
+ the persisted `maxAttempts` policy.
110
+
111
+ Gate execution is resumable across both launch and receive. Before launch, OAT
112
+ persists an attempt ID, start time, and result-receipt path. It correlates those
113
+ with the gate run marker, structured envelope, and run-bound artifact before it
114
+ accepts a result or relaunches. Before receive, it persists the handoff and
115
+ source/archive correlation; resume verifies the archived artifact, Reviews
116
+ event, and bookkeeping commit before marking receive complete. Missing,
117
+ contradictory, or ambiguous correlation fails closed. A valid accepted run or
118
+ completed receive is never duplicated.
119
+
120
+ Freshness is bound to the reviewed HEAD and an implementation fingerprint.
121
+ Recognized closeout-only descendants preserve a valid result: gate artifacts
122
+ and receipts, project tracking and project-log appends,
123
+ summary/documentation/PR sequence outputs, final HiLL bookkeeping, and
124
+ completion bookkeeping. An implementation, test, skill, template, workflow
125
+ configuration, or unknown path change is substantive. It makes the gate result
126
+ stale, requires a current final lifecycle review for the new basis, and starts
127
+ a new gate generation.
128
+
129
+ Only an allowed and fresh gate disposition can enter the pre-approval sequence,
130
+ cross final HiLL, run the post-approval sequence, mark implementation complete,
131
+ or emit success.
132
+
87
133
  ## Phase Scope
88
134
 
89
135
  The root supplies one scope for the whole phase:
@@ -44,7 +44,23 @@ flowchart LR
44
44
 
45
45
  ## Post-implementation flow
46
46
 
47
- After implementation and final review pass:
47
+ Implementation closeout has one authoritative order:
48
+
49
+ 1. Run final implementation verification.
50
+ 2. Pass the mandatory final lifecycle review.
51
+ 3. Resolve and disposition the configured `oat-project-implement` exit gate.
52
+ 4. Run the configured pre-approval sequence.
53
+ 5. Record final HiLL approval when the final phase is a checkpoint.
54
+ 6. Run the configured post-approval sequence.
55
+ 7. Mark implementation complete and emit the implementation success output.
56
+
57
+ The configured exit gate is independent from the mandatory lifecycle review,
58
+ root-owned phase reviews, and optional `oat_phase_review_gate`. It must reach an
59
+ allowed and fresh disposition before pre-approval work starts. A null
60
+ configuration is recorded explicitly as `allowed/no_gate`; it is not inferred
61
+ from missing state.
62
+
63
+ After implementation closeout finishes:
48
64
 
49
65
  1. **Summary** (`oat-project-summary`) — generates `summary.md` as institutional memory from project artifacts; PR-final and completion will auto-refresh it if you have not already run it or if it is stale
50
66
  2. **Documentation** (`oat-project-document`) — optional sync of project docs; now uses the shared `tools.project-management` config signal to decide whether repo-reference refresh should run before docs analysis, and should recommend new docs pages/directories when the shipped work introduces a capability area that the docs app does not already cover
@@ -87,11 +103,18 @@ This distinction matters during completion: `oat-project-complete` can skip the
87
103
  ### Approval-aware post-implementation sequencing
88
104
 
89
105
  `workflow.postImplementSequence` can use the legacy string values or a structured
90
- `{ preApproval, postApproval }` value. After the final review passes, OAT
91
- snapshots the effective sequence, runs ordered pre-approval steps, records final
92
- HiLL approval, and only then runs post-approval steps. The snapshot is
93
- restart-safe: an incomplete sequence routes back to implementation and resumes
94
- from its first incomplete step.
106
+ `{ preApproval, postApproval }` value. After final verification, final review,
107
+ and an allowed, fresh implementation exit-gate disposition, OAT snapshots the
108
+ effective sequence, runs ordered pre-approval steps, records final HiLL
109
+ approval, and only then runs post-approval steps. The snapshot is restart-safe:
110
+ an incomplete sequence routes back to implementation and resumes from its first
111
+ incomplete step.
112
+
113
+ `oat-project-next` checks `oat_implement_exit_gate` before every normal
114
+ post-implementation route. Missing, pending, blocked, malformed, or stale state
115
+ routes back to `oat-project-implement` even when `oat_phase_status` is
116
+ `complete` or `pr_open`. Only an allowed, fresh disposition can continue to
117
+ summary, documentation, PR, or project completion.
95
118
 
96
119
  When `workflow.autoReviewAtHillCheckpoints` is enabled or `plan.md` frontmatter sets `oat_auto_review_at_hill_checkpoints`, completing a HiLL checkpoint automatically runs the extra lifecycle review scoped to every implementation phase not already covered by a passed whole-phase code review, through the just-completed checkpoint. Mid-implementation multi-phase reviews use inclusive phase-range scopes such as `p02-p03`; the final implementation checkpoint uses `code final`. The review uses auto-disposition mode (minors auto-converted to fix tasks, no user prompts). Disabled by default. Legacy `autoReviewAtCheckpoints` and `oat_auto_review_at_checkpoints` are still read as fallbacks. This does not control Tier 1 per-phase `oat-reviewer` gates.
97
120
 
@@ -216,7 +216,7 @@ Final review `passed` gate requires:
216
216
 
217
217
  ## Subagent Compatibility
218
218
 
219
- `oat-project-review-provide` uses provider-aware subagent dispatch when available:
219
+ `oat-project-review-provide` uses provider-aware subagent dispatch when available. This outer dispatch starts the primary `oat-reviewer`; it is separate from any optional reconnaissance workers that the reviewer may launch after resolving its authoritative review scope:
220
220
 
221
221
  - Claude Code: dispatch `oat-reviewer` with `subagent_type` (resolved from `.claude/agents/oat-reviewer.md`).
222
222
  - Cursor: dispatch `oat-reviewer` via explicit `/oat-reviewer` invocation or natural mention (resolved from `.cursor/agents/oat-reviewer.md`; `.claude/agents/oat-reviewer.md` is also supported for compatibility).
@@ -246,6 +246,93 @@ Final review `passed` gate requires:
246
246
  fallback). This generic fallback does not override managed exact-target
247
247
  rules: a managed reviewer that cannot be launched exactly blocks the review.
248
248
 
249
+ ### Reviewer-local reconnaissance
250
+
251
+ After the outer dispatch, the primary reviewer may use reviewer-local workers
252
+ when a broad review has multiple independent evidence lanes. Examples include
253
+ final code reviews, broad phase or phase-range reviews, documentation sweeps,
254
+ and provider-view audits. Running disjoint searches concurrently can reduce
255
+ wall-clock review time, and matching each lane to the least expensive model
256
+ class that can safely do the work can reduce cost. The primary reviewer first
257
+ reads the authoritative diff and the workflow-required discovery, spec,
258
+ design, plan, and implementation artifacts. It decides lane boundaries and
259
+ task classes only after understanding the changed surfaces, requirements, and
260
+ failure consequences. Narrow task and artifact reviews remain inline when
261
+ coordination would cost as much as direct inspection.
262
+
263
+ Worker authority and model capability are independent. Every reviewer-local
264
+ worker keeps the read-only, advisory `recon` role class. The lane's separate
265
+ task class sets its minimum model-capability floor:
266
+
267
+ - **Mechanical recon** covers deterministic inventories, exact parity checks,
268
+ and test, lint, format, or build execution whose results are cheaply
269
+ verifiable.
270
+ - **Intelligent recon** covers semantic interpretation, unfamiliar-code
271
+ auditing, and other evidence where a miss could be silent.
272
+ - **Stronger bounded analysis** is reserved for independently scoped work where
273
+ dispersed context, ambiguity, security, release safety, irreversible impact,
274
+ or expensive failure warrants a higher floor.
275
+
276
+ File count alone does not justify escalation. Interpretation and policy
277
+ judgment either use an adequate stronger class or remain with the primary
278
+ reviewer. Active user and repository instructions, the active-provider
279
+ guidance, and the live nested catalog resolve current model examples; the
280
+ canonical reviewer does not promise named models.
281
+
282
+ Reviewer-local fan-out is limited to one bounded, read-only, non-recursive
283
+ round. Each worker receives a disjoint scope, cannot modify files or spawn more
284
+ workers, and returns a compact advisory report containing:
285
+
286
+ - coverage and checks performed;
287
+ - exact `file:line` evidence;
288
+ - gaps in the assigned scope; and
289
+ - explicit uncertainty, including uncertainty about absence claims.
290
+
291
+ Before launching these lanes, the reviewer loads the generic
292
+ `oat-dispatch-subagents` contract and exactly one active-provider reference.
293
+ That shared contract owns nested capability checks, worker catalog resolution,
294
+ model and effort selection, routing, authorization, launch evidence, and
295
+ provider-specific mechanics. It records each lane's task class, model-class
296
+ floor, classification rationale, and floor satisfaction without assuming that
297
+ workers inherit the primary reviewer's target. Lanes may share one wave only
298
+ when their task classes, model floors, and all other dispatch axes match;
299
+ mixed-class reviews use separate waves and records.
300
+
301
+ This generic reviewer-local use is distinct from
302
+ `oat-project-dispatch-subagents`, which is reserved for OAT lifecycle phase and
303
+ task dispatch policy. Reviewer-local lanes do not load or depend on that
304
+ lifecycle adapter.
305
+
306
+ Worker reports are candidate observations, not findings. The primary reviewer
307
+ reopens authoritative sources, verifies load-bearing positive and negative
308
+ claims, reconciles overlap and disagreement, fills cross-lane gaps, performs
309
+ synthesis, assigns severity, decides validation, and alone writes the review
310
+ artifact or final `StructuredFindings`.
311
+
312
+ When the reviewer attempts delegated reconnaissance, the review artifact
313
+ includes a compact `Review Orchestration` section. It records each wave's task
314
+ class and classification rationale, selected target, acceptance and outcome,
315
+ floor satisfaction, fallback, and the primary reviewer's reconciliation. The
316
+ section is the detailed evidence source; it does not copy every internal worker
317
+ record. Structured-output reviews keep the existing schema and summarize the
318
+ same orchestration evidence in `summary`.
319
+
320
+ The reviewer and its workers never write `project-log.md`. After validating the
321
+ artifact, the root project implementation or review workflow uses
322
+ `oat project log append` to add one concise structural entry that references
323
+ the artifact. Logging remains capability-gated by the CLI helper, so disabled
324
+ project logging requires no reviewer-side branch or write authority.
325
+
326
+ If nested workers are unsupported, unauthorized, fail, or return empty or
327
+ malformed reports, the primary reviewer covers those lanes inline. It also
328
+ stays inline when the host cannot explicitly satisfy a lane's model-class
329
+ floor. Fallback never selects below the declared floor. It preserves the same
330
+ checklist, verification depth, severity policy, and final output contract; it
331
+ does not promise provider behavior or silently inherit the primary reviewer's
332
+ model. Workers remain advisory and non-recursive regardless of task class, and
333
+ the primary reviewer keeps final verification, reconciliation, severity,
334
+ validation decisions, and output ownership.
335
+
249
336
  ## Reference artifacts
250
337
 
251
338
  - `.oat/projects/<scope>/<project>/plan.md` (`## Reviews`)
@@ -1,6 +1,6 @@
1
1
  {
2
- "cli": "0.2.2",
3
- "docs-config": "0.2.2",
4
- "docs-theme": "0.2.2",
5
- "docs-transforms": "0.2.2"
2
+ "cli": "0.2.4",
3
+ "docs-config": "0.2.4",
4
+ "docs-theme": "0.2.4",
5
+ "docs-transforms": "0.2.4"
6
6
  }