<!-- task=m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence plan=4 tag=REVIEW_OFR-S07-PINNED-CONTEXT-4 -->

# Code Review Reference - REVIEW_OFR-S07-PINNED-CONTEXT-4

> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.**
> The task is NOT complete until every implementation-owned section below is filled in.
> Complete the `Implementation Checklist`; the final checklist item is mandatory before saving.
> Fill implementation-owned sections, then stop with active files in place and report ready for review.
> If implementation is blocked, record the exact blocker, attempted commands/output, and resume condition only in implementation-owned evidence fields.
> Do not ask the user directly, present choices, call user-input tools, create control-plane stop files, or classify the next state.
> Finalization (`Code Review Result`, log rename, `complete.log`, archive moves, `Review-Only Checklist`) is review-agent-only, even after compaction/resume.
> Follow the ownership table at the bottom of this file for which sections you own.

## Overview

date=2026-07-30
task=m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence, plan=4, tag=REVIEW_OFR-S07-PINNED-CONTEXT-4

## Roadmap Targets

- Milestone: `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/openai-compatible-output-validation-filters.md`
- Milestone link: [Milestone document](agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/openai-compatible-output-validation-filters.md)
- Task ids:
  - `repeat-guard`: rolling content/history/action repetition detection and safe continuation
- Completion mode: check-on-pass

## Archive Evidence Snapshot

- `plan_cloud_G08_0.log` / `code_review_cloud_G08_0.log`: authentication blocker; `invocation_count=0`.
- `plan_cloud_G08_1.log` / `code_review_cloud_G08_1.log`: one consumed incomplete invocation; no accepted summary.
- `user_review_1.log`: resolved authorization/replan boundary and zero-provider-snapshot diagnosis.
- `plan_cloud_G09_2.log` / `code_review_cloud_G09_2.log`: no-change Edge apply left provider snapshots absent; `invocation_count=0`.
- `plan_cloud_G10_3.log` / `code_review_cloud_G10_3.log`: FAIL because the compose build copied sibling `iop` at `89660dc1bd3547deb1ecb4906b13eeafc1000f60`, not pinned `iop-dev` at `750cb1d1cb88066a10d3c703c99f1326306d8e15`; the rebuilt image and live status had zero provider snapshots, and `invocation_count=0`.
- Preserve all earlier `/tmp/iop-repeat-guard-live/repeat-guard-task-03-*` artifacts. Use only the fresh plan-4 build-context, build-log, and result paths declared below.

## For the Review Agent

> **[REVIEW AGENT ONLY]** The finalization steps below are review-agent only. Implementing agents must not execute this section.

Compare implementation of each item against source files and verify that output in `Verification Results` matches code.
Review completion means the following steps are finished:

