<!-- task=m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence plan=1 tag=OFR-S07-SOPS-CAPACITY-1 -->

# Run authenticated repeat-guard evidence only at full Ornith capacity

## For the Implementing Agent

Filling every implementation-owned section in `CODE_REVIEW-cloud-G08.md` is mandatory. Run the verification exactly once as authorized below, fill actual notes and raw-free output, keep the active PLAN/CODE_REVIEW files in place, and report ready for official review.

Finalization belongs only to the official code-review workflow. Do not archive files, write `complete.log`, modify roadmap state, create `USER_REVIEW.md`, ask the user, call user-input tools, or classify the next state. If any preflight fails, record the exact sanitized blocker, attempted command/output, live invocation count, and resume condition in the implementation-owned review fields and stop.

This plan authorizes at most one newly started live S07 invocation. The Go live test may start only after authentication and the original Ornith capacity contract both pass. A preflight failure consumes zero invocations. Once the live test starts, do not retry it. Never print a raw token, token hash, prompt, response, SSE body, private endpoint material, or full `summary.json`.

## Background

Plan 0 stopped safely before live execution because its runner had no approved raw credential source. The user resolved that action by rotating `user:toki` credentials and provisioning `toki-dev-pi` in a protected host-local SOPS file. The user later reported RTX5090 available again; the documented stack was brought up and its Node was relaunched through a session-independent process owner, so authentication and the full 3+1 capacity are now ready for a fresh gated attempt.

## Archive Evidence Snapshot

- `plan_cloud_G08_0.log` and `code_review_cloud_G08_0.log` record the plan-0 FAIL: `remote_preflight=BLOCKED auth_source=missing invocation_count=0`; no live S07 invocation was consumed.
- `user_review_0.log` records the resolved action: SOPS source `/Users/toki/.config/iop/secrets/dev-openai-toki.sops.yaml`, principal `user:toki`, token refs `toki-dev-pi` and `toki-dev-cline`, new-token `/v1/models` HTTP 200, superseded-token HTTP 401, and no tracked raw-token write.
- The latest sanitized runner probe reported `auth=200`; all four nodes are connected, `onexplayer-lemonade` is healthy/idle at capacity 3, and `rtx5090-lemonade` is healthy/idle at capacity 1.
- The superseded task 02 remains archived incomplete at `agent-task/archive/2026/07/m-openai-compatible-output-validation-filters/02+01_repeat_guard/` without `complete.log`. Do not reopen it or count its history as task-03 rework.

## 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/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_0.log`
- `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/code_review_cloud_G08_0.log`
- `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/user_review_0.log`

### SDD Criteria

- SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/openai-compatible-output-validation-filters/SDD.md`, approved.
- S03/S04/S09-S12 target `repeat-guard` and are covered by the existing deterministic fixtures in `stream_gate_vertical_slice_test.go`.
- S07 requires `ornith:35b`, `stream=true`, long Korean output, model-group total capacity+1 concurrency, and at least three runs. Its Evidence Map requires a repeat fingerprint/offset or `not_reproduced` plus raw-free provider/lifecycle/capacity evidence.
- The complete S07 Evidence Map row targets `ops-evidence` and also includes generic smoke and D03 logging on/off assertions. This packet owns only the Korean live-smoke evidence that the Milestone's `repeat-guard` task independently requires; it must not report `ops-evidence` complete.
- These criteria set the non-negotiable 5-concurrent × 3-run command, aggregate configured capacity 4, peak in-flight 4, queued pressure, 15 provider identities, 15 Edge correlations, and accepted sanitized result assertions below.

### Verification Context

- No separate verification-context handoff file was supplied. Repository-native sources, the resolved `user_review_0.log`, updated test rules, and fresh read-only SSH probes provide the context.
- Runner: `ssh toki@toki-labs.com`; workdir `/Users/toki/agent-work/iop-dev`; Darwin/arm64; `/bin/zsh`; Go 1.26.3.
- Source baseline: branch `feature/openai-compatible-output-validation-filters`, HEAD `d1e32b6e06f7153a4db5a5a08b7026d6dd49fcfb`, exactly modified `apps/edge/internal/openai/stream_gate_vertical_slice_test.go`, SHA-256 `8f0c767d6fb69175c6856fcd58f1398e89b9e13c6597dc950672b14b4013bd21`.
- Runtime identity: `edge-toki-labs-dev`; Edge listeners 18001/18083/18084/19093; deployed Edge executable must match `build/dev-runtime/bin/edge`.
- Authentication source: host-local SOPS file `/Users/toki/.config/iop/secrets/dev-openai-toki.sops.yaml`, age key `/Users/toki/.config/sops/age/keys.txt`, token ref `toki-dev-pi`. The raw value is decrypted only inside the remote shell, checked against the active hash mapping, and sent through stdin-fed curl configuration.
- Authentication confidence is high: the documented non-interactive preflight returned `dev_openai_auth_preflight=PASS token_ref=toki-dev-pi status=200`.
- External Verification Preflight: the RTX5090 host first returned with its IOP stack down. The documented explicit `-Action Up` brought Lemonade and Ornith online, but its SSH-session-owned Node exited after registering. A session-independent `Win32_Process.Create` launch restored the Node; the latest Edge status now reports all four nodes connected and the two selected providers healthy/idle at capacities 3+1.
- Required provider state immediately before execution is `onexplayer-lemonade` healthy/idle/capacity 3 plus `rtx5090-lemonade` healthy/idle/capacity 1, with all four nodes connected.
- No further recovery is part of implementation. If the now-restored capacity disappears before launch, emit the sanitized blocker with `invocation_count=0` and stop instead of restarting or retrying external state.
- Isolation: use the new path `/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-1`; it must not exist before the authorized invocation. Prompt, raw SSE, and response material remain only in ignored remote `/tmp` artifacts.

### Test Coverage Gaps

- No behavior or source change is planned. Existing deterministic tests cover repeat detection, observation correlation/quiescence, capacity evidence, authentication header injection, SSE validation, result classification, and raw-free summary generation.
- The remaining gap is probabilistic dev evidence from the exact full-capacity `ornith:35b` runtime. Three-slot degraded execution cannot satisfy the Milestone contract.

### Symbol References

- None. No symbol is renamed, removed, or added.
- Existing live inputs are `IOP_OPENAI_API_KEY`, `IOP_OPENAI_BASE_URL`, `IOP_OPENAI_MODEL`, and `IOP_OPENAI_SMOKE_*` in `apps/edge/internal/openai/stream_gate_vertical_slice_test.go:2438-2474,2573,2915-2917`.

### Split Judgment

- Keep authentication, capacity gating, live requests, correlation, result classification, and cleanup in one packet because all evidence must share one source/runtime identity and one invocation authorization.
- Task 03 has no runtime predecessor. Incomplete task 02 is historical context only and must not become a dependency.

### Scope Rationale

- The only workspace file the implementing agent may modify is the active review evidence file.
- Do not modify production/test source, contracts, specs, tracked config, deployed binaries/config, credentials, provider or node state, prompt contents, task-02 archives, or roadmap files.
- Remote writes are limited to the existing harness's ignored `/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-1` artifacts.
- Missing capacity is not authorization to repair RTX5090 or lower concurrency/provider assertions. A blocked preflight is implementation evidence for official review, not a reason to retry.

### Final Routing

- `evaluation_mode=isolated-reassessment`; finalizer `finalize-task-policy.sh`, mode `pair`.
- Build closures: scope/context/verification/evidence/ownership/decision all true; capability gap none. Scores `1/2/1/2/2` produce G08 with base `local-fit`.
- Positive loop risks: `temporal_state`, `concurrent_consistency`, `boundary_contract`, `structured_interpretation`; count 4. `large_indivisible_context=false`, so the risk boundary routes build to `cloud`, G08, canonical `PLAN-cloud-G08.md`.
- Recovery signals: `review_rework_count=1`, `evidence_integrity_failure=false`; recovery boundary not matched.
- Review closures all true; scores `1/2/1/2/2`; route `official-review`, `cloud`, G08, canonical `CODE_REVIEW-cloud-G08.md`; adapter `codex`, model `gpt-5.6-sol`, reasoning effort `xhigh`.

## Implementation Checklist

- [ ] [OFR-S07-SOPS-CAPACITY-1-1] Run the read-only authenticated remote preflight from the host-local SOPS token source and require the complete healthy/idle Ornith capacity `3+1`. If capacity is unavailable, record the sanitized blocker and `invocation_count=0` without recovering RTX5090.
- [ ] [OFR-S07-SOPS-CAPACITY-1-2] Only after every preflight assertion passes, start exactly one fresh 5-concurrent × 3-run live invocation, validate the sanitized S07 result and cleanup, and record only raw-free evidence.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [OFR-S07-SOPS-CAPACITY-1-1] Gate execution on authenticated full-capacity readiness

#### Problem

The credential blocker is resolved, but the latest status probe reports `rtx5090-lemonade` disconnected. The harness at `apps/edge/internal/openai/stream_gate_vertical_slice_test.go:2438-2474` requires five concurrent requests for three runs, while the Milestone requires total configured capacity+1. Starting with only OneXPlayer capacity 3 would violate the 3+1 evidence contract.

#### Solution

- Decrypt only `tokens.toki-dev-pi` from the protected host SOPS file inside the remote shell.
- Prove the token is active without printing it or its hash, then require authenticated `/v1/models` HTTP 200.
- Reprove source, tests, runtime, listeners, executable, prompt, observation, artifact, and process invariants.
- Require all four nodes connected and both selected providers healthy/idle at capacities 3 and 1.
- If capacity is absent, print only sanitized readiness plus `remote_preflight=BLOCKED reason=ornith-capacity-not-ready auth=PASS invocation_count=0`, exit 43, and stop without RTX5090 recovery.

#### Modified Files and Checklist

- [ ] `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/CODE_REVIEW-cloud-G08.md` — record sanitized preflight PASS or blocker evidence.
- [ ] No source, config, runtime, provider, credential, or roadmap changes.

#### Test Strategy

Run the existing focused and package tests with `-count=1` on the exact remote checkout. Cached output is not accepted. The `/v1/models` probe is authenticated but does not invoke a model 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
repo=/Users/toki/agent-work/iop-dev
expected_head=d1e32b6e06f7153a4db5a5a08b7026d6dd49fcfb
expected_test_hash=8f0c767d6fb69175c6856fcd58f1398e89b9e13c6597dc950672b14b4013bd21
test_file=apps/edge/internal/openai/stream_gate_vertical_slice_test.go
mapping_file=build/dev-runtime/.secrets/openai-principal-tokens.yaml
secret_file=/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-1
prompt_file=/tmp/iop-repeat-guard-live/repeat-prompt.txt
observation_file=/tmp/iop-repeat-guard-live/edge-observations.jsonl
api_key=''
api_key_hash=''
status_file=''
cleanup() {
  [[ -z "$status_file" ]] || /bin/rm -f -- "$status_file"
  unset api_key api_key_hash
}
trap cleanup EXIT
cd "$repo"

test -x "$sops_bin"
test -r "$age_key"
test -r "$secret_file"
test "$(/usr/bin/stat -f %Lp "$secret_file")" = 600
api_key=$(SOPS_AGE_KEY_FILE="$age_key" "$sops_bin" decrypt --extract '["tokens"]["toki-dev-pi"]' "$secret_file")
test -n "$api_key"
test -r "$mapping_file"
test "$(/usr/bin/stat -f %Lp "$mapping_file")" = 600
api_key_hash=$(printf '%s' "$api_key" | /usr/bin/shasum -a 256 | /usr/bin/awk '{print $1}')
/usr/bin/grep -Fq "token_hash_sha256: $api_key_hash" "$mapping_file"

http_status=$(
  {
    print 'silent'
    print 'show-error'
    print 'output = "/dev/null"'
    printf 'header = "Authorization: Bearer %s"\n' "$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)
jq_bin=$(command -v jq)
test "$(uname -s)" = Darwin
test "$(uname -m)" = arm64
test "$("$go_bin" version | /usr/bin/awk '{print $3}')" = go1.26.3
test "$("$go_bin" env GOMOD)" = "$repo/go.mod"
test "$(git branch --show-current)" = feature/openai-compatible-output-validation-filters
test "$(git rev-parse HEAD)" = "$expected_head"
test "$(git diff --name-only)" = "$test_file"
test "$(/usr/bin/shasum -a 256 "$test_file" | /usr/bin/awk '{print $1}')" = "$expected_test_hash"
git diff --check
"$go_bin" test -count=1 ./apps/edge/internal/openai -run 'TestDevRepeatGuard(SmokeEvidence|ObservationCorrelation|ObservationQuiescence|CapacityEvidence)'
"$go_bin" test -count=1 ./packages/go/streamgate ./apps/edge/internal/openai
"$go_bin" test -count=1 ./packages/go/config
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
test -s "$prompt_file"
test -f "$observation_file"
test -w "$observation_file"
test ! -e "$artifact_dir"
before=$(/usr/bin/stat -f %z "$observation_file")
sleep 2
after=$(/usr/bin/stat -f %z "$observation_file")
test "$before" = "$after"
! /usr/bin/pgrep -fl '[T]estDevRepeatGuardOrnithSmoke' >/dev/null

edge_pid=$(/usr/sbin/lsof -tiTCP:18083 -sTCP:LISTEN)
test -n "$edge_pid"
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}')"

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 ! "$jq_bin" -e '
  def provider($id): first(.nodes[].provider_snapshots[] | select(.id == $id));
  (.edge_id == "edge-toki-labs-dev") 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
  "$jq_bin" -c '{
    edge_id,
    nodes: [.nodes[] | {
      id,
      connected,
      providers: [.provider_snapshots[] |
        select(.id == "onexplayer-lemonade" or .id == "rtx5090-lemonade") |
        {id, capacity, health, in_flight, queued}]
    }]
  }' "$status_file"
  print 'remote_preflight=BLOCKED reason=ornith-capacity-not-ready auth=PASS invocation_count=0'
  exit 43
fi
print "remote_preflight=PASS head=$expected_head test_hash=$expected_test_hash edge_pid=$edge_pid providers=3+1_idle auth=PASS"
REMOTE
```

