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

# Standalone Agent Go/state surface 제거

## For the Implementing Agent

`CODE_REVIEW-cloud-G07.md`의 implementation-owned 섹션 작성은 필수다. encoded predecessor의 exact PASS를 확인하고 이 child 범위만 구현·검증한다. active pair를 유지해 review 준비 완료를 보고하며 finalization은 code-review agent만 수행한다. 차단되면 질문하거나 상태를 분류하지 말고 blocker, 실제 명령/출력, 재개 조건만 evidence 필드에 기록한다.

## Background

검증된 bundle 이후 manifest의 `transfer`/`remove` 중 이 child가 소유하는 standalone Go workflow, state, host, config, proto, smoke subset만 제거한다. Contract/spec/UI와 transitional generic runtime/provider는 후속 child가 소유한다.

## Analysis

### Files Read

- `agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md`
- `agent-roadmap/sdd/automation-runtime-bridge/iop-agent-chronos-extraction-decoupling/SDD.md`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/06+04,05_bundle_verification/PLAN-cloud-G10.md`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/07+06_remove_go_surface/plan_cloud_G09_0.log`
- `apps/agent/cmd/agent/main.go`
- `packages/go/agentruntime/types.go`
- `packages/go/agentprovider/cli/cli.go`
- `cmd/iop-provider-smoke/main.go`
- `cmd/iop-provider-smoke/main_test.go`

### SDD Criteria

- SDD `agent-roadmap/sdd/automation-runtime-bridge/iop-agent-chronos-extraction-decoupling/SDD.md`는 `[승인됨]`, 잠금 `해제` 상태다.
- 첫 줄 `milestone-task=decouple`의 target은 Acceptance Scenario `S03`과 Milestone Task `decouple`이며, Evidence Map row는 removed-path/reference audit와 IOP clean build를 요구한다.
- 이 child는 그 row의 source/runtime 삭제 절반을 manifest remove rows, dependent smoke entrypoint 제거, generic package 예외와 fresh full Go regression으로 구체화한다.

### Verification Context

- Handoff는 없다. Milestone, 승인 SDD, 보존된 parent plan과 삭제/보존 package 및 provider-smoke imports를 읽었고 predecessor `06+04,05_bundle_verification`의 exact PASS `complete.log`는 missing이다.
- `cmd/iop-provider-smoke`가 제거 대상 `agentconfig`/catalog를 직접 import하므로 `main.go`와 `main_test.go`를 같은 transaction에서 삭제하지 않으면 `go test -count=1 ./...`가 실패한다.
- 외부 서비스는 필요 없다. Confidence는 high이며 manifest disposition mismatch 또는 bundle evidence 부재는 구현 blocker다.

### Test Coverage Gaps

- 삭제 신규 test는 없다. manifest absence, generic exception, fresh full Go test로 검증한다.

### Symbol References

- apps/agent, agenttask/config/guard/policy/state/workspace/catalog은 제거하고 agentruntime 및 agentprovider/cli는 유지한다.

### Split Judgment

- 안정 계약은 standalone Go/state surface 부재와 임시 generic package의 build 가능성이다.
- Predecessor `06`의 active/archived exact PASS `complete.log`는 missing이다. PASS evidence는 manifest remove rows와 provider smoke 부재, generic exceptions 존재, full fresh Go PASS다.

### Scope Rationale

- build/contract/spec/docs와 UI 정리는 후속 children이 소유한다.

### Final Routing

- `evaluation_mode=isolated-reassessment`, finalizer=`finalize-task-policy.sh`, mode=`pair`.
- Build closures 모두 true. Scores=`2,1,2,1,1`, grade=`G07`, base/route=`local-fit`, lane=`local`.
- Review closures 모두 true. Scores=`2,1,2,1,1`, route=`official-review`, lane=`cloud`, grade=`G07`.
- `large_indivisible_context=false`; positive loop risks=`boundary_contract` (1); `review_rework_count=0`; `evidence_integrity_failure=false`; capability gap 없음.
- Canonical files: `PLAN-local-G07.md`, `CODE_REVIEW-cloud-G07.md`.

## Dependencies and Execution Order

1. `06+04,05_bundle_verification` must each have exactly one matching PASS `complete.log`; all are currently missing.
2. Resolve only those exact predecessor completion artifacts, then implement this child scope.

