<!-- task=m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence plan=2 tag=OFR-S07-SNAPSHOT-FOREGROUND-2 -->

# Re-seed provider status before one foreground repeat-guard run

## For the Implementing Agent

Filling every implementation-owned section in `CODE_REVIEW-cloud-G09.md` is mandatory. Keep this PLAN/CODE_REVIEW pair active and stop after recording actual evidence for official review.

Do not archive task files, write `complete.log`, modify roadmap state, create `USER_REVIEW.md`, ask the user directly, or classify the next state. A preflight failure is an implementation result: record its sanitized output, `invocation_count=0`, and the precise resume condition, then stop.

This plan does not start any external execution by being written. When the user starts the automation loop for this active pair, that loop start authorizes:

1. one documented no-change Edge runtime-config apply after a clean dry-run; and
2. at most one new S07 model invocation, only after the provider snapshot and every other preflight gate pass.

Never detach or background the live command. The caller-owned foreground execution session must remain attached until the Go process exits. Once the Go test starts, do not retry it. Never print or track a raw token, token hash, prompt, response, SSE body, private endpoint material, full status payload, or full `summary.json`.

## Background

The two earlier routed attempts did not produce accepted S07 evidence. Plan 0 stopped before execution because authentication was unavailable. Plan 1 consumed one live attempt but produced only four SSE artifacts, no summary, and incomplete cleanup. A later direct replacement was cancelled by the user, its exact harness processes were terminated, and its four SSE artifacts remain preserved without a summary.

The external stack is now reachable again: authentication returns HTTP 200, all four nodes are connected, the remote checkout is clean, the deployed Edge binary matches its build artifact, and the repeat-guard harness is absent. Focused Edge/Control Plane tests also pass. The remaining contradiction is operational: `build/dev-runtime/edge.yaml` contains four enabled providers, including OneXPlayer capacity 3 and RTX5090 capacity 1, but the live Control Plane status response contains zero `provider_snapshots`.

The documented no-change refresh path is the least invasive recovery. Its dry-run reports `status=applied`, `changes=0`, and no error. In apply mode the runtime commits a fresh service/node-store snapshot while intentionally skipping node config push when there are no changes. This packet must use that path once, prove the provider snapshot contract, and only then permit one foreground S07 run.

## 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 live attempt; four SSE files, no summary, and no accepted cleanup evidence.
- `user_review_0.log`: protected host SOPS credential provisioning and token rotation evidence.
- `user_review_1.log`: resolved replan decision, cancellation cleanup, current readiness tests, and the live `provider_snapshots=0` contradiction.
- Preserve `/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-1` and `/tmp/iop-repeat-guard-live/repeat-guard-task-03-direct-2`. Neither is accepted evidence and neither may be deleted, overwritten, or reused.
- The incomplete task-02 archive is historical only. Do not reopen it or count it as task-03 work.

## 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

## Analysis

### Files Read

- `apps/edge/internal/bootstrap/runtime.go`
- `apps/edge/internal/controlplane/connector.go`
- `apps/edge/internal/service/service.go`
- `apps/edge/internal/service/status_provider.go`
- `apps/edge/internal/service/model_queue_snapshot.go`
- `apps/control-plane/cmd/control-plane/http_views.go`
- `apps/edge/internal/openai/stream_gate_vertical_slice_test.go`
- `agent-contract/outer/openai-compatible-api.md`
- `agent-contract/inner/edge-config-runtime-refresh.md`
- `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/openai-compatible-output-validation-filters.md`
- `agent-roadmap/sdd/knowledge-tool-optimization-extension/openai-compatible-output-validation-filters/SDD.md`
- `agent-test/dev/rules.md`
- `agent-test/dev/edge-smoke.md`
- `agent-test/local/rules.md`
- `agent-test/local/edge-smoke.md`
- `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/plan_cloud_G08_1.log`
- `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/code_review_cloud_G08_1.log`
- `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/user_review_1.log`

### SDD Criteria

- SDD S07 requires `ornith:35b`, `stream=true`, long Korean output, model-group total capacity+1 concurrency, and at least three runs.
- For this `repeat-guard` packet, accepted live evidence is five concurrent requests across three runs, 15 provider response identities, 15 Edge correlations, three capacity rows with configured capacity 4, peak in-flight 4 and queue pressure, plus a sanitized repeat fingerprint/offset or `not_reproduced`.
- The broader S07 `ops-evidence` row also owns generic smoke and D03 logging assertions. This packet must report only `repeat-guard` on PASS.

### Verification Context