Expected: with full capacity, exit 0 and the final sanitized PASS line. With RTX5090 unavailable, exit 43 after sanitized readiness output and `invocation_count=0`; do not run the live command.

### [OFR-S07-SOPS-CAPACITY-1-2] Capture one full-capacity live invocation and cleanup

#### Problem

The Milestone remains incomplete until the harness at `apps/edge/internal/openai/stream_gate_vertical_slice_test.go:2438-2629` produces the required correlated 5×3 evidence under the original capacity contract.

#### Solution

- Re-resolve the SOPS token and recheck authentication, source identity, artifact isolation, and full provider readiness immediately before launch.
- Start the existing Go live test exactly once with `IOP_OPENAI_API_KEY`; never retry after the process starts.
- Validate the sanitized summary without printing it, then prove provider/process/source cleanup.
- Record only cardinalities, result class, capacity facts, invocation count, and sanitized PASS/blocker lines.

#### Modified Files and Checklist

- [ ] `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/CODE_REVIEW-cloud-G08.md` — record invocation count 1 and sanitized result/cleanup evidence, or the exact consumed-invocation failure.
- [ ] No production/test/config/runtime/provider/credential/roadmap change.

#### Test Strategy

Use only the existing environment-gated `TestDevRepeatGuardOrnithSmoke`. A degraded-provider run, cached output, synthetic summary, or retry is forbidden.