1. Append verdict and `review_rework_count` / `evidence_integrity_failure` routing signals.
2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_4.log` and `PLAN-cloud-G10.md` → `plan_cloud_G10_4.log`.
3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill.
4. If PASS and task group is `m-<milestone-slug>`, report completion event metadata. Roadmap state check and `update-roadmap` calls are runtime responsibilities.
5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting.

---

## Implementation Item Completion

| Item | Status |
|------|---------|
| REVIEW_OFR-S07-PINNED-CONTEXT-4-1 | [ ] |
| REVIEW_OFR-S07-PINNED-CONTEXT-4-2 | [ ] |

## Implementation Checklist

- [ ] [REVIEW_OFR-S07-PINNED-CONTEXT-4-1] Prove both providers and the pinned source/dependency state, build exactly one Control Plane image from an isolated context populated from pinned `iop-dev`, recreate only that service exactly once, and require matching source labels, the current binary contract, four connected nodes, and healthy/idle provider capacities `3+1`.
- [ ] [REVIEW_OFR-S07-PINNED-CONTEXT-4-2] Only after the complete image/status gate passes, start exactly one caller-owned foreground 5-concurrent x 3-run S07 invocation on the fresh plan-4 path, validate the raw-free summary and idle cleanup, and preserve every prior artifact.
- [x] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

## Review-Only Checklist

> **[REVIEW AGENT ONLY]** This checklist is used only by the review agent.
> Implementing agents must not modify or check this section.

- [x] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure` to `Code Review Result`.
- [x] Verify that verdict, `Dimension Assessment`, and Required/Suggested/Nit classifications match.
- [x] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G10_4.log`.
- [x] Archive active `PLAN-*-G??.md` to `plan_cloud_G10_4.log`.
- [x] Verify that the Agent-Ops managed block in `.gitignore` unignores `agent-task/**/*.md` and `agent-task/**/*.log` and ignores `agent-roadmap/current.md`.
- [ ] If PASS, write `complete.log` based on `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md` files.
- [ ] If PASS, move active task directory `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/` to `agent-task/archive/YYYY/MM/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/` and update this checklist at the final archive path.
- [ ] If PASS and task group is `m-<milestone-slug>`, report completion event metadata for runtime, without modifying roadmap or directly calling `update-roadmap`.
- [ ] If PASS for split work, remove empty active parent `agent-task/m-openai-compatible-output-validation-filters/` or verify it was kept due to remaining siblings/files.
- [x] If WARN/FAIL, write the next filesystem state matching code-review verdict and do not write `complete.log`.

## Deviations from Plan

The pinned image build/recreate command reached the bounded live status gate, but that gate exited 65 after 30 checks. The sanitized terminal status reported four connected nodes and four provider snapshots, while at least one required healthy/idle `3+1` provider condition remained false. Per the packet's non-retryable mutation boundary, the command was not rerun and the S07 invocation and cleanup commands were not started.

The final credential grep was piped through redaction so possible matched material could not reach evidence output; its pattern, paths, and exclusions were unchanged. An initial temporary-file wrapper was rejected locally before any hygiene command executed because its cleanup form violated command safety policy. The check was immediately run once without a temporary file; this caused no remote or workspace mutation.

## Key Design Decisions

Stopped immediately after the status-stage blocker. The packet consumed exactly one image-build allowance and one Control Plane force-recreate allowance, but consumed no model invocation. No Edge/config/provider recovery or mutation was attempted, and no prior artifact was removed.

## Reviewer Checkpoints

- Verify both Windows readiness commands used `-Action Status` and no provider mutation ran.
- Verify the source archive came from clean pinned `iop-dev` HEAD `750cb1d1cb88066a10d3c703c99f1326306d8e15`, the copied `proto-socket/go` subtree came from HEAD `3c1ffe87e560852c95c7f5f5b98e9c07eae8fdde`, and sibling `iop` was not a Docker source.
- Verify exactly one image build and one Control Plane force-recreate occurred, `--no-build` prevented compose from rebuilding the wrong context, and no Edge/config/provider mutation ran.
- Verify the new image and running container expose matching source labels and the current `provider_snapshots` binary contract.
- Verify four connected nodes and healthy/idle OneXPlayer/RTX5090 snapshots at capacities `3+1` before authentication or model launch.
- Verify SOPS authentication printed no raw token, token hash, or Authorization value.
- Verify the foreground Go process started at most once, stayed caller-owned until terminal exit, and was never retried.
- Verify accepted summary cardinalities, capacity rows, result classification, idle cleanup, source identity, artifact isolation, and secret hygiene.
- Verify PASS reports only `repeat-guard`, not `ops-evidence`.

## Verification Results

### Direct provider readiness

Commands:

```bash
ssh -o BatchMode=yes -o ConnectTimeout=15 r0bin@192.168.0.59 \
  'powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:/Users/r0bin/iop-field/remote-llm-toggle.ps1 -Action Status' |
  jq -e '.success == true and .state.ready == true and .state.health == "ok" and .state.model_loaded == true and .state.profile_valid == true and .state.listener_public == true and .state.edge_connected == true'

