{"slug": "ratchet-a-closed-loop-verification-gate-that-turns-prds-into-live-browser-proof", "title": "Ratchet: A Closed-Loop Verification Gate That Turns PRDs into Live Browser Proof", "summary": "A developer built Ratchet, a closed-loop verification gate that drives Kane CLI headlessly to block a build until every acceptance criterion in a PRD is proven in a live browser, rather than trusting an agent's self-reported completion. The tool runs coverage-gap checks and browser test runs against a running app, keeping builds unlocked until all use cases pass, and surfaced issues unit tests miss, including an EMPTY_DESIGN event wrongly treated as a hard failure and a trailing-slash URL assertion mismatch. Kane separated real application behavior from test and environment noise, confirming zero application bugs in the demo checkout flow.", "body_md": "AI coding agents are great at writing code, but they love saying \"it's done\" the moment unit tests pass—without ever checking if the app actually works in a real browser.\n\nTo fix that, I built **Ratchet**: a closed-loop verification gate powered by **Kane CLI** that refuses to lock a build until 100% of your PRD's acceptance criteria are proven in a live browser.\n\nInstead of relying on an agent's self-reported completion, Ratchet drives Kane CLI headlessly and enforces a strict verification flow:\n\n`kane-cli cover gaps --json`), including safe no-op handling when the design is already up to date.`kane-cli testrun run` against the running application (tested against a Pro Plan checkout demo with `SAVE20` promo pricing).`locked: false`) until every use case and acceptance criterion is proven.\nWiring a real browser verification loop surfaced issues that standard unit tests would never catch:\n\n`EMPTY_DESIGN` event was treated as a hard failure when non-blocking clarification gaps were present, leading to a cleaner no-op sync path.`kane-cli evidence serve`, Kane separated real application behavior from test/environment noise—flagging a canonical trailing-slash URL assertion issue (`http://localhost:4173` vs `http://localhost:4173/`) and a transient screenshot timeout, confirming zero application bugs in the checkout flow.\n\n```\nbash\n# 1. Install, build, and run offline engine tests\nnpm install && npm run build && npm test\n\n# 2. Start the demo app (Terminal 1)\ncd demo-app && python3 -m http.server 4173\n\n# 3. Run live browser verification and inspect coverage (Terminal 2)\ncd demo-app && kane-cli testrun run && kane-cli cover gaps --json\n\nCheck out the code on GitHub: Miracle-Alajemba/ratchet\n```\n\n", "url": "https://wpnews.pro/news/ratchet-a-closed-loop-verification-gate-that-turns-prds-into-live-browser-proof", "canonical_source": "https://dev.to/miracle_alajemba_6b425827/ratchet-a-closed-loop-verification-gate-that-turns-prds-into-live-browser-proof-13j3", "published_at": "2026-11-24 22:06:57+00:00", "updated_at": "2026-11-24 22:14:14.380642+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools"], "entities": ["Ratchet", "Kane CLI", "Miracle-Alajemba", "GitHub"], "also_reported_by": [], "takeaway": "Gate an AI coding agent's completion on live browser proof of every PRD acceptance criterion rather than unit tests, and treat non-blocking clarification gaps as no-ops instead of hard failures.", "recommendation": {"advice": "Require live browser verification of each acceptance criterion before locking a build, and distinguish environment noise like trailing-slash URL mismatches from real application bugs.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/ratchet-a-closed-loop-verification-gate-that-turns-prds-into-live-browser-proof", "markdown": "https://wpnews.pro/news/ratchet-a-closed-loop-verification-gate-that-turns-prds-into-live-browser-proof.md", "text": "https://wpnews.pro/news/ratchet-a-closed-loop-verification-gate-that-turns-prds-into-live-browser-proof.txt", "jsonld": "https://wpnews.pro/news/ratchet-a-closed-loop-verification-gate-that-turns-prds-into-live-browser-proof.jsonld"}}