Skip to content

tidy-gateway: the frozen gate chain is two gates, not four - #255

Merged
dinstein merged 1 commit into
mainfrom
tidy-gatecount
Aug 8, 2026
Merged

tidy-gateway: the frozen gate chain is two gates, not four#255
dinstein merged 1 commit into
mainfrom
tidy-gatecount

Conversation

@dinstein

@dinstein dinstein commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Nightly tidy. New lens: sweep Go comments for numeric claims about countable things — the failure family that produced most of this week's findings, and one I caught myself committing earlier tonight.

  • 1. gateway.go said the frozen gate chain is "four gates long". It is two.

131 such claims across the tree; this is the one that is wrong. Four was correct at the initial public release, when the chain also carried precheckGate and hitlGate — both removed with the runtime governance surface, leaving their count behind in the one sentence whose job is to state the current one.

It matters more here than elsewhere: the sentence exists to argue that adding rate limiting did not lengthen the chain, and it made that argument against a number nobody counting gates can reproduce. AGENTS.md requires any new execution path to assert its gate count matches a direct call.

Spot-checked from the same sweep and all correct: internal/tier's "seven packages import it" (7), discovery/meta.go's "five entries" (5 meta-tools), cli_test.go's "~90 commands" (96 paths), eventlog's twenty-one kinds (machine-guarded by eventkinds_test.go).

The comment justifying why rate limiting lives outside the pipeline ended
"a quota is an admission WRAPPER around the call, not a gate — the frozen
gate chain stays four gates long". pipeline.New builds two: scopeGate and
tokenTierGate. gates.go says "there are exactly two, because there are
exactly two gates", and AGENTS.md freezes the order as scope → token tier.

Four was right at the initial public release, when the chain also carried
precheckGate and hitlGate. Both went with the runtime governance surface,
and this sentence kept their count.

It is a worse place than most to leave a stale number. The sentence exists
to show that adding quotas did NOT lengthen the chain, and it was making
that argument against a figure a reader counting gates cannot reproduce —
so the one comment asserting the chain is unchanged is the one that reads
as though it changed. Gate count is load-bearing here: AGENTS.md requires
any new execution path to assert its count matches a direct call, and
inproc_test compares the counters.

Found by sweeping Go comments for numeric claims about countable things,
after catching myself writing hardcoded counts into a doc comment earlier
tonight.

make ci green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dinstein
dinstein merged commit b3e9e61 into main Aug 8, 2026
3 checks passed
@dinstein
dinstein deleted the tidy-gatecount branch August 8, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant