<!-- task=m-openai-compatible-output-validation-filters/02+01_repeat_guard plan=9 tag=REVIEW_OFR-REPEAT-8 -->

# Repeat guard review follow-up: restore the live gate and complete same-ref evidence

## For the Implementing Agent

Filling the implementation-owned sections in `CODE_REVIEW-*-G??.md` is mandatory. Run every verification command, paste actual notes and stdout/stderr into the active review file, keep the active PLAN/CODE_REVIEW files in place, and report ready for review; only the code-review skill may finalize or archive the task. If blocked, record only the exact blocker, attempted commands/output, and resume conditions in implementation-owned evidence fields. Do not ask the user, call user-input tools, create control-plane stop files, classify the next state, archive logs, or write `complete.log`.

## Background

The eighth review confirmed that the exact source ref `d1e32b6e06f7153a4db5a5a08b7026d6dd49fcfb` is represented by the available deployment artifacts and that focused race-enabled regressions pass. The mandatory live run remains blocked because `rtx5090-lemonade` is offline, leaving selected aggregate capacity at 3 instead of 4, and the deployed Edge configuration has no enabled `openai.stream_evidence_gate`, so it emits no filter observations. The only remaining acceptance gap is the clean same-ref `ornith:35b` 5-concurrent × 3 lifecycle and capacity evidence.

## Archive Evidence Snapshot

- Predecessor dependency: `agent-task/archive/2026/07/m-openai-compatible-output-validation-filters/01_resume_notice_builder/complete.log` records PASS and satisfies subtask `+01`.
- Prior review loops: `plan_cloud_G10_0.log` through `plan_cloud_G10_7.log` and their matching review logs remain the bounded same-task history; `code_review_cloud_G10_7.log` records the immediately preceding FAIL.
- Current failed pair after archival: `plan_cloud_G10_8.log` and `code_review_cloud_G10_8.log`; the Required finding is the missing SDD S07 live evidence.
- Fresh reviewer evidence: `git diff --check` and the focused Core and Edge race-enabled tests pass. The live command is correctly recorded as `NOT RUN`; selected healthy capacity is 3, RTX5090 SSH times out, the deployed gate is absent, and filter observation count is zero.
- Required follow-up: restore the exact same-ref RTX5090 runtime, enable and observe the repeat-guard gate on Edge, prove aggregate capacity 4, and then record 15 unique SSE-derived correlations plus three accepted `4/4/>=1/0/0` capacity rows.

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

- Workflow and rules: `agent-ops/rules/project/rules.md`, `agent-ops/rules/common/rules-roadmap.md`, `agent-ops/rules/common/rules-agent-spec.md`, `agent-ops/skills/common/router.md`, `agent-ops/skills/common/code-review/SKILL.md`, `agent-ops/skills/common/plan/SKILL.md`, `agent-ops/skills/common/finalize-task-routing/SKILL.md`, `agent-ops/rules/project/domain/edge/rules.md`, `agent-ops/rules/project/domain/platform-common/rules.md`, and `agent-ops/rules/project/domain/testing/rules.md`.
- Verification profiles: `agent-test/local/rules.md`, `agent-test/local/edge-smoke.md`, `agent-test/local/platform-common-smoke.md`, and `agent-test/local/testing-smoke.md`.
- Roadmap and design: `agent-roadmap/current.md`, `agent-roadmap/phase/knowledge-tool-optimization-extension/PHASE.md`, `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/openai-compatible-output-validation-filters.md`, and `agent-roadmap/sdd/knowledge-tool-optimization-extension/openai-compatible-output-validation-filters/SDD.md`.
- Current contracts and specs: `agent-contract/index.md`, `agent-contract/outer/openai-compatible-api.md`, `agent-contract/inner/edge-config-runtime-refresh.md`, `agent-spec/index.md`, `agent-spec/runtime/stream-evidence-gate.md`, `agent-spec/runtime/provider-pool-config-refresh.md`, and `agent-spec/input/openai-compatible-surface.md`.
- Focused harness and runtime evidence: `apps/edge/internal/openai/stream_gate_vertical_slice_test.go` and `packages/go/streamgate/runtime_test.go`.
- Task evidence: the active plan/review pair, `code_review_cloud_G10_7.log`, and the exact predecessor completion log cited above.

### SDD Criteria

- SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/openai-compatible-output-validation-filters/SDD.md`; status `[승인됨]`; SDD lock released.
- Repeat-guard scenarios S03, S04, and S09-S12 have deterministic fixture evidence. The Milestone task additionally requires the dev `ornith:35b` capacity+1 stream smoke.
- S07 and its Evidence Map require a minimum three-run live smoke with sanitized lifecycle and capacity evidence. This plan produces that repeat-guard acceptance evidence only; it does not claim completion of the separate `ops-evidence` task.
- PASS requires the existing deterministic repeat-guard evidence plus one clean same-ref live result containing exactly 15 request correlations and three accepted capacity rows.

### Verification Context

- No separate `verification_context` handoff was supplied. Repository rules, the approved SDD, current task evidence, and fresh reviewer commands provide the fallback context.
- Fresh local reviewer evidence on 2026-07-29: Go `1.26.2`, module `/config/workspace/iop-s1/go.mod`; `git diff --check`, the focused Core race test, and the focused Edge correlation/capacity race tests exited 0.
- External runner/workdir: `/Users/toki/agent-work/iop-dev` on macOS/arm64. Required endpoints are OpenAI `127.0.0.1:18083`, Node transport `18084`, admin `19093`, and status `127.0.0.1:18001/edges/edge-toki-labs-dev/status`.
- Source and artifact identity: reviewed source, clean runner source, and the available Edge/macOS/GX10/OneXPlayer artifacts identify `d1e32b6e06f7153a4db5a5a08b7026d6dd49fcfb`. RTX5090 has an exact-ref artifact record but its SSH and runtime identity cannot be revalidated while the host is unreachable.
- Required providers: `onexplayer-lemonade` capacity 3 and `rtx5090-lemonade` capacity 1. Current selected healthy aggregate capacity is 3 because RTX5090 is offline; acceptance requires 4.
- Required gate: the private deployed Edge configuration must enable `openai.stream_evidence_gate`, enable the blocking repeat-guard filter for this dev route/model, and write sanitized observations to `/tmp/iop-repeat-guard-live/edge-observations.jsonl`. The current deployed configuration lacks the gate and emits zero observations.
- Resume sequence: restore RTX5090 SSH/service, deploy and restart its exact same-ref Windows artifact, provision the intended private Edge gate and observation sink through the authorized workflow, restart Edge, prove both providers healthy with aggregate capacity 4, prove live repeat-guard observations appear, and only then invoke the fixed live command exactly once.
- Worker-owned prompt and artifact paths may be provisioned under `/tmp/iop-repeat-guard-live/` on the authorized runner. Raw prompt, SSE, output, credentials, and tokens must remain outside this workspace; tracked evidence and stdout contain sanitized identities, correlations, decisions, fingerprints/offsets, status, and capacity counters only.
- Confidence is high for local correctness and the exact blocker. No live PASS claim is possible until all preconditions above are evidenced.

### Test Coverage Gaps

- Fatal terminal observation fidelity is covered by `TestRequestRuntimeTerminalFailureFidelity/fatal_filter_overrides_success_terminal`; fresh race PASS.
- Repeat correlation and capacity parsing are covered by `TestDevRepeatGuardObservationCorrelation` and `TestDevRepeatGuardCapacityEvidence`; fresh race PASS.
- Clean same-ref external lifecycle and capacity behavior remains unverified. The 15-request, three-row live run is the only coverage gap.

### Symbol References

- None. This follow-up renames or removes no symbol and plans no production code change.

### Split Judgment

- Keep one verification-only follow-up. Runtime identity, gate activation, request correlation, and capacity recovery form one acceptance proof and cannot independently PASS.
- Dependency `+01` is satisfied by `agent-task/archive/2026/07/m-openai-compatible-output-validation-filters/01_resume_notice_builder/complete.log`.

### Scope Rationale

- Do not modify production code, tests, contracts, specs, tracked configuration, repeat policy, provider selection, queue semantics, or correlation logic.
- The authorized workflow may update the private deployed Edge configuration and restart the scoped dev runtimes because those are explicit preconditions of this live verification.
- Do not create a new code commit or publish a different source ref. Every participating runtime must use the already reviewed ref `d1e32b6e06f7153a4db5a5a08b7026d6dd49fcfb`.
- Raw smoke artifacts may be used only for local failure diagnosis in the worker-owned `/tmp/iop-repeat-guard-live/` directory; tracked evidence remains sanitized.

### Final Routing

- `evaluation_mode=isolated-reassessment`; `finalizer=finalize-task-policy.sh`; `finalizer_mode=pair`.
- Build closures: scope/context/verification/evidence/ownership/decision closed; grade scores `2/2/2/2/2`; base and final route basis `grade-boundary`; lane `cloud`; grade `G10`; canonical file `PLAN-cloud-G10.md`.
- Review closures: scope/context/verification/evidence/ownership/decision closed; grade scores `2/2/2/2/2`; route `official-review`; lane `cloud`; grade `G10`; adapter `codex`; model `gpt-5.6-sol`; reasoning effort `xhigh`; canonical file `CODE_REVIEW-cloud-G10.md`.
- `large_indivisible_context=false`.
- Positive loop risks: `temporal_state`, `concurrent_consistency`, `boundary_contract`, `structured_interpretation`, and `variant_product`; count `5`.
- Recovery signals: `review_rework_count=8`, `evidence_integrity_failure=false`; risk and recovery boundaries matched without replacing the grade-boundary basis.
- Capability gap: none; the remaining blocker is the scoped external runtime state, not model capability.

## Implementation Checklist

- [ ] [REVIEW_OFR-REPEAT-8-1] Restore the exact same-ref RTX5090 runtime and the enabled Edge repeat-guard gate, then produce the clean `ornith:35b` 5-concurrent × 3 lifecycle and capacity evidence.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REVIEW_OFR-REPEAT-8-1] Restore the live gate and complete same-ref lifecycle evidence

#### Problem

`code_review_cloud_G10_8.log:56` records the live item as incomplete, and `code_review_cloud_G10_8.log:279` records `Status: NOT RUN`. The Milestone at `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/openai-compatible-output-validation-filters.md:78` requires the integrated dev capacity+1 smoke. Local fixtures pass but cannot replace SDD S07 live evidence while selected capacity is 3 and the deployed gate is absent.

#### Solution

- Restore RTX5090 connectivity and its `rtx5090-lemonade` service, deploy/restart the exact-ref Windows artifact, and record its checksum/version, process start time, listener, provider identity, and healthy capacity 1.
- Provision the private Edge runtime configuration with `openai.stream_evidence_gate.enabled=true`, the intended blocking repeat-guard route/model scope, and the fixed observation sink; restart Edge from the exact reviewed ref.
- Before the live run, prove clean source identity, every participating binary/runtime identity, required listeners, both provider identities, selected aggregate capacity 4, and at least one sanitized live repeat-guard observation.
- Provision a non-empty untracked prompt and worker-owned raw artifact directory at the fixed `/tmp/iop-repeat-guard-live/` paths. Do not write raw evidence under this workspace.
- Run the existing `TestDevRepeatGuardOrnithSmoke` command exactly once with concurrency 5 and runs 3.
- Require 15 unique SSE-derived correlations and exactly three accepted capacity rows with `configured=4`, `peak_in_flight=4`, `peak_queued>=1`, `final_in_flight=0`, and `final_queued=0`.
- Record only sanitized evidence in the active review. If any precondition remains unavailable, leave the item unchecked and record the exact blocker, attempted preflight, and resume condition without invoking the live command.

#### Modified Files and Checklist

- [ ] `agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/CODE_REVIEW-cloud-G10.md` — exact sanitized preflight, command result, 15 correlations, and three capacity rows, or exact blocker evidence.
- [ ] No production, test, contract, spec, tracked config, or tracked raw-evidence file changes.

#### Test Strategy

- No new test is planned. Permanent terminal-fidelity, correlation, and capacity fixtures already pass; this item exercises the existing live harness against the exact same-ref dev deployment.
- A harness or production correction is outside this verification-only scope and requires a recorded plan deviation plus fresh regression evidence before any live retry.

#### Verification

```bash
go version && go env GOMOD
git diff --check
go test -race -count=1 ./packages/go/streamgate -run '^TestRequestRuntimeTerminalFailureFidelity/fatal_filter_overrides_success_terminal$'
go test -race -count=1 ./apps/edge/internal/openai -run 'Test(DevRepeatGuardObservationCorrelation|DevRepeatGuardCapacityEvidence)'
```

Expected: all commands exit 0; focused evidence is fresh and uncached.

After the authorized runtime restoration, gate activation, restart, and identity proof:

```bash
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=/tmp/iop-repeat-guard-live/repeat-guard \
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 \
go test -count=1 -v ./apps/edge/internal/openai -run '^TestDevRepeatGuardOrnithSmoke$'
```

Expected: exit 0; exactly 15 unique sanitized request correlations and three accepted capacity rows satisfying `4/4/>=1/0/0`, with no raw prompt, output, credential, or token in tracked files or stdout.

## Modified Files Summary

| File | Items |
|------|-------|
| `agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/CODE_REVIEW-cloud-G10.md` | REVIEW_OFR-REPEAT-8-1 sanitized evidence |

## Dependencies and Execution Order

1. Dependency `01_resume_notice_builder` is satisfied by the cited predecessor `complete.log`.
2. Restore the exact-ref RTX5090 runtime, configure/restart the scoped Edge gate, and provision worker-owned prompt/observation paths.
3. Prove same-ref identities, both healthy providers, aggregate capacity 4, and active sanitized gate observations.
4. Run the fresh local checks, then invoke the live command exactly once.
5. Record sanitized results and fill every implementation-owned review section.

## Final Verification

```bash
go version && go env GOMOD
git diff --check
go test -race -count=1 ./packages/go/streamgate -run '^TestRequestRuntimeTerminalFailureFidelity/fatal_filter_overrides_success_terminal$'
go test -race -count=1 ./apps/edge/internal/openai -run 'Test(DevRepeatGuardObservationCorrelation|DevRepeatGuardCapacityEvidence)'
```

Before the live command, prove one clean authorized reviewed ref, exact-ref binaries and running processes for Edge and both providers, aggregate selected capacity 4, the enabled blocking repeat-guard gate, and an active sanitized observation sink. Keep raw artifacts outside this workspace. Then run the `REVIEW_OFR-REPEAT-8-1` live command exactly once and require 15 unique correlations plus three `4/4/>=1/0/0` capacity rows. Cached output is not acceptable for focused commands.

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