Skip to content

spec-guards: ring-096 drift and 8 published-figure pins were hidden behind the seal step #9043

Open

Description

@github-actions

Re-filed from #6553. An attempt claimed that issue on 2026-10-07 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.


Refs #6092

spec-guards has not passed on master since 2026-09-16. The seal-currency step failed first, and that hid the steps after it. #6546 fixes the seal step. On that PR the job now gets one step further and fails on failures that were already on master.

Measured on the Railway t27c lab at master a406f41, with t27c built from master:

  1. tools/check_ring_spec_drift.py exits 1. ring-096-rust against specs/numeric/formats.t27 is DRIFTED: 6 functions are shared and 5 have different signatures.
    • The spec declares stub signatures such as fn gf16_to_f32(x: u16) -> gf16 { } and fn quantize_value(x: f32, fmt: Format) -> gf16 { }.
    • gen-rust lowers these to u16/f32 stubs.
    • The hand ring rings/ring-096-rust/src/lib.rs uses f64.
  2. tools/published_figures.py --check exits 1. 8 pinned figures have drifted:
    • []T{} literals, x.len(), x.len, len(x), a::b::c, OP_*, abs(, and test blocks (pinned 14314, measured 15067).
    • The pins live in the FIGURES list in tools/published_figures.py.
  3. check_duplicate_declarations.py and diagnostic_capacity.py exit 0. The CONVERGED-pairs step after them was not run here.

Both repairs touch non-t27 files: either the hand ring, or the Python pin table. The alternative is to change the meaning of formats.t27. Under the 2026-10-05 no-foreign-code rule, this needs an owner decision.

Boundary

  • specs/numeric/formats.t27
  • rings/ring-096-rust/src/lib.rs
  • tools/check_ring_spec_drift.py
  • tools/published_figures.py

User Scenarios

Requirements

  • FR-001: The hand-written ring rings/ring-096-rust/src/lib.rs MUST align its 5 drifted function signatures with the stub signatures declared in specs/numeric/formats.t27 (e.g., gf16_to_f32, quantize_value using f64 per the ring, or the spec changed to f64).
  • FR-002: The FIGURES list in tools/published_figures.py MUST be updated so that all 8 pinned figure counts (including test blocks: pinned 14314 → measured 15067) match the current measured values from the codebase.
  • FR-003: tools/check_ring_spec_drift.py MUST exit 0 when run against specs/numeric/formats.t27 and rings/ring-096-rust/src/lib.rs after the signature alignment.
  • FR-004: tools/published_figures.py --check MUST exit 0 after the FIGURES table is updated to the current measured values.

Success Criteria

  • python tools/check_ring_spec_spec_drift.py specs/numeric/formats.t27 rings/ring-096-rust/src/lib.rs exits 0
  • python tools/published_figures.py --check exits 0
  • The spec-guards job on master passes all steps including CONVERGED-pairs (previously hidden)

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