Skip to content

Oracle cluster: expected 'X', found 'X' (22 specs) #4706

Description

@gHashTag

Re-filed from #4511. An attempt claimed that issue on 2026-09-21 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.


What the oracle measured

expected 'X', found 'X'

It is not one file's problem: 22 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/config/schema.t27 > /tmp/t27-doctor.zig && zig test /tmp/t27-doctor.zig --test-no-exec 2>&1 | head -3
/tmp/t27-doctor.zig:267:55: error: expected '}', found ']'
    const lsp = lsp_server_create("t27", "t27c", &.{ _][ });
                                                      ^

The specs this affects

  • specs/config/schema.t27
  • specs/demos/jones_topology_filter.t27
  • specs/graph/knowledge_graph.t27
  • specs/igla/coder/weights.t27
  • specs/igla/training/low_bit_ternary.t27
  • specs/lsp/schema.t27
  • specs/memory/tmem/stream_compute.t27
  • specs/ml/layers/conv2d_layer.t27
  • specs/ml/layers/dense_layer.t27
  • specs/ml/loss/cross_entropy_loss.t27
  • specs/ml/recurrent/attention_mechanism.t27
  • specs/ml/transformer/feed_forward.t27
  • specs/nn/gla.t27
  • specs/port/tools/check_withdrawn_live.t27
  • specs/runtime/process.t27
  • specs/sync/schema.t27
  • specs/tri/collections/interval.t27
  • specs/tri/collections/namespace.t27
  • specs/tri/collections/result.t27
  • specs/tri/collections/set.t27
  • specs/tri/graph/disjoint_set.t27
  • specs/tri/net/async_stream.t27

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 with use 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-REPORTS has no test or invariant: measured 2026-09-20 over 60 specs it printed 677 of those where coverage found 190 untested functions, disagreeing on 59 of the 60 - it warns about bit_to_trit_pair in specs/base/ternary_encoding.t27, which test bit_to_trit_pair_zero calls on line 249. Read it as a hint; coverage is the answer.
  • t27c typecheck <spec> - types, before generation. Prints Typecheck 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. BLOCKED means 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

    1. t27c test-report specs/config/schema.t27 2>&1 | grep -c BLOCKED prints 0 (today it prints 1: the error above is what blocks it)
    1. t27c spec-status specs/config/schema.t27 does not print NOPARSE
    1. t27c gen specs/config/schema.t27 > /tmp/t27-doctor.zig && grep -c 'not yet implemented' /tmp/t27-doctor.zig prints 0
    1. cargo test -p t27c passes, if the fix is in the generator

Boundary

specs/config/schema.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 with use 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-REPORTS has no test or invariant: measured 2026-09-20 over 60 specs it printed 677 of those where coverage found 190 untested functions, disagreeing on 59 of the 60 - it warns about bit_to_trit_pair in specs/base/ternary_encoding.t27, which test bit_to_trit_pair_zero calls on line 249. Read it as a hint; coverage is the answer.
  • t27c typecheck <spec> - types, before generation. Prints Typecheck 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. BLOCKED means 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions