Repository navigation
The gate I added could never have run, and enum was not the only key the converter drops #5275
Description
Re-filed from #2724. An attempt claimed that issue on 2026-09-24 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.
Three follow-ups. Two of them found something wrong with earlier work in this same session.
1. Two numbers that were wrong in two places each
lsp/language.t27 and lsp/protocol.t27 each carried a length written into both the declared type and the assertion, so the two agreed with each other and with nothing else -- neither could be checked while the files did not compile.
| string | declared | asserted | true | |
|---|---|---|---|---|
LANG_ZIG |
"zig" |
[4]u8 |
4 | 3 |
METHOD_COMPLETION |
"textDocument/completion" |
[21]u8 |
21 | 23 |
Settled by counting, not by preference. The strings are right; the counts were wrong. Their siblings of identical shape -- "t27"->3, "python"->6, "exit"->4, "textDocument/didClose"->21 -- were all correct and passing, which is what made the two stand out.
lsp/language.t27 now runs 14 tests, all green -- a file whose tests had never executed at all. lsp/protocol.t27 is 30 passing, 1 failing, and that one stays: message_buffer_create reports a capacity it cannot hold (#2719), which is an API decision.
2. The self-check gate had no Zig -- it could not have run once
I wired harness_selfcheck.py into the prove job earlier this session. It sits at step 10 of 70. Nothing installs Zig before it, and nothing in that job installs Zig at all.
A gate that cannot execute is the decoration it was written to prevent. Fixed by putting setup-zig immediately ahead of it.
I nearly made it worse: my first move today was to add a second self-check step further down the same job -- a duplicate, also without Zig. Caught by listing the job's step names before committing.
Version matters here and the repo disagrees with itself. The only other Zig in CI is phi-loop-ci.yml, pinned to 0.13.0; every figure the run scan has produced was measured on 0.16.0. They are not interchangeable for this purpose -- usingnamespace was removed in 0.16 and the @typeInfo tags were renamed -- so the gate pins 0.16.0 and says why in a comment.
3. enum: was not the only key the converter flattens
Counted structurally across all 366 ancestors -- every entry under a type whose value is a nested block:
| key | blocks upstream | converter |
|---|---|---|
fields: |
650 | handled |
variants: |
41 | was not |
enum: |
31 | fixed in #2718 |
union:, cases: |
23 | still not |
variants: is the commoner of the two bare-name keys, and I fixed the rarer one first. Only 3 reached this corpus, because most of those ancestors have no route -- so the number that matters for a future conversion is 41, not 3.
Handled now. The converter derives 35 enum declarations, up from 18, and 34 of 34 comparable ones are identical to the hand recovery, 0 differing. The one unmatched is my cross-check script pairing http.t27 with server/http.t27 by basename -- the same trap as #2673, in my own tooling again.
union: and cases: carry a nested map per case rather than bare names, which the flat field grammar cannot express. Left open deliberately rather than half-done.
Measured across all of it: ast-check valid 296, errors 588, 0 specs worse, parse gate holds at 105 events / 0 lost.
Original file list
specs/lsp/language.t27specs/lsp/protocol.t27.github/workflows/phi-loop-ci.yml
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.
Queen-runnable restatement (2026-10-05)
Item 1 never reached master: commit 0b4e93d (the length fixes) is not an ancestor of master, and master's specs/lsp/language.t27 is a 14-line stub with one TODO and no tests. specs/lsp/protocol.t27 already carries METHOD_COMPLETION as a slice (#4786). Items 2 and 3 are workflow YAML and the Rust converter, out of scope under the only-t27 rule.
Boundary
specs/lsp/language.t27.trinity/seals/lsp_Specs.Lsp.Language.json.trinity/seals/lsp-language.json.trinity/seals/lsp_lsp-language.json
User Scenarios & Testing
- Given master, where
specs/lsp/language.t27is a stub andt27c test-reportprintstests 0, when the language spec is restored, then it declares the language ids (withLANG_ZIG = "zig", three bytes) and its tests run withFAIL 0.
Requirements
- FR-001:
specs/lsp/language.t27MUST declare the language id constants (LANG_T27,LANG_ZIG,LANG_PYTHON, ...) and helpers such aslanguage_id_from_extensionandis_t27_extension, as in 0b4e93d, written in constructs t27c compiles, with tests asserting concrete values (for example the length ofLANG_ZIGis 3). - FR-002: The change MUST NOT add or modify non-t27 hand-written code (specs/policy/own_language.t27).
- FR-003: Remove the
TODO: Implementstub body. - FR-004: After the edit run
t27c seal specs/lsp/language.t27 --save(the seal JSON is t27c output).
Success Criteria
grep -c 'LANG_ZIG' specs/lsp/language.t27prints at least1grep -c 'TODO: Implement' specs/lsp/language.t27prints0t27c test-report specs/lsp/language.t27 2>&1 | grep -cE '^ (FAIL +0|pass +[1-9][0-9]*)$'prints2
Activity
Restore LSP language specification with language ID constants and hel…
salvage(queen-5275): commit what the turn left uncommitted
docs: the coordination entry this branch needs to land