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

# Policy-Correct Continuation and Verifiable Logged-Smoke Evidence

## For the Implementing Agent

Implement every checklist item, run the exact verification commands, and fill the implementation-owned sections of `CODE_REVIEW-cloud-G10.md` with actual notes and stdout/stderr. Keep the active PLAN/CODE_REVIEW files in place and report ready for review; finalization belongs only to the code-review workflow. If blocked, record the exact blocker, attempted commands/output, and resume condition only in implementation-owned evidence fields. Do not ask the user, call user-input tools, create control-plane stop files, classify the next state, archive logs, or write `complete.log`.

## Background

The prior implementation fixed canonical review, retained confinement, Pi repair, and mandatory validation, and its fresh local test suite passed. Review still found that continuation candidates are detached from the rule and failure context that authorized them, the planned application-level fake-provider lifecycle test is absent, and the promoted field manifest validates without any of its referenced evidence files. Its restart claim is also produced after terminal completion and cannot prove either live recovery or the absence of a duplicate invocation.

## Archive Evidence Snapshot

- Prior task: `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure`
- Prior plan: `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/plan_cloud_G10_3.log`
- Prior review: `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/code_review_cloud_G10_3.log`
- Verdict: FAIL
- Findings: four Required, zero Suggested, zero Nit. Continuation merges unrelated rules and targets; no CLI/daemon composition drives a fake provider through review, validation rollback, sibling continuation, and restart; manifest validation ignores its 13 absent evidence files; and restart/duplicate-invocation claims are not derived from a live invocation.
- Affected files: the common continuation request boundary, standalone selector, application composition tests, logged-smoke harness/schema/evidence artifacts, and the two runtime contracts.
- Verification evidence: fresh focused, package, race, vet, shell, smoke-preflight, full-repository, and diff checks passed. A focused manifest reproducer then removed all 13 referenced evidence files while `--validate-manifest` still exited 0. Read-only dev preflight found clean Darwin arm64 at `750cb1d1cb88066a10d3c703c99f1326306d8e15`; the manifest field commit `ee632daf7b57f5e3a9bba8a3e647b9797ac060b3` was not present in that checkout.
- Routing signals: `review_rework_count=4`, `evidence_integrity_failure=true`.
- Roadmap carryover: this task remains the completion owner for `logged-smoke`; no roadmap state changes until PASS.

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

## Analysis

### Files Read

- `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/PLAN-cloud-G10.md`
- `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/CODE_REVIEW-cloud-G10.md`
- `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/code_review_cloud_G10_2.log`
- `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/logged-smoke-manifest.json`
- `agent-roadmap/phase/automation-runtime-bridge/PHASE.md`
- `agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-cli-runtime.md`
- `agent-roadmap/sdd/automation-runtime-bridge/iop-agent-cli-runtime/SDD.md`
- `agent-contract/inner/agent-runtime.md`
- `agent-contract/inner/iop-agent-cli-runtime.md`
- `packages/go/agenttask/ports.go`
- `packages/go/agenttask/dispatch.go`
- `packages/go/agenttask/failure_continuation_test.go`
- `packages/go/agentpolicy/evaluator.go`
- `packages/go/agentpolicy/evaluator_test.go`
- `packages/go/agentpolicy/failure_policy.go`
- `packages/go/agentpolicy/failure_policy_test.go`
- `apps/agent/internal/taskloop/module.go`
- `apps/agent/internal/taskloop/module_test.go`
- `apps/agent/internal/taskloop/integration.go`
- `apps/agent/internal/taskloop/integration_test.go`
- `apps/agent/internal/taskloop/review.go`
- `apps/agent/internal/taskloop/review_test.go`
- `apps/agent/internal/taskloop/provider.go`
- `apps/agent/internal/taskloop/provider_test.go`
- `apps/agent/cmd/agent/main.go`
- `apps/agent/cmd/agent/main_test.go`
- `apps/agent/internal/bootstrap/module.go`
- `apps/agent/internal/bootstrap/module_test.go`
- `scripts/e2e-iop-agent-logged-smoke.sh`
- `scripts/fixtures/iop-agent-smoke-manifest.schema.json`
- `Makefile`
- `agent-test/local/rules.md`
- `agent-test/local/platform-common-smoke.md`
- `agent-test/local/testing-smoke.md`
- `agent-test/dev/rules.md`
- `agent-test/dev/platform-common-smoke.md`
- `agent-test/dev/testing-smoke.md`

