<!-- task=04_refactor_validation_checklist plan=0 tag=TEST -->

# Refactor Validation Checklist

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

**구현 완료 후 `CODE_REVIEW-local-G03.md`의 모든 섹션을 채우는 것이 필수 마지막 단계입니다.** 이 작업은 앞선 refactor 작업의 검증 기준을 적용하는 루프 항목입니다. `CODE_REVIEW-local-G03.md`의 아카이브 지시는 리뷰 스킬 전용이며 구현 에이전트가 실행하지 않습니다.

## 배경

앞선 세 refactor는 현재 스켈레톤을 정리하는 최소 작업이다. 구현자가 미래 기능까지 확장하지 않도록 빌드, proto, config, CLI adapter, console, mock 유지 여부를 명시적으로 확인해야 한다.

## 분석 결과

### 읽은 파일

- `agent-ops/skills/common/plan/SKILL.md`
- `agent-ops/rules/project/rules.md`
- `agent-ops/rules/project/domain/node/rules.md`
- `agent-ops/rules/project/domain/edge/rules.md`
- `agent-ops/rules/project/domain/platform-common/rules.md`
- `proto/iop/runtime.proto`
- `packages/config/config.go`
- `apps/node/internal/runtime/types.go`
- `apps/node/internal/adapters/cli/cli.go`
- `apps/edge/cmd/edge/console.go`
- `apps/edge/internal/node/store.go`

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

- This task is a validation checklist, not a production code change.
- It relies on the three implementation tasks to add/update tests.

### 심볼 참조

- No symbol rename in this task.

### 범위 결정 근거

- This task must not create README roadmap content.
- This task must not implement new features.
- This task must not define DB schema, policy engine, security model, or Control Plane details.

### 빌드 등급

build=`local-G03`, review=`local-G03`. Checklist-only verification task; low implementation risk.

### [TEST-1] Apply scope guard before implementation review

#### 문제

The requested refactors can easily expand into future platform design.

#### 해결 방법

Before marking any refactor complete, verify excluded items were not implemented.

#### 수정 파일 및 체크리스트

- [ ] README/docs were not modified for roadmap content.
- [ ] Control Plane details were not implemented.
- [ ] Central Job/Event Store was not designed.
- [ ] Policy Engine, Audit, Permission, mTLS, Edge federation were not added.
- [ ] Mock adapter remains.
- [ ] Ollama/vLLM completion was not required.

#### 테스트 작성

No test file required.

#### 중간 검증

```bash
git diff --name-only -- README.md 'apps/**/README.md' 'docs/**' apps/control-plane apps/worker
```

예상 결과: no unexpected roadmap/control-plane/worker changes.

### [TEST-2] Verify proto and generated code handling

#### 문제

Target naming may change protobuf contracts. Generated files must not be hand-edited.

#### 해결 방법

Run generation when proto changes and inspect diffs.

#### 수정 파일 및 체크리스트

- [ ] If `proto/iop/*.proto` changed, run `make proto`.
- [ ] Do not directly edit `proto/gen/iop/*.pb.go`.
- [ ] Preserve field numbers unless a plan explicitly says otherwise.

#### 테스트 작성

No new tests.

#### 중간 검증

```bash
git diff -- proto/iop proto/gen/iop
```

예상 결과: source proto and generated code are consistent.

### [TEST-3] Verify naming and terminology searches

#### 문제

Search is needed to avoid leftover common-path `model` and `model execution` wording.

#### 해결 방법

Run targeted `rg` checks and classify intentional exceptions.

#### 수정 파일 및 체크리스트

- [ ] Internal execution target uses `target`.
- [ ] CLI profile is not described as model in common execution code.
- [ ] External/model-specific exceptions are recorded.
- [ ] `model execution`, `model runtime`, `model workload` are absent from common execution path.

#### 테스트 작성

No new tests.

#### 중간 검증

```bash
rg -n "\bmodel\b|\bModel\b" proto/iop apps packages configs --glob '!**/README.md'
rg -n "model execution|model runtime|model workload" proto/iop apps packages --glob '!**/README.md'
```

예상 결과: leftovers are intentional exceptions only.

### [TEST-4] Verify behavior-sensitive paths

#### 문제

CLI adapter, console commands, mock adapter, and stable ID fallback are behavior-sensitive.

#### 해결 방법

Run targeted tests before `go test ./...`.

#### 수정 파일 및 체크리스트

- [ ] CLI adapter profile execution tests still pass or known external-tool skips are recorded.
- [ ] Console `/status`, `/terminate-session`, send path tests pass.
- [ ] Mock adapter is still registered and usable.
- [ ] Edge/Node ID fallback behavior is documented and tested.

#### 테스트 작성

No separate test file; use related package tests.

#### 중간 검증

```bash
go test ./packages/config ./apps/edge/cmd/edge/... ./apps/edge/internal/node/... ./apps/edge/internal/transport/... ./apps/node/internal/...
```

예상 결과: targeted packages pass, or external toolchain/network failures are recorded.

## 수정 파일 요약

| 파일 | 항목 |
|------|------|
| implementation `CODE_REVIEW-*.md` files | TEST-1, TEST-2, TEST-3, TEST-4 |
| changed source/test files from related tasks | TEST-4 |

## 최종 검증

```bash
gofmt -w <changed-go-files>
go test ./packages/config ./apps/edge/cmd/edge/... ./apps/edge/internal/node/... ./apps/edge/internal/transport/... ./apps/node/internal/...
go test ./...
git diff --name-only -- README.md 'apps/**/README.md' 'docs/**' apps/control-plane apps/worker
```

예상 결과: validation evidence is recorded; scope exclusions are confirmed. 모든 코드 변경 완료 후 반드시 `CODE_REVIEW-*-G??.md`의 전체 섹션을 채운다. 이 파일 작성이 구현의 마지막 단계다.
