<!-- task=m-iop-owned-single-request-agent-execution/22+21_executor_activation plan=0 tag=API milestone-task=review-stage -->

# Activate the single-request executor

## For the Implementing Agent

Filling the implementation-owned sections of `CODE_REVIEW-cloud-G07.md` is the mandatory last implementation step. Run every verification command, paste actual output, keep both active files in place, and report ready for review; only the official code-review skill may append a verdict, archive files, write `complete.log`, or classify the next state. If blocked, record the exact blocker, attempted commands/output, and resume condition only in the review evidence fields; do not ask the user, call a user-input tool, create a control-plane stop file, or change the owner or scope.

## Background

The predecessor supplies a deterministic, request-safe Plan → Work → Review executor but leaves it unreachable from production construction. This closure child installs that executor at Edge startup, proves the production construction seam, and updates the current outer contract and implementation spec while leaving external S12 qualification deferred.

## Archive Evidence Snapshot

- Pre-refine parent plan: checkpoint `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`, `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/PLAN-cloud-G09.md`.
- Pre-refine parent review: checkpoint `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`, `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/CODE_REVIEW-cloud-G09.md`.
- The checkpoint pair contains no implementation evidence or official verdict; refinement split it once into three scope-preserving children. No active-log path is required after predecessor archival.

## Analysis

### Files Read

- The original parent PLAN/CODE_REVIEW pair and its recorded source, test, contract, and SDD findings.
- No source, test, archived log body, or verification output was reread for this refinement.

### SDD Criteria

- This child contributes `review-stage` by making the completed private stage pipeline reachable through the existing single-request executor boundary.
- Provider-stage data remains private; only reviewer-approved output becomes public, and local deterministic evidence must not be presented as S12 external qualification.

### Verification Context

- The existing input construction seam and deterministic dependencies prove production installation.
- Changed-path regressions, broader Edge verification, and current-document searches close the activation boundary without a remote provider run.

### Test Coverage Gaps

- Production construction currently leaves the completed executor unset.
- Current contract/spec text cannot describe the pipeline as active until installation and its regression fixture pass.

### Symbol References

- `openai.NewSingleRequestExecutor(...)`, `Service.SetSingleRequestExecutor`, and `apps/edge/internal/input/manager.go` are the installation boundary.
- No public getter or Anthropic request/event schema change is needed.

### Split Judgment

- This child is the closure consumer of the proven composite and owns installation plus current-document synchronization.
- Review/repair and composite behavior stay in their predecessor children; external qualification stays in S12.
- The child is not recursively split in this refinement pass.

### Scope Rationale

Include input-manager construction, installation regression coverage, outer contract/spec activation wording, and existing Edge regressions. Exclude stage implementation, new public schemas, config changes, generic error/cancel quality work, and actual provider/Claude smoke.

### Final Routing

- `evaluation_mode=isolated-reassessment`; all build/review closures are true; no capability gap.
- Build scores `1/1/2/1/2` => G07, base/route `local-fit`, `worker/local/G07`, `PLAN-local-G07.md`.
- Review scores `1/1/2/1/2` => G07, `official-review`, `review/cloud/G07`, `CODE_REVIEW-cloud-G07.md`.
- `large_indivisible_context=false`; loop risk `boundary_contract` (1); `review_rework_count=0`; `evidence_integrity_failure=false`; finalizer `finalize-task-policy.sh`, mode `pair`.

## Dependencies and Execution Order

1. Before implementation or review, run the exact dependency command in Final Verification. It must print exactly one task-21 completion path from active or archive storage and exit zero.
2. Read only that resolved `complete.log`, then consume the completed production constructor without recreating stage or bridge ownership.
3. Prove installation before updating the current contract/spec, and leave S12 external evidence explicitly deferred.

## Implementation Checklist

- [x] Install the completed composite at Edge input startup through the existing setter and prove production construction no longer leaves the executor unset.
- [x] Add installation/unavailable-regression coverage without adding a public getter or changing the Anthropic request/event schema.
- [x] Update the current outer contract and implementation spec with active stage order, private provider outcomes, generic failure behavior, local evidence, and explicit S12 deferral.
- [x] Run dependency, installation, changed-path regression, vet, broader Edge, deterministic constructor/document search, and diff checks.
- [x] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [API-1] Install and synchronize the active contract

**Problem**

A complete composite remains unreachable until Edge startup installs it. Once installed, current docs must stop claiming managed single-request execution is unavailable while distinguishing deterministic local evidence from S12 qualification.

**Solution**

Construct and install the executor in `apps/edge/internal/input/manager.go` after its dependencies exist. Add an input fixture proving production construction no longer leaves the executor unset. Update the outer contract and current spec with stage order, private outcomes, generic failure behavior, local evidence, and explicit S12 deferral.

**Modified Files and Checklist**

- [x] Install `openai.NewSingleRequestExecutor(...)` through the existing setter in `apps/edge/internal/input/manager.go`.
- [x] Add installation/unavailable-regression coverage in `apps/edge/internal/input/manager_test.go`.
- [x] Update `agent-contract/outer/anthropic-compatible-api.md` and `agent-spec/runtime/edge-node-execution.md` without claiming external qualification.

**Test Strategy**

Use the existing input construction seam and deterministic dependencies to prove installation, then run unchanged public handler/stream and broader Edge regressions.

**Verification**

Run input installation, changed-package regression/vet, constructor searches, current-document searches, and diff checks.

## Modified Files Summary

| File | Items |
|------|-------|
| `apps/edge/internal/input/manager.go` | API-1 |
| `apps/edge/internal/input/manager_test.go` | API-1 |
| `agent-contract/outer/anthropic-compatible-api.md` | API-1 |
| `agent-spec/runtime/edge-node-execution.md` | API-1 |
| `agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/CODE_REVIEW-cloud-G07.md` | API-1 |

## Final Verification

Fresh output is required; Go tests use `-count=1` and cached output is not acceptable.

1. `bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/21_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/21+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/21_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/21+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))'` — prints exactly one predecessor completion path and exits zero.
2. `go test ./apps/edge/internal/input -run 'TestManager.*SingleRequestExecutor' -count=1` — production construction installs the executor.
3. `go test ./apps/edge/internal/service ./apps/edge/internal/openai ./apps/edge/internal/input -count=1` — changed-path regressions pass freshly.
4. `go vet ./apps/edge/internal/service ./apps/edge/internal/openai ./apps/edge/internal/input && go test ./apps/edge/... -count=1` — changed packages vet cleanly and broader Edge regression passes.
5. `rg --sort path -n 'NewSingleRequestExecutor|SetSingleRequestExecutor' apps/edge/internal/openai apps/edge/internal/input --glob '*.go'` — production construction and setter installation are explicit and test-covered.
6. `rg --sort path -n 'Plan|Work|Review|repair|active|claude-smoke|S12|deferred' agent-contract/outer/anthropic-compatible-api.md agent-spec/runtime/edge-node-execution.md` — docs describe active local behavior and leave external qualification deferred.
7. `git diff --check` — no whitespace errors.

Actual provider/Claude full-cycle evidence remains owned by S12 `claude-smoke`.

After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`.
