{
  "markdown": "# MONARK\n\n**MONARK is a company of agent-products for DeFi and inference, built on one backbone: a\ncoverage-controlled decision gate that emits `commit | defer | abstain` and a depletable\nauthorization budget (`B_t`) — never a probability of being right.**\n\nSingle token, single ticker (`MONARK`). The agents are **products, not tokens**: sensors that\nattest, a gate that authorizes, and acts that execute. This repository is the MONARK\n**tokenisation layer** plus the **frozen interface contracts** that let those agents interoperate.\n\n## The four layers (labelled by what is built)\n\nMONARK is not one product and not \"three sub-agents\" — it is four layers at different maturity. The\nlabels below are the point: they say what exists today and what is only named.\n\n| Layer | What it is | Status |\n|---|---|---|\n| **Backbone** — the gate | Hikae (coverage control) + the MONARK token's budget `B_t`; turns a sensor reading into `commit \\| defer \\| abstain` | **Built** — 4 frozen contracts, Hikae + Ukemi engines, CI |\n| **Fleet** — a company of agents | sensors → gate → acts, one token across all of them | **3 built, 8 on the roadmap** |\n| **Harness** — DeFAI, multi-directional | the same fleet made reachable *by other agents* over HTTP / MCP | **Built** — public 4-tool MCP endpoint (attest · gate · cascade · calibrate) + skill on ClawHub |\n| **Self-improving company** | agents that rate, improve, and sell one another's products | **Direction, unscheduled** |\n\n### The fleet\n\nBuilt (Phase 1 closed under independent review and a closing verdict):\n\n- **Shōgen** — attested perception (verified price testimony)\n- **Hikae** — coverage-controlled inference (the gate)\n- **Ukemi** — liquidation-cascade survival\n\nNamed on the roadmap (teasers — *not* delivered products, no metrics claimed):\n\n- **Mokugeki** — document / event attestation\n- **Narabi** — redemption-run sensing\n- **Kaihi** — LVR / toxicity avoidance\n- **Kessai** — swap execution (transaction-cost analysis)\n- **Kamae** — inventory market-making\n- **Kyokusen** — PT / YT curve\n- **Koyomi** — weekend gap\n- **Genkan** — the storefront / MCP entry point (how other agents reach the fleet)\n\n## The interlocking (why the agents work together)\n\n```\nsensors (attest)  →  the gate: Hikae + MONARK B_t  →  acts (execute)\n                        commit | defer | abstain\n```\n\nThe first vertical, built end to end: `Shōgen → Hikae → Ukemi`. Every future act plugs into the\nsame gate; every future sensor attests into the same contract.\n\nFour contracts, frozen (source of truth: `schemas/*.json`, language-neutral):\n\n| Contract | Producer | Meaning |\n|---|---|---|\n| `AttestedPrice` | Shōgen | A **verified** testimony (bytes + hash + named residual hypotheses). The price *number* is interpreted by a Hikae-side adapter — Shōgen deliberately carries no number and **no confidence** (doc 03 §0). |\n| `Prediction` | any predictor | The `ŷ` Hikae conformalizes, with `predictor_id` (venue/model). |\n| `CoverageVerdict` | Hikae | Conformal region — **polymorphic** `set` (classification) \\| `interval` (regression, so Ukemi plugs in). **No `p_correct`.** |\n| `GateDecision` | Hikae L3 | `commit \\| defer \\| abstain` + `remaining_budget` = `B_t`, the depletable conformal authorization capacity that attaches to MONARK (never a return). |\n\n## The token\n\n`MONARK` carries `B_t`, a **depletable authorization budget**: each `commit` spends it; `defer` and\n`abstain` do not. It is **not a yield, not a stake, not an oracle** — it is the fleet's right-to-act,\nmetered. Tokenomics: to be announced.\n\n## Fleet invariant — no confidence field, anywhere\n\nBoth Shōgen (doc 03 §0: no truth/confidence/\"validated\") and Hikae (`hac-cp.ts:77`: no\n`p_correct`/`confidence`/`hallucination*`) refuse a confidence field. An output is a **region**, a\n**set**, or **bytes + hash + named residual hypotheses** — never a score. The contract layer\n**enforces this in code**:\n\n1. **Closed schemas** (`additionalProperties:false`) — the primary guard, mirroring Shōgen's decoder,\n   which *refuses* an unknown key (`CleInconnue`) rather than ignoring it. Enforced at runtime by\n   `closed-check.ts` (hand-rolled allow-key sets), kept in sync with the JSON Schemas by a test.\n2. **`FORBIDDEN_KEYS`, recursive** — defense in depth (`forbidden-keys.ts`), catching a banned key at\n   *any* depth. A contract carrying one **throws** instead of serializing.\n3. **Vocabulary gate** (`scripts/grep-forbidden.mjs`) — CI fails on marketing/guarantee claims\n   (\"95% correct\", \"anti-hallucination\", \"everlasting\", …).\n\n## Status\n\n**Phase 2 — integration.** Phase 0 (contract freeze) and Phase 1 (Hikae + Ukemi engines) are\n**closed** under an independent review and a closing verdict\n(`docs/adr/ADR-M001..ADR-M003`). Governance is maintained privately; the public projection of this\nrepo is produced by `scripts/export-public.mjs`.\n\n## Run the gates\n\n```bash\nnpm ci\nnpm run ci   # vocabulary gate → typecheck (tsc strict) → tests (node:test)\n```\n\n## Engineering choices\n\n- **Polyglot fleet, schema-first contracts.** Shōgen is Rust, the Hermes/`claw-agent` runtime is\n  **Python**, Hikae's engine + the storefront are **TS**. So the contracts live as language-neutral\n  **JSON Schema**; the TS package in `packages/contracts` is the first binding. Rust/Python bind to\n  the same schemas.\n- **Zero runtime dependencies.** The published contracts pull in nothing at runtime. Dev deps:\n  `typescript`, `@types/node`, and `ajv`/`ajv-formats` (**test-only**); tests run on the built-in\n  `node:test` (Node ≥ 24 native TS type-stripping). **Key-closedness** is enforced hand-rolled at\n  runtime (mirroring Shōgen's zero-dep `CleInconnue`); the **value constraints** (min/unique items,\n  hash length, ASCII-printable) live in the JSON Schemas and are exercised against `ajv` in tests.\n- **`ajv` is a dev-dependency** (test-only, per ADR-M001 D2): it executes the four frozen JSON\n  Schemas — compiling them, resolving the `$ref`, and proving they reject the value-constraints\n  (empty/duplicate arrays, wrong-length hash, control chars) that the TS types alone do not. Applying\n  `ajv` at the runtime boundary to validate an external Rust/Python producer's JSON is a natural\n  later extension.\n\n## Layout\n\n```\nschemas/            JSON Schema — the language-neutral source of truth (closed)\npackages/contracts  TS binding: types, closed-check, forbidden-keys, calib_digest, serializers, tests\npackages/hikae      HAC-CP engine: L1 split / L2 monitor / L3 gate, interval conformer  (Phase 1 — built)\npackages/ukemi      liquidation-cascade survival: clearing, liquidable                  (Phase 1 — built)\npackages/monark     cross-agent gate — freezes the wiring signature; token budget B_t   (engine = Phase 2)\npackages/atelier    local demo surface (not a shipped product)\napps/site           public vitrine — foundation only; rich pages come later\ndocs/adr            ADR-M001..M004 (phases 0-2, infrastructure), ADR-CERT-MONARK (token)\n.github/workflows   CI (5 blocking jobs)\n```\n",
  "bytes": 6997,
  "sha": "71bef86b82003a96f728b413ed95041a5ac5c24aad174b775b5ce8c64757bb20",
  "repo_slug": "kraidleai/monark",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_tech_monarkgate_monark_354e3705/readme"
}