<!-- task=m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification plan=22 tag=REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_API milestone-task=workspace-binding,claude-smoke -->

# Code Review Reference - Sixth guarded Claude-through-IOP execution

> **[IMPLEMENTING AGENT — READ FIRST]** Execute exactly one authorized sixth live call after fresh provider-free readiness, fill every implementation-owned section, and stop. Never retry, append a verdict, archive files, or infer success from partial evidence.

## Overview

date=2026-08-08
task=m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification, plan=22, tag=REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_API

## Archive Evidence Snapshot

- Prior pair: `plan_cloud_G10_21.log` / `code_review_cloud_G10_21.log`; verdict `FAIL`, Required R15, `review_rework_count=20`, `evidence_integrity_failure=false`.
- Resolved external stop: `user_review_8.log`; exactly one sixth guarded execution is authorized with no retry.
- Five prior guards are immutable; disposable CP/Edge/Node are `47248/62931/47260` at plan start.

## For the Review Agent

Verify readiness preceded guard creation, exactly one sixth call occurred, the child freeze was active, privacy/cardinality are closed, and publication matches the terminal outcome. Append one verdict and materialize its required next state.

## Implementation Item Completion

| Item | Status |
|---|---|
| readiness | [x] |
| sole-call | [x] |
| cardinality | [x] |
| publication | [x] |

## Implementation Checklist

- [x] Reconfirm the exact repaired runtime, certificate, catalog, provider-free frozen/unsupported shapes, preflight, zero ingress/process, five finalized guards, and absent artifacts.
- [x] Atomically create only `sole-live-6.started` after every readiness gate passes.
- [x] Run the Claude-through-IOP harness exactly once with fresh config and in-memory SOPS caller; never retry.
- [x] Finalize the guard as `sole-live-6.rc-N` and capture only closed result/cardinality evidence.
- [x] Publish manifest and success-only owners only on complete S12 PASS; otherwise leave them untouched.
- [x] Fill implementation-owned review sections and stop for official review.

## Review-Only Checklist

- [x] Append one verdict and verified routing signals.
- [x] Verify repaired child scope, sole-call evidence, S12 output, privacy, and no-retry cardinality.
- [x] Archive the active pair and materialize the verdict's next state.

## Deviations from Plan

- One supervised Claude CLI process produced two accepted Messages requests after the first plan-stage terminal error. The harness itself executed `--run` exactly once and performed no retry, but the installed client's ambient `CLAUDE_CODE_MAX_RETRIES` behavior was not frozen. Both requests are counted as part of the consumed sixth guard; no seventh call was attempted.

## Key Design Decisions

- The sixth guard was created only after provider-free readiness and finalized unconditionally as `sole-live-6.rc-69`; it is not reusable despite the failed result.
- The post-failure diagnosis read only fixed observation dimensions and static source/runtime metadata. No prompt, provider response, raw model output, credential, or new provider request was used.
- Because S12 requires ingress delta exactly 1 and complete stages, ingress delta 2 is a hard failure even if either internal request had progressed further.

## Verification Results

### 1. Fresh provider-free readiness

- CP/Edge/Node `47248/62931/47260`, health, certificate lifetime over 900 seconds, exact runtime evidence, and remote `git diff --check` passed.
- Authenticated catalog returned 200 with exactly one `iop-single-request-light`; the frozen Claude core returned a positive local token count and the unsupported context-hint neighbor returned `400 invalid_request_error`.
- Harness preflight returned the exact no-invocation PASS message. Ingress was 0, Claude process count was 0, five finalized guards and zero started guards existed, and manifest/workspace results were absent before guard creation.

### 2. Sixth sole live execution

- `sole-live-6.started` was atomically created once. One harness `--run` with a fresh Claude config and in-memory SOPS caller returned `[single-request-claude-smoke] validation failed: Claude invocation failed (status 1 class api-rejected reason api-error)` and harness exit 69.
- The guard was finalized as `sole-live-6.rc-69`. Harness invocation count was 1 and harness retry count was 0; installed Claude internally issued two accepted Messages requests after the first terminal error, so ingress changed `0 -> 2`. Canonical Claude process count returned `0 -> 0`.

