<!-- task=m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure plan=0 tag=TEST -->

# Code Review Reference - TEST

> **[IMPLEMENTING AGENT — READ FIRST] Filling this file is mandatory.**
> Paste actual local and field evidence. If macOS preflight blocks, record it exactly and leave the active pair; do not fabricate success or perform reviewer finalization.

## Overview

date=2026-07-29
task=m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure, plan=0, tag=TEST

## Roadmap Targets

- Milestone: `agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-cli-runtime.md`
- Milestone link: [Milestone document](agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-cli-runtime.md)
- Task ids:
  - `logged-smoke`: authenticated macOS discovery-through-completion multi-project field validation
- Completion mode: check-on-pass

## For the Review Agent

> **[REVIEW AGENT ONLY]** Implementing agents must not execute finalization.

Require an actual schema-valid redacted macOS manifest for PASS. Append verdict/signals; archive `CODE_REVIEW-cloud-G09.md` → `code_review_cloud_G09_0.log` and `PLAN-cloud-G09.md` → `plan_cloud_G09_0.log`; on PASS write `complete.log`, archive the task, and report `logged-smoke` completion metadata without editing the roadmap. External absence requires a normal follow-up, not a waiver.

## Implementation Item Completion

| Item | Status |
|------|--------|
| TEST-2 Harness/preflight | [ ] |
| TEST-3 S14 lifecycle | [ ] |
| TEST-4 Redaction | [ ] |
| TEST-5 Make targets | [ ] |

## Implementation Checklist

- [ ] Add a fail-fast, cleanup-safe macOS field harness with exact source, binary, config, login, workspace, socket, and process preflight.
- [ ] Cover discovery, preview/start, stream/log, quota/status, cancel, new invocation, daemon restart/recovery, independent project failure, and completion.
- [ ] Emit and validate a bounded redacted manifest containing commit/binary/config revisions, provider readiness states, project pseudonyms, step results, and evidence locators.
- [ ] Add Makefile entry points and locally verify help, preflight, redaction, and cleanup behavior without claiming S14 completion.
- [ ] Execute the harness on an actual logged-in macOS runner and paste the redacted manifest plus exact command output.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

## Review-Only Checklist

> **[REVIEW AGENT ONLY]** Implementing agents must not modify this checklist.

- [x] Append one verdict and verified routing signals.
- [x] Verify field evidence, dimensions, and finding classifications.
- [x] Archive `CODE_REVIEW-cloud-G09.md` as `code_review_cloud_G09_0.log`.
- [x] Archive `PLAN-cloud-G09.md` as `plan_cloud_G09_0.log`.
- [x] Verify the Agent-Ops managed `.gitignore` block.
- [ ] If PASS, write canonical `complete.log` and leave no active Markdown files.
- [ ] If PASS, move this task directory to the dated archive and update this checklist there.
- [ ] If PASS, report `logged-smoke` completion metadata without editing the roadmap.
- [ ] If PASS, remove an empty split parent or prove remaining siblings/files require it.
- [x] If WARN/FAIL, create the exact next state without `complete.log`.

## Deviations from Plan

_Implementer: actual deviations or blocker, or `None`._

## Key Design Decisions

_Implementer: actual decisions._

## Reviewer Checkpoints

- The macOS runner matches the reviewed commit, binary, and config revisions.
- Two distinct clean clones and actual CLI-owned logins are proven without secrets.
- Cancellation or failure of one project does not stop the sibling.
- Restart recovery and terminal archives preserve exact identities.
- Manifest schema/redaction searches pass and raw logs stay operator-local.

## Verification Results

### Local harness

```bash
bash -n scripts/e2e-iop-agent-logged-smoke.sh
scripts/e2e-iop-agent-logged-smoke.sh --help
make build-agent
```

_Paste actual stdout/stderr._

### External field run

```bash
scripts/e2e-iop-agent-logged-smoke.sh \
  --binary "$PWD/build/bin/iop-agent" \
  --repo-config "$PWD/configs/iop-agent.runtime.yaml" \
  --local-config "$IOP_AGENT_SMOKE_LOCAL_CONFIG" \
  --provider-catalog "$PWD/configs/iop-agent.providers.yaml" \
  --project-a "$IOP_AGENT_SMOKE_PROJECT_A" \
  --project-b "$IOP_AGENT_SMOKE_PROJECT_B" \
  --expected-head "$(git rev-parse HEAD)" \
  --output "$IOP_AGENT_SMOKE_OUTPUT"
```

