# Complete - m-cross-os-runner-bootstrap/04+02,03_binary_contract

## 완료 일시

2026-06-16

## 요약

bootstrap 설치 binary 확인 계약을 2회 리뷰 루프로 완료했다. 최종 판정은 PASS.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_local_G06_0.log` | `code_review_local_G06_0.log` | FAIL | bootstrap이 `--version`을 호출했지만 runner CLI가 해당 계약을 제공하지 않고 unknown command가 exit 0으로 끝나 follow-up 필요 |
| `plan_local_G07_1.log` | `code_review_local_G07_1.log` | PASS | `--version` CLI 계약과 unknown-command non-zero 회귀를 보강하고 OS별 bootstrap binary 검증을 통과 |

## 구현/정리 내용

- Unix/Windows bootstrap script가 설치된 `oto`/`oto.exe`에 `--version`을 실행해 binary 검증에 실패하면 설치를 중단하도록 했다.
- runner CLI에 `--version`/`-v` 경로를 추가하고, unknown top-level command가 non-zero exit code로 종료되도록 보강했다.
- fake binary 성공/실패 fixture, actual CLI version/unknown-command regression, Core embedded bootstrap drift 검증을 확인했다.

## 최종 검증

- `git diff --check` - PASS; 출력 없음.
- `cd apps/runner && dart analyze` - PASS; `No issues found!`
- `cd apps/runner && dart run bin/main.dart --version` - PASS; `oto version 1.0.0`, `exit_code=0`
- `cd apps/runner && dart run bin/main.dart -v` - PASS; `oto version 1.0.0`, `exit_code=0`
- `cd apps/runner && dart run bin/main.dart nonexistent-command-999` - PASS; `command does not exist`, `exit_code=1`
- `cd apps/runner && dart test test/oto_agent_bootstrap_script_test.dart test/oto_agent_bootstrap_ps1_test.dart` - PASS; `+33: All tests passed!`
- `cd apps/runner && dart test test/oto_cli_runtime_test.dart` - PASS; `+7: All tests passed!`
- `cd apps/runner && dart test test/oto_agent_migration_plan_test.dart test/oto_agent_bootstrap_script_test.dart test/oto_agent_bootstrap_ps1_test.dart test/oto_agent_cli_test.dart test/oto_agent_config_test.dart test/oto_agent_registration_test.dart test/oto_server_connection_smoke_test.dart` - PASS; `+101: All tests passed!`
- `cd services/core && go test -count=1 ./...` - PASS; core packages passed, `cmd/oto-core` and generated `oto` package had no test files.
- `cmp -s apps/runner/assets/script/shell/oto_agent_bootstrap.sh services/core/internal/httpserver/oto_agent_bootstrap.sh` - PASS; `shell_cmp_exit=0`
- `cmp -s apps/runner/assets/script/powershell/oto_agent_bootstrap.ps1 services/core/internal/httpserver/oto_agent_bootstrap.ps1` - PASS; `ps1_cmp_exit=0`

## Roadmap Completion

- Milestone: `agent-roadmap/phase/control-plane-product-surface/milestones/cross-os-runner-bootstrap.md`
- Completed task ids:
  - `[oto-binary]`: PASS; evidence=`plan_local_G07_1.log`, `code_review_local_G07_1.log`; verification=`cd apps/runner && dart analyze`, `cd apps/runner && dart run bin/main.dart --version`, `cd apps/runner && dart run bin/main.dart nonexistent-command-999`, `cd apps/runner && dart test test/oto_agent_bootstrap_script_test.dart test/oto_agent_bootstrap_ps1_test.dart`, `cd apps/runner && dart test test/oto_cli_runtime_test.dart`, `cd services/core && go test -count=1 ./...`
- Not completed task ids: 없음

## 잔여 Nit

- 없음

## 후속 작업

- 없음
