<!-- task=m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence plan=5 tag=REVIEW_OFR-S07-STALE-LEASE-5 -->

# Code Review Reference - REVIEW_OFR-S07-STALE-LEASE-5

> **[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 blocker, attempted commands/output, mutation count, invocation count, 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, or classify the next state.
> Finalization (`Code Review Result`, log rename, `complete.log`, archive moves, `Review-Only Checklist`) is review-agent-only, even after compaction/resume.
> Follow the ownership table at the bottom of this file for which sections you own.

## Overview

date=2026-07-30
task=m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence, plan=5, tag=REVIEW_OFR-S07-STALE-LEASE-5

## 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` / `code_review_cloud_G08_0.log`: authentication blocker; `invocation_count=0`.
- `plan_cloud_G08_1.log` / `code_review_cloud_G08_1.log`: one consumed incomplete invocation; no accepted summary.
- `user_review_1.log`: resolved authorization/replan boundary and zero-provider-snapshot diagnosis.
- `plan_cloud_G09_2.log` / `code_review_cloud_G09_2.log`: no-change Edge apply left provider snapshots absent; `invocation_count=0`.
- `plan_cloud_G10_3.log` / `code_review_cloud_G10_3.log`: the rebuilt image came from the wrong sibling checkout and still exposed no provider snapshots; `invocation_count=0`.
- `plan_cloud_G10_4.log` / `code_review_cloud_G10_4.log`: the pinned image and current status contract were restored, but OneXPlayer remained at `in_flight=1`; three latest OneXPlayer correlations were terminal, the harness was absent, and `invocation_count=0`.
- Preserve all existing `/tmp/iop-repeat-guard-live/repeat-guard-task-03-*` artifacts. The only new result path is `/tmp/iop-repeat-guard-live/repeat-guard-task-03-plan-5`.

## For the Review Agent

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

Compare implementation of each item against source files and verify that output in `Verification Results` matches code.
Review completion means the following steps are finished:

1. Append verdict and `review_rework_count` / `evidence_integrity_failure` routing signals.
2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_5.log` and `PLAN-cloud-G10.md` → `plan_cloud_G10_5.log`.
3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill.
4. If PASS and task group is `m-<milestone-slug>`, report completion event metadata. Roadmap state check and `update-roadmap` calls are runtime responsibilities.
5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting.

---

## Implementation Item Completion

| Item | Status |
|------|---------|
| REVIEW_OFR-S07-STALE-LEASE-5-1 | [ ] |
| REVIEW_OFR-S07-STALE-LEASE-5-2 | [ ] |

## Implementation Checklist

- [ ] [REVIEW_OFR-S07-STALE-LEASE-5-1] Revalidate the bounded stale-lease evidence, pass the focused generation-settlement tests, then stop and recreate only the OneXPlayer Node process exactly once and require a new connected generation with both selected providers healthy and idle at capacities `3+1`.
- [ ] [REVIEW_OFR-S07-STALE-LEASE-5-2] Only after the generation/status gate passes, start exactly one caller-owned foreground 5-concurrent x 3-run S07 invocation on the fresh plan-5 path, validate the raw-free summary and idle cleanup, and preserve every prior artifact.
- [x] 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 `CODE_REVIEW-*-G??.md` to `code_review_cloud_G10_5.log`.
- [x] Archive active `PLAN-*-G??.md` to `plan_cloud_G10_5.log`.
- [x] Verify that the Agent-Ops managed block in `.gitignore` unignores `agent-task/**/*.md` and `agent-task/**/*.log` and ignores `agent-roadmap/current.md`.
- [ ] If PASS, write `complete.log` based on `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md` files.
- [ ] If PASS, move active task directory `agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/` to `agent-task/archive/YYYY/MM/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/` and update this checklist at the final archive path.
- [ ] If PASS and task group is `m-<milestone-slug>`, report completion event metadata for runtime, without modifying roadmap or directly calling `update-roadmap`.
- [ ] If PASS for split work, remove empty active parent `agent-task/m-openai-compatible-output-validation-filters/` or verify it was kept due to remaining siblings/files.
- [x] If WARN/FAIL, write the next filesystem state matching code-review verdict and do not write `complete.log`.

## Deviations from Plan

None. Execution stopped at the failed pre-mutation focused-test gate exactly as required. No alternate Go path, retry, Node mutation, or model invocation was attempted.

## Key Design Decisions

The read-only stale-lease evidence was sufficient to reach the focused-test gate, but the exact pinned test command could not resolve `go` in the non-login remote shell. The packet forbids proceeding after any pre-mutation gate failure, so the OneXPlayer generation reset and S07 invocation remain unconsumed. Resume requires a new reviewed packet whose focused-test command resolves the remote Go toolchain while preserving a fresh mutation and invocation allowance.

## Reviewer Checkpoints

- Verify the read-only gate proves the exact latest OneXPlayer correlation is terminal, no later OneXPlayer observation exists, the S07 harness is absent, and three current snapshots retain `in_flight=1`.
- Verify the source/image contract and the three focused generation-settlement tests pass before mutation.
- Verify exactly one matching OneXPlayer `iop-node.exe` is stopped and exactly one different PID is launched through `Win32_Process.Create`.
- Verify Lemonade, the loaded model, Control Plane, Edge, configuration, other Nodes, credentials, and prior artifacts are untouched.
- Verify the post-reconnect gate has four connected nodes and healthy/idle OneXPlayer/RTX5090 snapshots at capacities `3+1`.
- Verify SOPS authentication prints no raw token, token hash, or Authorization value.
- Verify the foreground Go process starts at most once, stays caller-owned until terminal exit, and is never retried.
- Verify accepted summary cardinalities, capacity rows, result classification, idle cleanup, source identity, artifact isolation, and secret hygiene.
- Verify PASS reports only `repeat-guard`, not `ops-evidence`.

## Verification Results

### Bounded stale-lease, identity, and focused-test gate

Commands:

- Execute the exact `Bounded read-only stale-lease and identity gate` commands in `PLAN-cloud-G10.md`.
- Execute the exact `Focused generation-settlement tests` command in `PLAN-cloud-G10.md`.

Implementation evidence:

- OneXPlayer direct status predicate: `true`; exit `0`.
- RTX5090 direct status predicate: `true`; exit `0`.
- Read-only stale-lease/identity gate: `stale_lease_gate=PASS latest_correlation=req.manual-1785372720434474000 latest_kind=terminal_committed samples=3 onex_in_flight=1 harness=absent source=unchanged image=pinned node_stop_count=0 node_create_count=0 invocation_count=0`; exit `0`.
- Focused generation-settlement test command: `zsh:1: command not found: go`; exit `127`.
- Blocker: the exact pinned non-login SSH command could not resolve the remote Go executable, so the mandatory pre-mutation test gate did not pass.
- Resume condition: issue a new reviewed packet with a remote focused-test command that resolves the pinned Go toolchain, then rerun all read-only gates before granting a fresh one-stop, one-create, one-invocation allowance.
- Final counts at this gate: `node_stop_count=0 node_create_count=0 invocation_count=0`.

### Single OneXPlayer Node generation reset

Command:

- Execute the exact `Single OneXPlayer Node generation reset` commands in `PLAN-cloud-G10.md` once.

Implementation evidence:

Not executed because the focused generation-settlement test gate failed before mutation. No PID was stopped or created, and no `Win32_Process.Create` call was made. `node_stop_count=0 node_create_count=0 invocation_count=0`.

### Foreground S07 invocation

Command:

- Execute the exact `Foreground invocation` command in `PLAN-cloud-G10.md` at most once and only after the generation gate passes.

Implementation evidence:

Not executed because the pre-mutation focused-test gate failed. No `remote_live_start` marker was emitted and no Go smoke process was launched. `invocation_count=0`.

### Sanitized summary and cleanup

Command:

- Execute the exact `Sanitized summary and cleanup` command in `PLAN-cloud-G10.md` only after a successful foreground invocation.

Implementation evidence:

Not executed because no foreground S07 invocation occurred. No plan-5 summary was created or inspected. Existing artifacts were not modified. `node_stop_count=0 node_create_count=0 invocation_count=0`.

### Local workspace hygiene

Commands:

```bash
git diff --check
git status --short
git grep -nE 'sk-[A-Za-z0-9_-]{16,}|Authorization: Bearer [^$]' -- . \
  ':(exclude)agent-task/archive/**' \
  ':(exclude)agent-task/m-openai-compatible-output-validation-filters/03_repeat_guard_s07_remote_evidence/*.log'
```

Implementation evidence:

- `git diff --check`: no output; exit `0`.
- `git status --short`: exit `0`; the active task directory contains this evidence update, and all pre-existing unrelated modified/deleted/untracked paths were preserved.
- Credential-pattern grep: exit `0`; matches were existing documentation placeholders, test-only redaction fixtures, and unrelated task/roadmap path text. No match came from the active plan/review pair, and no new raw credential or live model-response material was recorded.
- Final counts: `node_stop_count=0 node_create_count=0 invocation_count=0`.

---

> **[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 these (archive, complete.log, and task-directory archive move are review-agent only) |
| Roadmap Targets | Fixed at stub creation from plan when present | Implementing agent must not modify; code-review copies it into `complete.log` as `Roadmap Completion` only on PASS |
| Archive Evidence Snapshot | Fixed at stub creation from plan when present | Implementing agent uses it as default prior-loop context; read only the specific archive files cited there when more detail is required |
| Implementation Item Completion (item names) | Fixed at stub creation | Implementing agent checks `[ ]` → `[x]` only |
| Implementation Checklist (item text/order) | Fixed at stub creation from plan | Implementing agent checks `[ ]` → `[x]` only |
| Review-Only Checklist | Review agent only | Implementing agent must not modify or check this section |
| Deviations from Plan, Key Design Decisions | Implementing agent | Replace placeholder text 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 in command output only; command changes require a `Deviations from Plan` entry |
| Code Review Result | Review agent appends | Not included in stub |

## Code Review Result

- Overall Verdict: FAIL
- Dimension Assessment:
  - Correctness: Pass — the implementation obeyed the fail-closed pre-mutation boundary and did not consume a Node mutation or model invocation after the test command failed.
  - Completeness: Fail — neither required implementation item is complete; the OneXPlayer generation reset, post-reconnect idle gate, foreground S07 invocation, sanitized summary, and cleanup evidence are absent.
  - Test Coverage: Fail — the implementing run did not pass the mandatory focused test gate and did not execute the required 5-concurrent x 3-run live smoke.
  - API Contract: Pass — no API, wire, config, source, or credential contract was changed.
  - Code Quality: Pass — no implementation source change was made, and the evidence update contains no debug output or raw live payload.
  - Implementation Deviation: Pass — stopping with zero mutations and zero invocations after a pre-mutation gate failure matches the plan.
  - Verification Trust: Pass — fresh review reproduced the non-login `go` resolution failure, confirmed `/opt/homebrew/bin/go` in the login shell, passed the three focused service tests there, and revalidated the unchanged stale-lease snapshot.
  - Spec Conformance: Fail — the S07 capacity+1 live evidence required to close the targeted `repeat-guard` verification gap was not produced.
- Findings:
  - Required — `PLAN-cloud-G10.md:222`: the focused-test command uses a non-login remote shell whose PATH is `/usr/bin:/bin:/usr/sbin:/sbin`, so `go` is unresolved and the mandatory gate at `CODE_REVIEW-cloud-G10.md:115` fails before every integrated acceptance step. Create a fresh reviewed packet that resolves the pinned toolchain through the declared login shell or `/opt/homebrew/bin/go`, reruns the bounded gates, performs exactly one OneXPlayer stop/create generation reset, and only after the idle `3+1` gate performs exactly one foreground S07 invocation and validates the sanitized summary and cleanup.
- Routing Signals:
  - `review_rework_count=6`
  - `evidence_integrity_failure=false`
- Next Step: Prepare the smallest fresh follow-up plan that fixes remote Go resolution while preserving the one-stop, one-create, and one-invocation boundaries; do not write `complete.log`.
