# Complete - m-provider-resource-admission-ownership-alignment/03+01,02_cross_group_wakeup

## 완료 일시

2026-07-19T13:57:42+09:00

## 요약

enqueue snapshot 부재 provider의 live refresh wake-up과 terminal lease drain 회귀를 4회 리뷰 루프 끝에 보강했으며 최종 판정은 PASS다.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_cloud_G07_0.log` | `code_review_cloud_G07_0.log` | FAIL | enqueue 당시 후보에 없던 provider를 refresh 뒤 재발견하지 못하는 live candidate universe 결함을 확인했다. |
| `plan_local_G06_1.log` | `code_review_local_G06_1.log` | FAIL | 두 회귀의 goroutine 결과 공유에서 data race와 비결정적 완료 판정을 확인했다. |
| `plan_local_G04_2.log` | `code_review_local_G04_2.log` | FAIL | stored snapshot 전제와 terminal lease drain assertion이 빠진 completeness 결함을 확인했다. |
| `plan_local_G04_3.log` | `code_review_local_G04_3.log` | PASS | exact queued item snapshot, non-nil resolver, A/B occupancy, terminal lifecycle 뒤 counter/lease drain을 reviewer fresh 검증으로 확인했다. |

## 구현/정리 내용

- `TestGlobalPumpReenabledProviderAbsentAtEnqueueWakesWaiter`와 `TestGlobalPumpCapacityZeroProviderBecomesEligible`가 정확히 한 queued item의 저장된 `item.candidates`에서 provider B 부재를 직접 확인한다.
- 두 회귀가 live resolver 존재와 refresh 뒤 provider B dispatch를 확인하고, provider A/B in-flight가 각각 1인 상태에서 두 terminal lifecycle event 뒤 일반·long counter와 전체 lease count가 0으로 회복되는지 검증한다.
- enqueue 완료를 bounded polling barrier로 동기화해 goroutine 시작 순서에 따른 비결정성을 제거했다.

## 최종 검증

- `gofmt -d apps/edge/internal/service/service_internal_test.go` - PASS; 출력 없음.
- `git diff --check` - PASS; 출력 없음.
- `GOCACHE=/tmp/iop-go-cache-review-g04-reviewer go test -count=1 ./apps/edge/internal/service -run 'TestGlobalPump(ReenabledProviderAbsentAtEnqueueWakesWaiter|CapacityZeroProviderBecomesEligible|DisabledProviderIsNotDispatched|CapacityRefreshWakesWaiter|PreservesEarliestDispatchableSequence)$'` - PASS; `ok iop/apps/edge/internal/service 0.014s`.
- `GOCACHE=/tmp/iop-go-cache-review-g04-reviewer go test -count=20 ./apps/edge/internal/service -run 'TestGlobalPump(ReenabledProviderAbsentAtEnqueueWakesWaiter|CapacityZeroProviderBecomesEligible)$'` - PASS; `ok iop/apps/edge/internal/service 0.027s`.
- `GOCACHE=/tmp/iop-go-cache-review-g04-reviewer go test -race -count=5 ./apps/edge/internal/service -run '^TestGlobalPump'` - PASS; `ok iop/apps/edge/internal/service 1.785s`, race detector 경고 없음.
- `GOCACHE=/tmp/iop-go-cache-review-g04-reviewer go test -count=1 ./apps/edge/...` - PASS; 모든 Edge package 통과.
- `GOCACHE=/tmp/iop-go-cache-review-g04-reviewer scripts/e2e-long-context-admission-smoke.sh --preflight --out-dir /tmp/iop-long-admission-smoke-review-g04-reviewer` - BLOCKED(rc=3); config check는 PASS했으나 `/models`와 Control Plane status endpoint가 접근 불가했다. evidence=`/tmp/iop-long-admission-smoke-review-g04-reviewer`.

## 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:
  - `cross-group-wakeup`: PASS; evidence=`agent-task/archive/2026/07/m-provider-resource-admission-ownership-alignment/03+01,02_cross_group_wakeup/plan_local_G04_3.log`, `agent-task/archive/2026/07/m-provider-resource-admission-ownership-alignment/03+01,02_cross_group_wakeup/code_review_local_G04_3.log`; verification=`go test -count=20` strengthened regressions, `go test -race -count=5 -run '^TestGlobalPump'`, `go test -count=1 ./apps/edge/...`.
- Not completed task ids: 없음

## 잔여 Nit

- 없음

## 후속 작업

- live capacity 1 cross-model 검증은 Milestone의 별도 `capacity-smoke` Task에서 endpoint 가용 환경으로 수행한다.
