Briefcase Server
The Briefcase Server is an Actix-web HTTP API that exposes the Rust core's functionality over REST.
Configuration
| Environment Variable | Default | Description |
|---|---|---|
BRIEFCASE_HOST | 0.0.0.0 | Bind address (production: api.briefcasebrain.com via Route 53) |
BRIEFCASE_PORT | 8080 | Listen port |
BRIEFCASE_DATABASE_URL | briefcase.db | SQLite database path |
BRIEFCASE_MAX_CONNECTIONS | 10 | Connection pool size |
BRIEFCASE_REQUEST_TIMEOUT | 30 | Request timeout (seconds) |
Endpoints
Health
| Method | Path | Description |
|---|---|---|
| GET | /health | Health check |
| GET | /info | Server version and status |
Decisions
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/decisions | Create a decision snapshot |
| GET | /api/v1/decisions/{id} | Retrieve a decision |
| GET | /api/v1/decisions | List decisions (with filters) |
| DELETE | /api/v1/decisions/{id} | Delete a decision |
Create Decision Request:
{
"function_name": "evaluate_claim",
"module_name": "claims",
"inputs": [{"value": "claim_data", "type": "json"}],
"outputs": [{"value": "approved", "type": "string", "confidence": 0.95}],
"model_params": {"name": "gpt-4", "version": "0613", "provider": "openai"},
"execution_time_ms": 1250,
"tags": {"environment": "production"}
}
Replay
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/replay/{id} | Replay a single decision |
| POST | /api/v1/replay/batch | Batch replay with concurrency |
| POST | /api/v1/replay/{id}/validate | Validate against policy rules |
| POST | /api/v1/replay/stats | Get replay statistics |
Replay modes: strict, tolerant, validation_only
Diff
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/diff | Compare two decision snapshots |
Running the Server
# From source
cargo run -p briefcase-server
# With custom config
BRIEFCASE_PORT=9090 BRIEFCASE_DATABASE_URL=prod.db cargo run -p briefcase-server
Deployment
The server is containerized and can be deployed to managed container platforms (for example ECS, Kubernetes, or equivalent orchestrators).
- Recommended production posture:
- run behind HTTPS via API gateway or load balancer
- expose
/healthfor readiness/liveness checks - configure storage and timeouts via environment variables
You can build and run the container locally:
docker build -t briefcase-server .
docker run --rm -p 8080:8080 briefcase-server
curl http://localhost:8080/health