Ratchet Pattern

What Is a 'Turn' in reins?
An anatomy of the turn, the smallest unit of execution in reins. What is not recorded is not a turn — from this one definition, driver independence, restart resilience, and auditability all follow. Compared against the June 2026 Loop Engineering discourse, we see how the turn converts those recommendations into structure.

Systems Make Genius Shine Brighter
Genius without structure drifts, and structure alone is mediocre. Only when genius and structure multiply does the real value emerge. The ZenFlow benchmark (Claude Sonnet, 32 endpoints, 43 minutes) and historical proof from B-17, Toyota, and WHO checklists all demonstrate the same principle.

Why Drift Never Dies
Drift keeps coming back no matter how many times you fix it. I closed business logic with SSOT, only to watch the same drift climb one layer up -- into the generator that builds that SSOT. I rebuild the answer from entropy upward: why this thing never dies.

abloq — A Blog an Agent Operates, a Machine Locks the Verification
Hand a blog to an agent and the articles come out. The problem is you can't trust them — it fabricates sources, bumps the lastmod of an article it never touched, and edits files no one asked it to. If a human has to inspect every line, there was no point delegating. abloq's answer is a division of labor: generation is probabilistic, verification is deterministic. The only thing a human writes is a single insight specification (insight.yaml); authoring, translation, refresh, and evidence work are carried out by agents as quests; and quality is guaranteed by a deterministic gate derived from a single blog.yaml. A locked PASS is irreversible — the agent may be disposable, but progress accumulates.

Why Your Agent Loop Diverges
The more Loop Engineering spreads, the more people hit the same wall — the loop won't converge, it diverges. Infinite spinning, drift, reward hacking: the three faces share one root. You plugged the generator itself back into the loop's judgment slot. And divergence is actually the lucky case. You can see it. What's truly terrifying is the loop that silently fakes convergence. The cure is singular — give the authority to lock 'done' not to the LLM but to a deterministic gate alone.

Production Traffic Is the Spec
Legacy code has no documentation. No tests either. And yet it's running right now. A month of well-recorded logs is the spec — build Hurl integration tests that capture the current behavior from production traffic, and you can pin down what the legacy does and lay a safety net for refactoring without reading a single line of code.

Burning a City for a Single Answer
A trillion-parameter model burns a city's worth of electricity and water just to spit out a single answer. I thought this was insane. Searching for a way out, I learned something. The flaw everyone was trying to fix, the LLM's sycophancy, was the answer itself. Feed it fact and sycophancy becomes accuracy. This is the story of why I started Reins.

reins — Keep Only the Domain in a Quest CLI; Make the Ratchet a Framework
how-make-quest taught you to build a quest CLI with your bare hands. But build a second CLI and you write the same ratchet, the same scan/next/submit, the same tallying all over again. reins pulls that invariant out into a framework — reins supplies the ratchet, the command skeleton, the tallying, and export; you implement only your domain's gate (the four methods of gate.Definition). The gate is a catalog of cheese-defense rules, and the toulmin defeat graph hands the agent a strategy guide for 'why you lost and what to change to win.'

How to Make a Quest CLI — Build a Tool That Lets the Machine Judge Completion
AI says "Done." In reality, it isn't finished. This article is about building the tool that solves that problem — a quest CLI — with your own hands. From the principle (why) to the cobra command skeleton (how), this single article is enough for an agent to build a Go quest CLI. huma is the worked example.

The Preconditions for Improving LLM Multi-Agent Accuracy
Run several agents and you get more accurate? Only half true. Models trained on the same data fail in the same places. Multi-agent works under two conditions — design for error independence, or, in a verifiable domain, stand up a verifier outside the LLM.

Why Your Agent Never Stops
When someone brags about running their agent 24/7, the feeling it stirs isn't admiration but a question — why isn't it done yet? Code is not a search problem; it's a constraint satisfaction problem. A healthy system is one that can stop.

Who Defines 'Done'? — The Problem Games Solved 40 Years Ago
The moment you define tenant move-out confirmation as five photos, it becomes a game quest. Defining 'done' not as the agent's claim but as a mechanically verifiable condition — games solved this 40 years ago, and it is the right way to get AI agents to actually do their job.

filefunc × Hono — From 60 Lines to 18: Code an Agent Reads in One Pass
I refactored Hono — a production framework with 23k stars — using filefunc. All 4,419 tests passed. Then I measured: the median lines an agent reads to grasp one concept dropped 71%, from 60 to 18. File count isn't the point — read length is.

Precedent Is Not Truth — How AI Turns Patches into Authority
AI reads the structure of code but cannot read whether that structure is a decision or a patch. So the more it copies, the more a flaw accumulates false authority. What broke the loop was not a bigger model — it was a single line of doubt from a human.

Building Agent-Operable Systems
60–80% of Fortune 500 IT budgets go to guarding locked legacy. Because they can't open it. The real meaning of the AI bubble is not smarter models — it is that locked corporate memory is becoming reachable.

huma -- A Ratchet That Never Skips an Endpoint
When you ask an AI agent to test 42 endpoints, it declares 'done' around the 15th. huma turns the endpoint list into a ratchet session so the agent cannot skip a single one. scan, next, write, verify. Four commands, zero config.

Agent Operable Codebase
Is code that is easy for humans to read the same as code that is easy for agents to work with? It is not. When a file has 20 functions, agent performance drops by 30-85%. The office must be turned into a factory.

Class 6. Lock When It Passes — Ratchet Pattern Principles and Bulk Application
AI declared 'all done.' In reality it was 40/527. Ratchet Pattern hands completion judgment to the machine.

Reins Engineering — AI with Reins
Harness engineering is a fence. It keeps the agent from going outside, but doesn't ensure it reaches the destination. Reins Engineering is the reins — steer with deterministic contracts, lock with ratchets, separate decisions from implementation.

Hurl Stops Vibe Coding Drift
Vibe coding collapses under logic drift within 3 months. CMU, METR, DORA, and Amazon cases prove it. Declare API contracts in plain text with Hurl and lock them with a ratchet -- you suppress drift structurally without limiting AI's freedom.

yongol — The Keel of AI-Coded SaaS
Vibe coding collapses at 200 endpoints because AI cannot distinguish decisions from implementation details. yongol shifts the AI workload from code to 10 declarative specs and enforces cross-layer consistency before compilation. Harness with reins.

AI Sycophancy Bias Is a Business Feature
Sycophancy bias in LLMs is not a bug. It is a mathematical inevitability of RLHF and a commercial feature that big tech has no incentive to fix. This is why LLM-as-Judge is structurally impossible.

Why Coding Agents Work and Why They Break
The same model hallucinates in web chat but ships a 200-line feature in a coding agent. Not because the model changed — because the topology changed. Generation can be probabilistic. Verification must be deterministic.

Ratchet Pattern — How to Make an Agent Finish the Job
I asked an AI agent to write tests for 527 functions. It stopped at 40 and declared 'done.' The Ratchet Pattern forces completion by delegating the done/not-done decision to a mechanical verifier — so the agent keeps going until the machine says stop.

tsma -- Regression Defense Line for Legacy Code
A CLI tool that indexes every function, detects test presence, measures coverage, and gives precise feedback to LLM agents. One command builds a regression defense line around legacy code.

filefunc — One File, One Concept
The navigation unit for an AI code agent is the file. filefunc is a Go code structure convention and CLI tool that enforces one concept per file.