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

# Repeat guard review follow-up: clean same-ref live lifecycle 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 fifth review reconfirmed that the local guard regressions pass and that the recorded external blocker is accurate. The reviewed tree still has no clean remotely addressable ref, the dev runner is on a different clean ref, one selected provider remains offline, and the fixed worker-owned prompt and observation inputs are absent. The remaining acceptance gap is unchanged: no clean same-ref `ornith:35b` 5-concurrent × 3 lifecycle and capacity evidence exists.

## 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`.
- Earlier failed loops: `plan_cloud_G10_0.log` / `code_review_cloud_G10_0.log`, `plan_cloud_G10_1.log` / `code_review_cloud_G10_1.log`, `plan_cloud_G10_2.log` / `code_review_cloud_G10_2.log`, and `plan_cloud_G10_3.log` / `code_review_cloud_G10_3.log`.
- Plan-contract correction: `plan_cloud_G10_4.log` and `code_review_cloud_G10_4.log`.
- Immediate prior pair: `plan_cloud_G10_5.log` and `code_review_cloud_G10_5.log`; verdict FAIL.
- Fresh reviewer evidence: local focused race checks pass, while the reviewed tree and dev runner still use different refs, selected capacity is 3 rather than 4, and the fixed prompt/observation inputs are absent.
- Required follow-up: publish the exact reviewed work through an authorized clean-ref workflow, rebuild/redeploy/restart every participating runtime from that ref, restore both selected providers, provision worker-owned inputs, and 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`.
- Contract/spec routing: `agent-contract/index.md` and `agent-spec/index.md`; no contract, spec, production, or test change is planned by this verification-only follow-up.
- Task evidence: active `PLAN-cloud-G10.md` / `CODE_REVIEW-cloud-G10.md`, `code_review_cloud_G10_3.log`, `code_review_cloud_G10_4.log`, and the exact predecessor `agent-task/archive/2026/07/m-openai-compatible-output-validation-filters/01_resume_notice_builder/complete.log`.

### SDD Criteria

- SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/openai-compatible-output-validation-filters/SDD.md`; status `[승인됨]`; SDD lock released.
- Targeted `repeat-guard` scenarios S03, S04, and S09-S12 already have deterministic fixture evidence. The Milestone task itself also requires the dev `ornith:35b` capacity+1 stream smoke.
- S07 and its Evidence Map require a minimum three-run live smoke with sanitized lifecycle/capacity evidence. This plan uses that row only as live evidence; it does not claim completion of the separate `ops-evidence` task.
- PASS requires both the existing deterministic repeat-guard evidence and 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, the 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`; focused Core race, repeat/correlation/capacity race fixtures, and `git diff --check` exited 0. The immediately preceding archived review evidence records the fresh package and repository regression passes; this follow-up changes no production or test file.
- External Verification Preflight:
  - authorized runner/workdir: existing dev runner, `/Users/toki/agent-work/iop-dev`, macOS/arm64;
  - current reviewed source: local branch `feature/openai-compatible-output-validation-filters` at `da506ba71d360e5bd3224a9070fa9ce945944ab5`, one commit ahead of the remote feature tip and with a dirty multi-file worktree;
  - source sync status: no clean remotely addressable ref containing the reviewed work is currently evidenced;
  - required Edge artifacts/config: `build/dev-runtime/bin/edge`, `build/dev-runtime/edge.yaml`, Edge id `edge-toki-labs-dev`, OpenAI `127.0.0.1:18083`, Node transport `18084`, admin `19093`;
  - required provider identities: `onexplayer-lemonade`, `rtx5090-lemonade`; current selected aggregate capacity `3`, while acceptance requires `4`;
  - required identity proof: clean source commit, Edge and every participating Node binary checksum/version, deployment/restart record, process start time, listener ports, and provider status from that same ref;
  - fresh read-only blocker evidence: the runner is clean on `main` at `e24207916a8ac83169a398af6458256a0f1332e0`, its Edge/Node artifacts do not identify the reviewed local tree, `rtx5090-lemonade` is offline, and the fixed prompt/observation inputs are absent;
  - blocker: commit, push, shared deployment, provider restoration, and runtime restart require an authorized workflow outside this review action;
  - setup/resume step: publish the exact reviewed work through the normal authorized workflow, clean-sync the runner, rebuild/redeploy/restart all participating runtimes, and verify all identities before running the live command.
- Raw prompt, SSE, output, credentials, and tokens remain only in a worker-owned task-specific `/tmp/iop-repeat-guard-live/` directory on the authorized runner. No raw smoke artifact is written under this workspace; tracked artifacts and stdout contain sanitized identities, correlations, decisions, fingerprints/offsets, status, and capacity counters only.
- Confidence: high for local correctness and for the exact missing evidence; no live PASS claim is possible until the clean same-ref precondition is met.

### Test Coverage Gaps

- Fatal terminal observation fidelity: covered by `TestRequestRuntimeTerminalFailureFidelity/fatal_filter_overrides_success_terminal`; fresh race PASS.
- Repeat history/action, strict correlation, and capacity parser behavior: covered by focused Edge race fixtures; fresh PASS.
- Clean same-ref runtime lifecycle and capacity behavior: not covered by current evidence. The required external 15-request/three-row run remains the only 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. Source/build/deploy/restart identity, 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, configuration, repeat policy, provider selection, queue semantics, or correlation logic.
- Do not create a commit, publish a ref, deploy, restart a shared runtime, or expose credentials outside the authorized workflow.
- 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=5`, `evidence_integrity_failure=false`; risk and recovery boundaries matched without replacing the grade-boundary basis.
- Capability gap: none; the remaining blocker is authorization and external identity setup, not model capability.

