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

# Code Review Reference - OFR-S07-SOPS-CAPACITY-1

> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.**
> The task is NOT complete until every implementation-owned section below is filled in.
> Complete the `Implementation Checklist`; the final checklist item is mandatory before saving.
> Fill implementation-owned sections, then stop with active files in place and report ready for review.
> If implementation is blocked, record the exact sanitized blocker, attempted commands/output, invocation count, authorization state, and resume condition only in implementation-owned evidence fields.
> Do not ask the user directly, present choices, call user-input tools, create control-plane stop files, recover RTX5090, or classify the next state.
> Finalization (`Code Review Result`, log rename, `complete.log`, archive moves, `Review-Only Checklist`) is review-agent-only.

## Overview

date=2026-07-30
task=m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence, plan=1, tag=OFR-S07-SOPS-CAPACITY-1

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

## Archive Evidence Snapshot

- `plan_cloud_G08_0.log` and `code_review_cloud_G08_0.log` record the plan-0 FAIL caused by a missing approved credential source; live invocation count was 0.
- `user_review_0.log` records the resolved credential action, protected SOPS source, successful new-token authentication, rejected superseded tokens, and no tracked raw-token write.
- The latest sanitized Edge status reports all four nodes connected and Ornith providers healthy/idle at capacities 3+1. RTX5090's session-dependent Node launch was replaced operationally with the documented session-independent launch before this plan starts.
- Do not reopen or recount superseded task 02.

## For the Review Agent

> **[REVIEW AGENT ONLY]** The finalization steps below are review-agent only. Implementing agents must not execute this section.

Compare each item against the plan, source, and fresh sanitized evidence.

1. Append one verdict and verified task-03-only `review_rework_count` / `evidence_integrity_failure` signals.
2. Archive this review to `code_review_cloud_G08_1.log` and the plan to `plan_cloud_G08_1.log`.
3. If PASS, write `complete.log`, move task 03 to the monthly archive, and report only the `repeat-guard` completion event for runtime; do not report `ops-evidence`.
4. If authenticated full capacity was unavailable before live launch, create an `external-execution` `USER_REVIEW.md` with `invocation_count=0`. Do not create an equivalent follow-up plan or attempt RTX5090 recovery.
5. If the live Go test started and failed, preserve the consumed invocation evidence and require explicit new authorization before any future live invocation.

---

## Implementation Item Completion

| Item | Status |
|------|---------|
| [OFR-S07-SOPS-CAPACITY-1-1] Gate execution on authenticated full-capacity readiness | [ ] |
| [OFR-S07-SOPS-CAPACITY-1-2] Capture one full-capacity live invocation and cleanup | [ ] |

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

## Review-Only Checklist

> **[REVIEW AGENT ONLY]** This checklist is used only by the review agent.
> Implementing agents must not modify or check this section.