## Implementation Checklist

- [ ] Refuse to start until predecessor 06+04,05_bundle_verification has an exact PASS complete.log and matching real-state bundle evidence.
- [ ] 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.
- [ ] Run removed-path, generic-exception, and fresh Go regression checks.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REFACTOR-1] Standalone Go workflow/state/runtime surface 삭제

**Problem**

`SDD.md:117-119`의 transfer-after-remove source가 IOP application source of truth로 남아 있어 ownership이 중복된다.

```text
# agent-roadmap/sdd/.../SDD.md:117-119
apps/agent/** and workflow/state packages -> transfer 후 remove
```

**Solution**

predecessor manifest에서 이 child가 소유하는 140개 row가 모두 `transfer`/`remove`인지 먼저 확인한 뒤 `apps/agent`, workflow/config/policy/state/workspace/catalog packages, local-control proto/config/smoke를 삭제한다. 제거되는 `agentconfig`와 `agentprovider/catalog`을 직접 import하는 `cmd/iop-provider-smoke` 전체도 이 transaction에서 삭제한다. Contract/spec/UI row와 `agentruntime`/`agentprovider/cli`는 건드리지 않는다.

```text
# after
apps/agent: absent
packages/go/agenttask: absent
packages/go/agentruntime: present until retain-node
```

**Modified Files and Checklist**

- [ ] Delete every REFACTOR-1 path in Modified Files Summary and no other source path.
- [ ] Verify the manifest classifies all 140 task-owned rows, including both `cmd/iop-provider-smoke` files, as `transfer`/`remove`; stop on a count or disposition mismatch.
- [ ] Preserve `packages/go/agentruntime/**` and `packages/go/agentprovider/cli/**`.

**Test Strategy**

- 신규 test는 생략한다. removed-path audit와 full fresh Go test가 회귀 oracle이다.

**Verification**

- `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'`
- `test ! -e cmd/iop-provider-smoke`
- `test -d packages/go/agentruntime && test -d packages/go/agentprovider/cli`

## Modified Files Summary