### SDD Criteria

- SDD: `agent-roadmap/sdd/automation-runtime-bridge/iop-agent-cli-runtime/SDD.md`, status approved and implementation-unlocked.
- Acceptance scenarios: S07 `quota-failure`, S10 `cli-surface`, S14 `logged-smoke`, and S19 `change-set-integration`.
- Milestone Task id: `logged-smoke`.
- Evidence Map: S07 permits retry/failover only under the matching typed policy and immutable quota evidence; S10 requires one authoritative CLI/daemon runtime composition; S14 requires an exact-source authenticated macOS multi-project manifest; S19 requires validation rollback, independent queue continuation, and restart safety.
- These rows require failure-specific ordered selection, one manager-level application composition test, a promoted bounded evidence set whose bytes are revalidated, and a restart checkpoint captured while the exact invocation is live.

### Verification Context

- Handoff: the current official review supplied four concrete Required findings, affected paths, fresh command output, a missing-evidence reproducer, remote preflight, and routing signals.
- Current checkout: branch `feature/iop-agent-cli-runtime`, HEAD `c2f91e2f1099ed93494832a268eb32f41d0c1530`, dirty with milestone-wide user changes. Preserve unrelated changes.
- Current host: Linux arm64 with Go `go1.26.2`; fresh tests require `GOTMPDIR=/tmp/g` when the default temporary root would exceed Unix-socket path limits.
- Commands already applied: focused taskloop tests, fresh package/race/full tests, vet, shell syntax, smoke preflight, Make dry-run, manifest validation/redaction, `git diff --check`, a missing-locator manifest reproducer, and read-only SSH preflight.
- Preconditions: no real provider CLI in Go tests; deterministic fake provider/reviewer/validator behavior; no credentials, raw home paths, provider streams, or unbounded logs in tracked evidence; all field artifacts from one exact source identity.
- Constraints: the common manager remains the only continuation decision owner; test seams may inject ports but may not fork a second scheduler implementation; the field runner must be clean or use an isolated clean exact-source checkout.
- Gaps: the tracked manifest's 13 locators are absent; source schema and evidence digests are not recomputed; no app composition test launches a fake provider; the prior field commit is not available in the declared dev checkout; restart was observed only after terminal completion.
- Confidence: high. Each local defect has a direct code path and deterministic regression oracle. Final S14 closure still requires a fresh exact-source Darwin run and promotion of its bounded redacted evidence set.

#### External Verification Preflight

- Runner: `ssh toki@toki-labs.com`; declared checkout `/Users/toki/agent-work/iop-dev`.
- Read-only result: Darwin `25.0.0 arm64`, clean checkout at `750cb1d1cb88066a10d3c703c99f1326306d8e15`; the previously claimed isolated field object `ee632daf7b57f5e3a9bba8a3e647b9797ac060b3` is missing there.
- Before field mutation, run:

```bash
ssh toki@toki-labs.com '
  set -eu
  PATH=/opt/homebrew/bin:/usr/local/bin:$PATH
  export PATH
  cd /Users/toki/agent-work/iop-dev
  uname -srm
  git branch --show-current
  git rev-parse HEAD
  git status --short
  command -v go
  command -v jq
  command -v codex
  command -v claude
  go version
'
```

- Source sync: materialize the exact reviewed source in a clean isolated checkout whose commit/tree identity is available to both the local reviewer and field runner, then rebuild the field binary there. Require the manifest source HEAD, both project clone HEADs, build-evidence tree identity, and rebuilt binary digest to agree. Do not reuse the unavailable prior field object or an existing binary.
- Runtime identity: require authenticated catalog profiles, runtime discovery/quota readiness, two distinct clean selected-task clones, a new owned state/output root, no matching daemon/socket before start, and exact daemon/provider PID plus start-token observations.
- Stop before lifecycle mutation when source identity, authentication, command availability, clone cleanliness, output ownership, or process identity cannot be proven. Record the exact blocker in the active review instead of weakening a gate.

### Test Coverage Gaps

