loop.config.template.yaml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # loop.config.yaml — one OUTER-loop definition.
  2. # Scaffolded by loop-scaffold.sh, scored by loop-check.sh. Flat YAML on purpose: every
  3. # key sits at column 0 so the audit parses it without a yq dependency.
  4. # Full field semantics: skills/loop-ops/references/state-spine.md
  5. #
  6. # >>> ADAPT every <PLACEHOLDER> below. The audit errors on unbounded scope, a
  7. # missing gate, an undefined escalation rule, or a tier/permission mismatch.
  8. # ── identity ────────────────────────────────────────────────────────────────
  9. name: <loop-name> # matches the .loops/<name>/ directory
  10. pattern: <pattern-key> # a catalog key (pr-watch, ci-watch, …) or "custom"
  11. # ── autonomy ────────────────────────────────────────────────────────────────
  12. tier: L1 # L1 report-only | L2 assisted (worktree+gate) | L3 unattended
  13. permission_mode: dontAsk # plan | dontAsk | auto | acceptEdits | bypassPermissions
  14. # L1 → plan or dontAsk · L2 → dontAsk/auto · L3 → bypassPermissions (container only)
  15. # ── cadence ─────────────────────────────────────────────────────────────────
  16. cadence: 1h # 10m | 1h | 6h | 1d, or a cron string ("*/10 * * * *")
  17. # ── purpose & bounds ────────────────────────────────────────────────────────
  18. goal: "<one sentence: what this loop does AND what it must never do>"
  19. scope: # bounded globs the loop may touch — NEVER "*" or "**"
  20. - "<src/**>"
  21. # ── the gate (required at L2+) ──────────────────────────────────────────────
  22. verify: "<command that decides pass/fail, e.g. npm test>" # a loop with no gate is invalid at L2+
  23. guard: "<must-always-pass, e.g. npm run typecheck>" # required at L2+
  24. # ── isolation & landing (required at L2+) ───────────────────────────────────
  25. worktree: true # isolate code changes in a git worktree (required L2+)
  26. land_via: fleet-ops # who test-gates + lands winning branches (L2+)
  27. # ── the escalation rule (required) ──────────────────────────────────────────
  28. # What the loop ESCALATES instead of doing. Mirror the never-auto-land classes:
  29. # force-push, push to main, prod deploy/migration, mass delete, IAM grants, .claude edits.
  30. escalation: "<e.g. open a PR with context; never merge to main; never deploy>"
  31. # ── safety rails ────────────────────────────────────────────────────────────
  32. budget_tokens: 200000 # per-run output-token ceiling (stop the run when reached)
  33. kill_switch: ".loops/<loop-name>/PAUSED exists, OR the loop-pause label is set"