Durable runbook ops agent on the Loom stack: checkpoint/resume, supervisor planner/executor/verifier, audit trail.
Project description
loom-ops
Durable runbook ops agent on the Loom stack — ops sibling of loom-run, built on loom-runner with flow-xray traces.
Run нельзя потерять: упал на шаге 12/40 →
resume, каждый tool call в SQLite, postmortem черезexplain+ flow-xray.
Loom stack (this repo’s place)
The stack is a pyramid, not five equal frameworks. Tail-call optimization is the primitive, runner is the durable runtime, xray is the microscope, and the apps prove the stack in real workflows.
| Layer | Project | Job |
|---|---|---|
| Primitive | loom-tailcalls | Make async recursive/state-machine loops stack-safe |
| Runtime kernel | loom-runner | Make those loops durable, resumable, idempotent |
| Microscope | flow-xray | Show what actually happened in one offline HTML trace |
| Proof app | loom-run | Chat agent reference implementation |
| Proof app | loom-ops ← this repo | Ops/runbook agent reference implementation |
loom-ops is the ops/runbook proof app. It depends on loom-runner,
loom-tailcalls, and flow-xray; none of those lower layers depend on this
repo.
Full map: docs/STACK.md. Dev assistant → use loom-run; ops runbooks → loom-ops.
Install
From PyPI (after publish — see releases):
pip install "loom-ops[api,telegram]"
loom-ops supervise "incident: API latency spike" --run-id inc-001 --db ops.sqlite --mock-llm --workspace .
PyPI workflow:
.github/workflows/publish.ymlon GitHub Release. RequiresPYPI_API_TOKENwith upload scope for projectloom-ops.
From source (development):
git clone https://github.com/kroq86/loom-ops.git
cd loom-ops
python3.13 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,api,telegram]"
Demo (mock LLM, no API key)
# Supervisor team: planner → parallel executor + verifier
loom-ops supervise "incident: API latency spike" --run-id inc-001 --db ops.sqlite --mock-llm --workspace .
# Inspect verifier subagent audit trail
loom-ops explain --run-id inc-001:sub:verifier --db ops.sqlite --workspace .
# Single runbook walk
loom-ops runbook "incident: API latency spike" --run-id rb-001 --db ops.sqlite --mock-llm --workspace .
# HITL: executor pauses for approval (see tests/test_supervisor_ops.py)
loom-ops approve --run-id exec-1 --note "LGTM" --role executor --db ops.sqlite --mock-llm --workspace .
# Allowlisted shell (optional)
export LOOM_OPS_ALLOW_SHELL=1
# uses workspace/ops.shell.allowlist.json by default
loom-ops runbook "deploy check" --run-id rb-shell --db ops.sqlite --mock-llm --workspace .
# HTTP SSE
loom-ops serve --db ops.sqlite --mock-llm --workspace .
curl -N -X POST http://127.0.0.1:8766/supervise \
-H 'Content-Type: application/json' \
-d '{"message":"incident: API latency spike","run_id":"inc-http","max_steps":20}'
curl http://127.0.0.1:8766/runs/inc-http/explain
# Telegram gateway (optional extra)
export TELEGRAM_BOT_TOKEN=...
export TELEGRAM_ALLOWED_CHAT_IDS=123456789
loom-ops telegram --db ops.sqlite --mock-llm --workspace .
Ops tools
| Tool | Role | Purpose |
|---|---|---|
read_runbook |
planner | Load runbook from runbooks/ |
execute_step |
executor | Mock, allowlisted shell, or MCP |
await_approval |
executor | HITL gate — run pauses until approve |
check_health |
verifier | Service health check (mock / MCP) |
record_audit |
verifier | Append audit entry (+ workspace memory) |
delegate_subagent |
supervisor | Spawn single resumable child run |
delegate_subagents_batch |
supervisor | Run multiple child roles in parallel |
Docs
Tests
python -m pytest -q
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file loom_ops-0.2.1.tar.gz.
File metadata
- Download URL: loom_ops-0.2.1.tar.gz
- Upload date:
- Size: 28.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa3493238c14570eca67aef47b0f8678be5427d196c842812cff270d18fec116
|
|
| MD5 |
18e438e17d6a7b5c0cebaf0896c20e9f
|
|
| BLAKE2b-256 |
66c6fb8834a1d0944fc3a0fd45905b234759e166abc86803f9266e94d9e7632d
|
File details
Details for the file loom_ops-0.2.1-py3-none-any.whl.
File metadata
- Download URL: loom_ops-0.2.1-py3-none-any.whl
- Upload date:
- Size: 31.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31539656dd735e0e47935e2beb6bb07cf3551326da269909d4121e3add8d3214
|
|
| MD5 |
9183b29f2a91dda81c78ec3b706aa0b8
|
|
| BLAKE2b-256 |
1ca12ad076554603bd16858d7762b4f163acf99a88c90db0cf33f28b52647107
|