_Paste actual macOS stdout/stderr or exact blocker and resume condition._

### Manifest and diff validation

```bash
scripts/e2e-iop-agent-logged-smoke.sh --validate-manifest "$IOP_AGENT_SMOKE_OUTPUT/manifest.json"
rg -n -i 'authorization|bearer|api[_-]?key|token|/Users/|/home/' "$IOP_AGENT_SMOKE_OUTPUT/manifest.json" && exit 1 || true
git diff --check
```

_Paste actual stdout/stderr and the redacted manifest._

---

> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only content unchanged.

## Section Ownership

| Section | Owner | Note |
|---------|-------|------|
| Header, Overview, Roadmap Targets, Review Instructions | Fixed | Implementer must not modify |
| Implementation Item Completion, Implementation Checklist | Implementing agent | Check status only |
| Review-Only Checklist | Review agent | Implementer must not modify |
| Deviations, Decisions, Verification Results | Implementing agent | Record actual local/field evidence |
| Reviewer Checkpoints | Fixed | Reviewer verifies them |
| Code Review Result and finalization | Review agent | Append/execute only after review |

## Code Review Result

- Overall Verdict: FAIL
- Dimension Assessment:
  - Correctness: Fail — the planned smoke entrypoint does not exist, so none of the required lifecycle behavior is implemented.
  - Completeness: Fail — all implementation items and implementation-owned evidence remain incomplete.
  - Test Coverage: Fail — the planned syntax, preflight, schema, redaction, cleanup, and macOS field checks cannot run.
  - API Contract: Fail — the bounded redacted manifest schema required by the plan and SDD evidence contract is absent.
  - Code Quality: Fail — there is no harness implementation whose cleanup, timeout, redaction, or error behavior can be reviewed.
  - Implementation Deviation: Fail — none of the three files in the Modified Files Summary contains the planned TEST-2 through TEST-5 work.
  - Verification Trust: Fail — the review artifact contains placeholders instead of actual command output, and the required production evidence path is absent.
  - Spec Conformance: Fail — SDD scenario S14 requires an actual logged-in macOS multi-project field manifest, but no schema-valid manifest or lifecycle evidence was supplied.
- Findings:
  - Required — `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/PLAN-cloud-G09.md:90`: `scripts/e2e-iop-agent-logged-smoke.sh` and `scripts/fixtures/iop-agent-smoke-manifest.schema.json` do not exist. Implement the fail-fast, cleanup-safe harness, the complete S14 lifecycle, and the bounded redacted manifest validator before resubmitting.
  - Required — `Makefile:1`: neither `test-iop-agent-logged-smoke-preflight` nor `test-iop-agent-logged-smoke` is declared or implemented; both `make -n` probes exit 2. Add the two explicit entrypoints and keep the field target dependent on caller-supplied macOS paths.
  - Required — `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/CODE_REVIEW-cloud-G09.md:31`: all implementation statuses are unchecked and the verification sections still contain placeholders. Run the local syntax/help/preflight/redaction/cleanup checks, then execute the exact harness on a logged-in macOS runner with two clean clones and paste a schema-valid redacted manifest proving isolation, cancellation, restart recovery, and terminal completion.
  - Required — `apps/agent/cmd/agent/main.go:260`: the production CLI still fails closed for start, stop, resume, preview, and live status because authoritative task-runtime wiring is absent. The successor `26+19,21,22,23,25_parity_cutover` plan owns the `iop-agent task-loop` composition but depends on this task's completion, so S14 cannot execute in the current dependency order. Rework the split so production task-loop composition completes before the logged-in smoke, with non-overlapping ownership, then regenerate this follow-up.
- Routing Signals:
  - `review_rework_count=1`
  - `evidence_integrity_failure=true`
- Next Step: Implement active follow-up `PLAN-cloud-G10.md`, which now owns authoritative production task-loop composition before the logged-in S14 smoke; keep dependent parity/cutover packet `26+19,21,22,23,25_parity_cutover` waiting on task 25.