- Runner: `ssh toki@toki-labs.com`; workdir `/Users/toki/agent-work/iop-dev`; Darwin/arm64; `/bin/zsh`.
- Clean remote source baseline: branch `feature/openai-compatible-output-validation-filters`, HEAD `750cb1d1cb88066a10d3c703c99f1326306d8e15`.
- Live test identity: `apps/edge/internal/openai/stream_gate_vertical_slice_test.go`, SHA-256 `46261bb3a3000e00c27c419682f741c64c31c849d0aa30cbc024ed4531e7bfa6`.
- Runtime identity: `edge-toki-labs-dev`; listeners 18001/18083/18084/19093; deployed Edge executable hash equals `build/dev-runtime/bin/edge`.
- Credential source: `/Users/toki/.config/iop/secrets/dev-openai-toki.sops.yaml`, age key `/Users/toki/.config/sops/age/keys.txt`, token ref `toki-dev-pi`. Decrypt only inside the remote shell and send it through stdin-fed curl config or the foreground Go environment.
- Fresh readiness evidence:
  - `dev_openai_auth_preflight=PASS token_ref=toki-dev-pi status=200`;
  - remote package tests pass for Edge service, Edge Control Plane connector, and Control Plane command package;
  - dispatcher regression passes: `227 passed, 109 subtests passed`;
  - `edge_config_check=PASS`;
  - `edge_refresh_dry_run=PASS status=applied changes=0 error=none`;
  - live status has four connected nodes but `provider_snapshot_nodes=0 provider_snapshot_count=0`;
  - no repeat-guard harness process remains.
- Fresh artifact path for this plan: `/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-2`. It must not exist before the live process starts.

### Test Coverage Gaps

- Deterministic unit and fixture coverage is green for snapshot construction, Connector transport, HTTP view conversion, repeat evidence parsing, correlation, capacity classification, and dispatcher stop parsing.
- Unit coverage does not prove that the running Edge service currently owns the configured NodeStore snapshot; the zero-provider live response is the remaining runtime-state gap.
- After that gap is closed, the only remaining requirement is probabilistic S07 evidence from the exact full-capacity runtime.

### Symbol References

- No symbol is renamed, removed, or added.
- The recovery path is `Runtime.RefreshConfig` → `applyMutableConfig` → `Service.SetRuntimeConfig`.
- The live status path is `Service.ListNodeSnapshots` → `Connector.buildStatusResponse` → `edgeStatusResponseViewFromProto`.
- The environment-gated live entrypoint remains `TestDevRepeatGuardOrnithSmoke`.

### Split Judgment

- Keep snapshot recovery, provider gating, the single foreground invocation, correlation, result classification, and cleanup together. They must use one source/runtime identity and the status counters restored by the same runtime snapshot.
- Do not combine the already implemented dispatcher/template language correction with this S07 packet. Those uncommitted user-directed changes are pre-existing and must be preserved without being reviewed or modified here.

### Scope Rationale

- The implementing agent may modify only `CODE_REVIEW-cloud-G09.md`.
- The one authorized runtime mutation is a no-change Edge config apply after dry-run proves `changes=0`. It must not push node config, change the candidate config, restart a process, rebuild/redeploy a binary, recover a device, rotate a credential, or edit tracked config.
- Remote writes are limited to the new ignored artifact path produced by the existing harness.
- If the no-change apply does not restore provider snapshots, stop with `invocation_count=0`; do not escalate to restart, rebuild, config edit, device recovery, or a model call.

### Final Routing

- `evaluation_mode=isolated-reassessment`; finalizer `finalize-task-policy.sh`, mode `pair`.
- Build/review closures are all true. Scores `1/2/2/2/2` produce G09 with build base basis `grade-boundary`.
- Positive loop risks are `temporal_state`, `concurrent_consistency`, `boundary_contract`, and `structured_interpretation`; count 4. `large_indivisible_context=false`.
- Recovery signals are `review_rework_count=2` and `evidence_integrity_failure=false`.
- Finalizer output: build `cloud`, G09, `PLAN-cloud-G09.md`, route basis `grade-boundary`; review `cloud`, G09, `CODE_REVIEW-cloud-G09.md`, route basis `official-review`, adapter `codex`, model `gpt-5.6-sol`, reasoning effort `xhigh`.

## Implementation Checklist

- [ ] [OFR-S07-SNAPSHOT-FOREGROUND-2-1] Revalidate the clean source/auth/config/runtime baseline, perform exactly one no-change Edge config apply, and require four connected nodes plus OneXPlayer/RTX5090 provider snapshots healthy and idle at capacities `3+1`.
- [ ] [OFR-S07-SNAPSHOT-FOREGROUND-2-2] Only after the complete gate passes, start exactly one caller-owned foreground 5-concurrent × 3-run S07 invocation, validate the raw-free summary and idle cleanup, and preserve all prior artifacts.
- [ ] Fill every implementation-owned section in `CODE_REVIEW-cloud-G09.md` with actual sanitized output, exit status, invocation count, and deviations.

### [OFR-S07-SNAPSHOT-FOREGROUND-2-1] Re-seed and prove the live provider snapshot

#### Problem

The loaded config and unit tests contain valid provider records, but the live status response omits all provider snapshots. The S07 harness cannot prove configured capacity, queue pressure, or cleanup from that response.

#### Solution

- Recheck source identity, tracked cleanliness, binary identity, listeners, SOPS authentication, absent harness, preserved old artifacts, and absent plan-2 artifact.
- Run `config check` and `config refresh --mode dry-run`; require `status=applied`, `changes=0`, and no error.
- Run `config refresh --mode apply` exactly once. Require the same no-change result. This re-seeds the live runtime snapshot without pushing node config.
- Poll the status endpoint for at most 30 seconds. Require all four nodes connected and both selected providers present, healthy, idle, and configured at capacities 3 and 1.
- If the provider contract remains absent or incorrect, emit only sanitized counts/state plus `runtime_snapshot_gate=BLOCKED invocation_count=0` and stop.

#### Modified Files and Checklist

- [ ] `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/CODE_REVIEW-cloud-G09.md` — record baseline, dry-run, single apply, status-gate, and blocker/PASS evidence.
- [ ] No source, config, binary, process, provider, credential, roadmap, or prior-artifact change.

#### Test Strategy

Run fresh targeted package tests on the exact clean remote checkout. The authenticated `/v1/models` request is a metadata-only preflight and does not invoke a provider.

#### Verification

```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_test_hash=46261bb3a3000e00c27c419682f741c64c31c849d0aa30cbc024ed4531e7bfa6
test_file=apps/edge/internal/openai/stream_gate_vertical_slice_test.go
secret=/Users/toki/.config/iop/secrets/dev-openai-toki.sops.yaml
age_key=/Users/toki/.config/sops/age/keys.txt
sops_bin=/opt/homebrew/bin/sops
artifact_dir=/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-2
status_file=''
api_key=''
cleanup() {
  [[ -z "$status_file" ]] || /bin/rm -f -- "$status_file"
  unset api_key
}
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 "$(/usr/bin/shasum -a 256 "$test_file" | /usr/bin/awk '{print $1}')" = "$expected_test_hash"
git diff --check
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
! /usr/bin/pgrep -fl '[T]estDevRepeatGuardOrnithSmoke' >/dev/null

test -x "$sops_bin"
test -r "$age_key"
test -r "$secret"
test "$(/usr/bin/stat -f %Lp "$secret")" = 600
api_key=$(SOPS_AGE_KEY_FILE="$age_key" "$sops_bin" decrypt --extract '["tokens"]["toki-dev-pi"]' "$secret")
test -n "$api_key"
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

go_bin=$(command -v go)
"$go_bin" test -count=1 ./apps/edge/internal/service ./apps/edge/internal/controlplane ./apps/control-plane/cmd/control-plane
build/dev-runtime/bin/edge --config build/dev-runtime/edge.yaml config check >/dev/null
for port in 18001 18083 18084 19093; do /usr/bin/nc -z 127.0.0.1 "$port"; done
edge_pid=$(/usr/sbin/lsof -tiTCP:18083 -sTCP:LISTEN)
edge_exe=$(/usr/sbin/lsof -a -p "$edge_pid" -d txt -Fn | /usr/bin/sed -n 's/^n//p' | /usr/bin/head -1)
test "$(/usr/bin/shasum -a 256 "$edge_exe" | /usr/bin/awk '{print $1}')" = "$(/usr/bin/shasum -a 256 build/dev-runtime/bin/edge | /usr/bin/awk '{print $1}')"

dry_run=$(build/dev-runtime/bin/edge --config build/dev-runtime/edge.yaml config refresh --mode dry-run --addr 127.0.0.1:19093)
print -r -- "$dry_run" | /usr/bin/jq -e '(.status == "applied") and (((.changes // []) | length) == 0) and ((.error // "") == "")' >/dev/null
apply_result=$(build/dev-runtime/bin/edge --config build/dev-runtime/edge.yaml config refresh --mode apply --addr 127.0.0.1:19093)
print -r -- "$apply_result" | /usr/bin/jq -e '(.status == "applied") and (((.changes // []) | length) == 0) and ((.error // "") == "")' >/dev/null

ready=false
for _ in {1..15}; do
  status_file=$(/usr/bin/mktemp -t iop-repeat-status.XXXXXX)
  /usr/bin/curl -fsS http://127.0.0.1:18001/edges/edge-toki-labs-dev/status > "$status_file"
  if /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
  /bin/rm -f -- "$status_file"
  status_file=''
  sleep 2
done

if [[ "$ready" != true ]]; then
  /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"
  print -r -- 'runtime_snapshot_gate=BLOCKED invocation_count=0'
  exit 43
fi
print -r -- 'runtime_snapshot_gate=PASS nodes=4 providers=3+1_idle auth=PASS refresh_apply_count=1 invocation_count=0'
REMOTE
```

