<!-- task=01_kotlin_subprocess_cleanup plan=0 tag=CROSSTEST_PROCESS -->

# Code Review Reference - CROSSTEST_PROCESS

> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.**
> The task is NOT complete until every implementation-owned section below is filled in.
> Complete the `구현 체크리스트`; the final checklist item is mandatory before saving.
> Do not modify or check the `코드리뷰 전용 체크리스트`; it is owned by the review agent only.
> Follow the ownership table at the bottom of this file for which sections you own.

## 개요

date=2026-05-21
task=01_kotlin_subprocess_cleanup, plan=0, tag=CROSSTEST_PROCESS

## 이 파일을 읽는 리뷰 에이전트에게

각 항목의 구현을 실제 소스 파일과 대조하고, `검증 결과` 섹션의 출력이 코드와 일치하는지 확인하세요.
리뷰 완료는 아래 순서까지 끝난 상태를 의미합니다.

1. 판정을 append한다.
2. `CODE_REVIEW-cloud-G07.md` → `code_review_cloud_G07_0.log`, `PLAN-cloud-G07.md` → `plan_cloud_G07_0.log`로 아카이브한다.
3. PASS이면 `complete.log` 작성 후 task 디렉터리를 `agent-task/archive/YYYY/MM/01_kotlin_subprocess_cleanup/`로 이동한다. WARN/FAIL이면 다음 active plan/review 파일을 즉시 작성한다.
4. 적용 가능한 `코드리뷰 전용 체크리스트` 항목을 최종 `.log` 위치에서 체크한 뒤 보고한다.

---

## 구현 항목별 완료 여부

| 항목 | 완료 여부 |
|------|---------|
| [CROSSTEST_PROCESS-1] Kotlin Dart/Go/Python client runner의 timeout process cleanup을 Kotlin TypeScript runner 수준으로 맞춘다. | [x] |

## 구현 체크리스트

- [x] [CROSSTEST_PROCESS-1] Kotlin Dart/Go/Python client runner의 timeout process cleanup을 Kotlin TypeScript runner 수준으로 맞춘다.
- [x] 중간 검증과 최종 검증 명령을 실행하고 실제 출력을 기록한다.
- [x] CODE_REVIEW-*-G??.md의 구현 에이전트 소유 섹션을 실제 구현 내용과 검증 출력으로 채운다. 이 항목이 완료되기 전에는 구현이 완료된 것이 아니다.

## 코드리뷰 전용 체크리스트

> **[REVIEW AGENT ONLY]** 이 체크리스트는 코드리뷰 에이전트만 사용한다.
> 구현 에이전트는 이 섹션을 수정하거나 체크하지 않는다.

- [x] `코드리뷰 결과`에 `PASS`, `WARN`, `FAIL` 중 하나의 판정을 append한다.
- [x] 판정과 `차원별 평가`, Required/Suggested/Nit 분류가 서로 일치한다.
- [x] active `CODE_REVIEW-*-G??.md`를 `code_review_{review_lane}_GNN_N.log`로 아카이브한다.
- [x] active `PLAN-*-G??.md`를 `plan_{build_lane}_GNN_M.log`로 아카이브한다.
- [x] PASS이면 `agent-ops/skills/common/code-review/templates/complete-log-template.md` 기준으로 `complete.log`를 작성하고 active `.md` 파일을 남기지 않는다.
- [x] PASS이면 `agent-task/{task_name}/`를 `agent-task/archive/YYYY/MM/{task_name}/`로 이동하고 최종 archive 경로에서 이 체크리스트를 갱신한다.
- [ ] WARN/FAIL이면 다음 active `PLAN-{build_lane}-GNN.md`와 `CODE_REVIEW-{review_lane}-GNN.md`를 작성하고 `complete.log`를 작성하지 않는다.

## 계획 대비 변경 사항

계획과 동일하게 구현했다. 변경 없음.

## 주요 설계 결정

- `label` 지역 변수를 도입해 `check` 메시지와 `validateResultLines` 첫 번째 인수를 동일한 값으로 유지했다. 계획의 지시("validateResultLines에 넘기는 문자열과 같은 값을 지역 변수로 빼서 사용")를 그대로 따른 것이다.
- `destroyProcessTree`를 각 파일에 독립적으로 추가했다. 공유 유틸리티로 추출하면 범위를 넘으므로 TypeScript runner와 같이 파일별로 선언했다.

## 리뷰어를 위한 체크포인트

- 세 Kotlin runner가 `kotlin_typescript.kt`와 같은 tree kill + bounded stream join 패턴을 따른다.
- timeout 후 exitCode=-1과 missing scenario 검증이 유지된다.
- 정상 crosstest 출력이 기존 PASS line contract를 유지한다.

## 검증 결과

_구현 에이전트가 각 중간 검증 및 최종 검증 명령 실행 후 출력을 여기에 붙여 넣는다._

필수 규칙:
- 검증 명령은 고정된 계약이다. 임의로 대체하지 않는다.
- 대체가 필요하면 `계획 대비 변경 사항`에 이유와 대체 명령을 기록한다.
- `검증 결과`에는 실제 stdout/stderr를 붙여 넣는다.

### CROSSTEST_PROCESS-1 중간 검증

