<?xml version="1.0" encoding="UTF-8"?>
<spec xmlns="https://vibevm.org/spec/1">
  <title id="root">go-ai-native-mcp — the server brief</title>
  <status stage="spec" state="done"/>
  <p p="1"><fact id="SERVED-OVER-MCP-AS-ONE-STDIO-BINARY" status="impl/done">**What it is.** The AI-Native Go discipline served over MCP: one stdio
binary, seventeen tools, launched by an agent host straight from this
package's slot.</fact></p>
  <p p="2"><fact id="SERVING-NEEDS-NO-VIBE-ON-THE-MACHINE" status="impl/done">Serving needs no vibe anywhere on the machine
(PROP-027 §2.6).</fact></p>
  <p p="3"><fact id="TRANSPORT-IS-THE-VENDORED-MCP-CORE" status="impl/done">Transport: the vendored `mcp-core` (line-delimited
JSON-RPC 2.0, protocol `2024-11-05` — MCP-CORE-v0.1).</fact></p>
  <p p="4"><fact id="THE-GO-ORACLE-STANDS-ON-GO-TYPES" status="spec/done">The Go oracle
stands on go/types — the reference implementation of the language
spec — one honest step short of the TS oracle (which IS tsc) and far
tighter than rust-analyzer↔rustc; the floor stays the truth
(TCG-ORACLE-GO §5).</fact></p>
  <p p="5"><fact id="THE-TOOLS-CALL-THE-SAME-LIB-FNS-THE-CLIS-CALL" status="impl/done">**One engine, one truth.** The tools call the SAME lib fns the CLIs
call, and the `=1.0.0` pin on `stack:org.vibevm.ai-native/go-ai-native-lang`
holds this package's vendored copies and the consumer's installed
stack to one resolved version set.</fact></p>
  <p p="6"><fact id="TOOL-LEVEL-FAILURE-IS-AN-ISERROR-RESULT" status="impl/done">Tool-level failure — a red gate, an
absent-toolchain refusal WITH ITS RECIPE — is an `isError` RESULT;
protocol errors are reserved for the transport grammar.</fact></p>
  <p p="7"><fact id="REPORTS-CARRY-THE-RUNS-ENTIRE-STORY" status="impl/done">**Reports are whole.** Every discipline tool runs inside the
