# Task Complete — edge_node_arch ## 완료 일시 2026-05-02 ## 요약 edge를 TCP 서버로, node를 TCP 클라이언트로 재설계. proto-socket + protobuf 기반 통신 구현. 2 루프(REFACTOR → REVIEW_REFACTOR). ## 루프 이력 | Plan | Code Review | 판정 | |------|-------------|------| | plan_0.log (REFACTOR) | code_review_0.log | WARN | | plan_1.log (REVIEW_REFACTOR) | code_review_1.log | PASS | ## 최종 리뷰 요약 - `proto/gen/iop/` 4개 파일 생성 (runtime, node, control, job) - `apps/node/internal/transport/`: `client.go`, `parser.go`, `session.go` — proto-socket `TcpClient` 기반 node→edge 클라이언트 - `apps/node/internal/node/node.go`: proto 타입 사용, `structAsMap` helper, `sessionSink.Emit`이 `*iop.RunEvent` 직접 전송 - `apps/node/internal/bootstrap/module.go`: `transport.DialEdge` OnStart, `sess.Close()` OnStop - `apps/edge/internal/node/registry.go`: `NodeRegistry` — Register/Unregister/Pick/Count/All - `apps/edge/internal/transport/server.go`: proto-socket `TcpServer`, `onNodeConnected` → CapabilityRequest → Register - `apps/edge/internal/bootstrap/module.go`: fx 모듈 wiring - `packages/config/config.go`: `EdgeConfig`, `LoadEdge`, `TransportConf.EdgeAddr` - `go.mod`: proto-socket require + replace - `configs/edge.yaml` 추가 ## 잔여 Nit - `apps/node/internal/node/node.go:111` `a.Capabilities(context.Background())` — 전달받은 `ctx` 대신 `context.Background()` 사용. 기능 영향 없음.