- `TestConfigSelectorPersistsOrderedPolicyAndSuppliesQuotaBackedFailover` covers one failure code and one alternate; it does not expose the cross-code target mix-up or reject rules whose stage, grade, lane, capability, or quota predicates do not match.
- `TestRuntimePersistsManualLifecycleAndCompletesIndependentProject` writes `complete.log` directly. CLI and daemon tests verify control-state composition but never run provider submission, canonical review, validation failure/rollback, sibling continuation, or reconstructed-manager restart.
- Manifest self-test mutates record strings inside JSON; it does not delete, replace, symlink, or tamper the actual evidence files.
- No test rejects a status trace that leaves a terminal state, a restart performed only after terminal completion, or two process locators under the same attempt identity.
- The promoted manifest has no promoted evidence bytes, so its S14 claims cannot be independently verified.

### Symbol References

- `FailureContinuationPolicyRequest` is constructed in `packages/go/agenttask/dispatch.go` and implemented by `apps/agent/internal/taskloop.configSelector` plus the test selector in `packages/go/agenttask/failure_continuation_test.go`; update all three together.
- `taskloop.Config` is constructed by CLI `adapter.runtime`, bootstrap `NewDaemonModule`, and taskloop tests; any injectable provider/reviewer seam must remain optional and default to the existing production composition.
- `DaemonOptions` is constructed by `NewDaemonModule` and its option helpers; keep test-only runtime port overrides unexported or narrowly internal.
- The manifest evidence locators are produced and validated only by `scripts/e2e-iop-agent-logged-smoke.sh`, constrained by `scripts/fixtures/iop-agent-smoke-manifest.schema.json`, invoked by `Makefile`, and documented by `agent-contract/inner/iop-agent-cli-runtime.md`.

### Split Judgment

Keep one plan. The closure invariant joins the policy-selected provider attempt, its app-level lifecycle, the exact live restart locator, and the bytes promoted as S14 evidence at one source identity. Splitting those units would permit field evidence from runtime semantics that have not passed the same review.

### Scope Rationale

- Do not redesign `agentpolicy.DecideContinuation`, scheduler state transitions, workspace confinement, canonical review parsing, Pi repair, or integration rollback; those paths already passed fresh focused review.
- Do not change local-control/client protocols, UI clients, Python cutover task 26, roadmap state, or unrelated dirty files.
- Do not add public test APIs, a second manager, real provider processes in Go tests, secrets, raw paths, provider streams, or unbounded field logs.
- Do not accept a structurally valid manifest without the exact promoted evidence bytes, or a restart claim observed only after terminal completion.

### Final Routing

- Evaluation mode: `isolated-reassessment`.
- Status: `routed`; finalizer `finalize-task-policy.sh`, mode `pair`.
- Build closures: scope/context/verification/evidence/ownership/decision all true from the concrete findings, approved SDD, deterministic local regressions, promoted evidence contract, and declared field preflight. Capability gap: not observed.
- Build grade scores: scope coupling 2, state concurrency 2, blast/irreversibility 2, evidence diagnosis 2, verification complexity 2; grade G10.
- Build base route basis and route basis: `grade-boundary`; lane `cloud`; filename `PLAN-cloud-G10.md`.
- Review closures: scope/context/verification/evidence/ownership/decision all true. Review grade scores: 2/2/2/2/2; route basis `official-review`; lane `cloud`; grade G10; adapter `codex`; model `gpt-5.6-sol`; reasoning effort `xhigh`; filename `CODE_REVIEW-cloud-G10.md`.
- `large_indivisible_context=false`.
- Positive loop-risk signatures: `temporal_state`, `concurrent_consistency`, `boundary_contract`, `structured_interpretation`; count 4.
- Recovery signals: `review_rework_count=4`, `evidence_integrity_failure=true`; risk and recovery boundaries both matched without replacing the grade-boundary basis.

## Implementation Checklist

- [ ] Bind continuation policy and candidate eligibility to the exact sanitized failure observation and full ordered rule context, with cross-code and nonmatching-predicate manager regressions.
- [ ] Drive one persisted manager through a deterministic fake-provider lifecycle in both CLI and daemon compositions, including canonical review, mandatory validation rollback, sibling continuation, and restart.
- [ ] Make manifest, schema, and self-test validate the actual bounded evidence files and derive live restart/no-duplicate/terminal-monotonic claims from exact process and state evidence.
- [ ] Run fresh local verification and a new exact-source authenticated Darwin field execution; promote the redacted manifest plus all allowlisted evidence files and update both runtime contracts.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REVIEW_REVIEW_REVIEW_REVIEW_TEST-1] Preserve Failure-Specific Ordered Continuation

