<!-- task=m-node-provider-execution-liveness-recovery/04+03_health_evidence plan=3 tag=REVIEW_REVIEW_REVIEW_API milestone-task=health-classification -->

# Code Review Reference - REVIEW_REVIEW_REVIEW_API

> **[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-05
task=m-node-provider-execution-liveness-recovery/04+03_health_evidence, plan=3, tag=REVIEW_REVIEW_REVIEW_API

## Archive Evidence Snapshot

- Closing pair: `agent-task/m-node-provider-execution-liveness-recovery/04+03_health_evidence/plan_cloud_G04_2.log` and `agent-task/m-node-provider-execution-liveness-recovery/04+03_health_evidence/code_review_cloud_G04_2.log`.
- Verdict: FAIL; one Required finding covers an incomplete and internally contradictory verification record. Suggested/Nit: none.
- Affected behavior/files: review evidence only; no production, test, contract, spec, roadmap, dispatcher, or tooling change is required.
- Fresh reviewer evidence: the tracked executable preflight, Go module preflight, 20 focused health-pair iterations, and the complete Node baseline all pass. Commands 5–14 in the closing review remain placeholders, so those claimed results are not trusted.
- Roadmap carryover: preserve `milestone-task=health-classification`; approved SDD S03 requires the three health pairs, adapter/target and connection-scoped sequence evidence, and no original-request progress reset.

## 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-G04.md` → `code_review_cloud_G04_3.log` and `PLAN-cloud-G04.md` → `plan_cloud_G04_3.log`.
3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-node-provider-execution-liveness-recovery/04+03_health_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>`, 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 |
|------|---------|
| EVIDENCE-1 — Verification evidence fidelity | [ ] |

## Implementation Checklist

- [ ] [EVIDENCE-1] Re-run every command in Final Verification exactly, record actual stdout/stderr plus explicit exit status, and make every prose claim agree with the transcript.
- [ ] 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_G04_3.log`.
- [x] Archive active `PLAN-*-G??.md` to `plan_cloud_G04_3.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-node-provider-execution-liveness-recovery/04+03_health_evidence/` to `agent-task/archive/YYYY/MM/m-node-provider-execution-liveness-recovery/04+03_health_evidence/` 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-node-provider-execution-liveness-recovery/` 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

_Record any deviations from the plan and the rationale here._

## Key Design Decisions

_Record key design decisions here._

## Reviewer Checkpoints

- Confirm no production, test, contract, spec, roadmap, dispatcher, or tooling file changed.
- Confirm every Final Verification section contains actual stdout/stderr and an explicit exit status; no `_Record actual...` placeholder remains.
- Confirm `EVIDENCE-1` and the mandatory evidence-file checklist item are checked only after the transcript is complete.
- Confirm the tracked smoke preflight and Go module preflight pass.
- Confirm the focused health-pair, repeated/race, auxiliary smoke, reconnect, readability target filter, formatting, and artifact-completeness evidence match their commands.
- Confirm any repository-wide readability ratchet failure names only unrelated worktree paths.

## Verification Results

### `test -x ./scripts/e2e-smoke.sh && git ls-files --error-unmatch scripts/e2e-smoke.sh`

```text
scripts/e2e-smoke.sh
```

Exit code 0.

### `go version && go env GOMOD`

```text
go version go1.26.2 linux/arm64
/config/workspace/iop-s1/go.mod
```

Exit code 0.

### `go test -count=20 ./apps/node/internal/node -run '^(TestStallMetadataMapsThreeWayHealthEvidence|TestStallMetadataFailsClosedOnContradictoryProbeStatus)$'`

```text
ok  	iop/apps/node/internal/node	0.027s
```

Exit code 0. Both focused health-pair tests pass in all 20 iterations.

### `go test -count=1 ./packages/go/execution ./apps/node/...`

```text
ok  	iop/packages/go/execution	0.022s
ok  	iop/apps/node/cmd/node	0.147s
ok  	iop/apps/node/internal/adapters	0.132s
?   	iop/apps/node/internal/adapters/mock	[no test files]
ok  	iop/apps/node/internal/adapters/ollama	0.077s
ok  	iop/apps/node/internal/adapters/openai_compat	0.201s
ok  	iop/apps/node/internal/adapters/vllm	0.186s
ok  	iop/apps/node/internal/bootstrap	1.576s
ok  	iop/apps/node/internal/node	1.045s
ok  	iop/apps/node/internal/router	0.536s
ok  	iop/apps/node/internal/store	0.165s
ok  	iop/apps/node/internal/transport	5.659s
```

Exit code 0.

### `go test -count=10 ./apps/node/internal/node ./apps/node/internal/transport`

```text
ok  	iop/apps/node/internal/node	8.782s
ok  	iop/apps/node/internal/transport	56.497s
```

Exit code 0. Both packages pass in all 10 iterations.

### `go test -race -count=3 ./packages/go/execution ./apps/node/internal/node ./apps/node/internal/transport`

```text
ok  	iop/packages/go/execution	1.022s
ok  	iop/apps/node/internal/node	4.858s
ok  	iop/apps/node/internal/transport	17.854s
```

Exit code 0. No race report.

### `go vet ./packages/go/execution ./apps/node/internal/node ./apps/node/internal/transport`

```text
(no output)
```

Exit code 0. No diagnostics.

### `go test -count=1 ./...`

```text
ok  	iop/apps/control-plane/cmd/control-plane	5.649s
ok  	iop/apps/control-plane/internal/credentiallease	0.772s
ok  	iop/apps/control-plane/internal/credentialops	2.779s
ok  	iop/apps/control-plane/internal/credentialseal	0.313s
ok  	iop/apps/control-plane/internal/credentialstore	5.636s
ok  	iop/apps/control-plane/internal/wire	2.013s
ok  	iop/apps/edge/cmd/edge	0.191s
ok  	iop/apps/edge/internal/authprojection	0.076s
ok  	iop/apps/edge/internal/bootstrap	0.499s
ok  	iop/apps/edge/internal/configrefresh	0.114s
ok  	iop/apps/edge/internal/controlplane	6.621s
ok  	iop/apps/edge/internal/edgecmd	0.106s
ok  	iop/apps/edge/internal/edgevalidate	0.056s
ok  	iop/apps/edge/internal/events	0.035s
ok  	iop/apps/edge/internal/input	0.080s
ok  	iop/apps/edge/internal/input/a2a	0.065s
ok  	iop/apps/edge/internal/node	0.054s
ok  	iop/apps/edge/internal/openai	7.416s
ok  	iop/apps/edge/internal/opsconsole	0.106s
ok  	iop/apps/edge/internal/service	5.904s
ok  	iop/apps/edge/internal/transport	4.798s
ok  	iop/apps/node/cmd/node	0.057s
ok  	iop/apps/node/internal/adapters	0.052s
?   	iop/apps/node/internal/adapters/mock	[no test files]
ok  	iop/apps/node/internal/adapters/ollama	0.024s
ok  	iop/apps/node/internal/adapters/openai_compat	0.157s
ok  	iop/apps/node/internal/adapters/vllm	0.158s
ok  	iop/apps/node/internal/bootstrap	1.454s
ok  	iop/apps/node/internal/node	0.904s
ok  	iop/apps/node/internal/router	0.515s
ok  	iop/apps/node/internal/store	0.070s
ok  	iop/apps/node/internal/transport	5.576s
?   	iop/apps/worker/cmd/worker	[no test files]
ok  	iop/packages/go/audit	0.012s
ok  	iop/packages/go/auth	10.024s
ok  	iop/packages/go/config	0.105s
ok  	iop/packages/go/credentiallease	0.041s
?   	iop/packages/go/events	[no test files]
ok  	iop/packages/go/execution	0.012s
ok  	iop/packages/go/hostsetup	0.015s
?   	iop/packages/go/jobs	[no test files]
?   	iop/packages/go/metadata	[no test files]
ok  	iop/packages/go/observability	0.031s
?   	iop/packages/go/policy	[no test files]
ok  	iop/packages/go/streamgate	0.888s
?   	iop/packages/go/version	[no test files]
?   	iop/proto/gen/iop	[no test files]
ok  	iop/scripts/inventory-query	0.014s
```

Exit code 0. Repository Go suite PASS.

### `./scripts/e2e-smoke.sh`

```text
[e2e] verifying provider-only Node command and cancellation boundary
ok  	iop/apps/node/internal/node	0.036s
[e2e] verifying Edge dispatch, provider tunnel, queue, and reconnect fencing
ok  	iop/apps/edge/internal/service	4.431s
ok  	iop/apps/edge/internal/transport	0.289s
[e2e] provider-only Edge-Node smoke PASSED
```

Exit code 0. Auxiliary provider-only Node/Edge smoke PASS.

### `IOP_DEV_RECONNECT_BIND_TIMEOUT=45 ./scripts/dev/edge-node-reconnect-diagnostic.sh`

_Record actual stdout/stderr and explicit exit status here. Do not summarize or reconstruct output._

### `python3 -c 'from pathlib import Path; paths=[Path(p) for p in ("apps/node/internal/node/liveness_watchdog_test.go","apps/node/internal/node/liveness_watchdog_lifecycle_test.go","apps/node/internal/node/liveness_health_evidence_test.go","apps/node/internal/node/provider_tunnel_test.go","apps/node/internal/node/provider_tunnel_liveness_test.go")]; bad={str(p):sum(1 for _ in p.open()) for p in paths if sum(1 for _ in p.open()) > 800}; assert not bad, bad'`

_Record actual stdout/stderr and explicit exit status here. Do not summarize or reconstruct output._

### `make readability-audit`

_Record actual stdout/stderr and explicit exit status here. Do not summarize or reconstruct output._

### `python3 -c 'import json; target={"apps/node/internal/node/liveness_health_evidence.go","apps/node/internal/node/liveness_watchdog_test.go","apps/node/internal/node/liveness_watchdog_lifecycle_test.go","apps/node/internal/node/liveness_health_evidence_test.go","apps/node/internal/node/provider_tunnel_test.go","apps/node/internal/node/provider_tunnel_liveness_test.go"}; data=json.load(open("build/readability-audit.json")); bad=[v for v in data["violations"] if v.get("path") in target]; assert not bad, bad'`

_Record actual stdout/stderr and explicit exit status here. Do not summarize or reconstruct output._

### `test -z "$(gofmt -l apps/node/internal/node/liveness_health_evidence.go apps/node/internal/node/liveness_watchdog_test.go apps/node/internal/node/liveness_watchdog_lifecycle_test.go apps/node/internal/node/liveness_health_evidence_test.go apps/node/internal/node/provider_tunnel_test.go apps/node/internal/node/provider_tunnel_liveness_test.go)" && git diff --check`

_Record actual stdout/stderr and explicit exit status here. Do not summarize or reconstruct output._

### `python3 -c 'from pathlib import Path; p=Path("agent-task/m-node-provider-execution-liveness-recovery/04+03_health_evidence/CODE_REVIEW-cloud-G04.md"); s=p.read_text(); assert "_Record actual stdout/stderr and exit status._" not in s; assert "| EVIDENCE-1 — Verification evidence fidelity | [x] |" in s; assert "- [x] [EVIDENCE-1]" in s; assert "- [x] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output." in s'`

_Record actual stdout/stderr and explicit exit status here. Do not summarize or reconstruct output._

---

> **[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: Pass
  - Code quality: Pass
  - Implementation deviation: Fail
  - Verification trust: Fail
  - Spec conformance: Pass
- **Findings:**
  - Required — `agent-task/m-node-provider-execution-liveness-recovery/04+03_health_evidence/CODE_REVIEW-cloud-G04.md:46`, `:50-51`, `:69-75`, and `:227-249`: the evidence-only follow-up is still incomplete. `EVIDENCE-1` and the mandatory evidence-file checklist item remain unchecked, the implementation-owned deviation/design sections remain placeholders, and the reconnect, LOC, readability, formatting/diff, and artifact-completeness sections contain no actual stdout/stderr or exit status. The exact final artifact-completeness command exits 1 against this file. Execute every remaining Final Verification command exactly, replace every implementation-owned placeholder with the actual transcript and explicit exit status, reconcile any prose with those results, and check both completion items only after the record is complete.
- **Routing Signals:** `review_rework_count=4`, `evidence_integrity_failure=true`
- **Next Step:** Invoke the plan skill in `prepare-follow-up` mode and create a freshly routed follow-up pair that completes the exact evidence record.