`mcp-core::capture` guard, so the agent's report carries the run's
entire story — the runner's own words AND its child processes (go,
gofmt, staticcheck, exhaustive).</fact></p>
  <section id="parity-map" title="The parity map">
    <p p="8"><fact id="parity-map-lead" status="impl/done">Tool ↔ the CLI invocation it is parity-locked to (the enumeration test
pins the list; the descriptions in `tools/list` restate each row):</fact></p>
    <table p="9">
      <tr>
        <td>Tool</td>
        <td>CLI</td>
      </tr>
      <tr>
        <td><fact id="ROW-INIT" status="impl/done">`init`</fact></td>
        <td><fact id="ROW-INIT-CLI" status="impl/done">`go-ai-native init [--namespace] [--force]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-FLOOR" status="impl/done">`floor`</fact></td>
        <td><fact id="ROW-FLOOR-CLI" status="impl/done">`go-ai-native floor [--keep-going]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-CONFORM-CHECK" status="impl/done">`conform_check`</fact></td>
        <td><fact id="ROW-CONFORM-CHECK-CLI" status="impl/done">`go-ai-native-conform check [--scope] [--baseline]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-CONFORM-FREEZE" status="impl/done">`conform_freeze`</fact></td>
        <td><fact id="ROW-CONFORM-FREEZE-CLI" status="impl/done">`go-ai-native-conform freeze [--baseline]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-SPECMAP-CHECK" status="impl/done">`specmap_check`</fact></td>
        <td><fact id="ROW-SPECMAP-CHECK-CLI" status="impl/done">`go-ai-native-specmap --check`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-SPECMAP-WRITE" status="impl/done">`specmap_write`</fact></td>
        <td><fact id="ROW-SPECMAP-WRITE-CLI" status="impl/done">`go-ai-native-specmap`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-TRACE-EXPLAIN" status="impl/done">`trace_explain`</fact></td>
        <td><fact id="ROW-TRACE-EXPLAIN-CLI" status="impl/done">`go-ai-native trace &lt;target&gt; [--json] [--prose]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-TEST-GATE" status="impl/done">`test_gate`</fact></td>
        <td><fact id="ROW-TEST-GATE-CLI" status="impl/done">`go-ai-native test-gate [--baseline]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-TRIPWIRE" status="impl/done">`tripwire`</fact></td>
        <td><fact id="ROW-TRIPWIRE-CLI" status="impl/done">`go-ai-native tripwire [--base] [--debt]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-HEALTH" status="impl/done">`health`</fact></td>
        <td><fact id="ROW-HEALTH-CLI" status="impl/done">`go-ai-native health [--out]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-FAST-LOOP" status="impl/done">`fast_loop`</fact></td>
        <td><fact id="ROW-FAST-LOOP-CLI" status="impl/done">`go-ai-native fast-loop [--cell] [--budget-secs] [--enforce-budget]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-CODEMOD-ADD-CELL" status="impl/done">`codemod_add_cell`</fact></td>
        <td><fact id="ROW-CODEMOD-ADD-CELL-CLI" status="impl/done">`go-ai-native codemod add-cell &lt;cell&gt; &lt;spec-uri&gt;`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-TCG-VALIDATE" status="impl/done">`tcg_validate`</fact></td>
        <td><fact id="ROW-TCG-VALIDATE-CLI" status="impl/done">`go-ai-native-tcg validate &lt;file&gt; [--content-from]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-TCG-SCOPE" status="impl/done">`tcg_scope`</fact></td>
        <td><fact id="ROW-TCG-SCOPE-CLI" status="impl/done">`go-ai-native-tcg scope &lt;file&gt; [--position]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-TCG-COMPLETE" status="impl/done">`tcg_complete`</fact></td>
        <td><fact id="ROW-TCG-COMPLETE-CLI" status="impl/done">`go-ai-native-tcg complete &lt;file&gt; --position [--prefix] [--max]`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-TCG-TYPE" status="impl/done">`tcg_type`</fact></td>
        <td><fact id="ROW-TCG-TYPE-CLI" status="impl/done">`go-ai-native-tcg type &lt;file&gt; --position`</fact></td>
      </tr>
      <tr>
        <td><fact id="ROW-TCG-BENCH" status="impl/done">`tcg_bench`</fact></td>
        <td><fact id="ROW-TCG-BENCH-CLI" status="impl/done">`go-ai-native-tcg bench --corpus --report`</fact></td>
      </tr>
    </table>
    <p p="10"><fact id="THE-SPECMAP-GATE-FORM-STAYS-CLI-ONLY" status="impl/done">`go-ai-native-specmap --gate` (the package-self-trace form) stays
CLI-only, as on the sibling servers.</fact></p>
    <p p="11"><fact id="THE-GO-UMBRELLA-HAS-NO-LEDGER-COMMAND" status="impl/done">The Go umbrella has no ledger
command — seventeen tools, the TS count.</fact></p>
  </section>
  <section id="discipline-tools" title="The discipline half">
    <p p="12"><fact id="TWELVE-THIN-ADAPTERS-OVER-THE-LIB-FNS" status="impl/done">Twelve thin adapters over `go_ai_native_cli` / `go_ai_native_conform` /
`go_ai_native_specmap` lib fns, each wrapped in the stderr-capture
guard — an agent's report carries the run's whole story (go, gofmt,
staticcheck, exhaustive children included).</fact></p>
    <p p="13"><fact id="EVERY-SCHEMA-CARRIES-THE-OPTIONAL-LANGUAGE-PROPERTY" status="impl/done">Every schema carries the
optional `language` property; a non-`go` value refuses with the recipe
naming that language's own server (PROP-026 §2 continuity).</fact></p>
    <p p="14"><fact id="HEAVY-TOOLS-SAY-EXPECT-MINUTES-AND-NOTHING-PROMPTS" status="impl/done">Heavy
tools say «expect minutes»; nothing prompts.</fact></p>
  </section>
  <section id="tcg-tools" title="The tcg half">
    <p p="15"><fact id="ONE-PERSISTENT-ORACLE-SESSION-SHARED-BY-FIVE-TOOLS" status="impl/done">The four oracle ops + the bench harness over ONE persistent gopls
session shared by all five tools: lazy-spawned on first use, respawned
ONCE per op on a crashed session (the serve relay's posture,
server-local).</fact></p>
    <p p="16"><fact id="ENRICHMENT-GOES-THROUGH-ENRICH-VALIDATE" status="impl/done">Enrichment goes through
`go_ai_native_tcg::enrich_validate` — the gate's own rules over the
gate's own extractor (the `--stdin-file` overlay form) — with the
policy reloaded per call, so a mid-session freeze is honoured
immediately.</fact></p>
    <p p="17"><fact id="TCG-VALIDATE-ISERROR-MIRRORS-THE-ONE-SHOT-EXIT-CONTRACT" status="impl/done">`tcg_validate`'s `isError` mirrors the one-shot exit
contract: an error diagnostic OR a non-baselined finding; the FILLED
`markers` stream rides every validate (the Go relay's named delta
over the Rust one).</fact></p>
    <p p="18"><fact id="THE-NDJSON-SERVE-RELAY-REMAINS-SHIPPED" status="impl/done">The NDJSON serve relay (`go-ai-native-tcg serve`,
TCG-PROTOCOL-GO-v0.1) remains shipped in the stack as the non-MCP
embedding form.</fact></p>
  </section>
</spec>