- [x] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure` to `Code Review Result`.
- [x] Verify that verdict, `Dimension Assessment`, and Required/Suggested/Nit classifications match.
- [x] Archive active review to `code_review_cloud_G08_1.log`.
- [x] Archive active plan to `plan_cloud_G08_1.log`.
- [x] Verify the Agent-Ops managed `.gitignore` block.
- [ ] If PASS, write `complete.log`, leave no active `.md` files, and move task 03 to `agent-task/archive/YYYY/MM/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/`.
- [ ] If PASS, report only the `repeat-guard` completion event for runtime without directly changing roadmap state.
- [ ] If full-capacity external execution remains unavailable, create `USER_REVIEW.md` with `reason=external-execution`, preserve invocation count 0, and do not create an equivalent follow-up.
- [x] If a live invocation was consumed, preserve that fact and require explicit authorization before any future invocation.
- [x] If WARN/FAIL for another reason, write the exact next filesystem state required by the code-review skill.

## Deviations from Plan

_Record any command or execution deviation and its rationale here._

## Key Design Decisions

_Record the actual gate outcome, whether the live invocation started, and why execution stopped or continued._

## Reviewer Checkpoints

- Verify SOPS decryption and token-hash comparison did not print raw credential material or a token hash.
- Verify authenticated `/v1/models` HTTP 200 occurred before any provider invocation.
- Verify the original capacity contract is unchanged: OneXPlayer 3 plus RTX5090 1, with five concurrent requests and three runs.
- Verify no additional RTX5090 recovery action occurred during implementation.
- Verify live invocation count is exactly 0 on any preflight blocker or exactly 1 after test start.
- Verify a started invocation was never retried.
- Verify summary cardinality, identity uniqueness, capacity, result, idle provider, process, source, and raw-free assertions.
- Verify task 02 remained archived incomplete and only task-03 history contributed to routing signals.
- Verify PASS reports `repeat-guard` only, not the broader S07 `ops-evidence` task.

## Verification Results

### Authenticated source/runtime/full-capacity preflight

Command:

```bash
# Run the exact OFR-S07-SOPS-CAPACITY-1-1 verification command from PLAN-cloud-G08.md.
```

Implementation evidence:

_Paste actual sanitized stdout/stderr and exit status. State `auth=PASS|BLOCKED`, provider readiness, and `invocation_count=0`. Do not paste credential material, hashes, raw prompt/output/SSE, or full status payloads._

### Single authorized remote live invocation

Command:

```bash
# Run only after the preflight PASS, using the exact OFR-S07-SOPS-CAPACITY-1-2 single-invocation command from PLAN-cloud-G08.md.
```

Implementation evidence:

_State whether the Go process started, the exact invocation count, exit status, and sanitized test output. If it did not start, record the preflight blocker and invocation count 0._

### Sanitized summary and cleanup

Command:

```bash
# Run only after a successful live invocation, using the exact sanitized summary/cleanup command from PLAN-cloud-G08.md.
```

Implementation evidence:

_Record only the sanitized result class, cardinalities, capacity facts, provider/process cleanup, and source identity result. Do not paste `summary.json`._

### Tracked secret/raw evidence check

Command:

```bash
git diff --check
git status --short
```

Implementation evidence:

_Paste actual output and state whether any raw credential or live response artifact entered tracked files._

---

> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section?**
> If anything is blank, go back and fill it in before saving this file.
> Leave review-agent-only sections unchanged.

## Section Ownership

| Section | Owner | Note |
|---------|-------|------|
| Header comment, Overview, Review Agent Instructions | Fixed at stub creation | Implementing agent must not modify or execute finalization |
| Roadmap Targets | Fixed at stub creation from plan | Implementing agent must not modify |
| Archive Evidence Snapshot | Fixed at stub creation from resolved review | Do not broadly inspect archives |
| Implementation Item Completion (item names) | Fixed at stub creation | Implementing agent checks `[ ]` → `[x]` only |
| Implementation Checklist (item text/order) | Fixed at stub creation | Implementing agent checks `[ ]` → `[x]` only |
| Review-Only Checklist | Review agent only | Implementing agent must not modify or check |
| Deviations from Plan, Key Design Decisions | Implementing agent | Replace placeholders with actual content |
| Reviewer Checkpoints | Fixed at stub creation | Pre-filled from plan |
| Verification Results (section headings + commands) | Fixed at stub creation | Implementing agent fills evidence; command changes require a deviation |
| Code Review Result | Review agent appends | Not included in stub |

## Code Review Result

- Overall Verdict: FAIL
- Dimension Assessment:
  - Correctness: Fail — the authorized live harness started once but exited after about 20 minutes with only four first-run SSE artifacts, no `summary.json`, and one selected-provider request still in flight after the harness exited.
  - Completeness: Fail — both implementation items and the mandatory evidence-file completion item remain unchecked, every implementation-owned section is still a placeholder, and the required sanitized summary and idle cleanup are absent.
  - Test Coverage: Fail — fresh reviewer-side focused, Stream Gate/OpenAI package, and config tests pass, but the required 5-concurrent by 3-run S07 execution did not complete.
  - API Contract: Pass — the unchanged plan and reviewed harness preserve principal-token authentication, the original `ornith:35b` capacity contract, and raw-free evidence boundaries; the post-run read-only probe passed source and authentication assertions before reaching the provider-idle failure.
  - Code Quality: Pass — no source change was made by this packet, fresh package tests pass, and no tracked raw credential or response artifact was introduced.
  - Implementation Deviation: Fail — live execution proceeded while the review artifact remained unfilled, and neither its terminal stdout/exit status nor the consumed-invocation failure was recorded in the implementation-owned fields.
  - Verification Trust: Fail — the exact live terminal output and exit status are unavailable; fresh reviewer evidence proves `invocation_count=1`, four SSE artifacts, an absent summary, an absent harness process, and incomplete provider cleanup.
  - Spec Conformance: Fail — SDD S07 and the targeted `repeat-guard` evidence require 15 provider responses, 15 Edge correlations, three capacity rows, and a repeat fingerprint/offset or `not_reproduced` result; none was produced.
- Findings:
  - Required — `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/CODE_REVIEW-cloud-G08.md:51`: the single authorized live invocation was consumed without producing the SDD S07 summary or idle cleanup, and the implementation evidence remains blank. Preserve the failed artifact, obtain explicit authorization before any replacement live invocation, require both providers to return healthy/idle first, and record the replacement invocation's exact sanitized terminal output, exit status, summary, cleanup, source identity, and tracked-secret checks.
- Routing Signals:
  - `review_rework_count=2`
  - `evidence_integrity_failure=false`
- Next Step: Archive the current pair and create an `external-execution` `USER_REVIEW.md` with `invocation_count=1`; do not create a replacement execution plan until explicit new authorization and healthy/idle provider evidence are recorded.
