Specimen A-03: Hatchery governance crab anatomy

Hatchery

AI agent orchestration with graduated trust escalation

Agents earn autonomy through demonstrated competence. Not configuration. The reference implementation of the SLOBSTAH governance protocol.

v0.3.0 101 Tests Passing Apache 2.0
# Install and run pip install hatchery-ai hatchery # Dashboard at http://localhost:8000 # API docs at http://localhost:8000/docs # Register an agent (Ollama, local LLM) curl -X POST http://localhost:8000/api/agents \ -H 'Content-Type: application/json' \ -d '{"name":"scout","agent_type":"ollama","endpoint":"http://localhost:11434","config":{"model":"llama3"}}' # Start chatting curl -X POST http://localhost:8000/api/chat \ -H 'Content-Type: application/json' \ -d '{"agent_id":"AGENT_ID","message":"What can you do?"}' # Or just open the dashboard and start typing.
What You Get
πŸ’¬
Chat Interface
Talk to your agents directly from the dashboard. Conversation memory persists across sessions. Slash commands for everything. Thinking animation while agents process.
🀝
Agent-to-Agent Delegation
Agents delegate subtasks to other agents. Results flow back up the chain. Every delegation goes through the same trust governance. Full audit trail.
πŸ“Š
Graduated Trust
Trust scores computed from real outcomes: 70% success rate + 30% volume. Agents earn autonomy through demonstrated competence. Irreversible actions always require human approval.
πŸ“‹
4-Tier Approval System
Free actions auto-execute. Small actions get logged. Medium actions need approval. Big or irreversible actions require the Admiral. Trust scores can promote agents through tiers.
πŸ‘€
Soul Files
Agent personalities loaded from markdown files. Write a persona, load it with one command. Five example personas included: researcher, writer, ops, code reviewer, project lead.
πŸ’°
Revenue P&L
Track income and expenses per revenue stream. Task compute costs auto-logged. P&L breakdowns by stream, source, and period. The organism funds itself.
πŸ†
Performance Scorecard
Six weighted metrics. Competitive compute allocation. Top scorers earn more resources. New agents get a 180-day runway. Monthly reviews with automatic rebalancing.
πŸ”
Full Audit Trail
Every action logged immutably. Who did what, when, at what cost, and who approved it. Queryable by entity type, actor, and time range.
Architecture
Chat Interface + Dashboard Single HTML file, vanilla JS, no build step β”‚ FastAPI REST API /api/chat /api/tasks /api/agents /api/trust /api/revenue /api/scorecard β”‚ Task Engine create β†’ tier β†’ approve β†’ dispatch ← trust feedback loop β†’ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Adapters β”‚ Governance (JSON) β”‚ β”‚ Ollama β”‚ ComputeLedger β”‚ β”‚ Shell β”‚ PerformanceScorecardβ”‚ β”‚ Claude Code β”‚ RevenueTracker β”‚ β”‚ HTTP β”‚ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ SQLite β”‚ Soul Files (markdown)β”‚ β”‚ tasks, agents β”‚ Agent personas β”‚ β”‚ runs, audit β”‚ Loaded on demand β”‚ β”‚ chat_history β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Python 3.13+ Β· FastAPI Β· Pydantic Β· SQLite No external database. No Redis. No Docker required. Zero external dependencies beyond FastAPI.
Documentation & Guides
README
Full feature overview, install instructions, API reference, and architecture.
start here
Quickstart
From zero to chatting with an agent in 60 seconds. Register agents, send tasks, toggle trust.
getting started
v0.3.0 Release Notes
Chat interface, agent delegation, soul files, Ollama adapter. Full changelog.
changelog
SLOBSTAH Protocol
The governance spec. LOBSTER hierarchy, BARNACLE scoring, REEF budgets, and all the other acronyms.
protocol
Example Soul Files
Five agent personas ready to use: researcher, writer, ops, code reviewer, project lead.
templates
Package Config
Dependencies, build config, and project metadata. Python 3.13+, Apache 2.0.
reference
Dashboard Commands
/helpShow all commands
/agentsList registered agents
/trustShow trust scores
/healthPing agent endpoints
/statusSystem overview
/soulsLoad agents from soul files
/approve [id]Approve a pending task
/deny [id]Deny a pending task
/history clearClear chat history
API Reference
MethodEndpointDescription
POST/api/chatChat with an agent (auto-dispatch)
GET/api/chat/history/{id}Chat history per agent
POST/api/tasksCreate a task
GET/api/tasksList tasks (filter by status, agent)
GET/api/tasks/pendingTasks awaiting approval
POST/api/tasks/{id}/approveApprove a task
POST/api/tasks/{id}/denyDeny with reason
POST/api/agentsRegister an agent
GET/api/agentsList agents
POST/api/agents/load-soulsAuto-register from soul files
GET/api/trustAll agent trust scores
GET/api/trust/{name}Single agent trust detail
PATCH/api/workspaceConfig + trust mode toggle
GET/api/ledgerSpending summary
GET/api/revenueRevenue P&L
GET/api/scorecardPerformance standings
GET/api/statsFull dashboard payload
GET/api/auditAudit trail
GET/api/healthHealth check
interactive API docs at localhost:8000/docs after install
Soul File Format
# AGENT NAME -- Soul File ## Role or Title --- ## Constitution Write what the agent believes, values, and refuses. This becomes the system prompt. First person voice. The loader extracts the Constitution section and condenses it to ~1500 characters for the LLM context. I believe in [core principle]. ### What I Value **Accuracy.** [Why this matters to the agent.] **Clarity.** [How the agent approaches work.] ### What I Refuse I refuse to [hard boundary]. ### How I Work Give me [input] and I'll give you [output].
save as SOUL.md in a named directory. /souls loads them all.
Supported Agent Types
ollama
Local LLM inference via Ollama. Point at any Ollama instance on your network. Zero API costs, your hardware, your data.
endpoint: http://host:11434
shell
Execute shell commands. Task description becomes the command. Timeout protection, stdout/stderr capture.
endpoint: /bin/bash
claude_code
Claude Code CLI integration. Send tasks to Claude for code generation, analysis, and complex reasoning.
endpoint: claude
http
Any HTTP API endpoint. POST the task, get the response. Integrate with external services and custom agent backends.
endpoint: https://your-api.com