# Complete - m-external-integration/01_iop_responses_surface

## 완료 일시

2026-06-08

## 요약

IOP Responses flat metadata compatibility와 OpenAI-compatible smoke contract 복구를 3회 리뷰 루프로 완료했다. 최종 판정은 PASS다.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_cloud_G07_0.log` | `code_review_cloud_G07_0.log` | FAIL | IOP `/v1/responses`가 NomadCode Core의 flat `metadata.task_id/source` shape를 service boundary까지 전달하지 못해 follow-up 필요 |
| `plan_cloud_G07_1.log` | `code_review_cloud_G07_1.log` | FAIL | flat alias parser는 닫혔으나 `iop-edge smoke openai`의 chat completions baseline이 제거되어 OpenAI-compatible smoke 계약 복구 필요 |
| `plan_cloud_G07_2.log` | `code_review_cloud_G07_2.log` | PASS | four-step smoke contract, flat metadata alias regression, IOP/NomadCode verification evidence 모두 충족 |

## 구현/정리 내용

- IOP Responses metadata parser가 flat `metadata.task_id`와 `metadata.source`를 `nomadcode.task_id`, `nomadcode.source` run metadata로 매핑하도록 보강했다.
- structured `metadata.nomadcode.task_id/source` precedence와 IOP-owned `source=openai-responses` 보존을 regression test로 고정했다.
- `iop-edge smoke openai`가 `/healthz`, `/v1/models`, `/v1/chat/completions`, `/v1/responses`를 순서대로 검증하도록 복구했다.
- `scripts/e2e-openai-ollama.sh`와 command smoke가 flat NomadCode metadata shape를 실제 listener 경로에서 검증하도록 했다.
- 리뷰 중 `/config/workspace/iop/apps/edge/internal/edgecmd/root.go`의 상위 help 문구를 실제 four-step smoke와 맞게 정리했다.

## 최종 검증

- `cd /config/workspace/iop && go test -count=1 ./apps/edge/internal/edgecmd ./apps/edge/cmd/edge` - PASS; `ok iop/apps/edge/internal/edgecmd`, `ok iop/apps/edge/cmd/edge`
- `cd /config/workspace/iop && go test -count=1 ./apps/edge/internal/openai ./apps/edge/internal/service` - PASS; `ok iop/apps/edge/internal/openai`, `ok iop/apps/edge/internal/service`
- `cd /config/workspace/iop && go test -count=1 ./apps/edge/...` - PASS; all edge packages passed
- `cd /config/workspace/iop && ./scripts/e2e-openai-ollama.sh` - PASS; `[openai-ollama] OpenAI-compatible Ollama serving test PASSED.`
- `cd /config/workspace/nomadcode/services/core && go test -count=1 ./internal/adapters/openai ./internal/scheduler` - PASS; `ok github.com/nomadcode/nomadcode-core/internal/adapters/openai`, `ok github.com/nomadcode/nomadcode-core/internal/scheduler`

## Roadmap Completion

- Milestone: `agent-roadmap/phase/external-integration/milestones/external-integration.md`
- Completed task ids: 없음
- Not completed task ids: 없음
- Evidence: `plan_cloud_G07_0.log`, `code_review_cloud_G07_0.log`, `plan_cloud_G07_1.log`, `code_review_cloud_G07_1.log`, `plan_cloud_G07_2.log`, `code_review_cloud_G07_2.log`
- Verification: `go test -count=1 ./apps/edge/...`, `./scripts/e2e-openai-ollama.sh`, `go test -count=1 ./internal/adapters/openai ./internal/scheduler`

## 잔여 Nit

- 없음

## 후속 작업

- `agent-task/m-external-integration/02+01_nomadcode_core_iop_smoke`에서 NomadCode Core remote enqueue smoke를 완료한다.
