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

# Plan - TEST

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

구현의 마지막 단계는 active `CODE_REVIEW-*-G??.md`의 구현 에이전트 소유 섹션을 실제 내용과 검증 출력으로 채우는 것이다. 외부 secret, dev Plane 상태, 원격 runner 준비가 막히면 직접 사용자에게 묻지 말고 `사용자 리뷰 요청`에 시도한 명령과 redacted 근거를 남긴다.

## 배경

마일스톤 완료 리뷰는 unit/fake 기반 evidence만으로 Plane `Todo`까지 실제 수렴을 증명하기 어렵다고 판정했다. 12/13번 구현 이후에도 archive 전에는 webhook, auto enqueue, develop gate, Plane projection, slot 회수의 live 또는 runtime-equivalent smoke evidence가 필요하다. 이 작업은 secret redaction을 지키며 재현 가능한 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-test/local/rules.md`
- `agent-test/local/core-smoke.md`
- `agent-test/local/workspace-ops-smoke.md`
- `agent-test/plane-dev.md`
- `services/core/README.md`
- `services/core/cmd/plane-smoke/main.go`
- `services/core/cmd/plane-smoke/main_test.go`
- `services/core/internal/http/plane_webhook.go`
- `services/core/internal/http/plane_webhook_test.go`
- `services/core/internal/workitempipeline/service.go`
- `services/core/internal/scheduler/jobs.go`
- `services/core/internal/scheduler/roadmap_sync_jobs.go`
- `services/core/internal/roadmapsyncpipeline/service.go`
- `services/core/internal/gitosync/bridge.go`
- `services/core/internal/gitosync/scanner.go`
- `services/core/cmd/server/main.go`
- `agent-roadmap/phase/agent-ops-mcp-control-plane/milestones/milestone-work-item-creation-sync.md`

### 테스트 환경 규칙

- `test_env=local`, `agent-test/local/rules.md` present/read.
- Matched profiles: `core-smoke`, `workspace-ops-smoke`.
- Plane dev fixture: `agent-test/plane-dev.md`; secrets must come from ignored `.env.plane.local` or SOPS/runtime env and must not be printed.
- Current remote runner is reachable, but observed remote checkout had unrelated dirty changes; smoke must either deploy/point at the reviewed commit or clearly record runtime-equivalent limits.

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

- Unit tests can prove dispatch and projection seams, but not dev Plane webhook delivery, actual Core logs, or Plane UI state.
- No existing smoke command verifies the whole Backlog+AGENT -> Core task -> queued/running -> develop scan -> Plane Todo -> reusable slot sequence.

### 심볼 참조

- Removed/renamed symbols: none.
- Smoke implementation should search `rg --sort path "plane-smoke|PLANE_WEBHOOK|RoadmapCreationSync|workspace_slots|roadmap_sync_steps" services/core agent-test docs`.

### 분할 판단

- Split policy evaluated. This task depends on active siblings `12+11_authoring_develop_gate` and `13+12_slot_terminal_state`; both predecessors are currently missing `complete.log`.
- Live smoke is isolated because it depends on external Plane/Core runner state and may require evidence recovery without changing product logic.

### 범위 결정 근거

- Do not store raw Plane token, webhook secret, API key, or private endpoint output in tracked files.
- Do not move the Milestone to archive; user approval is still required after evidence.
- Do not cover `Todo -> In Progress` or child task execution lifecycle.

### 빌드 등급

- `cloud-G07`: external live/runtime evidence, redaction, remote runner state, and multiple async systems are central to success.

## 구현 체크리스트

- [ ] Decide whether live smoke can run against the reviewed commit; if not, write a runtime-equivalent smoke that states exactly which live evidence is unavailable and why.
- [ ] Capture redacted evidence for webhook 202, Core task external ref, checkout metadata, slot reservation, and queued/running authoring state without printing secrets.
- [ ] Capture redacted evidence for roadmap sync ledger steps `develop_matched`, `original_comment_preserved`, `plane_body_updated`, `plane_todo_moved` and Plane Todo/title state.
- [ ] Capture evidence that a second smoke can reserve a slot without manual DB reset after terminal outcome.
- [ ] CODE_REVIEW-*-G??.md의 구현 에이전트 소유 섹션을 실제 구현 내용과 검증 출력으로 채운다. 이 항목이 완료되기 전에는 구현이 완료된 것이 아니다.

### [TEST-1] Build or document the smoke runner

문제: [services/core/README.md](/config/workspace/nomadcode/services/core/README.md:135)의 `plane-smoke` covers lookup/comment/status projection, but not webhook-dispatched authoring and creation sync ledger.

해결 방법:

Before:

```text
services/core/bin/plane-smoke
```

After:

```text
# Either extend existing smoke docs/runner or add a focused command.
PLANE_SMOKE_APPLY=1 <redacted env> ./bin/plane-cycle-smoke
```

수정 파일 및 체크리스트:

- [ ] Prefer extending `services/core/cmd/plane-smoke` only if it can stay non-destructive by default.
- [ ] Otherwise add a focused smoke doc under `agent-test/` plus a shell-safe command sequence; keep secrets ignored.
- [ ] Ensure all output redacts token/secret and uses work item ids only when non-secret fixture ids are allowed.

테스트 작성: If adding Go smoke command parsing, add config/redaction unit tests under `services/core/cmd/...`.

중간 검증: `cd services/core && go test -count=1 ./cmd/plane-smoke ./internal/http ./internal/scheduler`.

### [TEST-2] Collect live or runtime-equivalent evidence

문제: [agent-roadmap/phase/agent-ops-mcp-control-plane/milestones/milestone-work-item-creation-sync.md](/config/workspace/nomadcode/agent-roadmap/phase/agent-ops-mcp-control-plane/milestones/milestone-work-item-creation-sync.md:126)는 현재 live 확인 범위가 webhook 수신과 task 생성까지만이라고 기록한다.

해결 방법:

Before:

```text
webhook receiver answers 202 accepted; task creation only
```

After:

```text
webhook 202 -> task external ref + checkout metadata -> queued/running -> develop match -> roadmap_sync_steps all marked -> Plane Todo -> slot reusable
```

수정 파일 및 체크리스트:

- [ ] Use `agent-test/plane-dev.md` fixture ids and ignored secret files only.
- [ ] Record remote commit/branch, Core health/ready, and whether runtime matches reviewed commit.
- [ ] Save redacted evidence in an untracked temp path or active review output; do not write raw secret logs.
- [ ] If live Plane mutation cannot be safely run, record runtime-equivalent commands and exact missing live gate.

테스트 작성: No product unit test if this is evidence-only; if a smoke runner is added, cover redaction and config validation.

중간 검증: `git diff --check` plus the exact smoke command chosen by implementation.

## 의존 관계 및 구현 순서

This task waits for `12+11_authoring_develop_gate/complete.log` and `13+12_slot_terminal_state/complete.log` under the same task group. Do not run final live smoke before both predecessors PASS.

## 수정 파일 요약

| 파일 | 항목 |
|------|------|
| `services/core/cmd/plane-smoke/main.go` or new focused smoke command | TEST-1 |
| `services/core/cmd/plane-smoke/main_test.go` or new command tests | TEST-1 |
| `agent-test/plane-dev.md` or new smoke doc | TEST-1, TEST-2 |
| active `CODE_REVIEW-cloud-G07.md` evidence section | 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 live/runtime-equivalent smoke command chosen by implementation, with redacted output pasted into `CODE_REVIEW-cloud-G07.md`.

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