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

# Repeat guard review follow-up: obtain required Darwin S07 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, invocation count, 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 thirty-third review reconfirmed the reviewed live-oracle hash and every local repeat-guard check. The required Darwin/arm64 source preflight still failed before launch because the current Linux/arm64 checkout has no `zsh`, so SDD S07 still lacks deployed-provider lifecycle, capacity, result, and cleanup evidence. Production source, tests, contracts, specs, tracked configuration, and deployed runtime must remain unchanged.

## Archive Evidence Snapshot

- Dependency `01_resume_notice_builder` is satisfied by `agent-task/archive/2026/07/m-openai-compatible-output-validation-filters/01_resume_notice_builder/complete.log`.
- The failed pair is archived as `agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/plan_cloud_G08_33.log` and `agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/code_review_cloud_G08_33.log`.
- Verdict: FAIL; Required=1, Suggested=0, Nit=0.
- Required finding: `code_review_cloud_G08_33.log:212` records invocation count 0, and line 220 confirms that no `summary.json`, provider-response record, Edge-correlation record, capacity row, final live result, or cleanup evidence exists.
- Fresh reviewer evidence on 2026-07-30: `git diff --check` exited 0; SHA-256 was `8f0c767d6fb69175c6856fcd58f1398e89b9e13c6597dc950672b14b4013bd21`; focused repeat-guard tests exited 0 in 0.330s; `go test -count=1 ./packages/go/streamgate ./apps/edge/internal/openai` exited 0 in 0.919s and 7.336s; config coverage exited 0 in 0.121s.
- Fresh reviewer exact preflight: `command -v zsh` exited 1 and `zsh -lic ...` exited 127 with `/bin/bash: line 1: zsh: command not found`; the live Go test was not launched and the sole authorization was not consumed.
- Follow-up: execute the existing live oracle exactly once on `/Users/toki/agent-work/iop-dev` after every source, runtime, capacity, and isolation precondition passes, or record exact attempted preflight output and the resume condition if still blocked.

## 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: `AGENTS.md`, `agent-ops/rules/project/rules.md`, `agent-ops/rules/common/rules-roadmap.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`.
- Domain and verification: `agent-ops/rules/project/domain/edge/rules.md`, `agent-ops/rules/project/domain/platform-common/rules.md`, `agent-ops/rules/project/domain/testing/rules.md`, `agent-test/local/rules.md`, `agent-test/local/edge-smoke.md`, `agent-test/local/platform-common-smoke.md`, `agent-test/local/testing-smoke.md`.
- Roadmap and design: `agent-roadmap/current.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`.
- Current implementation map and contracts: `agent-ops/rules/common/rules-agent-spec.md`, `agent-spec/index.md`, `agent-spec/runtime/stream-evidence-gate.md`, `agent-spec/input/openai-compatible-surface.md`, `agent-contract/index.md`, `agent-contract/outer/openai-compatible-api.md`, `agent-contract/inner/edge-config-runtime-refresh.md`.
- Active and predecessor evidence: `agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/PLAN-cloud-G08.md`, `agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/CODE_REVIEW-cloud-G08.md`, `agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/code_review_cloud_G08_32.log`, `agent-task/archive/2026/07/m-openai-compatible-output-validation-filters/01_resume_notice_builder/complete.log`.
- Reviewed live-oracle entry, diff, and focused test sections: `apps/edge/internal/openai/stream_gate_vertical_slice_test.go`.

### SDD Criteria

- SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/openai-compatible-output-validation-filters/SDD.md`; status approved; lock released; no active SDD `USER_REVIEW.md`.
- `repeat-guard` maps to S03, S04, and S09-S12. Its completion evidence also requires the S07 capacity+1 `ornith:35b` live observation.
- S07 requires three 5-concurrent runs with sanitized provider identity, Edge lifecycle, accepted capacity, and repeat fingerprint/offset or `not_reproduced` evidence.
- Deterministic S03/S04/S09-S12 evidence is green. This follow-up is limited to the missing S07 Evidence Map row and post-run cleanup proof.

### Verification Context

- No separate `verification_context` handoff was supplied. Repository-native fallback used the approved SDD, active task artifacts, local test profiles, current checkout, the existing live oracle, and fresh reviewer commands.
- Current checkout: branch `feature/openai-compatible-output-validation-filters`; Go 1.26.2 on Linux/arm64; GOMOD `/config/workspace/iop-s1/go.mod`; HEAD `d1e32b6e06f7153a4db5a5a08b7026d6dd49fcfb`; the active task artifacts and reviewed live-oracle test delta are dirty.
- Fresh local evidence: `git diff --check`, reviewed SHA-256, focused repeat-guard tests, Stream Gate/OpenAI package tests, and config tests all exited 0 with fresh `-count=1` execution where applicable.
- External Verification Preflight: run only on Darwin/arm64 at `/Users/toki/agent-work/iop-dev`. Require `zsh` login-shell Go 1.26.3, GOMOD `/Users/toki/agent-work/iop-dev/go.mod`, matching branch/HEAD and only the reviewed test-file delta/hash, reviewed Edge/Node binary identities and process command lines, config/runtime identities, listeners `18083` and `18001`, active blocking `repeat_guard`, healthy idle selected providers with aggregate capacity 4, a bounded non-empty prompt file, a new empty `/tmp/iop-repeat-guard-live/repeat-guard-review-34` artifact path, a writable raw-free observation sink, zero competing harnesses, and a stable observation file through the quiet window. Target source sync, binaries, config, processes, ports, and provider state remain unverified from this host.
- Current-host blocker: `command -v zsh` returns no path and exits 1; the exact login-shell/source preflight exits 127. This host cannot prove or substitute for the target runner, checkout, deployed runtime, listeners, provider state, or observation sink.
- A failed preflight consumes no authorization. Once the Go live test process starts, the sole authorization is consumed and the command must not be retried.
- Confidence: high for local integrity and the required evidence shape; external runtime state remains unverified until the Darwin preflight runs.

### Test Coverage Gaps

- Deterministic local S03/S04/S09-S12 evidence remains covered by focused and package tests.
- S07 integrated coverage is absent because no live invocation evidence was produced. No source change or unit test substitutes for this result.

### Symbol References

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

### Split Judgment

- Keep one packet. Provider response identity, Edge lifecycle, capacity pressure/recovery, final result, and cleanup must come from the same isolated invocation.
- Dependency `+01` is satisfied by `agent-task/archive/2026/07/m-openai-compatible-output-validation-filters/01_resume_notice_builder/complete.log`.

### Scope Rationale

- Modify only the active review evidence artifact.
- Exclude production source, tests, contracts, specs, tracked configuration, deployed binaries/configuration, provider selection, queue behavior, and filter thresholds because the existing harness is the required oracle.
- 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`; basis `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=33`, `evidence_integrity_failure=true`; recovery boundary matched.
- Capability gap: none; the specified Darwin runner can execute the existing oracle when accessible.