ssh -o BatchMode=yes -o ConnectTimeout=15 iop-dev-rtx5090 \
  'powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:/Users/r0bin/iop-field/remote-llm-toggle.ps1 -Action Status' |
  jq -e '.success == true and .state.ready == true and .state.health == "ok" and .state.model_loaded == true and .state.profile_valid == true and .state.listener_public == true and .state.edge_connected == true'
```

Implementation evidence:

Only `-Action Status` ran on each provider host. No provider mutation command ran.

```text
true
onexplayer_status_exit=0
true
rtx5090_status_exit=0
combined_exit=0
```

### Pinned isolated-context build/recreate and status gate

Command:

```bash
ssh -o BatchMode=yes -o ConnectTimeout=15 toki@toki-labs.com '/bin/zsh -lc "exec /bin/zsh -s"' <<'REMOTE'
set -euo pipefail
set +x
cd /Users/toki/agent-work/iop-dev

expected_head=750cb1d1cb88066a10d3c703c99f1326306d8e15
expected_proto_head=3c1ffe87e560852c95c7f5f5b98e9c07eae8fdde
expected_test_hash=46261bb3a3000e00c27c419682f741c64c31c849d0aa30cbc024ed4531e7bfa6
test_file=apps/edge/internal/openai/stream_gate_vertical_slice_test.go
build_context=/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-4-build-context
build_log=/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-4-control-plane-build.log
artifact_dir=/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-4
status_file=$(/usr/bin/mktemp -t iop-repeat-cp-status.XXXXXX)
cleanup() {
  /bin/rm -f -- "$status_file"
  /bin/rm -rf -- /tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-4-build-context
}
trap cleanup EXIT

test "$(git branch --show-current)" = feature/openai-compatible-output-validation-filters
test "$(git rev-parse HEAD)" = "$expected_head"
test -z "$(git status --porcelain)"
test "$(git -C /Users/toki/agent-work/proto-socket rev-parse HEAD)" = "$expected_proto_head"
test -z "$(git -C /Users/toki/agent-work/proto-socket status --porcelain -- go)"
test "$(/usr/bin/shasum -a 256 "$test_file" | /usr/bin/awk '{print $1}')" = "$expected_test_hash"
test "$(/usr/bin/grep -c 'json:\"provider_snapshots,omitempty\"' apps/control-plane/cmd/control-plane/http_views.go)" -ge 1
git diff --check
test ! -e "$build_context"
test ! -e "$build_log"
test ! -e "$artifact_dir"
test -d /tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-1
test -d /tmp/iop-repeat-guard-live/repeat-guard-task-03-direct-2
test ! -e /tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-2
test ! -e /tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-3
test -f /tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-3-control-plane-build.log
! /usr/bin/pgrep -fl '[T]estDevRepeatGuardOrnithSmoke' >/dev/null

docker_bin=$(command -v docker)
go_bin=$(command -v go)
test -n "$docker_bin"
test -n "$go_bin"
test "$(command -v git)" = /usr/bin/git
test "$(command -v tar)" = /usr/bin/tar
test "$(command -v ditto)" = /usr/bin/ditto
test "$(command -v strings)" = /usr/bin/strings
"$docker_bin" compose version
for port in 18001 18083 18084 19093; do /usr/bin/nc -z 127.0.0.1 "$port"; done
"$go_bin" test -count=1 ./apps/edge/internal/service ./apps/edge/internal/controlplane ./apps/control-plane/cmd/control-plane

before_container=$("$docker_bin" ps --filter publish=18001 --format '{{.ID}}' | /usr/bin/head -1)
before_image=$("$docker_bin" image inspect iop-dev-agent-control-plane:latest --format '{{.Id}}')
test -n "$before_container"
test -n "$before_image"

