From 4284f101c87272f3a5a4bc70cd7f85c9d6bc5d22 Mon Sep 17 00:00:00 2001 From: Torben Nehmer Date: Wed, 16 Sep 2026 19:18:59 +0200 Subject: [PATCH] docs: why-gates-are-code haelt fest, dass ein Gate in Code auch erreichbar sein muss Files changed: - docs/why-gates-are-code.md --- docs/why-gates-are-code.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/why-gates-are-code.md b/docs/why-gates-are-code.md index 85691f0..dc6fb89 100644 --- a/docs/why-gates-are-code.md +++ b/docs/why-gates-are-code.md @@ -51,6 +51,28 @@ The Iteration Budget Gate asks a fourth kind of question - not "is this instance itself (call count, repeated identical calls), not from anything about the content of any one call. +## A gate in code still has to be reachable + +Code beats prose for the reason above, but on its own it buys less than it looks like: a check +that runs on every call is only as good as the thing it counts under. The Iteration Budget Gate +scopes its counter to a session, and "session" was approximated by the parent process id whenever +nothing set an explicit one. On a harness that runs every tool call in a freshly initialised +shell, that approximation hands out a new session per call - so a traced run of thirty-three calls +arrived as twenty-one sessions of one to three calls each, the ceiling of sixty was never +approached, and the loop-breaker's window never held three calls at once to compare. The gate ran +on every one of those calls, exactly as written, and refused nothing. + +That failure has no symptom of its own. A gate that fires announces that it exists; a gate that +*cannot* fire looks identical to a gate nobody happened to need - the same clean runs, the same +silence - and what finally told the two apart was reading a trace for an unrelated reason. So +there is a third property to keep alongside living in code and carrying measured numbers: each +gate has to leave evidence that it can still fire. The three that clear by token or by a +deliberate edit have it by construction, because clearing one is a visible event in somebody's +terminal. The budget gate, whose ordinary outcome is silence, is the one that had to be given +it - which is why its session id now carries where it came from, into both the trace and +`budget status`, so a session's own record answers the question instead of an investigation +having to. + ## Numbers that come from measurement, not intuition The iteration ceiling didn't start where it sits now. It used to run 15-25, borrowed from a