| File | Item |
|------|------|
| `apps/agent/cmd/agent/main.go` | REFACTOR-1 |
| `apps/agent/cmd/agent/main_test.go` | REFACTOR-1 |
| `apps/agent/internal/bootstrap/module.go` | REFACTOR-1 |
| `apps/agent/internal/bootstrap/module_test.go` | REFACTOR-1 |
| `apps/agent/internal/clientprocess/manager.go` | REFACTOR-1 |
| `apps/agent/internal/clientprocess/manager_test.go` | REFACTOR-1 |
| `apps/agent/internal/clientprocess/process.go` | REFACTOR-1 |
| `apps/agent/internal/clientprocess/store.go` | REFACTOR-1 |
| `apps/agent/internal/clientprocess/store_test.go` | REFACTOR-1 |
| `apps/agent/internal/clientprocess/types.go` | REFACTOR-1 |
| `apps/agent/internal/command/config_test.go` | REFACTOR-1 |
| `apps/agent/internal/command/root.go` | REFACTOR-1 |
| `apps/agent/internal/command/root_test.go` | REFACTOR-1 |
| `apps/agent/internal/command/service.go` | REFACTOR-1 |
| `apps/agent/internal/command/task_loop.go` | REFACTOR-1 |
| `apps/agent/internal/command/task_loop_test.go` | REFACTOR-1 |
| `apps/agent/internal/host/host.go` | REFACTOR-1 |
| `apps/agent/internal/host/host_test.go` | REFACTOR-1 |
| `apps/agent/internal/host/ports.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/client_operations.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/client_operations_test.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/ledger.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/ledger_test.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/peercred.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/peercred_darwin.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/peercred_linux.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/peercred_unsupported.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/protocol.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/protocol_test.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/server.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/server_test.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/service.go` | REFACTOR-1 |
| `apps/agent/internal/localcontrol/service_test.go` | REFACTOR-1 |
| `apps/agent/internal/projectlog/record.go` | REFACTOR-1 |
| `apps/agent/internal/projectlog/record_test.go` | REFACTOR-1 |
| `apps/agent/internal/projectlog/sink.go` | REFACTOR-1 |
| `apps/agent/internal/projectlog/sink_test.go` | REFACTOR-1 |
| `apps/agent/internal/projectlog/store.go` | REFACTOR-1 |
| `apps/agent/internal/projectlog/store_test.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/cutover_test.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/evidence.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/evidence_test.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/integration.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/integration_test.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/module.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/module_test.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/parity.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/parity_test.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/provider.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/provider_test.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/recovery.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/recovery_test.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/review.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/review_test.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/testdata/parity.yaml` | REFACTOR-1 |
| `apps/agent/internal/taskloop/workflow.go` | REFACTOR-1 |
| `apps/agent/internal/taskloop/workflow_test.go` | REFACTOR-1 |
| `configs/iop-agent.local.example.yaml` | REFACTOR-1 |
| `configs/iop-agent.providers.yaml` | REFACTOR-1 |
| `configs/iop-agent.runtime.yaml` | REFACTOR-1 |
| `cmd/iop-provider-smoke/main.go` | REFACTOR-1 |
| `cmd/iop-provider-smoke/main_test.go` | REFACTOR-1 |
| `packages/go/agentconfig/catalog.go` | REFACTOR-1 |
| `packages/go/agentconfig/catalog_test.go` | REFACTOR-1 |
| `packages/go/agentconfig/default_catalog_test.go` | REFACTOR-1 |
| `packages/go/agentconfig/load.go` | REFACTOR-1 |
| `packages/go/agentconfig/runtime_config.go` | REFACTOR-1 |
| `packages/go/agentconfig/runtime_config_test.go` | REFACTOR-1 |
| `packages/go/agentconfig/testdata/dangling-model.yaml` | REFACTOR-1 |
| `packages/go/agentconfig/testdata/dangling-profile.yaml` | REFACTOR-1 |
| `packages/go/agentconfig/testdata/duplicate-provider.yaml` | REFACTOR-1 |
| `packages/go/agentconfig/testdata/invalid-capability.yaml` | REFACTOR-1 |
| `packages/go/agentconfig/testdata/valid.yaml` | REFACTOR-1 |
| `packages/go/agentconfig/validate.go` | REFACTOR-1 |
| `packages/go/agentconfig/watcher.go` | REFACTOR-1 |
| `packages/go/agentguard/admission_integration_test.go` | REFACTOR-1 |
| `packages/go/agentguard/blocker.go` | REFACTOR-1 |
| `packages/go/agentguard/blocker_test.go` | REFACTOR-1 |
| `packages/go/agentguard/canonical.go` | REFACTOR-1 |
| `packages/go/agentguard/containment.go` | REFACTOR-1 |
| `packages/go/agentguard/gitmeta.go` | REFACTOR-1 |
| `packages/go/agentguard/notification.go` | REFACTOR-1 |
| `packages/go/agentguard/permit.go` | REFACTOR-1 |
| `packages/go/agentguard/types.go` | REFACTOR-1 |
| `packages/go/agentpolicy/decision.go` | REFACTOR-1 |
| `packages/go/agentpolicy/evaluator.go` | REFACTOR-1 |
| `packages/go/agentpolicy/evaluator_test.go` | REFACTOR-1 |
| `packages/go/agentpolicy/failure_policy.go` | REFACTOR-1 |
| `packages/go/agentpolicy/failure_policy_test.go` | REFACTOR-1 |
| `packages/go/agentpolicy/quota.go` | REFACTOR-1 |
| `packages/go/agentprovider/catalog/discovery.go` | REFACTOR-1 |
| `packages/go/agentprovider/catalog/discovery_test.go` | REFACTOR-1 |
| `packages/go/agentprovider/catalog/factory.go` | REFACTOR-1 |
| `packages/go/agentprovider/catalog/lifecycle_conformance_test.go` | REFACTOR-1 |
| `packages/go/agentprovider/catalog/readiness.go` | REFACTOR-1 |
| `packages/go/agentprovider/catalog/redact.go` | REFACTOR-1 |
| `packages/go/agentprovider/catalog/redact_test.go` | REFACTOR-1 |
| `packages/go/agentstate/store.go` | REFACTOR-1 |
| `packages/go/agentstate/store_test.go` | REFACTOR-1 |
| `packages/go/agenttask/confinement_dispatch_test.go` | REFACTOR-1 |
| `packages/go/agenttask/dependency.go` | REFACTOR-1 |
| `packages/go/agenttask/dependency_test.go` | REFACTOR-1 |
| `packages/go/agenttask/dispatch.go` | REFACTOR-1 |
| `packages/go/agenttask/failure_continuation_test.go` | REFACTOR-1 |
| `packages/go/agenttask/followup.go` | REFACTOR-1 |
| `packages/go/agenttask/integration.go` | REFACTOR-1 |
| `packages/go/agenttask/integration_queue.go` | REFACTOR-1 |
| `packages/go/agenttask/integration_queue_test.go` | REFACTOR-1 |
| `packages/go/agenttask/intent.go` | REFACTOR-1 |
| `packages/go/agenttask/manager.go` | REFACTOR-1 |
| `packages/go/agenttask/manager_integration_test.go` | REFACTOR-1 |
| `packages/go/agenttask/manager_test.go` | REFACTOR-1 |
| `packages/go/agenttask/ports.go` | REFACTOR-1 |
| `packages/go/agenttask/reconcile.go` | REFACTOR-1 |
| `packages/go/agenttask/review.go` | REFACTOR-1 |
| `packages/go/agenttask/review_test.go` | REFACTOR-1 |
| `packages/go/agenttask/scheduler.go` | REFACTOR-1 |
| `packages/go/agenttask/scheduler_test.go` | REFACTOR-1 |
| `packages/go/agenttask/state_machine.go` | REFACTOR-1 |
| `packages/go/agenttask/state_machine_test.go` | REFACTOR-1 |
| `packages/go/agenttask/test_support_test.go` | REFACTOR-1 |
| `packages/go/agenttask/types.go` | REFACTOR-1 |
| `packages/go/agenttask/workflow.go` | REFACTOR-1 |
| `packages/go/agenttask/workflow_evidence.go` | REFACTOR-1 |
| `packages/go/agenttask/workflow_evidence_test.go` | REFACTOR-1 |
| `packages/go/agentworkspace/change_set.go` | REFACTOR-1 |
| `packages/go/agentworkspace/confinement.go` | REFACTOR-1 |
| `packages/go/agentworkspace/confinement_darwin.go` | REFACTOR-1 |
| `packages/go/agentworkspace/confinement_linux.go` | REFACTOR-1 |
| `packages/go/agentworkspace/confinement_test.go` | REFACTOR-1 |
| `packages/go/agentworkspace/confinement_unsupported.go` | REFACTOR-1 |
| `packages/go/agentworkspace/integrator.go` | REFACTOR-1 |
| `packages/go/agentworkspace/integrator_test.go` | REFACTOR-1 |
| `packages/go/agentworkspace/overlay.go` | REFACTOR-1 |
| `packages/go/agentworkspace/overlay_test.go` | REFACTOR-1 |
| `packages/go/agentworkspace/snapshot.go` | REFACTOR-1 |
| `proto/gen/iop/agent.pb.go` | REFACTOR-1 |
| `proto/iop/agent.proto` | REFACTOR-1 |
| `scripts/e2e-iop-agent-logged-smoke.sh` | REFACTOR-1 |
| `scripts/fixtures/iop-agent-smoke-manifest.schema.json` | REFACTOR-1 |
| `agent-task/m-iop-agent-chronos-extraction-decoupling/07+06_remove_go_surface/CODE_REVIEW-cloud-G07.md` | REFACTOR-1 |

## Final Verification

1. `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)" = 7026fedc8b0eb24eab5c4124d3818400f66db5f1d116a71e7781f346fbd256a7; 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","inventory_source_revision","manifest_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","synthetic_bundle_sha","version"] and .version == 1 and .inventory_source_revision == "3155be0e275437a8eedc1aa93497955a7d30465b" and .manifest_sha == "7026fedc8b0eb24eab5c4124d3818400f66db5f1d116a71e7781f346fbd256a7" and (.synthetic_bundle_sha | test("^[0-9a-f]{64}$")) 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'`
2. `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'`
3. `test ! -e cmd/iop-provider-smoke`
4. `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`
5. `go test -count=1 ./...`

Commands containing `go test -count=1` require fresh output; all other checks are rerun against the current checkout.

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