### 3. S12 evidence or closed failure

- Both admitted requests entered only the Gemini plan stage (`mac-gemini-api`, `gemini-3.6-flash`) and ended as fixed `stage=plan`, `operation=plan`, `outcome=error`, `error_class=validation`, followed by successful cleanup and one validation terminal per request. Closed stage durations were 10,149 ms and 13,935 ms.
- The service observation vocabulary projects terminal `malformed`, `context`, and `validation` into the same metric value `validation`. The 10–14 second provider durations, successful Gemini tunnel admission, installed Claude's retry-on-5xx semantics, and two sequential requests narrow this result to a malformed plan terminal mapped to 502 `api_error`, not a pre-dispatch identity rejection. The raw Gemini output was not retained and its exact malformed shape is not asserted.
- No work/review/repair/final stage, tool call, workspace result, model output manifest, or S12 qualification artifact exists. Success-only owners remained untouched.

### 4. Privacy and final hygiene

- The SOPS caller stayed in process memory and was unset during wrapper cleanup. No caller value, provider response, prompt, workspace content, or raw error was printed or persisted in task evidence.
- Final state: ingress 2; six finalized `.rc-69` guards; zero `.started` guards; Claude process count 0; result and manifest absent; fleet remained live. No retry or seventh guard/call occurred.
- Installed Claude static strings expose `CLAUDE_CODE_MAX_RETRIES`; the current harness does not set it. The active task evidence records both client-internal cardinality drift and the plan dispatch validation boundary without overclaiming its missing field subtype.

---

> Implementer: fill every implementation-owned field, then stop for official review.

## Code Review Result

### Overall Verdict

FAIL

### Dimension Assessment

| Dimension | Assessment | Evidence |
|---|---|---|
| Correctness | Fail | The experimental-beta repair admitted the requests, but both failed at the plan-stage dispatch identity gate. |
| Completeness | Fail | Neither request reached work/review/final, and no workspace result or manifest exists. |
| Test coverage | Pass | Fresh fleet, certificate, catalog, frozen/unsupported count-token, preflight, guard, process, and artifact gates preceded execution. |
| API contract | Pass | The request crossed the Anthropic ingress boundary and returned only a closed API error; no raw provider data was exposed. |
| Code quality | Fail | The child environment freezes experimental betas but leaves installed-client retry cardinality ambient, and the dispatch mismatch gate retains no fixed member class. |
| Implementation deviation | Fail | One harness invocation produced two accepted requests because Claude's internal retry limit was not frozen. |
| Verification trust | Pass | `sole-live-6.rc-69`, ingress delta 2, two plan validation observations, two cleanups/terminals, zero remaining process, and absent artifacts agree. |
| Spec conformance | Fail | S12 requires ingress delta exactly 1 and a complete Gemini -> Ornith-fast -> Gemini sequence with one terminal. |

### Findings

- Required R16 — `scripts/e2e-single-request-claude.sh:868`: freeze the supervised child with `CLAUDE_CODE_MAX_RETRIES=0` in addition to the experimental-beta switch, require the fake to observe the exact value, and add a self-test proving one child invocation cannot produce an ambient retry path. Do not mutate the parent/user Claude configuration.
- Required R17 — `apps/edge/internal/openai/single_request_plan_stage.go:57`: both Gemini plan calls ran for provider-response latency and then produced the observation value `validation`. Service observation intentionally projects terminal `malformed`, `context`, and `validation` into that one label; installed Claude retries the resulting generic 5xx but not the plan-stage 400 validation branch. Together with the sequential second request, this identifies the closed terminal as malformed plan output mapped to 502 `api_error`. Make the provider plan-output contract deterministic and provider-compatible while preserving the exact two-field canonical artifact boundary; add a distinct fixed terminal/reason projection so future evidence distinguishes malformed model output from binding validation without retaining raw output.

### Routing Signals

- `evaluation_mode=isolated-reassessment`
- `verdict=FAIL`
- `review_rework_count=21`
- `evidence_integrity_failure=false`
- `next_state=plan`
