<!-- task=m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close plan=1 tag=REFACTOR -->

# Flutter Agent surface 제거와 S03 기여 evidence

## For the Implementing Agent

`CODE_REVIEW-cloud-G08.md`의 implementation-owned 섹션 작성은 필수다. encoded predecessor의 exact PASS를 확인한 뒤 이 child 범위만 구현·검증하고 실제 출력과 결정을 review stub에 기록한다. active pair를 유지해 review 준비 완료를 보고하며 finalization은 code-review agent만 수행한다. 차단되면 질문하거나 상태를 분류하지 말고 blocker, 시도한 명령/출력, 재개 조건만 implementation-owned evidence 필드에 기록한다. 사용자 입력 도구, control-plane stop file, archive finalization, `complete.log`는 만들지 않는다.

## Background

Flutter Agent rail/panel/capability/dependency와 이를 현재 IOP 책임으로 설명하는 UI 문서·client 규칙을 함께 제거해야 standalone client surface가 닫힌다. IOP client에는 Control Plane을 통한 model/provider/device 운영 UI만 남기고, loop/agent/workspace/tool/terminal/PTY/remote control UI는 Chronos 책임으로 이전한다. 이 child는 S03 `decouple`에 필요한 UI/source/build evidence를 생산하지만, task 10이 transitional shared runtime/provider disposition을 닫고 그 evidence를 통합하기 전에는 Milestone Task completion을 보고하지 않는다.

## Archive Evidence Snapshot

- 이전 pair `plan_local_G08_0.log`, `code_review_cloud_G08_0.log`에는 구현 evidence/verdict, Required/Suggested/Nit, 실행된 verification이 없다.
- 이전 pair의 Flutter/agent-ui 삭제 범위를 D04의 Chronos Server/Chronos Node 책임 경계와 client rule/README 동시 정리 기준으로 재계획했다.
- Milestone evidence carryover는 S03 UI/source 부재, removed-path/reference audit와 IOP clean build다. 03 manifest는 historical snapshot이며 이 child가 수정하지 않는다.
- 필요한 prior-loop 사실은 위에 모두 적었으므로 archive를 다시 읽지 않는다.

## Analysis

### Files Read

- `agent-roadmap/phase/automation-runtime-bridge/PHASE.md`
- `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-ui/.sync-state.json`
- `agent-ui/README.md`
- `agent-ui/definition/index.md`
- `agent-ui/definition/views/index.md`
- `agent-ui/definition/views/agent/index.md`
- `agent-ui/definition/components/index.md`
- `agent-ui/definition/components/agent-panel/index.md`
- `agent-ui/definition/components/console-shell/index.md`
- `agent-ui/definition/components/command-action-bar/index.md`
- `apps/client/Dockerfile`
- `apps/client/README.md`
- `apps/client/lib/client_home_page.dart`
- `apps/client/lib/main.dart`
- `apps/client/pubspec.yaml`
- `apps/client/pubspec.lock`
- `apps/client/test/app_shell_test.dart`
- `packages/flutter/iop_console/lib/iop_console.dart`
- `packages/flutter/iop_console/lib/src/iop_agent_panel.dart`
- `packages/flutter/iop_console/lib/src/iop_console_contract.dart`
- `packages/flutter/iop_console/lib/src/iop_console_shell.dart`
- `packages/flutter/iop_console/pubspec.yaml`
- `packages/flutter/iop_console/test/iop_console_shell_test.dart`
- `agent-ops/rules/project/domain/client/rules.md`
- `agent-ops/rules/project/domain/testing/rules.md`
- `agent-test/local/client-smoke.md`

### SDD Criteria

- SDD는 `[승인됨]`, 잠금 `해제`다. 이 child는 Acceptance Scenario `S03`와 Milestone Task `decouple`에 UI/source/build evidence를 기여하지만 Roadmap completion target은 갖지 않는다.
- Evidence Map은 removed-path/reference audit와 IOP clean build를 요구한다. UI rail/source/active definition 부재, Flutter tests/web build, local Go build/full suite, forbidden Chronos connection scan을 10이 소비할 하나의 S03 contribution evidence로 묶는다.
- D04상 Chronos Server/Chronos Node가 loop, agent profile/session, workspace/tool, terminal/PTY와 remote host control을 소유한다. IOP client는 이 surface나 Chronos bridge/API/proto/config/target/registry/control hook을 남기지 않는다.
- 10이 처분할 transitional `agentruntime`/CLI provider/Node bridge는 audit에 `pending_task_10`으로 기록한다. 해당 경로가 남아 있으므로 09 PASS만으로 S03/`decouple`을 완료 처리하지 않으며, 10이 09 evidence와 자체 disposition evidence를 통합한다.