Expected: exit 0 and the sanitized PASS line. Exit 43 is the correct blocked result when snapshots are still unavailable; do not continue to the live command.

### [OFR-S07-SNAPSHOT-FOREGROUND-2-2] Run one attached S07 invocation and verify cleanup

#### Problem

S07 is still incomplete because neither prior attempt produced 15 responses, 15 correlations, three capacity rows, or a terminal sanitized result.

#### Solution

- Repeat the non-mutating source/auth/status/artifact gates immediately before launch. Do not repeat the config apply.
- Start the Go test once in the same foreground shell. Do not use `&`, `nohup`, a detached task, a background process API, or a worker session that can return while the child is alive.
- Record the exact sanitized terminal output and exit status. Any exit after process start consumes the invocation and forbids retry.
- On exit 0, validate `summary.json` without printing it, prove provider counters returned idle, prove the harness is absent, and preserve source identity.

#### Modified Files and Checklist

- [ ] `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/CODE_REVIEW-cloud-G09.md` — record one foreground invocation and sanitized summary/cleanup evidence.
- [ ] No production/test/config/runtime/provider/credential/roadmap change after the preflight apply.

#### Test Strategy

Use only `TestDevRepeatGuardOrnithSmoke` with the existing five-concurrent, three-run, two-provider contract. Synthetic summaries, degraded capacity, and retries are forbidden.

#### Verification

Foreground invocation:

```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

artifact_dir=/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-2
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)" = 750cb1d1cb88066a10d3c703c99f1326306d8e15
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"
! /usr/bin/pgrep -fl '[T]estDevRepeatGuardOrnithSmoke' >/dev/null
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'
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
```

Expected: the SSH process stays active until Go exits. The test starts once and exits 0. Any non-zero exit after `remote_live_start` is a consumed invocation and must not be retried.

Sanitized summary and cleanup:

```bash
ssh -o BatchMode=yes -o ConnectTimeout=15 toki@toki-labs.com '/bin/zsh -lc "exec /bin/zsh -s"' <<'REMOTE'
set -euo pipefail
cd /Users/toki/agent-work/iop-dev
summary=/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-2/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

/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)"
print -r -- 'remote_cleanup=PASS 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'
REMOTE
```

Expected: exit 0 and the sanitized cleanup PASS line. Do not print `summary.json`.

## Modified Files Summary

| File | Items |
|------|-------|
| `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/CODE_REVIEW-cloud-G09.md` | OFR-S07-SNAPSHOT-FOREGROUND-2-1, OFR-S07-SNAPSHOT-FOREGROUND-2-2 |

## Dependencies and Execution Order

1. Preserve every prior artifact and verify the fresh plan-2 path is absent.
2. Run the clean source/auth/tests/config dry-run baseline.
3. Perform one no-change config apply, then require live provider snapshots with healthy/idle `3+1`.
4. If that gate fails, record `invocation_count=0` and stop. Do not restart, rebuild, redeploy, edit config, recover a device, or invoke a model.
5. If the gate passes, recheck non-mutating readiness and run the S07 Go test once in the foreground.
6. Validate raw-free summary and cleanup, fill the active review, and stop for official review.
7. The official reviewer must transition to `USER_REVIEW.md` and stop if a new external authorization or user-owned recovery is required; the dispatcher must not continue polling or generate an equivalent plan after that state appears.

## Final Verification

PASS requires a clean pinned source; protected SOPS authentication HTTP 200; config check; dry-run `changes=0`; exactly one no-change apply; four connected nodes; OneXPlayer and RTX5090 provider snapshots healthy/idle at capacities `3+1`; exactly one attached foreground invocation exiting 0; 15 unique provider responses; 15 unique Edge correlations; three capacity rows with configured 4, peak in-flight 4, and queue pressure; an accepted sanitized `reproduced` or `not_reproduced` result; idle providers; absent harness; unchanged source; preserved old artifacts; and no raw secret/output in tracked files.

If snapshot recovery fails, the correct implementation result is exit 43 with `runtime_snapshot_gate=BLOCKED invocation_count=0`, followed by official review. If the live process starts and fails, the correct result is a consumed invocation with exact sanitized terminal evidence and no retry.

**After completing all work, fill implementation-owned sections in `CODE_REVIEW-cloud-G09.md`.**
