Skip to content

The anchor gate

An edit made before the loop has an anchor is the cheapest moment to say so, so the gate speaks once and lets the edit through.

What it checks, when it speaks, and what it ignores

Inside an open loop, pi/anchor-gate.ts appends one warning line to the edit’s tool result, where the agent reads it. It speaks when write or edit starts the act phase while an earlier phase of the loop kind is incomplete. That is no anchor (anchor on the kind call, a Reality anchor: line, or a skip). In a durable loop it is also a missing decision, spec, fresh read, approval, or design, read from the docs/specs/<folder>/ files, found from the book, the intent, or a todo ref.

It warns again only when a new phase goes missing, and the call still goes through. Outside a loop and in quick loops it stays silent. .md, .txt, and .html files, scratch/, docs/specs/, and temp files outside the project pass silently. Edits made through bash are not checked.