Repository navigation
spec(t27mcp): check_hints -- compiler message to a short fix hint for foreign syntax - #10080
Merged
Merged
Conversation
… 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>
This was referenced Oct 17, 2026
Merged
This was referenced Oct 17, 2026
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>
This was referenced Oct 17, 2026
gHashTag
enabled auto-merge (squash)
October 17, 2026 18:51
Contributor
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10073
Part of the epic #10066 (learnability: parser hints for foreign syntax).
What
specs/t27mcp/check_hints.t27(moduleT27mcpCheckHints): the decision behind the t27 MCP server's newt27_checktool (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 compilerauthors; 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 elseH_NONE, so the server prints the compiler's own words and invents nothing.line_of(msg): the number afterline, or after a final:(the typechecker's warnings), or 0.HINTS: the texts, emitted for the server byt27c 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.mdgains at27mcp/row.Evidence (Railway lab, t27c 0.5.2)
t27c test-report specs/t27mcp/check_hints.t27: 13 of 13 pass, 0 vacuous.target typetotarget typo) the cast test fails(12 of 13); a clean message, an arity error and two unrelated messages get
H_NONE.t27c gen-cpluszig cc -target wasm32-wasi -Oslowers it to a 1156-byte wasm that the server runs; thebuild and sha256 are in
wasm/BUILDof the server PR.Compiler gap found (not worked around by hand code)
t27c gen-clowersHINTS[code].len(.lenon an element of a[N]strtable) toHINTS[code].lenon aconst char*, which does not compile. The tests read the table throughhas(HINTS[code], "...")instead,which lowers correctly.
Minimal repro:
🤖 Generated with Claude Code