# Complete - m-core-server-boundary-cleanup/01_routes

## 완료 일시

2026-06-08

## 요약

core server route registration and `/api/v1/` router boundary cleanup completed after 5 review loops; final verdict PASS.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_local_G06_0.log` | `code_review_local_G06_0.log` | FAIL | `/api/v1/` subrouter helper가 handler 구현 파일에 남아 후속 필요 |
| `plan_local_G07_1.log` | `code_review_local_G07_1.log` | FAIL | handler/DTO helper까지 `routes.go`로 이동한 scope 위반 |
| `plan_local_G08_2.log` | `code_review_local_G08_2.log` | FAIL | Host validation 회귀와 handler body rewrite churn 발견 |
| `plan_cloud_G07_3.log` | `code_review_cloud_G07_3.log` | FAIL | Host validation은 복구됐으나 handler body churn이 남음 |
| `plan_cloud_G08_4.log` | `code_review_cloud_G08_4.log` | PASS | route/subrouter boundary와 Host regression test 유지, handler churn 축소 완료 |

## 구현/정리 내용

- `NewServerWithRegistryAndStore`의 inline route registration을 `registerRoutes` helper 호출로 분리했다.
- `routes.go`가 `registerRoutes`, `apiPathSegments`, `handleRouter`를 소유하도록 분리하고 `server.go`의 handler body는 기존 표현에 가깝게 유지했다.
- bootstrap Host validation regression을 막기 위해 공백 없는 malicious Host(`localhost;rm`) test를 추가했다.

## 최종 검증

- `cd services/core && go test -count=1 ./internal/httpserver -run TestHandleRunnerBootstrapCommand` - PASS; `ok github.com/toki/oto/services/core/internal/httpserver 0.003s`
- `cd services/core && go test -count=1 ./internal/httpserver` - PASS; `ok github.com/toki/oto/services/core/internal/httpserver 0.008s`
- `cd services/core && go test -count=1 ./...` - PASS; core service packages passed, no-test packages reported as expected

## Roadmap Completion

- Milestone: `agent-roadmap/phase/independent-control-plane/milestones/core-server-boundary-cleanup.md`
- Completed task ids:
  - `routes`: PASS; evidence=`plan_cloud_G08_4.log`, `code_review_cloud_G08_4.log`; verification=`cd services/core && go test -count=1 ./...`
- Not completed task ids: 없음

## 잔여 Nit

- 없음

## 후속 작업

- 없음
