๋ณธ๋ฌธ์œผ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ
ๅฐ้พ™่™พๅฐ้พ™่™พAI
๐Ÿค–

Ops Framework

A 0-token jobs + monitoring framework for OpenClaw: run long-running read tasks via scripts, checkpoint/resume safely, and send periodic progress + immediate alerts to Telegram. Write jobs are blocked by default and must be explicitly approved and verified.

ไธ‹่ฝฝ2.4k
ๆ˜Ÿๆ ‡2
็‰ˆๆœฌ0.1.0
่ฅ้”€ๆŽจๅนฟ
ๅฎ‰ๅ…จ้€š่ฟ‡
๐Ÿ’ฌPrompt

ๆŠ€่ƒฝ่ฏดๆ˜Ž


name: ops-framework description: >- A 0-token jobs + monitoring framework for OpenClaw: run long-running read tasks via scripts, checkpoint/resume safely, and send periodic progress + immediate alerts to Telegram. Write jobs are blocked by default and must be explicitly approved and verified. version: 0.1.0 author: Zjianru license: MIT compatibility: >- Requires Python 3.10+ on the gateway host. Uses openclaw message send when available; otherwise falls back to Telegram HTTP API using the bot token in openclaw.json.

Ops Framework๏ผˆJobs + Ops Monitor๏ผ‰โ€” OpenClaw Skill (MVP)

็›ฎๆ ‡๏ผšๆŠŠโ€œ้•ฟไปปๅŠกๆ‰ง่กŒ / ๆ–ญ็‚น็ปญ่ท‘ / ่ฟ›ๅบฆๆฑ‡ๆŠฅ / ๅผ‚ๅธธๅ‘Š่ญฆโ€ๅšๆˆ 0-token ็š„ๅฏๅค็”จ่ƒฝๅŠ›ใ€‚

่ฟ™ๅฅ—ๆŠ€่ƒฝ็”ฑไธค้ƒจๅˆ†็ป„ๆˆ๏ผš

  • ops-monitor.py๏ผšไธ€ไธช็บฏๆœฌๅœฐ่„šๆœฌ๏ผŒ่ดŸ่ดฃ่ท‘ status / ๆฃ€ๆต‹ๅกไฝ / ๅ‘้€ Telegram ๅฟซๆŠฅ
  • ops-jobs.json๏ผšไธ€ไธชๅฃฐๆ˜Žๅผ job ้…็ฝฎ๏ผˆๅŒ…ๅซ kind/risk/ๅ‘ฝไปค/็ญ–็•ฅ๏ผ‰

ๆŽจ่ไฝœไธบโ€œๅค–ๆŒ‚โ€ๅญ˜ๅœจ๏ผš้•ฟไปปๅŠกๅฐฝ้‡็”จ่„šๆœฌ่ท‘๏ผŒ้ฟๅ…่ฎฉๆจกๅž‹ๆŒ็ปญ็›ฏ่ฟ›ๅบฆ็ƒง tokenใ€‚

What this solves

  • Long-running read jobs: scans, inventories, large syncs, periodic polling; support pause/resume and stall detection.
  • One-shot read jobs: health checks or lint-like checks; only report when they emit ACTION REQUIRED / ALERT or fail.
  • One-shot write jobs: blocked by default; must be explicitly approved and must chain to a read-only verification job.

Quickstart (local)

  1. Copy files to your OpenClaw host (suggested layout):
  • ~/.openclaw/net/tools/ops-monitor.py
  • ~/.openclaw/net/config/ops-jobs.json
  • ~/.openclaw/net/state/ops-monitor.json (auto-created)

You can also run the script from any directory as long as OPENCLAW_HOME points to your OpenClaw state dir (default ~/.openclaw).

  1. Start from the example config:
  • ops-jobs.example.json
  1. Validate:
python3 ops-monitor.py validate-config --config-file ~/.openclaw/net/config/ops-jobs.json
python3 ops-monitor.py selftest
  1. Run one monitoring tick (prints only; does not send):
python3 ops-monitor.py tick --print-only
  1. Run periodic ticks via your OS scheduler (launchd/systemd/cron). The script is designed to be called frequently; it decides whether to report based on policy and state.

Job kinds and safety

kind is one of:

  • long_running_read
  • one_shot_read
  • one_shot_write (never auto-executed by ops-monitor)

risk is one of:

  • read_only
  • write_local
  • write_external

Rules (MVP):

  • long_running_read may auto-resume only when risk=read_only and policy.autoResume=true.
  • one_shot_read may run explicitly or via queue (read-only only).
  • one_shot_write is always blocked from auto-run; it exists as a declarative โ€œapproval + verification chainโ€ placeholder.

Status contract (for long_running_read)

Your commands.status must print JSON to stdout, with at least:

  • running (boolean)
  • completed (boolean)

Recommended:

  • pid (number)
  • stopReason (string)
  • progress (object)
  • progressKey (string) โ€” stable key used for stall detection
  • level (ok|warn|alert)
  • message (string)

Commands

# Validate config
python3 ops-monitor.py validate-config --config-file ~/.openclaw/net/config/ops-jobs.json

# Print current statuses (no Telegram)
python3 ops-monitor.py status --config-file ~/.openclaw/net/config/ops-jobs.json

# One monitoring tick
python3 ops-monitor.py tick --config-file ~/.openclaw/net/config/ops-jobs.json

# Explicitly start/stop a long job
python3 ops-monitor.py start <job_id> --config-file ~/.openclaw/net/config/ops-jobs.json
python3 ops-monitor.py stop <job_id>  --config-file ~/.openclaw/net/config/ops-jobs.json

# Run one one_shot_read job explicitly
python3 ops-monitor.py run <job_id> --config-file ~/.openclaw/net/config/ops-jobs.json

Reference docs

  • Spec (Chinese, detailed): OPS_FRAMEWORK.md

ๅฆ‚ไฝ•ไฝฟ็”จใ€ŒOps Frameworkใ€๏ผŸ

  1. ๆ‰“ๅผ€ๅฐ้พ™่™พAI๏ผˆWeb ๆˆ– iOS App๏ผ‰
  2. ็‚นๅ‡ปไธŠๆ–นใ€Œ็ซ‹ๅณไฝฟ็”จใ€ๆŒ‰้’ฎ๏ผŒๆˆ–ๅœจๅฏน่ฏๆก†ไธญ่พ“ๅ…ฅไปปๅŠกๆ่ฟฐ
  3. ๅฐ้พ™่™พAI ไผš่‡ชๅŠจๅŒน้…ๅนถ่ฐƒ็”จใ€ŒOps Frameworkใ€ๆŠ€่ƒฝๅฎŒๆˆไปปๅŠก
  4. ็ป“ๆžœๅณๆ—ถๅ‘ˆ็Žฐ๏ผŒๆ”ฏๆŒ็ปง็ปญๅฏน่ฏไผ˜ๅŒ–

็›ธๅ…ณๆŠ€่ƒฝ