Skip to content

spec(t27mcp): check_hints -- compiler message to a short fix hint for foreign syntax - #10080

Merged
gHashTag merged 1 commit into
masterfrom
mcp-t27-check
Oct 17, 2026
Merged

gHashTag merged 1 commit into
masterfrom
mcp-t27-check

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Closes #10073

Part of the epic #10066 (learnability: parser hints for foreign syntax).

What

specs/t27mcp/check_hints.t27 (module T27mcpCheckHints): the decision behind the t27 MCP server's new
t27_check tool (gHashTag/t27-mcp). The server parses and typechecks source with the compiler front end
(bindings/wasm-explorer, as wasm). A model that writes foreign syntax gets messages written for compiler
authors; this spec maps the ones a model really triggers to a short "write this instead", and reads the line
number out of a message.

  • hint_code(msg): H_KEYWORD_IN, H_CAST (as u3), H_MATCH, H_INCREMENT (x++), H_TERNARY,
    H_TOP_LEVEL (impl), H_BRACE (Zig-style switch arm), H_WIDTH, H_UNKNOWN_TYPE; anything else
    H_NONE, so the server prints the compiler's own words and invents nothing.
  • line_of(msg): the number after line , or after a final : (the typechecker's warnings), or 0.
  • HINTS: the texts, emitted for the server by t27c gen-js.
  • let, &&, || and Zig-style signatures get no hint: the compiler accepts them.

Every rule is keyed on a message the compiler really emits; each test quotes one. Measured with the compiler
wasm on 55 foreign-syntax probes before the table was written.

specs/OWNERS.md gains a t27mcp/ row.

Evidence (Railway lab, t27c 0.5.2)

  • t27c test-report specs/t27mcp/check_hints.t27: 13 of 13 pass, 0 vacuous.
  • Negative control: with the cast rule's key mutated (target type to target typo) the cast test fails
    (12 of 13); a clean message, an arity error and two unrelated messages get H_NONE.
  • t27c gen-c plus zig cc -target wasm32-wasi -Os lowers it to a 1156-byte wasm that the server runs; the
    build and sha256 are in wasm/BUILD of the server PR.

Compiler gap found (not worked around by hand code)

t27c gen-c lowers HINTS[code].len (.len on an element of a [N]str table) to HINTS[code].len on a
const char*, which does not compile. The tests read the table through has(HINTS[code], "...") instead,
which lowers correctly.

Minimal repro:

module R;
pub const T : [2]str = ["", "ab"];
pub fn n(i: u32) -> u32 { return (T[i].len as u32); }

🤖 Generated with Claude Code

… foreign syntax

The t27 MCP server's t27_check tool judges source with the compiler front end
(wasm) and needs one decision: which hint a message gets. It lives here, with 13
tests and a negative control, not in the server's JavaScript. Compiled by t27c
gen-c to wasm.

Closes #10073
Refs #10066

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
gHashTag added a commit to gHashTag/t27-mcp that referenced this pull request Oct 17, 2026
…or foreign syntax

The compiler front end runs as wasm (explorer.wasm, gHashTag/t27
bindings/wasm-explorer, unchanged); each message gets a hint code and a line
number from wasm/check_hints.wasm, generated from
gHashTag/t27 specs/t27mcp/check_hints.t27 (PR gHashTag/t27#10080). check.mjs is
26 lines of glue and holds no rule.

Closes gHashTag/t27#10073
Refs gHashTag/t27#10066

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) October 17, 2026 18:51
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-17 18:55:32 UTC

Summary

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

These columns do not partition: 0 + 47 + 0 + 0 = 47, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=e769ef021713 != 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 1d8259e into master Oct 17, 2026
25 of 29 checks passed
gHashTag added a commit that referenced this pull request Oct 18, 2026
#10083 and #10092 were merged into their stacked base branches
(mcp-t27-check, mcp-t27-examples) after #10080 had already landed,
so neither spec reached master. This carries the two specs and the
OWNERS row unchanged from mcp-t27-examples.

Closes #10081
Closes #10090

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

spec(t27mcp): t27_check -- compiler message to a short fix hint for foreign syntax

1 participant