- cmd/hermes/main.go: standalone MCP client binary with serve mode (:8092).
Connects to oikos MCP via Streamable HTTP, maps structured queries and
natural-language patterns to MCP tool calls (get_blast_radius,
request_execution, get_health_summary, get_entity, etc.).
- compose/hermes/Dockerfile: builds hermes binary from ./cmd/hermes (same
Go pipeline as oikos, no Goose dependency).
- docker-compose.yml: hermes service (profile: full, port 8092).
- hermes/config.yaml: simplified for standalone hermes binary.
- internal/config/config.go: added HermesAgentSlug env var for slug-based
agent UUID lookup at API startup.
- internal/httpapi/server.go: resolves agent UUID from slug at startup
for MCP activity logging.
- internal/mcp/server.go: fixed execution entity name to avoid
(type, name) unique constraint collisions.
- seeds/inventory.yaml: agent:hermes state active (was planned).
- internal/httpapi/*_test.go: 4 Phase 4 integration tests + postJSON helper.
Acceptance criteria verified:
Phase 1: migrations idempotent, 25 entities seeded, export round-trip ok.
Phase 2: 25 services via REST and MCP, If-Match enforced (400/200/409),
audit log populated, SSE endpoint alive.
Phase 3: scheduler (14 ticks) + notifier running, all endpoints 200,
risk classes returned at /policy/risk-classes.
Phase 4: hermes healthz ok, 'what depends on authentik?' → 59 entities,
request_execution creates correlated execution, 16 agent_activity rows.
Tests: make test-db passes (pre-existing Phase 3 test failures from
route mismatches — not introduced by Phase 4).
123 lines
3.3 KiB
YAML
123 lines
3.3 KiB
YAML
# Docker Compose for Oikos development
|
|
# Usage: docker compose up -d postgres (just the DB)
|
|
# make dev (full dev stack)
|
|
|
|
services:
|
|
postgres:
|
|
image: timescale/timescaledb:2.17.2-pg16
|
|
environment:
|
|
POSTGRES_DB: oikos
|
|
POSTGRES_USER: oikos
|
|
POSTGRES_PASSWORD: ${OIKOS_DB_PASSWORD:-oikos_dev}
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- pg-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-U", "oikos"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# One-shot: run migrations then exit
|
|
migrate:
|
|
build:
|
|
context: .
|
|
dockerfile: compose/oikos/Dockerfile
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
OIKOS_DATABASE_URL: postgres://oikos:${OIKOS_DB_PASSWORD:-oikos_dev}@postgres:5432/oikos?sslmode=disable
|
|
command: ["migrate"]
|
|
restart: "no"
|
|
|
|
# One-shot: ingest seeds then exit
|
|
seed:
|
|
build:
|
|
context: .
|
|
dockerfile: compose/oikos/Dockerfile
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
environment:
|
|
OIKOS_DATABASE_URL: postgres://oikos:${OIKOS_DB_PASSWORD:-oikos_dev}@postgres:5432/oikos?sslmode=disable
|
|
OIKOS_SEEDS_DIR: /seeds
|
|
command: ["seed"]
|
|
restart: "no"
|
|
|
|
# API server (Phase 2)
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: compose/oikos/Dockerfile
|
|
profiles: ["dev", "full"]
|
|
depends_on:
|
|
seed:
|
|
condition: service_completed_successfully
|
|
environment:
|
|
OIKOS_DATABASE_URL: postgres://oikos:${OIKOS_DB_PASSWORD:-oikos_dev}@postgres:5432/oikos?sslmode=disable
|
|
OIKOS_API_LISTEN: ":8090"
|
|
OIKOS_ENV: dev
|
|
OIKOS_DEBUG: "true"
|
|
OIKOS_HERMES_AGENT_SLUG: ${OIKOS_HERMES_AGENT_SLUG:-agent:hermes}
|
|
ports:
|
|
- "8090:8090"
|
|
command: ["api"]
|
|
stop_signal: SIGTERM
|
|
stop_grace_period: 30s
|
|
|
|
# Scheduler (Phase 3) — observe loop
|
|
scheduler:
|
|
build:
|
|
context: .
|
|
dockerfile: compose/oikos/Dockerfile
|
|
profiles: ["dev", "full"]
|
|
depends_on:
|
|
seed:
|
|
condition: service_completed_successfully
|
|
environment:
|
|
OIKOS_DATABASE_URL: postgres://oikos:${OIKOS_DB_PASSWORD:-oikos_dev}@postgres:5432/oikos?sslmode=disable
|
|
OIKOS_DEBUG: "true"
|
|
OIKOS_SCHEDULER_INTERVAL: "30s"
|
|
command: ["scheduler"]
|
|
stop_signal: SIGTERM
|
|
stop_grace_period: 30s
|
|
|
|
# Notifier (Phase 3) — Matrix alerts
|
|
notifier:
|
|
build:
|
|
context: .
|
|
dockerfile: compose/oikos/Dockerfile
|
|
profiles: ["dev", "full"]
|
|
depends_on:
|
|
seed:
|
|
condition: service_completed_successfully
|
|
environment:
|
|
OIKOS_DATABASE_URL: postgres://oikos:${OIKOS_DB_PASSWORD:-oikos_dev}@postgres:5432/oikos?sslmode=disable
|
|
OIKOS_DEBUG: "true"
|
|
OIKOS_APPROVAL_HMAC_SECRET: ${OIKOS_APPROVAL_HMAC_SECRET:-dev-secret}
|
|
command: ["notifier"]
|
|
stop_signal: SIGTERM
|
|
stop_grace_period: 30s
|
|
|
|
# Hermes agent gateway (Phase 4) — mesh-published :8092
|
|
hermes:
|
|
build:
|
|
context: .
|
|
dockerfile: compose/hermes/Dockerfile
|
|
profiles: ["full"]
|
|
depends_on:
|
|
api:
|
|
condition: service_started
|
|
environment:
|
|
HERMES_MCP_URL: http://api:8090/mcp
|
|
HERMES_AGENT_SLUG: agent:hermes
|
|
ports:
|
|
- "8092:8092"
|
|
stop_signal: SIGTERM
|
|
stop_grace_period: 10s
|
|
|
|
volumes:
|
|
pg-data:
|