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
Metadata
Release files for loom-ops 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| loom_ops-0.2.1.tar.gz | 28.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| loom_ops-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 59.6 kB
Release files / loom_ops-0.2.1.tar.gz
| Download URL | loom_ops-0.2.1.tar.gz |
|---|---|
| Size | 28.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa3493238c14570eca67aef47b0f8678be5427d196c842812cff270d18fec116
|
|
BLAKE2b-256 checksum How to use checksums |
66c6fb8834a1d0944fc3a0fd45905b234759e166abc86803f9266e94d9e7632d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / loom_ops-0.2.1-py3-none-any.whl
| Download URL | loom_ops-0.2.1-py3-none-any.whl |
|---|---|
| Size | 31.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31539656dd735e0e47935e2beb6bb07cf3551326da269909d4121e3add8d3214
|
|
BLAKE2b-256 checksum How to use checksums |
1ca12ad076554603bd16858d7762b4f163acf99a88c90db0cf33f28b52647107
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|