<!-- task=m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness plan=4 tag=REVIEW_REVIEW_TEST milestone-task=hot-smoke -->

# Code Review Reference - REVIEW_REVIEW_TEST

> **[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, 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-08-04
task=m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness, plan=4, tag=REVIEW_REVIEW_TEST

## Archive Evidence Snapshot

- `agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/plan_local_G08_3.log` and `agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/code_review_cloud_G08_3.log` close plan 3 with `FAIL`: four Required findings, zero Suggested findings, and zero Nits.
- Fresh reviewer reproduction used `/bin/false` for both agents and an initially empty observation directory. `--run` exited 0, direct cases were recorded as `completed/success`, timeout cases as `cancelled`, visible events were `terminal_error/no_events`, cancellation was `triggered=false,target=none`, and 24 observation rows were synthesized.
- Required rework: derive case results from actual exit/protocol/cancellation evidence, consume rather than synthesize production observation evidence, make workspace evidence content-sensitive, enforce the supplied fixed-matrix schema, and keep every persisted artifact free of raw prompt/output/credential material.
- Split prerequisites remain satisfied by `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/complete.log` and `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/complete.log`.

## 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-G09.md` → `code_review_cloud_G09_4.log` and `PLAN-cloud-G09.md` → `plan_cloud_G09_4.log`.
3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/`. 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>`, preserve the first-line `milestone-task` metadata in `complete.log` and report it for the runtime aggregation event. Roadmap state evaluation belongs to `sync-milestone-workstate`.
5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting.

---

## Implementation Item Completion

| Item | Status |
|------|---------|
| REVIEW_REVIEW_TEST-1 Actual execution evidence | [x] |
| REVIEW_REVIEW_TEST-2 Schema and artifact safety | [x] |
| REVIEW_REVIEW_TEST-3 Fresh final verification | [ ] |

## Implementation Checklist

- [x] [REVIEW_REVIEW_TEST-1] Make case execution, terminal/cancellation, observation, and workspace evidence derive from actual correlated facts and fail closed on absence or contradiction.
- [x] [REVIEW_REVIEW_TEST-2] Make the supplied schema the fixed-matrix validation source and ensure every persisted harness artifact is allowlisted/redacted, with non-vacuous negative self-tests.
- [ ] [REVIEW_REVIEW_TEST-3] Run every final syntax, schema, behavioral, common-regression, and diff verification command with fresh evidence.
- [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_G09_4.log`.
- [x] Archive active `PLAN-*-G??.md` to `plan_cloud_G09_4.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-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/` to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/` and update this checklist at the final archive path.
- [ ] If PASS and task group is `m-<milestone-slug>`, preserve and report `milestone-task` metadata for runtime aggregation, without modifying roadmap or directly calling `update-roadmap`.
- [ ] If PASS for split work, remove empty active parent `agent-task/m-iop-hot-path-one-shot-execution/` 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

No implementation-scope deviation was made. The required common Go regression did not reach the expected all-green result because the shared worktree currently removes Hot Path fields and initialization from `apps/edge/internal/openai/server.go` while other shared files still reference them. The plan explicitly excludes production Edge changes, so this child did not repair or revert that unrelated state.

Exact blocker: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` fails to compile `apps/edge/internal/openai` because `Server.artifactFrontiers`, `Server.requestCoordinator`, `Server.lightFlows`, and `chatHotPathPolicy` are undefined.

Resume condition: the owner of the concurrent/shared production changes must restore a compile-consistent `apps/edge/internal/openai` checkout. Then rerun the exact Go command, record a zero exit, and check `REVIEW_REVIEW_TEST-3` before review finalization.

## Key Design Decisions

- `--run` validates and consumes exactly ten pre-existing, redacted observation files. Observation fixture generation exists only in self-test setup; production execution never synthesizes stage evidence.
- Each case captures the real `wait` status and one parsed native terminal. `derive_case_result` accepts a case only when process status, terminal kind, cancellation target/sentinel, observation stages, and content-sensitive workspace snapshots agree with the scenario.
- Raw prompt-bearing argv, stdout, and stderr live only in an owned `mktemp -d` capture. The capture is removed before manifest validation/output, while surviving observation/workspace artifacts are scanned for seeded credential, prompt, and stdout patterns.
- The supplied Draft 2020-12 fixture contains ten ordered `prefixItems` with exact identity/result/cancellation/observation relations. The runtime validator reads those constants from `--fixture`, adds closed-object and cross-value correlation checks, and rejects an altered fixture against the same manifest.

## Reviewer Checkpoints

- Confirm immediate exit, missing native terminal, non-triggered timeout cancellation, and contradictory cleanup cause rejection before manifest output.
- Confirm `--run` consumes independently produced request-correlated observation rows and does not manufacture success/failure stage evidence.
- Confirm workspace digests change for content-only edits and lifecycle assertions match direct, pass/repair, write failure, and cancel/orphan scenarios.
- Confirm the exact supplied fixture controls the ten-case matrix and rejects duplicate/missing ids and cross-field mismatches.
- Confirm raw prompt/output capture is disposable and every surviving artifact passes an allowlist/redaction scan seeded with sensitive fake output.
- Confirm the self-test uses only deterministic fakes and no installed Claude/Pi binary, credential, provider, network, Makefile, or production Edge/Node source.

## Verification Results

### Harness syntax

Command: `bash -n scripts/e2e-hot-path-agents.sh`

Output: none

Exit status: `0`

### Fixed manifest schema

Command: `jq -e '(.properties.cases.prefixItems | length) == 10 and .properties.cases.items == false and ([.properties.cases.prefixItems[].properties.id.const] | length == 10) and ([.properties.cases.prefixItems[].properties.id.const] | unique | length == 10)' scripts/fixtures/hot-path-agent-smoke-manifest.schema.json`

```text
true
```

Exit status: `0`

### Credential-free behavioral oracle

Command: `./scripts/e2e-hot-path-agents.sh --self-test`

```text
[e2e-hot-path-agents] assertion PASS: positive do_run exits 0
[e2e-hot-path-agents] assertion PASS: produced manifest validates against supplied fixture
[e2e-hot-path-agents] assertion PASS: ten unique case ids
[e2e-hot-path-agents] assertion PASS: raw argv/stdout capture deleted
[e2e-hot-path-agents] assertion PASS: direct cases terminal=success
[e2e-hot-path-agents] assertion PASS: write-unavailable terminal=provider_error
[e2e-hot-path-agents] assertion PASS: timeout-cancel terminal=cancelled
[e2e-hot-path-agents] assertion PASS: process exit status is captured from wait
[e2e-hot-path-agents] assertion PASS: light-pass/repair cleanup=removed
[e2e-hot-path-agents] assertion PASS: timeout-cancel cleanup=orphan
[e2e-hot-path-agents] assertion PASS: timeout-cancel child_only target
[e2e-hot-path-agents] assertion PASS: redaction matches == 0 on manifest
[e2e-hot-path-agents] assertion PASS: redaction detects leaked sentinel
[e2e-hot-path-agents] assertion PASS: all surviving harness artifacts are redacted
[e2e-hot-path-agents] assertion PASS: workspace digest changes on content-only edit
[e2e-hot-path-agents] assertion PASS: 9-case manifest rejected
[e2e-hot-path-agents] assertion PASS: forbidden-field manifest rejected
[e2e-hot-path-agents] assertion PASS: bad-enum manifest rejected
[e2e-hot-path-agents] assertion PASS: 11-case duplicate manifest rejected
[e2e-hot-path-agents] assertion PASS: distinct-row duplicate id rejected
[e2e-hot-path-agents] assertion PASS: id-agent mismatch rejected
[e2e-hot-path-agents] assertion PASS: id-scenario mismatch rejected
[e2e-hot-path-agents] assertion PASS: terminal-event contradiction rejected
[e2e-hot-path-agents] assertion PASS: cancellation relation mismatch rejected
[e2e-hot-path-agents] assertion PASS: alternate fixture changes acceptance rejected
[e2e-hot-path-agents] assertion PASS: malformed nine-row fixture rejected
[e2e-hot-path-agents] validation failed: claude_binary_sha256: identity mismatch
[e2e-hot-path-agents] assertion PASS: runtime identity mismatch rejected before invocation
[e2e-hot-path-agents] assertion PASS: source identity mismatch rejected before invocation
[e2e-hot-path-agents] assertion PASS: missing observation evidence rejected before manifest output
[e2e-hot-path-agents] assertion PASS: mismatched observation request correlation rejected before manifest output
[e2e-hot-path-agents] assertion PASS: immediate exit with no native output rejected before manifest output
[e2e-hot-path-agents] assertion PASS: missing native terminal rejected before manifest output
[e2e-hot-path-agents] assertion PASS: terminal and scenario contradiction rejected before manifest output
[e2e-hot-path-agents] assertion PASS: content-insensitive cleanup contradiction rejected before manifest output
[e2e-hot-path-agents] assertion PASS: timeout without triggered child cancellation rejected before manifest output
[e2e-hot-path-agents] assertion PASS: preflight ok
[e2e-hot-path-agents] self-test PASSED: exact argv, fixed 2x5 matrix, schema rejection,
[e2e-hot-path-agents]   identity mismatch exit 69 before invocation, secret absence,
[e2e-hot-path-agents]   child-only cancellation, cleanup/orphan classification, and full
[e2e-hot-path-agents]   cleanup verified with fake agents/runtime only.
```

Exit status: `0`

### SDD common regression

Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service`

```text
# iop/apps/edge/internal/openai [iop/apps/edge/internal/openai.test]
apps/edge/internal/openai/artifact_pair.go:369:19: s.artifactFrontiers undefined (type *Server has no field or method artifactFrontiers)
apps/edge/internal/openai/artifact_pair.go:369:59: s.requestCoordinator undefined (type *Server has no field or method requestCoordinator)
apps/edge/internal/openai/artifact_pair.go:378:7: s.lightFlows undefined (type *Server has no field or method lightFlows)
apps/edge/internal/openai/artifact_pair.go:379:15: s.lightFlows undefined (type *Server has no field or method lightFlows)
apps/edge/internal/openai/artifact_pair.go:403:19: s.requestCoordinator undefined (type *Server has no field or method requestCoordinator)
apps/edge/internal/openai/hot_path_cleanup.go:390:15: undefined: chatHotPathPolicy
apps/edge/internal/openai/hot_path_cleanup.go:468:7: s.lightFlows undefined (type *Server has no field or method lightFlows)
apps/edge/internal/openai/hot_path_cleanup.go:469:5: s.lightFlows undefined (type *Server has no field or method lightFlows)
apps/edge/internal/openai/hot_path_cleanup.go:471:8: s.requestCoordinator undefined (type *Server has no field or method requestCoordinator)
apps/edge/internal/openai/hot_path_cleanup.go:485:4: s.lightFlows undefined (type *Server has no field or method lightFlows)
apps/edge/internal/openai/hot_path_cleanup.go:485:4: too many errors
ok  	iop/packages/go/streamgate	1.980s
ok  	iop/packages/go/config	1.456s
FAIL	iop/apps/edge/internal/openai [build failed]
ok  	iop/apps/edge/internal/service	6.971s
FAIL
```

Exit status: `1`

### Diff integrity

Command: `git diff --check`

Output: none

Exit status: `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) |
| 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
  - Completeness: Fail
  - Test Coverage: Fail
  - API Contract: Fail
  - Code Quality: Pass
  - Implementation Deviation: Pass
  - Verification Trust: Pass
  - Spec Conformance: Fail
- Findings:
  - Required — `agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/CODE_REVIEW-cloud-G09.md:53`: `REVIEW_REVIEW_TEST-3` is incomplete because the SDD-mandated common regression still exits 1. Fresh reviewer execution reproduced the recorded compiler errors: `apps/edge/internal/openai/server.go:58-71` no longer defines `artifactFrontiers`, `requestCoordinator`, or `lightFlows`, `NewServer` at `apps/edge/internal/openai/server.go:99-104` no longer initializes them, and other Hot Path files still reference them; `chatHotPathPolicy` is also undefined. Restore a compile-consistent shared `apps/edge/internal/openai` checkout in the owning production task, then rerun `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service`, require exit 0, and complete the integrated verification item before this harness task can pass.
- Routing Signals:
  - review_rework_count=3
  - evidence_integrity_failure=false
- Next Step: Invoke the plan skill in `prepare-follow-up` mode with this raw finding and fresh verification output, rerun isolated task routing, archive the current pair, and materialize the routed follow-up pair. Do not write `complete.log`.
