# Complete - m-provider-resource-admission-ownership-alignment/11+08,13,15_reconnect_candidate_recovery

## 완료 일시

2026-07-22T08:50:40Z

## 요약

5개 plan/review 루프 끝에 reconnect candidate recovery의 ownership·dispatch·direct user-flow 검증을 닫고 최종 `PASS`로 종결했다.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_cloud_G08_0.log` | `code_review_cloud_G08_0.log` | FAIL | RegisterResponse 전 queue pump가 Node handler 설치 전 dispatch를 여는 readiness gap을 확인했다. |
| `plan_cloud_G09_1.log` | `code_review_cloud_G10_1.log` | FAIL | pending connection의 direct run/tunnel/cancel/command wire 우회와 direct user-flow 검증 공백을 확인했다. |
| `plan_local_G08_2.log` | `code_review_local_G09_2.log` | FAIL | ready/disconnect와 send/handoff의 check-then-act 경합, wire 타입 단언 부족을 확인했다. |
| `plan_local_G09_3.log` | `code_review_local_G09_3.log` | FAIL | actual queue 선형화, 두 send 승패 순서, exact proto, transcript fail-fast, 반복 race 신뢰성이 남았다. |
| `plan_local_G10_4.log` | `code_review_local_G10_4.log` | PASS | 직전 Required 5개를 구현하고 독립 반복 race·통합·direct transcript로 재검증했다. |

## 구현/정리 내용

- current accepted connection generation만 provider resource를 activate하고 global waiter queue를 pump하며, stale/rejected ready continuation은 activation·pump·connected event를 만들지 않게 했다.
- normalized `RunRequest`와 `ProviderTunnelRequest`의 send·lease handoff를 authoritative disconnect fence와 직렬화하고, disconnect-winning/send-winning을 모두 deterministic test로 고정했다.
- pending/ready direct fence를 wire type 카운트가 아닌 cloned protobuf의 run/request identity·payload·action·command field로 검증했다.
- `scripts/dev/edge-node-reconnect-diagnostic.sh`가 실제 Edge/Node transcript의 payload 순서, terminal ordering, reconnect, command response를 fail-fast로 검증하고 fault injection이 `exit 1`로 종료되게 했다.
- Spec update not needed: 구현 의미가 현재 `agent-contract/inner/edge-node-runtime-wire.md`, `agent-spec/runtime/edge-node-execution.md`, `agent-spec/runtime/provider-pool-config-refresh.md`의 ready-gated candidate activation/waiter pump 기준과 일치한다.

## 최종 검증

- `gofmt -d <review target Go files>` - PASS; stdout/stderr 없음.
- `git diff --check -- apps/edge/internal/node apps/edge/internal/transport apps/edge/internal/service apps/edge/internal/bootstrap scripts/dev` - PASS.
- `bash -n scripts/dev/edge.sh scripts/dev/node.sh scripts/dev/edge-node-reconnect-diagnostic.sh scripts/e2e-smoke.sh` - PASS.
- `go test -count=20 -race -timeout 300s ./apps/edge/internal/node ./apps/edge/internal/transport ./apps/edge/internal/service -run 'Ready|Disconnect|Ownership|Generation|PendingClientDirectSendFence|ProviderPool|RegistrationDoesNotDispatchBeforeReady'` - PASS; node `1.174s`, transport `95.475s`, service `65.458s`.
- `go test -count=10 -race -timeout 300s ./apps/edge/internal/bootstrap -run '^TestActualNodeReconnectReadyPumpsQueuedWaiterExactlyOnce$'` - PASS; `30.771s`.
- `go test -count=1 -timeout 600s ./apps/edge/... ./apps/node/...` - PASS.
- `IOP_DEV_RECONNECT_BIND_TIMEOUT=60 IOP_DEV_RECONNECT_PROFILE=mock ./scripts/dev/edge-node-reconnect-diagnostic.sh` - PASS; 3 runs, Node/Edge payload 일치, terminal ordering, reconnect, command response 5개.
- `IOP_DEV_RECONNECT_INJECT_FAIL=1 IOP_DEV_RECONNECT_BIND_TIMEOUT=60 IOP_DEV_RECONNECT_PROFILE=mock ./scripts/dev/edge-node-reconnect-diagnostic.sh` - PASS(expected negative); 주입한 Node/Edge payload mismatch에서 `exit 1`.
- `IOP_E2E_BIND_TIMEOUT=60 IOP_E2E_PROFILE=mock ./scripts/e2e-smoke.sh` - PASS; auxiliary smoke로 분리.
- `scripts/e2e-long-context-admission-smoke.sh --preflight` - BLOCKED `rc=3`; live `/models`와 Control Plane status endpoint 미도달, evidence=`/tmp/iop-long-admission-smoke`.

## 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:
  - `reconnect-candidate-recovery`: PASS; evidence=`agent-task/m-provider-resource-admission-ownership-alignment/11+08,13,15_reconnect_candidate_recovery/plan_local_G10_4.log`, `agent-task/m-provider-resource-admission-ownership-alignment/11+08,13,15_reconnect_candidate_recovery/code_review_local_G10_4.log`; verification=`go test -count=20 -race ...`, `go test -count=10 -race ... TestActualNodeReconnectReadyPumpsQueuedWaiterExactlyOnce`, direct reconnect diagnostic PASS.
- Not completed task ids: 없음

## 잔여 Nit

- 없음

## 후속 작업

- 없음
