feat: add sqlite-backed API docs and tests
All checks were successful
ci / test-and-build (push) Successful in 11m21s

This commit is contained in:
Steve W
2026-04-11 18:42:05 +00:00
parent 87efe766a2
commit f0275c41d0
9 changed files with 304 additions and 5 deletions

33
README.md Normal file
View File

@@ -0,0 +1,33 @@
# work-queue-api
Lightweight internal work queue API for TheLab agents.
## Features
- Go HTTP API with chi router
- SQLite storage, auto-migrated on startup
- Projects and work items endpoints from `SPEC.md`
- Dispatch history tracking
- Enforces one `in_progress` item per agent
- No auth, binds to port `8080` by default
## Run locally
```bash
export DATABASE_URL=./work_queue.db
export PORT=8080
~/.local/go/bin/go run ./cmd/work-queue-api
```
## Build
```bash
~/.local/go/bin/go build ./cmd/work-queue-api
```
## Endpoints
- `GET /health`
- `POST/GET/PATCH /projects`
- `POST/GET/PATCH/DELETE /work`
## Notes
- `POST /work` accepts `assigned_agent`, but still creates the item in `queued`
- `PATCH /work/:id` enforces status transitions from the spec
- `DELETE /work/:id` cancels queued or dispatched work items