Repository navigation
The gate blocked a correct fix because the parser reached more Rust; exempt dialect files from the event ratchet #4816
Description
Re-filed from #2660. An attempt claimed that issue on 2026-09-23 and left an empty branch, and a dispatch row that has spent its retry ceiling keeps its issue for good - so no bee could take it again, however much the brief improved. The work below is carried over unchanged.
#2658 reverted a correct lexer fix because the parse gate failed on one spec.
This is why it failed, and it is not the fix's fault.
The parser told me, once I asked it
recovery-at: Expected LBrace, got Ident ('where') at line 98:9
recovery-at: Expected LBrace, got Ident ('where') at line 137:9
recovery-at: Expected LBrace, got Ident ('where') at line 180:9
recovery-at: Unexpected top-level token: KwReturn at line 339:9
Nothing to do with exponents. Line 98:
fn for_all<F>(config: PropertyTestConfig, generator: fn(&mut Random) -> T, property: F) -> TestResult
where F: Fn(T) -> bool
where is Rust. specs/test_framework/property_test_template.t27 is one of
the 66 files in RUST_DIALECT.json — the ones this project has documented as
unparseable by t27.
The fix let the parser get further into a Rust file, and further in was more
Rust. The event count rose because the parser improved.
What I did wrong yesterday, and today
Yesterday I spent the iteration on fixtures that could not reproduce it, then
reverted. The parser prints recovery-at: with a line number and I never
looked. Three fixtures and two wrong hypotheses, against one command.
Today I also had to falsify my own hypotheses in order: single literals (no),
all literals (no), hex 0x7E00 (no). Only then did I ask the parser.
The gate change
Rust-dialect specs are exempt from the recovery-event half of the ratchet.
Recovery events are not monotone in parser correctness, exactly as total error
count is not monotone in emitter correctness (#2603): on a file already written
off, a rise carries no information.
declarations swallowed and declaring but capturing nothing stay ratcheted
for every file. Those mean lost content, which is a real regression anywhere.
In #2646 I wrote that coupling this gate to RUST_DIALECT.json would be "no
gain". That was wrong, and the cost was a correct fix reverted for a day.
Landed
The lexer accepts decimal exponents. return 2.5e10; emitted e10; — the
mantissa silently gone. 106 literals in 23 specs.
| before | after | |
|---|---|---|
| specs behind a wall | 91 | 88 |
| errors behind walls | 100 | 97 |
| valid specs | 141 | 141 |
| gate | 106 events, 0 lost | 110 events, 0 lost, holds |
| regressed from VALID | — | 0 |
The event count is higher and the gate passes, which is the point of the change.
Boundary
specs/test_framework/property_test_template.t27
The instruments
Every one of these reads and prints; none of them writes. Run them from the repository root, with <spec> replaced by the file in ## Boundary:
.t27 is not Rust and not Zig, and a bee fluent in either writes one by
accident. Measured 2026-09-20: a bee filled eight bodies in
specs/file/watcher.t27 with return Ok(());, Err(FileError::WatcherNotFound)
and for i in 0..watchers.length. The parse ratchet refused the whole file --
Unexpected token in expression: RParen, line 123 -- and a spec that does not
parse generates nothing, so every test it already carried stopped running.
At the top level the parser accepts exactly these eight forms, with an optional
pub, and no others:
const var fn enum struct test invariant bench
There is no trait, no impl, no type X = ..., no generics, no macro. What
a bee reaches for from another language, and what happens:
- Rust's result sugar (
Ok(()),Err(E::V),?) is not a construct here. - Rust macros (
println!,format!,vec!) are not constructs here. - A range loop (
for i in 0..n) is Rust and Zig, not this language. - Zig builtins (
catch unreachable,@intCast,@constCast) are not constructs here. - Cross-module reuse (
use other::fn;) parses and then generates a comment and an unqualified call, so the Zig fails withuse of undeclared identifier(use a::b; generates no import, so no spec can reuse a function from another spec #4298). It does not work yet.
t27c parse <spec> answers in one line whether what you wrote is the language.
Run it before you report, every time.
t27c spec-status <spec>- the compiler's one-word verdict: IMPLEMENTED, PARTIAL, UNWRITTEN, NOPARSE, NOFN. Exit code is 0 whatever it says, so read the word.t27c symbols <spec>- every name the file declares, with its kind. Answers "does this already exist here?" before you add it.t27c outline <spec>- per function: its locals, what it calls, what it returns. The contract you are implementing against.t27c coverage <spec>- which functions have a test and which do not. The issue asks for tests; this is how you check you wrote them.t27c lint <spec>- style and shape warnings. It OVER-REPORTShas no test or invariant: measured 2026-09-20 over 60 specs it printed 677 of those wherecoveragefound 190 untested functions, disagreeing on 59 of the 60 - it warns aboutbit_to_trit_pairinspecs/base/ternary_encoding.t27, whichtest bit_to_trit_pair_zerocalls on line 249. Read it as a hint;coverageis the answer.t27c typecheck <spec>- types, before generation. PrintsTypecheck OK (0 errors, 0 warnings)or the errors.t27c test-report <spec>- builds this spec and runs its own tests, which is what the oracle does.BLOCKEDmeans the generated Zig does not compile, with the error beside it.python3 tools/dupe_scan.py --name <function>- where that function already lives, if it does. 576 of 4021 bodies here are byte-identical copies.
The rest of the toolbelt is in docs/BEE_TOOLBELT.md.
Activity
gHashTag commentedon Oct 3, 2026
Closing as obsolete. The lexer fix this exemption was meant to unblock landed in 1d14b84 (#4783):
2.5e10keeps its mantissa. specs/test_framework/property_test_template.t27 no longer contains Rustwherecode (it survives only in comments, lines 427 and 501) andt27c spec-statusreports IMPLEMENTED. The parse gate on master, tools/ci/check_specs_still_parse.py, fails only on a parsed-to-NOPARSE flip (line 116), so there is no recovery-event ratchet left to exempt dialect files from.Triage for the review jam, #5776: this card was escalated because it states no acceptance criterion the Queen can read. Reopen if this is wrong.