# Milestone: Operator Runtime Reliability Refactor ## 위치 - Roadmap: `agent-roadmap/ROADMAP.md` - Phase: `agent-roadmap/phase/operator-surface/PHASE.md` ## 목표 Flutter operator console 작업을 더 진행하기 전에 API-worker runtime rail, worker execution wiring, capability reporting, client bootstrap, and remote test rule 기준을 정리한다. 이 Milestone이 끝나면 후속 UX/headless 작업이 실제 연결 가능한 control surface 위에서 계획될 수 있어야 한다. ## 상태 [완료] ## 구현 잠금 - 상태: 해제 - 결정 필요: 없음 ## 범위 - API의 worker client lifecycle, injection boundary, reconnect/error reporting 정리 - worker의 backtest start/execution wiring 또는 명시적 unavailable 상태 정리 - hello capability와 handler registration test를 실제 surface와 일치 - `../nexo/agent-test/local/rules.md`의 원격 실행 기준을 참고해 ALT local test profile을 원격 테스트 host 기준으로 정리 - Flutter app bootstrap에서 operator shell과 push/Firebase/Mattermost 초기화를 분리 - remote verification evidence, generated drift check, skipped integration 조건을 plan/review 루프에서 재현 가능하게 정리 ## 기능 ### Epic: [runtime-refactor] Operator runtime reliability refactor Operator console과 headless validation이 의존할 API-worker-client rail을 scaffold 상태에서 실행 가능한 운영 경계로 끌어올린다. - [x] [worker-exec] `services/worker` main에서 `BacktestStarter`, concrete `KindRunBacktest` handler, engine/store dependency를 연결하거나, 아직 실행 불가인 부분은 capability와 typed error로 명시한다. - [x] [api-worker-lifecycle] `services/api`의 worker client 전역 상태와 one-shot connect 흐름을 주입 가능한 lifecycle로 정리하고, connect failure, timeout, disconnect behavior를 테스트한다. - [x] [test-rules] `agent-test/local` 규칙을 `../nexo/agent-test/local/rules.md`의 원격 실행 방식에 맞춰 `ssh toki@toki-labs.com` 기준으로 정리하고, ALT smoke profile이 local shell 실행을 암시하지 않게 한다. - [x] [capabilities] API/worker `HelloResponse.capabilities`와 handler coverage test가 market/backtest/worker availability를 실제 등록 surface와 일치하게 검증한다. - [x] [client-bootstrap] Flutter operator shell이 push/Firebase/Mattermost 초기화 없이도 시작 가능한 경계로 분리되고, push-specific integration은 후속 push Milestone 범위로 남는다. - [x] [verification-handoff] 원격 ALT checkout에서 실행할 검증 명령, `bin/contracts-check`, `bin/worker-storage-check`, 통합 테스트 skip 조건과 실제 stdout/stderr 기록 기준을 plan/review 산출물에 남길 수 있게 정리한다. ## 완료 리뷰 - 상태: 승인됨 - 요청일: 2026-05-31 - 완료 근거: `m-operator-runtime-refactor` 완료 로그 기준으로 `worker-exec`, `api-worker-lifecycle`, `capabilities`, `client-bootstrap`가 PASS 처리되었고, 기존 완료 항목인 `test-rules`, `verification-handoff`까지 모든 기능 Task가 충족되었다. - `worker-exec`: `agent-task/archive/2026/05/m-operator-runtime-refactor/01_worker_execution/complete.log` - `api-worker-lifecycle`, `capabilities`: `agent-task/archive/2026/05/m-operator-runtime-refactor/02+01_api_lifecycle_capabilities/complete.log` - `client-bootstrap`: `agent-task/archive/2026/05/m-operator-runtime-refactor/03_client_bootstrap/complete.log` - 리뷰 필요: - [x] 사용자가 완료 결과를 확인했다 - [x] archive 이동을 승인했다 - 리뷰 코멘트: 2026-05-31 사용자 승인에 따라 Milestone을 완료 처리하고 archive로 이동한다. ## 범위 제외 - Flutter production 화면, dashboard layout, chart/form wireframe 확정 - KIS live credential, provider live smoke, trading/order execution - push notification 구현 자체 - 신규 strategy catalog 또는 고급 backtest 분석 기능 ## 작업 컨텍스트 - 관련 경로: `services/api/`, `services/worker/`, `apps/client/`, `agent-test/local/`, `bin/` - 표준선(선택): API는 thin control plane으로 유지하고 worker execution/storage는 worker에 둔다. 로컬 테스트 profile의 명령은 로컬 shell이 아니라 원격 테스트 host의 ALT checkout에서 실행한다. Client operator shell은 push integration 없이도 기본 실행 가능해야 한다. - 초기 반영: 2026-05-31에 `../nexo/agent-test/local/rules.md`를 참고해 `agent-test/local/rules.md`와 smoke profile의 host/blocker 문구를 원격 테스트 host 기준으로 갱신했다. - 진행 반영: 2026-05-31에 `agent-test/local` handoff 문구를 보강하고 `agent-task/m-operator-runtime-refactor/` 아래 worker/API/client split plan을 작성했다. - 완료 후보 반영: 2026-05-31에 `m-operator-runtime-refactor` 완료 로그와 동기화해 모든 기능 Task를 `[x]`로 전환하고 Milestone을 `[검토중]`으로 올렸다. - 선행 작업: API-Centered Proto-Socket Rail - 후속 작업: Flutter Operator Console UX Plan, Operator Headless Workflow Validation, Flutter Operator Console MVP - 확인 필요: 없음