#### Verification

Single authorized 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
expected_head=d1e32b6e06f7153a4db5a5a08b7026d6dd49fcfb
expected_test_hash=8f0c767d6fb69175c6856fcd58f1398e89b9e13c6597dc950672b14b4013bd21
test_file=apps/edge/internal/openai/stream_gate_vertical_slice_test.go
mapping_file=build/dev-runtime/.secrets/openai-principal-tokens.yaml
secret_file=/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-1
status_file=''
api_key=''
api_key_hash=''
cleanup() {
  [[ -z "$status_file" ]] || /bin/rm -f -- "$status_file"
  unset api_key api_key_hash
}
trap cleanup EXIT

test "$(git rev-parse HEAD)" = "$expected_head"
test "$(git diff --name-only)" = "$test_file"
test "$(/usr/bin/shasum -a 256 "$test_file" | /usr/bin/awk '{print $1}')" = "$expected_test_hash"
test ! -e "$artifact_dir"
api_key=$(SOPS_AGE_KEY_FILE="$age_key" "$sops_bin" decrypt --extract '["tokens"]["toki-dev-pi"]' "$secret_file")
test -n "$api_key"
api_key_hash=$(printf '%s' "$api_key" | /usr/bin/shasum -a 256 | /usr/bin/awk '{print $1}')
/usr/bin/grep -Fq "token_hash_sha256: $api_key_hash" "$mapping_file"
http_status=$(
  {
    print 'silent'
    print 'show-error'
    print 'output = "/dev/null"'
    printf 'header = "Authorization: Bearer %s"\n' "$api_key"
  } | /usr/bin/curl --config - --write-out '%{http_code}' http://127.0.0.1:18083/v1/models
)
test "$http_status" = 200

