Files
wehub-resource-sync bb5c75ce05
Component Security Validation / Security Audit (push) Has been cancelled
Deploy to Cloudflare Pages / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:58 +08:00

1 line
2.7 KiB
JSON

{"content": "---\nname: anti-spin-build-loop\ndescription: Builds toward a machine-checkable contract with explicit anti-spin guardrails — stops on no progress, repeated approaches, flip-flopping, or a spend budget.\ncategory: engineering\ninterval: 15m\nstop-condition: The machine-checkable contract passes, or an anti-spin guard trips (no progress, repeated/flip-flopping approach, or budget hit).\ncomponents: [agent:expert-advisors/architect-review, command:git-workflow/pr-review, hook:quality-gates/scope-guard]\ntags: [reliability, guardrails, budget, loop]\n---\n\n# Anti-Spin Build Loop\n\n> **Loop Engineering** — most agent loops never stop to ask whether they're actually making progress, so they retry the same broken approach or quietly edit the test to pass. This loop runs build → audit → verify against a machine-checkable contract, with explicit stops that detect spinning.\n\n## 🎯 Goal\nDrive toward a verifiable contract while actively guarding against the classic failure mode: an agent that loops forever without converging.\n\n## ⏱️ Schedule\nSuggested interval: `15m`.\n\n## ▶️ Run it\n```\n/loop 15m \"Build toward the goal, then audit and verify against a machine-checkable contract. Track progress each pass. Stop if you make no progress, repeat an approach you already tried, flip-flop between two approaches, or hit the budget. Finish only when the contract passes — never by weakening the contract or the tests.\"\n```\n\n## 🔁 Iteration steps\n1. **Build** — advance toward the contract.\n2. **Audit** — `architect-review` checks the change; `scope-guard` blocks weakening the tests/contract.\n3. **Verify** — run the machine-checkable contract; record progress vs. last pass.\n4. **Anti-spin check** — no progress? repeated approach? flip-flop? budget hit? → stop and report.\n5. **Observe** — if making progress and contract not yet met, loop; else `/pr-review` and hand off.\n\n## 🛑 Stopping condition\nContract passes, **or** an anti-spin guard trips — whichever comes first.\n\n## 💰 Budget & guardrails\nHard caps on iterations and spend; no-progress, repeated-approach and flip-flop detection. The contract and tests are immutable — the loop may not edit them to \"pass\".\n\n## 🧩 Referenced components\n- `agent:expert-advisors/architect-review` — independent audit each pass.\n- `command:git-workflow/pr-review` — structured review at handoff.\n- `hook:quality-gates/scope-guard` — prevents weakening tests/contract to fake success.\n\n## 💡 Example\nChasing a contract for a parser, the loop tries approach A, then B, then drifts back to A — the flip-flop guard trips and it stops with a clear report instead of burning tokens forever.\n"}