<!-- task=m-milestone-work-item-creation-sync/14+12,13_live_cycle_smoke plan=1 tag=REVIEW_TEST -->

# Plan - REVIEW_TEST

## 이 파일을 읽는 구현 에이전트에게

구현의 마지막 단계는 active `CODE_REVIEW-*-G??.md`의 구현 에이전트 소유 섹션을 실제 내용과 검증 출력으로 채우는 것이다. 원격 runner checkout은 검증용 클린 유지 작업공간이므로 dirty worktree를 덮어써도 되지만, secret 원문은 출력하지 않는다. 진행 중 사용자 결정이 다시 필요하면 직접 묻지 말고 review stub의 `사용자 리뷰 요청`에 명령과 redacted 근거를 남긴다. 구현 에이전트는 `USER_REVIEW.md`, `complete.log`, `.log` archive를 직접 만들지 않는다.

## 배경

이전 리뷰는 live Plane projection과 slot reuse 증거 부족으로 FAIL되었고 `USER_REVIEW.md`로 멈췄다. 사용자는 remote runner의 dirty worktree를 항상 덮어써도 된다고 결정했고, `agent-test/local/rules.md`에 반영되었다. 이제 blocker는 사용자 결정이 아니라 원격 runner 최신화와 live smoke 증거 수집 작업이다.

## 사용자 리뷰 요청 흐름

구현 중 blocker는 active review stub의 `사용자 리뷰 요청` 섹션에 기록한다. 직접 사용자 프롬프트는 금지되며 code-review가 `USER_REVIEW.md` 작성 여부를 결정한다. 후속 에이전트가 명령 재실행이나 산출물 수집으로 닫을 수 있는 증거 공백은 사용자 리뷰 요청이 아니다.

## Roadmap Targets

- Milestone: `agent-roadmap/phase/agent-ops-mcp-control-plane/milestones/milestone-work-item-creation-sync.md`
- Task ids:
  - `live-webhook-task`: 원격 dev Plane에서 `Backlog + AGENT assignee` 상위 티켓을 만들거나 갱신하면 webhook만으로 Core task가 생성되고 checkout metadata가 남는다.
  - `webhook-auto-enqueue`: webhook-dispatched creation task가 별도 수동 API 호출 없이 authoring queue로 이어진다.
  - `live-creation-projection`: matched develop scan/job 입력이 `roadmapsyncpipeline.Service`와 `RoadmapCreationSyncWorker`를 통해 실제 Plane 원문 댓글 보존, 본문/제목 갱신, `Todo` 이동으로 수렴한다.
- Completion mode: check-on-pass

## 분석 결과

### 읽은 파일

- `agent-ops/skills/common/plan/SKILL.md`
- `agent-ops/skills/common/code-review/SKILL.md`
- `agent-ops/skills/common/_templates/implementation-user-review-request-section.md`
- `agent-test/local/rules.md`
- `agent-test/local/core-smoke.md`
- `agent-test/local/workspace-ops-smoke.md`
- `agent-test/plane-dev.md`
- `agent-test/live-cycle-smoke.md`
- `agent-roadmap/current.md`
- `agent-roadmap/phase/agent-ops-mcp-control-plane/PHASE.md`
- `agent-roadmap/phase/agent-ops-mcp-control-plane/milestones/milestone-work-item-creation-sync.md`
- `agent-task/m-milestone-work-item-creation-sync/14+12,13_live_cycle_smoke/user_review_0.log`
- `agent-task/m-milestone-work-item-creation-sync/14+12,13_live_cycle_smoke/plan_cloud_G07_0.log`
- `agent-task/m-milestone-work-item-creation-sync/14+12,13_live_cycle_smoke/code_review_cloud_G07_0.log`

### 테스트 환경 규칙

- `test_env=local`; `agent-test/local/rules.md` present/read.
- Matched profiles: `agent-test/local/core-smoke.md`, `agent-test/local/workspace-ops-smoke.md`.
- Current local rule: standard remote runner checkout is a clean-maintained verification workspace; uncommitted/local changes on the runner may be overwritten, and runner dirty state is not a user-review blocker.
- Plane dev fixture: `agent-test/plane-dev.md`; secrets must come from ignored `.env.plane.local` or runtime/SOPS sources and must not be printed.
- Core verification baseline: `cd services/core && go test ./...`; workspace docs/preflight: `git diff --check`.
- Live smoke profile: `agent-test/live-cycle-smoke.md`; required evidence is webhook task creation, auto enqueue, Plane projection ledger/board state, and second-smoke slot reuse.

### 테스트 커버리지 공백

- Existing Go tests cover dispatch, roadmap sync pipeline ledger, and slot terminal policy.
- Missing evidence is live/runtime runner evidence after remote Core server runs the reviewed/current workspace code: Plane Todo projection and second-smoke slot reuse.

### 심볼 참조

- Removed/renamed symbols: none for this follow-up.
- Search target for implementation evidence: `rg --sort path "plane-smoke|PLANE_WEBHOOK|RoadmapCreationSync|workspace_slots|roadmap_sync_steps" services/core agent-test`.

### 분할 판단

- Split policy evaluated. This is a dependent follow-up for existing subtask `14+12,13_live_cycle_smoke`; the task directory already encodes dependency on 12 and 13.
- Predecessor `12+11_authoring_develop_gate` satisfied by `agent-task/archive/2026/06/m-milestone-work-item-creation-sync/12+11_authoring_develop_gate/complete.log`.
- Predecessor `13+12_slot_terminal_state` satisfied by `agent-task/archive/2026/06/m-milestone-work-item-creation-sync/13+12_slot_terminal_state/complete.log`.
- Do not split further: the remaining work is one live evidence recovery path and must keep remote deploy, smoke trigger, projection check, and slot reuse evidence in one correlated run.