## Implementation Checklist

- [ ] [REVIEW_OFR-REPEAT-5-1] Produce the clean same-ref `ornith:35b` 5-concurrent × 3 lifecycle and capacity evidence with matching runtime identities, worker-owned external raw artifacts, and sanitized results.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REVIEW_OFR-REPEAT-5-1] Clean same-ref live lifecycle and capacity evidence

#### Problem

`code_review_cloud_G10_5.log:55` records the required live item as incomplete, and its evidence section records `Status: NOT RUN`. Local fixtures prove correlation and capacity parsing but do not satisfy the Milestone's integrated dev smoke or SDD S07 live evidence boundary.

#### Solution

- Obtain a clean remotely addressable ref containing the exact reviewed work through the normal authorized workflow.
- Clean-sync `/Users/toki/agent-work/iop-dev` to that ref; rebuild, redeploy, and restart the Edge and every participating Node from it.
- Record matching source commit, clean status, binary checksums/version, process start times, listener ports, selected provider identities, and configured capacity before the run.
- 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, each with configured/peak/queued/final-in-flight/final-queued `4/4/>=1/0/0`.
- Before the live run, have the authorized workflow provision a non-empty untracked prompt and the Edge observation sink at the fixed worker-owned `/tmp/iop-repeat-guard-live/` paths below. Do not create raw artifacts anywhere in this workspace.
- Record only sanitized output in the active review. If authorization or identity proof remains unavailable, leave the item unchecked and record the exact blocker, attempted preflight, and resume condition.

#### Modified Files and Checklist

- [ ] `/tmp/iop-repeat-guard-live/` — worker-owned prompt, raw SSE, observation, and generated summary artifacts only; outside the workspace and not a dispatcher claim.
- [ ] `agent-task/m-openai-compatible-output-validation-filters/02+01_repeat_guard/CODE_REVIEW-cloud-G10.md` — sanitized identity, command, 15-correlation, and three-capacity-row evidence, or exact blocker evidence.
- [ ] No production, test, contract, spec, config, or tracked raw-evidence file changes.

#### Test Strategy

- No new test is planned. The permanent correlation and capacity fixtures already pass; this item executes the existing live harness against one clean same-ref deployment.
- A harness correction is outside this verification-only scope and requires a recorded plan deviation plus fresh local regression before another live run.

#### 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 clean sync/rebuild/redeploy/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 capacity rows satisfying `4/4/>=1/0/0`, with no raw prompt/output/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-5-1 sanitized 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. Obtain the authorized clean ref and matching deployment/restart identity, then provision the non-empty prompt and observation paths under `/tmp/iop-repeat-guard-live/`.
3. Run the fresh local guard checks, then the live command once.
4. 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 that the runner is clean at one authorized reviewed ref and that every participating Edge/Node binary and running process was rebuilt, redeployed, and restarted from that ref. The authorized workflow must provision the non-empty prompt and observation file under `/tmp/iop-repeat-guard-live/`; raw output must remain outside this workspace. Then run the REVIEW_OFR-REPEAT-5-1 live command exactly 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 code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`.
