Skip to content

fix(t27c): gen refuses what typecheck refuses, 35 misread specs fixed (Closes #6446) - #6787

Merged
gHashTag merged 2 commits into
masterfrom
claude/t27c-gen-typecheck-6446
Oct 6, 2026
Merged

gHashTag merged 2 commits into
masterfrom
claude/t27c-gen-typecheck-6446

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Closes #6446
Refs #6488 #6092

Owner approval

On 2026-10-06 the owner put the label owner-approved-foreign on issue #6446. That approves edits to existing Rust in bootstrap/ (the t27c compiler) for this issue only. This PR carries the same label. It adds no new foreign-language source file: the only new files are two .t27 fixtures.

What changes

  1. The 35 misread specs. These were already fixed at the source, in .t27, by fix(specs): the 28 specs typecheck refused while gen emitted them (Refs #6446) #6491 (28 specs) and fix(specs): the 8 specs the gen typecheck gate would refuse (Refs #6446) #6566 (8 specs). The lab misread gate on master 5bad20521 reports pairs 0, refused 0, silent 0, so this PR has no spec left to fix.
  2. Every gen path runs typecheck first (bootstrap/src/main.rs). A spec that typecheck refuses produces no output, a non-zero exit, and the message typecheck refused <path>: N error(s), so nothing is generated for it (#6446) followed by each error. There is no escape flag on the default path.
  3. Test (bootstrap/tests/backend_behaviour.rs, the existing harness, with two .t27 fixtures in bootstrap/tests/fixtures/gen_typecheck/):
    • gen_rust_refuses_a_field_with_no_type: a spec with f : ,, which used to print pub f: , and exit 0, now makes gen-rust fail with the typecheck message and empty stdout.
    • every_gen_path_refuses_a_spec_typecheck_refuses: the same check across all nine gen commands.
    • typecheck_and_gen_agree_on_the_gate_fixtures: the well-formed twin still passes typecheck, gen, gen-rust and gen-c, so the refusal comes from the gate and not from a broken binary.
  4. tri misread control (cli/tri/src/misread.rs, outside bootstrap/, carried from feat(t27c): every gen path runs typecheck first (Closes #6446) [needs owner label] #6577). Its positive control fed a malformed spec through gen-rust/gen-c and expected the misread. Under the gate that spec is now refused, so the control expects the refusal. A second control (Vec<>, which typecheck accepts) keeps proving the shape detector still fires. Without this edit, tri misread would report its own control as broken.
  5. tools/specs_generate_baseline.txt: the three fixtures that must never generate (damage_negative/neg_02, neg_05, and the new negative fixture) are listed with the gate's refusal.
  6. tools/policy/foreign-exceptions.txt: main.rs, backend_behaviour.rs and misread.rs are listed for this issue only, with the approval cited. Remove those three lines after this merges.

bootstrap/src/compiler.rs is unchanged, so the seal and FROZEN_HASH do not move. The lab frozen-hash gate reports a match (3c78f3c7ffb7), so the CONTRIBUTING.md "Build speed" seal step was not needed.

Measured (Railway t27c lab, debug t27c, every tracked .t27)

master 5bad20521 this branch 3e07a2890
tracked .t27 files 1431 1433 (+2 fixtures)
refused by typecheck 28 29 (+1 negative fixture)
refused by typecheck but gen-rust exit 0 4 0
refused by typecheck but gen exit 0 4 0
gen-rust refusals that name the gate 0 5

On master, these four specs were refused by typecheck yet generated anyway:

  • damage_negative/neg_02_match_arms
  • damage_negative/neg_05_raw_string
  • terminator/field_swallow
  • terminator/unbalanced

All four are fixtures. No spec under specs/ changes behaviour: the corpus already typechecks after #6491/#6566. tri misread is clean on both sides (0 silent, 0 refused), and with this branch its control is green.

cargo test -p t27c --tests with the CI ratchet:

  • No new failures on the branch vs master. The same 7 tests fail on both sides, all lab-environment ones (zig_primitive_bindings and one icarus_lowerable).
  • The three new tests pass.

Lab gates for 3e07a2890: verdict green

  • frozen-hash: ok
  • build: ok
  • suite: RATCHET CLEAN
  • lean: ok
  • seal-currency: ok
  • seal-coverage: 1471 seals, 1329 hold, 142 known-broken
  • specs-parse: ok
  • specs-generate: 1386 specs, 1382 generate, 4 known-broken (listed in the baseline)
  • misread: 0 silent, 0 refused

🤖 Generated with Claude Code

A spec that `t27c typecheck` refuses now generates nothing on every gen
path (gen, gen-c, gen-rust, gen-verilog, gen-verilog-hir,
gen-verilog-for-simulation, gen-testbench, gen-js, gen-ts, gen-python,
icarus-*, compile-all, compile-project, seal hashing and the HTTP server):
stdout stays empty, the command exits non-zero and stderr carries the
typecheck messages. There is no flag to skip it.

Carries the gate from #6577 (rebased on master 5bad205) and adds the
gen-testbench path it missed. The test moves into the existing harness
bootstrap/tests/backend_behaviour.rs and reads two .t27 fixtures under
bootstrap/tests/fixtures/gen_typecheck/ (a field with no type, and its
well-formed twin as the negative control), so no new Rust file is added.

`tri misread` ran its reproducer through gen-rust and gen-c and required
it to generate; with the gate it must instead be refused, and the shape
typecheck still accepts (`Vec<>`) is proven on a separate silent control.

Owner approval: label owner-approved-foreign on #6446 (2026-10-06) for
edits to existing Rust for this issue; the three paths are listed in
tools/policy/foreign-exceptions.txt with that scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag gHashTag added the owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR label Oct 6, 2026
@gHashTag
gHashTag enabled auto-merge (squash) October 6, 2026 12:09
This was referenced Oct 6, 2026
This was referenced Oct 6, 2026
Conflict in tools/policy/foreign-exceptions.txt: kept master's #6445 and #6658
entries and this branch's three #6446 entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-06 13:37:32 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 1
FAILING 49
PENDING 0
NO CHECKS YET 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=3c78f3c7ffb7 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit 50f3d21 into master Oct 6, 2026
30 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t27c gen emits code for specs typecheck refuses (35 misread pairs stay 'green')

1 participant