# Plan - Jenkins IA Executions And Ops ## 이 파일을 읽는 구현 에이전트에게 `CODE_REVIEW-cloud-G07.md`의 구현 에이전트 소유 섹션을 실제 구현 내용과 검증 출력으로 채우는 것이 구현의 마지막 단계다. 구현 후 active 파일을 유지하고 리뷰 준비만 보고한다. 선택된 Milestone `구현 잠금 > 결정 필요` 항목이 실구현을 차단할 때만 리뷰 스텁의 `사용자 리뷰 요청` 섹션을 채우고 멈춘다. 구현 중 직접 사용자에게 질문하거나 선택지를 제시하거나 `request_user_input`, `USER_REVIEW.md`, `complete.log`, archive 이동을 수행하지 않는다. ## 배경 Executions 화면은 Pipeline Graph View를 기준으로 삼는다고 문서화되어 있지만 실제 구현은 list/detail과 `Stage summary unavailable` placeholder에 머문다. Runners와 Settings도 Jenkins Nodes/Agents, Manage Jenkins 구조가 아니라 일반 카드/empty fallback에 가깝다. 사용자 결정으로 메뉴 구조는 OTO에 적용 가능한 Jenkins 모델만 1차 적용하는 것으로 확정되었으므로, 01 정의서 guardrail 완료 후 운영 view와 run/settings menu를 적용 가능 항목 중심으로 맞춘다. ## 사용자 리뷰 요청 흐름 사용자 리뷰 요청은 선택된 Milestone lock 결정이 구현을 막을 때만 active `CODE_REVIEW-cloud-G07.md`의 `사용자 리뷰 요청` 섹션에 기록한다. 구현 에이전트는 직접 사용자 프롬프트를 띄우지 않는다. ## Roadmap Targets - Milestone: `agent-roadmap/phase/control-plane-product-surface/milestones/control-plane-jenkins-menu-ia-code-sync.md` - Task ids: - `execution-ops-menu-sync`: executions/runners/settings 화면이 `Pipeline Overview`, `Console Output`, `Artifacts`, `Build History`, `Nodes/Agents`, `Manage OTO` 중심으로 동기화된다. - `preview-deploy`: 동기화된 Flutter web build를 원격 preview에 배포한다. - Completion mode: check-on-pass ## Agent UI Completion - Mode: review-pass-status-update - Agent UI docs: - `agent-ui/definition/index.md` - `agent-ui/definition/views/index.md` - `agent-ui/definition/components/index.md` - Required code evidence: - `packages/flutter/oto_console/lib/src/oto_executions_surface.dart`: run detail with stage graph/build history/log/artifact structure and run-context left task menu - `packages/flutter/oto_console/lib/src/oto_runners_surface.dart`: nodes/agents style list with current executor/context actions - `packages/flutter/oto_console/lib/src/oto_console_shell.dart`: Manage OTO settings fallback using Jenkins-style categories - Required implementation verification: - `cd packages/flutter/oto_console && flutter analyze && flutter test`: PASS expected before review - `cd apps/client && flutter analyze && flutter test`: PASS expected before review - `curl -I http://toki-labs.com:13020/`: 200 expected after preview deploy - Review finalization validation: - `validate-agent-ui scope=jenkins-ia-executions-ops`: PASS expected after status/evidence update - Status updates on PASS: - `agent-ui/definition/views/index.md`: `executions`, `runners`, `settings` Jenkins IA criteria `계획` -> `구현됨` - `agent-ui/definition/components/index.md`: `execution-action-toolbar`, `log-preview`, `artifact-list`, `runner-self-update-form`, `section-surface`, `record-list` criteria `계획` -> `구현됨` ## 분석 결과 ### 읽은 파일 - `agent-roadmap/current.md` - `agent-roadmap/phase/control-plane-product-surface/PHASE.md` - `agent-roadmap/phase/control-plane-product-surface/milestones/control-plane-jenkins-menu-ia-code-sync.md` - `agent-test/local/rules.md` - `agent-test/local/framework-smoke.md` - `agent-ui/definition/index.md` - `agent-ui/definition/views/index.md` - `agent-ui/definition/components/index.md` - `packages/flutter/oto_console/lib/src/oto_console_shell.dart` - `packages/flutter/oto_console/lib/src/oto_executions_surface.dart` - `packages/flutter/oto_console/lib/src/oto_runners_surface.dart` - `packages/flutter/oto_console/lib/src/oto_console_contract.dart` - `packages/flutter/oto_console/lib/oto_console.dart` - `packages/flutter/oto_console/pubspec.yaml` - `packages/flutter/oto_console/test/oto_console_test.dart` - `apps/client/lib/src/app/oto_client_app.dart` - `apps/client/lib/src/app/bootstrap.dart` - `apps/client/lib/main.dart` - `apps/client/pubspec.yaml` - `apps/client/test/widget_test.dart` ### SDD 기준 Milestone: `agent-roadmap/phase/control-plane-product-surface/milestones/control-plane-jenkins-menu-ia-code-sync.md`. SDD: 불필요. 사유: 기존 Flutter/agent-ui IA 정렬이며 새 API/schema/proto/config/env 계약 또는 외부 provider 쓰기 경계를 만들지 않는다. ### 테스트 환경 규칙 test_env는 `local`이다. `agent-test/local/rules.md`, `agent-test/local/framework-smoke.md`를 적용한다. 원격 runner preflight 결과 `/Users/toki/agent-work/oto`는 dirty/HEAD mismatch 상태이며, port `13020`에는 기존 preview가 떠 있다. 최종 preview는 local build artifact를 새 원격 preview dir로 배포하고 기존 port server를 교체하는 절차로 검증한다. ### 테스트 커버리지 공백 - Executions: [packages/flutter/oto_console/lib/src/oto_executions_surface.dart](/config/workspace/oto/packages/flutter/oto_console/lib/src/oto_executions_surface.dart:195)는 Jenkins 관계라고 주석을 달았지만 실제 UI는 list + selected detail이다. [packages/flutter/oto_console/lib/src/oto_executions_surface.dart](/config/workspace/oto/packages/flutter/oto_console/lib/src/oto_executions_surface.dart:406)는 stage graph 대신 placeholder만 둔다. - Runners: [packages/flutter/oto_console/lib/src/oto_runners_surface.dart](/config/workspace/oto/packages/flutter/oto_console/lib/src/oto_runners_surface.dart:189)는 runners를 generic list rows로 렌더한다. - Settings: [packages/flutter/oto_console/lib/src/oto_console_shell.dart](/config/workspace/oto/packages/flutter/oto_console/lib/src/oto_console_shell.dart:127)는 settings를 fallback `OtoConsoleSectionSurface`로 처리한다. - Tests: [apps/client/test/widget_test.dart](/config/workspace/oto/apps/client/test/widget_test.dart:1732)는 `Stage summary unavailable`를 기대한다. - Run/settings menu: 기존 테스트는 `Console Output`, `Pipeline Overview`, `Artifacts`, `Build History`, `Manage OTO` category menu를 단언하지 않는다. ### 심볼 참조 공개 symbol rename/remove는 계획하지 않는다. 내부 private widget 추가/교체만 수행한다. ### 분할 판단 dependent subtask `03+01_executions_ops`이며 predecessor index `01`은 `agent-task/m-control-plane-jenkins-menu-ia-code-sync/01_definition_guardrails/complete.log`로 만족되어야 한다. 02와 직접 의존은 없다. ### 범위 결정 근거 이 단계는 executions/runners/settings IA, run-context left task menu, Nodes/Agents, Artifacts, Manage OTO menu, 관련 tests, final preview deployment에 한정한다. Shell/jobs 작업은 02 범위다. Core API, stage data schema 추가, durable audit/artifact storage, 권한/audit behavior는 제외한다. Stage graph는 현재 view model 필드만으로 `Checkout/Build/Package/Publish` 같은 deterministic placeholder stages를 상태와 함께 표현하거나, 데이터가 없음을 그래프 영역 안에서 명확히 표현한다. ### 빌드 등급 `cloud-G07`. Multiple UI surfaces, host tests, remote preview smoke가 결합되어 광범위한 문맥과 외부 reference 판단이 필요하다. ## 구현 체크리스트 - [ ] [JENKINS_IA_OPS-1] executions run detail을 Pipeline Graph View/Stage View 및 run-context left task menu 중심 구조로 개편한다. - [ ] [JENKINS_IA_OPS-2] runners를 Jenkins Nodes/Agents style 운영 목록으로 개편한다. - [ ] [JENKINS_IA_OPS-3] settings fallback을 Manage OTO category 구조로 개편한다. - [ ] [JENKINS_IA_OPS-4] console/client tests를 갱신하고 원격 preview를 재배포한다. - [ ] `cd packages/flutter/oto_console && flutter analyze && flutter test`, `cd apps/client && flutter analyze && flutter test`, `git diff --check`, preview `curl -I`를 실행한다. - [ ] CODE_REVIEW-*-G??.md의 구현 에이전트 소유 섹션을 실제 구현 내용과 검증 출력으로 채운다. 이 항목이 완료되기 전에는 구현이 완료된 것이 아니다. ### [JENKINS_IA_OPS-1] Pipeline Graph Run Detail #### 문제 [packages/flutter/oto_console/lib/src/oto_executions_surface.dart](/config/workspace/oto/packages/flutter/oto_console/lib/src/oto_executions_surface.dart:330)는 run header, actions, stage placeholder, logs, artifacts를 세로로 쌓는다. [packages/flutter/oto_console/lib/src/oto_executions_surface.dart](/config/workspace/oto/packages/flutter/oto_console/lib/src/oto_executions_surface.dart:425)는 `Stage summary unavailable`를 표시한다. #### 해결 방법 Selected run detail 상단에 `Stage Graph`를 primary region으로 둔다. Current model에 stage data가 없으므로 fixed stage skeleton을 execution state에 맞춰 표시하고, 데이터 부재 문구는 그래프 region 내부의 secondary note로 낮춘다. View-local 좌측 task menu에는 `Console Output`, `Pipeline Overview`, `Artifacts`, `Build History`를 두고 selected run graph/log/artifacts 관계를 한 화면에서 유지한다. #### 수정 파일 및 체크리스트 - [ ] `packages/flutter/oto_console/lib/src/oto_executions_surface.dart`: `_PipelineStageGraph`, `_RunTaskMenu` 또는 동등 widget 추가. - [ ] actions/logs/artifacts pane은 graph 아래 또는 우측 context에 유지한다. - [ ] `Stage summary unavailable` 단독 placeholder는 제거한다. #### 테스트 작성 `packages/flutter/oto_console/test/oto_console_test.dart`와 `apps/client/test/widget_test.dart`에서 `Stage Graph`, stage labels, `Console Output`, `Pipeline Overview`, `Build History`, `Artifacts`를 단언한다. `Stage summary unavailable` 기대는 제거한다. #### 중간 검증 ```bash cd packages/flutter/oto_console && flutter test test/oto_console_test.dart ``` 예상: executions stage graph tests PASS. ### [JENKINS_IA_OPS-2] Nodes And Agents Runners Surface #### 문제 [packages/flutter/oto_console/lib/src/oto_runners_surface.dart](/config/workspace/oto/packages/flutter/oto_console/lib/src/oto_runners_surface.dart:222)는 runner row를 generic `_RecordRow`로 렌더하고, current job/execution은 small metadata chip에 머문다. #### 해결 방법 Runners surface를 `Nodes`/`Agents` view로 재구성한다. Rows에는 node name, status, executors/current work, message, actions를 table-like로 보여준다. Self Update는 row action 또는 contextual management action으로 유지한다. #### 수정 파일 및 체크리스트 - [ ] `packages/flutter/oto_console/lib/src/oto_runners_surface.dart`: `Nodes`, `Executor`, `Current job`, `Current run`, `Manage` labels를 포함한 table-like layout 추가. - [ ] self-update validation/action callback을 유지한다. #### 테스트 작성 `packages/flutter/oto_console/test/oto_console_test.dart` runner tests를 새 labels로 갱신하고 action callback tests를 유지한다. #### 중간 검증 ```bash cd packages/flutter/oto_console && flutter test test/oto_console_test.dart ``` 예상: runner node layout and action tests PASS. ### [JENKINS_IA_OPS-3] Manage OTO Settings #### 문제 [packages/flutter/oto_console/lib/src/oto_console_shell.dart](/config/workspace/oto/packages/flutter/oto_console/lib/src/oto_console_shell.dart:127)는 settings를 generic fallback detailGroups로 표시한다. Jenkins-style management category grid/navigation 구조가 없다. #### 해결 방법 Settings fallback을 `Manage OTO` category surface와 menu로 바꾼다. Categories: `System`, `Security`, `Tools`, `Nodes`, `Browser policy` 등 OTO contract에 맞는 항목만 표시하고 endpoint values는 category detail로 둔다. #### 수정 파일 및 체크리스트 - [ ] `packages/flutter/oto_console/lib/src/oto_console_shell.dart`: settings fallback labels와 layout을 Manage OTO category menu/list/grid로 변경한다. - [ ] `packages/flutter/oto_console/test/oto_console_test.dart`: settings empty/fallback expectations 갱신. #### 테스트 작성 기존 section surface test를 갱신한다. `Manage OTO`, `System`, `Security`, `Browser policy`가 보이는지 확인한다. #### 중간 검증 ```bash cd packages/flutter/oto_console && flutter test test/oto_console_test.dart ``` 예상: settings fallback tests PASS. ### [JENKINS_IA_OPS-4] Preview Deployment Smoke #### 문제 사용자가 원격 환경에서 UI를 확인하고 있으며, 이전 preview는 port `13020`에서 실행 중이다. 원격 checkout은 현재 local source와 HEAD/dirty state가 달라 그대로 빌드 source로 쓰기 어렵다. #### 해결 방법 local에서 `apps/client` web build를 만든 뒤 새 원격 preview directory로 업로드하고 port `13020` server를 교체한다. 기존 source checkout은 건드리지 않는다. #### 수정 파일 및 체크리스트 - [ ] `apps/client/test/widget_test.dart`: final labels 갱신. - [ ] `apps/client/build/web`: tracked 변경으로 남기지 않는다. - [ ] 원격 preview dir은 `/Users/toki/agent-work/oto-ui-preview--jenkins-ia` 형식으로 만든다. #### 테스트 작성 새 테스트는 1~3에서 작성한다. 이 항목은 deployment smoke다. #### 중간 검증 ```bash cd apps/client && flutter build web --dart-define=OTO_SERVER_HTTP_URL=http://toki-labs.com:18020 preview_dir="/Users/toki/agent-work/oto-ui-preview-$(date -u +%Y%m%d%H%M%S)-jenkins-ia" ssh toki@toki-labs.com "mkdir -p '$preview_dir'" rsync -a --delete apps/client/build/web/ "toki@toki-labs.com:$preview_dir/" ssh toki@toki-labs.com "pkill -f 'python3 -m http.server 13020' || true; cd '$preview_dir' && nohup python3 -m http.server 13020 >/tmp/oto-ui-preview.log 2>&1 &" curl -I http://toki-labs.com:13020/ ``` 예상: build succeeds and curl returns HTTP 200. ## 의존 관계 및 구현 순서 구현 시작 전 `agent-task/m-control-plane-jenkins-menu-ia-code-sync/01_definition_guardrails/complete.log` 존재를 확인한다. 03은 02와 병렬 가능하지만, 최종 preview는 둘 다 끝난 뒤 실행하면 가장 좋다. 02가 아직 미완료면 preview에는 03 범위만 반영되었다고 `계획 대비 변경 사항`에 기록한다. ## 수정 파일 요약 | 파일 | 항목 | |------|------| | `packages/flutter/oto_console/lib/src/oto_executions_surface.dart` | JENKINS_IA_OPS-1 | | `packages/flutter/oto_console/lib/src/oto_runners_surface.dart` | JENKINS_IA_OPS-2 | | `packages/flutter/oto_console/lib/src/oto_console_shell.dart` | JENKINS_IA_OPS-3 | | `packages/flutter/oto_console/test/oto_console_test.dart` | JENKINS_IA_OPS-1, JENKINS_IA_OPS-2, JENKINS_IA_OPS-3 | | `apps/client/test/widget_test.dart` | JENKINS_IA_OPS-1, JENKINS_IA_OPS-4 | | `agent-ui/definition/index.md` | JENKINS_IA_OPS-1..3 | | `agent-ui/definition/views/index.md` | JENKINS_IA_OPS-1..3 | | `agent-ui/definition/components/index.md` | JENKINS_IA_OPS-1..3 | ## 최종 검증 ```bash test -f agent-task/m-control-plane-jenkins-menu-ia-code-sync/01_definition_guardrails/complete.log cd packages/flutter/oto_console && flutter analyze && flutter test cd apps/client && flutter analyze && flutter test git diff --check cd apps/client && flutter build web --dart-define=OTO_SERVER_HTTP_URL=http://toki-labs.com:18020 curl -I http://toki-labs.com:13020/ ``` 모든 코드 변경 완료 후 반드시 `CODE_REVIEW-*-G??.md`의 구현 에이전트 소유 섹션을 채운다. 이 파일 작성이 구현의 마지막 단계다.