Repository navigation
fix(gate): count the caps with one tokenizer - #1748
Merged
Merged
Conversation
The gate measured the permanent caps with whatever tokenizer the installed ttok defaults to, and ttok changed that default in 1.0: gpt-5 (o200k_base) there, gpt-3.5-turbo (cl100k_base) in 0.3, which CI pins. On Lean the second counts 4.5% less, so the same tree passes the caps under one and fails under the other: 62,092 vs 64,885 on bend2/bendtt.lean, over the 64,000 cap. The fix names the model, so the count the caps mean is the same on every machine and under every ttok, and the CI pin stays valid: 0.3 and 1.0 now agree on all seven capped files.
Lorenzobattistela
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gate measured the permanent caps with whatever tokenizer the installed
ttokdefaults to.ttokchanged that default in 1.0 —gpt-5(o200k_base) there,gpt-3.5-turbo(cl100k_base) in 0.3, which the CI workflow pins — and on Lean the second counts 4.5% less. The same tree then gets two verdicts:bend2/bendtt.leanis 62,092 tokens undercl100k_baseand 64,885 undero200k_base, against a cap of 64,000. It is over by 885 tokens under one tokenizer and not at all under the other.Why this matters. The caps are permanent, and the only sanctioned response to a file over its cap is to make it smaller: "A file over its cap is made smaller by simplification, never by moving code out." A contributor who installs the current
ttok— which the gate's own error message tells them to do — runs the gate locally, seesbend2/bendtt.leanover the cap, and deletes Lean proofs from the machine-checked kernel to satisfy a budget that was never exceeded. Nothing but the CI workflow pinned the tokenizer, so a local verdict and the CI verdict could disagree.The fix names the model rather than the tool version, so the count the caps mean is the same on every machine and under every
ttok, present or future. The CI pin stays valid: 0.3 takes-m gpt-3.5-turbo, which is its own default. The existing error path already covers an unsupported model, so there is nothing else to add.Check — 0.3 and 1.0 now agree exactly on all seven capped files:
bend2/bend.tsbend2/comp.tsbend2/main.tsbend2/safe.tsbend2/bendtt.leanREADME.mdguide/GUIDE.mdGates on main: repo 54/54.
Not part of this PR, but worth a decision:
guide/GUIDE.mdis at 7,998 of 8,000 andbend2/safe.tsat 23,992 of 24,000, so the next edit to either turns the gate red, and the only sanctioned response is to delete from them. The core librarybend2/base.bendis uncapped, which is the shape of answer the caps already have for a file that grows.