Skip to content

Chapter 28 · Autonomy Levels and Loop Ready Scoring ​

Chapter goals: Master the definition and upgrade conditions of L1/L2/L3 autonomy levels; understand the audit dimensions of Loop Ready Score; anduse the official CLI toolchain to initialize,体检, audit, andestimate cost.

28.1 Three Autonomy Levels: L1 / L2 / L3 ​

How far a loop can动手 is必须显式分级管理. The official defines three autonomy levels:

LevelNameWhat the loop can doPrerequisites
L1Report (report only)Scan, triage,写 state files, notify humans; doesn't改 any codeHas triage skill + state file
L2Assisted (assisted fix)Draft minimal fixes in a worktree;开 PR for human review; connectors can更新 ticketsL1 stable for 1–2 weeks + independent verifier + attempt上限
L3UnattendedAuto-merge低风险 changes within the allowlist;全自动 closed-loopDenylist + budget + run log + metrics + human gates all就位

Upgrade is a单向门控; no跳级:

text
L1 report only → stable for 1–2 weeks (triage accuracy达标)
      ↓
L2 small fixes → verifier + worktree + max attemptcount (e.g. 3)就位
      ↓
L2+ connectors → loop can auto开 PR / update tickets (least-privilege bot identity)
      ↓
L3 unattended → only when denylist, budget, metrics, human gates are全部存在

The Most Common Failure Point

"L3 before L1 quality" — launching auto-fix + auto-merge on Day 1. At this point the triage rules haven't been calibrated; the loop executes high-privilege动作 on错误的信号; comprehension debt explodes instantly. Remember the顺序: prove it can see accurately first; thenallow it to动手.

28.2 Loop Ready Score: Audit Dimensions for Scoring ​

loop-audit scans your repo and gives a 0–100 Loop Ready Score,衡量 whether the loop具备 production-readiness. Audit dimensions include:

DimensionCheck Content
SkillsWhether a compact-format triage skill exists; whether the skill description is "boring but specific"; whether build/test commands are documented
StateWhether the state file schema is明确; whether each round读旧写新,带 timestamp,清理 resolved entries
Maker/Checker SeparationWhether the implementer and verifier are独立; whether the verifier真正 runs tests
BudgetWhether loop-budget.md defines the daily token上限 and over-limit actions
ConstraintsWhether path denylists, attempt上限, and other constraints are成文
Governance / Run logWhether loop-run-log.md records each run; whether LOOP.md describes the loop itself
Harness RuntimeWhen the score is高, also提示固化为版本化 harness stack

The value of the score lies not in the数字 itself, but in the dimension checklist being a design checklist — each项 corresponds to a real failure mode.

28.3 CLI Toolchain in Practice ​

The official收敛es all capabilities into one unified entry @cobusgreyling/loop:

bash
# 1. Initialize: generate skill skeleton, STATE.md, budget/run log files; print Loop Ready score
npx @cobusgreyling/loop init . --pattern daily-triage --tool claude

# 2. Health check: audit + sync + file检查 → output top 3 next actions
npx @cobusgreyling/loop doctor .

# 3. View current state
npx @cobusgreyling/loop status .

# 4. Audit and give improvement建议 (--suggest tells you where the gaps are)
npx @cobusgreyling/loop audit . --suggest

# 5. Generate a local badge showing the Loop Ready score
npx @cobusgreyling/loop badge .

# 6. Watch the score爬升 demo script (empty repo → L1 → L2)
bash scripts/before-after-demo.sh

Daily usage mental model: init once, doctor daily — doctorcompresses audit, sync, and file checks into the top 3 things to do; no need to read冗长 reports yourself.

28.4 Budget and Cost Estimation ​

Before launching高频 loops,必须先算账. The official provides a cost estimation tool with four planning factors:

bash
# Estimate daily token consumption by pattern × cadence × autonomy level
npx @cobusgreyling/loop-cost --pattern ci-sweeper --cadence 15m --level L1
FactorImpact on Cost
CadenceLinear放大: 5 min vs. 1 day = 288× runs/day
Sub-agents per roundEach sub-agent is a完整的 model call + tool round-trip
Context sizeLarge repo + full CI logs make the triage本身贵
Verifier modelUsing a stronger model as verifier in unattended scenarios — this money is worth spending

Magnitude reference (light triage约 50k tokens/round; with implementation+verification约 200k tokens/round): Daily Triage约 50k/day; CI Sweeper若每轮全链路高达 5M/day —这正是上一章强调 "空列表早退出"的原因.

The budget must be落成 a file and executed by mechanism, not口头约定:

markdown
<!-- loop-budget.md -->
## Loop Budget — Project X
- Max tokens/day: 2M
- On exceed: pause scheduler and通知人工
- Max sub-agent spawns per run: 3

Budget increases must be人工 approved

Agents不能自行上调自己的预算上限. The official provides a budget-negotiator skill让 L3 loops to "apply" for extra quota when approaching the上限; but the hand editing loop-budget.md must be human.

28.5 Gradual Rollout Strategy ​

Treat upgrades as a small release to manage:

  1. Each level has exit criteria: L1 looks at "false positive rate <30% and stable for两连续 weeks"; L2 looks at "采纳率 of proposed fixes"; L3 pre-launch逐项核对 safety checklist;
  2. Downgrade is always available: if any level有问题,退回到上一级 rather than硬扛 — slowing the调度 cadence or switching back to report-only is a matter of minutes;
  3. Record every human override: cases where you推翻 the loop's judgment are the most宝贵的调参material; write them back into the triage skill;
  4. Special rules for major release weeks:pause all auto-fix loops during release week; keep only the report mode; avoid the loop conflicting with热修.

Chapter Summary ​

  • L1 report / L2 assisted / L3 unattended; upgrades must be逐級 and satisfy prerequisites;跳级 is严禁;
  • Loop Ready Score's dimension checklist is the design checklist: Skills, State, Maker/Checker, Budget, Constraints, Governance;
  • CLI mental model: init once, doctor daily, audit --suggest forgaps, cost算账 before高频;
  • Cost four factors: cadence linear放大 is the most dangerous; verifier model money is most worth spending;
  • Budget written to loop-budget.md and executed by mechanism; the agent无权自我提额;
  • Gradual rollout = each level exit criteria +随时可 downgrade + record human overrides.

🧪 随堂测验

点击你认为正确的选项。答错时会展示正确答案与原因解析。

1. What is the prerequisite for upgrading from L1 to L2?

2. Regarding Loop Ready Score, which understanding is correct?

3. Why can't the agent自行上调 the budget in loop-budget.md?

4. Which cost factor has the mostdangerous放大效应 and needs to be controlledfirst?

🛠️ Hands-on Practice ​

  1. Run loop init and loop doctor . in a test repo;完成 doctor's top 3 actions one by one; then observe the score change.
  2. Write a loop-budget.md for your planned loop;包含每日上限、超限动作和子智能体数量上限三项.
  3. Use loop-cost to分别估算 daily-triage (1d/L1) and ci-sweeper (15m/L2) daily consumption; compare the results with your直觉; write down the偏差原因.

After completing the exercises, proceed to Next chapter: Loop Security and Failure Modes.