#### Problem

`apps/agent/internal/taskloop/module.go:778` merges failure codes and targets from every selection rule, and `module.go:836` marks every non-current target eligible. `packages/go/agenttask/ports.go:138` does not provide the policy source with the sanitized failure observation, so the adapter cannot evaluate the same ordered rule predicates for the concrete failure.

#### Solution

Carry the manager-sanitized immutable `AttemptObservation` in `FailureContinuationPolicyRequest`; do not expose provider diagnostics or allow the source to return a final action. Build the normal worker selection context from project/work metadata, override only failure code and quota state from that observation, and run `agentpolicy.Evaluator.SelectPolicy` once. Authorize retry/failover only when the selected non-default rule explicitly declares that failure code; return only that exact current or alternate target with fresh quota evidence. `agentpolicy.DecideContinuation` remains the sole final decision algorithm.

```go
// Before: packages/go/agenttask/ports.go:138
type FailureContinuationPolicyRequest struct {
    Project       ProjectRecord
    Work          WorkRecord
    CurrentTarget ExecutionTarget
}
```

```go
// After: packages/go/agenttask/ports.go
type FailureContinuationPolicyRequest struct {
    Project       ProjectRecord
    Work          WorkRecord
    CurrentTarget ExecutionTarget
    Observation   agentpolicy.AttemptObservation
}
```

```go
// Before: apps/agent/internal/taskloop/module.go:778
for _, rule := range registration.Selection.Rules {
    // Merge all codes and targets.
}
```

```go
// After: apps/agent/internal/taskloop/module.go
selection := selector.selectionContext(agenttask.SelectionRequest{
    Project: request.Project,
    Work: request.Work,
})
selection.FailureCode = string(request.Observation.Failure.Code)
selection.QuotaState = string(request.Observation.Quota.State)
decision, err := selector.evaluator.SelectPolicy(ctx, selector.policySnapshot, selection)
```

#### Modified Files and Checklist

- [ ] `packages/go/agenttask/ports.go` — add the sanitized immutable observation to the continuation policy-source request.
- [ ] `packages/go/agenttask/dispatch.go` — pass the already sanitized target-matched observation to the policy source.
- [ ] `packages/go/agenttask/failure_continuation_test.go` — assert the source receives the exact sanitized observation and still cannot choose an action.
- [ ] `apps/agent/internal/taskloop/module.go` — evaluate one full ordered failure context and expose only its explicitly authorized target.
- [ ] `apps/agent/internal/taskloop/module_test.go` — add multi-code/multi-target plus nonmatching stage, grade, lane, capability, quota, and default-denial regressions.
- [ ] `agent-contract/inner/agent-runtime.md` — document the safe observation handoff and unchanged common decision ownership.

#### Test Strategy

Write `TestConfigSelectorContinuationUsesExactFailureRuleContext` as a table over two failure codes mapped to different targets and nonmatching stage/grade/lane/capability/quota predicates. Extend the manager continuation test to prove sanitization, policy denial, retry, and first eligible failover without allowing the source to fabricate an action.

#### Verification

```bash
go test -count=1 ./packages/go/agenttask ./apps/agent/internal/taskloop -run 'Test.*(Continuation|FailureRule|ConfigSelector)'
go test -count=1 -race ./packages/go/agenttask ./apps/agent/internal/taskloop
```

Expected: each failure selects only the explicitly matching rule target; unrelated/default targets are ineligible; common continuation remains the sole action owner.

### [REVIEW_REVIEW_REVIEW_REVIEW_TEST-2] Prove the Application-Level Persisted Lifecycle

#### Problem

`apps/agent/internal/taskloop/module_test.go:21` manually writes terminal workflow evidence. `apps/agent/cmd/agent/main_test.go:308` explicitly launches no provider, while `apps/agent/internal/bootstrap/module_test.go:649` covers local-control authority only. These tests do not satisfy the planned S10/S19 fake-provider lifecycle checkpoint.

#### Solution

