Skip to main content

Development & testing

A Makefile at the repo root wraps the day-to-day commands so you don’t have to remember the uv incantations.

Targets at a glance

Run the platform locally

Shortcut: in Claude Code, /run-platform does all of this, on your local machine only (for staging or prod, see platform/DEPLOY.md). It checks prerequisites and prints what’s missing (uv, pnpm, Docker, Go, busy ports). It starts the platform-api and dashboard, and hands back the dashboard URL plus the first-boot admin password. Ask for the full pipeline to get the collector and enricher too. Without Claude, .claude/skills/run-platform/preflight.sh [--full] runs the same prerequisite check. The platform is four processes plus your agent. Two of them — the collector and the span-enricher, with the Redpanda buffer their targets start for you — make up the audit pipeline, and an agent run without them looks fine while its audit trail silently 404s, so start all of them. Each make target starts the Docker infrastructure it needs (Postgres, Redpanda, ClickHouse) and then blocks, one terminal each:
Then mint a key at http://localhost:5173/tokens and give it to the SDK. There is no reverse proxy locally, so the SDK also needs to be told where the collector is; on a deployed stage the proxy routes /v1/traces and this line is unnecessary:
Every decision the agent makes shows up on the dashboard’s audit page a few seconds later (the collector batches for 5 s). To check the pipeline without an agent, make platform-smoke sends one of every event type and reads them back. It reads its config straight from the environment — no .env — so export these first, or it silently exercises nothing:
deploy/provision.py mints a key from the command line when you don’t want to go through the dashboard — the integration-tests skill uses it. First-time setup: make platform-api-install, make dashboard-install, and a collector binary. The generated collector sources are committed, so the binary is just cd platform/collector && go build -o hexgate-collector .; you only need make collector-generate after editing builder-config.yaml, and that target calls the ocb builder, which make collector-install-builder puts on $PATH once. Unset HEXGATE_API_KEY / HEXGATE_API_URL / HEXGATE_OTLP_ENDPOINT before running the unit suite: some tests assert that no platform is configured.

Using an existing virtualenv

By default uv manages its own .venv (created by make install-dev). If you keep your dev environment elsewhere — e.g. a micromamba env — point uv at it once and make picks it up:
Drop the export into your shell rc (or a direnv .envrc) and forget about it. Without --extra dev, pytest-asyncio is missing and you’ll see “async functions are not natively supported” across every async test — same trap on a fresh env.

Platform-side test suite

The platform-side test suite is separate and lives at platform/api/tests/: