Skip to content

feat: t27_spec brief by default; field lists and failure reasons from a .t27 spec (Closes gHashTag/t27#10090) - #10

Merged
gHashTag merged 4 commits into
masterfrom
t27-brief
Oct 18, 2026
Merged

gHashTag merged 4 commits into
masterfrom
t27-brief

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Closes gHashTag/t27#10090

Part of the epic gHashTag/t27#10066 (learnability: fewer tokens and round trips for cheap models). Stacked on #11 (t27-examples); the spec is gHashTag/t27#10092.

What

  • t27_spec is brief by default: health, why it fails, loss, type-check errors, failing backends, size, summary, tags. fields: true returns the whole manifest record as before. For specs/demos/hello_world.t27 that is 619 bytes instead of 1330.
  • t27_specs rows keep the short list they already had; it now comes from the spec.
  • The hand-written brief() and failureReasons() are gone from server.mjs (35 lines out, 5 in). The field lists, the reason decision and the reason templates live in specs/t27mcp/spec_brief.t27, run as wasm/spec_brief.wasm with wasm/spec_brief.mjs; commands and sha256 are in wasm/BUILD. Built on the Railway lab.
  • brief.mjs (19 lines) is glue: it passes the manifest counters to the wasm, copies the listed keys and fills the {} of the templates.
  • smoke.mjs: the stale backendFailures check is fixed (see below) and two checks are added.

Hand-written JavaScript added: brief.mjs 19, server.mjs 5, smoke.mjs 9 = 33 lines (cap: 40 per file, 80 per PR). server.mjs shrinks by 30 net.

The smoke check that failed on #7

backendFailures tally matches the specs blaming a backend compared the sum of a per-backend count (737) with a count of specs (113). Not a server bug: the manifest's backendFailures counts specs per backend (c, js, rust, ts, verilog_hir, zig: 104 each; verilog: 113), and the sum of those is not a number of specs. The check now compares each backend's count with t27_specs {failedBackend} matched, and all seven agree.

Evidence

🤖 Generated with Claude Code

@gHashTag
gHashTag changed the base branch from t27-examples to t27-check October 17, 2026 18:37
… from specs/t27mcp/spec_brief.t27

Closes gHashTag/t27#10090. Part of gHashTag/t27#10066. Also fixes the stale
backendFailures smoke check (it summed a per-backend count against a spec count).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tri-claw

tri-claw Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Summary by t27-bees

The PR makes t27_spec return a brief record by default (health, failure reasons, loss, type-check errors, failing backends, size, summary, tags) instead of the full manifest, with fields: true for the old behavior. The brief field list, failure-reason logic, and reason templates move from hand-written JS in server.mjs to a .t27 spec compiled to WASM (wasm/spec_brief.wasm + generated wasm/spec_brief.mjs), with a tiny glue module brief.mjs. The smoke test's broken backend-failures tally is fixed to compare per-backend counts.

Worth a look

  • brief.mjs:7 — new URL('./wasm/spec_brief.wasm', import.meta.url) assumes the WASM file sits next to the module at runtime. If the package is bundled or the file layout changes, the fetch will fail.
  • brief.mjs:9–10 — The fill array indices (1=failedBackends, 2=tcErrors, 3=loss) must match the bit positions in wasm/spec_brief.mjs (W_BACKEND=2, W_TYPECHECK=4, W_LOSS=8) and the WHY_TEXT order. A spec change that reorders bits will silently produce wrong reason strings.
  • brief.mjs:12 — The call W.why_mask(isFail, nodes, failedBackends.length, tcErrors, loss) must match the WASM function's parameter order exactly. A signature drift in the compiled spec will return a wrong bitmask with no error.
  • server.mjs:348 — When fields: true, the response spreads the entire manifest row (...hit) and also adds whyFailing. The brief path (one(hit)) already includes whyFailing via cut(). If hit contains empty arrays (e.g., failedBackends: []), they appear in the full response but are filtered out by cut() in the brief response, creating an inconsistency.
  • smoke.mjs:55–57 — The per-backend check calls t27_specs with limit: 1 but asserts n === m where m is matched. If matched returns the limited count (1) instead of the total, the check passes incorrectly. The test assumes matched is the total.

Read: 8 files, +95 -43, the whole diff. Head 351bc91. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.

@gHashTag
gHashTag changed the base branch from t27-examples to master October 18, 2026 02:32
@gHashTag
gHashTag merged commit 9b44d93 into master Oct 18, 2026
2 checks passed
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.

t27mcp: t27_spec brief by default; field lists and failure reasons as a .t27 spec

1 participant