Skip to content

feat(t27c): every gen path runs typecheck first (Closes #6446) [needs owner label] - #6577

Closed
gHashTag wants to merge 2 commits into
masterfrom
claude/t27c-gen-typecheck-gate-rebased
Closed

gHashTag wants to merge 2 commits into
masterfrom
claude/t27c-gen-typecheck-gate-rebased

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Closes #6446

Every t27c gen* path, and seal hashing, now runs typecheck first, so a spec that typecheck refuses can no longer generate "green" code.

Owner exception -- PENDING

This PR edits hand-written Rust. Under the only-t27 rule (AGENTS.md, #6511) it may merge only after the owner puts the label owner-approved-foreign on it. The steward opened it under the owner's general instruction of 2026-10-05 (translated: "fix it and do not stop, do what is best"). That instruction was NOT given for this branch specifically, so the label is left to the owner. The debt this adds goes to the t27core self-host, #5980.

tools/policy/foreign-exceptions.txt carries PENDING entries for the three Rust paths. They must be removed before merge.

Files

File Kind
bootstrap/src/main.rs hand-written Rust (gate helpers + calls in every gen/seal/compile/server path)
cli/tri/src/misread.rs hand-written Rust (a separate control spec that still generates; 2 unit tests)
bootstrap/tests/gen_typecheck_gate.rs hand-written Rust test (3 tests)
tools/specs_generate_baseline.txt data: 2 damage-test fixtures that are deliberately not t27
tools/policy/foreign-exceptions.txt data: PENDING entries

Measured cost (Railway t27c lab, patch on master eb5358b)

🤖 Generated with Claude Code

gHashTag and others added 2 commits October 6, 2026 00:38
gen, gen-c, gen-rust, gen-verilog (+ sim/hir), gen-js/ts/python,
icarus/cocotb, seal, compile-all, compile-project and the HTTP gen/seal
handlers refuse a spec typecheck refuses: no output, non-zero exit, the
typecheck messages on stderr. No escape flag. typecheck and the gate
share one source selection (spliced if it parses, else raw).

tri misread: the reproducer must now be refused by every backend; the
shape typecheck still accepts (`Vec<>`) gets its own positive control.

Regression test bootstrap/tests/gen_typecheck_gate.rs: `f : ,` makes
gen-rust (and every gen path) fail with the typecheck message.

HELD: hand-written Rust, not opened as a PR under the 2026-10-05
t27-only rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he gate (Refs #6446)

neg_02_match_arms and neg_05_raw_string are tri damage controls: text shapes
that look damaged to a careless regex (Rust match arms, a raw string). They
are not t27 and typecheck refuses them, so the gen typecheck gate leaves them
ungenerated. Rewriting them would destroy the control; they are ledgered as
debt in specs_generate_baseline.txt instead.

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

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-05 17:48:14 UTC

Summary

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=9f2c8a4829f6 != 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).

This was referenced Oct 5, 2026
This was referenced Oct 6, 2026
@gHashTag

gHashTag commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #6787. It carries this gate, adds gen-testbench to it, moves the test into the existing backend_behaviour.rs harness with .t27 fixtures, and is lab-green on current master. This PR is left open for the owner to close.

gHashTag added a commit that referenced this pull request Oct 6, 2026
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 commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #6787, which landed the same gen typecheck gate on master; #6446 is closed.

@gHashTag gHashTag closed this Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

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