Add a narrow optional `agenttask.ProviderInvoker` dependency to `taskloop.Config`, defaulting to the existing catalog provider. Thread internal test overrides through CLI adapter and daemon construction without changing production defaults or public command behavior. Use deterministic fake launches/invocations and a fake canonical review executor; keep the real manager, workspace backend, evidence observer, integration backend, state store, command adapter, and daemon composition. Fail the validator once after a valid change-set freeze, prove rollback/canonical immutability and sibling completion, then reconstruct the CLI/daemon runtime over the same state and prove convergence without duplicate dispatch.

```go
// Before: apps/agent/internal/taskloop/module.go:204
provider, err := NewProvider(normalizedCatalog, quotaObserver)
```

```go
// After: apps/agent/internal/taskloop/module.go
provider := config.Provider
if provider == nil {
    provider, err = NewProvider(normalizedCatalog, quotaObserver)
}
```

#### Modified Files and Checklist

- [ ] `apps/agent/internal/taskloop/module.go` — accept an optional provider port while preserving the existing production default and manager ownership.
- [ ] `apps/agent/internal/taskloop/module_test.go` — replace manual lifecycle evidence with one manager-level fake-provider lifecycle and persisted restart assertions.
- [ ] `apps/agent/cmd/agent/main.go` — add an internal dependency seam used only by package tests; production `newAdapter` remains unchanged.
- [ ] `apps/agent/cmd/agent/main_test.go` — drive the command adapter through submission, canonical review, validation rollback, sibling continuation, project logs, and reconstructed persisted state.
- [ ] `apps/agent/internal/bootstrap/module.go` — add a narrow internal daemon option for the same task-runtime ports without changing production defaults.
- [ ] `apps/agent/internal/bootstrap/module_test.go` — run/restart the daemon composition over the same manager state and assert local-control/project-log/terminal projections.
- [ ] `agent-contract/inner/iop-agent-cli-runtime.md` — cite only the lifecycle behavior actually proven by these tests.

#### Test Strategy

Write one reusable behavior contract per package using deterministic in-memory port fakes and proof-owned no-op child launches; never invoke Codex, Claude, Pi, or another provider CLI. Assert submission identity, canonical `Overall Verdict: PASS`, frozen change set, validator root, failed validation rollback, retained blocker, sibling completion, restart state, exact dispatch count, project-log order, and terminal archive evidence.

#### Verification

```bash
go test -count=1 ./apps/agent/internal/taskloop ./apps/agent/cmd/agent ./apps/agent/internal/bootstrap -run 'Test.*(FakeProvider|PersistedLifecycle|Rollback|Restart)'
go test -count=1 -race ./apps/agent/internal/taskloop ./apps/agent/cmd/agent ./apps/agent/internal/bootstrap ./packages/go/agenttask ./packages/go/agentstate
```

Expected: both app compositions exercise one real manager lifecycle with fake ports, failed validation is fault-atomic, the sibling continues, and restart performs no duplicate dispatch.

### [REVIEW_REVIEW_REVIEW_REVIEW_TEST-3] Validate Evidence Bytes and Live Restart Identity

#### Problem

`scripts/e2e-iop-agent-logged-smoke.sh:127` validates only manifest-internal digest strings; all 13 referenced files can be absent. `state_invocation_identity` at line 573 hashes only an attempt ID, restart begins after both projects complete at lines 948-959, and `duplicate_invocation:false` is hard-coded at lines 987-996. The status validator at lines 198-210 also accepts a transition out of a terminal state.

#### Solution

Treat every evidence locator as a same-directory basename. Reject symlinks, non-regular files, path escapes, missing files, oversized files, forbidden content, duplicate locators, and kind/schema mismatches; recompute each SHA-256 and the tracked schema SHA-256. Restart while one selected invocation is proven live, capture pre/post state revision, attempt ID, process locator revision, PID, and start token, and derive duplicate status from those observations. Make terminal state absorbing. Extend self-test by deleting, symlinking, and tampering actual evidence files and by injecting post-terminal running and same-attempt duplicate-process evidence.

```bash
# Before: scripts/e2e-iop-agent-logged-smoke.sh:147
def evidence($root; $kind; $digest):
  any($root.evidence.records[]; .kind == $kind and .sha256 == $digest);
```