/bin/mkdir -p "$build_context/iop" "$build_context/proto-socket"
git archive --format=tar HEAD | /usr/bin/tar -xf - -C "$build_context/iop"
/usr/bin/ditto /Users/toki/agent-work/proto-socket/go "$build_context/proto-socket/go"
test "$(/usr/bin/shasum -a 256 "$build_context/iop/$test_file" | /usr/bin/awk '{print $1}')" = "$expected_test_hash"
test "$(/usr/bin/grep -c 'json:\"provider_snapshots,omitempty\"' "$build_context/iop/apps/control-plane/cmd/control-plane/http_views.go")" -ge 1

if ! "$docker_bin" build --no-cache \
  --label iop.source.repo=iop-dev \
  --label "iop.source.head=$expected_head" \
  --label "iop.source.proto_socket_head=$expected_proto_head" \
  --tag iop-dev-agent-control-plane:latest \
  --file "$build_context/iop/apps/control-plane/Dockerfile" \
  "$build_context" >"$build_log" 2>&1; then
  /usr/bin/tail -80 "$build_log"
  print -r -- 'control_plane_redeploy_gate=BLOCKED stage=build invocation_count=0'
  exit 61
fi

new_image=$("$docker_bin" image inspect iop-dev-agent-control-plane:latest --format '{{.Id}}')
source_repo=$("$docker_bin" image inspect iop-dev-agent-control-plane:latest --format '{{index .Config.Labels "iop.source.repo"}}')
source_head=$("$docker_bin" image inspect iop-dev-agent-control-plane:latest --format '{{index .Config.Labels "iop.source.head"}}')
proto_head=$("$docker_bin" image inspect iop-dev-agent-control-plane:latest --format '{{index .Config.Labels "iop.source.proto_socket_head"}}')
if [[ -z "$new_image" || "$new_image" = "$before_image" || "$source_repo" != iop-dev || "$source_head" != "$expected_head" || "$proto_head" != "$expected_proto_head" ]]; then
  print -r -- 'control_plane_redeploy_gate=BLOCKED stage=image_provenance invocation_count=0'
  exit 62
fi

if ! "$docker_bin" compose --env-file .env.dev.example up -d --no-deps --force-recreate --no-build control-plane >>"$build_log" 2>&1; then
  /usr/bin/tail -80 "$build_log"
  print -r -- 'control_plane_redeploy_gate=BLOCKED stage=recreate invocation_count=0'
  exit 63
fi

after_container=$("$docker_bin" ps --filter publish=18001 --format '{{.ID}}' | /usr/bin/head -1)
after_image=$("$docker_bin" inspect --format '{{.Image}}' "$after_container")
contract_hits=$("$docker_bin" exec "$after_container" sh -c "strings /usr/local/bin/control-plane | grep -c provider_snapshots || true")
if [[ -z "$after_container" || "$after_container" = "$before_container" || "$after_image" != "$new_image" || "$contract_hits" -lt 1 ]]; then
  print -r -- "control_plane_redeploy_gate=BLOCKED stage=running_contract contract_hits=$contract_hits invocation_count=0"
  exit 64
fi

