Development
Getting Started¶
git clone https://github.com/kenn-io/roborev
cd roborev
go test ./...
make install # Installs with version info (e.g., v0.7.0-5-gabcdef)
Or use go install ./cmd/... for quick iteration (version shows commit hash only).
Project Structure¶
roborev/
├── cmd/roborev/ # CLI entry point
├── internal/
│ ├── daemon/ # HTTP API server and worker pool
│ ├── storage/ # SQLite operations
│ ├── agent/ # Agent interface and implementations
│ └── config/ # Configuration loading
├── scripts/ # Install and utility scripts
└── docs/ # This documentation site
Architecture¶
- Daemon: HTTP server on port 7373 (auto-finds available port if busy)
- Workers: Pool of 4 (configurable) parallel review workers
- Storage: SQLite at
~/.roborev/reviews.dbwith WAL mode
Key Files¶
| Path | Purpose |
|---|---|
cmd/roborev/main.go |
CLI entry point, all commands |
internal/daemon/server.go |
HTTP API handlers |
internal/daemon/worker.go |
Worker pool, job processing |
internal/storage/ |
SQLite operations |
internal/agent/ |
Agent interface + implementations |
internal/config/config.go |
Config loading, agent resolution |
Adding a New Agent¶
- Create
internal/agent/newagent.go - Implement the
Agentinterface:
type Agent interface {
Name() string
Review(ctx context.Context, repoPath, commitSHA, prompt string) (string, error)
}
- Call
Register()ininit()
Database Schema¶
Tables: repos, commits, review_jobs, reviews, responses
Job states: queued -> running -> done/failed
Conventions¶
- HTTP over gRPC: Simple HTTP/JSON for the daemon API
- No CGO in releases: Build with
CGO_ENABLED=0for static binaries (except sqlite which needs CGO locally) - Test agent: Use
agent = "test"for testing without calling real AI - Isolated tests: All tests use
t.TempDir()for temp directories
Testing¶
Building¶
License¶
MIT