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

# Repeat guard review follow-up: execute S07 on the verified dev runner

## 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 twelfth review reconfirmed the reviewed test-only delta and focused repeat-guard evidence tests, but the implementation ran in a Linux sandbox rather than the required Darwin/arm64 dev runner. The SDD S07 live lifecycle/capacity result therefore remains absent: the authorized Go test was not started and no sanitized summary exists. This follow-up changes no source; it must execute the already-reviewed harness on the actual deployed runner after all identity and isolation preconditions pass.

## Archive Evidence Snapshot

- Dependency `01_resume_notice_builder` remains satisfied by `agent-task/archive/2026/07/m-openai-compatible-output-validation-filters/01_resume_notice_builder/complete.log`.
- The current failed pair will be archived as `agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/plan_cloud_G08_12.log` and `agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/code_review_cloud_G08_12.log`.
- Required finding: `code_review_cloud_G08_12.log:233` records invocation count 0, no 15 provider responses, no 15 Edge correlations, no three accepted capacity rows, and no sanitized `reproduced`/`not_reproduced` summary.
- Trusted evidence: reviewed ref `d1e32b6e06f7153a4db5a5a08b7026d6dd49fcfb`; test-file SHA-256 `8f0c767d6fb69175c6856fcd58f1398e89b9e13c6597dc950672b14b4013bd21`; fresh `git diff --check` and focused repeat-guard evidence tests exited 0 on 2026-07-29.
- Required follow-up: use `/Users/toki/agent-work/iop-dev` on the Darwin/arm64 dev runner, resolve Go from the same login shell used for the test, prove the reviewed runtime/source/isolation state, and consume exactly one live authorization.

## 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/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/skills/common/plan/templates/review-stub-template.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/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`.
- Contracts/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`.
- Source/test evidence: current git diff and the live harness plus focused evidence tests in `apps/edge/internal/openai/stream_gate_vertical_slice_test.go`.
- Task evidence: the active plan/review pair, same-task verdict headers, and the exact predecessor `complete.log` cited above.

### SDD Criteria

- SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/openai-compatible-output-validation-filters/SDD.md`; status approved; lock released.
- `repeat-guard` maps to S03, S04, S07, and S09-S12. Deterministic S03/S04/S09-S12 evidence remains covered by the reviewed harness and fresh focused tests.
- The remaining Evidence Map row is S07: a generic OpenAI-compatible smoke plus at least three capacity+1 `ornith:35b` long-Korean streaming runs, with sanitized lifecycle/correlation/capacity evidence and repeat fingerprint/offset or `not_reproduced`.
- The checklist and final verification therefore require one 5-concurrent × 3 invocation yielding 15 globally unique provider response IDs, 15 globally unique Edge correlations, three accepted capacity rows, and a sanitized final result.

### Verification Context

- No separate `verification_context` handoff was supplied. Repository-native fallback used the approved SDD, active review evidence, local test profiles, current git state, and fresh reviewer commands.
- Fresh local evidence: Go `1.26.2` on Linux/arm64, module `/config/workspace/iop-s1/go.mod`; `git diff --check` and the four focused repeat-guard evidence test groups exited 0; reviewed test-file hash matched.
- Current-host external preflight: `/Users/toki/agent-work/iop-dev` is absent, `zsh` is absent, and loopback ports `18083` and `18001` are unreachable. This host cannot produce S07 evidence.
- External Verification Preflight: execute only on the Darwin/arm64 dev runner rooted at `/Users/toki/agent-work/iop-dev`. Require HEAD `d1e32b6e06f7153a4db5a5a08b7026d6dd49fcfb`, the reviewed test-file-only source delta and hash, login-shell Go `1.26.3` with matching `GOMOD`, deployed Edge/Node binary/process/listener identities for the reviewed ref, OpenAI/status listeners `18083`/`18001`, active blocking `repeat_guard` for `ornith:35b`, healthy idle selected providers with capacities 3 and 1, a bounded non-empty prompt, an empty new artifact path, a writable raw-free observation sink, zero competing harnesses, and an unchanged observation identity/size through the quiet window.
- Any mismatch stops before the Go test process starts. No rebuild, config mutation, alternate host, stand-in provider pool, or retry of a started live test is authorized.
- Confidence is high that the remaining gap is environment placement, not source logic.

