{"slug": "krystal-loop-protocol-a-bounded-worker-critic-loop-for-ai-coding-agents", "title": "Krystal Loop Protocol – a bounded worker/critic loop for AI coding agents", "summary": "Krystal Loop Protocol (KLP) is a new operating pattern for AI coding agents that aims to keep multi-agent projects coherent and under human control by using a bounded worker/critic loop. The protocol, which requires no special model or infrastructure, structures work into scoped tasks with deterministic checks and independent read-only critics, and stops for human review on material changes. It addresses common agent failures such as overlapping edits, self-certified work, and false critic findings.", "body_md": "Use fast AI agents for the grunt work. Use a lead agent and real checks to keep the project coherent, working, and under your control.\n\nAI coding agents can produce a lot of code quickly. The harder problem begins after the first impressive demo: agents lose context, overlap each other's changes, trust confident summaries, reopen solved problems, and quietly break features that worked yesterday.\n\nKrystal Loop Protocol (KLP) is a practical operating pattern for continuing to build with multiple AI agents without handing them control of the project.\n\n**Scope it.** Write down the outcome, allowed files, forbidden actions, checks, budget, and stop conditions.**Split it.** Give each worker one small outcome that can be judged on its own.**Build it.** The worker returns the exact revision and a factual handover, not its own pass verdict.**Check it.** Run tests, linters, builds, or other deterministic checks before asking another model what it thinks.**Critique it.** A fresh, read-only critic reviews the exact revision against the original task and direct evidence.**Adjudicate and repair it.** Confirm or refute each critic finding with direct evidence, then fix confirmed blockers within declared limits.**Integrate it.** Treat the combined system as a new artifact and check it again.**Govern it.** The loop completes automatically inside its delegation. A person decides only material changes and consequential actions.\n\n| Common agent failure | KLP response |\n|---|---|\n| Two agents edit the same shared file. | Give each worker an explicit file and action boundary. |\n| A worker says its own work is complete. | Separate factual handover from independent acceptance. |\n| A critic reviews an outdated build. | Bind every verdict to an exact artifact revision. |\n| A critic confidently reports a false problem. | Confirm or refute every finding with direct evidence. |\n| Agents keep looping without improvement. | Stop on repeated findings, exhausted budgets, or a plateau. |\n| Unit changes pass but break when combined. | Review integration as a new artifact. |\n| A test or agent message is treated as permission to deploy. | Keep live actions behind an explicit human decision. |\n\nGive this to the lead agent before a multi-agent build:\n\n```\nWork under Krystal Loop Protocol Core.\n\nBefore changing files, write a bounded task contract containing:\n- its ID, revision, parent identity, and coordinator delegation;\n- the exact outcome;\n- allowed and protected paths;\n- forbidden actions and live side effects;\n- deterministic checks and required evidence;\n- time, cost, and repair-round limits;\n- conditions that require stopping for human review.\n\nSplit the task into independently judgeable work units. Workers must return\nfactual handovers tied to exact revisions and must not certify their own work.\nRun deterministic checks before independent, read-only criticism. Confirm,\nrefute, or leave each critic finding unresolved using direct evidence. Treat\nthe integrated result as a new artifact. Normal repair rounds may proceed under\nthe recorded delegation; material changes and consequential actions stop at\nthe authority boundary.\n```\n\nKLP does not require a special model, database, vector store, or message bus. You can start with Git and Markdown files, then add durable coordination when the project needs it.\n\nThe included examples demonstrate one complete bounded path:\n\n``` php\nDeepSeek Flash worker\n  -> exact revision and deterministic checks\n  -> controller-redacted, sealed review packet\n  -> different-family read-only critic\n  -> evidence-backed finding dispositions\n  -> bounded repair or integration\n```\n\nStart with the [DeepSeek Codex worker](/KrystalUnity/krystal-loop-protocol/blob/main/examples/deepseek-codex-worker/README.md),\nthen use the\n[OpenAI-compatible critic harness](/KrystalUnity/krystal-loop-protocol/blob/main/examples/openai-compatible-critic/README.md).\nThe worker launcher uses an isolated Codex profile and a reviewed assignment.\nThe critic makes one request, validates its structured verdict locally, and\ncannot edit or authorize any action. The examples do not automatically connect\nworker output to critic input; the controller must inspect and redact the\nreview packet first.\n\nThe [fail-review-repair fixture](/KrystalUnity/krystal-loop-protocol/blob/main/examples/fail-review-repair/README.md) proves a\ncomplete bounded lifecycle without provider egress or model spend:\n\n```\noutput=\"$(mktemp -d)/klp-fixture\"\npython3 examples/fail-review-repair/run_fixture.py --out-dir \"$output\"\npython3 -m json.tool \"$output/final-receipt.json\"\n```\n\nIt creates a temporary Git project, records a deliberately incomplete worker revision, captures a failed check, runs the sealed critic harness against a loopback fake provider, confirms one real finding, refutes one false finding, applies one authorized repair, and re-checks the integrated artifact. A second test proves a zero-round repair budget stops instead of overrunning authority.\n\n[KLP Core protocol](/KrystalUnity/krystal-loop-protocol/blob/main/PROTOCOL.md)[Instructions for AI agents and orchestrators](/KrystalUnity/krystal-loop-protocol/blob/main/AI_AGENT_INTEGRATION.md)[Optional runtime profiles](/KrystalUnity/krystal-loop-protocol/blob/main/RUNTIME_PROFILES.md)[Safety and limits](/KrystalUnity/krystal-loop-protocol/blob/main/SAFETY_AND_LIMITS.md)[DeepSeek Codex worker example](/KrystalUnity/krystal-loop-protocol/blob/main/examples/deepseek-codex-worker/README.md)[OpenAI-compatible critic example](/KrystalUnity/krystal-loop-protocol/blob/main/examples/openai-compatible-critic/README.md)[Offline fail-review-repair fixture](/KrystalUnity/krystal-loop-protocol/blob/main/examples/fail-review-repair/README.md)[Hermes Kanban adapter example](/KrystalUnity/krystal-loop-protocol/blob/main/adapters/hermes-kanban.md)\n\nKLP is not an autonomous software factory, deployment platform, model router, or claim that tests prove a product has no defects. It is a portable way to bound multi-agent work, retain useful evidence, and make uncertainty visible.\n\nKLP is inspired by public builder/critic systems such as the\n[Gauntlet Loop](https://somethingbig.ai/gauntlet-loop). It does not claim to\ninvent multi-agent coding, independent review, or automated testing. Its focus\nis what happens after the demo, when a real project must remain understandable\nand working across many changes.\n\nKLP Core v0.2 is a provisional public profile. This repository includes a portable worker launcher, a sealed-packet critic harness, local fake-provider tests, example contracts, and a reproducible offline fail-review-repair fixture. The fixture proves protocol mechanics; it does not certify model quality, production safety, or a particular agent framework.\n\nKrystal Loop Protocol uses split licensing:\n\n- software, scripts, schemas, configuration examples, and tests are licensed\nunder\n[Apache License 2.0](/KrystalUnity/krystal-loop-protocol/blob/main/LICENSE-APACHE-2.0)(`Apache-2.0`\n\n); - protocol and documentation text are licensed under\n[Creative Commons Attribution 4.0](/KrystalUnity/krystal-loop-protocol/blob/main/LICENSE-CC-BY-4.0)(`CC-BY-4.0`\n\n).\n\nSee the [licensing map](/KrystalUnity/krystal-loop-protocol/blob/main/LICENSE) for the file-level boundary.", "url": "https://wpnews.pro/news/krystal-loop-protocol-a-bounded-worker-critic-loop-for-ai-coding-agents", "canonical_source": "https://github.com/KrystalUnity/krystal-loop-protocol", "published_at": "2026-08-18 12:58:38+00:00", "updated_at": "2026-08-18 13:11:56.129327+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["Krystal Loop Protocol", "DeepSeek", "OpenAI"], "alternates": {"html": "https://wpnews.pro/news/krystal-loop-protocol-a-bounded-worker-critic-loop-for-ai-coding-agents", "markdown": "https://wpnews.pro/news/krystal-loop-protocol-a-bounded-worker-critic-loop-for-ai-coding-agents.md", "text": "https://wpnews.pro/news/krystal-loop-protocol-a-bounded-worker-critic-loop-for-ai-coding-agents.txt", "jsonld": "https://wpnews.pro/news/krystal-loop-protocol-a-bounded-worker-critic-loop-for-ai-coding-agents.jsonld"}}