# ternlang

## Quick Start

```bash
# Connect this server (installs CLI if needed)
npx -y @smithery/cli@latest mcp add rfi-irfos/ternlang

# Browse available tools
npx -y @smithery/cli@latest tool list rfi-irfos/ternlang

# Get full schema for a tool
npx -y @smithery/cli@latest tool get rfi-irfos/ternlang trit_decide

# Call a tool
npx -y @smithery/cli@latest tool call rfi-irfos/ternlang trit_decide '{}'
```

## Direct MCP Connection

Endpoint: `https://ternlang--rfi-irfos.run.tools`

## Tools (10)

- `trit_decide` — Convert float evidence into a ternary decision (-1/0/+1) with confidence score and interpretation.
- `trit_consensus` — Balanced ternary consensus of two trits: +1 if both affirm, -1 if both reject, 0 otherwise.
- `trit_eval` — Evaluate a ternlang expression on the live BET VM.
- `ternlang_run` — Compile and run a complete .tern program on the BET VM.
- `quantize_weights` — Quantize f32 neural network weights to ternary {-1,0,+1} using BitNet-style thresholding.
- `sparse_benchmark` — Run sparse vs dense ternary matrix multiplication benchmark.
- `moe_orchestrate` — Full MoE-13 orchestration pass with dual-key synergistic routing and safety veto.
- `moe_deliberate` — EMA-based iterative deliberation engine. Feeds evidence round by round toward a confidence target.
- `trit_action_gate` — Multi-dimensional safety gate. Any dimension with hard_block:true and negative evidence vetoes the action.
- `trit_enlighten` — Receive a piece of ternary wisdom. Try it.

```bash
# Get full input/output schema for a tool
npx -y @smithery/cli@latest tool get rfi-irfos/ternlang <tool-name>
```