### Test Coverage Gaps

- Local deterministic evidence coverage is complete for the reviewed follow-up and fresh focused tests pass.
- S07 external integrated coverage is missing because invocation count is 0. No unit-test or source change can substitute for the deployed lifecycle/capacity result.

### Symbol References

- None; this follow-up renames or removes no symbol.

### Split Judgment

- Keep one verification-only packet. Provider response identity, Edge correlation, capacity pressure/recovery, and sanitized final outcome must come from the same isolated live invocation.
- Dependency `+01` is satisfied by the cited archived predecessor `complete.log`.

### Scope Rationale

- Modify only the active review evidence artifact.
- Exclude production code, tests, contracts, specs, tracked config, deployed binaries/config, provider selection, thresholds, and queue behavior because the reviewed harness already exists and the sole missing acceptance condition is external execution evidence.
- Keep raw prompt, SSE, output, credentials, tokens, and private endpoint material outside tracked artifacts and stdout.

### 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 `1/2/1/2/2`; base basis `local-fit`; final basis `recovery-boundary`; lane `cloud`; grade `G08`; canonical file `PLAN-cloud-G08.md`.
- Review closures: scope/context/verification/evidence/ownership/decision closed. Grade scores `1/2/1/2/2`; route `official-review`; lane `cloud`; grade `G08`; canonical file `CODE_REVIEW-cloud-G08.md`; adapter `codex`; model `gpt-5.6-sol`; reasoning effort `xhigh`.
- `large_indivisible_context=false`.
- Positive loop risks: `temporal_state`, `concurrent_consistency`, `boundary_contract`, `structured_interpretation`, `variant_product`; count `5`.
- Recovery signals: `review_rework_count=12`, `evidence_integrity_failure=false`; recovery boundary matched.
- Capability gap: none; the actual runner can execute the existing deterministic live oracle.

## Implementation Checklist

- [ ] [REVIEW_OFR-REPEAT-12-1] On the verified Darwin/arm64 dev runner, prove the exact login-shell Go/source/runtime/isolation preconditions and execute exactly one fresh `ornith:35b` 5-concurrent × 3 live invocation that yields 15 provider responses, 15 Edge correlations, three accepted capacity rows, and a sanitized final result.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REVIEW_OFR-REPEAT-12-1] Complete the missing S07 live result

#### Problem

`agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/code_review_cloud_G08_12.log:233` records that the live command was not executed. SDD S07 therefore has no deployed evidence for provider response identity, Edge correlation, capacity pressure/recovery, or sanitized `reproduced`/`not_reproduced` outcome.

Before:

```text
NOT EXECUTED — invocation count 0.
```

After:

```text
PASS — invocation count 1; provider_responses=15; edge_correlations=15; capacity_runs=3; result=reproduced|not_reproduced.
```

#### Solution

- Run only on `/Users/toki/agent-work/iop-dev` on Darwin/arm64.
- Resolve an executable Go path in `zsh -lic` and invoke that exact path from the same login shell.
- Re-prove source/ref, deployed runtime, listener, gate, provider, prompt, artifact, observation, and competing-harness preconditions before launch.
- Use a new empty artifact directory `/tmp/iop-repeat-guard-live/repeat-guard-G08-13`.
- Launch `TestDevRepeatGuardOrnithSmoke` exactly once. A preflight failure consumes no authorization; any started invocation consumes the sole authorization and must not be retried.
- Require `summary.json` to contain three runs, 15 globally unique provider response IDs, 15 globally unique Edge correlations, three accepted `configured=4`, `peak_in_flight=4`, `peak_queued>=1`, `final_in_flight=0`, `final_queued=0` rows, and sanitized `reproduced` with fingerprint/offset or `not_reproduced`.
- Prove both providers return idle, no harness remains, reviewed source/runtime identity is unchanged, and no raw or secret-bearing material enters tracked evidence or stdout.

