21
API route paths (`src/openapi.json`)
NullClaw | Autonomous AI Ecosystem
Zig task-state backend for autonomous delivery systems: pipeline definitions, queueing, lease-based claiming, stage transitions, gate checks, artifacts, and operational queue analytics.
API route paths (`src/openapi.json`)
SQLite tables in initial migration
OTLP ingest endpoints (`/v1/traces`, `/otlp/v1/traces`)
default lease TTL for claim/heartbeat
git clone https://github.com/nullclaw/nulltickets.git
cd nulltickets
zig build -Doptimize=ReleaseSmall
./zig-out/bin/nulltickets --port 7700 --db /tmp/nulltickets.db
# health + openapi discovery
curl -s http://127.0.0.1:7700/health
curl -s http://127.0.0.1:7700/openapi.json
# create pipeline
curl -s -X POST http://127.0.0.1:7700/pipelines \
-H 'Content-Type: application/json' \
-d '{"name":"dev-pipeline","definition":{"initial":"research","states":{"research":{"agent_role":"researcher"},"coding":{"agent_role":"coder"},"done":{"terminal":true}},"transitions":[{"from":"research","to":"coding","trigger":"complete"},{"from":"coding","to":"done","trigger":"complete"}]}}'
# claim work for a role
curl -s -X POST http://127.0.0.1:7700/leases/claim \
-H 'Content-Type: application/json' \
-d '{"agent_id":"researcher-1","agent_role":"researcher"}'Source basis: `src/main.zig`, `src/api.zig`, `src/domain.zig`, `src/store.zig`, `src/migrations/001_init.sql`, and `src/openapi.json`.
Definitions must include valid `initial`, known transition states, at least one terminal state, and outgoing transitions for each non-terminal state.
Worker agents claim tasks by role, receive `lease_token`, and then must call run mutation endpoints with `Authorization: Bearer <lease_token>`.
Write endpoints support `Idempotency-Key`; key reuse with different body returns `409 idempotency_conflict`.
Stage transitions can require gates (`required_gates`) and queue-level stats are available via `GET /ops/queue` (`claimable`, `stuck`, `near_expiry`).