### Verification Context

- handoff 입력은 없다. Flutter source/tests/manifests, client domain/testing rule, active agent-ui graph와 schema v4 sync state를 읽었다.
- `.sync-state.json`에는 exact Milestone의 `pending_milestone_work` 하나가 있고 `console-shell` status path와 client/console code paths를 소유한다. Agent view/component는 `계획`이지만 이번 작업에서 archive되므로 completion status 매핑 대상이 아니다.
- 따라서 `prepare-code-work`는 실행하지 않는다. 기존 Milestone owner와 status path가 겹치며 sync rule이 중복 ownership을 금지한다. `.sync-state.json`은 수동 수정하지 않고 기존 console-shell mapping을 보존한다. Milestone 종료 때 `reconcile-milestone-completion`이 별도 수행된다.
- UI 변경은 `update-agent-ui`로 active Agent view/component를 archive하고 indexes/console-shell을 갱신한 뒤 `validate-agent-ui`로 남은 graph를 검증한다. archive 본문은 분석 중 읽지 않았다.
- 외부 service/credential은 없다. `flutter --version`, `make client-test`, `make client-build-web`, `make build-local`, fresh Go suite가 repository-native evidence다. confidence는 high다.

### Test Coverage Gaps

- 기존 console test가 Agent default panel과 capability injection을 기대하므로 삭제/갱신이 필요하다. remaining rail navigation, narrow/wide layout, execution logs injection은 유지한다.
- app shell test의 Agent open scenario는 제거하고 Agent tooltip/placeholder/capability text 부재를 검증한다.
- 공개 enum/constructor/export 축소는 existing package/client compile과 widget tests가 모든 call site를 포착한다. 별도 test file은 만들지 않는다.

### Symbol References

- `IopAgentPanel`: export, console shell default, client assembly, package/client tests.
- `IopConsoleSection.agent`, `Widget? agent`, `capabilities`: console enum/constructor/switch/rail, client assembly, tests.
- `IopCapability`, `IopCapabilityPack`, `iopDefaultCapabilityPack`: contract, main, home page, tests.
- `agent_shell`: app/package pubspec, app lock, Docker manifest/source copies, `iop_agent_panel.dart`, client README/rule.
- active UI ids `agent`, `agent-panel`: definition/view/component indexes and source documents; `console-shell` references both.

### Split Judgment

- 안정 계약은 “Flutter code, dependency graph, tests, client docs/rules와 active agent-ui graph가 한 번에 standalone Agent surface를 잃고 surviving console navigation은 유지된다”이다.
- predecessor index 08 (`08+07_cleanup_build_contract`)의 exact PASS `complete.log`는 현재 missing이다.
- 이 child PASS는 UI/source/build evidence만 확정하고 Roadmap completion event를 보고하지 않는다. 10이 shared runtime/provider disposition을 닫은 뒤 09 evidence를 통합해 S03/`decouple` completion을 판단한다. 13 effective matrix와 14 final receipt는 그 뒤 별도 task로 남는다.

### Scope Rationale

- RuntimePanel의 기존 `domain-agent` status/command UI는 standalone Agent shell과 다른 Control Plane operation surface이므로 이 child에서 제거하지 않는다. 해당 wire/runtime 중립화는 10 범위다.
- 새 Chronos UI를 만들거나 IOP client에서 Chronos endpoint를 연결하지 않는다.
- `.sync-state.json`은 기존 Milestone mapping이 정확하므로 claim하지 않고 helper 없는 수동 edit를 금지한다.
- agent-ui archive의 기존 본문은 읽지 않으며 exact 새 logs만 update-agent-ui 절차로 만든다.
- root README/HANDOFF는 08, Go runtime/spec/rules는 10, final audit/receipt는 13/14가 소유한다.

### Final Routing

- `evaluation_mode=isolated-reassessment`, `finalizer=finalize-task-policy.sh`, `finalizer_mode=pair`.
- Build closures=`2,1,2,1,2`, grade=`G08`, base/route=`local-fit`, lane=`local`, filename=`PLAN-local-G08.md`.
- Review closures=`2,1,2,1,2`, grade=`G08`, route=`official-review`, lane=`cloud`, adapter=`codex`, model=`gpt-5.6-sol`, reasoning=`xhigh`, filename=`CODE_REVIEW-cloud-G08.md`.
- `large_indivisible_context=false`; positive loop-risk=`boundary_contract`, count=`1`; `review_rework_count=0`; `evidence_integrity_failure=false`; risk/recovery boundary=false; capability gap 없음.

