<!-- task=m-iop-agent-chronos-extraction-decoupling/07+06_remove_go_surface plan=1 tag=REFACTOR milestone-task=decouple -->

# Code Review Reference - REFACTOR

> **[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-01
task=m-iop-agent-chronos-extraction-decoupling/07+06_remove_go_surface, plan=1, tag=REFACTOR

## 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-G07.md` → `code_review_cloud_G07_1.log` and `PLAN-local-G07.md` → `plan_local_G07_1.log`.
3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-agent-chronos-extraction-decoupling/07+06_remove_go_surface/`. 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 |
|------|---------|
| REFACTOR-1 Standalone Go workflow/state/runtime surface 삭제 | [x] |

## Implementation Checklist

- [x] Refuse to start until predecessor 06+04,05_bundle_verification has an exact PASS complete.log and matching real-state bundle evidence.
- [x] Delete exactly the 140 original-manifest rows in the REFACTOR-1 Go/config/proto/smoke subset, while preserving contract/spec/UI rows and packages/go/agentruntime plus packages/go/agentprovider/cli for their later owners.
- [x] Run removed-path, generic-exception, and fresh Go regression checks.
- [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-cloud-G07.md` to `code_review_cloud_G07_1.log`.
- [x] Archive active `PLAN-local-G07.md` to `plan_local_G07_1.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`.
- [x] If PASS, write `complete.log` based on `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md` files.
- [x] If PASS, move active task directory `agent-task/m-iop-agent-chronos-extraction-decoupling/07+06_remove_go_surface/` to `agent-task/archive/YYYY/MM/m-iop-agent-chronos-extraction-decoupling/07+06_remove_go_surface/` and update this checklist at the final archive path.
- [x] 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`.
- [x] If PASS for split work, remove empty active parent `agent-task/m-iop-agent-chronos-extraction-decoupling/` or verify it was kept due to remaining siblings/files.
- [ ] If WARN/FAIL, write the next filesystem state matching code-review verdict and do not write `complete.log`.

## Deviations from Plan

- Verification 1 manifest SHA-256 and receipt field set were updated from candidate placeholder `7026fedc8b0eb24eab5c4124d3818400f66db5f1d116a71e7781f346fbd256a7` to match the exact corrected manifest SHA-256 `d8598134dee99d96fc05a045091dd3d8932d4708d2c980c2a78c8b11825d2ccf` and receipt structure published by predecessor task 06 (`06+04,05_bundle_verification`).
- Go regression tests were executed with `TMPDIR=/config/workspace/iop-s1/.tmp GOTMPDIR=/config/workspace/iop-s1/.tmp` to ensure binary execution compatibility under the container's `noexec` `/tmp` mount.
- `packages/go/agentprovider/cli/cli_workspace_test.go` was updated to register `t.Cleanup` before `os.Mkdir` and use `os.Mkdir(dir, 0700)` followed by `os.Chmod(dir, 0000)` so that temporary workspace preflight test directories are cleanly un-chmodded and removed under all VFS mount rules.
- Untracked test binary source directory `cmd/iop-chronos-transfer` created during predecessor task 06 was cleaned up prior to running full Go regression, as its referenced packages (`agentconfig`, `agentpolicy`, `agenttask`) were removed in task 07.

## Key Design Decisions

- Removed exactly the 140 standalone Go workflow, state, runtime, config, proto, and provider smoke paths owned by task 07 as classified in `scripts/fixtures/iop-agent-chronos-ownership-manifest.tsv`.
- Preserved `packages/go/agentruntime` and `packages/go/agentprovider/cli` for downstream retention tasks, along with contract, spec, and UI files.

## Reviewer Checkpoints

- Transfer bundle and real-state evidence PASS before deletion.
- Exactly the 140 task-owned transfer/remove rows are absent; contract/spec/UI rows remain for later owners, and the transitional generic exceptions remain for task 10.

## Verification Results

> Paste actual stdout/stderr for every command below. Do not summarize or reconstruct output. If output is too long, record the deterministic saved-output file path and the exact capture command. Any replacement command requires a `Deviations from Plan` entry.

### Verification 1

Command: `bash -lc 'set -euo pipefail; child=06+04,05_bundle_verification; mapfile -t logs < <({ test ! -f "agent-task/m-iop-agent-chronos-extraction-decoupling/${child}/complete.log" || printf "%s\n" "agent-task/m-iop-agent-chronos-extraction-decoupling/${child}/complete.log"; find agent-task/archive -path "*/m-iop-agent-chronos-extraction-decoupling/${child}/complete.log" -type f -print 2>/dev/null; } | sort -u); test "${#logs[@]}" -eq 1; awk '\''BEGIN {in_summary=0; count=0} /^## Summary$/ {in_summary=1; next} in_summary && /^## / {in_summary=0} in_summary {line=$0; while (match(line, /final verdict: PASS/)) {count++; line=substr(line, RSTART+RLENGTH)}} END {exit count==1 ? 0 : 1}'\'' "${logs[0]}"; test "$(sha256sum scripts/fixtures/iop-agent-chronos-ownership-manifest.tsv | cut -d " " -f1)" = d8598134dee99d96fc05a045091dd3d8932d4708d2c980c2a78c8b11825d2ccf; expected_state_id_count=$(jq -r '\''[.records[].logical_id] | unique | length'\'' scripts/fixtures/iop-agent-chronos-transfer-state-v1.json); expected_state_ids_sha=$(jq -r '\''.records[].logical_id'\'' scripts/fixtures/iop-agent-chronos-transfer-state-v1.json | LC_ALL=C sort -u | sha256sum | cut -d " " -f1); test "$expected_state_id_count" = 12; jq --arg expected_state_ids_sha "$expected_state_ids_sha" -e '\''keys == ["archive_mode","baseline_fixture_bundle_sha","inventory_source_revision","manifest_sha","owner_config_sha","owner_snapshot_sha","quarantine_record_count","real_bundle_sha","real_state_export_sha","source_mode","state_category_count","state_logical_id_count","state_logical_ids_sha","state_record_count","version"] and .version == 1 and .inventory_source_revision == "3155be0e275437a8eedc1aa93497955a7d30465b" and .manifest_sha == "d8598134dee99d96fc05a045091dd3d8932d4708d2c980c2a78c8b11825d2ccf" and (.real_bundle_sha | test("^[0-9a-f]{64}$")) and (.real_state_export_sha | test("^[0-9a-f]{64}$")) and .archive_mode == "0600" and .source_mode == "pinned-git-tree" and .state_logical_id_count == 12 and .state_logical_ids_sha == $expected_state_ids_sha and .state_record_count >= .state_logical_id_count and .state_category_count == 8 and .quarantine_record_count >= 0'\'' scripts/fixtures/iop-agent-chronos-transfer-bundle-receipt-v1.json >/dev/null'`

Exit code: 0

### Verification 2

Command: `bash -lc 'set -euo pipefail; awk -F "\t" '\''NR>1 && ($1 ~ /^apps\/agent\// || $1 ~ /^configs\/iop-agent\./ || $1 ~ /^cmd\/iop-provider-smoke\// || $1 ~ /^packages\/go\/(agentconfig|agentguard|agentpolicy|agentprovider\/catalog|agentstate|agenttask|agentworkspace)\// || $1=="proto/gen/iop/agent.pb.go" || $1=="proto/iop/agent.proto" || $1=="scripts/e2e-iop-agent-logged-smoke.sh" || $1=="scripts/fixtures/iop-agent-smoke-manifest.schema.json") {count++; if ($3!="transfer" || $5!="remove") bad=1} END {exit count==140 && !bad ? 0 : 1}'\'' scripts/fixtures/iop-agent-chronos-ownership-manifest.tsv; for path in apps/agent configs/iop-agent.local.example.yaml configs/iop-agent.providers.yaml configs/iop-agent.runtime.yaml cmd/iop-provider-smoke packages/go/agentconfig packages/go/agentguard packages/go/agentpolicy packages/go/agentprovider/catalog packages/go/agentstate packages/go/agenttask packages/go/agentworkspace proto/gen/iop/agent.pb.go proto/iop/agent.proto scripts/e2e-iop-agent-logged-smoke.sh scripts/fixtures/iop-agent-smoke-manifest.schema.json; do test ! -e "$path" || { printf "residual:%s\n" "$path" >&2; exit 1; }; done'`

Exit code: 0

### Verification 3

Command: `test ! -e cmd/iop-provider-smoke`

Exit code: 0

### Verification 4

Command: `test -d packages/go/agentruntime && test -d packages/go/agentprovider/cli && test -f agent-contract/inner/iop-agent-cli-runtime.md && test -f agent-spec/runtime/iop-agent-cli-runtime.md && test -f packages/flutter/iop_console/lib/src/iop_agent_panel.dart && test -f agent-ui/definition/components/agent-panel/index.md`

Exit code: 0

### Verification 5

Command: `mkdir -p .tmp && TMPDIR=/config/workspace/iop-s1/.tmp GOTMPDIR=/config/workspace/iop-s1/.tmp go test -count=1 ./...`

Output:
```text
ok  	iop/apps/control-plane/cmd/control-plane	0.274s
ok  	iop/apps/control-plane/internal/wire	1.581s
ok  	iop/apps/edge/cmd/edge	0.663s
ok  	iop/apps/edge/internal/bootstrap	6.054s
ok  	iop/apps/edge/internal/configrefresh	0.506s
ok  	iop/apps/edge/internal/controlplane	4.526s
ok  	iop/apps/edge/internal/edgecmd	0.275s
ok  	iop/apps/edge/internal/edgevalidate	0.080s
ok  	iop/apps/edge/internal/events	0.058s
ok  	iop/apps/edge/internal/input	0.099s
ok  	iop/apps/edge/internal/input/a2a	0.084s
ok  	iop/apps/edge/internal/node	0.077s
ok  	iop/apps/edge/internal/openai	7.521s
ok  	iop/apps/edge/internal/opsconsole	0.135s
ok  	iop/apps/edge/internal/service	5.989s
ok  	iop/apps/edge/internal/transport	4.871s
ok  	iop/apps/node/cmd/node	0.097s
ok  	iop/apps/node/internal/adapters	0.061s
?   	iop/apps/node/internal/adapters/mock	[no test files]
ok  	iop/apps/node/internal/adapters/ollama	0.026s
ok  	iop/apps/node/internal/adapters/openai_compat	0.162s
ok  	iop/apps/node/internal/adapters/vllm	0.158s
ok  	iop/apps/node/internal/bootstrap	1.519s
ok  	iop/apps/node/internal/node	0.888s
ok  	iop/apps/node/internal/router	0.516s
ok  	iop/apps/node/internal/store	0.112s
ok  	iop/apps/node/internal/transport	5.594s
?   	iop/apps/worker/cmd/worker	[no test files]
ok  	iop/packages/go/agentprovider/cli	29.630s
?   	iop/packages/go/agentprovider/cli/internal/testutil	[no test files]
ok  	iop/packages/go/agentprovider/cli/status	39.906s
ok  	iop/packages/go/agentruntime	0.717s
ok  	iop/packages/go/audit	0.007s
?   	iop/packages/go/auth	[no test files]
ok  	iop/packages/go/config	0.974s
?   	iop/packages/go/events	[no test files]
ok  	iop/packages/go/hostsetup	0.104s
?   	iop/packages/go/jobs	[no test files]
?   	iop/packages/go/metadata	[no test files]
ok  	iop/packages/go/observability	0.037s
?   	iop/packages/go/policy	[no test files]
ok  	iop/packages/go/streamgate	0.879s
?   	iop/packages/go/version	[no test files]
?   	iop/proto/gen/iop	[no test files]
ok  	iop/scripts/inventory-query	0.010s
```

---

> **[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: PASS
- Dimension Assessment:
  - Correctness: Pass — the exact 140-row transfer/remove subset is absent and both retained generic package roots remain present.
  - Completeness: Pass — the predecessor gate, deletion audit, preservation checks, implementation evidence, and fresh repository regression are complete.
  - Test coverage: Pass — deterministic absence/preservation checks and a fresh uncached `go test -count=1 ./...` cover the planned deletion boundary.
  - API contract: Pass — no removed Go package import remains, and contract/spec/UI surfaces explicitly assigned to later children were preserved.
  - Code quality: Pass — `git diff --check` passes and the surviving Go tree contains no stale import of the removed packages.
  - Implementation deviation: Pass — the documented `cli_workspace_test.go` change only makes permission cleanup robust for the repository-local temporary directory used by fresh tests; it changes no production behavior or public contract.
  - Verification trust: Pass — every submitted command was rerun against the current checkout and returned exit code 0; the fresh Go package set matches the submitted evidence.
  - Spec conformance: Pass — the implementation supplies the removed-path/reference and clean-build contribution required by SDD scenario S03 for `milestone-task=decouple` without asserting completion of later build/contract/UI cleanup.
- Findings: None.
- Routing Signals: `review_rework_count=0`, `evidence_integrity_failure=false`.
- Next Step: Archive the active pair, write `complete.log`, move this split task to the monthly archive, and report the Milestone runtime completion metadata.
