# Complete - m-provider-resource-admission-ownership-alignment/12_node_connectivity_supervision

## 완료 일시

2026-07-21

## 요약

Node 최초 연결·재연결 supervisor의 S16/S17 계약을 2회 리뷰 루프(최초 FAIL, 후속 PASS)로 완료했다.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_cloud_G08_0.log` | `code_review_cloud_G08_0.log` | FAIL | shutdown-during-dial cancellation 우선순위, invalid numeric port fatal 분류, 실제 delayed Edge startup 증거를 Required로 분리 |
| `plan_local_G07_1.log` | `code_review_local_G08_1.log` | PASS | Required 3건의 구현·경합 테스트·실제 `DialEdge`·Edge/Node entrypoint smoke 증거 통과 |

## 구현/정리 내용

- TCP port `1..65535` 범위 밖의 numeric Edge port를 dial 전 fatal `ConnectError`로 거부하고 `strconv.ErrRange` cause를 보존했다.
- supervisor cancellation을 dial success/fatal 결과보다 우선하고, shutdown 후 늦게 반환된 owner를 즉시 닫아 session·attempt·exit-code 누수를 막았다.
- Node를 closed dynamic port에 먼저 시작한 뒤 같은 port에 Edge를 늦게 열어, 실제 `DialEdge` connection-refused 경로가 같은 process의 단일 registration/session으로 복구되는 것을 고정했다.
- auxiliary smoke에 양의 정수 `IOP_E2E_BIND_TIMEOUT` override를 추가하고 임시 Node YAML을 현재 `reconnect.interval_sec`/`max_attempts` schema로 맞췄다.

## 최종 검증

- `gofmt -d apps/node/internal/transport/client.go apps/node/internal/transport/client_test.go apps/node/internal/bootstrap/runtime_supervisor.go apps/node/internal/bootstrap/module_test.go` - PASS; 출력 없음.
- `bash -n scripts/e2e-smoke.sh` - PASS; 출력 없음.
- `GOCACHE=/tmp/iop-review-connectivity-gocache.Zqqu2M go test -count=1 ./packages/go/config -run 'Reconnect'` - PASS; `ok iop/packages/go/config`.
- `GOCACHE=/tmp/iop-review-connectivity-gocache.Zqqu2M go test -count=1 ./apps/node/internal/transport -run 'DialEdgeClassifiesConnectFailures'` - PASS; `ok iop/apps/node/internal/transport`.
- `GOCACHE=/tmp/iop-review-connectivity-gocache.Zqqu2M go test -race -count=1 ./apps/node/internal/bootstrap -run 'Supervisor|Initial|Reconnect|Shutdown|EdgeStartsAfterNode'` - PASS; `ok iop/apps/node/internal/bootstrap`.
- `GOCACHE=/tmp/iop-review-connectivity-gocache.Zqqu2M go test -race -count=1 ./apps/node/internal/transport ./apps/node/internal/bootstrap` - PASS; transport `6.640s`, bootstrap `2.926s`.
- `GOCACHE=/tmp/iop-review-connectivity-gocache.Zqqu2M go test -count=1 ./packages/go/...` - PASS; 전 패키지 통과.
- `GOCACHE=/tmp/iop-review-connectivity-gocache.Zqqu2M go test -count=1 ./apps/node/...` 및 `GOCACHE=/tmp/iop-review-connectivity-gocache.Zqqu2M go test -count=1 ./...` - BLOCKED; 변경·import 관계가 없는 `apps/node/internal/adapters/cli` PTY/process startup timing 테스트만 비결정적 실패했고, `TestCLIStartPartialRollbackWithMarkers`는 단독 PASS, `TestCLIExecutePersistentClaudeTUIReplaysPromptAfterStartupReadyRace`는 첫 단독 재실행 FAIL 후 연속 3회 PASS했다. bootstrap/transport 및 나머지 패키지는 통과했다.
- `GOCACHE=/tmp/iop-review-connectivity-gocache.Zqqu2M IOP_E2E_BIND_TIMEOUT=60 IOP_E2E_PROFILE=mock ./scripts/e2e-smoke.sh` - PASS; `scripts/dev/edge.sh`/`scripts/dev/node.sh` 진입점에서 registration, foreground 2회·background 1회의 sent/start/message/complete, `/nodes`, `/capabilities`, `/transport`, `/sessions`, `/terminate-session`, disconnect/OnStop을 확인했다.

## Roadmap Completion

- Milestone: `agent-roadmap/phase/operational-observability-provider-management/milestones/provider-resource-admission-ownership-alignment.md`
- Milestone link: [Milestone 문서](agent-roadmap/phase/operational-observability-provider-management/milestones/provider-resource-admission-ownership-alignment.md)
- Completed task ids:
  - `node-connectivity-supervision`: PASS; evidence=`agent-task/archive/2026/07/m-provider-resource-admission-ownership-alignment/12_node_connectivity_supervision/plan_local_G07_1.log`, `agent-task/archive/2026/07/m-provider-resource-admission-ownership-alignment/12_node_connectivity_supervision/code_review_local_G08_1.log`; verification=`go test -race -count=1 ./apps/node/internal/transport ./apps/node/internal/bootstrap`, `IOP_E2E_BIND_TIMEOUT=60 IOP_E2E_PROFILE=mock ./scripts/e2e-smoke.sh`
- Not completed task ids: 없음

## 잔여 Nit

- 없음

## 후속 작업

- 없음
