# AGENTS.md ## Repo layout - `pipeline-runner/` — C++ application built with PIP (Platform Independent Primitives). - `pipeline-runner/src/main.cpp` — entry point, config loading, server start. - `pipeline-runner/src/server.h/.cpp` — PIHTTPServer routes, all API endpoints. - `pipeline-runner/src/pipeline.h/.cpp` — Pipeline/Prompt structs, JSON file I/O, log functions. - `pipeline-runner/src/runner.h/.cpp` — async pipeline execution (PIThread + PIProcess per step). - `pipeline-runner/src/messageutils.h/.cpp` — HTTP response helpers (JSON, error, success). - `pipeline-runner/pipeline-runner.conf` — JSON config file (port, directories). - `pipeline-runner/tests/` — gtest tests for pipeline storage and runner. - `pipeline-runner/CMakeLists.txt` — CMake build config with PIP + gtest (FetchContent). - `pipeline-runner/storage/pipelines/` — JSON files for persisted pipelines. - `pipeline-runner/storage/logs/` — execution logs (one file per run). ## Dev commands - Build: `cd pipeline-runner/build && cmake .. && make` - Run: `cd pipeline-runner/build && ./pipeline-runner ../pipeline-runner.conf` - Run tests: `cd pipeline-runner/build && ./test-pipeline-runner` - Clean build: `rm -rf pipeline-runner/build && mkdir pipeline-runner/build && cd pipeline-runner/build && cmake .. && make` ## API endpoints | Method | Path | Description | |--------|------|-------------| | GET | `/api/pipelines` | List all pipelines | | POST | `/api/pipelines` | Create pipeline (JSON body) | | GET | `/api/pipelines/{id}` | Get single pipeline | | DELETE | `/api/pipelines/{id}` | Delete pipeline | | POST | `/api/runs` | Start execution (`{"pipeline_id": "..."}`) | | GET | `/api/runs/{run_id}/status` | Poll run status + step results | | GET | `/api/runs/{run_id}/log` | Get log file contents | ## Key behaviors - Pipeline execution runs `opencode run --title ` per step via `PIProcess`. - Pipeline stops on first step error (non-zero return code). - Each run executes in a separate `PIThread`. - CORS headers are added to all responses (`Access-Control-Allow-Origin: *`). - Config is loaded from `pipeline-runner.conf` (JSON format).