## Dependencies and Execution Order

1. `08+07_cleanup_build_contract`가 active 또는 matching archive 위치에 정확히 하나의 PASS `complete.log`를 만들어야 한다.
2. UI code/dependency/test와 client docs/rule을 수정하고, update-agent-ui → validate-agent-ui 순서로 active UI graph를 정리한다.
3. S03 contribution audit를 기록한 뒤 review evidence를 채운다.

## Implementation Checklist

- [ ] Verify exactly one PASS `complete.log` for predecessor `08+07_cleanup_build_contract` before editing this child.
- [ ] Remove Flutter Agent panel, rail/slot/capability API, app assembly, `agent_shell` dependencies/Docker copies, and update package/client tests for surviving navigation and Agent absence.
- [ ] Remove Agent ownership wording from `apps/client/README.md` and the client domain rule; state the retained Control Plane model/provider/device operations UI boundary and prohibit Chronos/workspace/terminal ownership.
- [ ] Use update-agent-ui to archive the Agent view/component and update indexes/console-shell, then validate the remaining graph without manually editing `.sync-state.json` or duplicating its Milestone mapping.
- [ ] Run Flutter tests/web build, local IOP build, fresh full Go tests, and residual/Chronos-connection scans; write `decoupling-audit.log` as S03 contribution evidence with transitional paths marked `pending_task_10` and completion explicitly deferred to task 10.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REFACTOR-1] Flutter Agent API·dependency·test 제거

**Problem**

`iop_console_shell.dart:3,6-15,24,32,42,48,134-135,213-218`, `client_home_page.dart:152-154,212`, `main.dart:11-34`가 standalone Agent rail/default panel/capability API를 노출한다. pubspec/lock과 `Dockerfile:14,21`은 `agent_shell`을 계속 resolve/copy한다.

```dart
// packages/flutter/iop_console/lib/src/iop_console_shell.dart:6-15
enum IopConsoleSection { overview, edges, nodes, runtime, executionLogs, maintenance, agent, settings }
```

**Solution**

Agent enum/rail/slot/default panel, capability contract/default pack/export를 제거하고 `iop_agent_panel.dart`를 삭제한다. app/package dependency와 Docker copy를 제거해 lockfile을 재생성한다. tests는 smart-toy/Agent surface 부재와 overview/execution logs/settings/narrow-wide navigation 보존을 검증한다.

```dart
// after
enum IopConsoleSection { overview, edges, nodes, runtime, executionLogs, maintenance, settings }
```

**Modified Files and Checklist**

- [ ] `apps/client/Dockerfile`, `pubspec.yaml`, `pubspec.lock` — `agent_shell` 제거.
- [ ] `apps/client/lib/client_home_page.dart`, `main.dart` — capability pack/Agent assembly 제거.
- [ ] `apps/client/test/app_shell_test.dart` — Agent-open scenario를 absence regression으로 교체.
- [ ] `packages/flutter/iop_console/lib/iop_console.dart`, `src/iop_agent_panel.dart`, `src/iop_console_contract.dart`, `src/iop_console_shell.dart`, `pubspec.yaml` — public Agent surface/dependency 제거.
- [ ] `packages/flutter/iop_console/test/iop_console_shell_test.dart` — Agent assertions 제거와 remaining navigation 회귀 유지.

**Test Strategy**

기존 widget tests를 갱신한다. `app_shell_test.dart`는 Agent tooltip/text가 없음을, `iop_console_shell_test.dart`는 remaining sections와 injected execution logs가 정상임을 assertion한다. 기존 fake repositories만 사용한다.

**Verification**

- `make client-test`
- `make client-build-web`

### [REFACTOR-2] Client 문서·rule과 agent-ui graph 동기 제거

**Problem**

`apps/client/README.md:9-13`, client rule `:19,61-62,77,85`, active `views/agent`, `components/agent-panel`, `console-shell`이 제거 대상 UI를 현재/계획 IOP surface로 남긴다.

```text
# apps/client/README.md:9-13
Agent Shell 구성 ... IopAgentPanel ... IOP 운영/유지보수 agent 화면
```

**Solution**

Client README/rule은 Control Plane model/provider/device operation viewer/command UI만 설명하고 AgentShell/workspace/terminal/Chronos connection을 금지한다. update-agent-ui로 Agent view/component 원문을 exact archive log로 이동하고 indexes와 definition root에서 제거한다. console-shell은 Agent reference를 제거한 `계획` 상태로 유지해 existing Milestone pending mapping과 일치시킨 뒤 validate-agent-ui로 graph를 검사한다.

