# Complete - m-iop-agent-cli-runtime/01_common_runtime_node_bridge

## 완료 일시

2026-07-28T08:01:57Z

## 요약

Node 공통 runtime bridge 전환과 terminal event ordering/suppression 회귀를 3회 plan-review loop 끝에 완료했으며 최종 판정은 PASS다.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_cloud_G10_0.log` | `code_review_cloud_G10_0.log` | FAIL | concurrent event 전달 역전과 Node post-terminal event 노출을 확인했다. |
| `plan_local_G08_1.log` | `code_review_cloud_G08_1.log` | FAIL | terminal/Flush 회귀 test의 scheduler 의존성과 포맷 evidence 불일치를 확인했다. |
| `plan_cloud_G07_2.log` | `code_review_cloud_G07_2.log` | PASS | terminal acceptance 뒤 동기 Flush로 회귀 test를 결정화하고 S04 검증 evidence를 재생성했다. |

## 구현/정리 내용

- Node의 실행 요청·이벤트 변환을 `packages/go/agentruntime` 공통 계약을 소비하는 얇은 protobuf bridge로 전환하고 Node-owned runtime/CLI/terminal 중복 구현을 제거했다.
- common `TerminalEmitter`와 Node `terminalDeferringSink`가 accepted order, exactly-one terminal과 post-terminal suppression을 보존하도록 직렬화 및 회귀 test를 정리했다.
- `TestTerminalDeferringSinkPreservesConcurrentDeliveryOrder`에서 terminal acceptance 완료를 명시적으로 기다린 뒤 Flush하도록 scheduler 의존성을 제거했다.

## 최종 검증

- `/config/.local/bin/go test -race -count=100 ./packages/go/agentruntime ./apps/node/internal/node -run 'TestTerminalEmitterPreservesConcurrentAcceptedOrder|TestTerminalDeferringSink(DropsPostTerminalEvents|PreservesConcurrentDeliveryOrder)'` - PASS; 두 package 모두 race report 없이 통과했다.
- `/config/.local/bin/go test -count=500 ./apps/node/internal/node -run '^TestTerminalDeferringSinkPreservesConcurrentDeliveryOrder$'` - PASS.
- `/config/.local/bin/go test -count=1 ./packages/go/agentruntime/... ./packages/go/agentprovider/cli/...` 및 `/config/.local/bin/go test -count=1 ./apps/node/internal/...` - PASS.
- `/config/.local/bin/go test -race -count=1 ./packages/go/agentruntime/... ./packages/go/agentprovider/cli/... ./apps/node/internal/adapters/... ./apps/node/internal/router/...` - PASS.
- `/config/.local/bin/go test -count=1 ./packages/go/... ./apps/node/...` - PASS.
- `IOP_E2E_BIND_TIMEOUT=60 IOP_E2E_PROFILE=mock ./scripts/e2e-smoke.sh` - PASS; 보조 mock smoke의 payload/terminal/command 흐름을 확인했다.
- `IOP_DEV_RECONNECT_BIND_TIMEOUT=60 ./scripts/dev/edge-node-reconnect-diagnostic.sh` - PASS; 3개 run의 Node==Edge payload 순서, terminal-last exactly-once, reconnect와 다섯 command 응답을 확인했다.
- duplicate implementation search, `gofmt -l packages/go/agentruntime apps/node/internal/node/runtime_sink.go apps/node/internal/node/sink_test.go`, `git diff --check` - PASS; stale Node-owned runtime import와 포맷/diff 오류가 없다.

## Roadmap Completion

- Milestone: `agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-cli-runtime.md`
- Milestone link: [Milestone 문서](agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-cli-runtime.md)
- Completed task ids:
  - `node-consumer`: PASS; evidence=`agent-task/archive/2026/07/m-iop-agent-cli-runtime/01_common_runtime_node_bridge/plan_cloud_G07_2.log`, `agent-task/archive/2026/07/m-iop-agent-cli-runtime/01_common_runtime_node_bridge/code_review_cloud_G07_2.log`; verification=focused repeat/race, common/Node fresh·race·aggregate suite, duplicate implementation search, mock smoke와 Edge-Node reconnect diagnostic
- Not completed task ids: 없음

## 잔여 Nit

- 없음

## 후속 작업

- 없음