```bash
$ cd kotlin
$ ./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinDartKt
> Task :run
INFO typeName kotlin=TestData
INFO typeName dart=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from dart client
PASS scenario=2 detail=received push from kotlin server
INFO typeName dart=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
INFO typeName dart=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from dart client
PASS scenario=2 detail=received push from kotlin server
INFO typeName dart=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
INFO typeName dart=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from dart client
PASS scenario=2 detail=received push from kotlin server
INFO typeName dart=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
INFO typeName dart=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from dart client
PASS scenario=2 detail=received push from kotlin server
INFO typeName dart=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
PASS all kotlin-server/dart-client crosstests passed
BUILD SUCCESSFUL in 14s

$ ./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinGoKt
> Task :run
INFO typeName kotlin=TestData
INFO typeName go=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from go client
PASS scenario=2 detail=received push from kotlin server
INFO typeName go=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
INFO typeName go=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from go client
PASS scenario=2 detail=received push from kotlin server
INFO typeName go=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
INFO typeName go=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from go client
PASS scenario=2 detail=received push from kotlin server
INFO typeName go=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
INFO typeName go=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from go client
PASS scenario=2 detail=received push from kotlin server
INFO typeName go=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
PASS all kotlin-server/go-client crosstests passed
BUILD SUCCESSFUL in 8s

$ ./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinPythonKt
> Task :run
INFO typeName kotlin=TestData
SERVER_RECEIVED index=101 message=fire from python client
INFO typeName python=TestData
PASS scenario=1 detail=fire-and-forget sent
PASS scenario=2 detail=received push from kotlin server
INFO typeName python=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
SERVER_RECEIVED index=101 message=fire from python client
INFO typeName python=TestData
PASS scenario=1 detail=fire-and-forget sent
PASS scenario=2 detail=received push from kotlin server
INFO typeName python=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
SERVER_RECEIVED index=101 message=fire from python client
INFO typeName python=TestData
PASS scenario=1 detail=fire-and-forget sent
PASS scenario=2 detail=received push from kotlin server
INFO typeName python=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
SERVER_RECEIVED index=101 message=fire from python client
INFO typeName python=TestData
PASS scenario=1 detail=fire-and-forget sent
PASS scenario=2 detail=received push from kotlin server
INFO typeName python=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
PASS all kotlin-server/python-client crosstests passed
BUILD SUCCESSFUL in 5s
```

### 최종 검증

```bash
$ cd kotlin
$ ./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinDartKt
PASS all kotlin-server/dart-client crosstests passed
BUILD SUCCESSFUL in 14s

$ ./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinGoKt
PASS all kotlin-server/go-client crosstests passed
BUILD SUCCESSFUL in 8s

$ ./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinPythonKt
PASS all kotlin-server/python-client crosstests passed
BUILD SUCCESSFUL in 5s

$ ./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinTypescriptKt
> Task :run
INFO typeName kotlin=TestData
INFO typeName ts=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from typescript client
PASS scenario=2 detail=received push from kotlin server
INFO typeName ts=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
INFO typeName ts=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from typescript client
PASS scenario=2 detail=received push from kotlin server
INFO typeName ts=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
INFO typeName ts=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from typescript client
PASS scenario=2 detail=received push from kotlin server
INFO typeName ts=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
INFO typeName ts=TestData
PASS scenario=1 detail=fire-and-forget sent
SERVER_RECEIVED index=101 message=fire from typescript client
PASS scenario=2 detail=received push from kotlin server
INFO typeName ts=TestData
PASS scenario=3 detail=single request response matched
PASS scenario=4 detail=concurrent request responses matched
PASS all kotlin-server/typescript-client crosstests passed
BUILD SUCCESSFUL in 7s
```

---

> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section: completion table, implementation checklist, changes from plan, design decisions, and verification output?**
> If anything is blank, go back and fill it in before saving this file.
> Leave the review-agent-only checklist unchanged.

## 코드리뷰 결과

### 2026-05-21 리뷰 판정: PASS

#### 차원별 평가

- Correctness: PASS — Dart/Go/Python runner 모두 timeout 시 `destroyProcessTree`를 호출하고, timeout exitCode=-1 및 missing scenario 검증 계약을 유지한다.
- Process cleanup: PASS — 세 runner 모두 TypeScript 기준 runner와 같은 process tree kill 및 bounded stream join 패턴을 따른다.
- Scope: PASS — 변경 범위가 `kotlin/crosstest/kotlin_dart.kt`, `kotlin/crosstest/kotlin_go.kt`, `kotlin/crosstest/kotlin_python.kt`로 계획 범위와 일치한다.
- Verification: PASS — 지정된 Kotlin crosstest 네 개를 재실행했고 모두 `BUILD SUCCESSFUL` 및 최종 PASS line을 확인했다.

#### Required

- 없음

#### Suggested

- 없음

#### Nit

- 없음

#### 리뷰어 검증

- `./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinDartKt` — PASS; `PASS all kotlin-server/dart-client crosstests passed`, `BUILD SUCCESSFUL in 12s`.
- `./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinGoKt` — PASS; `PASS all kotlin-server/go-client crosstests passed`, `BUILD SUCCESSFUL in 8s`.
- `./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinPythonKt` — PASS; `PASS all kotlin-server/python-client crosstests passed`, `BUILD SUCCESSFUL in 5s`.
- `./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinTypescriptKt` — PASS; `PASS all kotlin-server/typescript-client crosstests passed`, `BUILD SUCCESSFUL in 6s`.

## Sections and Ownership

| Section | Owner | Note |
|---------|-------|------|
| Header comment, 개요, 리뷰 에이전트 지시 | Fixed at stub creation | Implementing agent must not modify or execute these |
| 구현 항목별 완료 여부 | Implementing agent | Check `[ ]` to `[x]` only |
| 구현 체크리스트 | Implementing agent | Check `[ ]` to `[x]` only |
| 코드리뷰 전용 체크리스트 | Review agent only | Implementing agent must not modify or check |
| 계획 대비 변경 사항, 주요 설계 결정 | Implementing agent | Replace placeholder text with actual content |
| 리뷰어를 위한 체크포인트 | Fixed at stub creation | Review focus |
| 검증 결과 | Implementing agent | Fill command output only |