```text
# after active graph
views: overview, edges, nodes, runtime, execution-logs
components: console-shell + retained operation components; no agent-panel
pending_milestone_work.status_paths: console-shell only
```

**Modified Files and Checklist**

- [ ] `apps/client/README.md`, `agent-ops/rules/project/domain/client/rules.md` — standalone owner 문구 제거와 D04 client boundary 명시.
- [ ] `agent-ui/definition/index.md`, `views/index.md`, `components/index.md`, `components/console-shell/index.md` — active graph 갱신.
- [ ] `agent-ui/definition/views/agent/index.md`, `components/agent-panel/index.md` — active source 제거.
- [ ] `agent-ui/definition/archive/views/agent/index.log`, `archive/components/agent-panel/index.log` — update-agent-ui archive logs 생성.
- [ ] `.sync-state.json`은 수정하지 않고 existing Milestone mapping을 검증.

**Test Strategy**

새 UI test file은 없다. schema/frontmatter/index/source-evidence graph와 sync-state ownership을 validate-agent-ui 및 deterministic JSON/scan으로 검증한다.

**Verification**

- `python3 - <<'PY'
import json
from pathlib import Path
s = json.loads(Path('agent-ui/.sync-state.json').read_text())
pending = s['pending_milestone_work']
assert len(pending) == 1
assert pending[0]['milestone_path'] == 'agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md'
assert pending[0]['status_paths'] == ['agent-ui/definition/components/console-shell/index.md']
assert s['pending_code_work'] == []
PY`
- `test -z "$(rg --sort path -n 'IopAgentPanel|IopConsoleSection\.agent|agent_shell|iopDefaultCapabilityPack|IopCapabilityPack|IopCapability\b|agent-panel|views/agent|Agent Shell 구성|IOP 운영/유지보수 agent' apps/client/Dockerfile apps/client/README.md apps/client/lib apps/client/pubspec.yaml apps/client/pubspec.lock apps/client/test/app_shell_test.dart packages/flutter/iop_console agent-ops/rules/project/domain/client/rules.md agent-ui/definition --glob '!**/archive/**')"`

### [REFACTOR-3] S03 기여 audit 고정

**Problem**

UI 삭제 결과가 S03에 기여하려면 IOP clean build, Chronos application connection 부재와 후속 transitional path 분류를 재현 가능한 evidence로 남겨야 한다. 다만 transitional path가 남아 있으므로 이 audit만으로 S03 completion을 증명할 수 없다.

```text
# required evidence
removed standalone UI/reference count=0
future Chronos bridge/import/config count=0
IOP clean build/test=PASS
S03 completion=deferred to task 10
```

**Solution**

Final Verification의 exact commands/stdout/exit를 `decoupling-audit.log`에 기록한다. task 10이 소유한 `packages/go/agentruntime`, `packages/go/agentprovider/cli`, Node runtime bridge/agent-runtime contract-spec는 `pending_task_10`으로 명시하고 `s03_completion=deferred_to_task_10`을 기록한다. 이 audit는 task 10의 통합 입력이며 original manifest digest를 수정하거나 S03/final matrix completion을 선포하지 않는다.

**Modified Files and Checklist**

- [ ] `agent-task/m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close/decoupling-audit.log` — exact commands/output/exit, UI/connection zero counts, `pending_task_10` paths와 deferred completion marker.
- [ ] `CODE_REVIEW-cloud-G08.md` — implementation decisions와 actual evidence.

**Test Strategy**

새 product test는 없다. Flutter package/client tests, web/local builds, fresh full Go suite와 deterministic scans을 audit evidence로 사용한다.

**Verification**

- `make build-local && go test -count=1 ./...`
- `test -z "$(rg --sort path -n 'git\.toki-labs\.com/toki/chronos|/config/workspace/chronos|chronos[_-](bridge|node|server)|CHRONOS_' apps packages cmd proto configs)"`
- `test -s agent-task/m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close/decoupling-audit.log && rg -q '^standalone_ui_residuals=0$' agent-task/m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close/decoupling-audit.log && rg -q '^chronos_connection_residuals=0$' agent-task/m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close/decoupling-audit.log && rg -q '^s03_completion=deferred_to_task_10$' agent-task/m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close/decoupling-audit.log`

## Modified Files Summary