```bash
# After: scripts/e2e-iop-agent-logged-smoke.sh
validate_evidence_file "$manifest_dir" "$kind" "$locator" "$expected_sha256"
assert_schema_digest "$manifest" "$MANIFEST_SCHEMA"
assert_absorbing_terminal_traces "$manifest"
```

#### Modified Files and Checklist

- [ ] `scripts/e2e-iop-agent-logged-smoke.sh` — validate actual evidence files, capture live restart/process identity, derive duplication, and enforce terminal monotonicity.
- [ ] `scripts/fixtures/iop-agent-smoke-manifest.schema.json` — require the exact bounded per-kind evidence shapes and source/schema identity fields.
- [ ] `Makefile` — keep preflight deterministic and run the expanded file-tamper/restart self-test.

#### Test Strategy

Extend `--self-test` with a real temporary evidence set. Require safe success, then independently delete a locator, replace it with a symlink, tamper bytes, change its digest, change schema digest, escape a locator, duplicate a locator, regress from completed to running, reuse an attempt with a new process identity, and hard-code a contradictory duplicate flag. Each mutation must fail before any field process starts.

#### Verification

```bash
bash -n scripts/e2e-iop-agent-logged-smoke.sh
make test-iop-agent-logged-smoke-preflight
make -n test-iop-agent-logged-smoke
```

Expected: the complete bounded fixture passes; every missing, tampered, escaped, sensitive, non-monotonic, or identity-contradictory evidence set fails.

### [REVIEW_REVIEW_REVIEW_REVIEW_TEST-4] Produce a Self-Contained Exact-Source Field Evidence Set

#### Problem

`agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/logged-smoke-manifest.json:1` references 13 evidence files that are not promoted, and its isolated source object is unavailable in the declared checkout. The existing artifact therefore cannot independently prove S14.

#### Solution

After local checks pass, materialize the exact reviewed source in a clean isolated checkout available to both local and field verification, transfer/sync that exact identity, rebuild on Darwin, and run the authenticated two-project lifecycle. Restart at the live checkpoint required by item 3. Copy the manifest and all 13 allowlisted redacted JSON evidence files below into the task directory, validate them in place, and update both contracts and review evidence with actual commands/stdout. Do not copy provider streams, config secrets, home paths, or other runner files.

#### Modified Files and Checklist

- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/logged-smoke-manifest.json` — replace the non-self-contained manifest with the fresh exact-source field manifest.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/build-evidence.json` — promote bounded source/build identity evidence.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/discovery-quota.json` — promote bounded discovery/quota evidence.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/preview-evidence.json` — promote bounded preview evidence.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/start-evidence.json` — promote bounded manual-start evidence.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/cancellation-evidence.json` — promote exact cancellation/sibling identity evidence.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/locator-a.json` — promote project A invocation locator revisions.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/locator-b.json` — promote project B invocation locator revisions.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/restart-evidence.json` — promote derived live restart/no-duplicate evidence.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/project-log-a.json` — promote bounded project A ordered log evidence.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/project-log-b.json` — promote bounded project B ordered log evidence.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/archive-a.json` — promote bounded project A terminal archive evidence.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/archive-b.json` — promote bounded project B terminal archive evidence.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/terminal-evidence.json` — promote terminal completion evidence.
- [ ] `agent-contract/inner/agent-runtime.md` — record the failure-context handoff after its regression passes.
- [ ] `agent-contract/inner/iop-agent-cli-runtime.md` — replace non-verifiable S10/S14 claims with exact test and field evidence.
- [ ] `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/CODE_REVIEW-cloud-G10.md` — record actual local/field output and any exact blocker.

#### Test Strategy

This is required external verification, not a mocked test. PASS requires Darwin, one locally and remotely verifiable source/tree identity, a freshly rebuilt binary, authenticated provider profiles, two clean projects, exact cancellation isolation, a new invocation, a live restart checkpoint with no duplicate process, terminal archives, in-place evidence digest validation, and redaction.

#### Verification

```bash
jq -e . agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/logged-smoke-manifest.json >/dev/null
scripts/e2e-iop-agent-logged-smoke.sh \
  --validate-manifest agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/logged-smoke-manifest.json
if rg -n -i 'authorization|bearer|api[_-]?key|credential|secret|token|/Users/|/home/' \
  agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/*.json; then
  exit 1
fi
```