### 범위 결정 근거

- Do not change product logic unless live smoke reveals a deterministic repo-owned bug.
- Do not store raw Plane token, webhook secret, API key, or private endpoint output in tracked files.
- Do not archive the Milestone or call `update-roadmap`; PASS completion metadata is code-review/runtime responsibility.
- Do not cover `Todo -> In Progress` or child task execution lifecycle.

### 빌드 등급

- `cloud-G07`: terminal/remote runner state, Docker rebuild/restart, Plane webhook/projection evidence, and async slot reuse are central.

## 구현 체크리스트

- [x] Archive `USER_REVIEW.md` decision is reflected by `user_review_0.log`, and active `PLAN-cloud-G07.md` / `CODE_REVIEW-cloud-G07.md` are the only active loop files.
- [x] Bring the remote runner checkout/Core server to the reviewed/current workspace code, overwriting remote dirty state as allowed by `agent-test/local/rules.md`, and record redacted commit/status evidence.
- [x] Run focused Go verification after remote/latest alignment or record why remote verification had to use local workspace output.
- [x] Execute `agent-test/live-cycle-smoke.md` live steps for webhook task creation, auto enqueue, Plane projection, and second-smoke slot reuse; paste secret-free evidence.
- [x] CODE_REVIEW-*-G??.md의 구현 에이전트 소유 섹션을 실제 구현 내용과 검증 출력으로 채운다. 이 항목이 완료되기 전에는 구현이 완료된 것이 아니다.

### [REVIEW_TEST-1] Remote runner alignment

문제: [code_review_cloud_G07_0.log](/config/workspace/nomadcode/agent-task/m-milestone-work-item-creation-sync/14+12,13_live_cycle_smoke/code_review_cloud_G07_0.log:178)의 Required issue는 remote Core server가 검증 대상 코드로 실행되지 않아 live evidence를 수집하지 못한 것이다.

해결 방법:

Before:

```text
remote Core server: 55e0139
runner dirty worktree: treated as user-owned blocker
```

After:

```text
runner dirty worktree: overwrite allowed
remote Core server: reviewed/current workspace code
```

수정 파일 및 체크리스트:

- [x] `user_review_0.log`의 사용자 결정을 근거로 remote dirty state를 덮어쓴다.
- [x] local tracked/untracked core files needed by the smoke are present on the remote runner before Docker rebuild.
- [x] Record `git rev-parse HEAD`, `git status --short`, Docker service status, and health/ready output with no secret values.

테스트 작성: product test 추가 없음. 이 항목은 environment alignment/evidence collection이다.

중간 검증: `ssh toki@toki-labs.com "zsh -lc 'cd $HOME/agent-work/nomadcode && git rev-parse HEAD && git status --short && cd services/core && docker compose ps'"`

### [REVIEW_TEST-2] Live cycle evidence recovery

문제: [code_review_cloud_G07_0.log](/config/workspace/nomadcode/agent-task/m-milestone-work-item-creation-sync/14+12,13_live_cycle_smoke/code_review_cloud_G07_0.log:178)는 `develop_matched`, `original_comment_preserved`, `plane_body_updated`, `plane_todo_moved`, Plane Todo/title state, second-smoke slot reuse evidence가 없다고 판정했다.

해결 방법:

Before:

```text
unit tests PASS; prior baseline only proves task/checkout metadata partially
```

After:

```text
live smoke evidence includes Plane projection ledger/board state and second smoke slot reservation without manual DB reset
```

수정 파일 및 체크리스트:

- [x] Use `agent-test/live-cycle-smoke.md` and `agent-test/plane-dev.md` fixture values.
- [x] Trigger or observe webhook 202 and task creation from a Backlog+AGENT work item.
- [x] Confirm auto enqueue/running authoring state without manual task API enqueue.
- [x] Confirm roadmap sync ledger steps and Plane Todo/title state.
- [x] Confirm second smoke reserves a slot after terminal outcome without manual DB reset.
- [x] If a deterministic repo-owned bug appears, keep the fix narrowly scoped and add focused tests.

테스트 작성: no new unit test unless a repo-owned bug is fixed. Live evidence is the required test artifact.

중간 검증: exact live smoke command sequence chosen from `agent-test/live-cycle-smoke.md`; output must be pasted into `CODE_REVIEW-cloud-G07.md` with secrets redacted.

## 의존 관계 및 구현 순서

1. Confirm `user_review_0.log` exists and no active `USER_REVIEW.md` remains.
2. Align remote runner/Core server.
3. Run focused Go tests and smoke.
4. Fill `CODE_REVIEW-cloud-G07.md`.

## 수정 파일 요약

| 파일 | 항목 |
|------|------|
| `agent-task/m-milestone-work-item-creation-sync/14+12,13_live_cycle_smoke/CODE_REVIEW-cloud-G07.md` | REVIEW_TEST-1, REVIEW_TEST-2 |
| remote runner `$HOME/agent-work/nomadcode` checkout/runtime | REVIEW_TEST-1, REVIEW_TEST-2 |
| product files, if a repo-owned bug is found | REVIEW_TEST-2 |

## 최종 검증

- `cd services/core && go test -count=1 ./cmd/plane-smoke/... ./internal/http/... ./internal/scheduler/... ./internal/roadmapsyncpipeline/...`
- `cd services/core && go test ./...`
- `git diff --check`
- Exact remote alignment and live-cycle smoke commands chosen by implementation, with redacted output pasted into `CODE_REVIEW-cloud-G07.md`.

모든 코드 변경 완료 후 반드시 `CODE_REVIEW-*-G??.md`의 구현 에이전트 소유 섹션을 채운다. 이 파일 작성이 구현의 마지막 단계다.