| File | Item |
|------|------|
| `apps/client/Dockerfile` | REFACTOR-1 |
| `apps/client/lib/client_home_page.dart` | REFACTOR-1 |
| `apps/client/lib/main.dart` | REFACTOR-1 |
| `apps/client/pubspec.yaml` | REFACTOR-1 |
| `apps/client/pubspec.lock` | REFACTOR-1 |
| `apps/client/test/app_shell_test.dart` | REFACTOR-1 |
| `packages/flutter/iop_console/lib/iop_console.dart` | REFACTOR-1 |
| `packages/flutter/iop_console/lib/src/iop_agent_panel.dart` | REFACTOR-1 |
| `packages/flutter/iop_console/lib/src/iop_console_contract.dart` | REFACTOR-1 |
| `packages/flutter/iop_console/lib/src/iop_console_shell.dart` | REFACTOR-1 |
| `packages/flutter/iop_console/pubspec.yaml` | REFACTOR-1 |
| `packages/flutter/iop_console/test/iop_console_shell_test.dart` | REFACTOR-1 |
| `apps/client/README.md` | REFACTOR-2 |
| `agent-ops/rules/project/domain/client/rules.md` | REFACTOR-2 |
| `agent-ui/definition/index.md` | REFACTOR-2 |
| `agent-ui/definition/views/index.md` | REFACTOR-2 |
| `agent-ui/definition/views/agent/index.md` | REFACTOR-2 |
| `agent-ui/definition/components/index.md` | REFACTOR-2 |
| `agent-ui/definition/components/agent-panel/index.md` | REFACTOR-2 |
| `agent-ui/definition/components/console-shell/index.md` | REFACTOR-2 |
| `agent-ui/definition/archive/views/agent/index.log` | REFACTOR-2 |
| `agent-ui/definition/archive/components/agent-panel/index.log` | REFACTOR-2 |
| `agent-task/m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close/decoupling-audit.log` | REFACTOR-3 |
| `agent-task/m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close/CODE_REVIEW-cloud-G08.md` | REFACTOR-1, REFACTOR-2, REFACTOR-3 |

## Final Verification

1. `mapfile -t predecessor_logs < <({ test ! -f agent-task/m-iop-agent-chronos-extraction-decoupling/08+07_cleanup_build_contract/complete.log || printf '%s\n' agent-task/m-iop-agent-chronos-extraction-decoupling/08+07_cleanup_build_contract/complete.log; find agent-task/archive -path '*/m-iop-agent-chronos-extraction-decoupling/08+07_cleanup_build_contract/complete.log' -type f -print 2>/dev/null; } | sort -u); test "${#predecessor_logs[@]}" -eq 1; rg -q '^\| .* \| PASS \|' "${predecessor_logs[0]}"`
2. `flutter --version`
3. `make client-test`
4. `make client-build-web`
5. `test -z "$(rg --sort path -n 'IopAgentPanel|IopConsoleSection\.agent|agent_shell|iopDefaultCapabilityPack|IopCapabilityPack|IopCapability\b|agent-panel|views/agent|Agent Shell 구성|IOP 운영/유지보수 agent' apps/client/Dockerfile apps/client/README.md apps/client/lib apps/client/pubspec.yaml apps/client/pubspec.lock apps/client/test/app_shell_test.dart packages/flutter/iop_console agent-ops/rules/project/domain/client/rules.md agent-ui/definition --glob '!**/archive/**')"`
6. `python3 - <<'PY'
import json
from pathlib import Path
s = json.loads(Path('agent-ui/.sync-state.json').read_text())
pending = s['pending_milestone_work']
assert len(pending) == 1
assert pending[0]['milestone_path'] == 'agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md'
assert pending[0]['status_paths'] == ['agent-ui/definition/components/console-shell/index.md']
assert s['pending_code_work'] == []
PY`
7. `make build-local && go test -count=1 ./...`
8. `test -z "$(rg --sort path -n 'git\.toki-labs\.com/toki/chronos|/config/workspace/chronos|chronos[_-](bridge|node|server)|CHRONOS_' apps packages cmd proto configs)"`
9. `test -s agent-task/m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close/decoupling-audit.log && rg -q '^standalone_ui_residuals=0$' agent-task/m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close/decoupling-audit.log && rg -q '^chronos_connection_residuals=0$' agent-task/m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close/decoupling-audit.log && rg -q '^s03_completion=deferred_to_task_10$' agent-task/m-iop-agent-chronos-extraction-decoupling/09+08_remove_agent_ui_close/decoupling-audit.log`
10. `git diff --check`

`go test -count=1`은 fresh output이 필수다. Flutter/빌드/scan도 current checkout에서 재실행하고 actual output을 audit와 review에 기록한다.

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