A self-hosted DevOps agent that owns the lifecycle of a release: it rolls a new version out service by service, runs a health gate after each rollout, and automatically rolls back to the previous good version when the gate fails. Every deployment is recorded so you always know what is live and why.
This is not a generic task queue. It is a small, auditable release manager you run on your own VM. Bring your own LLM (Claude Code / Kimi Code / Codex) for smarter gate adjudication and reports — or run it fully deterministic with no API key.
What it does
- Queue a rollout —
deploy --service api --version 1.4.2 [--strategy canary] - Deploy → gate → promote — runs your deploy command, then your health-gate command a few times; promotes the version to live only if the gate goes green.
- Auto-rollback — if the deploy step errors, or the gate fails its retry budget, the agent runs your rollback command and records the reason.
- History & status — every rollout (live or rolled back) is stored in SQLite;
statusshows what is live per service and recent rollback pressure. - Honest core — deploy, gate, rollback and history all work with no LLM. The LLM only adjudicates a flapping gate and writes the report.
One-shot install (Debian/Ubuntu VM)
sudo bash install.sh # system deps + venv + LLM detection + systemd service
# or, no service / run by hand:
bash install.sh --no-service
The installer creates services.json from services.example.json — edit it to
describe how your services deploy, gate and roll back.
Quick start
# 1) describe your services (deploy / gate / rollback commands)
cp services.example.json services.json && $EDITOR services.json
# 2) queue a rollout and process it once
python agent.py deploy --service api --version 1.4.2
python agent.py run --once
# 3) see what is live, then a report
python agent.py status
python agent.py report --hours 24
# manual rollback if you need it
python agent.py rollback --service api
Architecture
deploy request ──> [queued]
│
▼
┌────────────────────┐
OODA ───▶ │ deploy_command │ run the new version
loop └─────────┬──────────┘
▼
┌────────────────────┐ gate green
│ gate_command │ ───────────────▶ [live] (promoted)
│ (x gate_retries) │
└─────────┬──────────┘ gate fails budget
▼
┌────────────────────┐
│ rollback_command │ ───────────────▶ [rolled_back]
└────────────────────┘
│
▼
SQLite history + optional webhook
LLM: deterministic vs. enhanced
| Capability | Without an LLM CLI | With a CLI connected |
|---|---|---|
| Deploy / gate / rollback | ✅ deterministic | ✅ identical |
| Deployment history & status | ✅ | ✅ |
| Flapping-gate adjudication (retry vs rollback) | budget-based | ✅ Gate Analyst prompt |
| Rollout report | ✅ numbers | ✅ enriched summary |
Connect one CLI once (no API key needed):
- Claude Code:
npm i -g @anthropic-ai/claude-code && claude(/login) - Kimi Code: see
https://platform.moonshot.ai, thenkimi-code - Codex CLI:
npm i -g @openai/codex && codex login
Pin a backend with PACK_LLM=claude|kimi|codex, or leave it to auto-detect.
Files
See agent-devops-v2.json for the authoritative file list. Highlights:
agent.py (the agent), llm_adapter.py (BYO-LLM), services.example.json
(config), PROMPTS.md (versioned prompts), CUSTOMIZE.md (5-minute wiring),
test_agent.py + smoke_test.sh (offline tests), install.sh (one-shot deploy).
License
Personal use per purchase. Resale prohibited.