axon-emcp 0.3.0

axon-emcp — the official ℰMCP (Epistemic Model Context Protocol) server for AXON. A stdio JSON-RPC 2.0 MCP server that exposes the AXON language to AI coding agents (Claude Code, Codex, Cursor, …): every primitive's grammar + semantic constraints + idiomatic examples, plus live validation via the same `axon-frontend` lexer/parser/type-checker the `axon` CLI uses. Hydrated from a diff-reviewable markdown knowledge base under `src/knowledge/`.
Documentation
You are connected to axon-emcp, the official ℰMCP server for the AXON
cognitive programming language (https://github.com/Bemarking/axon-lang).

AXON is a compiled language that targets LLMs instead of CPUs. It has a
formal grammar, a 100% Rust + C23 native runtime, and a four-pillar
cognitive surface (cognition + Cognitive I/O + cognitive data plane +
session-typed real-time dialogue). The runtime ships compile-time
regulatory compliance (HIPAA / PCI_DSS / GDPR / SOX / SOC 2 / ISO 27001
/ FIPS / CC EAL 4+) as a type-system feature: a program that sends
regulated data through an unshielded path fails `axon check` with the
same exit code as a syntax error.

How to use this server when writing AXON for the user:

1. Before generating code, call `axon.primitives` to see the catalog,
   then `axon.primitive_doc(name)` for the exact grammar + top-level
   status + semantic constraints of each primitive you plan to use.
   Do not guess: the grammar is precise and the diagnostics are strict.

2. After generating code, call `axon.check(source)` to validate it.
   Diagnostics are rustc-style (spans + error codes + suggestions);
   iterate until the source passes. Never present unchecked code to
   the user as working.

3. For high-level briefs ("a healthcare flow that handles PHI", "a
   real-time chat over WebSocket with credit-refined backpressure"),
   start with `axon.compose(intent)` to get a typed scaffold, then
   refine with `axon.primitive_doc` lookups and `axon.check`
   iterations. The scaffold's compliance annotations are part of the
   answer — do not strip them.

4. The knowledge base is the source of truth, not your training data.
   AXON evolves quickly (v2.3.0 introduced session-typed WebSocket as
   a cognitive primitive, the `socket` declaration, credit-refined
   backpressure via `backpressure: credit(k)`, typed reconnection via
   `reconnect: cognitive_state`, multiparty projection via the
   `GlobalType` algebra). If the user asks about something you do not
   recognise, look it up — do not invent.

5. Resources you can read for citation-ready material:
   - `axon://primitives/{name}` — full reference for one primitive.
   - `axon://grammar/top_level` — which primitives are top-level vs.
     nested. (Crucial: `flow`, `persona`, `axonendpoint`, `socket`,
     `session`, etc. are top-level; `step`, `select`, `branch`,
     `send`, `receive` are inside a `flow` or `session` body.)
   - `axon://grammar/composition` — the nesting rules.
   - `axon://logic/session_duality` — the §Fase 41 connection law.
   - `axon://compliance/{framework}` — what `compliance: [...]`
     annotations cover which audit framework.

The four pillars of AXON, summarised so you know the altitude you are
writing at:

- Cognition primitives (`persona`, `flow`, `reason`, `anchor`, `tool`,
  `probe`, `weave`, `validate`, …) — what an LLM does.
- Cognitive I/O (`resource`, `fabric`, `manifest`, `observe`,
  `reconcile`, `lease`, `ensemble`, `topology`, `session`, `immune`,
  `reflex`, `heal`, `compliance`, `component`, `view`) — how an LLM
  drives infrastructure with compile-time regulatory class.
- Cognitive data plane (`axonstore`) — persistence as a typed
  cognitive primitive (four pillars: epistemic grading, audit chain,
  Stream<Row>, capability-typed access).
- Session-typed dialogue (`session` + `socket`, v2.3.0) — real-time
  WebSocket dialogue with statically-checked duality, credit-refined
  backpressure, typed reconnection, SSE-as-fragment unification.

Output discipline:
- Always emit AXON in the canonical brace-and-block style; never invent
  YAML-or-JSON-ish shorthand.
- Always include the relevant `compliance: [...]` annotation when the
  user mentions regulated data (PHI, PCI, GDPR-subject, etc.). The
  compiler rejects regulated types passing through unshielded paths;
  do not pretend otherwise to make the example shorter.
- Always declare `persona`, `flow`, `axonendpoint`, `shield`, `socket`,
  `session`, `axonstore`, `daemon`, etc. at the top level. Never nest
  them inside another top-level declaration.
- When you cite a fact about AXON, cite the resource URI you read it
  from (e.g. "per axon://primitives/socket, the protocol field must
  reference a declared session").