## Implementation Checklist

- [ ] [REVIEW_OFR-REPEAT-33-1] On the verified Darwin/arm64 dev runner, execute exactly one fresh `ornith:35b` 5-concurrent × 3 live invocation after every precondition passes, then record 15 provider responses, 15 Edge correlations, three accepted capacity rows, the sanitized final result, and cleanup evidence; if preflight blocks execution, record exact attempted output, invocation count 0, and the resume condition.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REVIEW_OFR-REPEAT-33-1] Produce the missing S07 live evidence

#### Problem

`agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/code_review_cloud_G08_33.log:212` records invocation count 0, and line 220 confirms that no `summary.json`, provider-response record, Edge-correlation record, capacity row, final live result, or cleanup evidence exists. Fresh reviewer execution reconfirmed the reviewed hash and local tests, but the required Darwin/arm64 source preflight still exited 127 because `zsh` is unavailable on this host.

Before:

```text
NOT STARTED — invocation count 0; no summary.json or live lifecycle/capacity evidence.
```

After:

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

#### Solution

- Run only on the Darwin/arm64 runner rooted at `/Users/toki/agent-work/iop-dev`.
- Resolve Go and invoke the test from the same `zsh -lic` login shell.
- Prove source, deployed runtime, listeners, blocking gate, provider health/capacity, prompt, artifact containment, observation quiescence, and zero competing harnesses before launch.
- Use a new empty artifact directory `/tmp/iop-repeat-guard-live/repeat-guard-review-34`.
- Start `TestDevRepeatGuardOrnithSmoke` exactly once. Do not retry a started invocation.
- Validate `summary.json` and prove both providers idle, no harness process remains, identities are unchanged, and no raw/secret-bearing evidence entered the repository or stdout.
- If preflight blocks execution, record the exact attempted command/output, invocation count 0, blocker, and resume condition.

#### Modified Files and Checklist

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

#### Test Strategy

- Do not add or modify tests. The existing environment-gated live harness is the S07 integrated oracle.
- Re-run focused deterministic evidence groups, the local package baseline, and `git diff --check` before the external launch.

#### 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)'
go test -count=1 ./packages/go/streamgate ./apps/edge/internal/openai
go test -count=1 ./packages/go/config
```

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

External login-shell/source preflight:

```bash
command -v zsh
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 branch --show-current
git rev-parse HEAD
git status --short
shasum -a 256 apps/edge/internal/openai/stream_gate_vertical_slice_test.go
'
```

Expected: `zsh` resolves; Go 1.26.3; GOMOD `/Users/toki/agent-work/iop-dev/go.mod`; branch `feature/openai-compatible-output-validation-filters`; reviewed HEAD; only the reviewed test-file delta; reviewed hash. Record sanitized deployed Edge/Node identity, listeners, active filter policy, selected provider status/capacity, prompt/artifact/observation containment, quiet-window result, and zero competing harnesses before launch.

After every runtime and isolation check passes, 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-review-34 \
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 globally unique provider response IDs, 15 globally unique Edge correlations, three accepted capacity rows, and sanitized `reproduced` with fingerprint/offset or `not_reproduced`.

## 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-33-1 evidence |

## Dependencies and Execution Order

1. Dependency `01_resume_notice_builder` is satisfied by `agent-task/archive/2026/07/m-openai-compatible-output-validation-filters/01_resume_notice_builder/complete.log`.
2. Run local integrity verification.
3. Run external login-shell and deployed-runtime/isolation preflights on the actual Darwin runner.
4. Launch the live test exactly once, validate the sanitized summary, and record cleanup evidence.

## Final Verification

Run the local integrity commands and exact external preflight/live commands above. PASS requires one started invocation that exits 0, 15 unique provider response IDs, 15 unique Edge correlations, three accepted capacity rows, a sanitized final result, unchanged source/runtime identity, idle providers, no harness process, and no tracked raw evidence. Fresh execution is required; Go test cache output is not acceptable.

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