Expected: validation recomputes schema and all 13 evidence digests, every file has a bounded allowed shape, source/build/clone identities agree, and the redaction scan is empty.

## Dependencies and Execution Order

Implement item 1 before item 2 so the app lifecycle exercises corrected continuation. Implement item 3 before item 4 so the field run emits the final evidence contract. Run all local verification before external mutation.

## Modified Files Summary

| File | Item |
|------|------|
| `packages/go/agenttask/ports.go` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-1 |
| `packages/go/agenttask/dispatch.go` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-1 |
| `packages/go/agenttask/failure_continuation_test.go` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-1 |
| `apps/agent/internal/taskloop/module.go` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-1, REVIEW_REVIEW_REVIEW_REVIEW_TEST-2 |
| `apps/agent/internal/taskloop/module_test.go` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-1, REVIEW_REVIEW_REVIEW_REVIEW_TEST-2 |
| `apps/agent/cmd/agent/main.go` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-2 |
| `apps/agent/cmd/agent/main_test.go` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-2 |
| `apps/agent/internal/bootstrap/module.go` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-2 |
| `apps/agent/internal/bootstrap/module_test.go` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-2 |
| `scripts/e2e-iop-agent-logged-smoke.sh` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-3 |
| `scripts/fixtures/iop-agent-smoke-manifest.schema.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-3 |
| `Makefile` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-3 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/logged-smoke-manifest.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/build-evidence.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/discovery-quota.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/preview-evidence.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/start-evidence.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/cancellation-evidence.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/locator-a.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/locator-b.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/restart-evidence.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/project-log-a.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/project-log-b.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/archive-a.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/archive-b.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/terminal-evidence.json` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-contract/inner/agent-runtime.md` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-1, REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-contract/inner/iop-agent-cli-runtime.md` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-2, REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |
| `agent-task/m-iop-agent-cli-runtime/25+19,21,22,23,24_logged_smoke_closure/CODE_REVIEW-cloud-G10.md` | REVIEW_REVIEW_REVIEW_REVIEW_TEST-4 |

## Final Verification

Use fresh Go execution; cached success is not acceptable.

```bash
gofmt -w \
  packages/go/agenttask/ports.go \
  packages/go/agenttask/dispatch.go \
  packages/go/agenttask/failure_continuation_test.go \
  apps/agent/internal/taskloop/module.go \
  apps/agent/internal/taskloop/module_test.go \
  apps/agent/cmd/agent/main.go \
  apps/agent/cmd/agent/main_test.go \
  apps/agent/internal/bootstrap/module.go \
  apps/agent/internal/bootstrap/module_test.go
GOTMPDIR=/tmp/g go test -count=1 ./packages/go/agenttask ./apps/agent/internal/taskloop ./apps/agent/cmd/agent ./apps/agent/internal/bootstrap ./apps/agent/internal/command
GOTMPDIR=/tmp/g go test -count=1 -race ./packages/go/agenttask ./apps/agent/internal/taskloop ./apps/agent/cmd/agent ./apps/agent/internal/bootstrap ./packages/go/agentstate
go vet ./packages/go/agenttask ./apps/agent/internal/taskloop ./apps/agent/cmd/agent ./apps/agent/internal/bootstrap
bash -n scripts/e2e-iop-agent-logged-smoke.sh
make test-iop-agent-logged-smoke-preflight
make -n test-iop-agent-logged-smoke
make build-agent
GOOS=darwin GOARCH=arm64 go build -trimpath -o /tmp/iop-agent-review-darwin-arm64 ./apps/agent/cmd/agent
GOTMPDIR=/tmp/g go test -count=1 ./...
git diff --check
```

Expected: all commands exit 0; failure-specific policy regressions pass; CLI/daemon tests run the full manager lifecycle with fake ports and no real provider CLI; self-test rejects actual missing/tampered evidence and false restart identities; the full repository remains green.

Then run the external preflight and exact-source authenticated Darwin field execution from item 4. Copy the manifest and exactly the 13 allowlisted evidence files to the deterministic task paths, validate the copied set in place, and run the redaction scan. PASS requires the self-contained field evidence set; a synthetic fixture, terminal-only restart, missing locator, unavailable source object, or summarized output is insufficient.

After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`.