#### Modified Files and Checklist

- [ ] `agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/CODE_REVIEW-cloud-G08.md` — record the exact preflights, invocation count, sanitized live result, summary cardinality, and cleanup evidence.
- [ ] No source, test, production, contract, spec, tracked config, or deployed runtime change.

#### Test Strategy

- Do not add tests or modify source. The existing live harness is the required integrated oracle.
- Re-run the focused local evidence groups and `git diff --check` to preserve reviewed integrity.
- Run the environment-gated live test once only after every external precondition passes.

#### Verification

```bash
git diff --check
sha256sum apps/edge/internal/openai/stream_gate_vertical_slice_test.go
go test -count=1 ./apps/edge/internal/openai -run 'TestDevRepeatGuard(SmokeEvidence|ObservationCorrelation|ObservationQuiescence|CapacityEvidence)'
```

Expected: all commands exit 0 and the SHA-256 is `8f0c767d6fb69175c6856fcd58f1398e89b9e13c6597dc950672b14b4013bd21`.

On the external runner, execute the login-shell source preflight before starting the test:

```bash
zsh -lic '
set -eu
test "$(uname -s)" = "Darwin"
test "$(uname -m)" = "arm64"
cd /Users/toki/agent-work/iop-dev
go_bin="$(command -v go)"
test -n "$go_bin"
test -x "$go_bin"
"$go_bin" version
"$go_bin" env GOMOD
git rev-parse HEAD
git status --short
shasum -a 256 apps/edge/internal/openai/stream_gate_vertical_slice_test.go
'
```

Expected: Go `1.26.3`, GOMOD `/Users/toki/agent-work/iop-dev/go.mod`, HEAD `d1e32b6e06f7153a4db5a5a08b7026d6dd49fcfb`, only the reviewed test-file source delta, and the reviewed SHA-256.

After recording all deployed runtime/isolation preconditions, launch exactly once:

```bash
zsh -lic '
set -eu
cd /Users/toki/agent-work/iop-dev
go_bin="$(command -v go)"
test -n "$go_bin"
test -x "$go_bin"
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-G08-13 \
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_bin" test -timeout 90m -count=1 -v ./apps/edge/internal/openai -run "^TestDevRepeatGuardOrnithSmoke$"
'
```

Expected: invocation count 1, exit 0, 15 unique provider response IDs, 15 unique Edge correlations, three accepted capacity rows, sanitized `reproduced` with fingerprint/offset or `not_reproduced`, post-run providers idle, no harness process, and no tracked raw evidence.

## Modified Files Summary

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

## Dependencies and Execution Order

1. Dependency `01_resume_notice_builder` is satisfied by the cited predecessor `complete.log`.
2. Run local integrity verification.
3. Execute the login-shell Go/source preflight on the actual dev runner.
4. Re-prove deployed runtime and isolation preconditions.
5. Launch the live test exactly once, validate the sanitized summary, prove cleanup, and fill the active review evidence.

## Final Verification

```bash
git diff --check
sha256sum apps/edge/internal/openai/stream_gate_vertical_slice_test.go
go test -count=1 ./apps/edge/internal/openai -run 'TestDevRepeatGuard(SmokeEvidence|ObservationCorrelation|ObservationQuiescence|CapacityEvidence)'
```

Then execute the exact external login-shell preflight and single live command from `REVIEW_OFR-REPEAT-12-1`. PASS requires exit 0, 15 unique provider response IDs, 15 unique Edge correlations, three accepted capacity rows, sanitized `reproduced` with fingerprint/offset or `not_reproduced`, unchanged reviewed runtime/source identity, post-run idle state, and no tracked raw evidence.

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