From 1062c4c15bf779588531fe8f0a2775207938e90a Mon Sep 17 00:00:00 2001 From: toki Date: Mon, 1 Jun 2026 04:26:03 +0900 Subject: [PATCH] update: agent-ops domain rules and add agent domain --- agent-ops/rules/project/domain/agent/rules.md | 73 +++++++++++++++++++ agent-ops/rules/project/domain/cli/rules.md | 17 +++++ .../rules/project/domain/command/rules.md | 12 ++- agent-ops/rules/project/domain/core/rules.md | 11 +++ .../rules/project/domain/framework/rules.md | 12 +++ .../rules/project/domain/pipeline/rules.md | 9 +++ .../rules/project/domain/sample/rules.md | 12 ++- .../rules/project/domain/scheduler/rules.md | 6 ++ agent-ops/rules/project/rules.md | 8 +- 9 files changed, 155 insertions(+), 5 deletions(-) create mode 100644 agent-ops/rules/project/domain/agent/rules.md diff --git a/agent-ops/rules/project/domain/agent/rules.md b/agent-ops/rules/project/domain/agent/rules.md new file mode 100644 index 0000000..74c711f --- /dev/null +++ b/agent-ops/rules/project/domain/agent/rules.md @@ -0,0 +1,73 @@ +--- +domain: agent +last_rule_review_commit: 67d7b6e411b8a28d6d42cac550a29872a7ef6b7e +last_rule_updated_at: 2026-06-01 +--- + +# agent + +## 목적 / 책임 + +OTO Edge 서버에 CLI 기반 agent 노드를 등록하고, agent 실행에 필요한 config 파싱, Edge endpoint 해석, protobuf 등록 요청, bootstrap 스크립트를 담당한다. +파이프라인 실행 엔진이나 scheduler 등록 정책이 아니라 `oto agent run --config ` 실행 흐름과 Edge 연결 초기화가 이 도메인의 책임이다. + +## 포함 경로 + +- `lib/cli/commands/command_agent.dart` — `agent run --config ` CLI 표면과 오류 출력 +- `lib/oto/agent/` — agent config, runner, Edge 등록 client, generated protobuf 런타임 코드 +- `assets/script/shell/oto_agent_bootstrap.sh` — Linux agent 다운로드, config 생성, background 실행 bootstrap + +## 제외 경로 + +- `lib/cli/cli.dart` — 일반 CLI 출력/초기화 (`cli` 도메인) +- `lib/cli/commands/command_catalog.dart` — command catalog 출력 (`cli` 도메인) +- `lib/cli/commands/command_validate.dart` — pipeline YAML 검증 (`cli`/`core` 도메인) +- `lib/cli/commands/command_scheduler.dart` — scheduler 명령 진입 (`scheduler` 도메인) +- `lib/oto/application.dart` — pipeline build 오케스트레이션 (`core` 도메인) +- `lib/oto/pipeline/` — pipeline workflow 실행 (`pipeline` 도메인) +- `lib/oto/commands/` — pipeline에서 호출되는 커맨드 구현체 (`command` 도메인) +- `assets/script/`의 기타 build/package helper — CLI/배포 보조 asset (`cli` 도메인) + +## 주요 구성 요소 + +- `CommandAgent` — `agent` CLI subcommand 파싱, config 로딩, runner 호출, exit code 처리 +- `AgentConfig` / `AgentIdentityConfig` / `EdgeConnectionConfig` / `AgentRuntimeConfig` — agent bootstrap YAML 구조와 필수 필드 검증 +- `AgentConfigException` — config 파일/필드/타입 오류 표현 +- `AgentRunner` / `DefaultAgentRunner` — Edge 등록 workflow 실행과 결과 로그 출력 +- `RegistrationException` — Edge 등록 거절 또는 연결 실패 표현 +- `EdgeEndpoint` — Edge URL host/port 정규화와 기본 포트 결정 +- `EdgeRegistrationClient` — `proto_socket` 기반 RegisterRequest 전송 +- `RegistrationResult` — RegisterResponse accepted/rejected 결과 변환 +- `_OtoIopClient` — agent iop protobuf message registry를 가진 proto_socket client +- `lib/oto/agent/iop/*.pb*.dart` — `iop/runtime.proto` generated protobuf 코드 +- `lib/oto/agent/google/protobuf/*.pb*.dart` — `google/protobuf/struct.proto` generated protobuf 코드 +- `oto_agent_bootstrap.sh` — agent config 파일 생성, 권한 설정, background 실행 bootstrap + +## 유지할 패턴 + +- `CommandAgent`는 subcommand/argument 파싱과 출력만 담당하고, config 파싱은 `AgentConfig`, 등록 실행은 `AgentRunner`에 위임한다. +- `--config `와 `--config=` 형식을 모두 유지하고, 누락/알 수 없는 인자는 실행 전에 오류 처리한다. +- `AgentConfig`는 YAML root와 `agent`, `edge`, `runtime` section이 map인지 확인한 뒤 required string을 검증한다. +- agent config의 required field는 빈 문자열을 거부하고, optional `agent.alias`는 누락 시 `null`, 빈 문자열이면 빈 문자열로 보존한다. +- `EdgeEndpoint.parse()`는 scheme 없는 host도 허용하고, port가 없으면 https는 443, 그 외는 80을 기본값으로 둔다. +- Edge 등록 통신은 `EdgeRegistrationClient.register()`에서 열고 `finally`에서 client를 닫는다. +- RegisterResponse 변환은 `RegistrationResult.fromResponse()`에 모아 accepted/rejected와 runtime config 추출을 한 곳에서 처리한다. +- generated protobuf 파일은 직접 수정하지 않고 원본 proto와 생성 절차를 확인해 재생성한다. +- bootstrap 스크립트는 `--release-base-url`에 https만 허용하고, 생성한 config 파일은 `chmod 600`을 유지한다. +- agent 변경 후 `dart analyze`와 agent 관련 테스트(`test/oto_agent_*`, 필요 시 `test/oto_iop_connection_smoke_test.dart`)를 확인한다. + +## 다른 도메인과의 경계 + +- **cli**: `bin/main.dart` 등록과 일반 출력/스타일은 cli 도메인이다. `CommandAgent` 내부의 agent subcommand 정책부터는 agent 도메인이다. +- **core/pipeline/command**: agent 등록은 pipeline build 실행과 별개다. agent 도메인에서 `Application.build()`, `Pipeline.pipelineInitialize()`, `Command.byType()`을 직접 호출하지 않는다. +- **scheduler**: scheduler는 YAML 파이프라인을 cron/interval로 실행한다. agent bootstrap의 background 실행과 scheduler 등록/로그 정책을 섞지 않는다. +- **framework**: `proto_socket`, `protobuf`, `fixnum` dependency 선언은 framework 도메인에서 관리하고, Edge protocol 사용 방식은 agent 도메인에서 관리한다. +- **sample**: agent config YAML은 pipeline sample YAML이 아니다. `assets/yaml/sample/**`에 agent bootstrap config를 섞지 않는다. + +## 금지 사항 + +- agent 도메인에서 pipeline workflow나 command catalog를 직접 실행/해석하지 않는다. +- enrollment token, generated config, Edge 응답 중 민감 정보가 로그에 노출되도록 하지 않는다. +- generated protobuf 파일을 수동 편집하지 않는다. +- bootstrap 스크립트에서 사용자가 지정한 config/log/workspace 경로 외 임의의 프로젝트 파일을 수정하지 않는다. +- agent background 실행 정책을 scheduler 등록/해제 로직에 섞지 않는다. diff --git a/agent-ops/rules/project/domain/cli/rules.md b/agent-ops/rules/project/domain/cli/rules.md index 6100ae2..2702f52 100644 --- a/agent-ops/rules/project/domain/cli/rules.md +++ b/agent-ops/rules/project/domain/cli/rules.md @@ -1,3 +1,9 @@ +--- +domain: cli +last_rule_review_commit: 67d7b6e411b8a28d6d42cac550a29872a7ef6b7e +last_rule_updated_at: 2026-06-01 +--- + # cli ## 목적 / 책임 @@ -15,10 +21,13 @@ - `lib/cli/commands/command_manager.dart` — CLI 커맨드 라우팅 - `lib/cli/commands/command_const.dart` — OS별 설치 경로 상수 - `lib/cli/commands/command_exe.dart` — `exe` 명령과 `Application.build()` 진입 +- `lib/cli/commands/command_catalog.dart` — 등록된 OTO 커맨드 catalog 출력 명령 +- `lib/cli/commands/command_validate.dart` — YAML 구조/의미 검증 명령 - `lib/cli/commands/command_template.dart` — 템플릿 출력 - `lib/cli/commands/command_start.dart` — 시작/중지 커맨드 - `lib/cli/commands/command_install.dart` — 설치/제거 명령 - `lib/cli/commands/install/` — PATH 등록 등 설치 보조 로직 +- `lib/resources.resource_importer.dart` — 설치/패키징 asset용 `resource_importer` 생성 파일 - `assets/package/` — 배포/패키징 보조 파일 - `assets/bin/` — 설치 또는 패키징에 포함되는 보조 바이너리 - `assets/script/` — 빌드/패키징/실행 보조 스크립트. Jenkins env helper는 core 경계도 함께 확인 @@ -26,8 +35,11 @@ ## 제외 경로 - `lib/oto/` — 비즈니스 로직·파이프라인 엔진 (cli는 진입만 담당) +- `lib/cli/commands/command_agent.dart` — OTO Edge agent 실행 명령 (`agent` 도메인) - `lib/cli/commands/command_scheduler.dart` — scheduler 명령 파싱과 등록/실행 진입점 (`scheduler` 도메인) - `lib/cli/commands/scheduler/` — 스케줄러 실행/등록/OS별 백그라운드 처리 (`scheduler` 도메인) +- `lib/oto/agent/` — agent 설정/등록/Edge 통신 (`agent` 도메인) +- `assets/script/shell/oto_agent_bootstrap.sh` — agent 설치/실행 bootstrap (`agent` 도메인) - `assets/template/` — 커맨드 실행 중 사용하는 템플릿 (`command` 도메인) ## 주요 구성 요소 @@ -37,6 +49,8 @@ - `Color` / `Style` (`cli_style.dart`) — CLI 출력 스타일 enum - `CommandExe` — `-j`(Jenkins), `-t`(test), `-f`(file) 플래그 파싱 → `Application.build()` 호출 - `IsolateExe` — `CommandExe`와 scheduler 실행에서 사용하는 isolate 진입 래퍼 +- `CommandCatalogCli` — `CommandCatalog`를 사람이 읽는 표 또는 JSON으로 출력 +- `CommandValidateCli` — `Application.validateYamlContent()`를 통해 YAML을 실행 없이 검증 - `CommandInstall` / `CommandUninstall` — PATH 등록·해제 및 OS 시작 프로그램 설치 처리 - `CommandStart` / `CommandStop` — 백그라운드 서비스 시작/중지 명령 표면 - `CommandConstant` — OS별 설치 경로 계산 @@ -51,6 +65,7 @@ - top-level 명령 등록은 `bin/main.dart`의 `CLI.initialize(..., [Command...])` 목록에서 관리 - CLI는 인자 파싱과 진입점 역할만 수행하고, 파이프라인 실행은 `Application.build()`에 위임 - `CommandExe`는 `BuildType` 선택과 YAML 파일 읽기까지만 담당 +- `catalog`/`validate`처럼 JSON 출력을 지원하는 CLI는 stdout에 구조화 결과만 쓰고 일반 실행 로그는 억제한다 - 콘솔 출력은 `CLI.print*`, `CLI.style`, `Printer`, 또는 `CommandBase` 출력 헬퍼를 사용 - CLI 변경 후 `dart analyze`를 실행하고, CLI 진입 변경이면 최소 `dart run bin/main.dart` 수준의 스모크 실행 가능 여부를 확인 - 배포/설치 asset 변경 시 관련 CLI 설치/패키징 경로가 실제 파일명을 참조하는지 확인 @@ -59,6 +74,7 @@ - **pipeline/command**: cli는 `Application.build()`만 호출. 파이프라인·커맨드 내부를 직접 참조하지 않는다 - **core**: DataComposer 호출은 Application 내부에서 이루어지며 cli는 관여하지 않는다 +- **agent**: `agent` 명령과 `CommandAgent`는 agent 도메인이다. 일반 CLI 변경에서 Edge 등록/agent config 정책을 함께 수정하지 않는다 - **scheduler**: `CommandScheduler`, `lib/cli/commands/command_scheduler.dart`, `lib/cli/commands/scheduler/**`는 scheduler 도메인이다. 일반 CLI 변경에서 scheduler 내부 동작을 함께 수정하지 않는다 - **framework**: `bin/main.dart`는 외부 framework Application을 소비하지만 framework 의존성 자체는 framework 도메인에서 다룬다 @@ -66,4 +82,5 @@ - cli 레이어에서 Pipeline 또는 Command를 직접 인스턴스화하지 않는다 - 비즈니스 로직을 cli 커맨드 핸들러에 넣지 않는다 +- 일반 CLI 변경에 agent 등록, Edge 연결, bootstrap 스크립트 정책을 섞지 않는다 - 일반 CLI 변경에 scheduler 명령, 등록 파일, 로그 파일, OS 시작 프로그램 로직을 섞지 않는다 diff --git a/agent-ops/rules/project/domain/command/rules.md b/agent-ops/rules/project/domain/command/rules.md index 2432493..2180d6d 100644 --- a/agent-ops/rules/project/domain/command/rules.md +++ b/agent-ops/rules/project/domain/command/rules.md @@ -1,3 +1,9 @@ +--- +domain: command +last_rule_review_commit: 67d7b6e411b8a28d6d42cac550a29872a7ef6b7e +last_rule_updated_at: 2026-06-01 +--- + # command ## 목적 / 책임 @@ -8,13 +14,14 @@ ## 포함 경로 - `lib/oto/commands/` — 커맨드 구현체 (카테고리별 하위 폴더) -- `lib/oto/data/` — 커맨드 파라미터 데이터 모델 (`*_data.dart`, `*.g.dart`) +- `lib/oto/data/` — 커맨드 파라미터 데이터 모델 (`*_data.dart`, `*.g.dart`). `pipeline_data.dart`는 pipeline 도메인 - `assets/template/` — 커맨드 실행 중 사용하는 템플릿 파일 ## 제외 경로 - `lib/oto/pipeline/` — 실행 흐름 제어 (커맨드 dispatch 이전) - `lib/oto/core/` — 태그 치환, 데이터 합성 (커맨드 실행 이전) +- `lib/oto/data/pipeline_data.dart` — workflow/조건/반복 데이터 모델 (`pipeline` 도메인) - `assets/yaml/sample/` — YAML 사용 예시 (`sample` 도메인) ## 주요 구성 요소 @@ -22,6 +29,7 @@ - `Command` (`command.dart`) — 커맨드 베이스 클래스, `CommandType` enum - `CommandSpec` (`command.dart`) — CommandType → category/dataModel/samplePath 메타데이터 - `registerAllCommands()` (`command_registry.dart`) — 카테고리별 register 함수를 호출해 CommandType → Command 매핑 구성 +- `CommandCatalog` / `CommandCatalogEntry` (`command_catalog.dart`) — 등록된 CommandSpec 목록과 sample 존재 여부 조회 - `CommandRuntime` / `DefaultCommandRuntime` (`command_runtime.dart`) — 커맨드 외부 프로세스 실행 추상화 - `DataParam` (`base_data.dart`) — 모든 커맨드 파라미터의 베이스 - `DataBuild` / `DataScheduler` (`command_data.dart`) — YAML 최상위 build/scheduler 데이터 @@ -52,6 +60,7 @@ - 새 커맨드는 반드시 `Command` 상속 후 카테고리별 `register*Command(s)()` 함수와 `registerAllCommands()` 경로에 등록 - `Command.register()`에는 `CommandSpec`을 함께 전달해 category, dataModel, samplePath를 기록 - 파라미터 모델은 `DataParam` 상속 + `@JsonSerializable` +- `CommandCatalog`와 CLI `catalog` 출력은 `CommandSpec`을 기준으로 하므로 신규 커맨드의 category/dataModel/samplePath 누락 여부를 함께 확인한다 - `*.g.dart`는 `dart run build_runner build`로 생성한다. 생성 파일 직접 수정은 생성 불가한 긴급 상황에서만 한다 - `getWorkspace()`: workspace 필드 → `property['workspace']` → `commonData.workspace` 순으로 resolve - 커맨드 파라미터는 `getParam(command)`를 통해 태그 치환과 workspace resolve를 거친 뒤 `Data*` 모델로 파싱한다 @@ -65,6 +74,7 @@ - **pipeline**: `Command.execute(DataCommand)`를 호출하는 시점이 경계. 커맨드는 흐름을 모른다 - **core**: 태그 치환은 core가 완료한 후 DataCommand가 커맨드에 전달됨 +- **cli**: CLI `catalog`/`validate`는 command/core 정보를 읽어 출력하거나 검증하지만 커맨드 실행 로직은 command 도메인에 남긴다 - **sample**: YAML 사용 예시는 sample 도메인이 담당한다. 커맨드 파라미터 변경 시 sample 도메인과 동기화한다 - **framework**: `dart_framework`의 `ProcessExecutor`, path/system 유틸은 외부 런타임 의존성으로 사용한다. OTO 비즈니스 로직을 framework 의존성 쪽으로 옮기지 않는다 diff --git a/agent-ops/rules/project/domain/core/rules.md b/agent-ops/rules/project/domain/core/rules.md index 6b00b79..73caafa 100644 --- a/agent-ops/rules/project/domain/core/rules.md +++ b/agent-ops/rules/project/domain/core/rules.md @@ -1,3 +1,9 @@ +--- +domain: core +last_rule_review_commit: 67d7b6e411b8a28d6d42cac550a29872a7ef6b7e +last_rule_updated_at: 2026-06-01 +--- + # core ## 목적 / 책임 @@ -17,6 +23,7 @@ - `lib/oto/pipeline/` — 실행 흐름 (core 처리 이후) - `lib/oto/commands/` — 커맨드 구현체 (core 결과물을 소비) +- `lib/oto/agent/` — OTO Edge agent 설정/등록/통신 (`agent` 도메인) - `assets/script/`의 빌드/패키징 보조 스크립트 — CLI/배포 보조 asset이며 core가 직접 해석하지 않는다 ## 주요 구성 요소 @@ -26,6 +33,7 @@ - `DefinedData` (`defined_data.dart`) — 내장 YAML 템플릿 (빌트인 정의) - `ExecutionContext` (`execution_context.dart`) — commonData, property, command state, command map 런타임 컨테이너 - `BuildResult` (`build_result.dart`) — CLI 진입점에 전달되는 빌드 성공/실패 결과 +- `YamlValidationResult` (`application.dart`) — YAML 검증 CLI가 사용하는 구조화 검증 결과 - `SystemRuntime` / `DefaultSystemRuntime` (`system_runtime.dart`) — OS 환경·프로세스 실행 추상화 - `MattermostSender` / `MattermostData` (`utils/mattermost/`) — 공통 알림 헬퍼 - `Application` (`application.dart`) — build type 분기, command 등록, property 초기화, pipeline 실행 @@ -36,6 +44,7 @@ - 태그 전체 문자열이면 원본 타입 유지, 부분 삽입이면 `toString()` 변환 원칙 유지 - YAML 문자열 → Map 변환은 `Application.getMapFromYamlA()` 흐름을 유지 - 커맨드 등록은 `registerAllCommands()` 호출 이후 command catalog validation과 pipeline validate를 수행 +- 실행 없는 YAML 검증은 `Application.validateYamlContent()`에서 build map, command list, command map, pipeline 초기화 순서로 확인한다 - property 기본값에 `workspace`가 없으면 `Application.current`를 채우는 흐름을 유지 - 테스트 가능한 OS/프로세스 의존 로직은 `SystemRuntime`을 통해 주입 가능한 구조를 유지 - Jenkins env helper script 변경 시 `DataComposer`의 호출 경로와 환경 변수 파싱 결과를 함께 확인한다 @@ -46,11 +55,13 @@ - **pipeline**: DataComposer가 DataCommand 리스트 생성을 완료한 후 Pipeline이 실행 시작 - **command**: 커맨드 실행 중 쓰기 태그(`<@...>`) 처리는 TagSystem에 위임 - **cli/scheduler**: build type, YAML content, scheduler build data는 cli/scheduler에서 넘기지만 실제 build 흐름과 `BuildResult` 생성은 Application이 담당 +- **agent**: agent config 파싱과 Edge 등록은 core가 아니라 agent 도메인이다. core의 YAML 파싱/검증 흐름과 agent bootstrap config를 섞지 않는다 - **sample**: 태그 문법이나 YAML 구조가 변경되면 sample 도메인의 YAML 예시를 함께 점검 ## 금지 사항 - core에서 외부 시스템(Git, Jenkins API 등)을 직접 호출하지 않는다 +- core에서 OTO Edge agent 등록 또는 proto socket 통신을 수행하지 않는다 - 커맨드별 파싱 로직을 DataComposer에 넣지 않는다 - pipeline 흐름 제어(if/foreach/switch 등)를 core에 넣지 않는다 - command별 실행 결과 처리 로직을 `Application`에 추가하지 않는다 diff --git a/agent-ops/rules/project/domain/framework/rules.md b/agent-ops/rules/project/domain/framework/rules.md index 91c53d5..0b4f993 100644 --- a/agent-ops/rules/project/domain/framework/rules.md +++ b/agent-ops/rules/project/domain/framework/rules.md @@ -1,3 +1,9 @@ +--- +domain: framework +last_rule_review_commit: 67d7b6e411b8a28d6d42cac550a29872a7ef6b7e +last_rule_updated_at: 2026-06-01 +--- + # framework ## 목적 / 책임 @@ -23,6 +29,9 @@ - `dart_framework/platform/isolate_manager.dart` — CLI 실행/스케줄러 isolate 처리에서 사용 - `dart_framework/utils/*` — `simpleFuture`, path/system/string/os startup 유틸 사용 - `dart_framework/log/log.dart` — `Application.logWithType()`의 로그 타입에 사용 +- `proto_socket` — agent Edge 등록 통신에서 사용하는 workspace 상위 path dependency +- `protobuf` / `fixnum` — `lib/oto/agent/**`의 generated protobuf 코드 런타임 의존성 +- `resource_importer` — `lib/resources.resource_importer.dart` 생성 파일과 asset 임베딩 설정 ## 유지할 패턴 @@ -30,6 +39,7 @@ - `dart_framework` API 사용 시 기존 import 패턴을 따른다 - 외부 의존성 ref 변경은 `pubspec.yaml`에서만 수행하고, 변경 후 `dart pub get` 및 `dart analyze`를 확인한다 - analyzer/lint 기준 변경은 기존 코드 전체에 영향을 줄 수 있으므로 `dart analyze` 결과와 필요한 수정 범위를 함께 확인한다 +- generated protobuf lint 예외는 `analysis_options.yaml`의 analyzer exclude 또는 파일 생성 주석으로 관리한다 - 로컬에 `lib/framework/`를 되살리는 대신 필요한 OTO 로직은 `lib/oto/` 또는 `lib/cli/`의 해당 도메인에 둔다 ## 다른 도메인과의 경계 @@ -37,9 +47,11 @@ - **core**: `lib/oto/application.dart`는 OTO 오케스트레이터이며 외부 framework의 Application과 별개다 - **cli/scheduler**: isolate, process, OS startup 유틸을 소비하지만 스케줄러 정책은 scheduler 도메인에 둔다 - **command**: 커맨드들은 `ProcessExecutor`를 소비하지만 커맨드별 비즈니스 로직은 command 도메인에 둔다 +- **agent**: `proto_socket`, `protobuf`, `fixnum` 의존성은 framework 도메인에서 관리하지만 Edge 등록 프로토콜과 agent 정책은 agent 도메인에 둔다 ## 금지 사항 - `lib/framework/` 디렉터리를 새로 만들지 않는다 - 외부 `dart_framework` 내부 코드를 이 저장소의 도메인 rule 기준으로 직접 수정한다고 가정하지 않는다 - OTO 비즈니스 로직(파이프라인, 커맨드 등록 등)을 framework 의존성 변경으로 해결하려 하지 않는다 +- generated dependency/runtime 코드를 수동 수정으로 문제 해결하려 하지 않는다 diff --git a/agent-ops/rules/project/domain/pipeline/rules.md b/agent-ops/rules/project/domain/pipeline/rules.md index 45e5027..c1578ea 100644 --- a/agent-ops/rules/project/domain/pipeline/rules.md +++ b/agent-ops/rules/project/domain/pipeline/rules.md @@ -1,3 +1,9 @@ +--- +domain: pipeline +last_rule_review_commit: 67d7b6e411b8a28d6d42cac550a29872a7ef6b7e +last_rule_updated_at: 2026-06-01 +--- + # pipeline ## 목적 / 책임 @@ -8,6 +14,7 @@ YAML에서 파싱된 `DataCommand` 리스트를 순차 실행하고, 조건 분 ## 포함 경로 - `lib/oto/pipeline/` — 파이프라인 실행 엔진 전체 +- `lib/oto/data/pipeline_data.dart` — workflow, 조건, 반복, switch 등 pipeline 데이터 모델 ## 제외 경로 @@ -27,6 +34,7 @@ YAML에서 파싱된 `DataCommand` 리스트를 순차 실행하고, 조건 분 - `PipelineForeach` / `PipelineWhile` — 반복 흐름 - `PipelineContain` — 중첩 파이프라인 - `PipelineWaitUntil` / `PipelineWaitUntilSeconds` — 조건 기반 또는 초 단위 대기 흐름 +- `DataPipeline`, `DataIf`, `DataForeach`, `DataWhile`, `DataSwitch`, `DataExeHandle` — pipeline YAML 구조 검증/파싱 모델 ## 유지할 패턴 @@ -40,6 +48,7 @@ YAML에서 파싱된 `DataCommand` 리스트를 순차 실행하고, 조건 분 ## 다른 도메인과의 경계 - **command**: `Pipeline`이 `Command.byType()`을 호출하는 시점이 경계. 커맨드 내부 로직은 pipeline이 모른다 +- **command data**: `DataCommand`와 커맨드 파라미터 모델은 command 도메인이고, workflow 흐름 모델인 `pipeline_data.dart`만 pipeline 도메인이다 - **core**: `DataComposer`가 YAML → `DataCommand` 변환을 마친 후 pipeline이 실행 시작 - **sample**: workflow 문법 변경 시 `assets/yaml/sample/02_*`~`05_*`와 README 흐름 제어 예시를 함께 점검 diff --git a/agent-ops/rules/project/domain/sample/rules.md b/agent-ops/rules/project/domain/sample/rules.md index a0deb00..04724a0 100644 --- a/agent-ops/rules/project/domain/sample/rules.md +++ b/agent-ops/rules/project/domain/sample/rules.md @@ -1,3 +1,9 @@ +--- +domain: sample +last_rule_review_commit: 67d7b6e411b8a28d6d42cac550a29872a7ef6b7e +last_rule_updated_at: 2026-06-01 +--- + # sample ## 목적 / 책임 @@ -10,10 +16,10 @@ AI가 파이프라인 YAML을 작성하거나 검토할 때 가장 먼저 읽는 - `assets/yaml/sample/` — 카테고리별 샘플 YAML 파일 -## 제거된 레거시 경로 +## 레거시 / 비사용 경로 -- `assets/yaml/example/` — 기존 실험용 파일. 새 예제 재작성 전 혼선을 줄이기 위해 제거됨 -- `assets/templates/` — 알림 테스트 템플릿. 새 예제 재작성 전 혼선을 줄이기 위해 제거됨 +- `assets/yaml/example/` — 현재 tracked 샘플 파일은 없으며 샘플 작성 기준으로 사용하지 않는다 +- `assets/templates/` — 현재 tracked 템플릿 파일은 없으며 샘플 작성 기준으로 사용하지 않는다 - 루트/`assets/` 하위의 구형 테스트 YAML/XML (`build_*.yaml`, `slack_test.yaml`, `pipeline-test*.yaml`, `scheduler*.yaml`, `assets/config.xml`, `assets/example.yaml`)은 현재 형상과 맞지 않아 제거됨 ## 제외 경로 diff --git a/agent-ops/rules/project/domain/scheduler/rules.md b/agent-ops/rules/project/domain/scheduler/rules.md index de57902..bc67a4e 100644 --- a/agent-ops/rules/project/domain/scheduler/rules.md +++ b/agent-ops/rules/project/domain/scheduler/rules.md @@ -1,3 +1,9 @@ +--- +domain: scheduler +last_rule_review_commit: 67d7b6e411b8a28d6d42cac550a29872a7ef6b7e +last_rule_updated_at: 2026-06-01 +--- + # scheduler ## 목적 / 책임 diff --git a/agent-ops/rules/project/rules.md b/agent-ops/rules/project/rules.md index 5dcaff9..d7a298a 100644 --- a/agent-ops/rules/project/rules.md +++ b/agent-ops/rules/project/rules.md @@ -25,6 +25,7 @@ bin/main.dart lib/ ├── cli/ # CLI 레이어 (명령 파싱, 스케줄러 관리) └── oto/ + ├── agent/ # OTO Edge agent 등록/통신 ├── application.dart # 싱글턴 오케스트레이터, BuildType enum ├── commands/ # 커맨드 구현체 (카테고리별) ├── core/ # 태그 시스템, 데이터 합성, 정의 데이터 @@ -38,7 +39,7 @@ lib/ ## 기술 스택 - 언어: Dart (SDK >=3.2.3 <4.0.0) -- 의존성: dart_framework (커스텀), proto_socket (상위 `../proto-socket/dart` path dependency), http, json_annotation, cron, xml +- 의존성: dart_framework (커스텀), proto_socket (상위 `../proto-socket/dart` path dependency), http, json_annotation, cron, xml, protobuf/fixnum, resource_importer - 코드 생성: json_serializable + build_runner (`dart run build_runner build`) ## BuildType @@ -99,12 +100,16 @@ lib/ | 경로 패턴 | 도메인 | rules.md | |----------|--------|----------| | `bin/main.dart` | cli | `agent-ops/rules/project/domain/cli/rules.md` | +| `lib/resources.resource_importer.dart` | cli | `agent-ops/rules/project/domain/cli/rules.md` | | `lib/oto/pipeline/**` | pipeline | `agent-ops/rules/project/domain/pipeline/rules.md` | | `lib/oto/commands/**` | command | `agent-ops/rules/project/domain/command/rules.md` | +| `lib/oto/data/pipeline_data.dart` | pipeline | `agent-ops/rules/project/domain/pipeline/rules.md` | | `lib/oto/data/**` | command | `agent-ops/rules/project/domain/command/rules.md` | +| `lib/cli/commands/command_agent.dart` | agent | `agent-ops/rules/project/domain/agent/rules.md` | | `lib/cli/commands/scheduler/**` | scheduler | `agent-ops/rules/project/domain/scheduler/rules.md` | | `lib/cli/commands/command_scheduler.dart` | scheduler | `agent-ops/rules/project/domain/scheduler/rules.md` | | `lib/cli/**` | cli | `agent-ops/rules/project/domain/cli/rules.md` | +| `lib/oto/agent/**` | agent | `agent-ops/rules/project/domain/agent/rules.md` | | `lib/oto/application.dart` | core | `agent-ops/rules/project/domain/core/rules.md` | | `lib/oto/core/**` | core | `agent-ops/rules/project/domain/core/rules.md` | | `lib/oto/utils/**` | core | `agent-ops/rules/project/domain/core/rules.md` | @@ -113,6 +118,7 @@ lib/ | `assets/yaml/sample/**` | sample | `agent-ops/rules/project/domain/sample/rules.md` | | `assets/package/**` | cli | `agent-ops/rules/project/domain/cli/rules.md` | | `assets/bin/**` | cli | `agent-ops/rules/project/domain/cli/rules.md` | +| `assets/script/shell/oto_agent_bootstrap.sh` | agent | `agent-ops/rules/project/domain/agent/rules.md` | | `assets/script/**` | cli | `agent-ops/rules/project/domain/cli/rules.md` | | `pubspec.yaml` | framework | `agent-ops/rules/project/domain/framework/rules.md` | | `analysis_options.yaml` | framework | `agent-ops/rules/project/domain/framework/rules.md` |