<!-- task=m-iop-agent-chronos-extraction-decoupling/08+07_cleanup_build_contract plan=0 tag=REFACTOR -->

# Standalone build·contract·spec·문서 정리

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

삭제된 standalone runtime을 계속 광고하는 build target, proto generation, dependencies, contract/spec/rule/document source-of-truth를 정리한다.

## Analysis

### Files Read

- `Makefile`
- `go.mod`
- `go.sum`
- `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/07+06_remove_go_surface/plan_cloud_G09_0.log`
- `agent-contract/index.md`
- `agent-contract/inner/iop-agent-cli-runtime.md`
- `agent-spec/index.md`
- `agent-spec/runtime/iop-agent-cli-runtime.md`
- `README.md`
- `HANDOFF.md`

### SDD Criteria

- SDD `agent-roadmap/sdd/automation-runtime-bridge/iop-agent-chronos-extraction-decoupling/SDD.md`는 `[승인됨]`, 잠금 `해제` 상태다.
- Target은 Acceptance Scenario `S03`과 Milestone Task `decouple`; Evidence Map row는 removed-path/reference audit와 IOP clean build를 요구한다.
- 이 child는 삭제된 source와 build/contract/spec/rule/index 간 불일치를 정리하고 proto/tidy/idempotency 및 active-reference Final Verification으로 그 row의 governance 절반을 닫는다.

### Verification Context

- Handoff는 없다. Milestone, 승인 SDD, 보존된 parent plan과 current build/contract/spec/docs를 읽었고 predecessor `07+06_remove_go_surface`의 exact PASS `complete.log`는 missing이다.
- gap은 삭제 후 stale build targets, proto generation, contract/spec/index pointers다. `update-contract`/`update-spec` 책임 경계를 따르고 common rule 영역은 수정하지 않는다.
- 외부 서비스는 필요 없다. Confidence는 high이며 fresh Go tests와 deterministic reference scans가 closure 기준이다.

### Test Coverage Gaps

- 새 test는 없다. proto/tidy idempotency, active index scan, fresh Go test로 검증한다.

### Symbol References

- build-agent, test-iop-agent, iop.agent-cli-runtime active index와 standalone rule/spec pointers를 제거한다.

### Split Judgment

- 안정 계약은 IOP build/governance surface가 삭제된 Go tree와 일치하는 것이다.
- Predecessor `07`의 active/archived exact PASS `complete.log`는 missing이다. PASS evidence는 proto/tidy idempotency, stale active pointer 0와 fresh Go PASS다.

### Scope Rationale

- Flutter/agent-ui 제거와 최종 decouple closure는 다음 child에 둔다.

### Final Routing

- `evaluation_mode=isolated-reassessment`, finalizer=`finalize-task-policy.sh`, mode=`pair`.
- Build closures 모두 true. Scores=`2,0,2,1,2`, grade=`G07`, base/route=`local-fit`, lane=`local`.
- Review closures 모두 true. Scores=`2,0,2,1,2`, 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. `07+06_remove_go_surface` 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 07+06_remove_go_surface has an exact PASS complete.log.
- [ ] Remove standalone build/proto targets and reconcile dependencies, contracts, specs, rules, README, and HANDOFF exactly as the original REFACTOR-2 scope specifies.
- [ ] Keep the legacy standalone contract unindexed and transfer-reference-only until the handoff cleanup.
- [ ] Run proto, tidy, active-reference, fresh Go, and diff checks.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REFACTOR-2] Build, proto, contract, spec, rule, document 정리

**Problem**

binary/source를 지워도 Makefile target, proto generation, dependency, active contract/spec/domain 문서가 남으면 IOP가 계속 standalone ownership을 광고한다.

```make
# Makefile:1,40-43,119-145
build-agent
test-iop-agent-*
```

**Solution**

agent build/smoke/proto entry를 제거하고 `go mod tidy`로 orphan dependency를 정리한다. standalone spec/domain 문서는 삭제하고 contract는 active index에서 제거한 뒤 `transfer-reference-only` banner와 bundle digest placeholder만 남겨 handoff gate가 최종 삭제하게 한다. README/HANDOFF/rules는 bundle receipt 및 downstream ownership reference만 남긴다. shared runtime contract/spec은 다음 retain-node plan이 neutral path로 갱신한다.

```text
# after
Makefile has no build-agent or test-iop-agent-* target.
agent-contract/index.md has no iop.agent-cli-runtime active row.
agent-contract/inner/iop-agent-cli-runtime.md is unindexed transfer-reference-only until handoff.
```

**Modified Files and Checklist**

- [ ] Update/delete every REFACTOR-2 path in Modified Files Summary.
- [ ] Keep Milestone/SDD and transfer receipt references as governance evidence, not active runtime instructions.

**Test Strategy**

- generated proto consistency, `go mod tidy` idempotency, active index link checks를 수행한다.

**Verification**

- `make proto && go mod tidy && git diff --check`
- `test -z "$(rg --sort path -n 'build-agent|test-iop-agent|proto/iop/agent\.proto|iop\.agent-cli-runtime' Makefile agent-contract/index.md agent-spec/index.md agent-ops/rules/project README.md apps/client/README.md)"`

## Modified Files Summary

| File | Item |
|------|------|
| `Makefile` | REFACTOR-2 |
| `README.md` | REFACTOR-2 |
| `HANDOFF.md` | REFACTOR-2 |
| `go.mod` | REFACTOR-2 |
| `go.sum` | REFACTOR-2 |
| `agent-contract/index.md` | REFACTOR-2 |
| `agent-contract/inner/iop-agent-cli-runtime.md` | REFACTOR-2 |
| `agent-spec/index.md` | REFACTOR-2 |
| `agent-spec/runtime/iop-agent-cli-runtime.md` | REFACTOR-2 |
| `agent-ops/rules/project/rules.md` | REFACTOR-2 |
| `agent-ops/rules/project/domain/agent/rules.md` | REFACTOR-2 |
| `agent-ops/rules/project/domain/client/rules.md` | REFACTOR-2 |
| `agent-ops/rules/project/domain/testing/rules.md` | REFACTOR-2 |
| `scripts/readability_baseline.json` | REFACTOR-2 |
| `scripts/readability_read_sets.json` | REFACTOR-2 |
| `agent-task/m-iop-agent-chronos-extraction-decoupling/08+07_cleanup_build_contract/CODE_REVIEW-cloud-G07.md` | REFACTOR-2 |

## Final Verification

1. Confirm exact PASS `complete.log` for `07+06_remove_go_surface`.
2. `make proto && go mod tidy && git diff --check`
3. `test -z "$(rg --sort path -n 'build-agent|test-iop-agent|proto/iop/agent\.proto|iop\.agent-cli-runtime' Makefile agent-contract/index.md agent-spec/index.md agent-ops/rules/project README.md apps/client/README.md)"`
4. `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`.