status_file=$(/usr/bin/mktemp -t iop-repeat-live-status.XXXXXX)
/usr/bin/curl -fsS http://127.0.0.1:18001/edges/edge-toki-labs-dev/status > "$status_file"
if ! "$(command -v 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; then
  print 'remote_live_gate=BLOCKED reason=ornith-capacity-not-ready auth=PASS invocation_count=0'
  exit 43
fi
/bin/rm -f -- "$status_file"
status_file=''

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: only after the capacity gate passes, the Go process starts once and exits 0. Any failure after start consumes the 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-1/summary.json
jq_bin=$(command -v jq)
test -f "$summary"
"$jq_bin" -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

status_file=$(/usr/bin/mktemp -t iop-repeat-cleanup.XXXXXX)
trap '/bin/rm -f "$status_file"' EXIT
/usr/bin/curl -fsS http://127.0.0.1:18001/edges/edge-toki-labs-dev/status > "$status_file"
"$jq_bin" -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)" = d1e32b6e06f7153a4db5a5a08b7026d6dd49fcfb
test "$(git diff --name-only)" = apps/edge/internal/openai/stream_gate_vertical_slice_test.go
test "$(/usr/bin/shasum -a 256 apps/edge/internal/openai/stream_gate_vertical_slice_test.go | /usr/bin/awk '{print $1}')" = 8f0c767d6fb69175c6856fcd58f1398e89b9e13c6597dc950672b14b4013bd21
print '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-G08.md` | OFR-S07-SOPS-CAPACITY-1-1, OFR-S07-SOPS-CAPACITY-1-2 |

## Dependencies and Execution Order

1. Task 03 has no runtime predecessor; do not wait for or restore task 02.
2. Run the authenticated source/runtime/full-capacity preflight.
3. If any assertion fails, record invocation count 0 and stop. Do not recover RTX5090 or run the live command.
4. Only after PASS, run the repeated capacity gate and start the live Go test exactly once.
5. Validate sanitized summary/cleanup evidence and fill every implementation-owned review field.
6. Official review decides PASS or creates an `external-execution` user-review stop. It must not generate an equivalent automated follow-up while full capacity is unavailable.

## Final Verification

PASS requires: preflight exit 0; SOPS token hash active; authenticated `/v1/models` HTTP 200; all four nodes connected; selected provider capacity `3+1` healthy and idle; exactly one started live invocation exiting 0; 15 unique provider responses; 15 unique Edge correlations; three capacity rows with configured 4, peak in-flight 4, and queue pressure; accepted `reproduced` evidence or `not_reproduced`; providers idle; no harness; unchanged source/runtime identity; and no secret or raw evidence in tracked files or recorded output.

If full capacity is unavailable, the correct implementation outcome is a sanitized exit-43 blocker with `auth=PASS` and `invocation_count=0`. That cannot satisfy PASS and must be handed to official review without automatic RTX recovery.

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