ready=false
for _ in {1..30}; do
  if /usr/bin/curl -fsS http://127.0.0.1:18001/healthz >/dev/null &&
     /usr/bin/curl -fsS http://127.0.0.1:18001/readyz >/dev/null &&
     /usr/bin/curl -fsS http://127.0.0.1:18001/edges/edge-toki-labs-dev/status >"$status_file" &&
     /usr/bin/jq -e '
       def provider($id): first(.nodes[]?.provider_snapshots[]? | select(.id == $id));
       ((.error // "") == "") and
       ((.nodes // []) | length == 4) and
       (all(.nodes[]; .connected == true)) and
       (provider("onexplayer-lemonade").capacity == 3) and
       (provider("onexplayer-lemonade").health == "healthy") and
       (provider("onexplayer-lemonade").in_flight == 0) and
       (provider("onexplayer-lemonade").queued == 0) and
       (provider("rtx5090-lemonade").capacity == 1) and
       (provider("rtx5090-lemonade").health == "healthy") and
       (provider("rtx5090-lemonade").in_flight == 0) and
       (provider("rtx5090-lemonade").queued == 0)
     ' "$status_file" >/dev/null; then
    ready=true
    break
  fi
  sleep 2
done

if [[ "$ready" != true ]]; then
  /usr/bin/curl -fsS http://127.0.0.1:18001/edges/edge-toki-labs-dev/status >"$status_file" || true
  /usr/bin/jq -c '{
    error: (.error // null),
    node_count: ((.nodes // []) | length),
    connected_count: ([.nodes[]? | select(.connected == true)] | length),
    provider_snapshot_count: ([.nodes[]?.provider_snapshots[]?] | length)
  }' "$status_file" 2>/dev/null || print -r -- '{"status":"unavailable"}'
  print -r -- 'control_plane_redeploy_gate=BLOCKED stage=status invocation_count=0'
  exit 65
fi

print -r -- "control_plane_redeploy_gate=PASS image_source=iop-dev source_head=$source_head contract_hits=$contract_hits nodes=4 providers=3+1_idle build_log=$build_log invocation_count=0"
REMOTE
```

Implementation evidence:

The source/dependency identity, cleanliness, fixture hash, current source contract, fresh artifact paths, tools, ports, and prior-artifact guards all passed before the build. The command therefore used pinned `iop-dev` HEAD `750cb1d1cb88066a10d3c703c99f1326306d8e15` and clean `proto-socket` HEAD `3c1ffe87e560852c95c7f5f5b98e9c07eae8fdde`.

The command structure performed exactly one isolated-context `docker build` and exactly one `docker compose ... --no-build --no-deps --force-recreate control-plane`. It then passed the changed-image/source-label/running-image/binary-contract checks, because execution reached the subsequent live status loop. Image and container ids were not emitted before the blocker and are not reconstructed here.

```text
Docker Compose version v2.31.0-desktop.2
Connection to 127.0.0.1 port 18001 [tcp/*] succeeded!
Connection to 127.0.0.1 port 18083 [tcp/*] succeeded!
Connection to 127.0.0.1 port 18084 [tcp/*] succeeded!
Connection to 127.0.0.1 port 19093 [tcp/*] succeeded!
ok  	iop/apps/edge/internal/service	6.260s
ok  	iop/apps/edge/internal/controlplane	5.717s
ok  	iop/apps/control-plane/cmd/control-plane	0.986s
curl: (22) The requested URL returned error: 404
curl: (22) The requested URL returned error: 404
{"error":null,"node_count":4,"connected_count":4,"provider_snapshot_count":4}
control_plane_redeploy_gate=BLOCKED stage=status invocation_count=0
exit=65
```

Exact blocker: within the bounded 30-check status loop, at least one required provider predicate did not converge to the required healthy/idle OneXPlayer capacity 3 plus RTX5090 capacity 1 state, despite four connected nodes and four provider snapshots. This packet is non-retryable after the single build/recreate.

Resume condition: a separately authorized packet must first establish a sanitized per-provider status diagnosis and a complete gate with four connected nodes plus healthy/idle capacities `3+1`. Plan 4 cannot resume because its build/recreate mutation allowance is consumed.

### Foreground S07 invocation

Command:

```bash
ssh -o BatchMode=yes -o ConnectTimeout=15 toki@toki-labs.com '/bin/zsh -lc "exec /bin/zsh -s"' <<'REMOTE'
set -euo pipefail
set +x
cd /Users/toki/agent-work/iop-dev

expected_head=750cb1d1cb88066a10d3c703c99f1326306d8e15
expected_image_repo=iop-dev
artifact_dir=/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-4
secret=/Users/toki/.config/iop/secrets/dev-openai-toki.sops.yaml
age_key=/Users/toki/.config/sops/age/keys.txt
status_file=$(/usr/bin/mktemp -t iop-repeat-live-status.XXXXXX)
api_key=''
cleanup() {
  /bin/rm -f -- "$status_file"
  unset api_key
}
trap cleanup EXIT

test "$(git rev-parse HEAD)" = "$expected_head"
test -z "$(git status --porcelain)"
test "$(/usr/bin/shasum -a 256 apps/edge/internal/openai/stream_gate_vertical_slice_test.go | /usr/bin/awk '{print $1}')" = 46261bb3a3000e00c27c419682f741c64c31c849d0aa30cbc024ed4531e7bfa6
test ! -e "$artifact_dir"
test -d /tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-1
test -d /tmp/iop-repeat-guard-live/repeat-guard-task-03-direct-2
test ! -e /tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-2
test ! -e /tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-3
! /usr/bin/pgrep -fl '[T]estDevRepeatGuardOrnithSmoke' >/dev/null

container=$(docker ps --filter publish=18001 --format '{{.ID}}' | /usr/bin/head -1)
test -n "$container"
test "$(docker inspect --format '{{index .Config.Labels "iop.source.repo"}}' "$container")" = "$expected_image_repo"
test "$(docker inspect --format '{{index .Config.Labels "iop.source.head"}}' "$container")" = "$expected_head"
test "$(docker exec "$container" sh -c "strings /usr/local/bin/control-plane | grep -c provider_snapshots || true")" -ge 1

test -x /opt/homebrew/bin/sops
test -r "$age_key"
test -r "$secret"
test "$(/usr/bin/stat -f %Lp "$secret")" = 600
api_key=$(SOPS_AGE_KEY_FILE="$age_key" /opt/homebrew/bin/sops decrypt --extract '["tokens"]["toki-dev-pi"]' "$secret")
test -n "$api_key"

/usr/bin/curl -fsS http://127.0.0.1:18001/edges/edge-toki-labs-dev/status >"$status_file"
/usr/bin/jq -e '
  def provider($id): first(.nodes[]?.provider_snapshots[]? | select(.id == $id));
  ((.nodes // []) | length == 4) and
  (all(.nodes[]; .connected == true)) and
  (provider("onexplayer-lemonade").capacity == 3) and
  (provider("onexplayer-lemonade").health == "healthy") and
  (provider("onexplayer-lemonade").in_flight == 0) and
  (provider("onexplayer-lemonade").queued == 0) and
  (provider("rtx5090-lemonade").capacity == 1) and
  (provider("rtx5090-lemonade").health == "healthy") and
  (provider("rtx5090-lemonade").in_flight == 0) and
  (provider("rtx5090-lemonade").queued == 0)
' "$status_file" >/dev/null

http_status=$(
  {
    print -r -- 'silent'
    print -r -- 'show-error'
    print -r -- 'output = "/dev/null"'
    print -r -- "header = \"Authorization: Bearer $api_key\""
  } | /usr/bin/curl --config - --write-out '%{http_code}' http://127.0.0.1:18083/v1/models
)
test "$http_status" = 200
/bin/rm -f -- "$status_file"

print -r -- 'remote_live_start invocation_count=1 ownership=foreground artifact=plan-4'
IOP_OPENAI_API_KEY="$api_key" \
IOP_OPENAI_BASE_URL=http://127.0.0.1:18083 \
IOP_OPENAI_MODEL=ornith:35b \
IOP_OPENAI_SMOKE_CONCURRENCY=5 \
IOP_OPENAI_SMOKE_RUNS=3 \
IOP_OPENAI_SMOKE_PROMPT_FILE=/tmp/iop-repeat-guard-live/repeat-prompt.txt \
IOP_OPENAI_SMOKE_ARTIFACT_DIR="$artifact_dir" \
IOP_OPENAI_SMOKE_OBSERVATION_FILE=/tmp/iop-repeat-guard-live/edge-observations.jsonl \
IOP_OPENAI_SMOKE_STATUS_URL=http://127.0.0.1:18001/edges/edge-toki-labs-dev/status \
IOP_OPENAI_SMOKE_PROVIDER_IDS=onexplayer-lemonade,rtx5090-lemonade \
"$(command -v go)" test -timeout 90m -count=1 -v ./apps/edge/internal/openai -run '^TestDevRepeatGuardOrnithSmoke$'
REMOTE
```

Implementation evidence:

Not run because the preceding Control Plane status gate exited 65. `remote_live_start` did not occur, no credential was decrypted for this step, and the exact invocation count is `0`.

```text
foreground_s07=NOT_RUN
remote_live_start=absent
invocation_count=0
exit=not_applicable
```

### Sanitized summary and cleanup

Command:

```bash
ssh -o BatchMode=yes -o ConnectTimeout=15 toki@toki-labs.com '/bin/zsh -lc "exec /bin/zsh -s"' <<'REMOTE'
set -euo pipefail
set +x
cd /Users/toki/agent-work/iop-dev
summary=/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-4/summary.json
status_file=$(/usr/bin/mktemp -t iop-repeat-cleanup.XXXXXX)
trap '/bin/rm -f "$status_file"' EXIT

test -f "$summary"
/usr/bin/jq -e '
  (.model == "ornith:35b") and (.concurrency == 5) and (.runs == 3) and
  ((.provider_responses | length) == 15) and
  (([.provider_responses[].provider_response_id] | unique | length) == 15) and
  ((.lifecycles | length) == 15) and
  (([.lifecycles[].correlation_id] | unique | length) == 15) and
  ((.capacity_runs | length) == 3) and
  (all(.capacity_runs[];
    (.configured_capacity == 4) and (.peak_in_flight == 4) and
    (.peak_queued >= 1) and (.final_in_flight == 0) and (.final_queued == 0))) and
  ((.result == "not_reproduced") or
    ((.result == "reproduced") and
     any(.lifecycles[];
       (.result == "reproduced") and
       ((.fingerprint // "") | length > 0) and
       (.offset >= 0))))
' "$summary" >/dev/null
result_evidence=$(/usr/bin/jq -r '
  if .result == "reproduced" then
    first(.lifecycles[] |
      select(.result == "reproduced") |
      "result=reproduced fingerprint=\(.fingerprint) offset=\(.offset)")
  else
    "result=not_reproduced"
  end
' "$summary")

/usr/bin/curl -fsS http://127.0.0.1:18001/edges/edge-toki-labs-dev/status >"$status_file"
/usr/bin/jq -e '
  def provider($id): first(.nodes[]?.provider_snapshots[]? | select(.id == $id));
  (provider("onexplayer-lemonade").in_flight == 0) and
  (provider("onexplayer-lemonade").queued == 0) and
  (provider("rtx5090-lemonade").in_flight == 0) and
  (provider("rtx5090-lemonade").queued == 0)
' "$status_file" >/dev/null
! /usr/bin/pgrep -fl '[T]estDevRepeatGuardOrnithSmoke' >/dev/null
test "$(git rev-parse HEAD)" = 750cb1d1cb88066a10d3c703c99f1326306d8e15
test -z "$(git status --porcelain)"
test -d /tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-1
test -d /tmp/iop-repeat-guard-live/repeat-guard-task-03-direct-2
test ! -e /tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-2
test ! -e /tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-3
print -r -- "remote_cleanup=PASS $result_evidence invocation_count=1 provider_responses=15 edge_correlations=15 capacity_runs=3 configured_capacity=4 peak_in_flight=4 queued_pressure=present providers=idle harness=absent source=unchanged prior_artifacts=preserved"
REMOTE
```

Implementation evidence:

Not run because no S07 invocation started and no accepted plan-4 summary exists.

```text
sanitized_summary_cleanup=NOT_RUN
invocation_count=0
exit=not_applicable
```

### Workspace and secret hygiene

Commands:

```bash
git diff --check
git status --short
git grep -nE 'sk-[A-Za-z0-9_-]{16,}|Authorization: Bearer [^$]' -- . \
  ':(exclude)agent-task/archive/**' \
  ':(exclude)agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/*.log'
```

Implementation evidence:

The required checks completed without printing matched material. Existing unrelated workspace changes were preserved.

```text
git_diff_check_exit=0
git_status_exit=0
credential_grep_exit=0
credential_grep_match_count=114
```

All 114 tracked matches are outside the active task pair and were not introduced by this implementation; they are pre-existing contract examples, fixtures, tests, archived roadmap material, and unrelated workspace content. A supplemental scan of the untracked active PLAN/CODE_REVIEW pair returned exit 0 with two self-check-regex matches and nine `sk-` false positives inside the literal `task-03-plan-4-build-context` / build-log paths. The active pair has zero potential credential matches after those classifications. No matched material was printed or copied into this evidence.

---

> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section?**
> If anything is blank, go back and fill it in before saving this file.
> Leave review-agent-only sections unchanged.

## Section Ownership

| Section | Owner | Note |
|---------|-------|------|
| Header comment, Overview, Review Agent Instructions | Fixed at stub creation | Implementing agent must not modify or execute these (archive, complete.log, and task-directory archive move are review-agent only) |
| Roadmap Targets | Fixed at stub creation from plan when present | Implementing agent must not modify; code-review copies it into `complete.log` as `Roadmap Completion` only on PASS |
| Archive Evidence Snapshot | Fixed at stub creation from plan when present | Implementing agent uses it as default prior-loop context; read only the specific archive files cited there when more detail is required |
| Implementation Item Completion (item names) | Fixed at stub creation | Implementing agent checks `[ ]` → `[x]` only |
| Implementation Checklist (item text/order) | Fixed at stub creation from plan | Implementing agent checks `[ ]` → `[x]` only |
| Review-Only Checklist | Review agent only | Implementing agent must not modify or check this section |
| Deviations from Plan, Key Design Decisions | Implementing agent | Replace placeholder text with actual content |
| Reviewer Checkpoints | Fixed at stub creation | Pre-filled from plan |
| Verification Results (section headings + commands) | Fixed at stub creation | Implementing agent fills in command output only; command changes require a `Deviations from Plan` entry |
| Code Review Result | Review agent appends | Not included in stub |

## Code Review Result

- Overall Verdict: FAIL
- Dimension Assessment:
  - Correctness: Fail
  - Completeness: Fail
  - Test coverage: Fail
  - API contract: Pass
  - Code quality: Pass
  - Implementation deviation: Pass
  - Verification trust: Pass
  - Spec conformance: Fail
- Findings:
  - Required — `CODE_REVIEW-cloud-G10.md:60`: the pinned Control Plane image now exposes the current provider-snapshot contract and all four nodes are connected, but the mandatory healthy/idle `3+1` gate never passed because `onexplayer-lemonade` remained `capacity=3, in_flight=1, queued=0`; the foreground S07 invocation consequently never started (`invocation_count=0`). Fresh reviewer sampling reproduced that unchanged snapshot five times while both Windows providers remained ready and no S07 harness existed. First determine whether the occupied lease represents a legitimate request or stale Edge accounting through bounded read-only runtime observation; if it is stale, restart only the OneXPlayer `iop-node.exe` process once through the documented session-independent `Win32_Process.Create` path while leaving Lemonade and the loaded model untouched, rely on the generation-scoped disconnect/reconnect settlement in `apps/edge/internal/service/model_queue_release.go`, require all four nodes to reconnect and both Ornith providers to return to `in_flight=0, queued=0`, and then run exactly one fresh 5-concurrent x 3-run S07 foreground invocation with the full 15-response, 15-correlation, three-capacity-row, result-classification, cleanup, source-identity, artifact-isolation, and secret-hygiene evidence.
- Routing Signals:
  - `review_rework_count=5`
  - `evidence_integrity_failure=false`
- Next Step: Invoke the plan skill with these raw findings and fresh reviewer evidence, rerun isolated routing, archive the current pair, and materialize the routed follow-up PLAN/CODE_REVIEW pair.
