iop/agent-task/04_edge_operation_contract/plan_cloud_G08_2.log
toki 6e2a1fc2f2 feat: edge runtime, opsconsole, CLI target terminology, and e2e validation updates
- Add edge runtime config and opsconsole package
- Refactor edge console to use new runtime config
- Add service source metadata support
- Update CLI adapter with target terminology
- Add edge operation contract and event bus replay
- Update node label and command ops surface
- Add E2E smoke tests and full validation
- Update proto runtime definitions
- Update documentation and agent-ops rules
2026-05-17 14:57:49 +09:00

85 lines
3.9 KiB
Text

<!-- task=04_edge_operation_contract plan=2 tag=REVIEW_REVIEW_OPC -->
# 04 Edge Operation Contract Follow-up Plan - REVIEW_REVIEW_OPC
## 이 파일을 읽는 구현 에이전트에게
이 plan은 `code_review_cloud_G08_1.log`에서 나온 Required verification 이슈만 해결한다. DTO 구조, opsconsole 출력 문자열, service API shape, Go 동작 코드는 변경하지 않는다.
구현 완료 후 `CODE_REVIEW-cloud-G08.md`의 모든 섹션을 실제 구현 내용과 명령 출력으로 채운다. 리뷰 파일의 아카이브 지시는 리뷰 에이전트가 수행한다.
## 배경
2차 리뷰에서 formatting과 Go 테스트는 통과했지만, smoke 검증이 plan에서 요구한 실제 `bin/edge.sh`/`bin/node.sh` entrypoint가 아니라 `/tmp/iop-smoke/edge`와 `/tmp/iop-smoke/node` 직접 실행으로 기록되었다. 또한 smoke 후 repo root에 untracked `iop.db`가 남았다.
## 분석 결과
### 읽은 파일
- `agent-task/04_edge_operation_contract/code_review_cloud_G08_1.log`
- `agent-ops/skills/project/e2e-smoke/SKILL.md`
- `bin/edge.sh`
- `bin/node.sh`
- `packages/config/config.go`
- `apps/node/internal/bootstrap/module.go`
### 빌드 등급
- Build `cloud-G08`: terminal/bin entrypoint smoke 검증이 핵심이다.
- Review `cloud-G08`: verification trust와 clean workspace 확인이 필요하다.
### [REVIEW_REVIEW_OPC-1] 실제 bin entrypoint smoke 재실행 및 repo artifact 정리
#### 문제
검증 기록이 `bin/edge.sh`/`bin/node.sh`가 아니라 pre-built binary 직접 실행이다. 또한 node store가 repo root `iop.db`를 만들었다.
#### 해결 방법
- repo root의 untracked `iop.db`를 제거한다.
- 임시 edge config의 node definition 아래에 `runtime.workspace_root: "/tmp/iop-smoke/workspace"`를 둔다. node local config의 top-level `runtime`은 `config.NodeConfig`에 없으므로 store 위치에 영향을 주지 않는다.
- `IOP_EDGE_CONFIG=/tmp/iop-smoke/edge.yaml ./bin/edge.sh < /tmp/iop-smoke/edge.in`와 `IOP_NODE_CONFIG=/tmp/iop-smoke/node.yaml ./bin/node.sh`를 실제로 실행한다.
- 기존과 같은 mock full-cycle을 재검증한다: startup/register, `/nodes`, foreground x2, `/session`, background on/off, `/terminate-session`, `/status`, `/exit`, disconnect lifecycle.
- 검증 뒤 `git status --short -- iop.db`가 빈 출력임을 기록한다.
#### 수정 파일 및 체크리스트
- [ ] `agent-task/04_edge_operation_contract/CODE_REVIEW-cloud-G08.md`
- [ ] repo root `iop.db` 제거
#### 테스트 결정
코드 변경 없이 검증 신뢰만 회복하는 plan이다. 테스트 코드는 추가하지 않는다.
#### 중간 검증
```bash
rm -f iop.db
git status --short -- iop.db
test -f Makefile && rg -n "test-e2e" Makefile || true
```
수동 smoke는 반드시 아래 형태의 실제 bin script command를 포함한다.
```bash
IOP_EDGE_CONFIG=/tmp/iop-smoke/edge.yaml ./bin/edge.sh < /tmp/iop-smoke/edge.in > /tmp/iop-smoke/edge.log 2>&1 &
IOP_NODE_CONFIG=/tmp/iop-smoke/node.yaml ./bin/node.sh > /tmp/iop-smoke/node.log 2>&1 &
```
## 수정 파일 요약
| 파일 | 항목 |
|---|---|
| `agent-task/04_edge_operation_contract/CODE_REVIEW-cloud-G08.md` | REVIEW_REVIEW_OPC-1 |
## 최종 검증
```bash
gofmt -l apps/edge/internal/service/service.go apps/edge/internal/service/service_test.go apps/edge/internal/opsconsole/console.go apps/edge/internal/opsconsole/events.go apps/edge/internal/opsconsole/status.go apps/edge/internal/opsconsole/console_test.go apps/edge/internal/opsconsole/events_test.go apps/edge/cmd/edge/console.go
git diff --check -- apps/edge/internal/service/service.go apps/edge/internal/service/service_test.go apps/edge/internal/opsconsole apps/edge/cmd/edge/console.go
git status --short -- iop.db
go test -count=1 ./apps/edge/internal/service ./apps/edge/internal/opsconsole ./apps/edge/cmd/edge
go test -count=1 ./...
```
최종 보고에는 실제 bin script smoke/full-cycle 결과와 `iop.db` clean 상태를 반드시 포함한다.