Repository navigation
Description
What the oracle measured
use of undeclared identifier 'X'
It is not one file's problem: 106 specs fail the same way. The oracle generates every spec to Zig and runs zig test over the result; these are the ones whose generated code the compiler refuses, with the same message.
Reproduce it
$ t27c gen specs/account/auth.t27 > /tmp/t27-doctor.zig && zig test /tmp/t27-doctor.zig --test-no-exec 2>&1 | head -3
/tmp/t27-doctor.zig:23:16: error: use of undeclared identifier 'Ok'
return Ok(AccessToken("fresh-access-token"));
^~
The specs this affects
specs/account/auth.t27specs/account/repo.t27specs/api/c_api_contract.t27specs/api/sdk_contract.t27specs/ar/composition.t27specs/ar/explainability.t27specs/ar/restraint.t27specs/auth/config.t27specs/base/ternary_add.t27specs/brain/brain.t27specs/brain/neural_gamma.t27specs/bus/pubsub.t27specs/config/load.t27specs/demos/jones_topology_decision_gate.t27specs/file/operations.t27specs/file/watcher.t27specs/fpga/bridge.t27specs/fpga/testbench/fifo_tb.t27specs/fpga/testbench/mac_tb.t27specs/fpga/testbench/memory_tb.t27specs/fpga/testbench/power_analysis_tb.t27specs/fpga/testbench/top_tb.t27specs/fpga/testbench/uart_tb.t27specs/git/diff.t27specs/git/operations.t27- ...and 81 more
What to look at first
The error is in GENERATED Zig, so the fix is in the generator or in the spec that feeds it - never in the .zig, which is overwritten on every run. If every spec in the list shares a construct, the generator is the suspect; if only some do, the specs are.
The instruments
Every one of these reads and prints; none of them writes. Run them from the repository root, with <spec> replaced by a file from the list above:
.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.
Acceptance criteria
-
t27c test-report specs/account/auth.t27 2>&1 | grep -c BLOCKEDprints0(today it prints1: the error above is what blocks it)
-
t27c spec-status specs/account/auth.t27does not printNOPARSE
-
t27c gen specs/account/auth.t27 > /tmp/t27-doctor.zig && grep -c 'not yet implemented' /tmp/t27-doctor.zigprints0
-
cargo test -p t27cpasses, if the fix is in the generator
Boundary
specs/account/auth.t27
Activity
gHashTag commentedon Nov 17, 2026
Covered by specs/conformance/oracle_undeclared_identifier.t27.