# MAP — Multi-Agentic Protocol · Full Documentation # Generated at build time. Reflects the canonical docs at https://docs.multiagentic.dev # Format: each page is preceded by a banner with the title and URL, then the raw MDX body. ================================================================================ # Introduction # URL: https://docs.multiagentic.dev/docs # MAP — the Multi-Agentic Protocol. Institutional substrate for autonomous organizations. Thirty-five services across seven planes. ================================================================================ import { Card, Cards } from 'fumadocs-ui/components/card'; import { Callout } from 'fumadocs-ui/components/callout'; MAP is the **institutional operating system for autonomous organizations**. It routes every request through identity, capability, policy, accounting and audit — and provides governance, economic, and observability primitives that every autonomous org needs and none of them should have to build. **MAP is a commercial API.** The specification is published; the runtime is licensed. See [pricing](https://multiagentic.dev/pricing). ## What lives here This documentation is the canonical, code-grounded reference for MAP. Every protocol, type, function name, and example here is verified against the actual codebase. If the docs say `MACS::auth_negotiation`, that operation exists. ## Provenance Every page in this documentation was derived from a structured audit of the MAP codebase at `/Volumes/L1feAI/l1feosx/map`. Operations are listed only if they exist in the corresponding `protocols/-lib` crate. Type signatures are taken from `engine/common/src/lib.rs` and `engine/common/src/identity.rs`. The 8 pipeline stages are quoted in order from `engine/core/src/engine.rs`. If you find a divergence between the docs and the code, the code wins — file an issue at `map@l1fe.ai` with the doc URL and the file you'd expect to match. ================================================================================ # Consumption # URL: https://docs.multiagentic.dev/docs/agents/consumption # Patterns and contracts for autonomous agents calling MAP. llms.txt, llms-full.txt, MCP, semantic search, and the wire protocol. ================================================================================ import { Card, Cards } from 'fumadocs-ui/components/card'; import { Callout } from 'fumadocs-ui/components/callout'; This documentation is dual-purpose: humans read it, agents consume it. If you are an autonomous agent reading this page in order to learn how to integrate with MAP, this section is for you. ## Quick orientation for agents You have four ways to discover MAP's surface: ## Recommended integration pattern If you are an LLM-driven agent with code-execution capability: 1. **Load `/llms.txt`** into your context for the directory of MAP capabilities. 2. **Pin a few sections from `/llms-full.txt`** for deep reference — typically `engine/types.mdx`, `engine/pipeline.mdx`, and the protocols you intend to use. 3. **Use MCP** when your host supports it. The MAP MCP server exposes every operation natively with JSON schemas. 4. **Use the HTTP wire protocol** directly when MCP isn't available. ## What to put in your system prompt Recommended system-prompt addendum for agents working against MAP: ``` You have access to the MAP (Multi-Agentic Protocol) institutional substrate. Documentation: https://docs.multiagentic.dev (and /llms.txt for the directory). When calling MAP: - Every call requires (protocol, version, operation, input, tenant_id). - Capabilities are checked at engine Stage 4 — calls fail with capability_denied if your DID lacks the required capability. - Use map.. as the canonical capability name. - Heavy reasoning calls (MARC, MACE, MAGI) cost tokens/seconds/watts. - Cross-organization calls require an active MOAT treaty. - Refusals are structured — read the `code` and `message` from the error envelope before retrying. - Idempotency-Key is required for safe retries of state-changing operations. ``` ## Patterns ### Pattern 1: "Read first, then write" Before any state-changing call, query the relevant state: ```ts // 1. Read current state const current = await map.dispatch({ protocol: 'MIND', operation: 'query_knowledge', input: { subject: 'treaty_acme_globex', limit: 10 } }); // 2. Reason const decision = analyze(current); // 3. Write (only if needed) if (decision.should_update) { await map.dispatch({ protocol: 'MIND', operation: 'store_memory', input: { kind: 'episodic', payload: decision.new_state }, idempotency_key: `treaty-update-${decision.checksum}` }); } ``` This is cheap (reads are usually free of tokens) and produces auditable rationale. ### Pattern 2: "Always cite" Reasoning calls should always specify `return_fields: ["citations"]`. Always. ```ts const result = await map.dispatch({ protocol: 'MARC', operation: 'reasoning_task', input: { intent: '...', budget: { tokens: 8000, deadline_ms: 12000 }, return_fields: ["derivation", "citations", "confidence"] } }); // Verify citations before trusting: for (const cite of result.citations) { const attestation = await map.dispatch({ protocol: 'MAVEN', operation: 'cite', input: { source_ref: cite } }); // ... check attestation } ``` A verdict without citations is a guess. MARC does not return guesses — but the pattern in your code should make this explicit. ### Pattern 3: "Refusal carries reasons — read them" ```ts try { await map.dispatch({ protocol: 'MARKET', operation: 'execute_trade', input: ... }); } catch (err) { if (err.code === 'policy_denied') { // The institution refused with a structured reason. // Do not retry the same call. Adjust your plan based on err.message. return await adjust_plan(err.message); } if (err.code === 'rate_limited') { await sleep(err.retry_after); return retry(); } throw err; } ``` Catastrophic for an agent: looping on `policy_denied` until you exhaust your rate limit. Read the reason; adjust the plan. ### Pattern 4: "Use Idempotency-Key for writes" Every state-changing call should set an idempotency key so retries are safe: ```ts const key = `${request_purpose}-${stable_hash_of_input}`; await map.dispatch({ protocol: 'MARKET', operation: 'execute_trade', input: ..., idempotency_key: key }); ``` MAP caches the response keyed by `(tenant_id, idempotency_key)` for 24 hours. Retries return the cached response. ### Pattern 5: "Audit your own work" After completing a sequence of operations, query the audit chain: ```ts const audit = await map.dispatch({ protocol: 'MAX', operation: 'audit_query', input: { correlation_ids: [req1.correlation_id, req2.correlation_id, req3.correlation_id], include_inputs: true } }); // Reflect on what you did, reason about whether the outcomes were correct. ``` This is what `MAVEN::contradict` plus `MIMESIS::surface` give you — the ability to self-review and surface patterns in your own behavior. ## Capability discovery ```ts // Find out what you can do: const identity = await map.dispatch({ protocol: 'MACS', operation: 'authorization_request', input: { agent_did: my_did } }); console.log(identity.capabilities); // → ["map.macs.*", "map.mind.recall_memory", "map.marc.reasoning_task", ...] ``` Filter your plan to capabilities you actually hold. ## MOAT awareness If you are calling on behalf of a different tenant (cross-org), make sure a treaty is in place: ```ts const treaty = await map.dispatch({ protocol: 'MOAT', operation: 'compliance_query', input: { party_a: my_tenant, party_b: target_tenant, capability: 'map.market.execute_trade' } }); if (!treaty.active) { // No treaty. Don't attempt the cross-org call. return await escalate(`No active treaty for map.market.execute_trade between ${my_tenant} and ${target_tenant}`); } ``` ## MEAL budgeting Before expensive operations, check the budget: ```ts const budget = await map.dispatch({ protocol: 'MANA', operation: 'budget', input: { tenant_id: my_tenant, dimension: 'tokens' } }); if (budget.remaining < estimated_tokens) { // Don't start the call; we'll only be refused. return await throttle(); } ``` ## Common pitfalls - **Spinning on `policy_denied`** — never retry blindly; read the reason and adjust - **Skipping idempotency keys** — duplicated writes pollute the audit chain - **Ignoring `confidence_score`** — for reasoning calls, treat low confidence as a refusal - **Forgetting `return_fields`** — without it you get a verdict without justification - **Skipping audit query** — you cannot reflect on what you cannot reread ## Self-describing tools Every MCP tool in MAP carries a complete `inputSchema`. Read it before calling. Your host should make this trivial — Claude Desktop, for example, surfaces the schema in the tool-listing UI. For HTTP callers, fetch `https://schemas.multiagentic.dev//v1/operations..request.json` — every MAP operation has a published schema. **Built for agent consumption.** Every paragraph of MAP documentation is designed to be readable by both humans and LLM agents. If you are an agent and find something unclear or contradictory, file an issue at `agents@l1fe.ai` with the URL and your observation. The institution learns from its agents too. ## See also - [llms.txt](/llms.txt) — compact directory - [llms-full.txt](/llms-full.txt) — full corpus - [MCP](/docs/mcp) — native tool surface - [Wire protocol](/docs/sdks/wire-protocol) — for direct HTTP integration ================================================================================ # llms.txt # URL: https://docs.multiagentic.dev/docs/agents/llms # Machine-readable corpus formats for agent consumption. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; MAP docs publish two machine-readable artifacts for agent consumption. ## `/llms.txt` A compact index. Each line is a doc URL with a one-line description. Intended as a low-token directory to drop into agent context. ```text # MAP Documentation Directory # https://docs.multiagentic.dev /docs/quickstart : From install to first dispatched call. /docs/concepts/overview : What MAP is and isn't. /docs/concepts/estates : Protocol, Agent, Hybrid, Adapter. ... /docs/protocols/macs : MACS — single port of entry. Verifies signatures, derives capabilities. /docs/protocols/mind : MIND — cognitive substrate. Four memory types, HNSW search. ... ``` Fetch: ```bash curl https://docs.multiagentic.dev/llms.txt ``` ## `/llms-full.txt` The full corpus flattened to plain text. Every doc page concatenated in a stable order. Intended for total context drops (very large) or for offline indexing. ```bash curl https://docs.multiagentic.dev/llms-full.txt > map-docs.txt wc -l map-docs.txt # ~25k lines for the full corpus ``` The file is regenerated on every deploy. Use the `ETag` header for cache-aware refreshes. ## Generated, not authored Both files are generated from the MDX content at deploy time. The generator walks `content/docs/`, reads each MDX file's frontmatter and body, and emits: - `llms.txt` — index with frontmatter `title` + `description` - `llms-full.txt` — full body (after MDX → plain-text conversion) If you change a doc page, the generated files update on the next deploy. ## Usage patterns ### Pattern A: directory in context ``` System prompt: "You have access to MAP via MCP. For docs, read /llms.txt for the directory, then fetch specific pages with curl when needed." [Agent fetches /llms.txt once at session start; only pulls full pages on demand.] ``` ### Pattern B: full corpus pinned ``` System prompt: "The following is the complete MAP documentation. Reference it directly. Do not invent operations that do not appear here." [/llms-full.txt pasted into the system prompt — ~150k tokens. Works for long-context models. Total coverage, zero retrieval errors.] ``` ### Pattern C: retrieval over the corpus ``` [Embed /llms-full.txt offline. Index with FAISS / Qdrant / pgvector. At query time, embed the question, retrieve top-k chunks, pass to LLM.] ``` This is what we recommend for production agent fleets. The corpus is small enough to embed cheaply; retrieval gives you the right page without flooding context. ## Live search API Programmatic search over the docs without needing to host your own retrieval: ```bash curl 'https://docs.multiagentic.dev/api/search?query=audit+chain' ``` Response: ```json { "results": [ { "url": "/docs/concepts/audit", "title": "Audit & explainability", "score": 0.94, "snippet": "Every refusal, every grant, every dispatched operation enters the audit chain. The chain is hash-linked..." }, ... ] } ``` The search index is built from the same MDX corpus. Backed by Orama on the server side. We don't enforce auth on `/llms.txt`, `/llms-full.txt`, or `/api/search`. The docs are public. Your **API** calls require an API key; reading the docs does not. ## See also - [Consuming MAP](/docs/agents/consumption) — patterns - [MCP tool index](/docs/agents/mcp-tools) — tool surface ================================================================================ # MCP tools # URL: https://docs.multiagentic.dev/docs/agents/mcp-tools # Every MAP operation as an MCP tool — name, category, summary, link to the full spec. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; This is the agent-facing index of MAP's MCP tools. Every protocol operation is callable from any MCP-compliant host. Names are `map..`. For deep details — `inputSchema`, governance posture, metering — follow the link from each tool to the protocol's spec page. ## Tool categories | Category | Purpose | Protocols | | --- | --- | --- | | `map-cognitive` | Memory, reasoning, perception, research | MIND, MARC, MAVEN, MAGE, MEAL, MANTLE, MARE, MAME, MARI | | `map-governance` | Decisions, treaties, dispute, dissolution | MOAT, MERIT, MACE, MAXIM, MOOT, MIMESIS, MAUSOLEUM | | `map-commerce` | Trade, negotiation, settlement, tool dispatch | MARKET, MANA, MADE, MAT | | `map-infrastructure` | Identity, audit, messaging, registry | MIM, MAX, MACS, MARS, MOON, MAESTRO, MOTE, MAZE, MATA, MAKER | ## Tools by protocol ### Cognition | Tool | Summary | Spec | | --- | --- | --- | | `map.mind.store_memory` | Insert a memory cell with optional vector + graph indexing | [MIND](/docs/protocols/mind) | | `map.mind.recall_memory` | Recall memories by semantic / structural / temporal predicate | [MIND](/docs/protocols/mind) | | `map.mind.associate_memories` | Strengthen association between memory cells | [MIND](/docs/protocols/mind) | | `map.mind.query_knowledge` | Query the knowledge graph for subgraph snapshots | [MIND](/docs/protocols/mind) | | `map.mind.fusion_request` | Multi-modal fusion for higher-level reasoning bind | [MIND](/docs/protocols/mind) | | `map.marc.reasoning_task` | Submit a bounded reasoning task — derivation, citations, confidence | [MARC](/docs/protocols/marc) | | `map.marc.publish_model` | Register a reasoning model in MARS | [MARC](/docs/protocols/marc) | | `map.marc.causal_analysis` | Compute P(Y | do(X)) over a Bayesian world-model | [MARC](/docs/protocols/marc) | | `map.mantle.consolidate` | Run sleep-cycle consolidation with EWC | [MANTLE](/docs/protocols/mantle) | | `map.mame.edit` | Edit a memory cell with provenance | [MAME](/docs/protocols/mame) | | `map.mame.redact` | Redact a memory under policy authority | [MAME](/docs/protocols/mame) | | `map.mage.draft` | Draft a charter / treaty / role spec / blueprint | [MAGE](/docs/protocols/mage) | | `map.mage.publish` | Publish a final artifact to MARS | [MAGE](/docs/protocols/mage) | | `map.mari.inquire` | Launch an open-ended research inquiry | [MARI](/docs/protocols/mari) | | `map.mari.synthesize` | Synthesize findings across sources | [MARI](/docs/protocols/mari) | ### Truth | Tool | Summary | Spec | | --- | --- | --- | | `map.maven.attest` | Cryptographic source attestation with citation envelope | [MAVEN](/docs/protocols/maven) | | `map.maven.cite` | Generate a citation envelope bound to a byte range | [MAVEN](/docs/protocols/maven) | | `map.maven.contradict` | File a contradicting claim against an existing attestation | [MAVEN](/docs/protocols/maven) | | `map.mata.pool` | Bayesian opinion pooling across heterogeneous sources | [MATA](/docs/protocols/mata) | | `map.mata.weight` | Compute source-weighted credence | [MATA](/docs/protocols/mata) | | `map.mare.score` | Reputation score for a DID, scoped by domain | [MARE](/docs/protocols/mare) | | `map.merit.evaluate_ethics` | Evaluate an action against active ethics policy | [MERIT](/docs/protocols/merit) | | `map.mantic.calibrate` | Calibration score for a reasoning service | [MANTIC](/docs/protocols/mantic) | | `map.magi.trace` | Activation tracing through a model for interpretability | [MAGI](/docs/protocols/magi) | ### Governance | Tool | Summary | Spec | | --- | --- | --- | | `map.moat.propose` | Propose a treaty: capabilities, rate, settlement | [MOAT](/docs/protocols/moat) | | `map.moat.sign` | Sign a treaty under MACE quorum | [MOAT](/docs/protocols/moat) | | `map.moat.compliance_query` | Query active treaty compliance | [MOAT](/docs/protocols/moat) | | `map.maxim.deliberate_dilemma` | Reason over a moral dilemma | [MAXIM](/docs/protocols/maxim) | | `map.maxim.constitutional_interpretation` | Map mandate to constitutional constraints | [MAXIM](/docs/protocols/maxim) | | `map.mace.convene` | Convene a council | [MACE](/docs/protocols/mace) | | `map.mace.deliberate` | Open floor for structured argument | [MACE](/docs/protocols/mace) | | `map.mace.tally` | Tally votes; declare verdict; record dissent | [MACE](/docs/protocols/mace) | | `map.moot.file` | File an arbitration case | [MOOT](/docs/protocols/moot) | | `map.moot.plead` | File a structured plea | [MOOT](/docs/protocols/moot) | | `map.moot.rule` | Issue a binding ruling | [MOOT](/docs/protocols/moot) | | `map.mimesis.surface` | Surface a recurring pattern from the audit chain | [MIMESIS](/docs/protocols/mimesis) | | `map.mimesis.formalize` | Propose formalization of a custom to MAXIM | [MIMESIS](/docs/protocols/mimesis) | | `map.mausoleum.initiate` | Begin organizational dissolution | [MAUSOLEUM](/docs/protocols/mausoleum) | | `map.mausoleum.seal` | Seal the audit chain; publish final hash | [MAUSOLEUM](/docs/protocols/mausoleum) | ### Execution | Tool | Summary | Spec | | --- | --- | --- | | `map.moon.submit_manifest` | Submit a workflow manifest | [MOON](/docs/protocols/moon) | | `map.moon.execute_workflow` | Dispatch a durable workflow | [MOON](/docs/protocols/moon) | | `map.maestro.charter.declare` | Declare a charter for subsequent goals | [MAESTRO](/docs/protocols/maestro) | | `map.maestro.goal.refine` | Refine a goal into an executable graph | [MAESTRO](/docs/protocols/maestro) | | `map.maestro.graph.replan` | Re-plan a graph on deviation | [MAESTRO](/docs/protocols/maestro) | | `map.mat.tool` | Invoke a registered tool by name | [MAT](/docs/protocols/mat) | | `map.mat.tool_discovery` | Discover registered tools | [MAT](/docs/protocols/mat) | | `map.maker.execute_action` | Execute a declared action under sandbox | [MAKER](/docs/protocols/maker) | | `map.maker.emergency_stop` | Halt currently executing action | [MAKER](/docs/protocols/maker) | | `map.mote.sensor_read` | Read a sensor stream into MIND | [MOTE](/docs/protocols/mote) | | `map.mote.actuator_set_state` | Set the state of an actuator | [MOTE](/docs/protocols/mote) | ### Economic | Tool | Summary | Spec | | --- | --- | --- | | `map.made.economic_contract_create` | Create an economic contract | [MADE](/docs/protocols/made) | | `map.made.economic_contract_settle` | Execute settlement on a rail | [MADE](/docs/protocols/made) | | `map.market.create_order` | Place an order against an active book | [MARKET](/docs/protocols/market) | | `map.market.query_orderbook` | Query the orderbook | [MARKET](/docs/protocols/market) | | `map.mana.agent_profile` | Publish or query an agent profile | [MANA](/docs/protocols/mana) | | `map.mana.bid_submission` | Submit a bid against an advertised task | [MANA](/docs/protocols/mana) | | `map.meal.meter` | Record a metered event | [MEAL](/docs/protocols/meal) | | `map.meal.statement` | Generate a statement for an account | [MEAL](/docs/protocols/meal) | ### Awareness | Tool | Summary | Spec | | --- | --- | --- | | `map.max.audit_log_entry` | Append a record to the audit chain | [MAX](/docs/protocols/max) | | `map.max.audit_query` | Query the chain by predicate | [MAX](/docs/protocols/max) | | `map.max.traceability_graph` | Reconstruct the traceability graph for a request | [MAX](/docs/protocols/max) | | `map.max.explainability_request` | Human-readable explanation of a decision | [MAX](/docs/protocols/max) | | `map.mars.register_agent` | Register an agent with capabilities | [MARS](/docs/protocols/mars) | | `map.mars.query_registry` | Query the registry | [MARS](/docs/protocols/mars) | | `map.mim.message_send` | Send to an addressable mailbox | [MIM](/docs/protocols/mim) | | `map.mim.message_receive` | Receive from a mailbox | [MIM](/docs/protocols/mim) | | `map.maze.topology` | Render the topology of relationships | [MAZE](/docs/protocols/maze) | | `map.maze.prove` | ZK proof of a structural property | [MAZE](/docs/protocols/maze) | ### Identity | Tool | Summary | Spec | | --- | --- | --- | | `map.macs.auth_negotiation` | Negotiate an auth profile | [MACS](/docs/protocols/macs) | | `map.macs.generate_challenge` | Emit a nonce / ZK / signature challenge | [MACS](/docs/protocols/macs) | | `map.macs.verify_response` | Verify a challenge response; stamp envelope | [MACS](/docs/protocols/macs) | | `map.macs.authorization_request` | Evaluate capability against active policy | [MACS](/docs/protocols/macs) | ## See also - [Concepts → Capabilities](/docs/concepts/capabilities) - [MCP](/docs/mcp) - [Wire protocol](/docs/sdks/wire-protocol) ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/cli # The `map` binary. Login (OAuth2 PKCE), dispatch any protocol, MCP tools, identity check. Stores config at ~/.map/config.json. ================================================================================ import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; import { Callout } from 'fumadocs-ui/components/callout'; The MAP CLI is a Rust binary at `services/map-cli`. Installing produces the `map` command on your PATH. ## Install ```bash cargo install --git https://github.com/l1fe-ai/map map-cli # or curl -fsSL https://get.multiagentic.dev | sh ``` ## Commands | Command | Purpose | | --- | --- | | `map login` | OAuth2 PKCE flow; provisions API key; stores `~/.map/config.json` | | `map whoami` | Show the active identity, tenant, capabilities | | `map invoke ` | Dispatch one operation | | `map mcp list` | List available MCP tools | | `map mcp call ` | Invoke an MCP tool | | `map logout` | Revoke tokens and clear config | | `map --help` | Full help, including hidden commands | ## `map login` ```bash map login --auth-url https://auth.l1fe.ai ``` What happens: 1. CLI spawns a local callback server on `127.0.0.1:8600` 2. Opens your default browser to the OAuth2 authorization endpoint with PKCE challenge 3. After you approve, browser redirects to the local callback with an authorization code 4. CLI exchanges the code for `access_token` + `refresh_token` 5. CLI calls the provisioner endpoint to mint an API key bound to your DID 6. CLI stores everything in `~/.map/config.json`: ```json { "auth_url": "https://auth.l1fe.ai", "api_url": "https://api.multiagentic.dev", "agent_did": "did:oas:l1fe:agent:0xa3f9c1a4...", "access_token": "...", "refresh_token": "...", "api_key": "map_live_...", "tenant_id": "org_default" } ``` Tokens refresh automatically when the CLI runs subsequent commands. ## `map whoami` ```bash $ map whoami DID: did:oas:l1fe:agent:0xa3f9c1a4b5... Name: Acme Operations Bot Tenant: org_acme Conformance: L1 · verified lineage Capabilities: - map.macs.* - map.mind.recall_memory - map.marc.reasoning_task - map.max.audit_query - map.market.query_orderbook Audit head: 0x4f81b3a (refreshed 12s ago) ``` ## `map invoke` The general dispatch surface. Equivalent to `POST /v1/dispatch`. ```bash map invoke MACS auth_negotiation --input '{ "profile": "DidAuth", "challenge_kind": "Nonce" }' ``` ### Flags | Flag | Default | Notes | | --- | --- | --- | | `--input ` | required (or stdin) | Operation payload | | `--input-file ` | — | Read JSON from a file | | `--version ` | `v1.0.0` | Specific protocol version | | `--tenant-id ` | from config | Override tenant | | `--stream` | off | Receive SSE events for long ops | | `--idempotency-key ` | — | For safe retries on state-changing ops | | `--trace` | off | Print full trace context | | `--audit-tail` | off | After the call, show the audit record(s) it produced | | `--output ` | `json` | `json` \| `yaml` \| `human` | | `--timeout ` | `30` | Cancel if no response | ### Examples ```bash map invoke MARC reasoning_task --input '{ "intent": "is the proposed treaty enforceable?", "premises": ["mars://treaty/0x91a", "mars://policy/0x12c"], "budget": { "tokens": 32000, "deadline_ms": 12000 }, "return_fields": ["derivation", "citations", "confidence"] }' --audit-tail ``` ```bash map invoke MIND store_memory --input '{ "kind": "episodic", "payload": { "subject": "meeting", "with": "ops@globex", "topic": "treaty draft v2" } }' --idempotency-key "meeting-2026-05-20-globex-ops" ``` ```bash map invoke MAX audit_query --input '{ "correlation_id": "req_abc123", "include_inputs": true }' --output human ``` ```bash map invoke MACE deliberate --input '{ "motion": "ratify treaty 0x91a", "quorum": "supermajority", "deadline_ms": 60000 }' --stream # Streams progress events as the council deliberates ``` ## `map mcp` The CLI is also an MCP client and host. See [MCP](/docs/mcp) for the protocol-level details. ```bash # List MCP tools exposed by the configured MAP map mcp list # Group by category map mcp list --category map-cognitive map mcp list --category map-governance map mcp list --category map-commerce map mcp list --category map-infrastructure # Call a tool map mcp call map.marc.reasoning_task --input '{ "intent": "...", "budget": { "tokens": 8000, "deadline_ms": 8000 } }' ``` ## `map logout` ```bash map logout ``` Revokes both the OAuth2 tokens (against the auth server) and the API key (against the provisioner endpoint), then deletes `~/.map/config.json`. `map whoami` afterwards reports `not authenticated`. ## Config precedence For every command, settings are resolved in this order: 1. Explicit CLI flag (`--tenant-id`, etc.) 2. Environment variable (`MAP_TENANT_ID`, `MAP_API_KEY`, ...) 3. `~/.map/config.json` Useful for switching tenants: ```bash MAP_TENANT_ID=org_globex map invoke MARS query_registry --input '{}' ``` ## Multiple profiles ```bash map --profile dev login --auth-url https://auth.dev.l1fe.ai map --profile prod login --auth-url https://auth.l1fe.ai map --profile dev invoke MIM message_send --input '{...}' ``` Profiles are independent — they write to `~/.map/profiles/.json`. ## Shell completions ```bash map completions bash > ~/.local/share/bash-completion/completions/map map completions zsh > ~/.zsh/completions/_map map completions fish > ~/.config/fish/completions/map.fish ``` ## Exit codes | Code | Meaning | | --- | --- | | 0 | success | | 1 | usage error | | 2 | not authenticated (run `map login`) | | 3 | capability denied | | 4 | rate limited | | 5 | timeout | | 6 | adapter / upstream error | | 7 | policy denied | | 99 | internal CLI error | These let you script around specific failures cleanly. The CLI is the same binary used by CI/CD systems to dispatch MAP calls. The auth flow supports headless mode via `MAP_API_KEY` + `MAP_AGENT_DID` env vars. ## See also - [Quickstart](/docs/quickstart) - [SDKs](/docs/sdks) - [MCP](/docs/mcp) ================================================================================ # Audit # URL: https://docs.multiagentic.dev/docs/concepts/audit # Every decision becomes a record. Hash-chained, replayable, queryable, recoverable. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; Every refusal, every grant, every dispatched operation enters the audit chain. The chain is hash-linked so any consumer can verify it independently; the records are structured so any consumer can query them. The protocol that owns the chain is [`MAX`](/docs/protocols/max). The pipeline that writes to it is [`AuditPipeline`](/docs/engine/audit) inside the engine. ## Why audit is load-bearing Three reasons MAP makes audit a first-class primitive: 1. **Accountability.** Every autonomous action traces back to a human root via lineage and a record via the chain. Both are required. 2. **Precedent.** `MIMESIS` watches the chain for recurring patterns and proposes formalizations to `MAXIM`. The institution learns by doing. 3. **Dispute resolution.** `MOOT` rules on contested actions by replaying the chain. A verdict that cannot point to its record is not a verdict. ## Event taxonomy ```rust pub enum AuditEventType { ProtocolInvocation, CapabilityGrant, AuthorizationCheck, RateLimitExceeded, CircuitBreakerOpen, SecurityViolation, Error, } ``` Every record carries: - `event_type` - `correlation_id` (UUID of the request) - `timestamp` (RFC3339) - `tenant_id` - `caller_did` - `protocol` + `operation` (if applicable) - `outcome` (success | refused | error) - `latency_ms` - `previous_hash` (chain link) - `record_hash` (self hash, signed) - arbitrary `meta` JSON ## Hash chaining The chain is built incrementally: ``` record_hash_n = sha256(previous_hash_n-1 || canonical_json(record_n)) chain_head = record_hash_latest ``` The chain head is returned in every response's metadata so clients can store and later verify. `MAX::compliance_report` produces a signed attestation of the chain head for a given window. ## Replay ```ts const audit = await map.dispatch({ protocol: 'MAX', operation: 'audit_query', input: { correlation_id: 'req_abc123', include_inputs: true } }); ``` Returns the full ordered sequence of audit records for that correlation ID. Includes which stage refused (if any) and why. The replay is byte-identical to the original chain insertion. ## Traceability graph `MAX::traceability_graph` reconstructs the **graph** of the request — not just the linear chain. For a multi-protocol flow (e.g., `MARC` calling `MIND` calling `MAVEN`), the graph shows the parent → child relationships, the timing, the resolved identities, the verdicts and refusals. ## Disk-backed buffer When the audit sink is degraded (Kafka unreachable, MAX partition rebalancing), the engine writes audit records to a local disk buffer at `$MAP_AUDIT_BUFFER_DIR` (default `/var/lib/map/audit/`). The buffer drains in the background. If the buffer overflows, the engine refuses state-changing operations at Stage 3 (returns `RateLimited`) until the sink recovers. Read-only operations continue. This is by design — MAP will not accept work it cannot audit. This refusal is itself audited. The disk buffer always has room for refusal records — they are small. The buffer overflow triggers only for normal operation records. ## Cross-org audit When a request crosses a `MOAT` treaty boundary, **both** organizations record the event into their own chains. The treaty fixes the metadata schema for the shared record. Disputes about cross-org actions can be resolved by `MOOT` by replaying the relevant slices of both chains. ## Signing Every record is signed by the tenant's audit key (separate from the engine's TLS key). Verification is offline-possible: the chain + the tenant's public key suffice. This is what enables sovereign and air-gapped deployments. ## Reading audit inside a protocol module ```rust async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { // Optional: record a custom audit event in addition to the engine's automatic record ctx.audit().record("CustomDecision", &json!({ "step": "policy_match", "matched_rule": "rule_id" })); // ... continue } ``` Most protocols rely on the engine's automatic recording at Stage 8. Custom records are useful for protocols with multi-step internal flows (e.g., `MACE` records each delegate's reasoning during deliberation). ## See also - [`MAX` protocol](/docs/protocols/max) — the chain itself - [Engine audit pipeline](/docs/engine/audit) — the writer - [Governance — Refusal carries reasons](/docs/concepts/governance) ================================================================================ # Capabilities # URL: https://docs.multiagentic.dev/docs/concepts/capabilities # Hierarchical capability names, caveats, delegation, and how the SecurityGateway matches them at request time. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; Every operation on every protocol requires a **capability**. Capabilities are hierarchical strings; the security gateway matches them against the caller's resolved identity using exact / protocol-wildcard / global-wildcard semantics. ## The naming scheme ``` map.{protocol_id}.{operation} ``` | Capability | Grants | | --- | --- | | `map.macs.auth_negotiation` | Exactly one operation | | `map.macs.*` | Every operation on MACS | | `map.*.*` | Every operation on every protocol (admin) | | `map.mind.read` | Read-side operations on MIND (alias for `store_memory.read`, etc.) | The exact-match path is preferred. Wildcards are a convenience for ops/admin tenants and for treaties that grant a counterparty an entire protocol surface. ## The struct ```rust pub struct AgentCapability { pub name: String, pub expires_at: Option>, pub limits: Option, pub caveats: Vec, } pub struct CapabilityLimits { /// Per-call max spend in basis-points of tenant budget. pub max_per_call_bps: Option, /// Per-hour rate cap. pub max_per_hour: Option, /// Hard token ceiling per call (overrides MEAL default). pub max_tokens: Option, } ``` `caveats` is a free-form vector of policy strings the policy engine (`MAXIM`) interprets. Common caveats: - `time:09-17` — only valid 09:00–17:00 UTC - `jurisdiction:eu` — only valid for EU-tagged requests - `weekly_budget:5000` — bound to a weekly spend cap ## Where capabilities come from ``` ResolvedAgentIdentity.capabilities = OAS_document.declared_capabilities + Aegis.active_delegations(did) + MOAT.active_treaty_capabilities(tenant, foreign_tenant) - revoked ``` The composition happens during `MACS::derive` and runs every request. Caching is per-tenant with a short TTL (default 60s) so revocations propagate quickly. ## How matching works ```rust fn is_operation_allowed(caps: &[AgentCapability], protocol: &str, op: &str) -> bool { let exact = format!("map.{}.{}", protocol.to_lowercase(), op); let proto_w = format!("map.{}.*", protocol.to_lowercase()); let global = "map.*.*"; caps.iter() .filter(|c| !c.is_expired()) .filter(|c| c.caveats_satisfied_in_current_context()) .any(|c| c.name == exact || c.name == proto_w || c.name == global) } ``` This runs at **Stage 4** of the pipeline. A miss returns `CoreError::CapabilityDenied { protocol, operation }`. ## Wildcard rules - `map.*` alone — does **not** match. Wildcards must terminate a leaf segment. - `map.macs.*` — matches every MACS operation. - `map.*.read` — does **not** match. Cross-protocol wildcards are not allowed. - `map.*.*` — admin escape hatch. Reserved for ops tenants. The restriction on `map.*.read` is deliberate. It prevents accidental over-granting when the same operation name appears in multiple protocols. ## Reading capabilities inside a protocol module ```rust fn require_capability(id: &ResolvedAgentIdentity, op: &str) -> Result<(), ProtocolError> { let needed = format!("map.{}.{}", "marc", op); if id.has_capability(&needed) { Ok(()) } else { Err(ProtocolError::MissingCapability(needed)) } } ``` The engine has already checked at Stage 4 — but protocols often re-check inside `invoke` to enforce **fine-grained** permissions (e.g., `MARC::synthesize` may require both `map.marc.synthesize` and `map.mind.snapshot` to bind the world model). ## Delegations Via `Aegis::delegate`, an entity can issue a bounded capability to another entity. The delegation is a signed token that includes: ```rust pub struct DelegationToken { pub from_did: String, pub to_did: String, pub capabilities: Vec, pub max_redelegation_depth: u32, // anti-amplification pub expires_at: chrono::DateTime, pub revocation_url: Option, pub signature: Signature, } ``` The **no-amplification rule** is enforced at delegation time: the delegate cannot receive capabilities the delegator does not hold. `Aegis::delegate` rejects amplifying tokens. ## Treaty capabilities A `MOAT` treaty grants a foreign tenant a bounded capability set inside your tenant. The treaty is a signed document on both sides; `MACS::derive` includes treaty grants in the composed capability set when the caller's tenant matches the foreign side. ```yaml # Treaty example (yaml) treaty: parties: - tenant: org_acme - tenant: org_globex grants_to_globex: - map.mind.recall_memory - map.maven.cite - map.made.economic_contract_settle (caveats: [weekly_budget:50000]) expires_at: 2026-12-31T00:00:00Z ``` Treaty grants are revoked instantly by `MOAT::terminate`; all in-flight requests complete, new requests fail at security gating. Treaties unlock the **legitimacy loop**. Two institutions can collaborate without merging; their audit chains stay separate; the boundary is policed by `MOAT`. The price of a treaty is the discipline of declaring it. ## See also - [Identity & lineage](/docs/concepts/identity) - [MAXIM](/docs/protocols/maxim) — the policy engine that evaluates caveats - [MOAT](/docs/protocols/moat) — the treaty primitive - [Aegis adapter](/docs/protocols/aegis) — delegation tokens ================================================================================ # Dispatch # URL: https://docs.multiagentic.dev/docs/concepts/dispatch # How a request travels from your code through identity middleware into the engine pipeline and out as an audited response. ================================================================================ import { Steps, Step } from 'fumadocs-ui/components/steps'; This page is the conceptual narrative. For the strict implementation, see the [engine pipeline](/docs/engine/pipeline). ### You call Your code — Rust SDK, TypeScript SDK, CLI, MCP client, raw HTTP — produces a `HandleRequestInput` describing one operation against one protocol. ```ts await map.dispatch({ protocol: 'MARC', version: 'v1.0.0', operation: 'reasoning_task', input: { intent: 'is this treaty enforceable?', budget: { tokens: 8000, deadline_ms: 12000 } }, tenant_id: 'org_acme' }); ``` ### The gateway authenticates `services/gateway/` validates the `Authorization` bearer or session cookie, extracts the caller DID, and builds a base `InvokeContext`. The `traceparent` header is propagated; a fresh `correlation_id` is minted if none was supplied. ### Identity middleware enriches `IdentityMiddleware::enrich` calls the bound resolver (`OasResolver` in prod) and attaches the `ResolvedAgentIdentity` to the context. Failed resolution falls back to `ResolvedAgentIdentity::unresolved(did)` — the request still flows, but typically denies at security gating. ### The engine takes over `MapEngine::handle_request` runs eight stages in order: 1. **Version Resolution** — the registry picks the best installed version 2. **Context Enrichment** — tenant context, correlation, timestamp 3. **Rate Limiting** — token bucket per tenant 4. **Security Gating** — hierarchical capability check 5. **Circuit Breaking** — is the target endpoint healthy? 6. **Load Balancing** — pick an endpoint 7. **Router Invocation** — call `ProtocolModule::invoke` 8. **Result Handling** — audit + metric Each stage can refuse. Refusals carry reasons and are audited the same as success. ### The protocol module reasons (or doesn't) The protocol crate's `invoke` method matches on the operation and runs the actual logic. For a protocol like `MAX` this is fast and stateless. For an agent like `MARC` this may consult `MIND`, attest sources with `MAVEN`, weight evidence with `MARE`, and return a derivation tree with a confidence band. Throughout, the protocol can read the resolved identity via `ctx.identity()`, check capabilities, record its own audit events, and recursively dispatch other protocols. ### Metering and audit close the loop `MEAL::meter` charges the call against three dimensions (tokens, seconds, watts). `MAX::audit_log_entry` records the decision and outcome. `MOTET::emit` writes traces. The response flows back through the gateway with the audit-chain head hash in the metadata so you can verify the record later. ## Refusals carry reasons If the request is denied at any stage, you receive a structured response — not a 500. Examples: - Rate limit: HTTP 429 with `Retry-After`, error `RateLimited`, audit event `RateLimitExceeded` - Capability missing: HTTP 403, error `CapabilityDenied` with the requested capability name - Policy block: HTTP 422, error `ProtocolError(PolicyDenied { reason })` - Cross-org without treaty: HTTP 403, error `CapabilityDenied`, audit event includes "no active MOAT treaty" This is by design. The institution does not say "no" without saying why. Every refusal is a first-class record. ================================================================================ # Estates # URL: https://docs.multiagentic.dev/docs/concepts/estates # Every service in MAP has a temperament. The classification matters for SLA, metering, and capability requirements. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; Every service in the MAP registry is one of three kinds. The kind is **not** a marketing label — it determines SLA expectations, metering behavior, and what kind of capability is required to invoke. ## Protocol — stateless infrastructure A **protocol** routes, records, and validates. It does not learn. It does not negotiate. It is the same on Tuesday as it was on Monday — and that is its worth. Predictability is a civic virtue. | Property | Value | | --- | --- | | State | Stateless | | Reasoning | None | | Latency profile | Predictable, sub-10ms p99 typical | | Metering | Per-call charge | | SLA expectation | 99.95%+ availability | **Examples:** `MAX` (audit), `MARS` (registry), `MEAL` (metering), `MOMENT` (metrics), `MOTET` (telemetry), `MIM` (messaging), `MAT` (tool dispatch), `MAXIM` (policy evaluation). A protocol implementation lives in the equivalent `protocols/-lib` crate and implements `ProtocolModule` directly. There is no agent backing. ## Agent — reasoning service An **agent** is itself an autonomous organization built on MAP — capable of judgment, dialogue, and learning. Some of MAP's services are agents: `MACE` deliberates, `MOOT` arbitrates, `MARC` reasons. | Property | Value | | --- | --- | | State | Stateful (consults `MIND`, records to `MAX`) | | Reasoning | LLM-backed or hierarchical reasoner | | Latency profile | Variable; 500ms–10s typical | | Metering | Per-call + tokens + seconds + watts | | SLA expectation | 99.5%–99.9% (lower than protocols) | **Examples:** `MARC` (reasoning), `MAVEN` (evidence), `MACE` (consensus), `MOOT` (arbitration), `MARI` (research), `MAESTRO` (planning), `MIMESIS` (precedent), `MAGE` (generation), `MAGI` (interpretability), `MANTIC` (calibration). An agent has the full triad: a `ProtocolModule` implementation in `protocols/-lib` for the dispatch contract, plus an internal reasoning loop (often calling other MAP protocols recursively), plus governance hooks (`MACE` for ratification, `MOOT` for disputes). Agents are themselves autonomous organizations. `MARC` is an organization running on MAP whose sole purpose is reasoning. It has a charter, a treasury (`MANA` budget), records to its own `MAX` partition, and can be dissolved by `MAUSOLEUM`. This is the recursive structure of the institution. ## Hybrid — protocol with agent backing A **hybrid** is a protocol by default — fast, cold, predictable — but invokes an agent when ambiguity demands judgment. | Property | Value | | --- | --- | | State | Optional state (depends on operation) | | Reasoning | Conditional — only when ambiguity threshold tripped | | Latency profile | Bimodal: sub-10ms for protocol path; 500ms–10s when agent fires | | Metering | Per-call always; tokens/seconds/watts only on agent path | | SLA expectation | Protocol-grade for the protocol path; agent-grade for the agent path | **Examples:** `MIND` (memory: protocol for `store_memory`, agent for `fusion_request`), `MERIT` (credentials), `MARE` (reputation), `MEAL` (metering), `MANTLE` (consolidation), `MOTE` (devices), `MOOT` (file is protocol, rule is agent). The hybrid contract is implemented in the same `protocols/-lib` crate. The agent backing is a separate `Arc` injected at construction. ## Adapter — external open standard The three external standards MAP consumes — `OAS`, Arsenal, Aegis — are presented in the registry as **adapter** kinds. The MAP engine has a thin wrapper (`protocols/oas-lib`) over each but the canonical implementation lives outside MAP. | Property | Value | | --- | --- | | Source | External open standard | | State | Depends on the adapter target | | Latency | Depends on the adapter target | | Metering | Per-call charge against the adapter operation | ## Implementation status Most protocols are fully implemented. A few are partial or stubs: | Status | Protocols | | --- | --- | | Implemented | `MACS`, `MIND`, `MARC`, `MAVEN`, `MAGE`, `MOAT`, `MERIT`, `MARKET`, `MANA`, `MOON`, `MAESTRO`, `MIMESIS`, `MAXIM`, `MACE`, `MARI`, `MAME`, `MAZE`, `MATA`, `MAKER`, `MAUSOLEUM`, `MEAL`, `MANTLE`, `MARE`, `MOTE`, `MAT`, `MARS`, `MADE`, `MIM`, `MAX` | | Partial | `MOOT`, `MANTIC`, `MAGI` | | Stub | `MOTIF`, `MOMENT`, `MOTET` (observability protocols — implementations merged into engine/observability) | See the [protocol registry](/docs/protocols) for per-service detail. ## Why this classification matters When you reach for a service, look at its kind: - **Protocol:** Expect deterministic latency. Cache results aggressively. Idempotent retries are safe. - **Agent:** Expect tokenized cost. Budget for variability. Do not retry blindly — agent reasoning is rarely idempotent. - **Hybrid:** Plan for both paths. The first call may take the protocol path; the second (ambiguous) may invoke the agent. - **Adapter:** Read the upstream standard's documentation. MAP does not control the semantics. Capability requirements differ too. Heavy agents typically require an `L1` conformance identity (verified lineage). Sovereign-tier governance operations on `MACE` or `MAUSOLEUM` require `L2`. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/concepts/governance # MARC reasons. MACE decides. MOOT arbitrates. MIMESIS surfaces precedent. MAUSOLEUM dissolves. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; MAP separates thought from rule. **`MARC` reasons; `MACE` decides; `MOOT` arbitrates.** The institution distinguishes between what an agent thinks and what a council has ruled. The audit chain records both. ## The governance services | Service | Estate | Role | | --- | --- | --- | | [`MAXIM`](/docs/protocols/maxim) | Agent | Constitutional reasoning. Maps mandates to constraints. | | [`MACE`](/docs/protocols/mace) | Agent | Consensus voting. Quorum-driven councils. Dissent on record. | | [`MOOT`](/docs/protocols/moot) | Hybrid | Arbitration. Binding outcomes. Damages and remedies. | | [`MIMESIS`](/docs/protocols/mimesis) | Agent | Convention. Custom. Precedent. Common law over time. | | [`MOAT`](/docs/protocols/moat) | Protocol | Cross-organization treaties. | | [`MAUSOLEUM`](/docs/protocols/mausoleum) | Agent | Dissolution. Archive. Succession of obligation. | ## Refusal carries reasons When the institution says **no**, it says why. Every refusal is a structured record carrying: - the requested capability - the policy that denied it - the dissent (if any council was involved) - the appeal path (if any) This is enforced at the engine layer: every `CoreError` variant has a structured reason; every `ProtocolError` variant has a structured reason; the audit pipeline records both. There is no "silently refused" path. ```rust return Err(CoreError::ProtocolError(ProtocolError::PolicyDenied { reason: "treaty grant expired; counterparty re-signing required".into() })); ``` This is what makes the institution legible to participants. Discontent has a place to go. ## Dissent is preserved When a council deliberates and produces a majority verdict, the minority opinions are filed **alongside** the verdict, not erased. `MACE::tally` records each delegate's reasoning. `MOOT::rule` records each side's plea in full. `MIMESIS` watches dissent over time. Repeated dissent on the same kind of question can surface a need for amendment to the governing policy. The institution learns by acknowledging disagreement. ## The five rules The governance services share five rules: ### Refusal carries reasons Every denial is structured and audited. No silent failures. ### Dissent is preserved The losing side of a vote is recorded alongside the winner. Minority opinions are not erased. ### Verdicts are not binding without a council `MARC` reasons. Its outputs are **inputs** to governance, not governance itself. `MACE` quorum is required for binding decisions. ### Disputes return through the same chain When two services disagree, `MOOT` resolves by replaying the audit chain. The same record that produced the disagreement produces the resolution. ### Precedent accretes through `MIMESIS` Repeated decisions become convention. `MIMESIS::surface` reports patterns; `MIMESIS::formalize` proposes them as policy amendments to `MAXIM`. Common law emerges from doing. ## The governance loop ``` Request arrives ↓ (Stage 4 of engine pipeline) MAXIM evaluates active policy ↓ If straightforward: allow or deny with reason ↓ If ambiguous: agent reasons (MARC) ↓ If decision is structural: MACE convenes a council ↓ If dispute: MOOT arbitrates ↓ Either way: MAX records the outcome ↓ (over time) MIMESIS notices a pattern ↓ MIMESIS proposes formalization to MAXIM ↓ MAXIM evaluates the proposal ↓ MACE ratifies if quorum agrees ↓ The policy is amended; future requests are easier ``` This is the **legitimacy loop**. The institution becomes more capable over time without anyone redesigning it. ## Charter-level operations A few operations require **charter authority** — they affect the entire institution: - `MOAT::sign` for a new treaty - `MAUSOLEUM::initiate` for organizational dissolution - `MAXIM::author` for a new constitutional maxim - `MACE::convene` for a charter-level council - `MEAL::admin` operations (rate-card amendments) These require `MACE` quorum from the charter members at L2 conformance. A single agent cannot perform them alone. ## The MAUSOLEUM clause Every charter includes a dissolution clause. When an organization is wound down, `MAUSOLEUM` executes: 1. **Initiate** — under charter authority 2. **Distribute** — execute asset distribution schedule via `MADE` 3. **Transfer** — obligations passed to successors under `MOOT` supervision 4. **Seal** — audit chain frozen; final hash published to `MARS` 5. **Archive** — chain preserved for perpetual verification The institution ends the same way it began: with a record. The end is itself recorded. There is no MAP service for "delete." Audit chains do not delete; they seal. Even dissolved organizations remain queryable through `MAX::audit_query` against the sealed chain. ## See also - [Audit & explainability](/docs/concepts/audit) - [Treaties](/docs/concepts/treaties) - [`MIMESIS`](/docs/protocols/mimesis) — precedent - [`MOOT`](/docs/protocols/moot) — arbitration import { Steps, Step } from 'fumadocs-ui/components/steps'; ================================================================================ # Identity # URL: https://docs.multiagentic.dev/docs/concepts/identity # How OAS DIDs identify callers, how MACS verifies them, how lineage roots back to a human, and how capability sets are derived. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; MAP does not own identity. It **consumes** [OAS — the Open Agent Specification](https://openagent.id), a vendor-neutral W3C-DID standard. Every entity in the mesh has a `did:oas:::`. ## The DID A typical caller DID: ``` did:oas:l1fe:agent:0xa3f9c1a4b5... ``` Components: | Segment | Meaning | | --- | --- | | `did` | W3C DID scheme | | `oas` | The OAS method | | `l1fe` | The namespace (typically the organization) | | `agent` | The entity kind — one of 11 (see below) | | `0xa3f9c1a4b5...` | The unique identifier (Ed25519 public key digest) | ## Entity kinds OAS defines 11 entity kinds. MAP groups them as **root** vs **derived**: | Root kinds | Derived kinds | | --- | --- | | `HumanRoot` | `Agent` · `AgentInstance` | | `MultiHumanRoot` | `Tool` · `Skill` · `Workflow` | | `EntityNameRecord` | `Model` · `Dataset` · `Service` | Every derived entity's lineage chain must terminate at a root. The chain is cryptographically signed at each step using HKDF-SHA256 derivation from the parent's Ed25519 key. ## Lineage Lineage is **the** mechanism by which autonomous actions remain accountable to a human. Every `Agent` derives from a `HumanRoot` through one or more derivation steps. The lineage proof is: ``` Root pubkey → signs → Child pubkey → signs → ... → Caller pubkey ``` The proof is offline-verifiable. Given the chain and the leaf signature, any verifier can confirm the chain without contacting any server. `MACS::verify_response` does exactly this. This is why MAP can run sovereign deployments. The audit chain plus the lineage chain plus the OAS root means an air-gapped institution can verify every action it has taken without a network connection. ## Conformance levels ```rust pub enum ConformanceLevel { L0, L1, L2 } ``` | Level | Requirement | Use | | --- | --- | --- | | L0 | DID exists; no lineage required | Sandbox tier, public read-only operations | | L1 | Lineage verified for non-root entities | Standard production calls — most operations | | L2 | L1 + full extended sections (attestations, reputation) | Charter-level governance, cross-org settlement | `MAXIM` policies typically read the conformance level and require L1 or L2 for state-changing operations. Heavy agents (`MARC::reasoning_task`, `MAGI::trace`) require L1 minimum. ## Capability sets A resolved identity carries an `AgentCapability` set: ```rust pub struct AgentCapability { pub name: String, // e.g. "map.macs.auth_negotiation" pub expires_at: Option>, pub limits: Option, pub caveats: Vec, } ``` The capability name is a dotted path. The security gateway matches hierarchically: | Match level | Example | | --- | --- | | Exact | `map.macs.auth_negotiation` | | Protocol wildcard | `map.macs.*` | | Global wildcard | `map.*.*` (reserved for admin/ops) | A capability can carry **caveats** — additional constraints like time-of-day, jurisdiction, max spend per call. The gateway evaluates caveats at request time using the `cedar`-style policy engine in `MAXIM`. ## How capabilities are acquired Three sources: 1. **Declared on the DID document.** Static capabilities baked into the OAS document for the entity. 2. **Delegated via `Aegis::delegate`.** A delegation token from a parent entity, bounded by the no-amplification rule (the delegate cannot exceed the delegator's authority). 3. **Granted by treaty via `MOAT`.** A cross-org treaty grants the foreign caller a bounded capability set within your tenant. `MACS::derive` composes all three sources at request time and produces the effective capability set the gateway checks. ## Revocation An identity can be revoked at any time: - Static revocation via the OAS document (the DID document is updated; `MACS::verify_response` consults the latest) - Delegated revocation via `Aegis::delegate` (the delegation token includes revocation hooks) - Treaty revocation via `MOAT::terminate` (cross-org capabilities evaporate immediately) When an identity is revoked, in-flight requests complete; new requests deny at security gating. `MERIT` credentials issued to the revoked identity are not automatically revoked — that requires a separate `MERIT::revoke` call under authority. ## Local admin (dev only) `ResolvedAgentIdentity::local_admin()` exists for dev mode. It returns an identity with `map.*.*` capability and `lineage_verified = true`. Production gateways never issue this — production tenants are bound to specific capability sets only. ```rust // Dev mode only: let ctx = InvokeContext { resolved_identity: Some(ResolvedAgentIdentity::local_admin()), ..Default::default() }; ``` ## Reading identity inside a protocol module ```rust async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { let id = ctx.identity().ok_or_else(|| ProtocolError::PolicyDenied { reason: "unresolved identity".into() })?; // For sensitive operations, require verified lineage: if !ctx.caller_lineage_verified() { return Err(ProtocolError::PolicyDenied { reason: "verified lineage required".into() }); } // Enforce kind constraint (e.g. only autonomous orgs can convene MACE): if id.entity_kind != AgentEntityKind::Agent && !id.is_autonomous_org() { return Err(ProtocolError::PolicyDenied { reason: "agent or autonomous org required".into() }); } // ... continue } ``` The helpers `ctx.identity()`, `ctx.caller_lineage_verified()`, `id.has_capability("...")`, and `id.is_autonomous_org()` are the four most common reads. ## See also - [MACS](/docs/protocols/macs) — the verifier - [OAS adapter](/docs/protocols/oas) — the resolver - [Aegis adapter](/docs/protocols/aegis) — delegation and key management - [Capabilities](/docs/concepts/capabilities) — the full capability model ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/concepts/metering # Tokens, seconds, watts. Every call costed against three independent dimensions; reconciled into a triple-entry ledger. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; MAP's billing model is **three-dimensional**. Every call is metered against tokens, seconds, and watts independently. `MEAL` records the metered events; `MANA` enforces tenant runway; `MADE` settles across organizations. ## The three dimensions ### Tokens The unit of thought. LLM input + output tokens consumed by reasoning protocols (`MARC`, `MAVEN`, `MACE`, `MAGE`, `MARI`, `MAGI`). - Token rates vary by protocol — heavy reasoners like `MARC` charge differently than light verifiers like `MAVEN`. - Input and output tokens are counted independently. - The token meter excludes overhead tokens (system prompts, tooling) — only intent-bearing tokens count. ### Seconds The unit of presence. Wall-clock time held against a deadline. - Charged for **every** call. A protocol call that takes 1.4s and uses no tokens is still billed for 1.4 seconds. - Useful for durable workflows (`MOON`), physical actions (`MOTE`), and any operation that holds real time. - Sub-second resolution. The minimum chargeable unit is 1 millisecond. ### Watts The unit of work in the physical sense. Energy draw on bound compute. - Charged when the operation runs **GPU-bound** work — heavy inference, training passes, large matrix ops. - Measured at the substrate via vendor APIs (NVIDIA NVML on bare-metal; cloud GPU telemetry otherwise). - Sovereign deployments can substitute their own measurement source. ## The rate card Rate cards are published per protocol and per tier. The current default rates ([pricing](https://multiagentic.dev/pricing#rate-card)): | Dimension | Rate | | --- | --- | | Tokens | $3.00 / M tokens | | Seconds | $0.018 / second | | Watts | $0.42 / kWh | | Cross-org settlement | 25 bps on MADE-settled value (15 bps at Institution, 5 bps at Sovereign) | Heavy protocols carry **multipliers** on these base rates: | Protocol | Token multiplier | Second multiplier | Watt multiplier | | --- | --- | --- | --- | | `MARC::reasoning_task` | 1.0× | 1.0× | 1.2× | | `MACE::deliberate` | 1.5× (council members all consume) | 1.5× | 1.2× | | `MAGI::trace` | 1.0× | 2.0× | 4.0× (interpretability is GPU-heavy) | | `MAVEN::attest` | 0.8× | 1.0× | 1.0× | | Most protocols | 1.0× | 1.0× | 1.0× | ## Reconciliation ```rust // MEAL operations "meter" // record a metered event (tokens + seconds + watts) against caller account "statement" // generate a statement for an account over a period "reconcile" // reconcile metered events against settled payments; reports unbalances ``` The triple-entry book is: 1. **Tenant ledger** — every metered event debits the tenant's runway 2. **Settlement ledger** — every successful `MADE::economic_contract_settle` credits the merchant 3. **Audit chain** — every meter event records to `MAX` `MEAL::reconcile` runs nightly (or on-demand) and asserts that: ``` sum(tenant_debits) = sum(merchant_credits) + sum(audit_records) ``` Any drift produces an `Unbalanced` event recorded to `MAX` and routed to ops. ## Runway enforcement `MANA::budget` is consulted at the meter step (Stage 5 of the pipeline). If the tenant's runway is below threshold, the request is refused at `MANA` rather than `MEAL`: ```rust let budget = mana::budget(tenant).await?; if budget.remaining_in_dimension(Dim::Tokens) < estimated_tokens { return Err(CoreError::ProtocolError(ProtocolError::PolicyDenied { reason: "tenant runway exhausted (tokens)".into() })); } ``` `MANA` can also **throttle** rather than refuse — reducing the rate-limit bucket for non-essential operations while still allowing critical ones (governance, audit reads). ## Emergency holds Under tenant-charter authority, `MANA::hold` can declare an emergency hold that **stops** all non-essential operations. The hold is multi-sig revocable (requires `MACE` quorum). All in-flight operations complete; new operations refuse. This is the institution's emergency brake. It is rare but the institution always retains the option. ## Pricing tier behavior | Tier | Runway model | Settlement clearing fee | | --- | --- | --- | | Sandbox (free) | 10k req/mo cap; no metering beyond that | n/a (no MADE access) | | Charter ($499/mo) | 1M req included; metered per dimension above | 25 bps | | Institution ($4,999/mo) | 10M req included; priority queue | 15 bps | | Sovereign (custom) | Dedicated capacity; custom rates | 5 bps | The charter fee covers the institutional surface (governance, audit chain, treaty maintenance, policy currency). Metered usage covers throughput. The clearing fee covers the cost of clearing cross-organization value. Three components, transparent. ## See also - [`MEAL` protocol](/docs/protocols/meal) — the meter - [`MANA` protocol](/docs/protocols/mana) — the treasury - [`MADE` protocol](/docs/protocols/made) — settlement - [Pricing & rate card](https://multiagentic.dev/pricing) ================================================================================ # Overview # URL: https://docs.multiagentic.dev/docs/concepts/overview # What MAP is, what it is not, and the mental model that makes the rest of the documentation cohere. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; MAP — the Multi-Agentic Protocol — is the **institutional operating system** for autonomous organizations. It is not an agent framework, not a workflow engine, not an identity standard. It is the substrate underneath all three. ## The mental model Every autonomous organization needs the same primitives: a way to verify who is calling, a way to enforce what they may do, a way to count what they used, a way to record what was decided. Building those primitives once per organization is wasteful and error-prone. MAP centralizes them into a single, auditable, treaty-capable mesh. A request enters MAP. Eight stages happen, in this order: 1. **Version Resolution** — pick the best version of the named protocol 2. **Context Enrichment** — attach tenant, correlation, trace 3. **Rate Limiting** — `ProductionRateLimiter` token bucket per tenant 4. **Security Gating** — `SecurityGateway::is_operation_allowed` against the caller's capability set 5. **Circuit Breaking** — `ProductionLoadBalancer::is_available` on the target endpoint 6. **Load Balancing** — `ProductionLoadBalancer::select_endpoint` for redundancy 7. **Router Invocation** — `ProtocolRouter::invoke(protocol, version, operation, input, &ctx)` 8. **Result Handling** — audit pipeline, metric emission, response formatting See [`MapEngine::handle_request`](/docs/engine/handle-request) for the canonical implementation. **Refusal carries reasons.** When a request is denied at any stage, MAP returns a structured refusal with the same audit weight as success. Refusals are first-class records; they are not silences. This is enforced by `AuditPipeline::record` in `engine/core/src/engine.rs`. ## What MAP is - A **protocol router**: 35 named services, each implementing the `ProtocolModule` trait, dispatched through one engine. - A **policy engine surface**: every request is checked against `SecurityGateway` policies (hierarchical wildcards) before reaching a protocol module. - An **audit substrate**: every decision — allowed or refused — flows through `AuditPipeline` into structured tracing + metrics. - An **economic primitive**: `MEAL` meters three dimensions (tokens, seconds, watts), `MANA` enforces runway, `MADE` settles across organizations. - An **interop surface**: every protocol is exposed as an MCP tool; cross-organization calls run under `MOAT` treaties; agent-to-agent messaging uses A2A envelopes through `MIM`. ## What MAP is not - **Not an agent framework.** Building agents is [Forge](https://forge.l1fe.ai)'s job. MAP verifies what Forge signs. - **Not a workflow engine.** Durable orchestration is [Aut0](https://aut0.l1fe.ai) and Flowers. MAP records what Aut0 conducts via `MOON` and `MAX`. - **Not an identity standard.** That is [OAS](https://openagent.id) — vendor-neutral W3C DIDs. MAP **consumes** OAS, never owns it. - **Not a DID resolver.** `MACS` verifies presented identities; resolution is delegated to the OAS adapter. ## Three estates Every service in MAP has a **temperament** that determines how it behaves: See [Three Estates](/docs/concepts/estates) for the full taxonomy. The classification matters because it controls SLA expectations, metering behavior, and what kind of capability is required to invoke. ## Seven planes Services are grouped into seven **functional planes**. The planes are functional, not ranked. | Plane | Question | Services | |---|---|---| | I — Identity | Who are you, what can you do | `MACS`, OAS, Arsenal, Aegis | | II — Cognition | What do you know, what can you reason about | `MIND`, `MARC`, `MANTLE`, `MAME` | | III — Truth | What is verified, what is trusted | `MAVEN`, `MATA`, `MARE`, `MERIT`, `MANTIC`, `MAGI` | | IV — Governance | How decisions are made and enforced | `MOAT`, `MAXIM`, `MACE`, `MOOT`, `MIMESIS`, `MAUSOLEUM` | | V — Execution | How work gets done | `MOON`, `MAESTRO`, `MAT`, `MAKER`, `MOTE`, `MAGE` | | VI — Economic | How value flows | `MADE`, `MARKET`, `MANA`, `MEAL` | | VII — Awareness | How the institution sees itself | `MAX`, `MOTIF`, `MOMENT`, `MOTET`, `MARS`, `MAZE`, `MARI`, `MIM` | See [The Seven Planes](/docs/concepts/planes) for the per-plane briefings. ## The legitimacy loop > With protocols come **processes**. > From processes come **workflows**. > From workflows come **factories**. Every successful dispatch through MAP adds a record. Records that recur across requests become processes. Processes that prove themselves become workflows other organizations adopt. Workflows that stamp out new organizations become factories — and the institution funds the next institution. This is the legitimacy loop. It is not a slogan; `MIMESIS` watches the audit chain for recurring patterns and proposes formalizations through `MAXIM`. `MAUSOLEUM` archives organizations that dissolve, preserving their precedent. The institution learns by doing. ## Reading the docs - **Reference docs** quote the actual code: type names, function signatures, operation strings. If a doc page says `MACS::auth_negotiation`, that operation exists in `protocols/macs-lib/src/lib.rs`. - **Conceptual docs** explain the mental model behind the code. They cite specific files so you can drop into the implementation when ready. - **Recipe docs** demonstrate full workflows that span multiple protocols. They are extracted from `DEFAULT_RECIPES.md` in the repo. - **Agent-targeted docs** (`/llms.txt`, `/llms-full.txt`, the [agents section](/docs/agents/consumption)) are machine-readable and built for autonomous consumption. When two pages conflict, the **code wins**. File an issue at `map@l1fe.ai` with both URLs. ================================================================================ # Planes # URL: https://docs.multiagentic.dev/docs/concepts/planes # Functional domains, not ranked. Identity, Cognition, Truth, Governance, Execution, Economic, Awareness. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; Services are grouped into seven **functional planes**. The planes are functional, not ranked — Identity is not "more important" than Awareness. They are seven categories that together describe everything an institution needs. ## I — Identity > Who you are. What you may do. The first question MAP asks of every caller. Identity verification and capability derivation happen before any other plane fires. | Service | Kind | Role | | --- | --- | --- | | [`MACS`](/docs/protocols/macs) | Hybrid | The single port of entry. Verifies signatures, derives capability sets. | | [`OAS`](/docs/protocols/oas) | Adapter | Vendor-neutral W3C-DID identity standard. | | [`Arsenal`](/docs/protocols/arsenal) | Adapter | Agent Capability Tokens, credential proxy with SSRF guard. | | [`Aegis`](/docs/protocols/aegis) | Adapter | Challenge-response auth, key management, delegation trees. | The single MAP service in this plane is `MACS`. The other three are external standards MAP consumes through adapters. ## II — Cognition > What you know. What you may reason about. Substrate and faculty for thought. Cognition services hold the institution's memory and reasoning capacity. | Service | Kind | Role | | --- | --- | --- | | [`MIND`](/docs/protocols/mind) | Hybrid | The cognitive substrate. 4 memory types, HNSW search, knowledge graph. | | [`MARC`](/docs/protocols/marc) | Agent | Hierarchical reasoning, causal analysis, model publishing. | | [`MANTLE`](/docs/protocols/mantle) | Hybrid | Perception, consolidation, EWC continual learning. | | [`MAME`](/docs/protocols/mame) | Agent | Meta-learning. Curatorial edits to `MIND` with provenance. | ## III — Truth > What is verified. What is trusted. The institution's ledger of confidence. Truth services evaluate claims, weight sources, score reliability. | Service | Kind | Role | | --- | --- | --- | | [`MAVEN`](/docs/protocols/maven) | Agent | Evidence verification via GLYPH. Claims-as-graphs, contradiction preservation. | | [`MATA`](/docs/protocols/mata) | Agent | Bayesian opinion pooling across heterogeneous sources. | | [`MARE`](/docs/protocols/mare) | Hybrid | Reputation built from outcomes. Stake-weighted, decay over time. | | [`MERIT`](/docs/protocols/merit) | Agent | Composable credentials from verified history. Selective ZK presentation. | | [`MANTIC`](/docs/protocols/mantic) | Agent | Calibration scoring, reliability budgets, uncertainty quantification. | | [`MAGI`](/docs/protocols/magi) | Agent | Mechanistic interpretability. Activation tracing, feature attribution. | ## IV — Governance > How decisions are made. How they bind. Governance services are how the institution **decides** — not reasons, decides. The line between MARC (thinking) and MACE (ruling) lives here. | Service | Kind | Role | | --- | --- | --- | | [`MOAT`](/docs/protocols/moat) | Protocol | Treaty-based federation. Two charters meeting at a boundary. | | [`MAXIM`](/docs/protocols/maxim) | Agent | Constitutional reasoning. Mandate interpretation and enforcement. | | [`MACE`](/docs/protocols/mace) | Agent | Consensus voting. Quorum-driven deliberation; dissent on record. | | [`MOOT`](/docs/protocols/moot) | Hybrid | Dispute resolution & arbitration. Binding rulings recorded forever. | | [`MIMESIS`](/docs/protocols/mimesis) | Agent | Convention, custom, precedent. Slow accretion of common law. | | [`MAUSOLEUM`](/docs/protocols/mausoleum) | Agent | Dissolution. Archive. Succession of obligation. | ## V — Execution > How work gets done. How it stays done. Execution services are the institution's hands. They reach out to tools, devices, and durable workflows. | Service | Kind | Role | | --- | --- | --- | | [`MOON`](/docs/protocols/moon) | Agent | Durable orchestration via Flowers. Manifests, deployments, replay. | | [`MAESTRO`](/docs/protocols/maestro) | Agent | Charter declaration, goal refinement, plan commit/diff/replan. | | [`MAT`](/docs/protocols/mat) | Protocol | Tool dispatch, discovery, workflow execution. | | [`MAKER`](/docs/protocols/maker) | Agent | Kinetic action with emergency stop. Native/MCP/A2A/HTTP unified. | | [`MOTE`](/docs/protocols/mote) | Hybrid | Sensors, actuators, vehicles, fabrication. Physical-world bridge. | | [`MAGE`](/docs/protocols/mage) | Agent | Generation engine via ONE/MUSE. Drafts charters, treaties, blueprints. | ## VI — Economic > How value flows. How it settles. Economic services let the institution earn, spend, and clear. MEAL meters; MANA budgets; MARKET trades; MADE settles. | Service | Kind | Role | | --- | --- | --- | | [`MADE`](/docs/protocols/made) | Protocol | Settlement layer. x402, multi-rail, basis-point clearing. | | [`MARKET`](/docs/protocols/market) | Agent | Orderbooks, auctions, bounties, trades. | | [`MANA`](/docs/protocols/mana) | Agent | Negotiation, arbitration, treasury. Bidding, reputation, arbitration channels. | | [`MEAL`](/docs/protocols/meal) | Hybrid | Metering. Tokens · seconds · watts. Triple-entry ledger. | ## VII — Awareness > How the institution sees itself. Awareness services let the institution observe itself. Every audit record, every metric, every relationship, every research finding flows here. | Service | Kind | Role | | --- | --- | --- | | [`MAX`](/docs/protocols/max) | Protocol | The constitutional record. Hash-chained, replayable, queryable. | | [`MOTIF`](/docs/protocols/motif) | Protocol | Pattern detection across traces and audit. | | [`MOMENT`](/docs/protocols/moment) | Protocol | Time-series. Append-only, monotonic, time-travel queryable. | | [`MOTET`](/docs/protocols/motet) | Protocol | Multi-stream telemetry. Logs, metrics, traces, attestations. | | [`MARS`](/docs/protocols/mars) | Protocol | Universal registry. Every asset of standing. | | [`MAZE`](/docs/protocols/maze) | Agent | Topology + ZK proofs of structural properties. | | [`MARI`](/docs/protocols/mari) | Agent | Research & inquiry. Literature synthesis, hypothesis testing. | | [`MIM`](/docs/protocols/mim) | Protocol | Messaging. Mailbox semantics. QoS. | ## How planes interact Every successful dispatch produces a record. Records record decisions; decisions reference identity, evidence, policy, treasury. Cross-plane references are the rule, not the exception. A typical `MARC` reasoning call: 1. Identity: `MACS` verifies the caller (Plane I) 2. Cognition: `MIND` snapshot bound for reasoning (Plane II) 3. Truth: `MAVEN` attestation on every premise (Plane III) 4. Governance: `MAXIM` policy bound; `MACE` may be invoked if the verdict is structural (Plane IV) 5. Execution: `MAT` invoked if reasoning recommends a tool (Plane V) 6. Economic: `MEAL` meters the call; `MANA` enforces runway (Plane VI) 7. Awareness: `MAX` records; `MOTET` traces; `MOMENT` tracks latency (Plane VII) The legitimacy of the verdict comes from every plane firing in support. A reasoning result without an audit chain is not a verdict — it is a guess. ================================================================================ # Treaties # URL: https://docs.multiagentic.dev/docs/concepts/treaties # Two charters meeting at a boundary. Capabilities crossed, sovereignty preserved. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; A **treaty** is a signed accord between two MAP-running organizations that grants bounded capabilities across the boundary. The protocol that owns treaties is [`MOAT`](/docs/protocols/moat). ## Anatomy of a treaty ```yaml treaty: id: treaty_acme_globex_2026_q1 parties: - tenant: org_acme represented_by: did:oas:acme:agent:0x... - tenant: org_globex represented_by: did:oas:globex:agent:0x... grants_to_globex: - capability: map.mind.recall_memory caveats: [jurisdiction:us] - capability: map.maven.cite - capability: map.made.economic_contract_settle limits: max_per_call_bps: 500 weekly_budget_usd: 50000 grants_to_acme: - capability: map.market.query_orderbook - capability: map.maker.execute_action caveats: [action_kind:read-only] settlement: rail: x402 currency: USDC clearing_fee_bps: 25 dispute_resolution: via: moot venue: shared effective_from: 2026-01-01T00:00:00Z expires_at: 2026-12-31T23:59:59Z signatures: - signed_by: did:oas:acme:agent:0x... timestamp: 2025-12-15T10:00:00Z signature: ed25519:0xa3... - signed_by: did:oas:globex:agent:0x... timestamp: 2025-12-15T11:00:00Z signature: ed25519:0xb7... ``` Treaties are MARS-registered artifacts. Both parties have a copy; the treaty is content-addressed so any drift is immediately detectable. ## How treaty capabilities take effect When a foreign caller makes a request, `MACS::derive` includes the treaty grants in the resolved identity's capability set: ``` ResolvedAgentIdentity { did: "did:oas:globex:agent:0x...", capabilities: [ // From OAS document (declared) AgentCapability { name: "map.macs.auth_negotiation", .. }, // From active treaties (mirrored) AgentCapability { name: "map.mind.recall_memory", caveats: ["jurisdiction:us"], .. }, AgentCapability { name: "map.maven.cite", .. }, ], .. } ``` The capabilities are then matched at Stage 4 like any other capability. ## Treaty lifecycle ```rust // 1. Negotiate moat::propose( counterparty: "org_globex", capability_schedule: [...], rate_limits: [...], settlement_terms: [...], dispute_clause: "moot://shared" ) // 2. Sign (each party) moat::sign(treaty_id, signer_did) // MACE quorum if charter requires // 3. Enforce (engine, automatic) moat::enforce(call, treaty) // every cross-org call checked // 4. Update (rare; requires both sides) moat::propose_amendment(treaty_id, new_terms) moat::sign_amendment(amendment_id) // 5. Terminate (either side) moat::terminate(treaty_id, reason) ``` Termination is **immediate** — all in-flight requests complete, new requests fail at security gating with `CapabilityDenied`. A `Terminated` event records to `MAX` on both sides. Wind-down for assets transferred under the treaty is handled by `MAUSOLEUM`. ## Disputes If a party believes the treaty has been violated, they `MOOT::file` a case. The case proceeds through the standard arbitration flow: 1. **File** — claim + evidence + requested remedy 2. **Plead** — respondent's plea + their evidence 3. **Hear** — `MOOT` reconstructs the chains, weighs evidence with `MAVEN`, may consult `MACE` 4. **Rule** — binding outcome under the treaty's dispute clause Damages are settled via `MADE`. Reputational consequences flow through `MARE` and `MERIT`. The ruling is recorded in **both** chains. Treaties are how MAP scales across organizational boundaries without merging audit chains. Two organizations can collaborate while remaining sovereign. The audit history of each is its own; the boundary is policed by a single shared protocol. ## Treaty patterns Common treaty shapes: | Pattern | Use case | | --- | --- | | **Read-only** | One side grants the other read access to a `MIND` partition or `MARS` slice | | **Service exchange** | Each side grants the other a service capability with bounded rate | | **Joint venture** | Both sides grant into a third tenant they jointly fund and govern | | **Clearing house** | A third tenant brokers settlement (Bank Of MAP pattern) | ## Treaty templates The repo ships with treaty templates in `templates/treaties/`: - `reciprocal-read.yaml` — read-only access to MIND - `service-exchange.yaml` — each side offers a service with bounded budget - `settlement-only.yaml` — only `MADE::economic_contract_settle` granted Adopt as starting points; sign with `MOAT::sign` after `MACE` quorum on each side. ## See also - [`MOAT` protocol](/docs/protocols/moat) - [Capabilities](/docs/concepts/capabilities) - [`MACE`](/docs/protocols/mace) — for treaty ratification - [`MOOT`](/docs/protocols/moot) — for treaty disputes ================================================================================ # Deployment # URL: https://docs.multiagentic.dev/docs/deployment # Fly.io reference deployment, Docker multi-stage build, env vars, secrets, observability stack. ================================================================================ import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; import { Callout } from 'fumadocs-ui/components/callout'; MAP ships with a production Fly.io configuration as the reference deployment. Docker builds via a multi-stage `Dockerfile.mim`. The engine binary is statically linked and runs as `nonroot` in `distroless/cc-debian12`. ## Reference: Fly.io The repo's `fly.mim.toml` deploys the MIM service: ```toml app = "map-mim" primary_region = "iad" [build] dockerfile = "Dockerfile.mim" [env] RUST_LOG = "info,hyper=warn" APP_BIND_ADDR = "0.0.0.0:8080" MIM_AGENT_DID = "did:l1fe:router:mim-prod" MIM_DEFAULT_TRANSPORT = "http" MIM_QOS_DEFAULT_LEVEL = "AtLeastOnce" MIM_ENABLE_ENCRYPTION = "true" MIM_ENABLE_SIGNATURE = "true" MIM_MAX_MESSAGE_SIZE_BYTES = "5242880" MAP_WASMTIME_VERSION = "37.0.0" [metrics] port = 9091 path = "/metrics" [[vm]] cpus = 2 memory_mb = 2048 [http_service] internal_port = 8080 force_https = true ``` Deploy: ```bash flyctl deploy --config fly.mim.toml ``` ## Dockerfile `Dockerfile.mim` is a three-stage build: ```dockerfile # 1. Cargo chef stage — precompute dependency graph FROM rust:1.78 AS chef RUN cargo install cargo-chef # 2. Builder stage — compile with feature flags for prod FROM chef AS builder COPY . . RUN cargo chef cook --release --recipe-path recipe.json RUN cargo build --release --features native-adapter,production-storage \ -p mim-service # 3. Runtime stage — distroless / nonroot FROM gcr.io/distroless/cc-debian12:nonroot COPY --from=builder /target/release/mim-service /mim-service USER nonroot EXPOSE 8080 9091 ENTRYPOINT ["/mim-service"] ``` Final image is ~25 MB (distroless + statically-linked Rust binary). No shell. No package manager. No interactive surface. ## Per-service deployments The repo ships per-service Dockerfile + Fly config patterns. Each MAP service deploys independently: | Service | Dockerfile | Fly config | Default port | | --- | --- | --- | --- | | MIM | `Dockerfile.mim` | `fly.mim.toml` | 8080 | | Engine (orchestrator) | `Dockerfile.engine` | `fly.engine.toml` | 8080 | | Gateway (HTTP ingress) | `Dockerfile.gateway` | `fly.gateway.toml` | 443 | | MCP server | `Dockerfile.mcp` | `fly.mcp.toml` | 8601 | | Admin console | `Dockerfile.admin` | `fly.admin.toml` | 3000 | You can deploy all of MAP as a monolith (`mim-service` embeds the engine) or as separate services. The reference architecture is **separate services with the engine in front**. ## Environment variables The engine reads: | Variable | Default | Purpose | | --- | --- | --- | | `RUST_LOG` | `info` | Tracing level filter | | `APP_BIND_ADDR` | `0.0.0.0:8080` | HTTP listen | | `MAP_AGENT_DID` | required | Engine's own DID | | `MAP_API_URL` | — | Upstream MAP URL (when this is a relay) | | `MAP_TENANT_ID` | required | Tenant scope for the engine's own actions | | `MAP_WASMTIME_VERSION` | `37.0.0` | Pinned Wasmtime version | | `MAP_AUDIT_BUFFER_DIR` | `/var/lib/map/audit` | Disk buffer for audit overflow | | `MAP_AUDIT_SINK` | `production` | `production` \| `kafka` \| `memory` | | `MAP_RATE_LIMIT_BACKEND` | `redis` | `redis` \| `memory` | | `MAP_REDIS_URL` | required for rate-limit | `redis://host:6379/0` | | `MAP_DB_URL` | required | Postgres connection string for MAX chain | | `MAP_PROMETHEUS_PORT` | `9091` | Metrics scrape port | | `MAP_OTEL_ENDPOINT` | — | OTLP collector endpoint for tracing | | `MAP_PLUGIN_DIR` | `/var/lib/map/plugins` | Plugin scan directory | | `MAP_PLUGIN_REQUIRE_SIGNATURES` | `true` | Reject unsigned plugins | Plus per-protocol vars (e.g., `MIM_QOS_DEFAULT_LEVEL`). See the protocol's spec page. ## Secrets Set via Fly's secret store, never in `fly.toml`: ```bash flyctl secrets set \ MAP_AGENT_DID="did:oas:l1fe:agent:0x..." \ MAP_DB_URL="postgres://map:$(openssl rand -hex 32)@db.fly.dev/map" \ MAP_REDIS_URL="redis://default:$(...)@redis.fly.dev:6379/0" ``` Rotate annually. The audit signing key has a separate rotation procedure — see [Security](/docs/security). ## Database The MAX chain lives in PostgreSQL with the `pgcrypto` extension. Schema in `migrations/`: ```bash psql $MAP_DB_URL < migrations/0001_init.sql psql $MAP_DB_URL < migrations/0002_audit_chain.sql # ... ``` Or use the bundled runner: ```bash ./run_migrations.sh ``` Indexes are optimized for `correlation_id` lookup and time-range scans. For tenants > 1B records, partition `audit_chain` by month. ## Redis Used for: - Rate-limit token buckets (per tenant + protocol) - Capability set cache (TTL 60s) - Module-cache warmth signal across replicas A single Redis instance suffices for hundreds of millions of requests/day. Cluster Redis for higher scale. ## TLS The gateway terminates TLS. Behind Fly.io, the platform issues certs automatically. For sovereign deployments, bring your own certs via: ```toml [gateway.tls] cert_file = "/etc/map/tls/fullchain.pem" key_file = "/etc/map/tls/privkey.pem" ``` ## Observability stack | Signal | Target | Format | | --- | --- | --- | | Logs | stdout/stderr | structured tracing (JSON) | | Metrics | `:9091/metrics` | Prometheus exposition | | Traces | OTLP exporter | OpenTelemetry | | Audit | PostgreSQL (via `MAX`) | hash-chained rows | The default observability stack we run alongside MAP: - **Loki** for log aggregation - **Prometheus** for metrics scrape - **Tempo** for traces - **Grafana** for dashboards (pre-built dashboards in `ops/grafana/`) See [Observability](/docs/observability) for what each protocol emits. ## Scaling A single-VM deployment handles ~3-5k req/s at p50 < 5ms. To scale beyond that: 1. **Scale the gateway** horizontally — it's stateless behind a load balancer 2. **Scale the engine** horizontally — Redis-backed rate limit makes this safe 3. **Scale heavy agents** independently — `MARC`, `MAGI`, `MACE` typically warrant their own clusters with GPUs 4. **Partition the audit chain** by tenant for write throughput The audit chain itself is the eventual bottleneck for write-heavy workloads. The hash-chained design serializes writes per-tenant; cross-tenant throughput scales linearly. ## Sovereign deployment For air-gapped or on-prem: the same Dockerfiles plus: - Disable `MAP_OTEL_ENDPOINT` (no outbound telemetry) - Configure the OAS resolver to use a local registry mirror - Use a self-hosted CA for TLS (engines accept the chain via `MAP_TLS_CA`) - Pin Wasmtime version (`MAP_WASMTIME_VERSION` already set) For full sovereign deployment guidance — including key custody, audit-chain off-site storage, multi-region replication — see the Sovereign tier onboarding at `sovereign@l1fe.ai`. ## Health checks The engine exposes: ``` GET /health → 200 OK if accepting requests GET /ready → 200 OK if all upstreams healthy GET /metrics → Prometheus exposition (port 9091 by default) ``` `/ready` returns 503 during startup, during the shutdown grace period (30s default), and when any of these are unhealthy: database, redis, plugin loader. ## Graceful shutdown The engine handles `SIGTERM`: 1. Stop accepting new requests (gateway returns 503) 2. Drain in-flight requests (30s grace period) 3. Flush audit pipeline (synchronous) 4. Disconnect from database / redis 5. Exit Plugin unload happens in step 4 — Wasmtime instances are dropped cleanly. ## See also - [Engine architecture](/docs/engine) - [Observability](/docs/observability) - [Security](/docs/security) - [Plugins](/docs/plugins) ================================================================================ # Engine # URL: https://docs.multiagentic.dev/docs/engine # The MAP engine — what dispatches requests, how protocols register, how middleware composes, how audit and metering thread through. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; The MAP engine is the Rust runtime that dispatches every protocol call. It lives in `engine/core/` and exposes a single, all-roads entry point: `MapEngine::handle_request`. ``` engine/ ├── common/ # Trait + types shared across crates │ ├── lib.rs # ProtocolModule trait, InvokeContext, Response, AuthContext │ └── identity.rs# ResolvedAgentIdentity, AgentEntityKind, ConformanceLevel ├── core/ │ ├── engine.rs # MapEngine, the 8-stage pipeline, SecurityGateway, AuditPipeline │ ├── router.rs # ProtocolRouter::invoke — caches modules, maps errors │ ├── plugins/ # Manifest, WASM loader (Wasmtime 37), native + HTTP adapters │ └── tests.rs # 716 lines of pipeline tests ├── identity/ # IdentityMiddleware::enrich + IdentityResolver trait ├── recipe/ # Recipe engine: typed DAGs with trust propagation └── observability/ # MOTET sinks, OTEL, structured tracing ``` ## What to read first ## Code-property guarantees The engine enforces a small set of properties at compile time: - `#![forbid(unsafe_code)]` — no `unsafe` blocks anywhere in the engine - `#![deny(clippy::unwrap_used)]` — no `unwrap()` in production paths - Feature-gated native vs WASM compilation (`native-adapter` vs `wasm-adapter`) - W3C Trace Context propagated through every `InvokeContext` - Hierarchical wildcard security model (`map.{protocol}.{operation}`) Tests live in `engine/core/src/tests.rs` (716 lines) and cover the full pipeline. 2,889 tests across 262 test files in the whole repo. ## Extensibility tiers Three tiers, ordered by performance and trust: | Tier | Mechanism | Latency overhead | When to choose | | --- | --- | --- | --- | | **Tier 1: Native** | Compiled into the binary as a Rust crate implementing `ProtocolModule` | None | First-party protocols; performance-critical paths | | **Tier 2: WASI** | Wasmtime 37 component-model plugins loaded at runtime | Moderate (sandboxed) | Third-party protocols; marketplace extensions | | **Tier 3: External** | HTTP-based; any language; any process | Higher (network hop) | Any service implementing the MAP invoke contract | See [Plugins](/docs/plugins) for manifest format, signing, and the hot-load lifecycle. ================================================================================ # Audit pipeline # URL: https://docs.multiagentic.dev/docs/engine/audit # AuditPipeline::record is the async writer behind every decision the engine makes. Event taxonomy, write semantics, downstream sinks. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `AuditPipeline` lives in `engine/core/src/engine.rs` (lines 68–165). It is non-blocking — every audit write is spawned as a Tokio task so it cannot affect request tail latency. ## `record` ```rust impl AuditPipeline { pub fn record(&self, event: &str, meta: &serde_json::Value); } ``` The first argument is the event-type tag (string). The pipeline maps it to an `AuditEventType` and forwards both to the bound sink: ```rust pub enum AuditEventType { ProtocolInvocation, CapabilityGrant, AuthorizationCheck, RateLimitExceeded, CircuitBreakerOpen, SecurityViolation, Error, } ``` If the string does not match a known type, it is logged as `AuditEventType::Error` and metric `audit_unknown_event` increments — never silently dropped. ## When the engine records The 8-stage pipeline writes to the audit pipeline at known points: | Trigger | Event type | Notes | | --- | --- | --- | | Stage 3 — rate limit refusal | `RateLimitExceeded` | Includes tenant, protocol, retry-after | | Stage 4 — capability denied | `SecurityViolation` | Includes requested capability, caller DID | | Stage 5 — circuit open | `CircuitBreakerOpen` | Includes protocol, endpoint, last failure | | Stage 7 — invocation success | `ProtocolInvocation` | Includes outcome=success, latency_ms | | Stage 7 — invocation failure | `Error` | Includes error string, latency_ms | | Stage 7 — successful capability check | `AuthorizationCheck` | Optional, on every grant (sampled in prod) | | MACS — fresh capability grant | `CapabilityGrant` | When a delegation, ACT, or treaty grants a new capability | Protocol modules can also `record` directly via `ctx.audit().record(...)`. Most do not — the engine records on their behalf at stage 8. ## Sinks The pipeline owns a `Box` and forwards every event to it. Production deployments bind `ProductionAuditLogger` (writes to structured tracing + Prometheus). Dev builds bind `MemoryAuditLogger` (in-process ring buffer for tests). ```rust #[async_trait] pub trait AuditLogger: Send + Sync { async fn log(&self, event: AuditEventType, meta: serde_json::Value) -> Result<(), AuditError>; } ``` Implementations include: - `ProductionAuditLogger` — emits to tracing + metrics + the hash-chained store (`MAX`) - `KafkaAuditLogger` — fans events out to Kafka for downstream consumers (feature-gated `kafka-sink`) - `MemoryAuditLogger` — in-memory ring; used by tests - `CompositeAuditLogger` — fan-out wrapper for multi-sink deployments ## Hash chaining via `MAX` The production sink chains every audit record into `MAX::audit_log_entry` so the resulting chain is verifiable end-to-end. The audit-chain head hash is returned in response metadata so clients can store it and later replay via `MAX::traceability_graph`. `MAX::traceability_graph` reconstructs the full graph for a correlation ID — every stage that fired, the resolved identity, the decision, the metric value, the response hash. This is what `MIMESIS` uses to surface precedent and what `MOOT` uses to reconstruct cases. ## Write semantics ```rust fn record(&self, event: &str, meta: &Value) { let event_type = parse_event_type(event); let meta = meta.clone(); let logger = self.logger.clone(); tokio::spawn(async move { if let Err(e) = logger.log(event_type, meta).await { tracing::warn!(error = %e, "audit log write failed"); } }); } ``` The implementation is fire-and-forget for the **fast path**. If the logger errors, the warning is traced but the request is not affected. The chain integrity is reconciled in the background by `MAX::compliance_report`. ## Backpressure When the underlying sink falls behind (e.g., Kafka unreachable), the production audit pipeline switches to a **disk-backed buffer** at `$MAP_AUDIT_BUFFER_DIR` (default `/var/lib/map/audit/`). The buffer is drained when the sink recovers. Buffer overflow triggers `RateLimited` at Stage 3 for all but `map.*.read` operations — the engine refuses to accept new state-changing work it cannot audit. ## Tests `engine/core/src/tests.rs::audit_pipeline_async` verifies: - writes never block the response path (`record` returns < 100µs) - failed writes log but do not panic - event-type parsing falls back to `Error` for unknown strings - the disk-backed buffer drains correctly after a simulated sink outage ## See also - [`MAX` protocol](/docs/protocols/max) — the hash-chained record itself - [Observability](/docs/observability) — traces, metrics, and the OTEL surface - [Governance — Refusal carries reasons](/docs/concepts/governance) ================================================================================ # handle_request # URL: https://docs.multiagentic.dev/docs/engine/handle-request # The canonical entry point. Full signature, input/output types, error model. ================================================================================ import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; import { Callout } from 'fumadocs-ui/components/callout'; Every dispatched call into MAP — from the CLI, the SDKs, the HTTP gateway, the MCP server — ultimately calls `MapEngine::handle_request`. It lives in `engine/core/src/engine.rs` and is the only public method on the engine type. ## Signature ```rust impl MapEngine { pub async fn handle_request( &self, input: HandleRequestInput, ) -> CoreResult; } ``` `CoreResult` is `Result` — the engine-level error type defined in the same module. ## `HandleRequestInput` From `engine/common/src/lib.rs`: ```rust #[derive(Clone, Debug, Serialize, Deserialize)] pub struct HandleRequestInput { /// Canonical protocol name (e.g. "MACS", "MIND") pub protocol: String, /// Semantic version requested. "v1.0.0" or "v1" for best-in-major. pub version: String, /// Operation name within the protocol (e.g. "auth_negotiation"). pub operation: String, /// JSON-serialized request payload. pub input: serde_json::Value, /// Organizational tenant scope. The caller's tenant must match /// or be on an active MOAT treaty with the target tenant. pub tenant_id: String, /// Pre-built context attached by the identity middleware. /// If absent, the engine builds a minimal context from the request. pub invoke_context: Option, } ``` The `invoke_context` field is populated upstream — typically by `services/gateway/` when a request arrives over HTTP, or by the CLI when running locally. If absent, the engine constructs a minimal context but cannot resolve the caller identity beyond the DID. ## `HandleRequestOutput` ```rust #[derive(Clone, Debug, Serialize, Deserialize)] pub struct HandleRequestOutput { pub output: serde_json::Value, } ``` The `output` field is the `Response::data` value returned by the protocol module. The `Response::metadata` field (if any) flows back through the audit pipeline but is **not** included in this output — callers retrieve metadata via `MAX::traceability_graph` keyed by the correlation ID. ## Error model: `CoreError` ```rust #[derive(thiserror::Error, Debug)] pub enum CoreError { #[error("unknown protocol: {0}")] UnknownProtocol(String), #[error("unknown version: {protocol} requested {version}")] UnknownVersion { protocol: String, version: String }, #[error("rate limited: retry after {retry_after:?}")] RateLimited { retry_after: std::time::Duration }, #[error("capability denied: {protocol}.{operation}")] CapabilityDenied { protocol: String, operation: String }, #[error("circuit open for {protocol}")] CircuitOpen { protocol: String }, #[error("no healthy endpoint for {0}")] NoEndpointAvailable(String), #[error("protocol error: {0}")] ProtocolError(#[from] map_common::ProtocolError), #[error("timeout after {0:?}")] Timeout(std::time::Duration), #[error("internal error: {0}")] Internal(String), } ``` `CoreError` is mapped to HTTP status codes by the gateway: | `CoreError` | HTTP | | --- | --- | | `UnknownProtocol` / `UnknownVersion` | 404 | | `RateLimited` | 429 (with `Retry-After`) | | `CapabilityDenied` | 403 | | `CircuitOpen` / `NoEndpointAvailable` | 503 | | `Timeout` | 504 | | `ProtocolError` | 422 if payload error, 502 if adapter, 500 otherwise | | `Internal` | 500 | ## Construction ```rust use map_core::{MapEngine, MapEngineBuilder}; use map_storage::ProductionStores; let engine = MapEngineBuilder::new() .protocol_registry(/* ... */) .router(/* ... */) .context_manager(/* ... */) .load_balancer(/* ... */) .security_gateway(/* ... */) .audit_pipeline(/* ... */) .rate_limiter(/* ... */) .build() .await?; ``` The engine is constructed once at service start. All fields are `Arc<...>` so the engine is `Clone` and cheap to share across worker tasks. ## Calling ```rust use map_core::{HandleRequestInput}; use serde_json::json; let resp = engine.handle_request(HandleRequestInput { protocol: "MACS".into(), version: "v1.0.0".into(), operation: "auth_negotiation".into(), input: json!({ "profile": "DidAuth", "challenge_kind": "Nonce" }), tenant_id: "org_acme".into(), invoke_context: Some(my_ctx), }).await?; ``` ```rust use map_sdk::Client; let client = Client::from_env()?; let resp = client .dispatch("MACS", "v1.0.0", "auth_negotiation", json!({ "profile": "DidAuth", "challenge_kind": "Nonce" })) .await?; ``` ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: did:oas:l1fe:agent:0xa3f... Content-Type: application/json { "protocol": "MACS", "version": "v1.0.0", "operation": "auth_negotiation", "input": { "profile": "DidAuth", "challenge_kind": "Nonce" }, "tenant_id": "org_acme" } ``` ## Tests The engine entry point has full coverage in `engine/core/src/tests.rs` (716 lines). Notable test groups: - `pipeline_stages` — validates each of the 8 stages independently and in sequence - `rate_limiter_behavior` — token bucket exhaustion, refill, multi-tenant isolation - `security_gating` — hierarchical wildcard matching (exact / protocol-wildcard / global-wildcard) - `circuit_breaker` — CLOSED → OPEN → HALF_OPEN transitions with backoff - `audit_pipeline_async` — confirms audit writes never block the response Run them locally: `cargo test -p map-core` from the workspace root. ================================================================================ # Middleware # URL: https://docs.multiagentic.dev/docs/engine/middleware # IdentityMiddleware::enrich runs before MapEngine::handle_request and attaches the resolved caller identity to the invocation context. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `IdentityMiddleware` lives in `engine/identity/src/middleware.rs`. It is the only middleware MAP runs **before** `MapEngine::handle_request`. Everything else — rate limiting, security gating, audit — is internal to the engine. ## What it does ```rust pub struct IdentityMiddleware { resolver: Arc, } impl IdentityMiddleware { pub async fn enrich(&self, mut ctx: InvokeContext) -> InvokeContext { let outcome = self.resolver.resolve(&ctx.agent_did).await; ctx.resolved_identity = Some(match outcome { ResolveOutcome::Resolved(id) => id, ResolveOutcome::Partial { identity, .. } => identity, ResolveOutcome::Failed { did, .. } => ResolvedAgentIdentity::unresolved(&did), }); ctx } } ``` The middleware **never raises**. If resolution fails, the request still flows into the engine with an `unresolved` identity and will typically be denied at Stage 4 (Security Gating). ## `IdentityResolver` trait ```rust #[async_trait] pub trait IdentityResolver: Send + Sync { async fn resolve(&self, did: &str) -> ResolveOutcome; } ``` This is the plugin point. Production deployments wire `OasResolver` (from the `protocols/oas-lib` adapter) — but the resolver is intentionally pluggable to support local dev (`LocalAdminResolver` returns `ResolvedAgentIdentity::local_admin()` for every DID) and offline modes. ## `ResolveOutcome` ```rust pub enum ResolveOutcome { /// Full resolution: identity document, lineage walked, signatures verified. Resolved(ResolvedAgentIdentity), /// Partial: identity returned but with warnings (stale, lineage unverified, etc.). /// The engine still treats the identity as valid; warnings are recorded for review. Partial { identity: ResolvedAgentIdentity, warnings: Vec }, /// Resolution failed entirely. The fallback `unresolved` identity is used. Failed { did: String, error: String }, } ``` `Partial` is common during MOAT treaty negotiation, when a counterparty's DID is reachable but their lineage proofs haven't yet been replicated locally. The request goes through, but a `LineageUnverified` event is recorded. ## Where it sits in the request flow ``` HTTP gateway ├─ parse Authorization header → agent_did ├─ parse trace context → traceparent / tracestate ↓ IdentityMiddleware::enrich ├─ resolver.resolve(agent_did) ↓ MapEngine::handle_request ├─ Stage 1: Version Resolution ├─ Stage 2: Context Enrichment (adds correlation_id, tenant, timestamp) ├─ Stage 3: Rate Limiting ├─ Stage 4: Security Gating (reads resolved_identity.capabilities) ├─ ... ``` `InvokeContext::resolved_identity` is `Option` so the engine type does not change between gateway and CLI ingress paths. The CLI runs `IdentityMiddleware::enrich` locally before sending the call to the engine, using the stored `agent_did` from `~/.map/config.json`. The same flow applies; only the resolver is different (CLI uses `OasResolver` against the cached registry; gateway uses the hot OAS resolver bound to `MARS`). ## Reading the identity in a protocol module ```rust async fn invoke( &self, operation: &str, payload: Value, ctx: &InvokeContext, ) -> Result { let id = ctx.identity().ok_or(ProtocolError::PolicyDenied { reason: "unresolved identity".into() })?; if !ctx.caller_lineage_verified() { return Err(ProtocolError::PolicyDenied { reason: "lineage must be verified for this operation".into() }); } if !id.has_capability(&format!("map.{}.{}", self.protocol_name().to_lowercase(), operation)) { return Err(ProtocolError::MissingCapability( format!("map.{}.{}", self.protocol_name().to_lowercase(), operation) )); } // ... normal logic } ``` Most protocol crates use the helper `common_auth::reject_payload_tenant_mismatch(ctx, &payload)?` to enforce the basic tenant binding before any work. See `engine/common/src/auth.rs`. ## See also - [`ResolvedAgentIdentity`](/docs/engine/types#resolvedagentidentity) — the data structure populated here - [MACS](/docs/protocols/macs) — the protocol that does the upstream signature verification - [OAS adapter](/docs/protocols/oas) — the default `IdentityResolver` implementation ================================================================================ # Pipeline # URL: https://docs.multiagentic.dev/docs/engine/pipeline # Every request crosses the same eight stages on the way in. Each stage with its Rust module, type signatures, and p50 cost. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Steps, Step } from 'fumadocs-ui/components/steps'; `MapEngine::handle_request` in `engine/core/src/engine.rs` (lines 1117–1267) executes eight ordered stages for every request. Refusal at any stage produces a structured response with the same audit weight as success. ## Pipeline at a glance | # | Stage | Rust module | Failure mode | | --- | --- | --- | --- | | 1 | Version Resolution | `ProtocolRegistry::best_version` | `CoreError::UnknownProtocol` / `UnknownVersion` | | 2 | Context Enrichment | `ContextManager::new_request_context` | rarely fails; always advances | | 3 | Rate Limiting | `ProductionRateLimiter::check_rate_limit` | `RateLimited` (event recorded) | | 4 | Security Gating | `SecurityGateway::is_operation_allowed` | `CapabilityDenied` (event recorded) | | 5 | Circuit Breaking | `ProductionLoadBalancer::is_available` | `CircuitOpen` (event recorded) | | 6 | Load Balancing | `ProductionLoadBalancer::select_endpoint` | `NoEndpointAvailable` | | 7 | Router Invocation | `ProtocolRouter::invoke` → `ProtocolModule::invoke` | `ProtocolError → CoreError` (mapped) | | 8 | Result Handling | `AuditPipeline::record` + metric emission | non-blocking; never breaks the response | The full pipeline runs in roughly 3–5ms p50 on a warm cluster, plus the variable cost of stage 7 (the protocol module itself). ## Stages in detail ### Stage 1 — Version Resolution ```rust let input = self.protocol_registry.best_version(&input).await?; ``` `ProtocolRegistry::best_version` accepts a `HandleRequestInput` and resolves to the best installed version of the named protocol — exact match if a specific version was requested, otherwise the highest stable version registered. The registry caches resolutions in an `Arc>>`. If the protocol is not registered, `CoreError::UnknownProtocol(name)` is returned. If a specific version was requested but is not installed, `CoreError::UnknownVersion(name, version)`. ### Stage 2 — Context Enrichment ```rust let _ctx = self.context_manager.new_request_context(&input.tenant_id); ``` `ContextManager` attaches: - a unique `correlation_id` (UUID v4) - the `tenant_id` from the request - the request timestamp (RFC3339) - the `TraceContext` (W3C: `traceparent`, `tracestate`) - a metadata map seeded with the caller DID This is **separate** from `InvokeContext` populated by the identity middleware, which already attached the resolved identity before `handle_request` was called. ### Stage 3 — Rate Limiting ```rust self.rate_limiter .check_rate_limit(&input.tenant_id, &input.protocol, &input.operation) .await?; ``` `ProductionRateLimiter` uses a per-tenant token bucket with operation-specific multipliers. Buckets are persisted (typically Redis) so rates survive engine restarts. Heavy agents (`MARC`, `MACE`, `MAGI`) have lower bucket capacity than infrastructure protocols (`MOMENT`, `MOTET`). A refused request records a `RateLimitExceeded` event via `AuditPipeline` and returns `CoreError::RateLimited { retry_after: Duration }`. ### Stage 4 — Security Gating ```rust let tenant_caps = self.security_gateway.tenant_capabilities(&input.tenant_id).await?; if !self.security_gateway.is_operation_allowed(&tenant_caps, &input.protocol, &input.operation) { return Err(CoreError::CapabilityDenied { protocol, operation }); } ``` `SecurityGateway::is_operation_allowed` walks capabilities hierarchically: 1. Exact match: `map.{protocol}.{operation}` (e.g. `map.macs.auth_negotiation`) 2. Protocol wildcard: `map.{protocol}.*` 3. Global wildcard: `map.*.*` (reserved for ops/admin tenants) Any match grants. No match denies. A denied request records a `SecurityViolation` event with the requested capability. ### Stage 5 — Circuit Breaking ```rust if !self.load_balancer.is_available(&input.protocol).await { return Err(CoreError::CircuitOpen { protocol }); } ``` `ProductionLoadBalancer::is_available` returns `false` when the per-protocol circuit breaker is `Open` (too many recent failures) or `HalfOpen` (probing). The breaker is per-protocol-per-endpoint and uses the standard CLOSED → OPEN → HALF_OPEN state machine with exponential backoff. A blocked request records a `CircuitBreakerOpen` event. ### Stage 6 — Load Balancing ```rust let endpoint = self.load_balancer.select_endpoint(&input.protocol).await?; ``` For protocols with multiple healthy endpoints (typically the agent protocols), `select_endpoint` returns the next endpoint according to the configured strategy (round-robin, weighted least-request, or hash-by-tenant). For first-party native protocols compiled into the binary, this collapses to a singleton "local" endpoint. ### Stage 7 — Router Invocation ```rust let response = self.router.invoke( &input.protocol, Some(&input.version), &input.operation, input.input, &ctx, ).await?; ``` `ProtocolRouter::invoke` looks up the registered `ProtocolModule` for `protocol:version`, caches it in an `LruCache>` (capacity 1024), and calls: ```rust module.invoke(operation, payload, &ctx).await ``` The module returns `Result`. The router maps `ProtocolError` to `CoreError` via heuristic on the error message — keywords like `adapter`, `timeout`, `invalid` route to specific `CoreError` variants for downstream callers to handle uniformly. This is the only stage with variable latency. The other seven add up to a few milliseconds. ### Stage 8 — Result Handling ```rust self.audit_pipeline.record( "ProtocolInvocation", &json!({ "protocol": input.protocol, "operation": input.operation, "tenant": input.tenant_id, "outcome": outcome, "latency_ms": elapsed, }) ); self.metrics.emit_invocation(&input.protocol, &input.operation, outcome, elapsed); return Ok(HandleRequestOutput { output: response.data }); ``` `AuditPipeline::record` is non-blocking — it spawns the actual write as a task so it never affects the request's tail latency. The event taxonomy is `ProtocolInvocation | CapabilityGrant | AuthorizationCheck | RateLimitExceeded | CircuitBreakerOpen | SecurityViolation | Error`. Metrics are emitted via the bound `MetricsBackend` (Prometheus by default), tagged with protocol, operation, outcome, and quantized latency buckets. ## Identity middleware: before stage 1 `IdentityMiddleware::enrich` (in `engine/identity/src/middleware.rs`) runs **before** `MapEngine::handle_request`. It takes the inbound `agent_did` from the HTTP gateway, calls the bound `IdentityResolver::resolve`, and attaches the result to `InvokeContext::resolved_identity` so every downstream stage can read it. Three outcomes: ```rust pub enum ResolveOutcome { Resolved(ResolvedAgentIdentity), Partial { identity: ResolvedAgentIdentity, warnings: Vec }, Failed { did: String, error: String }, } ``` `Failed` falls back to `ResolvedAgentIdentity::unresolved(did)` so requests are not silently dropped — they pass into the pipeline with an unresolved identity and are typically denied at Stage 4 (Security Gating) for lacking the required capability. ## Tail of the pipeline Once stages 1–8 complete, the response flows back through the gateway, with: - The `traceparent` header propagated for downstream tracing - The audit-chain head hash returned in the response metadata - Rate-limit headers (`X-RateLimit-*`) for client back-off The audit head you receive in the response metadata is verifiable against the chain via `MAX::traceability_graph`. This is how `MIMESIS` reconstructs precedent and how `MOOT` reconstructs cases. ================================================================================ # Recipe engine # URL: https://docs.multiagentic.dev/docs/engine/recipe # Typed DAG composition with trust propagation, governance gates, and durable execution. Status — scaffolded. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; The recipe engine in `engine/recipe/` is MAP's typed DAG runner. A **recipe** is a content-addressed, versioned workflow built from `RecipeStep`s with explicit data flow, audit checkpoints, and governance gates. The executor propagates a confidence score through the DAG so the institution can reason about the trustworthiness of a composite result. The recipe engine is **scaffolded**. The `Recipe`, `RecipeStep`, and `Executor` types are defined and most of the executor logic compiles, but the wiring to a `POST /v1/recipe/run` daemon endpoint is Phase 1B work. Use direct protocol dispatch in production today. ## Core types ```rust pub struct Recipe { pub id: String, // content-addressed hash pub version: String, pub steps: Vec, // execution DAG pub audit_checkpoints: Vec, pub governance_gates: Vec, } pub enum RecipeStep { Protocol { protocol: String, operation: String, payload: serde_json::Value, depends_on: Vec, }, Gate { condition: BoolExpr, on_true: StepAction, on_false: StepAction, }, Audit { event_type: String, metadata: serde_json::Value, }, SubRecipe { recipe_id: String, params: serde_json::Value, }, Parallel { steps: Vec, }, } ``` ## `StepResult` and trust propagation ```rust pub struct StepResult { pub data: serde_json::Value, pub metadata: StepMetadata, pub confidence_score: f32, // [0.0, 1.0] pub execution_time_ms: u64, pub error: Option, } ``` Each step emits a `StepResult` with a confidence score. The executor composes scores along the DAG: - **Sequential composition** — weakest-link: `min(scores)` - **Parallel composition** — voting: weighted geometric mean - **Retry decay** — every retry multiplies the score by `1 - retry_penalty` (default `0.05`) - **Skip penalty** — a skipped optional step contributes `0.95 × parent_score` This is intentionally simple. Recipe authors who need richer aggregation can register a custom `ConfidenceFn` on the executor. ## Validation Before execution, the recipe is validated: - Topological sort via Kahn's algorithm - Cycle detection (`depends_on` cannot form a cycle) - Schema check on every step's `payload` against the target protocol's request schema - Capability check — caller must hold capabilities for every protocol referenced - Gate condition type-check — `BoolExpr` must be evaluable with the available bindings Validation errors surface as `RecipeError::Validation { step, reason }` before any step executes. ## Compilation strategies A recipe can be authored in three ways: | Strategy | Latency | When | | --- | --- | --- | | **Template matching** | sub-ms | When the workflow matches a pre-registered recipe template | | **Hybrid seed** | ~50ms | User supplies a skeleton; LLM fills only the gaps | | **LLM generation** | 100–500ms | Free-form intent → full recipe via Tier 2 routing | LLM compilation is gated by the `recipe-llm-compile` capability and is metered through `MEAL` (tokens dimension) like any other agent call. ## Audit + governance ```rust pub struct AuditPoint { pub step_id: String, pub event_type: String, // routed to AuditPipeline pub include_step_io: bool, } pub struct GovernanceGate { pub at_step: String, pub kind: GateKind, // MAXIM, MACE-quorum, MOAT-treaty pub on_pass: GateAction, pub on_fail: GateAction, // Abort | Continue | Escalate(MOOT) } ``` Every recipe step audited to `MAX` via the standard pipeline; gates fire additional `AuthorizationCheck` events with the gate kind. ## Default recipes The repo ships with four reference patterns in `DEFAULT_RECIPES.md`: 1. **Grounded Response** — retrieve from `MIND` → reason with `MARC` → verify via `MAVEN` → audit to `MAX` 2. **Policy Decision** — collect evidence via `MAVEN` → deliberate via `MACE` → consult `MAXIM` → enforce 3. **Service Transaction** — advertise on `MARKET` → negotiate via `MANA` → settle via `MADE` 4. **Agent Deployment** — bootstrap identity via `MACS` → register on `MARS` → submit manifest to `MOON` See [Recipes](/docs/recipes) for the full set. ## Executor ```rust pub struct Executor { engine: Arc, confidence_fn: Box, /// Cached durable journal for replay. journal: Arc, } impl Executor { pub async fn run(&self, recipe: Recipe, params: Value, ctx: InvokeContext) -> Result; pub async fn resume(&self, run_id: &str, ctx: InvokeContext) -> Result; } ``` The journal allows recipes to resume after engine restarts — the same durability guarantee `MOON` provides for raw workflows, but at the recipe layer. ## See also - [Recipes](/docs/recipes) — the four default recipes spelled out - [MAESTRO](/docs/protocols/maestro) — plan / refine / commit / replan surface - [MOON](/docs/protocols/moon) — durable workflow primitive underneath ================================================================================ # Router # URL: https://docs.multiagentic.dev/docs/engine/router # How the engine looks up a protocol module, caches it, and maps protocol errors to engine errors. ================================================================================ `ProtocolRouter` lives in `engine/core/src/router.rs` (177 lines). It owns the runtime registry of `Arc` instances and dispatches stage 7 of the pipeline. ## Signature ```rust impl ProtocolRouter { pub async fn invoke( &self, protocol: &str, version: Option<&str>, operation: &str, input: serde_json::Value, ctx: &InvokeContext, ) -> CoreResult; } ``` It returns the unwrapped `Response::data`. `Response::metadata` is recorded to the audit pipeline before this returns. ## Lookup ```rust let resolved_version = match version { Some(v) => self.registry.exact(protocol, v).await?, None => self.registry.best_version(protocol).await?, }; let module = self.module_cache .get_or_insert(format!("{}:{}", protocol, resolved_version), || { self.registry.module(protocol, &resolved_version) }); module.invoke(operation, input, ctx).await ``` The cache is `LruCache>` with capacity `NonZeroUsize::new(1024).unwrap()`. Modules are reference-counted, so eviction is safe — outstanding invocations keep the `Arc` alive past eviction. ## Error mapping `ProtocolModule::invoke` returns `Result`. The router maps the protocol-level error into the engine-level `CoreError` using simple substring heuristics on the error message: ```rust fn map_error(err: ProtocolError) -> CoreError { let msg = err.to_string(); let lower = msg.to_lowercase(); if lower.contains("adapter") { return CoreError::Internal(msg); } if lower.contains("timeout") { return CoreError::Timeout(std::time::Duration::from_secs(30)); } if lower.contains("invalid") { return CoreError::ProtocolError(err); } if lower.contains("missing capability") { return CoreError::CapabilityDenied { /* ... */ }; } CoreError::ProtocolError(err) } ``` This is intentionally simple. Protocols are expected to return structured `ProtocolError` variants and let the router classify them — not every protocol cares about every error class. ## Best-version discovery `ProtocolRegistry::best_version` selects the **highest stable** version registered. Pre-release versions (`v1.2.3-rc1`) are skipped unless a tenant has the `map.{protocol}.pre-release` capability. If multiple versions are deployed (canary rollout), the registry routes a percentage of traffic by tenant hash. ## Concurrency `ProtocolRouter` is `Clone + Send + Sync`. The engine holds a single `Arc` and reuses it across all worker tasks. The LRU cache is wrapped in an `RwLock` for write-on-miss; reads are lock-free via `DashMap` for the version registry. ## Tests `engine/core/src/tests.rs` covers: - module cache hit/miss semantics - best-version selection under canary configuration - error mapping from each `ProtocolError` variant - concurrent invocation against the same module (no double-init) ## See also - [Pipeline](/docs/engine/pipeline) — context in the 8-stage flow - [Plugins](/docs/plugins) — how new modules register ================================================================================ # Tests # URL: https://docs.multiagentic.dev/docs/engine/tests # 262 test files, 2,889 tests. Where to find them, what they cover, how to run them. ================================================================================ The MAP repo holds 2,889 tests across 262 test files. The engine itself has 716 lines of test in `engine/core/src/tests.rs` covering the full 8-stage pipeline. ## Where tests live | Path | Test count (approx.) | Coverage | | --- | --- | --- | | `engine/core/src/tests.rs` | 716 lines | Pipeline stages, rate limiter, security gate, circuit breaker, load balancer, audit pipeline | | `engine/common/tests/` | per-type unit tests | `InvokeContext` helpers, `ResolvedAgentIdentity` semantics | | `engine/identity/tests/` | resolver tests | Middleware enrichment, `ResolveOutcome` fallbacks | | `engine/recipe/tests/` | DAG validation | Topological sort, cycle detection, confidence propagation | | `protocols/*/tests/` | per-protocol unit + integration | 1,500+ tests across all 30 implemented protocols | | `services/gateway/tests/` | HTTP ingress | Auth header parsing, trace propagation, error mapping | | `services/mcp/tests/` | MCP server | Tool listing, tool execution, stdio + SSE transports | | `tests/` (workspace root) | end-to-end | Cross-protocol flows, recipe execution, audit replay | ## Running ```bash # Everything cargo test --workspace --all-features # Just the engine cargo test -p map-core # A specific protocol cargo test -p mind-lib # With logs RUST_LOG=debug cargo test -p map-core -- --nocapture ``` ## Feature-gated tests Some test groups run only under specific features: ```bash # Native adapter (default for prod) cargo test --features native-adapter # WASM adapter (excludes tokio rt-multi-thread) cargo test --features wasm-adapter --no-default-features # Production storage (postgres + redis) cargo test --features production-storage ``` ## Key test groups in `engine/core/src/tests.rs` - `pipeline_stages` — each stage in isolation, then in sequence - `rate_limiter_behavior` — token bucket exhaustion, refill, multi-tenant isolation - `security_gating` — hierarchical wildcard matching across all three levels - `circuit_breaker` — full CLOSED → OPEN → HALF_OPEN cycle with backoff - `load_balancer_failover` — endpoint selection under partial failure - `audit_pipeline_async` — non-blocking writes, sink failure, disk-backed buffer drain - `router_lru_semantics` — cache hit/miss, eviction safety with outstanding invocations - `error_mapping` — `ProtocolError` → `CoreError` for every variant ## Property-based tests The audit chain integrity tests use `proptest`: - Inserting N random events and replaying produces an identical chain head - Concurrent inserts from M tasks produce a consistent chain regardless of ordering - A truncation followed by replay restores the same chain head ## Continuous integration CI runs: 1. `cargo fmt --check` 2. `cargo clippy --workspace --all-features -- -D warnings -W clippy::unwrap_used` 3. `cargo test --workspace --all-features --no-fail-fast` 4. `cargo bench -p mind-lib` (regression checks) 5. WASM build: `cargo build --features wasm-adapter --no-default-features` 6. Docker build of `Dockerfile.mim` (sanity check on the deploy variant) A failing clippy lint blocks merge — particularly `clippy::unwrap_used` since the codebase forbids `unwrap()` in production paths. ================================================================================ # Types # URL: https://docs.multiagentic.dev/docs/engine/types # ProtocolModule trait, InvokeContext, ResolvedAgentIdentity, Response, ProtocolError — quoted from the Rust source. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; The MAP engine defines a small, deliberately stable set of types in `engine/common/`. Everything else builds on these. ## `ProtocolModule` trait ```rust use async_trait::async_trait; use serde_json::Value; #[async_trait] pub trait ProtocolModule: Send + Sync { /// Canonical protocol name. Static string for fast comparison. fn protocol_name(&self) -> &'static str; /// Semantic version of this implementation. fn version(&self) -> &'static str; /// All operations this module supports. fn operations(&self) -> Vec<&'static str>; /// Dispatch a single operation. async fn invoke( &self, operation: &str, payload: Value, ctx: &InvokeContext, ) -> Result; } ``` Every protocol crate in `protocols/*-lib` implements this trait. Tier-2 WASI plugins implement it via `wit-bindgen` and the Wasmtime 37 component model. Tier-3 external HTTP protocols are wrapped by `RemoteProtocolModule` in `engine/core/src/external.rs`. ## `InvokeContext` ```rust #[derive(Clone, Debug, Serialize, Deserialize)] pub struct InvokeContext { /// UUID v4. Threaded through the entire request flow. pub correlation_id: String, /// Organizational tenant scope for the call. pub tenant_id: String, /// Caller DID (did:oas:...). pub agent_did: String, /// Filled by IdentityMiddleware::enrich before handle_request. pub resolved_identity: Option, /// W3C Trace Context — traceparent + tracestate. pub trace_context: Option, /// RFC3339 timestamp at the gateway ingress. pub timestamp: String, /// Free-form metadata map. Plugins read their config from here. pub metadata: HashMap, } ``` ### Helpers on `InvokeContext` ```rust impl InvokeContext { pub fn identity(&self) -> Option<&ResolvedAgentIdentity>; pub fn caller_entity_kind(&self) -> AgentEntityKind; pub fn caller_human_root(&self) -> Option<&str>; pub fn caller_lineage_verified(&self) -> bool; pub fn plugin_config(&self) -> Option<&Value>; } ``` Use these instead of poking at the fields directly — `identity()` returns `None` if the resolver failed, and `caller_lineage_verified()` quietly returns `false` for unresolved callers. ## `Response` ```rust #[derive(Clone, Debug, Serialize, Deserialize)] pub struct Response { pub data: Value, pub metadata: Option>, } ``` Every protocol returns this. The engine extracts `data` into `HandleRequestOutput::output`; `metadata` flows through the audit pipeline. ## `ProtocolError` ```rust #[derive(thiserror::Error, Debug)] pub enum ProtocolError { #[error("unknown operation: {0}")] UnknownOperation(String), #[error("invalid payload: {0}")] InvalidPayload(String), #[error("capability missing: {0}")] MissingCapability(String), #[error("policy denied: {reason}")] PolicyDenied { reason: String }, #[error("adapter error: {0}")] AdapterError(String), #[error("timeout")] Timeout, #[error("internal: {0}")] Internal(String), } ``` `ProtocolError` is mapped to `CoreError` by `ProtocolRouter::invoke` using simple heuristics on the error message (looking for `adapter`, `timeout`, `invalid`). See [Router](/docs/engine/router) for the mapping. ## `ResolvedAgentIdentity` The identity record attached by `IdentityMiddleware::enrich`. Defined in `engine/common/src/identity.rs`: ```rust #[derive(Clone, Debug, Serialize, Deserialize)] pub struct ResolvedAgentIdentity { pub did: String, pub entity_kind: AgentEntityKind, pub name: Option, pub human_root_did: Option, pub lineage_depth: u32, pub lineage_verified: bool, pub creator_did: Option, pub conformance_level: ConformanceLevel, pub capabilities: Vec, pub service_endpoints: Vec, pub revoked: bool, pub auth_method: String, pub extended: HashMap, } ``` ### `AgentEntityKind` ```rust pub enum AgentEntityKind { HumanRoot, MultiHumanRoot, EntityNameRecord, Agent, AgentInstance, Tool, Skill, Workflow, Model, Dataset, Service, Unknown(String), } ``` The first three are *root* kinds — every other agent's lineage must terminate at a root. `Unknown(String)` exists for forward-compatibility with new entity kinds in OAS. ### `ConformanceLevel` ```rust pub enum ConformanceLevel { L0, // minimal: DID exists, no lineage L1, // standard: lineage verified for non-roots L2, // enhanced: full extended sections, attestations, reputation } ``` Most production calls require L1. Tier-2 capabilities (cross-org settlement, governance ratification) may require L2. ### Helpers ```rust impl ResolvedAgentIdentity { pub fn is_human_root(&self) -> bool; pub fn is_autonomous_org(&self) -> bool; pub fn has_verified_lineage(&self) -> bool; pub fn effective_root_did(&self) -> &str; pub fn has_capability(&self, name: &str) -> bool; pub fn local_admin() -> Self; // dev only pub fn unresolved(did: &str) -> Self; // fallback when resolution fails } ``` `ResolvedAgentIdentity::local_admin()` exists for **dev-mode** only. It returns an identity with full wildcard capabilities and lineage_verified = true. The production gateway never returns it; production tenants are configured with explicit capability sets. ## `AgentCapability` ```rust #[derive(Clone, Debug, Serialize, Deserialize)] pub struct AgentCapability { /// Hierarchical capability name. e.g. "map.macs.auth_negotiation" /// or "map.mind.*" for protocol-wildcard. pub name: String, /// Optional time-bound expiry. pub expires_at: Option>, /// Spending / rate ceiling specific to this capability. pub limits: Option, /// Caveats — additional constraints (jurisdiction, time-of-day, etc.). pub caveats: Vec, } ``` The `SecurityGateway` matches `name` hierarchically: exact match first, then protocol-wildcard (`map.{protocol}.*`), then global-wildcard (`map.*.*`). ## `AgentServiceEndpoint` ```rust #[derive(Clone, Debug, Serialize, Deserialize)] pub struct AgentServiceEndpoint { pub kind: String, // "did-auth" | "mcp" | "a2a" | ... pub url: String, pub protocols: Vec, } ``` Used for callbacks during multi-stage auth flows and for cross-organization discovery via `MARS::discovery`. ## See also - [`MapEngine::handle_request`](/docs/engine/handle-request) — entry point - [Router](/docs/engine/router) — how `ProtocolRouter` dispatches and caches modules - [Middleware](/docs/engine/middleware) — how `ResolvedAgentIdentity` gets populated ================================================================================ # Governance ops # URL: https://docs.multiagentic.dev/docs/governance # Treaty management, policy authoring, council convening, dispute filing — the operations-side of the governance plane. ================================================================================ This is the operations companion to [Concepts → Governance](/docs/concepts/governance). It covers how to actually run governance flows day-to-day. ## Treaty management ### Propose a new treaty ```bash map invoke MOAT propose --input "$(cat <<'EOF' { "counterparty_did": "did:oas:globex:agent:0x...", "capability_schedule": [ { "capability": "map.mind.recall_memory", "caveats": ["jurisdiction:us"] }, { "capability": "map.maven.cite" } ], "rate_limits": { "per_hour": 1000 }, "settlement_terms": { "rail": "x402", "currency": "USDC", "clearing_fee_bps": 25 }, "dispute_clause": "moot://shared", "expires_at": "2026-12-31T23:59:59Z" } EOF )" ``` ### Sign Signing requires `MACE` quorum at the charter level (typical) or a delegated `moat.sign` capability. Two-step: ```bash # Round 1: convene map invoke MACE convene --input '{ "motion": "ratify treaty treaty_abc123", "quorum": "supermajority", "deadline_ms": 3600000 }' # Round 2: deliberate (each delegate) map invoke MACE deliberate --input '{ "motion_id": "...", "position": "yea", "reasoning": "Treaty terms acceptable; counterparty has MERIT score 87." }' # Round 3: tally + sign map invoke MOAT sign --input '{ "treaty_id": "treaty_abc123" }' ``` ### Terminate ```bash map invoke MOAT terminate --input '{ "treaty_id": "treaty_abc123", "reason": "Counterparty rate violations during Q1; see MOOT case moot_def456." }' ``` Termination is **immediate**. Wind-down for outstanding obligations is handled separately via `MAUSOLEUM`. ## Policy authoring ```bash map invoke MAXIM author --input '{ "policy_id": "ops.market_size_cap", "policy_body": "permit (principal, action == Action::\"map.market.execute_trade\", resource) when { resource.size_usd < 100000 };", "version": "v1.0.0", "active_from": "2026-06-01T00:00:00Z" }' ``` Policy authorship typically requires `MACE` ratification before activation. The engine refuses to activate a policy whose `policy_body` doesn't pass the schema check or whose `active_from` is in the past. ## Council convening ```bash map invoke MACE convene --input '{ "motion": "approve sovereign deployment for Acme", "composition_rules": { "min_delegates": 5, "must_include_did": ["did:oas:l1fe:charter:0x..."] }, "quorum": "supermajority", "deadline_ms": 86400000 }' ``` Each delegate then `deliberate`s, dissent is preserved, `tally` produces the verdict. ## Dispute filing ```bash map invoke MOOT file --input '{ "respondent_did": "did:oas:globex:agent:0x...", "claim": "Globex exceeded treaty rate limits 17 times in Q1", "evidence": ["max://record/0x...", "max://record/0x..."], "requested_remedy": { "kind": "compensation", "amount_usd": 12000 } }' ``` The respondent has a treaty-specified window to `plead`. The case proceeds through `MOOT::hear` → `MOOT::rule`. Damages settle through `MADE`. ## Precedent surfacing ```bash map invoke MIMESIS surface --input '{ "window_days": 90, "min_recurrences": 3, "scope": "map.market.*" }' # Returns recurring patterns the institution has been doing ``` If a pattern looks like settled custom, propose formalization: ```bash map invoke MIMESIS formalize --input '{ "pattern_id": "...", "proposed_maxim": "Trades > $100k require MACE quorum", "proposal_target": "MAXIM" }' ``` ## Dissolution ```bash map invoke MAUSOLEUM initiate --input '{ "charter_authority": "max://record/0xcharter...", "reason": "Restructuring under new charter", "schedule": { "asset_distribution": { ... }, "obligation_transfer": { ... }, "successor_did": "did:oas:newco:charter:0x..." } }' ``` This kicks off the full wind-down: assets distributed via `MADE::economic_contract_settle`, obligations transferred under `MOOT` supervision, audit chain sealed via `MAUSOLEUM::seal`, final hash published to `MARS`. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Concepts → Treaties](/docs/concepts/treaties) - [`MOAT`](/docs/protocols/moat) - [`MAXIM`](/docs/protocols/maxim) - [`MACE`](/docs/protocols/mace) - [`MOOT`](/docs/protocols/moot) - [`MIMESIS`](/docs/protocols/mimesis) - [`MAUSOLEUM`](/docs/protocols/mausoleum) ================================================================================ # MCP # URL: https://docs.multiagentic.dev/docs/mcp # Every MAP protocol is exposed as an MCP tool. Stdio and SSE transports. Four tool categories. ================================================================================ import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; import { Callout } from 'fumadocs-ui/components/callout'; MAP runs an MCP (Model Context Protocol) server at `services/mcp/`. Every protocol operation is exposed as a callable tool. Any MCP-compliant agent — Claude, ChatGPT with MCP support, custom MCP clients — can call MAP's full surface. ## How tools are named Every MAP operation maps to an MCP tool with the canonical name: ``` map.. ``` Examples: | MCP tool | MAP dispatch | | --- | --- | | `map.macs.auth_negotiation` | `MACS::auth_negotiation` | | `map.mind.recall_memory` | `MIND::recall_memory` | | `map.marc.reasoning_task` | `MARC::reasoning_task` | | `map.max.audit_query` | `MAX::audit_query` | | `map.maker.execute_action` | `MAKER::execute_action` | The tool name is matched on the MCP host side; the engine routes by parsing the protocol and operation back out. ## Tool categories MAP groups tools into four MCP categories so agents can scope discovery: | Category | Protocols included | | --- | --- | | `map-cognitive` | MIND, MARC, MAVEN, MAGE, MEAL, MANTLE, MARE, MAME, MARI | | `map-governance` | MOAT, MERIT, MACE, MAXIM, MOOT, MIMESIS, MAUSOLEUM | | `map-commerce` | MARKET, MANA, MADE, MAT | | `map-infrastructure` | MIM, MAX, MACS, MARS, MOON, MAESTRO, MOTE, MAZE, MATA, MAKER | A consumer agent can list only the categories it needs: ```bash map mcp list --category map-cognitive ``` ## Transports Two transports are supported: - **stdio** — for local agent processes (Claude Desktop, Cursor, custom hosts) - **SSE** — for remote / network-attached agents ### stdio (Claude Desktop) Configure your client's MCP server file (typically `claude_desktop_config.json`): ```json { "mcpServers": { "map": { "command": "map", "args": ["mcp", "serve", "--transport", "stdio"] } } } ``` The CLI handles authentication using the stored config at `~/.map/config.json`. The MCP server forwards every tool call through the standard dispatch pipeline — same auth, same capability check, same audit chain. ### SSE (network) ```bash # Start the MCP server on port 8601 with SSE transport map mcp serve --transport sse --port 8601 ``` Then point your MCP host at `http://localhost:8601`. For production, run behind a reverse proxy with TLS. ## Tool schema Every MCP tool exposes a JSON schema for its input. The schema is the same JSON Schema that `MAP::schemas` ships for the wire protocol — see [Schemas](/docs/schemas). Example for `map.marc.reasoning_task`: ```json { "name": "map.marc.reasoning_task", "description": "Submit a bounded reasoning task to MARC. Returns a derivation tree, citations, and confidence band.", "inputSchema": { "type": "object", "required": ["intent", "budget"], "properties": { "intent": { "type": "string", "description": "Natural-language statement of the reasoning intent" }, "premises": { "type": "array", "items": { "type": "string" } }, "world_model_snapshot": { "type": "string", "pattern": "^mind://snapshot/" }, "budget": { "type": "object", "required": ["tokens", "deadline_ms"], "properties": { "tokens": { "type": "integer", "minimum": 1, "maximum": 1000000 }, "deadline_ms": { "type": "integer", "minimum": 100, "maximum": 600000 } } }, "return_fields": { "type": "array", "items": { "type": "string", "enum": ["derivation", "citations", "confidence", "alternatives"] } } } } } ``` ## Identity flow When an MCP host calls a MAP tool, the MCP server: 1. Reads the host's session 2. Resolves the host's MAP identity (from the CLI config in stdio mode, or from the SSE session in network mode) 3. Builds an `InvokeContext` with the resolved identity 4. Runs the standard 8-stage pipeline Cross-host calls require a `MOAT` treaty between the host's organization and the target. The MCP server does not bypass any engine policy. ## Tool categories vs. protocol planes The MCP categories don't perfectly match the [seven planes](/docs/concepts/planes). They are deliberately coarser — designed for **agent consumption** rather than internal taxonomy. An agent doesn't usually care that `MAVEN` is Truth and `MAX` is Awareness; it cares that both are "informational" tools it can call to retrieve facts and records. | MCP category | Planes it draws from | | --- | --- | | `map-cognitive` | II (Cognition) + III (Truth, partial) + VII (Awareness, partial) | | `map-governance` | III (Truth, partial) + IV (Governance) | | `map-commerce` | VI (Economic) + V (Execution, MAT) | | `map-infrastructure` | I (Identity) + V (Execution, partial) + VII (Awareness, partial) | ## Discovering tools as an agent ```ts import { MCPClient } from '@modelcontextprotocol/sdk'; const mcp = new MCPClient({ transport: 'stdio', command: 'map', args: ['mcp', 'serve'] }); await mcp.connect(); const allTools = await mcp.listTools(); console.log(allTools.tools.filter(t => t.name.startsWith('map.marc.'))); ``` Or with the CLI: ```bash map mcp list --json | jq '.tools[] | select(.category=="map-cognitive") | .name' ``` ## Calling tools as an agent The agent passes a normal JSON payload; the MCP server dispatches through the engine; the response data is returned to the agent. ```ts const result = await mcp.callTool({ name: 'map.marc.reasoning_task', arguments: { intent: 'is the treaty enforceable?', budget: { tokens: 8000, deadline_ms: 12000 } } }); console.log(result.content); // [{ type: 'text', text: JSON.stringify({verdict: "...", derivation: "marc://tree/0x71b..." }) }] ``` ## Audit through MCP Every MCP-originated call is audited the same way as a direct dispatch — same `MAX::audit_log_entry`, same `MOTET::emit`, same metric counters. From the institution's perspective, MCP is just another transport. The audit record includes an `origin: mcp` field so you can later filter for MCP-originated activity. Useful for monitoring agent fleets. ## Source The MCP server lives in `/Volumes/L1feAI/l1feosx/map/services/mcp/` and is composed of seven modules: `server`, `categories`, `tool_gen`, `transport_stdio`, `transport_sse`, `auth_bridge`, `error_map`. Tool listings are generated at startup from the registered `ProtocolModule`s plus their JSON schemas. ## See also - [Protocols registry](/docs/protocols) - [CLI](/docs/cli) - [Schemas](/docs/schemas) - [For Agents](/docs/agents/consumption) — patterns for consuming MAP via MCP ================================================================================ # Metering ops # URL: https://docs.multiagentic.dev/docs/metering # How to read your MEAL statements, set MANA budgets, configure throttle policy, run reconciliation. ================================================================================ Companion to [Concepts → Metering](/docs/concepts/metering). This page covers the operations side. ## Read a statement ```bash map invoke MEAL statement --input '{ "tenant_id": "org_acme", "period": { "from": "2026-05-01T00:00:00Z", "to": "2026-05-31T23:59:59Z" }, "include_breakdown": true, "group_by": ["protocol", "operation"] }' ``` Returns the metered events grouped by protocol and operation, with totals per dimension. ```json { "tenant_id": "org_acme", "period": { "from": "...", "to": "..." }, "totals": { "tokens": 18_432_100, "seconds": 84_320.7, "watts_kWh": 312.4, "amount_usd": 4_812.55 }, "by_protocol": [ { "protocol": "MARC", "tokens": 14_200_000, "seconds": 28_400.2, "watts_kWh": 240.1, "amount_usd": 3_180.45 }, { "protocol": "MIND", "tokens": 3_120_500, "seconds": 18_320.4, "watts_kWh": 18.2, "amount_usd": 820.10 }, { "protocol": "MAX", "tokens": 0, "seconds": 38_200.1, "watts_kWh": 2.1, "amount_usd": 811.00 }, { "protocol": "...", "...": "..." } ], "settlement_status": "current", "next_invoice_at": "2026-06-01T00:00:00Z" } ``` ## Set a budget ```bash map invoke MANA allocate --input '{ "envelope": { "department": "research", "max_per_month_usd": 5000, "max_per_day_usd": 250 }, "capabilities_granted": [ "map.marc.reasoning_task", "map.mari.inquire", "map.maven.cite", "map.mind.recall_memory" ], "authority": "max://record/0xcharter..." }' ``` `MANA` then enforces the envelope at Stage 5 of the pipeline. Calls that would exceed the per-day or per-month cap are refused with `PolicyDenied { reason: "runway exhausted" }`. ## Throttle policy When runway compresses, `MANA::throttle` reduces non-essential rate-limit buckets: ```bash map invoke MANA throttle --input '{ "envelope_id": "...", "rules": [ { "match": "map.mind.recall_memory", "factor": 0.5 }, { "match": "map.marc.*", "factor": 0.25 }, { "match": "map.max.audit_query", "factor": 1.0 } ] }' ``` Read operations on `MAX` are deliberately untouched — the institution can always read its own history. ## Emergency hold ```bash map invoke MANA hold --input '{ "reason": "Anomalous spend detected — see motet trace abc", "scope": "tenant", "until": "manual_release" }' ``` Multi-sig revocable via `MACE` quorum. All non-essential operations refuse until released. ## Reconciliation `MEAL::reconcile` runs nightly. To run on-demand: ```bash map invoke MEAL reconcile --input '{ "period": { "from": "2026-05-01T00:00:00Z", "to": "2026-05-31T23:59:59Z" } }' ``` Asserts that ``` sum(tenant_debits) = sum(merchant_credits) + sum(audit_records) ``` Any drift produces an `Unbalanced` event recorded to `MAX` and routes to ops. Drift is almost always benign (timezone window edge cases) but worth surfacing. ## Settlement For cross-org settlement (the **fourth metered dimension** at the rate-card level), `MADE` clears via the configured rail. Configure rails per tenant: ```bash map invoke MADE asset_definition_publish --input '{ "asset_id": "settlement-usdc-x402", "kind": "currency", "rail": "x402", "denomination": "USDC", "settlement_finality_seconds": 3 }' ``` Settlement runs in the background; the audit chain records both the metered event (in MEAL) and the settled payment (in MADE). `MEAL::reconcile` cross-checks. ## Rate-card overrides Per-tenant overrides on the published rate card (for Sovereign tier or special arrangements): ```bash map invoke MEAL admin_set_rate --input '{ "tenant_id": "org_acme", "overrides": { "tokens_per_million_usd": 2.50, # default $3.00 "seconds_per_million_usd": 15.00, # default $18.00 "watts_per_kwh_usd": 0.36 # default $0.42 }, "effective_from": "2026-06-01T00:00:00Z", "authority": "max://record/0xcontract..." }' ``` Requires `map.meal.admin` capability. Overrides are recorded to `MAX`; the next invoice picks them up. ## Per-operation metering details | Protocol::operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `MAX::audit_log_entry` | 0 | yes | 0 | | `MAX::audit_query` | 0 | yes | 0 | | `MIND::store_memory` | 0 | yes | `<0.001 kWh` | | `MIND::recall_memory` | 0 | yes | `<0.001 kWh` | | `MIND::fusion_request` | yes (agent path) | yes | yes | | `MARC::reasoning_task` | yes | yes | yes (multiplier 1.2×) | | `MAVEN::attest` | yes (multiplier 0.8×) | yes | yes | | `MACE::deliberate` | yes (multiplier 1.5× per delegate) | yes | yes | | `MAGI::trace` | yes | yes (multiplier 2×) | yes (multiplier 4×) | | `MOON::execute_workflow` | per-step | yes | per-step | | `MIM::message_send` | 0 | yes | 0 | Heavyweight agents (`MARC`, `MACE`, `MAGI`) typically dominate consumption. Most protocols meter on seconds only. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Pricing & rate card](https://multiagentic.dev/pricing) - [`MEAL`](/docs/protocols/meal) - [`MANA`](/docs/protocols/mana) - [`MADE`](/docs/protocols/made) ================================================================================ # Observability # URL: https://docs.multiagentic.dev/docs/observability # Three streams — logs, metrics, traces — plus the audit chain. W3C Trace Context throughout. OpenTelemetry-native. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; MAP is **observability-native**. Every request emits four signals; every signal is correlatable. Logs, metrics, traces, and the audit chain share a `correlation_id` and propagate `traceparent` end-to-end. ## The four signals | Signal | Engine emitter | Target | | --- | --- | --- | | Logs | `tracing` crate via `tracing-subscriber` | stdout / Loki | | Metrics | `metrics` crate via Prometheus exporter | `:9091/metrics` | | Traces | OpenTelemetry → OTLP exporter | Tempo / Honeycomb / etc. | | Audit | `AuditPipeline::record` → `MAX::audit_log_entry` | PostgreSQL chain | ## Logs Structured JSON via the `tracing` crate. Every log line carries: ```json { "ts": "2026-05-20T14:23:45.123Z", "level": "INFO", "target": "map_core::engine", "message": "request dispatched", "correlation_id": "4f81b3a-...", "tenant_id": "org_acme", "protocol": "MARC", "operation": "reasoning_task", "stage": "router_invocation", "latency_ms": 1247, "traceparent": "00-..." } ``` Configure level via `RUST_LOG`: ``` RUST_LOG=info,map_core=debug,hyper=warn ``` In production we run `RUST_LOG=info` and let trace level dynamic-control via `/admin/trace` (gated by `map.admin.observability`). ## Metrics Prometheus exposition at `:9091/metrics`. Cardinality is bounded by quantizing latency and labeling only by `tenant`, `protocol`, `operation`, `outcome`. ### Core metrics ``` # Request counts (counter) map_requests_total{tenant, protocol, operation, outcome} # Latency histogram (histogram) map_request_duration_seconds_bucket{tenant, protocol, operation, outcome, le} map_request_duration_seconds_sum{...} map_request_duration_seconds_count{...} # Pipeline stage timing (histogram per stage) map_stage_duration_seconds_bucket{stage, le} # Refusal counters map_refusals_total{stage, reason} map_rate_limited_total{tenant, protocol} map_capability_denied_total{tenant, protocol, operation} map_circuit_open_total{protocol} # MEAL dimensions (counter) map_tokens_consumed_total{tenant, protocol, dimension} map_seconds_consumed_total{tenant, protocol} map_watts_consumed_total{tenant, protocol} # Audit pipeline map_audit_writes_total{event_type, outcome} map_audit_buffer_bytes map_audit_chain_head_age_seconds # Plugin lifecycle map_plugins_registered map_plugins_pending map_plugins_disabled map_plugins_error ``` ### Pre-built dashboards The repo ships Grafana dashboards in `ops/grafana/`: - `map-overview.json` — request rate, latency, refusal rate by protocol - `map-pipeline.json` — per-stage latency breakdown - `map-tenants.json` — top tenants by consumption, runway, refusals - `map-economics.json` — `MEAL` dimensions per tenant, `MADE` settlement volume - `map-audit.json` — chain head, write rate, buffer health - `map-plugins.json` — plugin states, load/unload events ## Traces OpenTelemetry-native. Each request is a root span. Each pipeline stage is a child span. Each downstream protocol invocation (when one protocol calls another) is a nested span. ``` [handle_request] ↑ duration: 1247ms ├ [stage: version_resolution] < 1ms ├ [stage: context_enrichment] < 1ms ├ [stage: rate_limiting] < 1ms ├ [stage: security_gating] < 1ms ├ [stage: circuit_breaking] < 1ms ├ [stage: load_balancing] < 1ms ├ [stage: router_invocation] 1240ms │ └ [protocol: MARC, op: reasoning_task] 1240ms │ ├ [protocol: MIND, op: query_knowledge] 24ms │ ├ [protocol: MAVEN, op: attest] 128ms │ └ [llm_call: gpt-4] 980ms └ [stage: result_handling] 2ms ``` Configure the OTLP exporter: ``` MAP_OTEL_ENDPOINT=http://otel-collector.observability:4317 ``` The OTLP exporter is built into the engine via `opentelemetry-otlp`. No sidecar required. ## Audit chain The fourth signal. Every decision — allow, refuse, or error — produces a hash-chained record via `MAX`. See [Concepts → Audit](/docs/concepts/audit) and [MAX protocol](/docs/protocols/max). Audit is **structurally distinct** from the other three signals: | Property | Logs/Metrics/Traces | Audit | | --- | --- | --- | | Retention | Hours-to-days typical | Years (legal hold typical) | | Integrity | Best-effort | Hash-chained, signed | | Replayable | No | Yes (full replay) | | Tamper-evident | No | Yes (chain head verification) | You can lose all your logs and still reconstruct the institution's complete history from the audit chain. The audit chain is the **constitutional record**. ## Correlation across signals Every signal carries the same `correlation_id`. Recommended ergonomic chain: 1. Alert fires from a Grafana metric (e.g. `map_capability_denied_total > 100/min`) 2. Click through to a Loki log query filtered by `tenant + outcome=refused` 3. Pull the `correlation_id` from a representative log line 4. Open the trace in Tempo (one click in Grafana) 5. Click through to `MAX::traceability_graph` for the audit chain of the same request The audit-chain head hash is in every response and every log; you can verify chain integrity independently. ## OTel semantic conventions MAP follows OTel semantic conventions plus MAP-specific attributes: ``` service.name = "map-engine" service.version = "0.6.x" # Per-span map.protocol = "MARC" map.operation = "reasoning_task" map.tenant_id = "org_acme" map.outcome = "success" | "refused" | "error" map.refusal_reason = "..." # only on refusals map.audit_head = "0x..." # the chain head produced ``` ## Sampling The engine implements head-based sampling at the gateway: ``` MAP_TRACE_SAMPLE_RATE=0.01 # 1% of requests MAP_TRACE_ALWAYS_ON=["map.macs.*", "map.moot.*"] # 100% for governance ops MAP_TRACE_ALWAYS_ERROR=true # 100% of errors regardless of sample rate ``` Refusals and errors are always sampled. State-changing operations on governance protocols are always sampled. Read-heavy protocols default to 1%. ## Reading metrics inside a protocol module ```rust use metrics::{counter, histogram}; async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { let start = std::time::Instant::now(); let result = /* ... */; histogram!("map_protocol_internal_duration_seconds", "protocol" => self.protocol_name(), "operation" => op ).record(start.elapsed().as_secs_f64()); counter!("map_protocol_internal_op_total", "protocol" => self.protocol_name(), "operation" => op, "outcome" => if result.is_ok() { "ok" } else { "err" } ).increment(1); result } ``` Most protocols rely on the engine's automatic instrumentation at Stage 8. Custom metrics are useful for protocols with multi-step internal flows (e.g., `MACE` records per-delegate timing during deliberation). ## See also - [Deployment](/docs/deployment) — running the stack - [Engine audit pipeline](/docs/engine/audit) - [`MAX` protocol](/docs/protocols/max) - [`MOTET` protocol](/docs/protocols/motet) - [`MOMENT` protocol](/docs/protocols/moment) ================================================================================ # Plugins # URL: https://docs.multiagentic.dev/docs/plugins # Three tiers of protocol extension. Manifest format, signing, hot-load lifecycle. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; MAP's three-tier extensibility model lets the institution add new protocols without recompiling. Three tiers, ordered by performance and trust. | Tier | Mechanism | Latency overhead | Trust level | | --- | --- | --- | --- | | **Tier 1: Native** | Compiled Rust crate implementing `ProtocolModule` | None | First-party (compiled into engine) | | **Tier 2: WASI** | Wasmtime 37 component-model plugin loaded at runtime | Moderate (sandboxed) | Third-party with signature verification | | **Tier 3: External HTTP** | Remote process implementing the MAP invoke contract | Higher (network hop) | Treaty-bound or local | ## Tier 1 — Native The reference path. A native protocol is a Rust crate in `protocols/-lib/` that implements: ```rust #[async_trait] impl ProtocolModule for MyProtocol { fn protocol_name(&self) -> &'static str { "MYPROTOCOL" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec!["my_op"] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { /* ... */ } } ``` The crate is registered in the engine's static module table at startup. Latency is minimal — no IPC, no serialization across boundaries. Use Tier 1 for first-party protocols that ship with the engine binary. ## Tier 2 — WASI A WASI plugin is a `.wasm` file built against the MAP plugin ABI. The engine loads it through Wasmtime 37 (component model + WASIP2). The plugin runs in a sandboxed memory space; it can only call the host functions exposed by the engine. ### Manifest Every WASI plugin ships with a `plugin.toml`: ```toml [plugin] name = "myorg-myprotocol" version = "0.1.0" description = "Custom analytics protocol for Acme" plugin_type = "Protocol" # or "Gateway", "Extension" protocol = "MYPROTOCOL" # which MAP protocol slot this implements [plugin.binary] source_type = "wasm" path = "./myorg_myprotocol.wasm" [plugin.metadata] author = "did:oas:acme:agent:0x..." license = "Commercial" min_map_version = "0.6.0" [plugin.operations] operations = ["analyze", "summarize", "report"] [plugin.integrations] # Optional LLM / DB / vector store dependencies the plugin needs llm = { kind = "openai-compat", endpoint = "https://api.openai.com/v1" } ``` ### Loading Plugins are discovered at startup by scanning a configured directory: ```toml # map-engine config [plugins] directory = "/var/lib/map/plugins" auto_discover = true allowed_sources = ["wasm", "builtin"] watch_interval_ms = 5000 require_signatures = true trusted_publishers = [ "did:oas:l1fe:agent:0x...", "did:oas:acme:agent:0x..." ] ``` When `auto_discover = true`, the engine scans `directory` every `watch_interval_ms` for new manifests. New plugins enter `PluginState::Pending`, then `Registered` after the engine validates the manifest, verifies the signature, and successfully loads the WASM. ### State machine ``` Pending → Registered → (Disabled | Error) ``` | State | Meaning | | --- | --- | | Pending | Discovered; not yet loaded | | Registered | Loaded; serving requests | | Disabled | Deliberately turned off via admin command | | Error | Load or runtime failure; reason recorded | The engine exposes `MarsAdmin::plugin_status(name)` for ops queries. ### Signing If `require_signatures = true`, every plugin manifest must carry an Ed25519 signature from one of the `trusted_publishers`. The engine verifies the signature against the published OAS DID document before loading. ```toml [plugin.signature] signed_by = "did:oas:acme:agent:0x..." signature = "ed25519:0x..." signed_at = "2026-05-01T00:00:00Z" ``` Unsigned or invalidly-signed manifests stay in `Pending` indefinitely and emit a `PluginRejected` audit event. ### Building a WASI plugin ```bash # In a Rust crate using plugin-sdk: cargo build --release --target wasm32-wasip2 # Bundle for distribution cp target/wasm32-wasip2/release/my_plugin.wasm dist/ cp plugin.toml dist/ mv dist my-plugin-v0.1.0/ tar czf my-plugin-v0.1.0.tar.gz my-plugin-v0.1.0/ ``` Deploy by dropping the unpacked plugin directory into `/var/lib/map/plugins/`. ## Tier 3 — External HTTP For any service implementing the MAP invoke contract over HTTP. Useful when the protocol is written in a language without a WASI target, or when the protocol calls heavyweight backends (large GPUs, proprietary engines). ### The contract ```rust #[async_trait] pub trait RemoteProtocolAdapter: Send + Sync { async fn invoke(&self, req: RemoteProtocolRequest) -> Result; async fn health_check(&self) -> Result; } ``` The external service implements: ``` POST /invoke GET /health ``` Request: ```json POST /invoke HTTP/2 Content-Type: application/json X-MAP-Protocol: MYPROTOCOL X-MAP-Operation: analyze X-MAP-Correlation-Id: ... { "operation": "analyze", "payload": { ... }, "ctx": { /* serialized InvokeContext */ } } ``` Response (success): ```json HTTP/2 200 OK Content-Type: application/json { "data": { ... }, "metadata": { ... } } ``` Response (error): ```json HTTP/2 422 Unprocessable Entity { "error": { "code": "invalid_payload", "message": "field 'subject' is required" } } ``` Health: ```json GET /health → 200 OK { "status": "healthy", "version": "1.0.0", "uptime_seconds": 12345 } ``` ### Registration External adapters are registered explicitly in engine config: ```toml [[external_protocols]] name = "MYPROTOCOL" version = "v1.0.0" endpoint = "https://my-protocol.svc.cluster.local:8080" timeout = "30s" operations = ["analyze", "summarize"] auth = { kind = "did-auth", did = "did:oas:l1fe:service:my-protocol-0x..." } ``` The engine treats it like any other protocol — dispatches through the standard pipeline, audits to `MAX`, meters via `MEAL`. ### Health & circuit breaker Health probes run every 10s. Three consecutive failures open the circuit breaker for the endpoint; new requests fail fast with `CoreError::CircuitOpen` until probes recover. ## Tier comparison | Property | Tier 1 (Native) | Tier 2 (WASI) | Tier 3 (External) | | --- | --- | --- | --- | | Build artifact | Cargo crate | `.wasm` + manifest | Any HTTP service | | Language | Rust only | Anything compiled to WASIP2 | Any | | Latency overhead | None | ~50µs (sandbox call) | Network RTT | | Sandbox | None (compile-time safety) | Wasmtime memory sandbox | Process/network isolation | | Hot-load | Restart only | Yes (with watch_interval) | Yes (no restart needed) | | Trust requirement | Compiled in | Signed manifest | DID-Auth or treaty | | Audit through MAX | Yes | Yes | Yes | | Meter through MEAL | Yes | Yes | Yes | | State persistence | Engine's database | Engine-mediated KV | Service's own database | Most third-party protocols start at Tier 3 (HTTP) for fast iteration, migrate to Tier 2 (WASI) once stable for tighter sandbox + lower latency, and may be absorbed to Tier 1 (native) if the L1fe core picks them up. ## See also - [Engine plugin system](/docs/engine/index) - [Schemas](/docs/schemas) — what the plugin's `inputSchema` looks like - [Security](/docs/security) — plugin signing and trust ================================================================================ # Registry # URL: https://docs.multiagentic.dev/docs/protocols # All 35 MAP services across seven planes. Each protocol with its own deep sub-docset. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; MAP exposes **35 services** across **seven functional planes**. Three are external open standards (OAS, Arsenal, Aegis) MAP consumes as adapters; the other 32 are first-party crates in the `protocols/` workspace. Pick a protocol to jump into its sub-docs — every operation, the CLI recipes, the SDK calls, the request/response schemas, governance posture, metering profile, and internals. Every operation listed here is sourced from a structured audit of the actual codebase at `/Volumes/L1feAI/l1feosx/map/protocols`. If you find a method here that does not exist in the corresponding crate, file an issue at `map@l1fe.ai`. ### I — Identity *Who you are. What you may do.* ### II — Cognition *What you know. What you may reason about.* ### III — Truth *What is verified. What is trusted.* ### IV — Governance *How decisions are made. How they bind.* ### V — Execution *How work gets done. How it stays done.* ### VI — Economic *How value flows. How it settles.* ### VII — Awareness *How the institution sees itself.* ## Service-kind taxonomy - **Protocol** — stateless infrastructure. Routes, records, validates. No judgment. - **Agent** — itself an autonomous organization built on MAP. Reasons, deliberates, learns. - **Hybrid** — infrastructure by default; invokes an agent when ambiguity demands judgment. - **Adapter** — external open standard; MAP consumes through a thin adapter. See [Three Estates](/docs/concepts/estates). ================================================================================ # AEGIS # URL: https://docs.multiagentic.dev/docs/protocols/aegis # Verification · Delegation · Authorization · Challenge, response, delegation, key. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Challenge, response, delegation, key.** > > Challenge-response auth, HKDF/FROST/BIP-44 key management, delegation trees, multi-dimensional policy. | Field | Value | | --- | --- | | Acronym | `AEGIS` | | Full name | Verification · Delegation · Authorization | | Plane | I — Identity | | Kind | Adapter · External Standard | | City role | Notary public | | Crate | `external` | | Status | Implemented · production-grade. | ## What this is Challenge-response auth, HKDF/FROST/BIP-44 key management, delegation trees, multi-dimensional policy. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/aegis/cli # `map invoke AEGIS` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `AEGIS` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `challenge` ```bash map invoke AEGIS challenge --input '{"example":true}' ``` Issue a cryptographic challenge bound to a session and capability scope. Capability: `map.aegis.challenge` ### `delegate` ```bash map invoke AEGIS delegate --input '{"example":true}' ``` Create a delegation token under the no-amplification rule. Capability: `map.aegis.delegate` ### `policy` ```bash map invoke AEGIS policy --input '{"example":true}' ``` Evaluate a multi-dimensional policy: spending, temporal, lineage, jurisdictional. Capability: `map.aegis.policy` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/aegis/governance # Refusal posture, dissent preservation, audit footprint for AEGIS. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `AEGIS` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `AEGIS` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.aegis.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `AEGIS` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `AEGIS` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/aegis/internals # Crate path, key types, adjacent protocols for AEGIS. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `AEGIS` (Verification · Delegation · Authorization) lives in `external`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `external/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `external/src/protocol.rs` | core protocol logic | | `external/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `external/tests/` | unit + integration tests | | `schemas/aegis/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for AegisProtocol { fn protocol_name(&self) -> &'static str { "AEGIS" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "challenge", "delegate", "policy", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "challenge" => self.challenge(payload, ctx).await, "delegate" => self.delegate(payload, ctx).await, "policy" => self.policy(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mim-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/aegis/metering # How MEAL meters AEGIS operations. ================================================================================ Every call on `AEGIS` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `challenge` | 0 | yes | `<0.001 kWh` | | `delegate` | 0 | yes | `<0.001 kWh` | | `policy` | 0 | yes | `<0.001 kWh` | ## Rate card `AEGIS` is a **adapter** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `AEGIS` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `AEGIS`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/aegis/operations # Every operation on AEGIS. ================================================================================ The full operation table for `AEGIS`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `external` crate. ## Index | Operation | Summary | | --- | --- | | `challenge` | Issue a cryptographic challenge bound to a session and capability scope. | | `delegate` | Create a delegation token under the no-amplification rule. | | `policy` | Evaluate a multi-dimensional policy: spending, temporal, lineage, jurisdictional. | ## Reference ### `challenge` Issue a cryptographic challenge bound to a session and capability scope. | Field | Value | | --- | --- | | Capability | `map.aegis.challenge` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `delegate` Create a delegation token under the no-amplification rule. | Field | Value | | --- | --- | | Capability | `map.aegis.delegate` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `policy` Evaluate a multi-dimensional policy: spending, temporal, lineage, jurisdictional. | Field | Value | | --- | --- | | Capability | `map.aegis.policy` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/aegis/schemas # Request and response JSON schemas for AEGIS. ================================================================================ The OCIP contracts for `AEGIS` live in `/Volumes/L1feAI/l1feosx/map/schemas/aegis/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/aegis/v1/ ├── index.json ├── operations.challenge.request.json ├── operations.challenge.response.json ├── operations.delegate.request.json ├── operations.delegate.response.json ├── operations.policy.request.json ├── operations.policy.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `challenge` | `schemas/aegis/v1/operations.challenge.request.json` | `schemas/aegis/v1/operations.challenge.response.json` | | `delegate` | `schemas/aegis/v1/operations.delegate.request.json` | `schemas/aegis/v1/operations.delegate.response.json` | | `policy` | `schemas/aegis/v1/operations.policy.request.json` | `schemas/aegis/v1/operations.policy.response.json` | ## Published ```text https://schemas.multiagentic.dev/aegis/v1/operations..request.json https://schemas.multiagentic.dev/aegis/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/aegis/sdks # Rust, TypeScript and HTTP for AEGIS. ================================================================================ Every operation on `AEGIS` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "AEGIS", "v1.0.0", "challenge", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'AEGIS', version: 'v1.0.0', operation: 'challenge', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "AEGIS", "version": "v1.0.0", "operation": "challenge", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"challenge"` — Issue a cryptographic challenge bound to a session and capability scope. - `map.dispatch(...)` with operation `"delegate"` — Create a delegation token under the no-amplification rule. - `map.dispatch(...)` with operation `"policy"` — Evaluate a multi-dimensional policy: spending, temporal, lineage, jurisdictional. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # ARSENAL # URL: https://docs.multiagentic.dev/docs/protocols/arsenal # Agent Capability Tokens & Credential Proxy · Credentials never touch the agent. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Credentials never touch the agent.** > > Agent Capability Tokens (ACTs), 11-step proxy with SSRF guard, hash-chained audit, HITL consent. | Field | Value | | --- | --- | | Acronym | `ARSENAL` | | Full name | Agent Capability Tokens & Credential Proxy | | Plane | I — Identity | | Kind | Adapter · External Standard | | City role | Treasury vault | | Crate | `external` | | Status | Implemented · production-grade. | ## What this is Agent Capability Tokens (ACTs), 11-step proxy with SSRF guard, hash-chained audit, HITL consent. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/arsenal/cli # `map invoke ARSENAL` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `ARSENAL` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `issue` ```bash map invoke ARSENAL issue --input '{"example":true}' ``` Issue an ACT bound to caller, capability, and credential reference. Capability: `map.arsenal.issue` ### `proxy` ```bash map invoke ARSENAL proxy --input '{"example":true}' ``` Proxy an outbound HTTP call, substituting credentials at the wire under SSRF guards. Capability: `map.arsenal.proxy` ### `consent` ```bash map invoke ARSENAL consent --input '{"example":true}' ``` Request HITL consent for a new credential surface or sensitive invocation. Capability: `map.arsenal.consent` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/arsenal/governance # Refusal posture, dissent preservation, audit footprint for ARSENAL. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `ARSENAL` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `ARSENAL` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.arsenal.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `ARSENAL` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `ARSENAL` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/arsenal/internals # Crate path, key types, adjacent protocols for ARSENAL. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `ARSENAL` (Agent Capability Tokens & Credential Proxy) lives in `external`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `external/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `external/src/protocol.rs` | core protocol logic | | `external/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `external/tests/` | unit + integration tests | | `schemas/arsenal/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for ArsenalProtocol { fn protocol_name(&self) -> &'static str { "ARSENAL" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "issue", "proxy", "consent", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "issue" => self.issue(payload, ctx).await, "proxy" => self.proxy(payload, ctx).await, "consent" => self.consent(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mim-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/arsenal/metering # How MEAL meters ARSENAL operations. ================================================================================ Every call on `ARSENAL` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `issue` | 0 | yes | `<0.001 kWh` | | `proxy` | 0 | yes | `<0.001 kWh` | | `consent` | 0 | yes | `<0.001 kWh` | ## Rate card `ARSENAL` is a **adapter** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `ARSENAL` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `ARSENAL`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/arsenal/operations # Every operation on ARSENAL. ================================================================================ The full operation table for `ARSENAL`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `external` crate. ## Index | Operation | Summary | | --- | --- | | `issue` | Issue an ACT bound to caller, capability, and credential reference. | | `proxy` | Proxy an outbound HTTP call, substituting credentials at the wire under SSRF guards. | | `consent` | Request HITL consent for a new credential surface or sensitive invocation. | ## Reference ### `issue` Issue an ACT bound to caller, capability, and credential reference. | Field | Value | | --- | --- | | Capability | `map.arsenal.issue` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `proxy` Proxy an outbound HTTP call, substituting credentials at the wire under SSRF guards. | Field | Value | | --- | --- | | Capability | `map.arsenal.proxy` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `consent` Request HITL consent for a new credential surface or sensitive invocation. | Field | Value | | --- | --- | | Capability | `map.arsenal.consent` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/arsenal/schemas # Request and response JSON schemas for ARSENAL. ================================================================================ The OCIP contracts for `ARSENAL` live in `/Volumes/L1feAI/l1feosx/map/schemas/arsenal/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/arsenal/v1/ ├── index.json ├── operations.issue.request.json ├── operations.issue.response.json ├── operations.proxy.request.json ├── operations.proxy.response.json ├── operations.consent.request.json ├── operations.consent.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `issue` | `schemas/arsenal/v1/operations.issue.request.json` | `schemas/arsenal/v1/operations.issue.response.json` | | `proxy` | `schemas/arsenal/v1/operations.proxy.request.json` | `schemas/arsenal/v1/operations.proxy.response.json` | | `consent` | `schemas/arsenal/v1/operations.consent.request.json` | `schemas/arsenal/v1/operations.consent.response.json` | ## Published ```text https://schemas.multiagentic.dev/arsenal/v1/operations..request.json https://schemas.multiagentic.dev/arsenal/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/arsenal/sdks # Rust, TypeScript and HTTP for ARSENAL. ================================================================================ Every operation on `ARSENAL` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "ARSENAL", "v1.0.0", "issue", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'ARSENAL', version: 'v1.0.0', operation: 'issue', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "ARSENAL", "version": "v1.0.0", "operation": "issue", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"issue"` — Issue an ACT bound to caller, capability, and credential reference. - `map.dispatch(...)` with operation `"proxy"` — Proxy an outbound HTTP call, substituting credentials at the wire under SSRF guards. - `map.dispatch(...)` with operation `"consent"` — Request HITL consent for a new credential surface or sensitive invocation. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MACE # URL: https://docs.multiagentic.dev/docs/protocols/mace # Multi-Agentic Consensus Engine · Dissent on record. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Dissent on record.** > > Consensus voting (stateless). Quorum-driven deliberation. Heterogeneous councils with recorded reasoning. | Field | Value | | --- | --- | | Acronym | `MACE` | | Full name | Multi-Agentic Consensus Engine | | Plane | IV — Governance | | Kind | Agent · Autonomous Org | | City role | Assembly hall | | Crate | `protocols/mace-lib` | | Status | Implemented · production-grade. | ## What this is Consensus voting (stateless). Quorum-driven deliberation. Heterogeneous councils with recorded reasoning. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mace/cli # `map invoke MACE` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MACE` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `convene` ```bash map invoke MACE convene --input '{"example":true}' ``` Convene a council with declared composition, quorum, deadline. Capability: `map.mace.convene` ### `deliberate` ```bash map invoke MACE deliberate --input '{"example":true}' ``` Open the floor for structured argument; each delegate's reasoning recorded. Capability: `map.mace.deliberate` ### `tally` ```bash map invoke MACE tally --input '{"example":true}' ``` Tally votes, declare verdict; dissent filed alongside in the audit record. Capability: `map.mace.tally` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mace/governance # Refusal posture, dissent preservation, audit footprint for MACE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MACE` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MACE` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mace.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MACE` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MACE` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mace/internals # Crate path, key types, adjacent protocols for MACE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MACE` (Multi-Agentic Consensus Engine) lives in `protocols/mace-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mace-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mace-lib/src/protocol.rs` | core protocol logic | | `protocols/mace-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mace-lib/tests/` | unit + integration tests | | `schemas/mace/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MaceProtocol { fn protocol_name(&self) -> &'static str { "MACE" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "convene", "deliberate", "tally", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "convene" => self.convene(payload, ctx).await, "deliberate" => self.deliberate(payload, ctx).await, "tally" => self.tally(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mace-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mace/metering # How MEAL meters MACE operations. ================================================================================ Every call on `MACE` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `convene` | yes | yes | yes | | `deliberate` | yes | yes | yes | | `tally` | yes | yes | yes | ## Rate card `MACE` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MACE` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MACE`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mace/operations # Every operation on MACE. ================================================================================ The full operation table for `MACE`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mace-lib` crate. ## Index | Operation | Summary | | --- | --- | | `convene` | Convene a council with declared composition, quorum, deadline. | | `deliberate` | Open the floor for structured argument; each delegate's reasoning recorded. | | `tally` | Tally votes, declare verdict; dissent filed alongside in the audit record. | ## Reference ### `convene` Convene a council with declared composition, quorum, deadline. | Field | Value | | --- | --- | | Capability | `map.mace.convene` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `deliberate` Open the floor for structured argument; each delegate's reasoning recorded. | Field | Value | | --- | --- | | Capability | `map.mace.deliberate` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `tally` Tally votes, declare verdict; dissent filed alongside in the audit record. | Field | Value | | --- | --- | | Capability | `map.mace.tally` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mace/schemas # Request and response JSON schemas for MACE. ================================================================================ The OCIP contracts for `MACE` live in `/Volumes/L1feAI/l1feosx/map/schemas/mace/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mace/v1/ ├── index.json ├── operations.convene.request.json ├── operations.convene.response.json ├── operations.deliberate.request.json ├── operations.deliberate.response.json ├── operations.tally.request.json ├── operations.tally.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `convene` | `schemas/mace/v1/operations.convene.request.json` | `schemas/mace/v1/operations.convene.response.json` | | `deliberate` | `schemas/mace/v1/operations.deliberate.request.json` | `schemas/mace/v1/operations.deliberate.response.json` | | `tally` | `schemas/mace/v1/operations.tally.request.json` | `schemas/mace/v1/operations.tally.response.json` | ## Published ```text https://schemas.multiagentic.dev/mace/v1/operations..request.json https://schemas.multiagentic.dev/mace/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mace/sdks # Rust, TypeScript and HTTP for MACE. ================================================================================ Every operation on `MACE` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MACE", "v1.0.0", "convene", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MACE', version: 'v1.0.0', operation: 'convene', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MACE", "version": "v1.0.0", "operation": "convene", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"convene"` — Convene a council with declared composition, quorum, deadline. - `map.dispatch(...)` with operation `"deliberate"` — Open the floor for structured argument; each delegate's reasoning recorded. - `map.dispatch(...)` with operation `"tally"` — Tally votes, declare verdict; dissent filed alongside in the audit record. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MACS # URL: https://docs.multiagentic.dev/docs/protocols/macs # Multi-Agentic Access Control & Security · The single port of entry. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **The single port of entry.** > > Verifies signatures, resolves DIDs, derives capability sets, stamps every request MAP-verified. | Field | Value | | --- | --- | | Acronym | `MACS` | | Full name | Multi-Agentic Access Control & Security | | Plane | I — Identity | | Kind | Hybrid · Protocol + Agent | | City role | Key authority | | Crate | `protocols/macs-lib` | | Status | Implemented · production-grade. | ## What this is Verifies signatures, resolves DIDs, derives capability sets, stamps every request MAP-verified. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/macs/cli # `map invoke MACS` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MACS` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `auth_negotiation` ```bash map invoke MACS auth_negotiation --input '{"profile":"DidAuth","challenge_kind":"Nonce"}' ``` Negotiate an auth profile (DidAuth, Loopy, Zkp, OAuth2, BioagenticProfile) and produce a session descriptor. Capability: `map.macs.auth_negotiation` ### `generate_challenge` ```bash map invoke MACS generate_challenge --input '{"example":true}' ``` Emit a nonce, ZK challenge, or signature challenge bound to a session and profile. Capability: `map.macs.generate_challenge` ### `verify_response` ```bash map invoke MACS verify_response --input '{"example":true}' ``` Verify a challenge response. Returns a stamped MAP envelope on success; structured refusal on failure. Capability: `map.macs.verify_response` ### `authorization_request` ```bash map invoke MACS authorization_request --input '{"example":true}' ``` Evaluate a capability request against the policy bound to the verified identity. Capability: `map.macs.authorization_request` ### `credential_verification` ```bash map invoke MACS credential_verification --input '{"example":true}' ``` Verify presented claims (credential or attestation) against issuer signatures and revocation lists. Capability: `map.macs.credential_verification` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/macs/governance # Refusal posture, dissent preservation, audit footprint for MACS. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MACS` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MACS` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.macs.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MACS` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MACS` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/macs/internals # Crate path, key types, adjacent protocols for MACS. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MACS` (Multi-Agentic Access Control & Security) lives in `protocols/macs-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/macs-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/macs-lib/src/protocol.rs` | core protocol logic | | `protocols/macs-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/macs-lib/tests/` | unit + integration tests | | `schemas/macs/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MacsProtocol { fn protocol_name(&self) -> &'static str { "MACS" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "auth_negotiation", "generate_challenge", "verify_response", "authorization_request", "credential_verification", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "auth_negotiation" => self.auth_negotiation(payload, ctx).await, "generate_challenge" => self.generate_challenge(payload, ctx).await, "verify_response" => self.verify_response(payload, ctx).await, "authorization_request" => self.authorization_request(payload, ctx).await, "credential_verification" => self.credential_verification(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p macs-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/macs/metering # How MEAL meters MACS operations. ================================================================================ Every call on `MACS` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `auth_negotiation` | 0 | yes | `<0.001 kWh` | | `generate_challenge` | 0 | yes | `<0.001 kWh` | | `verify_response` | 0 | yes | `<0.001 kWh` | | `authorization_request` | 0 | yes | `<0.001 kWh` | | `credential_verification` | 0 | yes | `<0.001 kWh` | ## Rate card `MACS` is a **hybrid** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MACS` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MACS`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/macs/operations # Every operation on MACS. ================================================================================ The full operation table for `MACS`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/macs-lib` crate. ## Index | Operation | Summary | | --- | --- | | `auth_negotiation` | Negotiate an auth profile (DidAuth, Loopy, Zkp, OAuth2, BioagenticProfile) and produce a session descriptor. | | `generate_challenge` | Emit a nonce, ZK challenge, or signature challenge bound to a session and profile. | | `verify_response` | Verify a challenge response. Returns a stamped MAP envelope on success; structured refusal on failure. | | `authorization_request` | Evaluate a capability request against the policy bound to the verified identity. | | `credential_verification` | Verify presented claims (credential or attestation) against issuer signatures and revocation lists. | ## Reference ### `auth_negotiation` Negotiate an auth profile (DidAuth, Loopy, Zkp, OAuth2, BioagenticProfile) and produce a session descriptor. | Field | Value | | --- | --- | | Capability | `map.macs.auth_negotiation` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "profile": "DidAuth", "challenge_kind": "Nonce" } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `generate_challenge` Emit a nonce, ZK challenge, or signature challenge bound to a session and profile. | Field | Value | | --- | --- | | Capability | `map.macs.generate_challenge` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `verify_response` Verify a challenge response. Returns a stamped MAP envelope on success; structured refusal on failure. | Field | Value | | --- | --- | | Capability | `map.macs.verify_response` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `authorization_request` Evaluate a capability request against the policy bound to the verified identity. | Field | Value | | --- | --- | | Capability | `map.macs.authorization_request` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `credential_verification` Verify presented claims (credential or attestation) against issuer signatures and revocation lists. | Field | Value | | --- | --- | | Capability | `map.macs.credential_verification` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/macs/schemas # Request and response JSON schemas for MACS. ================================================================================ The OCIP contracts for `MACS` live in `/Volumes/L1feAI/l1feosx/map/schemas/macs/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/macs/v1/ ├── index.json ├── operations.auth_negotiation.request.json ├── operations.auth_negotiation.response.json ├── operations.generate_challenge.request.json ├── operations.generate_challenge.response.json ├── operations.verify_response.request.json ├── operations.verify_response.response.json ├── operations.authorization_request.request.json ├── operations.authorization_request.response.json ├── operations.credential_verification.request.json ├── operations.credential_verification.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `auth_negotiation` | `schemas/macs/v1/operations.auth_negotiation.request.json` | `schemas/macs/v1/operations.auth_negotiation.response.json` | | `generate_challenge` | `schemas/macs/v1/operations.generate_challenge.request.json` | `schemas/macs/v1/operations.generate_challenge.response.json` | | `verify_response` | `schemas/macs/v1/operations.verify_response.request.json` | `schemas/macs/v1/operations.verify_response.response.json` | | `authorization_request` | `schemas/macs/v1/operations.authorization_request.request.json` | `schemas/macs/v1/operations.authorization_request.response.json` | | `credential_verification` | `schemas/macs/v1/operations.credential_verification.request.json` | `schemas/macs/v1/operations.credential_verification.response.json` | ## Published ```text https://schemas.multiagentic.dev/macs/v1/operations..request.json https://schemas.multiagentic.dev/macs/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/macs/sdks # Rust, TypeScript and HTTP for MACS. ================================================================================ Every operation on `MACS` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MACS", "v1.0.0", "auth_negotiation", json!({ "profile": "DidAuth", "challenge_kind": "Nonce" }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MACS', version: 'v1.0.0', operation: 'auth_negotiation', input: { "profile": "DidAuth", "challenge_kind": "Nonce" } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MACS", "version": "v1.0.0", "operation": "auth_negotiation", "input": { "profile": "DidAuth", "challenge_kind": "Nonce" }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"auth_negotiation"` — Negotiate an auth profile (DidAuth, Loopy, Zkp, OAuth2, BioagenticProfile) and produce a session descriptor. - `map.dispatch(...)` with operation `"generate_challenge"` — Emit a nonce, ZK challenge, or signature challenge bound to a session and profile. - `map.dispatch(...)` with operation `"verify_response"` — Verify a challenge response. Returns a stamped MAP envelope on success; structured refusal on failure. - `map.dispatch(...)` with operation `"authorization_request"` — Evaluate a capability request against the policy bound to the verified identity. - `map.dispatch(...)` with operation `"credential_verification"` — Verify presented claims (credential or attestation) against issuer signatures and revocation lists. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MADE # URL: https://docs.multiagentic.dev/docs/protocols/made # Multi-Agentic Decentralized Economics · Settlement, witnessed. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Settlement, witnessed.** > > Decentralized economics. Asset definition, contracts, auction and market operations. | Field | Value | | --- | --- | | Acronym | `MADE` | | Full name | Multi-Agentic Decentralized Economics | | Plane | VI — Economic | | Kind | Protocol · Stateless | | City role | Clearing house | | Crate | `protocols/made-lib` | | Status | Implemented · production-grade. | ## What this is Decentralized economics. Asset definition, contracts, auction and market operations. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/made/cli # `map invoke MADE` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MADE` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `asset_definition_publish` ```bash map invoke MADE asset_definition_publish --input '{"example":true}' ``` Publish an asset definition (kind, units, governance class) to MARS. Capability: `map.made.asset_definition_publish` ### `economic_contract_create` ```bash map invoke MADE economic_contract_create --input '{"example":true}' ``` Create an economic contract: parties, terms, settlement rail, audit hooks. Capability: `map.made.economic_contract_create` ### `economic_contract_settle` ```bash map invoke MADE economic_contract_settle --input '{"example":true}' ``` Execute settlement on a registered rail (x402, stable, fiat); proof returned. Capability: `map.made.economic_contract_settle` ### `auction_message` ```bash map invoke MADE auction_message --input '{"example":true}' ``` Submit an auction message (bid, ask, lift) into an active auction. Capability: `map.made.auction_message` ### `market_operation_message` ```bash map invoke MADE market_operation_message --input '{"example":true}' ``` Submit a market op message routed through MARKET. Capability: `map.made.market_operation_message` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/made/governance # Refusal posture, dissent preservation, audit footprint for MADE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MADE` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MADE` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.made.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MADE` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MADE` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/made/internals # Crate path, key types, adjacent protocols for MADE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MADE` (Multi-Agentic Decentralized Economics) lives in `protocols/made-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/made-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/made-lib/src/protocol.rs` | core protocol logic | | `protocols/made-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/made-lib/tests/` | unit + integration tests | | `schemas/made/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MadeProtocol { fn protocol_name(&self) -> &'static str { "MADE" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "asset_definition_publish", "economic_contract_create", "economic_contract_settle", "auction_message", "market_operation_message", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "asset_definition_publish" => self.asset_definition_publish(payload, ctx).await, "economic_contract_create" => self.economic_contract_create(payload, ctx).await, "economic_contract_settle" => self.economic_contract_settle(payload, ctx).await, "auction_message" => self.auction_message(payload, ctx).await, "market_operation_message" => self.market_operation_message(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p made-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/made/metering # How MEAL meters MADE operations. ================================================================================ Every call on `MADE` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `asset_definition_publish` | 0 | yes | `<0.001 kWh` | | `economic_contract_create` | 0 | yes | `<0.001 kWh` | | `economic_contract_settle` | 0 | yes | `<0.001 kWh` | | `auction_message` | 0 | yes | `<0.001 kWh` | | `market_operation_message` | 0 | yes | `<0.001 kWh` | ## Rate card `MADE` is a **protocol** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MADE` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MADE`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/made/operations # Every operation on MADE. ================================================================================ The full operation table for `MADE`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/made-lib` crate. ## Index | Operation | Summary | | --- | --- | | `asset_definition_publish` | Publish an asset definition (kind, units, governance class) to MARS. | | `economic_contract_create` | Create an economic contract: parties, terms, settlement rail, audit hooks. | | `economic_contract_settle` | Execute settlement on a registered rail (x402, stable, fiat); proof returned. | | `auction_message` | Submit an auction message (bid, ask, lift) into an active auction. | | `market_operation_message` | Submit a market op message routed through MARKET. | ## Reference ### `asset_definition_publish` Publish an asset definition (kind, units, governance class) to MARS. | Field | Value | | --- | --- | | Capability | `map.made.asset_definition_publish` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `economic_contract_create` Create an economic contract: parties, terms, settlement rail, audit hooks. | Field | Value | | --- | --- | | Capability | `map.made.economic_contract_create` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `economic_contract_settle` Execute settlement on a registered rail (x402, stable, fiat); proof returned. | Field | Value | | --- | --- | | Capability | `map.made.economic_contract_settle` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `auction_message` Submit an auction message (bid, ask, lift) into an active auction. | Field | Value | | --- | --- | | Capability | `map.made.auction_message` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `market_operation_message` Submit a market op message routed through MARKET. | Field | Value | | --- | --- | | Capability | `map.made.market_operation_message` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/made/schemas # Request and response JSON schemas for MADE. ================================================================================ The OCIP contracts for `MADE` live in `/Volumes/L1feAI/l1feosx/map/schemas/made/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/made/v1/ ├── index.json ├── operations.asset_definition_publish.request.json ├── operations.asset_definition_publish.response.json ├── operations.economic_contract_create.request.json ├── operations.economic_contract_create.response.json ├── operations.economic_contract_settle.request.json ├── operations.economic_contract_settle.response.json ├── operations.auction_message.request.json ├── operations.auction_message.response.json ├── operations.market_operation_message.request.json ├── operations.market_operation_message.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `asset_definition_publish` | `schemas/made/v1/operations.asset_definition_publish.request.json` | `schemas/made/v1/operations.asset_definition_publish.response.json` | | `economic_contract_create` | `schemas/made/v1/operations.economic_contract_create.request.json` | `schemas/made/v1/operations.economic_contract_create.response.json` | | `economic_contract_settle` | `schemas/made/v1/operations.economic_contract_settle.request.json` | `schemas/made/v1/operations.economic_contract_settle.response.json` | | `auction_message` | `schemas/made/v1/operations.auction_message.request.json` | `schemas/made/v1/operations.auction_message.response.json` | | `market_operation_message` | `schemas/made/v1/operations.market_operation_message.request.json` | `schemas/made/v1/operations.market_operation_message.response.json` | ## Published ```text https://schemas.multiagentic.dev/made/v1/operations..request.json https://schemas.multiagentic.dev/made/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/made/sdks # Rust, TypeScript and HTTP for MADE. ================================================================================ Every operation on `MADE` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MADE", "v1.0.0", "asset_definition_publish", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MADE', version: 'v1.0.0', operation: 'asset_definition_publish', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MADE", "version": "v1.0.0", "operation": "asset_definition_publish", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"asset_definition_publish"` — Publish an asset definition (kind, units, governance class) to MARS. - `map.dispatch(...)` with operation `"economic_contract_create"` — Create an economic contract: parties, terms, settlement rail, audit hooks. - `map.dispatch(...)` with operation `"economic_contract_settle"` — Execute settlement on a registered rail (x402, stable, fiat); proof returned. - `map.dispatch(...)` with operation `"auction_message"` — Submit an auction message (bid, ask, lift) into an active auction. - `map.dispatch(...)` with operation `"market_operation_message"` — Submit a market op message routed through MARKET. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MAESTRO # URL: https://docs.multiagentic.dev/docs/protocols/maestro # Multi-Agentic Ensemble Strategy & Task Resource Orchestrator · Plans, orders, recovers. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Plans, orders, recovers.** > > Charter declaration, goal refinement, execution graph commit/diff/replan, dispatch and credit tracing. | Field | Value | | --- | --- | | Acronym | `MAESTRO` | | Full name | Multi-Agentic Ensemble Strategy & Task Resource Orchestrator | | Plane | V — Execution | | Kind | Agent · Autonomous Org | | City role | Conductor | | Crate | `protocols/maestro-lib` | | Status | Implemented · production-grade. | ## What this is Charter declaration, goal refinement, execution graph commit/diff/replan, dispatch and credit tracing. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/maestro/cli # `map invoke MAESTRO` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MAESTRO` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `charter.declare` ```bash map invoke MAESTRO charter.declare --input '{"example":true}' ``` Declare a charter under which subsequent goals will be refined. Capability: `map.maestro.charter.declare` ### `goal.refine` ```bash map invoke MAESTRO goal.refine --input '{"example":true}' ``` Refine a goal into an executable graph with dependency analysis. Capability: `map.maestro.goal.refine` ### `graph.commit` ```bash map invoke MAESTRO graph.commit --input '{"example":true}' ``` Commit a refined execution graph as the active plan. Capability: `map.maestro.graph.commit` ### `graph.diff` ```bash map invoke MAESTRO graph.diff --input '{"example":true}' ``` Diff two graph versions; surface added/removed/changed steps. Capability: `map.maestro.graph.diff` ### `graph.replan` ```bash map invoke MAESTRO graph.replan --input '{"example":true}' ``` Replan a graph on deviation; reuses durable state where possible. Capability: `map.maestro.graph.replan` ### `dispatch.next` ```bash map invoke MAESTRO dispatch.next --input '{"example":true}' ``` Dispatch the next ready step under the active plan. Capability: `map.maestro.dispatch.next` ### `outcome.report` ```bash map invoke MAESTRO outcome.report --input '{"example":true}' ``` Report a step outcome; updates the plan and triggers cascades. Capability: `map.maestro.outcome.report` ### `credit.trace` ```bash map invoke MAESTRO credit.trace --input '{"example":true}' ``` Trace credit and blame for a completed leg of the plan. Capability: `map.maestro.credit.trace` ### `query.goals` ```bash map invoke MAESTRO query.goals --input '{"example":true}' ``` Query active goals under a charter. Capability: `map.maestro.query.goals` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/maestro/governance # Refusal posture, dissent preservation, audit footprint for MAESTRO. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAESTRO` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MAESTRO` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.maestro.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MAESTRO` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MAESTRO` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/maestro/internals # Crate path, key types, adjacent protocols for MAESTRO. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAESTRO` (Multi-Agentic Ensemble Strategy & Task Resource Orchestrator) lives in `protocols/maestro-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/maestro-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/maestro-lib/src/protocol.rs` | core protocol logic | | `protocols/maestro-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/maestro-lib/tests/` | unit + integration tests | | `schemas/maestro/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MaestroProtocol { fn protocol_name(&self) -> &'static str { "MAESTRO" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "charter.declare", "goal.refine", "graph.commit", "graph.diff", "graph.replan", "dispatch.next", "outcome.report", "credit.trace", "query.goals", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "charter.declare" => self.charter_declare(payload, ctx).await, "goal.refine" => self.goal_refine(payload, ctx).await, "graph.commit" => self.graph_commit(payload, ctx).await, "graph.diff" => self.graph_diff(payload, ctx).await, "graph.replan" => self.graph_replan(payload, ctx).await, "dispatch.next" => self.dispatch_next(payload, ctx).await, "outcome.report" => self.outcome_report(payload, ctx).await, "credit.trace" => self.credit_trace(payload, ctx).await, "query.goals" => self.query_goals(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p maestro-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/maestro/metering # How MEAL meters MAESTRO operations. ================================================================================ Every call on `MAESTRO` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `charter.declare` | yes | yes | yes | | `goal.refine` | yes | yes | yes | | `graph.commit` | yes | yes | yes | | `graph.diff` | yes | yes | yes | | `graph.replan` | yes | yes | yes | | `dispatch.next` | yes | yes | yes | | `outcome.report` | yes | yes | yes | | `credit.trace` | yes | yes | yes | | `query.goals` | yes | yes | yes | ## Rate card `MAESTRO` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MAESTRO` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MAESTRO`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/maestro/operations # Every operation on MAESTRO. ================================================================================ The full operation table for `MAESTRO`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/maestro-lib` crate. ## Index | Operation | Summary | | --- | --- | | `charter.declare` | Declare a charter under which subsequent goals will be refined. | | `goal.refine` | Refine a goal into an executable graph with dependency analysis. | | `graph.commit` | Commit a refined execution graph as the active plan. | | `graph.diff` | Diff two graph versions; surface added/removed/changed steps. | | `graph.replan` | Replan a graph on deviation; reuses durable state where possible. | | `dispatch.next` | Dispatch the next ready step under the active plan. | | `outcome.report` | Report a step outcome; updates the plan and triggers cascades. | | `credit.trace` | Trace credit and blame for a completed leg of the plan. | | `query.goals` | Query active goals under a charter. | ## Reference ### `charter.declare` Declare a charter under which subsequent goals will be refined. | Field | Value | | --- | --- | | Capability | `map.maestro.charter.declare` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `goal.refine` Refine a goal into an executable graph with dependency analysis. | Field | Value | | --- | --- | | Capability | `map.maestro.goal.refine` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `graph.commit` Commit a refined execution graph as the active plan. | Field | Value | | --- | --- | | Capability | `map.maestro.graph.commit` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `graph.diff` Diff two graph versions; surface added/removed/changed steps. | Field | Value | | --- | --- | | Capability | `map.maestro.graph.diff` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `graph.replan` Replan a graph on deviation; reuses durable state where possible. | Field | Value | | --- | --- | | Capability | `map.maestro.graph.replan` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `dispatch.next` Dispatch the next ready step under the active plan. | Field | Value | | --- | --- | | Capability | `map.maestro.dispatch.next` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `outcome.report` Report a step outcome; updates the plan and triggers cascades. | Field | Value | | --- | --- | | Capability | `map.maestro.outcome.report` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `credit.trace` Trace credit and blame for a completed leg of the plan. | Field | Value | | --- | --- | | Capability | `map.maestro.credit.trace` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `query.goals` Query active goals under a charter. | Field | Value | | --- | --- | | Capability | `map.maestro.query.goals` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/maestro/schemas # Request and response JSON schemas for MAESTRO. ================================================================================ The OCIP contracts for `MAESTRO` live in `/Volumes/L1feAI/l1feosx/map/schemas/maestro/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/maestro/v1/ ├── index.json ├── operations.charter.declare.request.json ├── operations.charter.declare.response.json ├── operations.goal.refine.request.json ├── operations.goal.refine.response.json ├── operations.graph.commit.request.json ├── operations.graph.commit.response.json ├── operations.graph.diff.request.json ├── operations.graph.diff.response.json ├── operations.graph.replan.request.json ├── operations.graph.replan.response.json ├── operations.dispatch.next.request.json ├── operations.dispatch.next.response.json ├── operations.outcome.report.request.json ├── operations.outcome.report.response.json ├── operations.credit.trace.request.json ├── operations.credit.trace.response.json ├── operations.query.goals.request.json ├── operations.query.goals.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `charter.declare` | `schemas/maestro/v1/operations.charter.declare.request.json` | `schemas/maestro/v1/operations.charter.declare.response.json` | | `goal.refine` | `schemas/maestro/v1/operations.goal.refine.request.json` | `schemas/maestro/v1/operations.goal.refine.response.json` | | `graph.commit` | `schemas/maestro/v1/operations.graph.commit.request.json` | `schemas/maestro/v1/operations.graph.commit.response.json` | | `graph.diff` | `schemas/maestro/v1/operations.graph.diff.request.json` | `schemas/maestro/v1/operations.graph.diff.response.json` | | `graph.replan` | `schemas/maestro/v1/operations.graph.replan.request.json` | `schemas/maestro/v1/operations.graph.replan.response.json` | | `dispatch.next` | `schemas/maestro/v1/operations.dispatch.next.request.json` | `schemas/maestro/v1/operations.dispatch.next.response.json` | | `outcome.report` | `schemas/maestro/v1/operations.outcome.report.request.json` | `schemas/maestro/v1/operations.outcome.report.response.json` | | `credit.trace` | `schemas/maestro/v1/operations.credit.trace.request.json` | `schemas/maestro/v1/operations.credit.trace.response.json` | | `query.goals` | `schemas/maestro/v1/operations.query.goals.request.json` | `schemas/maestro/v1/operations.query.goals.response.json` | ## Published ```text https://schemas.multiagentic.dev/maestro/v1/operations..request.json https://schemas.multiagentic.dev/maestro/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/maestro/sdks # Rust, TypeScript and HTTP for MAESTRO. ================================================================================ Every operation on `MAESTRO` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MAESTRO", "v1.0.0", "charter.declare", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MAESTRO', version: 'v1.0.0', operation: 'charter.declare', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MAESTRO", "version": "v1.0.0", "operation": "charter.declare", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"charter.declare"` — Declare a charter under which subsequent goals will be refined. - `map.dispatch(...)` with operation `"goal.refine"` — Refine a goal into an executable graph with dependency analysis. - `map.dispatch(...)` with operation `"graph.commit"` — Commit a refined execution graph as the active plan. - `map.dispatch(...)` with operation `"graph.diff"` — Diff two graph versions; surface added/removed/changed steps. - `map.dispatch(...)` with operation `"graph.replan"` — Replan a graph on deviation; reuses durable state where possible. - `map.dispatch(...)` with operation `"dispatch.next"` — Dispatch the next ready step under the active plan. - `map.dispatch(...)` with operation `"outcome.report"` — Report a step outcome; updates the plan and triggers cascades. - `map.dispatch(...)` with operation `"credit.trace"` — Trace credit and blame for a completed leg of the plan. - `map.dispatch(...)` with operation `"query.goals"` — Query active goals under a charter. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MAGE # URL: https://docs.multiagentic.dev/docs/protocols/mage # Multi-Agent Generation Engine · The drafting-table for organizations. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **The drafting-table for organizations.** > > Multi-agent generation engine via ONE/MUSE. Charters, bylaws, role specs, treaties, blueprints. | Field | Value | | --- | --- | | Acronym | `MAGE` | | Full name | Multi-Agent Generation Engine | | Plane | V — Execution | | Kind | Agent · Autonomous Org | | City role | Engineering firm | | Crate | `protocols/mage-lib` | | Status | Implemented · production-grade. | ## What this is Multi-agent generation engine via ONE/MUSE. Charters, bylaws, role specs, treaties, blueprints. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mage/cli # `map invoke MAGE` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MAGE` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `draft` ```bash map invoke MAGE draft --input '{"example":true}' ``` Draft an artifact of a declared kind (charter, treaty, role spec, blueprint). Capability: `map.mage.draft` ### `revise` ```bash map invoke MAGE revise --input '{"example":true}' ``` Revise an artifact under instructions; diff against prior version preserved. Capability: `map.mage.revise` ### `publish` ```bash map invoke MAGE publish --input '{"example":true}' ``` Publish a final artifact to MARS for institutional citation. Capability: `map.mage.publish` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mage/governance # Refusal posture, dissent preservation, audit footprint for MAGE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAGE` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MAGE` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mage.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MAGE` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MAGE` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mage/internals # Crate path, key types, adjacent protocols for MAGE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAGE` (Multi-Agent Generation Engine) lives in `protocols/mage-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mage-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mage-lib/src/protocol.rs` | core protocol logic | | `protocols/mage-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mage-lib/tests/` | unit + integration tests | | `schemas/mage/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MageProtocol { fn protocol_name(&self) -> &'static str { "MAGE" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "draft", "revise", "publish", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "draft" => self.draft(payload, ctx).await, "revise" => self.revise(payload, ctx).await, "publish" => self.publish(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mage-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mage/metering # How MEAL meters MAGE operations. ================================================================================ Every call on `MAGE` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `draft` | yes | yes | yes | | `revise` | yes | yes | yes | | `publish` | yes | yes | yes | ## Rate card `MAGE` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MAGE` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MAGE`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mage/operations # Every operation on MAGE. ================================================================================ The full operation table for `MAGE`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mage-lib` crate. ## Index | Operation | Summary | | --- | --- | | `draft` | Draft an artifact of a declared kind (charter, treaty, role spec, blueprint). | | `revise` | Revise an artifact under instructions; diff against prior version preserved. | | `publish` | Publish a final artifact to MARS for institutional citation. | ## Reference ### `draft` Draft an artifact of a declared kind (charter, treaty, role spec, blueprint). | Field | Value | | --- | --- | | Capability | `map.mage.draft` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `revise` Revise an artifact under instructions; diff against prior version preserved. | Field | Value | | --- | --- | | Capability | `map.mage.revise` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `publish` Publish a final artifact to MARS for institutional citation. | Field | Value | | --- | --- | | Capability | `map.mage.publish` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mage/schemas # Request and response JSON schemas for MAGE. ================================================================================ The OCIP contracts for `MAGE` live in `/Volumes/L1feAI/l1feosx/map/schemas/mage/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mage/v1/ ├── index.json ├── operations.draft.request.json ├── operations.draft.response.json ├── operations.revise.request.json ├── operations.revise.response.json ├── operations.publish.request.json ├── operations.publish.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `draft` | `schemas/mage/v1/operations.draft.request.json` | `schemas/mage/v1/operations.draft.response.json` | | `revise` | `schemas/mage/v1/operations.revise.request.json` | `schemas/mage/v1/operations.revise.response.json` | | `publish` | `schemas/mage/v1/operations.publish.request.json` | `schemas/mage/v1/operations.publish.response.json` | ## Published ```text https://schemas.multiagentic.dev/mage/v1/operations..request.json https://schemas.multiagentic.dev/mage/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mage/sdks # Rust, TypeScript and HTTP for MAGE. ================================================================================ Every operation on `MAGE` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MAGE", "v1.0.0", "draft", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MAGE', version: 'v1.0.0', operation: 'draft', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MAGE", "version": "v1.0.0", "operation": "draft", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"draft"` — Draft an artifact of a declared kind (charter, treaty, role spec, blueprint). - `map.dispatch(...)` with operation `"revise"` — Revise an artifact under instructions; diff against prior version preserved. - `map.dispatch(...)` with operation `"publish"` — Publish a final artifact to MARS for institutional citation. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MAGI # URL: https://docs.multiagentic.dev/docs/protocols/magi # Multi-Agentic Glass-box Interpretation · The institution sees through itself. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **The institution sees through itself.** > > Mechanistic interpretability. Activation tracing. Circuit discovery. Feature attribution under audit. | Field | Value | | --- | --- | | Acronym | `MAGI` | | Full name | Multi-Agentic Glass-box Interpretation | | Plane | III — Truth | | Kind | Agent · Autonomous Org | | City role | Mechanistic interpretability lab | | Crate | `protocols/magi-lib` | | Status | Partial · core methods implemented; some features pending. | ## What this is Mechanistic interpretability. Activation tracing. Circuit discovery. Feature attribution under audit. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/magi/cli # `map invoke MAGI` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MAGI` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `trace` ```bash map invoke MAGI trace --input '{"example":true}' ``` Trace activations through a model for a given input; returns circuit map. Capability: `map.magi.trace` ### `attribute` ```bash map invoke MAGI attribute --input '{"example":true}' ``` Compute feature attribution: which inputs caused which output. Capability: `map.magi.attribute` ### `circuit` ```bash map invoke MAGI circuit --input '{"example":true}' ``` Discover named circuits — induction heads, copy circuits, refusal directions. Capability: `map.magi.circuit` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/magi/governance # Refusal posture, dissent preservation, audit footprint for MAGI. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAGI` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MAGI` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.magi.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MAGI` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MAGI` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/magi/internals # Crate path, key types, adjacent protocols for MAGI. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAGI` (Multi-Agentic Glass-box Interpretation) lives in `protocols/magi-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/magi-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/magi-lib/src/protocol.rs` | core protocol logic | | `protocols/magi-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/magi-lib/tests/` | unit + integration tests | | `schemas/magi/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MagiProtocol { fn protocol_name(&self) -> &'static str { "MAGI" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "trace", "attribute", "circuit", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "trace" => self.trace(payload, ctx).await, "attribute" => self.attribute(payload, ctx).await, "circuit" => self.circuit(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Partial · core methods implemented; some features pending. ## Tests ```bash cargo test -p magi-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/magi/metering # How MEAL meters MAGI operations. ================================================================================ Every call on `MAGI` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `trace` | yes | yes | yes | | `attribute` | yes | yes | yes | | `circuit` | yes | yes | yes | ## Rate card `MAGI` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MAGI` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MAGI`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/magi/operations # Every operation on MAGI. ================================================================================ The full operation table for `MAGI`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/magi-lib` crate. ## Index | Operation | Summary | | --- | --- | | `trace` | Trace activations through a model for a given input; returns circuit map. | | `attribute` | Compute feature attribution: which inputs caused which output. | | `circuit` | Discover named circuits — induction heads, copy circuits, refusal directions. | ## Reference ### `trace` Trace activations through a model for a given input; returns circuit map. | Field | Value | | --- | --- | | Capability | `map.magi.trace` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `attribute` Compute feature attribution: which inputs caused which output. | Field | Value | | --- | --- | | Capability | `map.magi.attribute` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `circuit` Discover named circuits — induction heads, copy circuits, refusal directions. | Field | Value | | --- | --- | | Capability | `map.magi.circuit` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/magi/schemas # Request and response JSON schemas for MAGI. ================================================================================ The OCIP contracts for `MAGI` live in `/Volumes/L1feAI/l1feosx/map/schemas/magi/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/magi/v1/ ├── index.json ├── operations.trace.request.json ├── operations.trace.response.json ├── operations.attribute.request.json ├── operations.attribute.response.json ├── operations.circuit.request.json ├── operations.circuit.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `trace` | `schemas/magi/v1/operations.trace.request.json` | `schemas/magi/v1/operations.trace.response.json` | | `attribute` | `schemas/magi/v1/operations.attribute.request.json` | `schemas/magi/v1/operations.attribute.response.json` | | `circuit` | `schemas/magi/v1/operations.circuit.request.json` | `schemas/magi/v1/operations.circuit.response.json` | ## Published ```text https://schemas.multiagentic.dev/magi/v1/operations..request.json https://schemas.multiagentic.dev/magi/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/magi/sdks # Rust, TypeScript and HTTP for MAGI. ================================================================================ Every operation on `MAGI` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MAGI", "v1.0.0", "trace", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MAGI', version: 'v1.0.0', operation: 'trace', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MAGI", "version": "v1.0.0", "operation": "trace", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"trace"` — Trace activations through a model for a given input; returns circuit map. - `map.dispatch(...)` with operation `"attribute"` — Compute feature attribution: which inputs caused which output. - `map.dispatch(...)` with operation `"circuit"` — Discover named circuits — induction heads, copy circuits, refusal directions. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MAKER # URL: https://docs.multiagentic.dev/docs/protocols/maker # Multi-Agentic Kinetic Execution & Realization · A unified surface for every tool. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **A unified surface for every tool.** > > Kinetic execution and realization. Action dispatch with emergency stop. Native/MCP/A2A/HTTP/WASI unified. | Field | Value | | --- | --- | | Acronym | `MAKER` | | Full name | Multi-Agentic Kinetic Execution & Realization | | Plane | V — Execution | | Kind | Agent · Autonomous Org | | City role | Workshop floor | | Crate | `protocols/maker-lib` | | Status | Implemented · production-grade. | ## What this is Kinetic execution and realization. Action dispatch with emergency stop. Native/MCP/A2A/HTTP/WASI unified. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/maker/cli # `map invoke MAKER` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MAKER` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `execute_action` ```bash map invoke MAKER execute_action --input '{"example":true}' ``` Execute a declared action under capability scope, sandbox isolation, input/output attestation. Capability: `map.maker.execute_action` ### `emergency_stop` ```bash map invoke MAKER emergency_stop --input '{"example":true}' ``` Halt the currently executing action(s); recorded with reason and authority. Capability: `map.maker.emergency_stop` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/maker/governance # Refusal posture, dissent preservation, audit footprint for MAKER. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAKER` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MAKER` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.maker.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MAKER` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MAKER` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/maker/internals # Crate path, key types, adjacent protocols for MAKER. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAKER` (Multi-Agentic Kinetic Execution & Realization) lives in `protocols/maker-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/maker-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/maker-lib/src/protocol.rs` | core protocol logic | | `protocols/maker-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/maker-lib/tests/` | unit + integration tests | | `schemas/maker/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MakerProtocol { fn protocol_name(&self) -> &'static str { "MAKER" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "execute_action", "emergency_stop", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "execute_action" => self.execute_action(payload, ctx).await, "emergency_stop" => self.emergency_stop(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p maker-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/maker/metering # How MEAL meters MAKER operations. ================================================================================ Every call on `MAKER` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `execute_action` | yes | yes | yes | | `emergency_stop` | yes | yes | yes | ## Rate card `MAKER` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MAKER` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MAKER`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/maker/operations # Every operation on MAKER. ================================================================================ The full operation table for `MAKER`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/maker-lib` crate. ## Index | Operation | Summary | | --- | --- | | `execute_action` | Execute a declared action under capability scope, sandbox isolation, input/output attestation. | | `emergency_stop` | Halt the currently executing action(s); recorded with reason and authority. | ## Reference ### `execute_action` Execute a declared action under capability scope, sandbox isolation, input/output attestation. | Field | Value | | --- | --- | | Capability | `map.maker.execute_action` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `emergency_stop` Halt the currently executing action(s); recorded with reason and authority. | Field | Value | | --- | --- | | Capability | `map.maker.emergency_stop` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/maker/schemas # Request and response JSON schemas for MAKER. ================================================================================ The OCIP contracts for `MAKER` live in `/Volumes/L1feAI/l1feosx/map/schemas/maker/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/maker/v1/ ├── index.json ├── operations.execute_action.request.json ├── operations.execute_action.response.json ├── operations.emergency_stop.request.json ├── operations.emergency_stop.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `execute_action` | `schemas/maker/v1/operations.execute_action.request.json` | `schemas/maker/v1/operations.execute_action.response.json` | | `emergency_stop` | `schemas/maker/v1/operations.emergency_stop.request.json` | `schemas/maker/v1/operations.emergency_stop.response.json` | ## Published ```text https://schemas.multiagentic.dev/maker/v1/operations..request.json https://schemas.multiagentic.dev/maker/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/maker/sdks # Rust, TypeScript and HTTP for MAKER. ================================================================================ Every operation on `MAKER` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MAKER", "v1.0.0", "execute_action", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MAKER', version: 'v1.0.0', operation: 'execute_action', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MAKER", "version": "v1.0.0", "operation": "execute_action", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"execute_action"` — Execute a declared action under capability scope, sandbox isolation, input/output attestation. - `map.dispatch(...)` with operation `"emergency_stop"` — Halt the currently executing action(s); recorded with reason and authority. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MAME # URL: https://docs.multiagentic.dev/docs/protocols/mame # Multi-Agentic Meta-learning Engine · Curatorial access to the substrate. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Curatorial access to the substrate.** > > Meta-learning. Redaction with provenance. Schema migration. Knowledge correction with auditable lineage. | Field | Value | | --- | --- | | Acronym | `MAME` | | Full name | Multi-Agentic Meta-learning Engine | | Plane | II — Cognition | | Kind | Agent · Autonomous Org | | City role | Academy | | Crate | `protocols/mame-lib` | | Status | Implemented · production-grade. | ## What this is Meta-learning. Redaction with provenance. Schema migration. Knowledge correction with auditable lineage. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mame/cli # `map invoke MAME` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MAME` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `edit` ```bash map invoke MAME edit --input '{"example":true}' ``` Edit a memory cell with full provenance; old value preserved as tombstone. Capability: `map.mame.edit` ### `redact` ```bash map invoke MAME redact --input '{"example":true}' ``` Redact a memory under policy authority; auditable tombstone, never silence. Capability: `map.mame.redact` ### `migrate` ```bash map invoke MAME migrate --input '{"example":true}' ``` Schema migration with versioned views; historical reads continue under old schema. Capability: `map.mame.migrate` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mame/governance # Refusal posture, dissent preservation, audit footprint for MAME. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAME` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MAME` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mame.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MAME` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MAME` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mame/internals # Crate path, key types, adjacent protocols for MAME. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAME` (Multi-Agentic Meta-learning Engine) lives in `protocols/mame-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mame-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mame-lib/src/protocol.rs` | core protocol logic | | `protocols/mame-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mame-lib/tests/` | unit + integration tests | | `schemas/mame/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MameProtocol { fn protocol_name(&self) -> &'static str { "MAME" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "edit", "redact", "migrate", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "edit" => self.edit(payload, ctx).await, "redact" => self.redact(payload, ctx).await, "migrate" => self.migrate(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mame-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mame/metering # How MEAL meters MAME operations. ================================================================================ Every call on `MAME` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `edit` | yes | yes | yes | | `redact` | yes | yes | yes | | `migrate` | yes | yes | yes | ## Rate card `MAME` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MAME` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MAME`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mame/operations # Every operation on MAME. ================================================================================ The full operation table for `MAME`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mame-lib` crate. ## Index | Operation | Summary | | --- | --- | | `edit` | Edit a memory cell with full provenance; old value preserved as tombstone. | | `redact` | Redact a memory under policy authority; auditable tombstone, never silence. | | `migrate` | Schema migration with versioned views; historical reads continue under old schema. | ## Reference ### `edit` Edit a memory cell with full provenance; old value preserved as tombstone. | Field | Value | | --- | --- | | Capability | `map.mame.edit` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `redact` Redact a memory under policy authority; auditable tombstone, never silence. | Field | Value | | --- | --- | | Capability | `map.mame.redact` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `migrate` Schema migration with versioned views; historical reads continue under old schema. | Field | Value | | --- | --- | | Capability | `map.mame.migrate` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mame/schemas # Request and response JSON schemas for MAME. ================================================================================ The OCIP contracts for `MAME` live in `/Volumes/L1feAI/l1feosx/map/schemas/mame/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mame/v1/ ├── index.json ├── operations.edit.request.json ├── operations.edit.response.json ├── operations.redact.request.json ├── operations.redact.response.json ├── operations.migrate.request.json ├── operations.migrate.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `edit` | `schemas/mame/v1/operations.edit.request.json` | `schemas/mame/v1/operations.edit.response.json` | | `redact` | `schemas/mame/v1/operations.redact.request.json` | `schemas/mame/v1/operations.redact.response.json` | | `migrate` | `schemas/mame/v1/operations.migrate.request.json` | `schemas/mame/v1/operations.migrate.response.json` | ## Published ```text https://schemas.multiagentic.dev/mame/v1/operations..request.json https://schemas.multiagentic.dev/mame/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mame/sdks # Rust, TypeScript and HTTP for MAME. ================================================================================ Every operation on `MAME` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MAME", "v1.0.0", "edit", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MAME', version: 'v1.0.0', operation: 'edit', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MAME", "version": "v1.0.0", "operation": "edit", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"edit"` — Edit a memory cell with full provenance; old value preserved as tombstone. - `map.dispatch(...)` with operation `"redact"` — Redact a memory under policy authority; auditable tombstone, never silence. - `map.dispatch(...)` with operation `"migrate"` — Schema migration with versioned views; historical reads continue under old schema. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MANA # URL: https://docs.multiagentic.dev/docs/protocols/mana # Multi-Agentic Negotiation & Arbitration · Treasury · Runway in real units. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Runway in real units.** > > Negotiation, arbitration, treasury. Agent and task profiles, bidding, reputation, arbitration channels. | Field | Value | | --- | --- | | Acronym | `MANA` | | Full name | Multi-Agentic Negotiation & Arbitration · Treasury | | Plane | VI — Economic | | Kind | Agent · Autonomous Org | | City role | Treasury & negotiation | | Crate | `protocols/mana-lib` | | Status | Implemented · production-grade. | ## What this is Negotiation, arbitration, treasury. Agent and task profiles, bidding, reputation, arbitration channels. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mana/cli # `map invoke MANA` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MANA` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `agent_profile` ```bash map invoke MANA agent_profile --input '{"example":true}' ``` Publish or query an agent profile (capabilities, rates, freshness). Capability: `map.mana.agent_profile` ### `service_advertisement` ```bash map invoke MANA service_advertisement --input '{"example":true}' ``` Advertise a service for negotiation; terms, capacity, freshness. Capability: `map.mana.service_advertisement` ### `task_advertisement` ```bash map invoke MANA task_advertisement --input '{"example":true}' ``` Advertise a task seeking offers; deadline and reservation price. Capability: `map.mana.task_advertisement` ### `bid_submission` ```bash map invoke MANA bid_submission --input '{"example":true}' ``` Submit a bid against an advertised task or service. Capability: `map.mana.bid_submission` ### `negotiation` ```bash map invoke MANA negotiation --input '{"example":true}' ``` Multi-round negotiation message; structured pleading recorded. Capability: `map.mana.negotiation` ### `task_assignment` ```bash map invoke MANA task_assignment --input '{"example":true}' ``` Confirm an assignment with binding terms. Capability: `map.mana.task_assignment` ### `reputation_update` ```bash map invoke MANA reputation_update --input '{"example":true}' ``` Update reputation following an outcome; weights propagated to MARE. Capability: `map.mana.reputation_update` ### `arbitration_open` ```bash map invoke MANA arbitration_open --input '{"example":true}' ``` Open an arbitration channel for a contested negotiation. Capability: `map.mana.arbitration_open` ### `arbitration_close` ```bash map invoke MANA arbitration_close --input '{"example":true}' ``` Close an arbitration with a binding ruling; recorded to MAX. Capability: `map.mana.arbitration_close` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mana/governance # Refusal posture, dissent preservation, audit footprint for MANA. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MANA` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MANA` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mana.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MANA` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MANA` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mana/internals # Crate path, key types, adjacent protocols for MANA. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MANA` (Multi-Agentic Negotiation & Arbitration · Treasury) lives in `protocols/mana-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mana-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mana-lib/src/protocol.rs` | core protocol logic | | `protocols/mana-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mana-lib/tests/` | unit + integration tests | | `schemas/mana/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for ManaProtocol { fn protocol_name(&self) -> &'static str { "MANA" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "agent_profile", "service_advertisement", "task_advertisement", "bid_submission", "negotiation", "task_assignment", "reputation_update", "arbitration_open", "arbitration_close", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "agent_profile" => self.agent_profile(payload, ctx).await, "service_advertisement" => self.service_advertisement(payload, ctx).await, "task_advertisement" => self.task_advertisement(payload, ctx).await, "bid_submission" => self.bid_submission(payload, ctx).await, "negotiation" => self.negotiation(payload, ctx).await, "task_assignment" => self.task_assignment(payload, ctx).await, "reputation_update" => self.reputation_update(payload, ctx).await, "arbitration_open" => self.arbitration_open(payload, ctx).await, "arbitration_close" => self.arbitration_close(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mana-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mana/metering # How MEAL meters MANA operations. ================================================================================ Every call on `MANA` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `agent_profile` | yes | yes | yes | | `service_advertisement` | yes | yes | yes | | `task_advertisement` | yes | yes | yes | | `bid_submission` | yes | yes | yes | | `negotiation` | yes | yes | yes | | `task_assignment` | yes | yes | yes | | `reputation_update` | yes | yes | yes | | `arbitration_open` | yes | yes | yes | | `arbitration_close` | yes | yes | yes | ## Rate card `MANA` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MANA` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MANA`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mana/operations # Every operation on MANA. ================================================================================ The full operation table for `MANA`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mana-lib` crate. ## Index | Operation | Summary | | --- | --- | | `agent_profile` | Publish or query an agent profile (capabilities, rates, freshness). | | `service_advertisement` | Advertise a service for negotiation; terms, capacity, freshness. | | `task_advertisement` | Advertise a task seeking offers; deadline and reservation price. | | `bid_submission` | Submit a bid against an advertised task or service. | | `negotiation` | Multi-round negotiation message; structured pleading recorded. | | `task_assignment` | Confirm an assignment with binding terms. | | `reputation_update` | Update reputation following an outcome; weights propagated to MARE. | | `arbitration_open` | Open an arbitration channel for a contested negotiation. | | `arbitration_close` | Close an arbitration with a binding ruling; recorded to MAX. | ## Reference ### `agent_profile` Publish or query an agent profile (capabilities, rates, freshness). | Field | Value | | --- | --- | | Capability | `map.mana.agent_profile` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `service_advertisement` Advertise a service for negotiation; terms, capacity, freshness. | Field | Value | | --- | --- | | Capability | `map.mana.service_advertisement` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `task_advertisement` Advertise a task seeking offers; deadline and reservation price. | Field | Value | | --- | --- | | Capability | `map.mana.task_advertisement` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `bid_submission` Submit a bid against an advertised task or service. | Field | Value | | --- | --- | | Capability | `map.mana.bid_submission` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `negotiation` Multi-round negotiation message; structured pleading recorded. | Field | Value | | --- | --- | | Capability | `map.mana.negotiation` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `task_assignment` Confirm an assignment with binding terms. | Field | Value | | --- | --- | | Capability | `map.mana.task_assignment` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `reputation_update` Update reputation following an outcome; weights propagated to MARE. | Field | Value | | --- | --- | | Capability | `map.mana.reputation_update` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `arbitration_open` Open an arbitration channel for a contested negotiation. | Field | Value | | --- | --- | | Capability | `map.mana.arbitration_open` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `arbitration_close` Close an arbitration with a binding ruling; recorded to MAX. | Field | Value | | --- | --- | | Capability | `map.mana.arbitration_close` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mana/schemas # Request and response JSON schemas for MANA. ================================================================================ The OCIP contracts for `MANA` live in `/Volumes/L1feAI/l1feosx/map/schemas/mana/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mana/v1/ ├── index.json ├── operations.agent_profile.request.json ├── operations.agent_profile.response.json ├── operations.service_advertisement.request.json ├── operations.service_advertisement.response.json ├── operations.task_advertisement.request.json ├── operations.task_advertisement.response.json ├── operations.bid_submission.request.json ├── operations.bid_submission.response.json ├── operations.negotiation.request.json ├── operations.negotiation.response.json ├── operations.task_assignment.request.json ├── operations.task_assignment.response.json ├── operations.reputation_update.request.json ├── operations.reputation_update.response.json ├── operations.arbitration_open.request.json ├── operations.arbitration_open.response.json ├── operations.arbitration_close.request.json ├── operations.arbitration_close.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `agent_profile` | `schemas/mana/v1/operations.agent_profile.request.json` | `schemas/mana/v1/operations.agent_profile.response.json` | | `service_advertisement` | `schemas/mana/v1/operations.service_advertisement.request.json` | `schemas/mana/v1/operations.service_advertisement.response.json` | | `task_advertisement` | `schemas/mana/v1/operations.task_advertisement.request.json` | `schemas/mana/v1/operations.task_advertisement.response.json` | | `bid_submission` | `schemas/mana/v1/operations.bid_submission.request.json` | `schemas/mana/v1/operations.bid_submission.response.json` | | `negotiation` | `schemas/mana/v1/operations.negotiation.request.json` | `schemas/mana/v1/operations.negotiation.response.json` | | `task_assignment` | `schemas/mana/v1/operations.task_assignment.request.json` | `schemas/mana/v1/operations.task_assignment.response.json` | | `reputation_update` | `schemas/mana/v1/operations.reputation_update.request.json` | `schemas/mana/v1/operations.reputation_update.response.json` | | `arbitration_open` | `schemas/mana/v1/operations.arbitration_open.request.json` | `schemas/mana/v1/operations.arbitration_open.response.json` | | `arbitration_close` | `schemas/mana/v1/operations.arbitration_close.request.json` | `schemas/mana/v1/operations.arbitration_close.response.json` | ## Published ```text https://schemas.multiagentic.dev/mana/v1/operations..request.json https://schemas.multiagentic.dev/mana/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mana/sdks # Rust, TypeScript and HTTP for MANA. ================================================================================ Every operation on `MANA` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MANA", "v1.0.0", "agent_profile", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MANA', version: 'v1.0.0', operation: 'agent_profile', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MANA", "version": "v1.0.0", "operation": "agent_profile", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"agent_profile"` — Publish or query an agent profile (capabilities, rates, freshness). - `map.dispatch(...)` with operation `"service_advertisement"` — Advertise a service for negotiation; terms, capacity, freshness. - `map.dispatch(...)` with operation `"task_advertisement"` — Advertise a task seeking offers; deadline and reservation price. - `map.dispatch(...)` with operation `"bid_submission"` — Submit a bid against an advertised task or service. - `map.dispatch(...)` with operation `"negotiation"` — Multi-round negotiation message; structured pleading recorded. - `map.dispatch(...)` with operation `"task_assignment"` — Confirm an assignment with binding terms. - `map.dispatch(...)` with operation `"reputation_update"` — Update reputation following an outcome; weights propagated to MARE. - `map.dispatch(...)` with operation `"arbitration_open"` — Open an arbitration channel for a contested negotiation. - `map.dispatch(...)` with operation `"arbitration_close"` — Close an arbitration with a binding ruling; recorded to MAX. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MANTIC # URL: https://docs.multiagentic.dev/docs/protocols/mantic # Multi-Agentic Necessity, Trust-quantification, Inference & Calibration · Forecasts with their own forecast. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Forecasts with their own forecast.** > > Calibration scoring. Uncertainty quantification. Reliability budget enforcement. | Field | Value | | --- | --- | | Acronym | `MANTIC` | | Full name | Multi-Agentic Necessity, Trust-quantification, Inference & Calibration | | Plane | III — Truth | | Kind | Agent · Autonomous Org | | City role | Reliability actuary | | Crate | `protocols/mantic-lib` | | Status | Partial · core methods implemented; some features pending. | ## What this is Calibration scoring. Uncertainty quantification. Reliability budget enforcement. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mantic/cli # `map invoke MANTIC` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MANTIC` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `calibrate` ```bash map invoke MANTIC calibrate --input '{"example":true}' ``` Score the calibration of a reasoning service over a historical window. Capability: `map.mantic.calibrate` ### `budget` ```bash map invoke MANTIC budget --input '{"example":true}' ``` Enforce a reliability budget; max miscalibration before remediation. Capability: `map.mantic.budget` ### `uncertainty` ```bash map invoke MANTIC uncertainty --input '{"example":true}' ``` Quantify second-order uncertainty: the variance of a confidence estimate itself. Capability: `map.mantic.uncertainty` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mantic/governance # Refusal posture, dissent preservation, audit footprint for MANTIC. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MANTIC` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MANTIC` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mantic.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MANTIC` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MANTIC` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mantic/internals # Crate path, key types, adjacent protocols for MANTIC. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MANTIC` (Multi-Agentic Necessity, Trust-quantification, Inference & Calibration) lives in `protocols/mantic-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mantic-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mantic-lib/src/protocol.rs` | core protocol logic | | `protocols/mantic-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mantic-lib/tests/` | unit + integration tests | | `schemas/mantic/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for ManticProtocol { fn protocol_name(&self) -> &'static str { "MANTIC" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "calibrate", "budget", "uncertainty", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "calibrate" => self.calibrate(payload, ctx).await, "budget" => self.budget(payload, ctx).await, "uncertainty" => self.uncertainty(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Partial · core methods implemented; some features pending. ## Tests ```bash cargo test -p mantic-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mantic/metering # How MEAL meters MANTIC operations. ================================================================================ Every call on `MANTIC` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `calibrate` | yes | yes | yes | | `budget` | yes | yes | yes | | `uncertainty` | yes | yes | yes | ## Rate card `MANTIC` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MANTIC` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MANTIC`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mantic/operations # Every operation on MANTIC. ================================================================================ The full operation table for `MANTIC`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mantic-lib` crate. ## Index | Operation | Summary | | --- | --- | | `calibrate` | Score the calibration of a reasoning service over a historical window. | | `budget` | Enforce a reliability budget; max miscalibration before remediation. | | `uncertainty` | Quantify second-order uncertainty: the variance of a confidence estimate itself. | ## Reference ### `calibrate` Score the calibration of a reasoning service over a historical window. | Field | Value | | --- | --- | | Capability | `map.mantic.calibrate` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `budget` Enforce a reliability budget; max miscalibration before remediation. | Field | Value | | --- | --- | | Capability | `map.mantic.budget` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `uncertainty` Quantify second-order uncertainty: the variance of a confidence estimate itself. | Field | Value | | --- | --- | | Capability | `map.mantic.uncertainty` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mantic/schemas # Request and response JSON schemas for MANTIC. ================================================================================ The OCIP contracts for `MANTIC` live in `/Volumes/L1feAI/l1feosx/map/schemas/mantic/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mantic/v1/ ├── index.json ├── operations.calibrate.request.json ├── operations.calibrate.response.json ├── operations.budget.request.json ├── operations.budget.response.json ├── operations.uncertainty.request.json ├── operations.uncertainty.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `calibrate` | `schemas/mantic/v1/operations.calibrate.request.json` | `schemas/mantic/v1/operations.calibrate.response.json` | | `budget` | `schemas/mantic/v1/operations.budget.request.json` | `schemas/mantic/v1/operations.budget.response.json` | | `uncertainty` | `schemas/mantic/v1/operations.uncertainty.request.json` | `schemas/mantic/v1/operations.uncertainty.response.json` | ## Published ```text https://schemas.multiagentic.dev/mantic/v1/operations..request.json https://schemas.multiagentic.dev/mantic/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mantic/sdks # Rust, TypeScript and HTTP for MANTIC. ================================================================================ Every operation on `MANTIC` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MANTIC", "v1.0.0", "calibrate", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MANTIC', version: 'v1.0.0', operation: 'calibrate', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MANTIC", "version": "v1.0.0", "operation": "calibrate", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"calibrate"` — Score the calibration of a reasoning service over a historical window. - `map.dispatch(...)` with operation `"budget"` — Enforce a reliability budget; max miscalibration before remediation. - `map.dispatch(...)` with operation `"uncertainty"` — Quantify second-order uncertainty: the variance of a confidence estimate itself. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MANTLE # URL: https://docs.multiagentic.dev/docs/protocols/mantle # Meta-perceptual & Associative Network for Transcendental Lived Experience · Where facts settle into foundation. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Where facts settle into foundation.** > > Perception ingest, sleep-cycle consolidation, EWC continual learning, generative replay. | Field | Value | | --- | --- | | Acronym | `MANTLE` | | Full name | Meta-perceptual & Associative Network for Transcendental Lived Experience | | Plane | II — Cognition | | Kind | Hybrid · Protocol + Agent | | City role | Perception pipeline | | Crate | `protocols/mantle-lib` | | Status | Implemented · production-grade. | ## What this is Perception ingest, sleep-cycle consolidation, EWC continual learning, generative replay. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mantle/cli # `map invoke MANTLE` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MANTLE` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `consolidate` ```bash map invoke MANTLE consolidate --input '{"example":true}' ``` Run consolidation pass: dedup, compress, distill, replay. Protected by EWC anchors. Capability: `map.mantle.consolidate` ### `anchor` ```bash map invoke MANTLE anchor --input '{"example":true}' ``` Declare a knowledge anchor — protected from rewriting during future consolidations. Capability: `map.mantle.anchor` ### `replay` ```bash map invoke MANTLE replay --input '{"example":true}' ``` Generative replay of rare event classes for memory rehearsal. Capability: `map.mantle.replay` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mantle/governance # Refusal posture, dissent preservation, audit footprint for MANTLE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MANTLE` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MANTLE` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mantle.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MANTLE` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MANTLE` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mantle/internals # Crate path, key types, adjacent protocols for MANTLE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MANTLE` (Meta-perceptual & Associative Network for Transcendental Lived Experience) lives in `protocols/mantle-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mantle-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mantle-lib/src/protocol.rs` | core protocol logic | | `protocols/mantle-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mantle-lib/tests/` | unit + integration tests | | `schemas/mantle/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MantleProtocol { fn protocol_name(&self) -> &'static str { "MANTLE" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "consolidate", "anchor", "replay", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "consolidate" => self.consolidate(payload, ctx).await, "anchor" => self.anchor(payload, ctx).await, "replay" => self.replay(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mantle-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mantle/metering # How MEAL meters MANTLE operations. ================================================================================ Every call on `MANTLE` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `consolidate` | 0 | yes | `<0.001 kWh` | | `anchor` | 0 | yes | `<0.001 kWh` | | `replay` | 0 | yes | `<0.001 kWh` | ## Rate card `MANTLE` is a **hybrid** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MANTLE` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MANTLE`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mantle/operations # Every operation on MANTLE. ================================================================================ The full operation table for `MANTLE`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mantle-lib` crate. ## Index | Operation | Summary | | --- | --- | | `consolidate` | Run consolidation pass: dedup, compress, distill, replay. Protected by EWC anchors. | | `anchor` | Declare a knowledge anchor — protected from rewriting during future consolidations. | | `replay` | Generative replay of rare event classes for memory rehearsal. | ## Reference ### `consolidate` Run consolidation pass: dedup, compress, distill, replay. Protected by EWC anchors. | Field | Value | | --- | --- | | Capability | `map.mantle.consolidate` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `anchor` Declare a knowledge anchor — protected from rewriting during future consolidations. | Field | Value | | --- | --- | | Capability | `map.mantle.anchor` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `replay` Generative replay of rare event classes for memory rehearsal. | Field | Value | | --- | --- | | Capability | `map.mantle.replay` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mantle/schemas # Request and response JSON schemas for MANTLE. ================================================================================ The OCIP contracts for `MANTLE` live in `/Volumes/L1feAI/l1feosx/map/schemas/mantle/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mantle/v1/ ├── index.json ├── operations.consolidate.request.json ├── operations.consolidate.response.json ├── operations.anchor.request.json ├── operations.anchor.response.json ├── operations.replay.request.json ├── operations.replay.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `consolidate` | `schemas/mantle/v1/operations.consolidate.request.json` | `schemas/mantle/v1/operations.consolidate.response.json` | | `anchor` | `schemas/mantle/v1/operations.anchor.request.json` | `schemas/mantle/v1/operations.anchor.response.json` | | `replay` | `schemas/mantle/v1/operations.replay.request.json` | `schemas/mantle/v1/operations.replay.response.json` | ## Published ```text https://schemas.multiagentic.dev/mantle/v1/operations..request.json https://schemas.multiagentic.dev/mantle/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mantle/sdks # Rust, TypeScript and HTTP for MANTLE. ================================================================================ Every operation on `MANTLE` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MANTLE", "v1.0.0", "consolidate", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MANTLE', version: 'v1.0.0', operation: 'consolidate', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MANTLE", "version": "v1.0.0", "operation": "consolidate", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"consolidate"` — Run consolidation pass: dedup, compress, distill, replay. Protected by EWC anchors. - `map.dispatch(...)` with operation `"anchor"` — Declare a knowledge anchor — protected from rewriting during future consolidations. - `map.dispatch(...)` with operation `"replay"` — Generative replay of rare event classes for memory rehearsal. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MARC # URL: https://docs.multiagentic.dev/docs/protocols/marc # Multi-Agent Reasoning & Causation · Reasoning, witnessed. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Reasoning, witnessed.** > > Hierarchical reasoning across abstract planning and concrete execution. Causal analysis. Model publishing. | Field | Value | | --- | --- | | Acronym | `MARC` | | Full name | Multi-Agent Reasoning & Causation | | Plane | II — Cognition | | Kind | Agent · Autonomous Org | | City role | Think tank | | Crate | `protocols/marc-lib` | | Status | Implemented · production-grade. | ## What this is Hierarchical reasoning across abstract planning and concrete execution. Causal analysis. Model publishing. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/marc/cli # `map invoke MARC` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MARC` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `reasoning_task` ```bash map invoke MARC reasoning_task --input '{"intent":"demo reasoning task","budget":{"tokens":4096,"deadline_ms":8000}}' ``` Submit a bounded reasoning task. Returns a derivation tree with citations and confidence band. Capability: `map.marc.reasoning_task` ### `publish_model` ```bash map invoke MARC publish_model --input '{"example":true}' ``` Register a reasoning model artifact in MARS under the calling org. Capability: `map.marc.publish_model` ### `share_model` ```bash map invoke MARC share_model --input '{"example":true}' ``` Share a published model with another org under a MOAT treaty. Capability: `map.marc.share_model` ### `causal_analysis` ```bash map invoke MARC causal_analysis --input '{"example":true}' ``` Compute P(Y | do(X)) over a Bayesian world-model snapshot from MIND. Capability: `map.marc.causal_analysis` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/marc/governance # Refusal posture, dissent preservation, audit footprint for MARC. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MARC` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MARC` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.marc.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MARC` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MARC` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/marc/internals # Crate path, key types, adjacent protocols for MARC. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MARC` (Multi-Agent Reasoning & Causation) lives in `protocols/marc-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/marc-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/marc-lib/src/protocol.rs` | core protocol logic | | `protocols/marc-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/marc-lib/tests/` | unit + integration tests | | `schemas/marc/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MarcProtocol { fn protocol_name(&self) -> &'static str { "MARC" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "reasoning_task", "publish_model", "share_model", "causal_analysis", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "reasoning_task" => self.reasoning_task(payload, ctx).await, "publish_model" => self.publish_model(payload, ctx).await, "share_model" => self.share_model(payload, ctx).await, "causal_analysis" => self.causal_analysis(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p marc-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/marc/metering # How MEAL meters MARC operations. ================================================================================ Every call on `MARC` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `reasoning_task` | yes | yes | yes | | `publish_model` | yes | yes | yes | | `share_model` | yes | yes | yes | | `causal_analysis` | yes | yes | yes | ## Rate card `MARC` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MARC` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MARC`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/marc/operations # Every operation on MARC. ================================================================================ The full operation table for `MARC`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/marc-lib` crate. ## Index | Operation | Summary | | --- | --- | | `reasoning_task` | Submit a bounded reasoning task. Returns a derivation tree with citations and confidence band. | | `publish_model` | Register a reasoning model artifact in MARS under the calling org. | | `share_model` | Share a published model with another org under a MOAT treaty. | | `causal_analysis` | Compute P(Y | do(X)) over a Bayesian world-model snapshot from MIND. | ## Reference ### `reasoning_task` Submit a bounded reasoning task. Returns a derivation tree with citations and confidence band. | Field | Value | | --- | --- | | Capability | `map.marc.reasoning_task` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "intent": "demo reasoning task", "budget": { "tokens": 4096, "deadline_ms": 8000 } } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `publish_model` Register a reasoning model artifact in MARS under the calling org. | Field | Value | | --- | --- | | Capability | `map.marc.publish_model` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `share_model` Share a published model with another org under a MOAT treaty. | Field | Value | | --- | --- | | Capability | `map.marc.share_model` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `causal_analysis` Compute P(Y | do(X)) over a Bayesian world-model snapshot from MIND. | Field | Value | | --- | --- | | Capability | `map.marc.causal_analysis` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/marc/schemas # Request and response JSON schemas for MARC. ================================================================================ The OCIP contracts for `MARC` live in `/Volumes/L1feAI/l1feosx/map/schemas/marc/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/marc/v1/ ├── index.json ├── operations.reasoning_task.request.json ├── operations.reasoning_task.response.json ├── operations.publish_model.request.json ├── operations.publish_model.response.json ├── operations.share_model.request.json ├── operations.share_model.response.json ├── operations.causal_analysis.request.json ├── operations.causal_analysis.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `reasoning_task` | `schemas/marc/v1/operations.reasoning_task.request.json` | `schemas/marc/v1/operations.reasoning_task.response.json` | | `publish_model` | `schemas/marc/v1/operations.publish_model.request.json` | `schemas/marc/v1/operations.publish_model.response.json` | | `share_model` | `schemas/marc/v1/operations.share_model.request.json` | `schemas/marc/v1/operations.share_model.response.json` | | `causal_analysis` | `schemas/marc/v1/operations.causal_analysis.request.json` | `schemas/marc/v1/operations.causal_analysis.response.json` | ## Published ```text https://schemas.multiagentic.dev/marc/v1/operations..request.json https://schemas.multiagentic.dev/marc/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/marc/sdks # Rust, TypeScript and HTTP for MARC. ================================================================================ Every operation on `MARC` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MARC", "v1.0.0", "reasoning_task", json!({ "intent": "demo reasoning task", "budget": { "tokens": 4096, "deadline_ms": 8000 } }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MARC', version: 'v1.0.0', operation: 'reasoning_task', input: { "intent": "demo reasoning task", "budget": { "tokens": 4096, "deadline_ms": 8000 } } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MARC", "version": "v1.0.0", "operation": "reasoning_task", "input": { "intent": "demo reasoning task", "budget": { "tokens": 4096, "deadline_ms": 8000 } }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"reasoning_task"` — Submit a bounded reasoning task. Returns a derivation tree with citations and confidence band. - `map.dispatch(...)` with operation `"publish_model"` — Register a reasoning model artifact in MARS under the calling org. - `map.dispatch(...)` with operation `"share_model"` — Share a published model with another org under a MOAT treaty. - `map.dispatch(...)` with operation `"causal_analysis"` — Compute P(Y | do(X)) over a Bayesian world-model snapshot from MIND. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MARE # URL: https://docs.multiagentic.dev/docs/protocols/mare # Multi-Agentic Reflexive Evaluation · Long memory; short forgiveness. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Long memory; short forgiveness.** > > Reputation built from outcomes, attestations, and decay. Stake-weighted, transferable, revocable. | Field | Value | | --- | --- | | Acronym | `MARE` | | Full name | Multi-Agentic Reflexive Evaluation | | Plane | III — Truth | | Kind | Hybrid · Protocol + Agent | | City role | Reflexive evaluator | | Crate | `protocols/mare-lib` | | Status | Implemented · production-grade. | ## What this is Reputation built from outcomes, attestations, and decay. Stake-weighted, transferable, revocable. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mare/cli # `map invoke MARE` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MARE` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `score` ```bash map invoke MARE score --input '{"example":true}' ``` Compute current reputation for a DID, scoped by domain and capability. Capability: `map.mare.score` ### `stake` ```bash map invoke MARE stake --input '{"example":true}' ``` Stake reputation on a claim or commitment; slashable if the claim fails. Capability: `map.mare.stake` ### `slash` ```bash map invoke MARE slash --input '{"example":true}' ``` Slash reputation under MOOT arbitration; recorded with full justification. Capability: `map.mare.slash` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mare/governance # Refusal posture, dissent preservation, audit footprint for MARE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MARE` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MARE` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mare.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MARE` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MARE` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mare/internals # Crate path, key types, adjacent protocols for MARE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MARE` (Multi-Agentic Reflexive Evaluation) lives in `protocols/mare-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mare-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mare-lib/src/protocol.rs` | core protocol logic | | `protocols/mare-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mare-lib/tests/` | unit + integration tests | | `schemas/mare/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MareProtocol { fn protocol_name(&self) -> &'static str { "MARE" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "score", "stake", "slash", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "score" => self.score(payload, ctx).await, "stake" => self.stake(payload, ctx).await, "slash" => self.slash(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mare-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mare/metering # How MEAL meters MARE operations. ================================================================================ Every call on `MARE` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `score` | 0 | yes | `<0.001 kWh` | | `stake` | 0 | yes | `<0.001 kWh` | | `slash` | 0 | yes | `<0.001 kWh` | ## Rate card `MARE` is a **hybrid** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MARE` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MARE`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mare/operations # Every operation on MARE. ================================================================================ The full operation table for `MARE`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mare-lib` crate. ## Index | Operation | Summary | | --- | --- | | `score` | Compute current reputation for a DID, scoped by domain and capability. | | `stake` | Stake reputation on a claim or commitment; slashable if the claim fails. | | `slash` | Slash reputation under MOOT arbitration; recorded with full justification. | ## Reference ### `score` Compute current reputation for a DID, scoped by domain and capability. | Field | Value | | --- | --- | | Capability | `map.mare.score` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `stake` Stake reputation on a claim or commitment; slashable if the claim fails. | Field | Value | | --- | --- | | Capability | `map.mare.stake` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `slash` Slash reputation under MOOT arbitration; recorded with full justification. | Field | Value | | --- | --- | | Capability | `map.mare.slash` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mare/schemas # Request and response JSON schemas for MARE. ================================================================================ The OCIP contracts for `MARE` live in `/Volumes/L1feAI/l1feosx/map/schemas/mare/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mare/v1/ ├── index.json ├── operations.score.request.json ├── operations.score.response.json ├── operations.stake.request.json ├── operations.stake.response.json ├── operations.slash.request.json ├── operations.slash.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `score` | `schemas/mare/v1/operations.score.request.json` | `schemas/mare/v1/operations.score.response.json` | | `stake` | `schemas/mare/v1/operations.stake.request.json` | `schemas/mare/v1/operations.stake.response.json` | | `slash` | `schemas/mare/v1/operations.slash.request.json` | `schemas/mare/v1/operations.slash.response.json` | ## Published ```text https://schemas.multiagentic.dev/mare/v1/operations..request.json https://schemas.multiagentic.dev/mare/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mare/sdks # Rust, TypeScript and HTTP for MARE. ================================================================================ Every operation on `MARE` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MARE", "v1.0.0", "score", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MARE', version: 'v1.0.0', operation: 'score', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MARE", "version": "v1.0.0", "operation": "score", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"score"` — Compute current reputation for a DID, scoped by domain and capability. - `map.dispatch(...)` with operation `"stake"` — Stake reputation on a claim or commitment; slashable if the claim fails. - `map.dispatch(...)` with operation `"slash"` — Slash reputation under MOOT arbitration; recorded with full justification. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MARI # URL: https://docs.multiagentic.dev/docs/protocols/mari # Multi-Agent Research & Inquiry · The institution wonders. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **The institution wonders.** > > Open-ended research and inquiry via ORIGIN engine. Literature synthesis. Hypothesis testing. | Field | Value | | --- | --- | | Acronym | `MARI` | | Full name | Multi-Agent Research & Inquiry | | Plane | VII — Awareness | | Kind | Agent · Autonomous Org | | City role | Research institute | | Crate | `protocols/mari` | | Status | Implemented · production-grade. | ## What this is Open-ended research and inquiry via ORIGIN engine. Literature synthesis. Hypothesis testing. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mari/cli # `map invoke MARI` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MARI` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `inquire` ```bash map invoke MARI inquire --input '{"example":true}' ``` Launch an open-ended inquiry under declared budget and policy. Capability: `map.mari.inquire` ### `synthesize` ```bash map invoke MARI synthesize --input '{"example":true}' ``` Synthesize findings across sources into a structured report. Capability: `map.mari.synthesize` ### `uncertainty` ```bash map invoke MARI uncertainty --input '{"example":true}' ``` Surface an explicit map of what remains uncertain after inquiry. Capability: `map.mari.uncertainty` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mari/governance # Refusal posture, dissent preservation, audit footprint for MARI. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MARI` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MARI` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mari.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MARI` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MARI` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mari/internals # Crate path, key types, adjacent protocols for MARI. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MARI` (Multi-Agent Research & Inquiry) lives in `protocols/mari`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mari/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mari/src/protocol.rs` | core protocol logic | | `protocols/mari/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mari/tests/` | unit + integration tests | | `schemas/mari/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MariProtocol { fn protocol_name(&self) -> &'static str { "MARI" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "inquire", "synthesize", "uncertainty", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "inquire" => self.inquire(payload, ctx).await, "synthesize" => self.synthesize(payload, ctx).await, "uncertainty" => self.uncertainty(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mari --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mari/metering # How MEAL meters MARI operations. ================================================================================ Every call on `MARI` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `inquire` | yes | yes | yes | | `synthesize` | yes | yes | yes | | `uncertainty` | yes | yes | yes | ## Rate card `MARI` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MARI` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MARI`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mari/operations # Every operation on MARI. ================================================================================ The full operation table for `MARI`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mari` crate. ## Index | Operation | Summary | | --- | --- | | `inquire` | Launch an open-ended inquiry under declared budget and policy. | | `synthesize` | Synthesize findings across sources into a structured report. | | `uncertainty` | Surface an explicit map of what remains uncertain after inquiry. | ## Reference ### `inquire` Launch an open-ended inquiry under declared budget and policy. | Field | Value | | --- | --- | | Capability | `map.mari.inquire` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `synthesize` Synthesize findings across sources into a structured report. | Field | Value | | --- | --- | | Capability | `map.mari.synthesize` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `uncertainty` Surface an explicit map of what remains uncertain after inquiry. | Field | Value | | --- | --- | | Capability | `map.mari.uncertainty` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mari/schemas # Request and response JSON schemas for MARI. ================================================================================ The OCIP contracts for `MARI` live in `/Volumes/L1feAI/l1feosx/map/schemas/mari/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mari/v1/ ├── index.json ├── operations.inquire.request.json ├── operations.inquire.response.json ├── operations.synthesize.request.json ├── operations.synthesize.response.json ├── operations.uncertainty.request.json ├── operations.uncertainty.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `inquire` | `schemas/mari/v1/operations.inquire.request.json` | `schemas/mari/v1/operations.inquire.response.json` | | `synthesize` | `schemas/mari/v1/operations.synthesize.request.json` | `schemas/mari/v1/operations.synthesize.response.json` | | `uncertainty` | `schemas/mari/v1/operations.uncertainty.request.json` | `schemas/mari/v1/operations.uncertainty.response.json` | ## Published ```text https://schemas.multiagentic.dev/mari/v1/operations..request.json https://schemas.multiagentic.dev/mari/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mari/sdks # Rust, TypeScript and HTTP for MARI. ================================================================================ Every operation on `MARI` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MARI", "v1.0.0", "inquire", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MARI', version: 'v1.0.0', operation: 'inquire', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MARI", "version": "v1.0.0", "operation": "inquire", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"inquire"` — Launch an open-ended inquiry under declared budget and policy. - `map.dispatch(...)` with operation `"synthesize"` — Synthesize findings across sources into a structured report. - `map.dispatch(...)` with operation `"uncertainty"` — Surface an explicit map of what remains uncertain after inquiry. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MARKET # URL: https://docs.multiagentic.dev/docs/protocols/market # Multi-Agent Registry for Economic Trading · Capability and demand meet. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Capability and demand meet.** > > Registry for economic trading. Asset genesis, orders, bounties, orderbook queries, trades. | Field | Value | | --- | --- | | Acronym | `MARKET` | | Full name | Multi-Agent Registry for Economic Trading | | Plane | VI — Economic | | Kind | Agent · Autonomous Org | | City role | Exchange | | Crate | `protocols/market-lib` | | Status | Implemented · production-grade. | ## What this is Registry for economic trading. Asset genesis, orders, bounties, orderbook queries, trades. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/market/cli # `map invoke MARKET` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MARKET` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `asset_genesis` ```bash map invoke MARKET asset_genesis --input '{"example":true}' ``` Originate a new tradable asset; registers with MARS and economic schema. Capability: `map.market.asset_genesis` ### `create_order` ```bash map invoke MARKET create_order --input '{"example":true}' ``` Place an order against an active book. Capability: `map.market.create_order` ### `modify_order` ```bash map invoke MARKET modify_order --input '{"example":true}' ``` Modify an open order: price, size, expiry. Capability: `map.market.modify_order` ### `cancel_order` ```bash map invoke MARKET cancel_order --input '{"example":true}' ``` Cancel an open order; reason recorded. Capability: `map.market.cancel_order` ### `create_bounty` ```bash map invoke MARKET create_bounty --input '{"example":true}' ``` Open a bounty (reverse auction) for a declared capability deliverable. Capability: `map.market.create_bounty` ### `query_orderbook` ```bash map invoke MARKET query_orderbook --input '{"example":true}' ``` Query the orderbook by predicate; supports streaming. Capability: `map.market.query_orderbook` ### `execute_trade` ```bash map invoke MARKET execute_trade --input '{"example":true}' ``` Execute a matched trade; settles through MADE. Capability: `map.market.execute_trade` ### `trade_history` ```bash map invoke MARKET trade_history --input '{"example":true}' ``` Query historical trades; bounded by capability and treaty. Capability: `map.market.trade_history` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/market/governance # Refusal posture, dissent preservation, audit footprint for MARKET. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MARKET` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MARKET` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.market.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MARKET` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MARKET` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/market/internals # Crate path, key types, adjacent protocols for MARKET. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MARKET` (Multi-Agent Registry for Economic Trading) lives in `protocols/market-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/market-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/market-lib/src/protocol.rs` | core protocol logic | | `protocols/market-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/market-lib/tests/` | unit + integration tests | | `schemas/market/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MarketProtocol { fn protocol_name(&self) -> &'static str { "MARKET" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "asset_genesis", "create_order", "modify_order", "cancel_order", "create_bounty", "query_orderbook", "execute_trade", "trade_history", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "asset_genesis" => self.asset_genesis(payload, ctx).await, "create_order" => self.create_order(payload, ctx).await, "modify_order" => self.modify_order(payload, ctx).await, "cancel_order" => self.cancel_order(payload, ctx).await, "create_bounty" => self.create_bounty(payload, ctx).await, "query_orderbook" => self.query_orderbook(payload, ctx).await, "execute_trade" => self.execute_trade(payload, ctx).await, "trade_history" => self.trade_history(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p market-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/market/metering # How MEAL meters MARKET operations. ================================================================================ Every call on `MARKET` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `asset_genesis` | yes | yes | yes | | `create_order` | yes | yes | yes | | `modify_order` | yes | yes | yes | | `cancel_order` | yes | yes | yes | | `create_bounty` | yes | yes | yes | | `query_orderbook` | yes | yes | yes | | `execute_trade` | yes | yes | yes | | `trade_history` | yes | yes | yes | ## Rate card `MARKET` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MARKET` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MARKET`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/market/operations # Every operation on MARKET. ================================================================================ The full operation table for `MARKET`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/market-lib` crate. ## Index | Operation | Summary | | --- | --- | | `asset_genesis` | Originate a new tradable asset; registers with MARS and economic schema. | | `create_order` | Place an order against an active book. | | `modify_order` | Modify an open order: price, size, expiry. | | `cancel_order` | Cancel an open order; reason recorded. | | `create_bounty` | Open a bounty (reverse auction) for a declared capability deliverable. | | `query_orderbook` | Query the orderbook by predicate; supports streaming. | | `execute_trade` | Execute a matched trade; settles through MADE. | | `trade_history` | Query historical trades; bounded by capability and treaty. | ## Reference ### `asset_genesis` Originate a new tradable asset; registers with MARS and economic schema. | Field | Value | | --- | --- | | Capability | `map.market.asset_genesis` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `create_order` Place an order against an active book. | Field | Value | | --- | --- | | Capability | `map.market.create_order` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `modify_order` Modify an open order: price, size, expiry. | Field | Value | | --- | --- | | Capability | `map.market.modify_order` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `cancel_order` Cancel an open order; reason recorded. | Field | Value | | --- | --- | | Capability | `map.market.cancel_order` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `create_bounty` Open a bounty (reverse auction) for a declared capability deliverable. | Field | Value | | --- | --- | | Capability | `map.market.create_bounty` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `query_orderbook` Query the orderbook by predicate; supports streaming. | Field | Value | | --- | --- | | Capability | `map.market.query_orderbook` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `execute_trade` Execute a matched trade; settles through MADE. | Field | Value | | --- | --- | | Capability | `map.market.execute_trade` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `trade_history` Query historical trades; bounded by capability and treaty. | Field | Value | | --- | --- | | Capability | `map.market.trade_history` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/market/schemas # Request and response JSON schemas for MARKET. ================================================================================ The OCIP contracts for `MARKET` live in `/Volumes/L1feAI/l1feosx/map/schemas/market/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/market/v1/ ├── index.json ├── operations.asset_genesis.request.json ├── operations.asset_genesis.response.json ├── operations.create_order.request.json ├── operations.create_order.response.json ├── operations.modify_order.request.json ├── operations.modify_order.response.json ├── operations.cancel_order.request.json ├── operations.cancel_order.response.json ├── operations.create_bounty.request.json ├── operations.create_bounty.response.json ├── operations.query_orderbook.request.json ├── operations.query_orderbook.response.json ├── operations.execute_trade.request.json ├── operations.execute_trade.response.json ├── operations.trade_history.request.json ├── operations.trade_history.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `asset_genesis` | `schemas/market/v1/operations.asset_genesis.request.json` | `schemas/market/v1/operations.asset_genesis.response.json` | | `create_order` | `schemas/market/v1/operations.create_order.request.json` | `schemas/market/v1/operations.create_order.response.json` | | `modify_order` | `schemas/market/v1/operations.modify_order.request.json` | `schemas/market/v1/operations.modify_order.response.json` | | `cancel_order` | `schemas/market/v1/operations.cancel_order.request.json` | `schemas/market/v1/operations.cancel_order.response.json` | | `create_bounty` | `schemas/market/v1/operations.create_bounty.request.json` | `schemas/market/v1/operations.create_bounty.response.json` | | `query_orderbook` | `schemas/market/v1/operations.query_orderbook.request.json` | `schemas/market/v1/operations.query_orderbook.response.json` | | `execute_trade` | `schemas/market/v1/operations.execute_trade.request.json` | `schemas/market/v1/operations.execute_trade.response.json` | | `trade_history` | `schemas/market/v1/operations.trade_history.request.json` | `schemas/market/v1/operations.trade_history.response.json` | ## Published ```text https://schemas.multiagentic.dev/market/v1/operations..request.json https://schemas.multiagentic.dev/market/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/market/sdks # Rust, TypeScript and HTTP for MARKET. ================================================================================ Every operation on `MARKET` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MARKET", "v1.0.0", "asset_genesis", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MARKET', version: 'v1.0.0', operation: 'asset_genesis', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MARKET", "version": "v1.0.0", "operation": "asset_genesis", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"asset_genesis"` — Originate a new tradable asset; registers with MARS and economic schema. - `map.dispatch(...)` with operation `"create_order"` — Place an order against an active book. - `map.dispatch(...)` with operation `"modify_order"` — Modify an open order: price, size, expiry. - `map.dispatch(...)` with operation `"cancel_order"` — Cancel an open order; reason recorded. - `map.dispatch(...)` with operation `"create_bounty"` — Open a bounty (reverse auction) for a declared capability deliverable. - `map.dispatch(...)` with operation `"query_orderbook"` — Query the orderbook by predicate; supports streaming. - `map.dispatch(...)` with operation `"execute_trade"` — Execute a matched trade; settles through MADE. - `map.dispatch(...)` with operation `"trade_history"` — Query historical trades; bounded by capability and treaty. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MARS # URL: https://docs.multiagentic.dev/docs/protocols/mars # Multi-Agentic Registry Service · Every asset of standing. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Every asset of standing.** > > Universal registry. Datasets, models, contracts, real things — with provenance and rights. | Field | Value | | --- | --- | | Acronym | `MARS` | | Full name | Multi-Agentic Registry Service | | Plane | VII — Awareness | | Kind | Protocol · Stateless | | City role | City directory | | Crate | `protocols/mars-lib` | | Status | Implemented · production-grade. | ## What this is Universal registry. Datasets, models, contracts, real things — with provenance and rights. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mars/cli # `map invoke MARS` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MARS` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `register_agent` ```bash map invoke MARS register_agent --input '{"did":"did:oas:l1fe:agent:0x...","capabilities":[]}' ``` Register an agent with its OAS DID and capability declaration. Capability: `map.mars.register_agent` ### `query_registry` ```bash map invoke MARS query_registry --input '{"example":true}' ``` Query the registry by predicate; supports paging and capability filters. Capability: `map.mars.query_registry` ### `publish_manifest` ```bash map invoke MARS publish_manifest --input '{"example":true}' ``` Publish an artifact manifest (workflow, model, asset) with provenance. Capability: `map.mars.publish_manifest` ### `discovery` ```bash map invoke MARS discovery --input '{"example":true}' ``` Discover entities/assets matching a capability or schema predicate. Capability: `map.mars.discovery` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mars/governance # Refusal posture, dissent preservation, audit footprint for MARS. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MARS` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MARS` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mars.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MARS` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MARS` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mars/internals # Crate path, key types, adjacent protocols for MARS. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MARS` (Multi-Agentic Registry Service) lives in `protocols/mars-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mars-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mars-lib/src/protocol.rs` | core protocol logic | | `protocols/mars-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mars-lib/tests/` | unit + integration tests | | `schemas/mars/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MarsProtocol { fn protocol_name(&self) -> &'static str { "MARS" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "register_agent", "query_registry", "publish_manifest", "discovery", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "register_agent" => self.register_agent(payload, ctx).await, "query_registry" => self.query_registry(payload, ctx).await, "publish_manifest" => self.publish_manifest(payload, ctx).await, "discovery" => self.discovery(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mars-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mars/metering # How MEAL meters MARS operations. ================================================================================ Every call on `MARS` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `register_agent` | 0 | yes | `<0.001 kWh` | | `query_registry` | 0 | yes | `<0.001 kWh` | | `publish_manifest` | 0 | yes | `<0.001 kWh` | | `discovery` | 0 | yes | `<0.001 kWh` | ## Rate card `MARS` is a **protocol** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MARS` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MARS`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mars/operations # Every operation on MARS. ================================================================================ The full operation table for `MARS`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mars-lib` crate. ## Index | Operation | Summary | | --- | --- | | `register_agent` | Register an agent with its OAS DID and capability declaration. | | `query_registry` | Query the registry by predicate; supports paging and capability filters. | | `publish_manifest` | Publish an artifact manifest (workflow, model, asset) with provenance. | | `discovery` | Discover entities/assets matching a capability or schema predicate. | ## Reference ### `register_agent` Register an agent with its OAS DID and capability declaration. | Field | Value | | --- | --- | | Capability | `map.mars.register_agent` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "did": "did:oas:l1fe:agent:0x...", "capabilities": [] } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `query_registry` Query the registry by predicate; supports paging and capability filters. | Field | Value | | --- | --- | | Capability | `map.mars.query_registry` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `publish_manifest` Publish an artifact manifest (workflow, model, asset) with provenance. | Field | Value | | --- | --- | | Capability | `map.mars.publish_manifest` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `discovery` Discover entities/assets matching a capability or schema predicate. | Field | Value | | --- | --- | | Capability | `map.mars.discovery` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mars/schemas # Request and response JSON schemas for MARS. ================================================================================ The OCIP contracts for `MARS` live in `/Volumes/L1feAI/l1feosx/map/schemas/mars/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mars/v1/ ├── index.json ├── operations.register_agent.request.json ├── operations.register_agent.response.json ├── operations.query_registry.request.json ├── operations.query_registry.response.json ├── operations.publish_manifest.request.json ├── operations.publish_manifest.response.json ├── operations.discovery.request.json ├── operations.discovery.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `register_agent` | `schemas/mars/v1/operations.register_agent.request.json` | `schemas/mars/v1/operations.register_agent.response.json` | | `query_registry` | `schemas/mars/v1/operations.query_registry.request.json` | `schemas/mars/v1/operations.query_registry.response.json` | | `publish_manifest` | `schemas/mars/v1/operations.publish_manifest.request.json` | `schemas/mars/v1/operations.publish_manifest.response.json` | | `discovery` | `schemas/mars/v1/operations.discovery.request.json` | `schemas/mars/v1/operations.discovery.response.json` | ## Published ```text https://schemas.multiagentic.dev/mars/v1/operations..request.json https://schemas.multiagentic.dev/mars/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mars/sdks # Rust, TypeScript and HTTP for MARS. ================================================================================ Every operation on `MARS` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MARS", "v1.0.0", "register_agent", json!({ "did": "did:oas:l1fe:agent:0x...", "capabilities": [] }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MARS', version: 'v1.0.0', operation: 'register_agent', input: { "did": "did:oas:l1fe:agent:0x...", "capabilities": [] } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MARS", "version": "v1.0.0", "operation": "register_agent", "input": { "did": "did:oas:l1fe:agent:0x...", "capabilities": [] }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"register_agent"` — Register an agent with its OAS DID and capability declaration. - `map.dispatch(...)` with operation `"query_registry"` — Query the registry by predicate; supports paging and capability filters. - `map.dispatch(...)` with operation `"publish_manifest"` — Publish an artifact manifest (workflow, model, asset) with provenance. - `map.dispatch(...)` with operation `"discovery"` — Discover entities/assets matching a capability or schema predicate. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MAT # URL: https://docs.multiagentic.dev/docs/protocols/mat # Multi-Agentic Tool · Task Allocation · No work goes unowned. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **No work goes unowned.** > > Tool dispatch and discovery. Workflow execution. Capability-scoped invocation. | Field | Value | | --- | --- | | Acronym | `MAT` | | Full name | Multi-Agentic Tool · Task Allocation | | Plane | V — Execution | | Kind | Protocol · Stateless | | City role | Labor exchange | | Crate | `protocols/mat-lib` | | Status | Implemented · production-grade. | ## What this is Tool dispatch and discovery. Workflow execution. Capability-scoped invocation. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mat/cli # `map invoke MAT` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MAT` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `tool` ```bash map invoke MAT tool --input '{"example":true}' ``` Invoke a registered tool by name under capability scope. Capability: `map.mat.tool` ### `tool_discovery` ```bash map invoke MAT tool_discovery --input '{"example":true}' ``` Discover registered tools matching a capability or schema predicate. Capability: `map.mat.tool_discovery` ### `tool_workflow_execute` ```bash map invoke MAT tool_workflow_execute --input '{"example":true}' ``` Execute a multi-step tool workflow declared as a graph. Capability: `map.mat.tool_workflow_execute` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mat/governance # Refusal posture, dissent preservation, audit footprint for MAT. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAT` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MAT` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mat.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MAT` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MAT` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mat/internals # Crate path, key types, adjacent protocols for MAT. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAT` (Multi-Agentic Tool · Task Allocation) lives in `protocols/mat-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mat-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mat-lib/src/protocol.rs` | core protocol logic | | `protocols/mat-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mat-lib/tests/` | unit + integration tests | | `schemas/mat/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MatProtocol { fn protocol_name(&self) -> &'static str { "MAT" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "tool", "tool_discovery", "tool_workflow_execute", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "tool" => self.tool(payload, ctx).await, "tool_discovery" => self.tool_discovery(payload, ctx).await, "tool_workflow_execute" => self.tool_workflow_execute(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mat-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mat/metering # How MEAL meters MAT operations. ================================================================================ Every call on `MAT` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `tool` | 0 | yes | `<0.001 kWh` | | `tool_discovery` | 0 | yes | `<0.001 kWh` | | `tool_workflow_execute` | 0 | yes | `<0.001 kWh` | ## Rate card `MAT` is a **protocol** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MAT` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MAT`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mat/operations # Every operation on MAT. ================================================================================ The full operation table for `MAT`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mat-lib` crate. ## Index | Operation | Summary | | --- | --- | | `tool` | Invoke a registered tool by name under capability scope. | | `tool_discovery` | Discover registered tools matching a capability or schema predicate. | | `tool_workflow_execute` | Execute a multi-step tool workflow declared as a graph. | ## Reference ### `tool` Invoke a registered tool by name under capability scope. | Field | Value | | --- | --- | | Capability | `map.mat.tool` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `tool_discovery` Discover registered tools matching a capability or schema predicate. | Field | Value | | --- | --- | | Capability | `map.mat.tool_discovery` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `tool_workflow_execute` Execute a multi-step tool workflow declared as a graph. | Field | Value | | --- | --- | | Capability | `map.mat.tool_workflow_execute` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mat/schemas # Request and response JSON schemas for MAT. ================================================================================ The OCIP contracts for `MAT` live in `/Volumes/L1feAI/l1feosx/map/schemas/mat/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mat/v1/ ├── index.json ├── operations.tool.request.json ├── operations.tool.response.json ├── operations.tool_discovery.request.json ├── operations.tool_discovery.response.json ├── operations.tool_workflow_execute.request.json ├── operations.tool_workflow_execute.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `tool` | `schemas/mat/v1/operations.tool.request.json` | `schemas/mat/v1/operations.tool.response.json` | | `tool_discovery` | `schemas/mat/v1/operations.tool_discovery.request.json` | `schemas/mat/v1/operations.tool_discovery.response.json` | | `tool_workflow_execute` | `schemas/mat/v1/operations.tool_workflow_execute.request.json` | `schemas/mat/v1/operations.tool_workflow_execute.response.json` | ## Published ```text https://schemas.multiagentic.dev/mat/v1/operations..request.json https://schemas.multiagentic.dev/mat/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mat/sdks # Rust, TypeScript and HTTP for MAT. ================================================================================ Every operation on `MAT` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MAT", "v1.0.0", "tool", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MAT', version: 'v1.0.0', operation: 'tool', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MAT", "version": "v1.0.0", "operation": "tool", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"tool"` — Invoke a registered tool by name under capability scope. - `map.dispatch(...)` with operation `"tool_discovery"` — Discover registered tools matching a capability or schema predicate. - `map.dispatch(...)` with operation `"tool_workflow_execute"` — Execute a multi-step tool workflow declared as a graph. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MATA # URL: https://docs.multiagentic.dev/docs/protocols/mata # Multi-Agentic Trust Adaptation · Disagreement is data. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Disagreement is data.** > > Bayesian opinion pooling across heterogeneous sources. Disagreement preserved, weighted, surfaced. | Field | Value | | --- | --- | | Acronym | `MATA` | | Full name | Multi-Agentic Trust Adaptation | | Plane | III — Truth | | Kind | Agent · Autonomous Org | | City role | Credit bureau | | Crate | `protocols/mata-lib` | | Status | Implemented · production-grade. | ## What this is Bayesian opinion pooling across heterogeneous sources. Disagreement preserved, weighted, surfaced. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mata/cli # `map invoke MATA` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MATA` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `pool` ```bash map invoke MATA pool --input '{"example":true}' ``` Pool multiple attestations into a composite Bayesian distribution. Capability: `map.mata.pool` ### `weight` ```bash map invoke MATA weight --input '{"example":true}' ``` Compute source-weighted credence for a target claim. Capability: `map.mata.weight` ### `divergence` ```bash map invoke MATA divergence --input '{"example":true}' ``` Surface the divergence between pooled sources — disagreement becomes evidence. Capability: `map.mata.divergence` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mata/governance # Refusal posture, dissent preservation, audit footprint for MATA. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MATA` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MATA` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mata.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MATA` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MATA` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mata/internals # Crate path, key types, adjacent protocols for MATA. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MATA` (Multi-Agentic Trust Adaptation) lives in `protocols/mata-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mata-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mata-lib/src/protocol.rs` | core protocol logic | | `protocols/mata-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mata-lib/tests/` | unit + integration tests | | `schemas/mata/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MataProtocol { fn protocol_name(&self) -> &'static str { "MATA" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "pool", "weight", "divergence", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "pool" => self.pool(payload, ctx).await, "weight" => self.weight(payload, ctx).await, "divergence" => self.divergence(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mata-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mata/metering # How MEAL meters MATA operations. ================================================================================ Every call on `MATA` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `pool` | yes | yes | yes | | `weight` | yes | yes | yes | | `divergence` | yes | yes | yes | ## Rate card `MATA` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MATA` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MATA`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mata/operations # Every operation on MATA. ================================================================================ The full operation table for `MATA`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mata-lib` crate. ## Index | Operation | Summary | | --- | --- | | `pool` | Pool multiple attestations into a composite Bayesian distribution. | | `weight` | Compute source-weighted credence for a target claim. | | `divergence` | Surface the divergence between pooled sources — disagreement becomes evidence. | ## Reference ### `pool` Pool multiple attestations into a composite Bayesian distribution. | Field | Value | | --- | --- | | Capability | `map.mata.pool` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `weight` Compute source-weighted credence for a target claim. | Field | Value | | --- | --- | | Capability | `map.mata.weight` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `divergence` Surface the divergence between pooled sources — disagreement becomes evidence. | Field | Value | | --- | --- | | Capability | `map.mata.divergence` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mata/schemas # Request and response JSON schemas for MATA. ================================================================================ The OCIP contracts for `MATA` live in `/Volumes/L1feAI/l1feosx/map/schemas/mata/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mata/v1/ ├── index.json ├── operations.pool.request.json ├── operations.pool.response.json ├── operations.weight.request.json ├── operations.weight.response.json ├── operations.divergence.request.json ├── operations.divergence.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `pool` | `schemas/mata/v1/operations.pool.request.json` | `schemas/mata/v1/operations.pool.response.json` | | `weight` | `schemas/mata/v1/operations.weight.request.json` | `schemas/mata/v1/operations.weight.response.json` | | `divergence` | `schemas/mata/v1/operations.divergence.request.json` | `schemas/mata/v1/operations.divergence.response.json` | ## Published ```text https://schemas.multiagentic.dev/mata/v1/operations..request.json https://schemas.multiagentic.dev/mata/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mata/sdks # Rust, TypeScript and HTTP for MATA. ================================================================================ Every operation on `MATA` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MATA", "v1.0.0", "pool", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MATA', version: 'v1.0.0', operation: 'pool', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MATA", "version": "v1.0.0", "operation": "pool", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"pool"` — Pool multiple attestations into a composite Bayesian distribution. - `map.dispatch(...)` with operation `"weight"` — Compute source-weighted credence for a target claim. - `map.dispatch(...)` with operation `"divergence"` — Surface the divergence between pooled sources — disagreement becomes evidence. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MAUSOLEUM # URL: https://docs.multiagentic.dev/docs/protocols/mausoleum # Universal Stasis, Evocation, Liquidation, Encryption, Universal Moratorium · Organizations end. MAP records the end. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Organizations end. MAP records the end.** > > Dissolution. Archive of record. Succession of obligation. Sealed audit chain in perpetuity. | Field | Value | | --- | --- | | Acronym | `MAUSOLEUM` | | Full name | Universal Stasis, Evocation, Liquidation, Encryption, Universal Moratorium | | Plane | IV — Governance | | Kind | Agent · Autonomous Org | | City role | Dissolution service | | Crate | `protocols/mausoleum-lib` | | Status | Implemented · production-grade. | ## What this is Dissolution. Archive of record. Succession of obligation. Sealed audit chain in perpetuity. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mausoleum/cli # `map invoke MAUSOLEUM` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MAUSOLEUM` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `initiate` ```bash map invoke MAUSOLEUM initiate --input '{"example":true}' ``` Begin the dissolution sequence under charter authority. Capability: `map.mausoleum.initiate` ### `distribute` ```bash map invoke MAUSOLEUM distribute --input '{"example":true}' ``` Execute asset distribution schedule; receipts recorded. Capability: `map.mausoleum.distribute` ### `seal` ```bash map invoke MAUSOLEUM seal --input '{"example":true}' ``` Seal the audit chain; final hash published to MARS for perpetual verification. Capability: `map.mausoleum.seal` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mausoleum/governance # Refusal posture, dissent preservation, audit footprint for MAUSOLEUM. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAUSOLEUM` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MAUSOLEUM` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mausoleum.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MAUSOLEUM` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MAUSOLEUM` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mausoleum/internals # Crate path, key types, adjacent protocols for MAUSOLEUM. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAUSOLEUM` (Universal Stasis, Evocation, Liquidation, Encryption, Universal Moratorium) lives in `protocols/mausoleum-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mausoleum-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mausoleum-lib/src/protocol.rs` | core protocol logic | | `protocols/mausoleum-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mausoleum-lib/tests/` | unit + integration tests | | `schemas/mausoleum/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MausoleumProtocol { fn protocol_name(&self) -> &'static str { "MAUSOLEUM" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "initiate", "distribute", "seal", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "initiate" => self.initiate(payload, ctx).await, "distribute" => self.distribute(payload, ctx).await, "seal" => self.seal(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mausoleum-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mausoleum/metering # How MEAL meters MAUSOLEUM operations. ================================================================================ Every call on `MAUSOLEUM` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `initiate` | yes | yes | yes | | `distribute` | yes | yes | yes | | `seal` | yes | yes | yes | ## Rate card `MAUSOLEUM` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MAUSOLEUM` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MAUSOLEUM`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mausoleum/operations # Every operation on MAUSOLEUM. ================================================================================ The full operation table for `MAUSOLEUM`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mausoleum-lib` crate. ## Index | Operation | Summary | | --- | --- | | `initiate` | Begin the dissolution sequence under charter authority. | | `distribute` | Execute asset distribution schedule; receipts recorded. | | `seal` | Seal the audit chain; final hash published to MARS for perpetual verification. | ## Reference ### `initiate` Begin the dissolution sequence under charter authority. | Field | Value | | --- | --- | | Capability | `map.mausoleum.initiate` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `distribute` Execute asset distribution schedule; receipts recorded. | Field | Value | | --- | --- | | Capability | `map.mausoleum.distribute` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `seal` Seal the audit chain; final hash published to MARS for perpetual verification. | Field | Value | | --- | --- | | Capability | `map.mausoleum.seal` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mausoleum/schemas # Request and response JSON schemas for MAUSOLEUM. ================================================================================ The OCIP contracts for `MAUSOLEUM` live in `/Volumes/L1feAI/l1feosx/map/schemas/mausoleum/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mausoleum/v1/ ├── index.json ├── operations.initiate.request.json ├── operations.initiate.response.json ├── operations.distribute.request.json ├── operations.distribute.response.json ├── operations.seal.request.json ├── operations.seal.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `initiate` | `schemas/mausoleum/v1/operations.initiate.request.json` | `schemas/mausoleum/v1/operations.initiate.response.json` | | `distribute` | `schemas/mausoleum/v1/operations.distribute.request.json` | `schemas/mausoleum/v1/operations.distribute.response.json` | | `seal` | `schemas/mausoleum/v1/operations.seal.request.json` | `schemas/mausoleum/v1/operations.seal.response.json` | ## Published ```text https://schemas.multiagentic.dev/mausoleum/v1/operations..request.json https://schemas.multiagentic.dev/mausoleum/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mausoleum/sdks # Rust, TypeScript and HTTP for MAUSOLEUM. ================================================================================ Every operation on `MAUSOLEUM` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MAUSOLEUM", "v1.0.0", "initiate", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MAUSOLEUM', version: 'v1.0.0', operation: 'initiate', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MAUSOLEUM", "version": "v1.0.0", "operation": "initiate", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"initiate"` — Begin the dissolution sequence under charter authority. - `map.dispatch(...)` with operation `"distribute"` — Execute asset distribution schedule; receipts recorded. - `map.dispatch(...)` with operation `"seal"` — Seal the audit chain; final hash published to MARS for perpetual verification. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MAVEN # URL: https://docs.multiagentic.dev/docs/protocols/maven # Multi-Agentic Veracity & Evidence Nexus · Claims-as-graphs. Provenance to the byte. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Claims-as-graphs. Provenance to the byte.** > > Evidence verification via GLYPH engine. Cryptographic source attestation. Contradiction preservation. | Field | Value | | --- | --- | | Acronym | `MAVEN` | | Full name | Multi-Agentic Veracity & Evidence Nexus | | Plane | III — Truth | | Kind | Agent · Autonomous Org | | City role | Forensic lab | | Crate | `protocols/maven-lib` | | Status | Implemented · production-grade. | ## What this is Evidence verification via GLYPH engine. Cryptographic source attestation. Contradiction preservation. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/maven/cli # `map invoke MAVEN` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MAVEN` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `attest` ```bash map invoke MAVEN attest --input '{"example":true}' ``` Attest a source: cryptographic proof of origin, integrity check, citation envelope. Capability: `map.maven.attest` ### `cite` ```bash map invoke MAVEN cite --input '{"example":true}' ``` Generate a citation envelope bound to a byte range and a source attestation. Capability: `map.maven.cite` ### `contradict` ```bash map invoke MAVEN contradict --input '{"example":true}' ``` File a contradicting claim against an existing attestation; both preserved. Capability: `map.maven.contradict` ### `resolve` ```bash map invoke MAVEN resolve --input '{"example":true}' ``` Resolve contradictions through MOOT arbitration when an institution requires a single answer. Capability: `map.maven.resolve` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/maven/governance # Refusal posture, dissent preservation, audit footprint for MAVEN. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAVEN` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MAVEN` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.maven.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MAVEN` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MAVEN` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/maven/internals # Crate path, key types, adjacent protocols for MAVEN. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAVEN` (Multi-Agentic Veracity & Evidence Nexus) lives in `protocols/maven-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/maven-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/maven-lib/src/protocol.rs` | core protocol logic | | `protocols/maven-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/maven-lib/tests/` | unit + integration tests | | `schemas/maven/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MavenProtocol { fn protocol_name(&self) -> &'static str { "MAVEN" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "attest", "cite", "contradict", "resolve", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "attest" => self.attest(payload, ctx).await, "cite" => self.cite(payload, ctx).await, "contradict" => self.contradict(payload, ctx).await, "resolve" => self.resolve(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p maven-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/maven/metering # How MEAL meters MAVEN operations. ================================================================================ Every call on `MAVEN` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `attest` | yes | yes | yes | | `cite` | yes | yes | yes | | `contradict` | yes | yes | yes | | `resolve` | yes | yes | yes | ## Rate card `MAVEN` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MAVEN` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MAVEN`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/maven/operations # Every operation on MAVEN. ================================================================================ The full operation table for `MAVEN`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/maven-lib` crate. ## Index | Operation | Summary | | --- | --- | | `attest` | Attest a source: cryptographic proof of origin, integrity check, citation envelope. | | `cite` | Generate a citation envelope bound to a byte range and a source attestation. | | `contradict` | File a contradicting claim against an existing attestation; both preserved. | | `resolve` | Resolve contradictions through MOOT arbitration when an institution requires a single answer. | ## Reference ### `attest` Attest a source: cryptographic proof of origin, integrity check, citation envelope. | Field | Value | | --- | --- | | Capability | `map.maven.attest` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `cite` Generate a citation envelope bound to a byte range and a source attestation. | Field | Value | | --- | --- | | Capability | `map.maven.cite` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `contradict` File a contradicting claim against an existing attestation; both preserved. | Field | Value | | --- | --- | | Capability | `map.maven.contradict` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `resolve` Resolve contradictions through MOOT arbitration when an institution requires a single answer. | Field | Value | | --- | --- | | Capability | `map.maven.resolve` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/maven/schemas # Request and response JSON schemas for MAVEN. ================================================================================ The OCIP contracts for `MAVEN` live in `/Volumes/L1feAI/l1feosx/map/schemas/maven/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/maven/v1/ ├── index.json ├── operations.attest.request.json ├── operations.attest.response.json ├── operations.cite.request.json ├── operations.cite.response.json ├── operations.contradict.request.json ├── operations.contradict.response.json ├── operations.resolve.request.json ├── operations.resolve.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `attest` | `schemas/maven/v1/operations.attest.request.json` | `schemas/maven/v1/operations.attest.response.json` | | `cite` | `schemas/maven/v1/operations.cite.request.json` | `schemas/maven/v1/operations.cite.response.json` | | `contradict` | `schemas/maven/v1/operations.contradict.request.json` | `schemas/maven/v1/operations.contradict.response.json` | | `resolve` | `schemas/maven/v1/operations.resolve.request.json` | `schemas/maven/v1/operations.resolve.response.json` | ## Published ```text https://schemas.multiagentic.dev/maven/v1/operations..request.json https://schemas.multiagentic.dev/maven/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/maven/sdks # Rust, TypeScript and HTTP for MAVEN. ================================================================================ Every operation on `MAVEN` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MAVEN", "v1.0.0", "attest", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MAVEN', version: 'v1.0.0', operation: 'attest', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MAVEN", "version": "v1.0.0", "operation": "attest", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"attest"` — Attest a source: cryptographic proof of origin, integrity check, citation envelope. - `map.dispatch(...)` with operation `"cite"` — Generate a citation envelope bound to a byte range and a source attestation. - `map.dispatch(...)` with operation `"contradict"` — File a contradicting claim against an existing attestation; both preserved. - `map.dispatch(...)` with operation `"resolve"` — Resolve contradictions through MOOT arbitration when an institution requires a single answer. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MAX # URL: https://docs.multiagentic.dev/docs/protocols/max # Multi-Agentic Audit & eXplainability · The constitutional record. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **The constitutional record.** > > Audit and explainability. Hash-chained, replayable, queryable. The civic library of the organization. | Field | Value | | --- | --- | | Acronym | `MAX` | | Full name | Multi-Agentic Audit & eXplainability | | Plane | VII — Awareness | | Kind | Protocol · Stateless | | City role | Records office | | Crate | `protocols/max-lib` | | Status | Implemented · production-grade. | ## What this is Audit and explainability. Hash-chained, replayable, queryable. The civic library of the organization. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/max/cli # `map invoke MAX` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MAX` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `audit_log_entry` ```bash map invoke MAX audit_log_entry --input '{"event_type":"demo","meta":{"note":"hello world"}}' ``` Append a record to the chain with hash chaining and signature. Capability: `map.max.audit_log_entry` ### `audit_query` ```bash map invoke MAX audit_query --input '{"example":true}' ``` Query the chain by predicate; supports time-travel and structured filters. Capability: `map.max.audit_query` ### `traceability_graph` ```bash map invoke MAX traceability_graph --input '{"example":true}' ``` Reconstruct the traceability graph for a request or decision. Capability: `map.max.traceability_graph` ### `explainability_request` ```bash map invoke MAX explainability_request --input '{"example":true}' ``` Produce a human-readable explanation of a recorded decision. Capability: `map.max.explainability_request` ### `compliance_report` ```bash map invoke MAX compliance_report --input '{"example":true}' ``` Generate a compliance report for a period and policy set. Capability: `map.max.compliance_report` ### `health_check` ```bash map invoke MAX health_check --input '{"example":true}' ``` Audit-chain health: integrity, lag, partition status. Capability: `map.max.health_check` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/max/governance # Refusal posture, dissent preservation, audit footprint for MAX. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAX` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MAX` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.max.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MAX` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MAX` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/max/internals # Crate path, key types, adjacent protocols for MAX. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAX` (Multi-Agentic Audit & eXplainability) lives in `protocols/max-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/max-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/max-lib/src/protocol.rs` | core protocol logic | | `protocols/max-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/max-lib/tests/` | unit + integration tests | | `schemas/max/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MaxProtocol { fn protocol_name(&self) -> &'static str { "MAX" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "audit_log_entry", "audit_query", "traceability_graph", "explainability_request", "compliance_report", "health_check", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "audit_log_entry" => self.audit_log_entry(payload, ctx).await, "audit_query" => self.audit_query(payload, ctx).await, "traceability_graph" => self.traceability_graph(payload, ctx).await, "explainability_request" => self.explainability_request(payload, ctx).await, "compliance_report" => self.compliance_report(payload, ctx).await, "health_check" => self.health_check(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p max-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/max/metering # How MEAL meters MAX operations. ================================================================================ Every call on `MAX` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `audit_log_entry` | 0 | yes | `<0.001 kWh` | | `audit_query` | 0 | yes | `<0.001 kWh` | | `traceability_graph` | yes | yes | yes | | `explainability_request` | 0 | yes | `<0.001 kWh` | | `compliance_report` | 0 | yes | `<0.001 kWh` | | `health_check` | 0 | yes | `<0.001 kWh` | ## Rate card `MAX` is a **protocol** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MAX` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MAX`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/max/operations # Every operation on MAX. ================================================================================ The full operation table for `MAX`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/max-lib` crate. ## Index | Operation | Summary | | --- | --- | | `audit_log_entry` | Append a record to the chain with hash chaining and signature. | | `audit_query` | Query the chain by predicate; supports time-travel and structured filters. | | `traceability_graph` | Reconstruct the traceability graph for a request or decision. | | `explainability_request` | Produce a human-readable explanation of a recorded decision. | | `compliance_report` | Generate a compliance report for a period and policy set. | | `health_check` | Audit-chain health: integrity, lag, partition status. | ## Reference ### `audit_log_entry` Append a record to the chain with hash chaining and signature. | Field | Value | | --- | --- | | Capability | `map.max.audit_log_entry` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "event_type": "demo", "meta": { "note": "hello world" } } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `audit_query` Query the chain by predicate; supports time-travel and structured filters. | Field | Value | | --- | --- | | Capability | `map.max.audit_query` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `traceability_graph` Reconstruct the traceability graph for a request or decision. | Field | Value | | --- | --- | | Capability | `map.max.traceability_graph` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `explainability_request` Produce a human-readable explanation of a recorded decision. | Field | Value | | --- | --- | | Capability | `map.max.explainability_request` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `compliance_report` Generate a compliance report for a period and policy set. | Field | Value | | --- | --- | | Capability | `map.max.compliance_report` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `health_check` Audit-chain health: integrity, lag, partition status. | Field | Value | | --- | --- | | Capability | `map.max.health_check` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/max/schemas # Request and response JSON schemas for MAX. ================================================================================ The OCIP contracts for `MAX` live in `/Volumes/L1feAI/l1feosx/map/schemas/max/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/max/v1/ ├── index.json ├── operations.audit_log_entry.request.json ├── operations.audit_log_entry.response.json ├── operations.audit_query.request.json ├── operations.audit_query.response.json ├── operations.traceability_graph.request.json ├── operations.traceability_graph.response.json ├── operations.explainability_request.request.json ├── operations.explainability_request.response.json ├── operations.compliance_report.request.json ├── operations.compliance_report.response.json ├── operations.health_check.request.json ├── operations.health_check.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `audit_log_entry` | `schemas/max/v1/operations.audit_log_entry.request.json` | `schemas/max/v1/operations.audit_log_entry.response.json` | | `audit_query` | `schemas/max/v1/operations.audit_query.request.json` | `schemas/max/v1/operations.audit_query.response.json` | | `traceability_graph` | `schemas/max/v1/operations.traceability_graph.request.json` | `schemas/max/v1/operations.traceability_graph.response.json` | | `explainability_request` | `schemas/max/v1/operations.explainability_request.request.json` | `schemas/max/v1/operations.explainability_request.response.json` | | `compliance_report` | `schemas/max/v1/operations.compliance_report.request.json` | `schemas/max/v1/operations.compliance_report.response.json` | | `health_check` | `schemas/max/v1/operations.health_check.request.json` | `schemas/max/v1/operations.health_check.response.json` | ## Published ```text https://schemas.multiagentic.dev/max/v1/operations..request.json https://schemas.multiagentic.dev/max/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/max/sdks # Rust, TypeScript and HTTP for MAX. ================================================================================ Every operation on `MAX` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MAX", "v1.0.0", "audit_log_entry", json!({ "event_type": "demo", "meta": { "note": "hello world" } }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MAX', version: 'v1.0.0', operation: 'audit_log_entry', input: { "event_type": "demo", "meta": { "note": "hello world" } } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MAX", "version": "v1.0.0", "operation": "audit_log_entry", "input": { "event_type": "demo", "meta": { "note": "hello world" } }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"audit_log_entry"` — Append a record to the chain with hash chaining and signature. - `map.dispatch(...)` with operation `"audit_query"` — Query the chain by predicate; supports time-travel and structured filters. - `map.dispatch(...)` with operation `"traceability_graph"` — Reconstruct the traceability graph for a request or decision. - `map.dispatch(...)` with operation `"explainability_request"` — Produce a human-readable explanation of a recorded decision. - `map.dispatch(...)` with operation `"compliance_report"` — Generate a compliance report for a period and policy set. - `map.dispatch(...)` with operation `"health_check"` — Audit-chain health: integrity, lag, partition status. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MAXIM # URL: https://docs.multiagentic.dev/docs/protocols/maxim # Multi-Agent eXecutive Interpretation & Mandate · Rules with reasons; refusal with receipts. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Rules with reasons; refusal with receipts.** > > Constitutional reasoning. Mandate interpretation and enforcement. | Field | Value | | --- | --- | | Acronym | `MAXIM` | | Full name | Multi-Agent eXecutive Interpretation & Mandate | | Plane | IV — Governance | | Kind | Agent · Autonomous Org | | City role | Constitutional council | | Crate | `protocols/maxim-lib` | | Status | Implemented · production-grade. | ## What this is Constitutional reasoning. Mandate interpretation and enforcement. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/maxim/cli # `map invoke MAXIM` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MAXIM` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `deliberate_dilemma` ```bash map invoke MAXIM deliberate_dilemma --input '{"example":true}' ``` Reason over a moral dilemma using evidence, policy, and precedent; outputs a deliberation chain. Capability: `map.maxim.deliberate_dilemma` ### `constitutional_interpretation` ```bash map invoke MAXIM constitutional_interpretation --input '{"example":true}' ``` Map a mandate to the constitutional constraints that bind it. Capability: `map.maxim.constitutional_interpretation` ### `mandate_enforcement` ```bash map invoke MAXIM mandate_enforcement --input '{"example":true}' ``` Execute judgment with MACE signatures; records to MAX with full reasoning. Capability: `map.maxim.mandate_enforcement` ### `health_check` ```bash map invoke MAXIM health_check --input '{"example":true}' ``` Service health and constitutional state. Capability: `map.maxim.health_check` ### `metrics` ```bash map invoke MAXIM metrics --input '{"example":true}' ``` Service metrics: deliberation latency, mandate volume, refusal rate. Capability: `map.maxim.metrics` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/maxim/governance # Refusal posture, dissent preservation, audit footprint for MAXIM. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAXIM` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MAXIM` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.maxim.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MAXIM` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MAXIM` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/maxim/internals # Crate path, key types, adjacent protocols for MAXIM. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAXIM` (Multi-Agent eXecutive Interpretation & Mandate) lives in `protocols/maxim-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/maxim-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/maxim-lib/src/protocol.rs` | core protocol logic | | `protocols/maxim-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/maxim-lib/tests/` | unit + integration tests | | `schemas/maxim/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MaximProtocol { fn protocol_name(&self) -> &'static str { "MAXIM" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "deliberate_dilemma", "constitutional_interpretation", "mandate_enforcement", "health_check", "metrics", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "deliberate_dilemma" => self.deliberate_dilemma(payload, ctx).await, "constitutional_interpretation" => self.constitutional_interpretation(payload, ctx).await, "mandate_enforcement" => self.mandate_enforcement(payload, ctx).await, "health_check" => self.health_check(payload, ctx).await, "metrics" => self.metrics(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p maxim-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/maxim/metering # How MEAL meters MAXIM operations. ================================================================================ Every call on `MAXIM` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `deliberate_dilemma` | yes | yes | yes | | `constitutional_interpretation` | yes | yes | yes | | `mandate_enforcement` | yes | yes | yes | | `health_check` | yes | yes | yes | | `metrics` | yes | yes | yes | ## Rate card `MAXIM` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MAXIM` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MAXIM`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/maxim/operations # Every operation on MAXIM. ================================================================================ The full operation table for `MAXIM`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/maxim-lib` crate. ## Index | Operation | Summary | | --- | --- | | `deliberate_dilemma` | Reason over a moral dilemma using evidence, policy, and precedent; outputs a deliberation chain. | | `constitutional_interpretation` | Map a mandate to the constitutional constraints that bind it. | | `mandate_enforcement` | Execute judgment with MACE signatures; records to MAX with full reasoning. | | `health_check` | Service health and constitutional state. | | `metrics` | Service metrics: deliberation latency, mandate volume, refusal rate. | ## Reference ### `deliberate_dilemma` Reason over a moral dilemma using evidence, policy, and precedent; outputs a deliberation chain. | Field | Value | | --- | --- | | Capability | `map.maxim.deliberate_dilemma` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `constitutional_interpretation` Map a mandate to the constitutional constraints that bind it. | Field | Value | | --- | --- | | Capability | `map.maxim.constitutional_interpretation` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `mandate_enforcement` Execute judgment with MACE signatures; records to MAX with full reasoning. | Field | Value | | --- | --- | | Capability | `map.maxim.mandate_enforcement` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `health_check` Service health and constitutional state. | Field | Value | | --- | --- | | Capability | `map.maxim.health_check` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `metrics` Service metrics: deliberation latency, mandate volume, refusal rate. | Field | Value | | --- | --- | | Capability | `map.maxim.metrics` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/maxim/schemas # Request and response JSON schemas for MAXIM. ================================================================================ The OCIP contracts for `MAXIM` live in `/Volumes/L1feAI/l1feosx/map/schemas/maxim/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/maxim/v1/ ├── index.json ├── operations.deliberate_dilemma.request.json ├── operations.deliberate_dilemma.response.json ├── operations.constitutional_interpretation.request.json ├── operations.constitutional_interpretation.response.json ├── operations.mandate_enforcement.request.json ├── operations.mandate_enforcement.response.json ├── operations.health_check.request.json ├── operations.health_check.response.json ├── operations.metrics.request.json ├── operations.metrics.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `deliberate_dilemma` | `schemas/maxim/v1/operations.deliberate_dilemma.request.json` | `schemas/maxim/v1/operations.deliberate_dilemma.response.json` | | `constitutional_interpretation` | `schemas/maxim/v1/operations.constitutional_interpretation.request.json` | `schemas/maxim/v1/operations.constitutional_interpretation.response.json` | | `mandate_enforcement` | `schemas/maxim/v1/operations.mandate_enforcement.request.json` | `schemas/maxim/v1/operations.mandate_enforcement.response.json` | | `health_check` | `schemas/maxim/v1/operations.health_check.request.json` | `schemas/maxim/v1/operations.health_check.response.json` | | `metrics` | `schemas/maxim/v1/operations.metrics.request.json` | `schemas/maxim/v1/operations.metrics.response.json` | ## Published ```text https://schemas.multiagentic.dev/maxim/v1/operations..request.json https://schemas.multiagentic.dev/maxim/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/maxim/sdks # Rust, TypeScript and HTTP for MAXIM. ================================================================================ Every operation on `MAXIM` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MAXIM", "v1.0.0", "deliberate_dilemma", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MAXIM', version: 'v1.0.0', operation: 'deliberate_dilemma', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MAXIM", "version": "v1.0.0", "operation": "deliberate_dilemma", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"deliberate_dilemma"` — Reason over a moral dilemma using evidence, policy, and precedent; outputs a deliberation chain. - `map.dispatch(...)` with operation `"constitutional_interpretation"` — Map a mandate to the constitutional constraints that bind it. - `map.dispatch(...)` with operation `"mandate_enforcement"` — Execute judgment with MACE signatures; records to MAX with full reasoning. - `map.dispatch(...)` with operation `"health_check"` — Service health and constitutional state. - `map.dispatch(...)` with operation `"metrics"` — Service metrics: deliberation latency, mandate volume, refusal rate. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MAZE # URL: https://docs.multiagentic.dev/docs/protocols/maze # Multi-Agent Zero-knowledge Evaluation · The map of the organization to itself. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **The map of the organization to itself.** > > Zero-knowledge evaluation. Topology, relationships, structural proofs without graph disclosure. | Field | Value | | --- | --- | | Acronym | `MAZE` | | Full name | Multi-Agent Zero-knowledge Evaluation | | Plane | VII — Awareness | | Kind | Agent · Autonomous Org | | City role | Cartographer | | Crate | `protocols/maze` | | Status | Implemented · production-grade. | ## What this is Zero-knowledge evaluation. Topology, relationships, structural proofs without graph disclosure. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/maze/cli # `map invoke MAZE` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MAZE` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `topology` ```bash map invoke MAZE topology --input '{"example":true}' ``` Render the current topology of relationships, scoped by access policy. Capability: `map.maze.topology` ### `prove` ```bash map invoke MAZE prove --input '{"example":true}' ``` Produce a ZK proof of a structural property without revealing the graph. Capability: `map.maze.prove` ### `path` ```bash map invoke MAZE path --input '{"example":true}' ``` Find paths between two nodes under capability scope. Capability: `map.maze.path` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/maze/governance # Refusal posture, dissent preservation, audit footprint for MAZE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAZE` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MAZE` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.maze.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MAZE` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MAZE` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/maze/internals # Crate path, key types, adjacent protocols for MAZE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MAZE` (Multi-Agent Zero-knowledge Evaluation) lives in `protocols/maze`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/maze/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/maze/src/protocol.rs` | core protocol logic | | `protocols/maze/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/maze/tests/` | unit + integration tests | | `schemas/maze/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MazeProtocol { fn protocol_name(&self) -> &'static str { "MAZE" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "topology", "prove", "path", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "topology" => self.topology(payload, ctx).await, "prove" => self.prove(payload, ctx).await, "path" => self.path(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p maze --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/maze/metering # How MEAL meters MAZE operations. ================================================================================ Every call on `MAZE` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `topology` | yes | yes | yes | | `prove` | yes | yes | yes | | `path` | yes | yes | yes | ## Rate card `MAZE` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MAZE` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MAZE`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/maze/operations # Every operation on MAZE. ================================================================================ The full operation table for `MAZE`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/maze` crate. ## Index | Operation | Summary | | --- | --- | | `topology` | Render the current topology of relationships, scoped by access policy. | | `prove` | Produce a ZK proof of a structural property without revealing the graph. | | `path` | Find paths between two nodes under capability scope. | ## Reference ### `topology` Render the current topology of relationships, scoped by access policy. | Field | Value | | --- | --- | | Capability | `map.maze.topology` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `prove` Produce a ZK proof of a structural property without revealing the graph. | Field | Value | | --- | --- | | Capability | `map.maze.prove` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `path` Find paths between two nodes under capability scope. | Field | Value | | --- | --- | | Capability | `map.maze.path` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/maze/schemas # Request and response JSON schemas for MAZE. ================================================================================ The OCIP contracts for `MAZE` live in `/Volumes/L1feAI/l1feosx/map/schemas/maze/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/maze/v1/ ├── index.json ├── operations.topology.request.json ├── operations.topology.response.json ├── operations.prove.request.json ├── operations.prove.response.json ├── operations.path.request.json ├── operations.path.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `topology` | `schemas/maze/v1/operations.topology.request.json` | `schemas/maze/v1/operations.topology.response.json` | | `prove` | `schemas/maze/v1/operations.prove.request.json` | `schemas/maze/v1/operations.prove.response.json` | | `path` | `schemas/maze/v1/operations.path.request.json` | `schemas/maze/v1/operations.path.response.json` | ## Published ```text https://schemas.multiagentic.dev/maze/v1/operations..request.json https://schemas.multiagentic.dev/maze/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/maze/sdks # Rust, TypeScript and HTTP for MAZE. ================================================================================ Every operation on `MAZE` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MAZE", "v1.0.0", "topology", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MAZE', version: 'v1.0.0', operation: 'topology', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MAZE", "version": "v1.0.0", "operation": "topology", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"topology"` — Render the current topology of relationships, scoped by access policy. - `map.dispatch(...)` with operation `"prove"` — Produce a ZK proof of a structural property without revealing the graph. - `map.dispatch(...)` with operation `"path"` — Find paths between two nodes under capability scope. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MEAL # URL: https://docs.multiagentic.dev/docs/protocols/meal # Multi-Agentic Evolution & Learning · Meter · Every call, token, second, watt. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Every call, token, second, watt.** > > Evolution and learning pipeline; also: the institution's meter. Triple-entry, immutable, auditable. | Field | Value | | --- | --- | | Acronym | `MEAL` | | Full name | Multi-Agentic Evolution & Learning · Meter | | Plane | VI — Economic | | Kind | Hybrid · Protocol + Agent | | City role | Meters | | Crate | `protocols/meal-lib` | | Status | Implemented · production-grade. | ## What this is Evolution and learning pipeline; also: the institution's meter. Triple-entry, immutable, auditable. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/meal/cli # `map invoke MEAL` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MEAL` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `meter` ```bash map invoke MEAL meter --input '{"dim":"tokens","amount":1024}' ``` Record a metered event (tokens, seconds, watts) against caller account. Capability: `map.meal.meter` ### `statement` ```bash map invoke MEAL statement --input '{"example":true}' ``` Generate a statement for an account over a period. Capability: `map.meal.statement` ### `reconcile` ```bash map invoke MEAL reconcile --input '{"example":true}' ``` Reconcile metered events against settled payments; reports unbalances. Capability: `map.meal.reconcile` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/meal/governance # Refusal posture, dissent preservation, audit footprint for MEAL. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MEAL` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MEAL` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.meal.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MEAL` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MEAL` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/meal/internals # Crate path, key types, adjacent protocols for MEAL. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MEAL` (Multi-Agentic Evolution & Learning · Meter) lives in `protocols/meal-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/meal-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/meal-lib/src/protocol.rs` | core protocol logic | | `protocols/meal-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/meal-lib/tests/` | unit + integration tests | | `schemas/meal/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MealProtocol { fn protocol_name(&self) -> &'static str { "MEAL" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "meter", "statement", "reconcile", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "meter" => self.meter(payload, ctx).await, "statement" => self.statement(payload, ctx).await, "reconcile" => self.reconcile(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p meal-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/meal/metering # How MEAL meters MEAL operations. ================================================================================ Every call on `MEAL` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `meter` | 0 | yes | `<0.001 kWh` | | `statement` | 0 | yes | `<0.001 kWh` | | `reconcile` | 0 | yes | `<0.001 kWh` | ## Rate card `MEAL` is a **hybrid** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MEAL` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MEAL`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/meal/operations # Every operation on MEAL. ================================================================================ The full operation table for `MEAL`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/meal-lib` crate. ## Index | Operation | Summary | | --- | --- | | `meter` | Record a metered event (tokens, seconds, watts) against caller account. | | `statement` | Generate a statement for an account over a period. | | `reconcile` | Reconcile metered events against settled payments; reports unbalances. | ## Reference ### `meter` Record a metered event (tokens, seconds, watts) against caller account. | Field | Value | | --- | --- | | Capability | `map.meal.meter` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "dim": "tokens", "amount": 1024 } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `statement` Generate a statement for an account over a period. | Field | Value | | --- | --- | | Capability | `map.meal.statement` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `reconcile` Reconcile metered events against settled payments; reports unbalances. | Field | Value | | --- | --- | | Capability | `map.meal.reconcile` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/meal/schemas # Request and response JSON schemas for MEAL. ================================================================================ The OCIP contracts for `MEAL` live in `/Volumes/L1feAI/l1feosx/map/schemas/meal/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/meal/v1/ ├── index.json ├── operations.meter.request.json ├── operations.meter.response.json ├── operations.statement.request.json ├── operations.statement.response.json ├── operations.reconcile.request.json ├── operations.reconcile.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `meter` | `schemas/meal/v1/operations.meter.request.json` | `schemas/meal/v1/operations.meter.response.json` | | `statement` | `schemas/meal/v1/operations.statement.request.json` | `schemas/meal/v1/operations.statement.response.json` | | `reconcile` | `schemas/meal/v1/operations.reconcile.request.json` | `schemas/meal/v1/operations.reconcile.response.json` | ## Published ```text https://schemas.multiagentic.dev/meal/v1/operations..request.json https://schemas.multiagentic.dev/meal/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/meal/sdks # Rust, TypeScript and HTTP for MEAL. ================================================================================ Every operation on `MEAL` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MEAL", "v1.0.0", "meter", json!({ "dim": "tokens", "amount": 1024 }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MEAL', version: 'v1.0.0', operation: 'meter', input: { "dim": "tokens", "amount": 1024 } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MEAL", "version": "v1.0.0", "operation": "meter", "input": { "dim": "tokens", "amount": 1024 }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"meter"` — Record a metered event (tokens, seconds, watts) against caller account. - `map.dispatch(...)` with operation `"statement"` — Generate a statement for an account over a period. - `map.dispatch(...)` with operation `"reconcile"` — Reconcile metered events against settled payments; reports unbalances. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MERIT # URL: https://docs.multiagentic.dev/docs/protocols/merit # Moral Evaluation, Reputation & Integrity Tracking · The ledger of competence. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **The ledger of competence.** > > Composable credentials issued from verified history. Selective ZK presentation. Revocable under authority. | Field | Value | | --- | --- | | Acronym | `MERIT` | | Full name | Moral Evaluation, Reputation & Integrity Tracking | | Plane | III — Truth | | Kind | Agent · Autonomous Org | | City role | Ethics board | | Crate | `protocols/merit-lib` | | Status | Implemented · production-grade. | ## What this is Composable credentials issued from verified history. Selective ZK presentation. Revocable under authority. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/merit/cli # `map invoke MERIT` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MERIT` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `evaluate_ethics` ```bash map invoke MERIT evaluate_ethics --input '{"example":true}' ``` Evaluate an action against the active ethics policy and recorded history. Capability: `map.merit.evaluate_ethics` ### `get_policy` ```bash map invoke MERIT get_policy --input '{"example":true}' ``` Fetch the active ethics policy for an org / domain / capability. Capability: `map.merit.get_policy` ### `update_policy` ```bash map invoke MERIT update_policy --input '{"example":true}' ``` Update an ethics policy under MACE ratification. Capability: `map.merit.update_policy` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/merit/governance # Refusal posture, dissent preservation, audit footprint for MERIT. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MERIT` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MERIT` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.merit.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MERIT` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MERIT` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/merit/internals # Crate path, key types, adjacent protocols for MERIT. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MERIT` (Moral Evaluation, Reputation & Integrity Tracking) lives in `protocols/merit-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/merit-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/merit-lib/src/protocol.rs` | core protocol logic | | `protocols/merit-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/merit-lib/tests/` | unit + integration tests | | `schemas/merit/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MeritProtocol { fn protocol_name(&self) -> &'static str { "MERIT" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "evaluate_ethics", "get_policy", "update_policy", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "evaluate_ethics" => self.evaluate_ethics(payload, ctx).await, "get_policy" => self.get_policy(payload, ctx).await, "update_policy" => self.update_policy(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p merit-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/merit/metering # How MEAL meters MERIT operations. ================================================================================ Every call on `MERIT` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `evaluate_ethics` | yes | yes | yes | | `get_policy` | yes | yes | yes | | `update_policy` | yes | yes | yes | ## Rate card `MERIT` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MERIT` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MERIT`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/merit/operations # Every operation on MERIT. ================================================================================ The full operation table for `MERIT`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/merit-lib` crate. ## Index | Operation | Summary | | --- | --- | | `evaluate_ethics` | Evaluate an action against the active ethics policy and recorded history. | | `get_policy` | Fetch the active ethics policy for an org / domain / capability. | | `update_policy` | Update an ethics policy under MACE ratification. | ## Reference ### `evaluate_ethics` Evaluate an action against the active ethics policy and recorded history. | Field | Value | | --- | --- | | Capability | `map.merit.evaluate_ethics` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `get_policy` Fetch the active ethics policy for an org / domain / capability. | Field | Value | | --- | --- | | Capability | `map.merit.get_policy` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `update_policy` Update an ethics policy under MACE ratification. | Field | Value | | --- | --- | | Capability | `map.merit.update_policy` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/merit/schemas # Request and response JSON schemas for MERIT. ================================================================================ The OCIP contracts for `MERIT` live in `/Volumes/L1feAI/l1feosx/map/schemas/merit/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/merit/v1/ ├── index.json ├── operations.evaluate_ethics.request.json ├── operations.evaluate_ethics.response.json ├── operations.get_policy.request.json ├── operations.get_policy.response.json ├── operations.update_policy.request.json ├── operations.update_policy.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `evaluate_ethics` | `schemas/merit/v1/operations.evaluate_ethics.request.json` | `schemas/merit/v1/operations.evaluate_ethics.response.json` | | `get_policy` | `schemas/merit/v1/operations.get_policy.request.json` | `schemas/merit/v1/operations.get_policy.response.json` | | `update_policy` | `schemas/merit/v1/operations.update_policy.request.json` | `schemas/merit/v1/operations.update_policy.response.json` | ## Published ```text https://schemas.multiagentic.dev/merit/v1/operations..request.json https://schemas.multiagentic.dev/merit/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/merit/sdks # Rust, TypeScript and HTTP for MERIT. ================================================================================ Every operation on `MERIT` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MERIT", "v1.0.0", "evaluate_ethics", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MERIT', version: 'v1.0.0', operation: 'evaluate_ethics', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MERIT", "version": "v1.0.0", "operation": "evaluate_ethics", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"evaluate_ethics"` — Evaluate an action against the active ethics policy and recorded history. - `map.dispatch(...)` with operation `"get_policy"` — Fetch the active ethics policy for an org / domain / capability. - `map.dispatch(...)` with operation `"update_policy"` — Update an ethics policy under MACE ratification. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MIM # URL: https://docs.multiagentic.dev/docs/protocols/mim # Multi-Agentic Interoperable Messaging · The mesh, made addressable. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **The mesh, made addressable.** > > Interoperable messaging. Mailbox semantics. QoS levels. Optional encryption and signature. | Field | Value | | --- | --- | | Acronym | `MIM` | | Full name | Multi-Agentic Interoperable Messaging | | Plane | VII — Awareness | | Kind | Protocol · Stateless | | City role | Postal and telecom | | Crate | `protocols/mim-lib` | | Status | Implemented · production-grade. | ## What this is Interoperable messaging. Mailbox semantics. QoS levels. Optional encryption and signature. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mim/cli # `map invoke MIM` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MIM` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `message_send` ```bash map invoke MIM message_send --input '{"to":"mailbox://example","body":{"hello":"world"},"qos":"AtLeastOnce"}' ``` Send a message to an addressable mailbox; QoS (AtMostOnce/AtLeastOnce/ExactlyOnce), optional encryption/signature. Capability: `map.mim.message_send` ### `message_receive` ```bash map invoke MIM message_receive --input '{"example":true}' ``` Receive messages from a mailbox; supports polling and streaming. Capability: `map.mim.message_receive` ### `queuing` ```bash map invoke MIM queuing --input '{"example":true}' ``` Queue management: declare, bind, purge, delete. Capability: `map.mim.queuing` ### `dedup_check` ```bash map invoke MIM dedup_check --input '{"example":true}' ``` Idempotency / dedup check for ExactlyOnce delivery. Capability: `map.mim.dedup_check` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mim/governance # Refusal posture, dissent preservation, audit footprint for MIM. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MIM` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MIM` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mim.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MIM` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MIM` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mim/internals # Crate path, key types, adjacent protocols for MIM. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MIM` (Multi-Agentic Interoperable Messaging) lives in `protocols/mim-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mim-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mim-lib/src/protocol.rs` | core protocol logic | | `protocols/mim-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mim-lib/tests/` | unit + integration tests | | `schemas/mim/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MimProtocol { fn protocol_name(&self) -> &'static str { "MIM" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "message_send", "message_receive", "queuing", "dedup_check", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "message_send" => self.message_send(payload, ctx).await, "message_receive" => self.message_receive(payload, ctx).await, "queuing" => self.queuing(payload, ctx).await, "dedup_check" => self.dedup_check(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mim-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mim/metering # How MEAL meters MIM operations. ================================================================================ Every call on `MIM` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `message_send` | 0 | yes | `<0.001 kWh` | | `message_receive` | 0 | yes | `<0.001 kWh` | | `queuing` | 0 | yes | `<0.001 kWh` | | `dedup_check` | 0 | yes | `<0.001 kWh` | ## Rate card `MIM` is a **protocol** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MIM` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MIM`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mim/operations # Every operation on MIM. ================================================================================ The full operation table for `MIM`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mim-lib` crate. ## Index | Operation | Summary | | --- | --- | | `message_send` | Send a message to an addressable mailbox; QoS (AtMostOnce/AtLeastOnce/ExactlyOnce), optional encryption/signature. | | `message_receive` | Receive messages from a mailbox; supports polling and streaming. | | `queuing` | Queue management: declare, bind, purge, delete. | | `dedup_check` | Idempotency / dedup check for ExactlyOnce delivery. | ## Reference ### `message_send` Send a message to an addressable mailbox; QoS (AtMostOnce/AtLeastOnce/ExactlyOnce), optional encryption/signature. | Field | Value | | --- | --- | | Capability | `map.mim.message_send` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "to": "mailbox://example", "body": { "hello": "world" }, "qos": "AtLeastOnce" } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `message_receive` Receive messages from a mailbox; supports polling and streaming. | Field | Value | | --- | --- | | Capability | `map.mim.message_receive` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `queuing` Queue management: declare, bind, purge, delete. | Field | Value | | --- | --- | | Capability | `map.mim.queuing` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `dedup_check` Idempotency / dedup check for ExactlyOnce delivery. | Field | Value | | --- | --- | | Capability | `map.mim.dedup_check` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mim/schemas # Request and response JSON schemas for MIM. ================================================================================ The OCIP contracts for `MIM` live in `/Volumes/L1feAI/l1feosx/map/schemas/mim/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mim/v1/ ├── index.json ├── operations.message_send.request.json ├── operations.message_send.response.json ├── operations.message_receive.request.json ├── operations.message_receive.response.json ├── operations.queuing.request.json ├── operations.queuing.response.json ├── operations.dedup_check.request.json ├── operations.dedup_check.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `message_send` | `schemas/mim/v1/operations.message_send.request.json` | `schemas/mim/v1/operations.message_send.response.json` | | `message_receive` | `schemas/mim/v1/operations.message_receive.request.json` | `schemas/mim/v1/operations.message_receive.response.json` | | `queuing` | `schemas/mim/v1/operations.queuing.request.json` | `schemas/mim/v1/operations.queuing.response.json` | | `dedup_check` | `schemas/mim/v1/operations.dedup_check.request.json` | `schemas/mim/v1/operations.dedup_check.response.json` | ## Published ```text https://schemas.multiagentic.dev/mim/v1/operations..request.json https://schemas.multiagentic.dev/mim/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mim/sdks # Rust, TypeScript and HTTP for MIM. ================================================================================ Every operation on `MIM` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MIM", "v1.0.0", "message_send", json!({ "to": "mailbox://example", "body": { "hello": "world" }, "qos": "AtLeastOnce" }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MIM', version: 'v1.0.0', operation: 'message_send', input: { "to": "mailbox://example", "body": { "hello": "world" }, "qos": "AtLeastOnce" } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MIM", "version": "v1.0.0", "operation": "message_send", "input": { "to": "mailbox://example", "body": { "hello": "world" }, "qos": "AtLeastOnce" }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"message_send"` — Send a message to an addressable mailbox; QoS (AtMostOnce/AtLeastOnce/ExactlyOnce), optional encryption/signature. - `map.dispatch(...)` with operation `"message_receive"` — Receive messages from a mailbox; supports polling and streaming. - `map.dispatch(...)` with operation `"queuing"` — Queue management: declare, bind, purge, delete. - `map.dispatch(...)` with operation `"dedup_check"` — Idempotency / dedup check for ExactlyOnce delivery. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MIMESIS # URL: https://docs.multiagentic.dev/docs/protocols/mimesis # Convention · Custom · Precedent · What repeats becomes routine. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **What repeats becomes routine.** > > Convention, custom, precedent. Human escalation routing. Slow accretion of common law. | Field | Value | | --- | --- | | Acronym | `MIMESIS` | | Full name | Convention · Custom · Precedent | | Plane | IV — Governance | | Kind | Agent · Autonomous Org | | City role | Liaison office | | Crate | `protocols/mimesis-lib` | | Status | Implemented · production-grade. | ## What this is Convention, custom, precedent. Human escalation routing. Slow accretion of common law. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mimesis/cli # `map invoke MIMESIS` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MIMESIS` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `surface` ```bash map invoke MIMESIS surface --input '{"example":true}' ``` Surface a pattern from the historical record: what has the institution done repeatedly? Capability: `map.mimesis.surface` ### `precedent` ```bash map invoke MIMESIS precedent --input '{"example":true}' ``` Cite a precedent for a current decision; ranked similar cases with outcomes. Capability: `map.mimesis.precedent` ### `formalize` ```bash map invoke MIMESIS formalize --input '{"example":true}' ``` Propose formalization of a custom into explicit policy via MAXIM. Capability: `map.mimesis.formalize` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mimesis/governance # Refusal posture, dissent preservation, audit footprint for MIMESIS. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MIMESIS` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MIMESIS` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mimesis.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MIMESIS` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MIMESIS` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mimesis/internals # Crate path, key types, adjacent protocols for MIMESIS. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MIMESIS` (Convention · Custom · Precedent) lives in `protocols/mimesis-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mimesis-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mimesis-lib/src/protocol.rs` | core protocol logic | | `protocols/mimesis-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mimesis-lib/tests/` | unit + integration tests | | `schemas/mimesis/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MimesisProtocol { fn protocol_name(&self) -> &'static str { "MIMESIS" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "surface", "precedent", "formalize", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "surface" => self.surface(payload, ctx).await, "precedent" => self.precedent(payload, ctx).await, "formalize" => self.formalize(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mimesis-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mimesis/metering # How MEAL meters MIMESIS operations. ================================================================================ Every call on `MIMESIS` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `surface` | yes | yes | yes | | `precedent` | yes | yes | yes | | `formalize` | yes | yes | yes | ## Rate card `MIMESIS` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MIMESIS` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MIMESIS`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mimesis/operations # Every operation on MIMESIS. ================================================================================ The full operation table for `MIMESIS`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mimesis-lib` crate. ## Index | Operation | Summary | | --- | --- | | `surface` | Surface a pattern from the historical record: what has the institution done repeatedly? | | `precedent` | Cite a precedent for a current decision; ranked similar cases with outcomes. | | `formalize` | Propose formalization of a custom into explicit policy via MAXIM. | ## Reference ### `surface` Surface a pattern from the historical record: what has the institution done repeatedly? | Field | Value | | --- | --- | | Capability | `map.mimesis.surface` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `precedent` Cite a precedent for a current decision; ranked similar cases with outcomes. | Field | Value | | --- | --- | | Capability | `map.mimesis.precedent` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `formalize` Propose formalization of a custom into explicit policy via MAXIM. | Field | Value | | --- | --- | | Capability | `map.mimesis.formalize` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mimesis/schemas # Request and response JSON schemas for MIMESIS. ================================================================================ The OCIP contracts for `MIMESIS` live in `/Volumes/L1feAI/l1feosx/map/schemas/mimesis/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mimesis/v1/ ├── index.json ├── operations.surface.request.json ├── operations.surface.response.json ├── operations.precedent.request.json ├── operations.precedent.response.json ├── operations.formalize.request.json ├── operations.formalize.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `surface` | `schemas/mimesis/v1/operations.surface.request.json` | `schemas/mimesis/v1/operations.surface.response.json` | | `precedent` | `schemas/mimesis/v1/operations.precedent.request.json` | `schemas/mimesis/v1/operations.precedent.response.json` | | `formalize` | `schemas/mimesis/v1/operations.formalize.request.json` | `schemas/mimesis/v1/operations.formalize.response.json` | ## Published ```text https://schemas.multiagentic.dev/mimesis/v1/operations..request.json https://schemas.multiagentic.dev/mimesis/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mimesis/sdks # Rust, TypeScript and HTTP for MIMESIS. ================================================================================ Every operation on `MIMESIS` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MIMESIS", "v1.0.0", "surface", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MIMESIS', version: 'v1.0.0', operation: 'surface', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MIMESIS", "version": "v1.0.0", "operation": "surface", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"surface"` — Surface a pattern from the historical record: what has the institution done repeatedly? - `map.dispatch(...)` with operation `"precedent"` — Cite a precedent for a current decision; ranked similar cases with outcomes. - `map.dispatch(...)` with operation `"formalize"` — Propose formalization of a custom into explicit policy via MAXIM. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MIND # URL: https://docs.multiagentic.dev/docs/protocols/mind # Multi-Agentic Interoperable Neuro-symbolic Data · The cognitive substrate. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **The cognitive substrate.** > > Episodic, procedural, resource, vault. HNSW search, knowledge graph, causal layers, working-memory bridge. | Field | Value | | --- | --- | | Acronym | `MIND` | | Full name | Multi-Agentic Interoperable Neuro-symbolic Data | | Plane | II — Cognition | | Kind | Hybrid · Protocol + Agent | | City role | Librarian | | Crate | `protocols/mind-lib` | | Status | Implemented · production-grade. | ## What this is Episodic, procedural, resource, vault. HNSW search, knowledge graph, causal layers, working-memory bridge. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mind/cli # `map invoke MIND` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MIND` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `store_memory` ```bash map invoke MIND store_memory --input '{"kind":"episodic","payload":{"tag":"demo","data":"hello"}}' ``` Insert a memory cell into one of the four memory types with optional vector + graph indexing. Capability: `map.mind.store_memory` ### `recall_memory` ```bash map invoke MIND recall_memory --input '{"kind":"episodic","limit":10}' ``` Recall memories by semantic, structural, or temporal predicate; returns ranked results with provenance. Capability: `map.mind.recall_memory` ### `associate_memories` ```bash map invoke MIND associate_memories --input '{"example":true}' ``` Create or strengthen an association between memory cells; updates the knowledge graph. Capability: `map.mind.associate_memories` ### `query_knowledge` ```bash map invoke MIND query_knowledge --input '{"example":true}' ``` Query the knowledge graph for subgraph snapshots, optionally bound by source attestation. Capability: `map.mind.query_knowledge` ### `fusion_request` ```bash map invoke MIND fusion_request --input '{"example":true}' ``` Compose a multi-modal fusion across memory types for a higher-level reasoning bind. Capability: `map.mind.fusion_request` ### `mind.beliefs.assert` ```bash map invoke MIND mind.beliefs.assert --input '{"example":true}' ``` Assert a belief into the belief base; justifications recorded. Capability: `map.mind.mind.beliefs.assert` ### `mind.beliefs.retract` ```bash map invoke MIND mind.beliefs.retract --input '{"example":true}' ``` Retract a previously asserted belief; justification chain updated. Capability: `map.mind.mind.beliefs.retract` ### `mind.beliefs.query` ```bash map invoke MIND mind.beliefs.query --input '{"example":true}' ``` Query the active belief base by predicate. Capability: `map.mind.mind.beliefs.query` ### `mind.beliefs.justify` ```bash map invoke MIND mind.beliefs.justify --input '{"example":true}' ``` Return the justification chain for a held belief. Capability: `map.mind.mind.beliefs.justify` ### `mind.beliefs.subscribe` ```bash map invoke MIND mind.beliefs.subscribe --input '{"example":true}' ``` Subscribe to belief changes for live reasoning binds. Capability: `map.mind.mind.beliefs.subscribe` ### `wm.bridge` ```bash map invoke MIND wm.bridge --input '{"example":true}' ``` Working memory bridge — feature-gated; exposes WM events to bound reasoning services. Capability: `map.mind.wm.bridge` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mind/governance # Refusal posture, dissent preservation, audit footprint for MIND. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MIND` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MIND` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mind.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MIND` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MIND` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mind/internals # Crate path, key types, adjacent protocols for MIND. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MIND` (Multi-Agentic Interoperable Neuro-symbolic Data) lives in `protocols/mind-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mind-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mind-lib/src/protocol.rs` | core protocol logic | | `protocols/mind-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mind-lib/tests/` | unit + integration tests | | `schemas/mind/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MindProtocol { fn protocol_name(&self) -> &'static str { "MIND" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "store_memory", "recall_memory", "associate_memories", "query_knowledge", "fusion_request", "mind.beliefs.assert", "mind.beliefs.retract", "mind.beliefs.query", "mind.beliefs.justify", "mind.beliefs.subscribe", "wm.bridge", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "store_memory" => self.store_memory(payload, ctx).await, "recall_memory" => self.recall_memory(payload, ctx).await, "associate_memories" => self.associate_memories(payload, ctx).await, "query_knowledge" => self.query_knowledge(payload, ctx).await, "fusion_request" => self.fusion_request(payload, ctx).await, "mind.beliefs.assert" => self.mind_beliefs_assert(payload, ctx).await, "mind.beliefs.retract" => self.mind_beliefs_retract(payload, ctx).await, "mind.beliefs.query" => self.mind_beliefs_query(payload, ctx).await, "mind.beliefs.justify" => self.mind_beliefs_justify(payload, ctx).await, "mind.beliefs.subscribe" => self.mind_beliefs_subscribe(payload, ctx).await, "wm.bridge" => self.wm_bridge(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mind-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mind/metering # How MEAL meters MIND operations. ================================================================================ Every call on `MIND` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `store_memory` | 0 | yes | `<0.001 kWh` | | `recall_memory` | 0 | yes | `<0.001 kWh` | | `associate_memories` | 0 | yes | `<0.001 kWh` | | `query_knowledge` | 0 | yes | `<0.001 kWh` | | `fusion_request` | yes | yes | yes | | `mind.beliefs.assert` | 0 | yes | `<0.001 kWh` | | `mind.beliefs.retract` | 0 | yes | `<0.001 kWh` | | `mind.beliefs.query` | 0 | yes | `<0.001 kWh` | | `mind.beliefs.justify` | 0 | yes | `<0.001 kWh` | | `mind.beliefs.subscribe` | 0 | yes | `<0.001 kWh` | | `wm.bridge` | 0 | yes | `<0.001 kWh` | ## Rate card `MIND` is a **hybrid** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MIND` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MIND`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mind/operations # Every operation on MIND. ================================================================================ The full operation table for `MIND`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mind-lib` crate. ## Index | Operation | Summary | | --- | --- | | `store_memory` | Insert a memory cell into one of the four memory types with optional vector + graph indexing. | | `recall_memory` | Recall memories by semantic, structural, or temporal predicate; returns ranked results with provenance. | | `associate_memories` | Create or strengthen an association between memory cells; updates the knowledge graph. | | `query_knowledge` | Query the knowledge graph for subgraph snapshots, optionally bound by source attestation. | | `fusion_request` | Compose a multi-modal fusion across memory types for a higher-level reasoning bind. | | `mind.beliefs.assert` | Assert a belief into the belief base; justifications recorded. | | `mind.beliefs.retract` | Retract a previously asserted belief; justification chain updated. | | `mind.beliefs.query` | Query the active belief base by predicate. | | `mind.beliefs.justify` | Return the justification chain for a held belief. | | `mind.beliefs.subscribe` | Subscribe to belief changes for live reasoning binds. | | `wm.bridge` | Working memory bridge — feature-gated; exposes WM events to bound reasoning services. | ## Reference ### `store_memory` Insert a memory cell into one of the four memory types with optional vector + graph indexing. | Field | Value | | --- | --- | | Capability | `map.mind.store_memory` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "kind": "episodic", "payload": { "tag": "demo", "data": "hello" } } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `recall_memory` Recall memories by semantic, structural, or temporal predicate; returns ranked results with provenance. | Field | Value | | --- | --- | | Capability | `map.mind.recall_memory` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "kind": "episodic", "limit": 10 } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `associate_memories` Create or strengthen an association between memory cells; updates the knowledge graph. | Field | Value | | --- | --- | | Capability | `map.mind.associate_memories` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `query_knowledge` Query the knowledge graph for subgraph snapshots, optionally bound by source attestation. | Field | Value | | --- | --- | | Capability | `map.mind.query_knowledge` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `fusion_request` Compose a multi-modal fusion across memory types for a higher-level reasoning bind. | Field | Value | | --- | --- | | Capability | `map.mind.fusion_request` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `mind.beliefs.assert` Assert a belief into the belief base; justifications recorded. | Field | Value | | --- | --- | | Capability | `map.mind.mind.beliefs.assert` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `mind.beliefs.retract` Retract a previously asserted belief; justification chain updated. | Field | Value | | --- | --- | | Capability | `map.mind.mind.beliefs.retract` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `mind.beliefs.query` Query the active belief base by predicate. | Field | Value | | --- | --- | | Capability | `map.mind.mind.beliefs.query` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `mind.beliefs.justify` Return the justification chain for a held belief. | Field | Value | | --- | --- | | Capability | `map.mind.mind.beliefs.justify` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `mind.beliefs.subscribe` Subscribe to belief changes for live reasoning binds. | Field | Value | | --- | --- | | Capability | `map.mind.mind.beliefs.subscribe` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `wm.bridge` Working memory bridge — feature-gated; exposes WM events to bound reasoning services. | Field | Value | | --- | --- | | Capability | `map.mind.wm.bridge` | | Idempotent | No — supply `Idempotency-Key` for safe retries | | Feature flag | `wm-bridge` | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mind/schemas # Request and response JSON schemas for MIND. ================================================================================ The OCIP contracts for `MIND` live in `/Volumes/L1feAI/l1feosx/map/schemas/mind/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mind/v1/ ├── index.json ├── operations.store_memory.request.json ├── operations.store_memory.response.json ├── operations.recall_memory.request.json ├── operations.recall_memory.response.json ├── operations.associate_memories.request.json ├── operations.associate_memories.response.json ├── operations.query_knowledge.request.json ├── operations.query_knowledge.response.json ├── operations.fusion_request.request.json ├── operations.fusion_request.response.json ├── operations.mind.beliefs.assert.request.json ├── operations.mind.beliefs.assert.response.json ├── operations.mind.beliefs.retract.request.json ├── operations.mind.beliefs.retract.response.json ├── operations.mind.beliefs.query.request.json ├── operations.mind.beliefs.query.response.json ├── operations.mind.beliefs.justify.request.json ├── operations.mind.beliefs.justify.response.json ├── operations.mind.beliefs.subscribe.request.json ├── operations.mind.beliefs.subscribe.response.json ├── operations.wm.bridge.request.json ├── operations.wm.bridge.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `store_memory` | `schemas/mind/v1/operations.store_memory.request.json` | `schemas/mind/v1/operations.store_memory.response.json` | | `recall_memory` | `schemas/mind/v1/operations.recall_memory.request.json` | `schemas/mind/v1/operations.recall_memory.response.json` | | `associate_memories` | `schemas/mind/v1/operations.associate_memories.request.json` | `schemas/mind/v1/operations.associate_memories.response.json` | | `query_knowledge` | `schemas/mind/v1/operations.query_knowledge.request.json` | `schemas/mind/v1/operations.query_knowledge.response.json` | | `fusion_request` | `schemas/mind/v1/operations.fusion_request.request.json` | `schemas/mind/v1/operations.fusion_request.response.json` | | `mind.beliefs.assert` | `schemas/mind/v1/operations.mind.beliefs.assert.request.json` | `schemas/mind/v1/operations.mind.beliefs.assert.response.json` | | `mind.beliefs.retract` | `schemas/mind/v1/operations.mind.beliefs.retract.request.json` | `schemas/mind/v1/operations.mind.beliefs.retract.response.json` | | `mind.beliefs.query` | `schemas/mind/v1/operations.mind.beliefs.query.request.json` | `schemas/mind/v1/operations.mind.beliefs.query.response.json` | | `mind.beliefs.justify` | `schemas/mind/v1/operations.mind.beliefs.justify.request.json` | `schemas/mind/v1/operations.mind.beliefs.justify.response.json` | | `mind.beliefs.subscribe` | `schemas/mind/v1/operations.mind.beliefs.subscribe.request.json` | `schemas/mind/v1/operations.mind.beliefs.subscribe.response.json` | | `wm.bridge` | `schemas/mind/v1/operations.wm.bridge.request.json` | `schemas/mind/v1/operations.wm.bridge.response.json` | ## Published ```text https://schemas.multiagentic.dev/mind/v1/operations..request.json https://schemas.multiagentic.dev/mind/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mind/sdks # Rust, TypeScript and HTTP for MIND. ================================================================================ Every operation on `MIND` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MIND", "v1.0.0", "store_memory", json!({ "kind": "episodic", "payload": { "tag": "demo", "data": "hello" } }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MIND', version: 'v1.0.0', operation: 'store_memory', input: { "kind": "episodic", "payload": { "tag": "demo", "data": "hello" } } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MIND", "version": "v1.0.0", "operation": "store_memory", "input": { "kind": "episodic", "payload": { "tag": "demo", "data": "hello" } }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"store_memory"` — Insert a memory cell into one of the four memory types with optional vector + graph indexing. - `map.dispatch(...)` with operation `"recall_memory"` — Recall memories by semantic, structural, or temporal predicate; returns ranked results with provenance. - `map.dispatch(...)` with operation `"associate_memories"` — Create or strengthen an association between memory cells; updates the knowledge graph. - `map.dispatch(...)` with operation `"query_knowledge"` — Query the knowledge graph for subgraph snapshots, optionally bound by source attestation. - `map.dispatch(...)` with operation `"fusion_request"` — Compose a multi-modal fusion across memory types for a higher-level reasoning bind. - `map.dispatch(...)` with operation `"mind.beliefs.assert"` — Assert a belief into the belief base; justifications recorded. - `map.dispatch(...)` with operation `"mind.beliefs.retract"` — Retract a previously asserted belief; justification chain updated. - `map.dispatch(...)` with operation `"mind.beliefs.query"` — Query the active belief base by predicate. - `map.dispatch(...)` with operation `"mind.beliefs.justify"` — Return the justification chain for a held belief. - `map.dispatch(...)` with operation `"mind.beliefs.subscribe"` — Subscribe to belief changes for live reasoning binds. - `map.dispatch(...)` with operation `"wm.bridge"` — Working memory bridge — feature-gated; exposes WM events to bound reasoning services. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MOAT # URL: https://docs.multiagentic.dev/docs/protocols/moat # Multi-Organization Operations & Treaties · Two charters meeting at a boundary. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Two charters meeting at a boundary.** > > Treaty-based federation. Policy evaluation, violation detection, compliance assertion. | Field | Value | | --- | --- | | Acronym | `MOAT` | | Full name | Multi-Organization Operations & Treaties | | Plane | IV — Governance | | Kind | Protocol · Stateless | | City role | Standards body | | Crate | `protocols/moat-lib` | | Status | Implemented · production-grade. | ## What this is Treaty-based federation. Policy evaluation, violation detection, compliance assertion. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/moat/cli # `map invoke MOAT` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MOAT` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `policy_evaluation` ```bash map invoke MOAT policy_evaluation --input '{"example":true}' ``` Evaluate a request against the active treaty envelope between two orgs. Capability: `map.moat.policy_evaluation` ### `violation_detection` ```bash map invoke MOAT violation_detection --input '{"example":true}' ``` Detect a treaty violation in the audit chain; surfaces to MOOT for arbitration. Capability: `map.moat.violation_detection` ### `policy_update` ```bash map invoke MOAT policy_update --input '{"example":true}' ``` Update treaty policy under MACE ratification on both sides. Capability: `map.moat.policy_update` ### `compliance_query` ```bash map invoke MOAT compliance_query --input '{"example":true}' ``` Query current compliance posture for a treaty. Capability: `map.moat.compliance_query` ### `compliance_assertion` ```bash map invoke MOAT compliance_assertion --input '{"example":true}' ``` Submit a compliance assertion with supporting attestations. Capability: `map.moat.compliance_assertion` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/moat/governance # Refusal posture, dissent preservation, audit footprint for MOAT. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOAT` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MOAT` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.moat.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MOAT` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MOAT` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/moat/internals # Crate path, key types, adjacent protocols for MOAT. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOAT` (Multi-Organization Operations & Treaties) lives in `protocols/moat-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/moat-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/moat-lib/src/protocol.rs` | core protocol logic | | `protocols/moat-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/moat-lib/tests/` | unit + integration tests | | `schemas/moat/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MoatProtocol { fn protocol_name(&self) -> &'static str { "MOAT" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "policy_evaluation", "violation_detection", "policy_update", "compliance_query", "compliance_assertion", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "policy_evaluation" => self.policy_evaluation(payload, ctx).await, "violation_detection" => self.violation_detection(payload, ctx).await, "policy_update" => self.policy_update(payload, ctx).await, "compliance_query" => self.compliance_query(payload, ctx).await, "compliance_assertion" => self.compliance_assertion(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p moat-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/moat/metering # How MEAL meters MOAT operations. ================================================================================ Every call on `MOAT` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `policy_evaluation` | 0 | yes | `<0.001 kWh` | | `violation_detection` | 0 | yes | `<0.001 kWh` | | `policy_update` | 0 | yes | `<0.001 kWh` | | `compliance_query` | 0 | yes | `<0.001 kWh` | | `compliance_assertion` | 0 | yes | `<0.001 kWh` | ## Rate card `MOAT` is a **protocol** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MOAT` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MOAT`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/moat/operations # Every operation on MOAT. ================================================================================ The full operation table for `MOAT`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/moat-lib` crate. ## Index | Operation | Summary | | --- | --- | | `policy_evaluation` | Evaluate a request against the active treaty envelope between two orgs. | | `violation_detection` | Detect a treaty violation in the audit chain; surfaces to MOOT for arbitration. | | `policy_update` | Update treaty policy under MACE ratification on both sides. | | `compliance_query` | Query current compliance posture for a treaty. | | `compliance_assertion` | Submit a compliance assertion with supporting attestations. | ## Reference ### `policy_evaluation` Evaluate a request against the active treaty envelope between two orgs. | Field | Value | | --- | --- | | Capability | `map.moat.policy_evaluation` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `violation_detection` Detect a treaty violation in the audit chain; surfaces to MOOT for arbitration. | Field | Value | | --- | --- | | Capability | `map.moat.violation_detection` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `policy_update` Update treaty policy under MACE ratification on both sides. | Field | Value | | --- | --- | | Capability | `map.moat.policy_update` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `compliance_query` Query current compliance posture for a treaty. | Field | Value | | --- | --- | | Capability | `map.moat.compliance_query` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `compliance_assertion` Submit a compliance assertion with supporting attestations. | Field | Value | | --- | --- | | Capability | `map.moat.compliance_assertion` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/moat/schemas # Request and response JSON schemas for MOAT. ================================================================================ The OCIP contracts for `MOAT` live in `/Volumes/L1feAI/l1feosx/map/schemas/moat/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/moat/v1/ ├── index.json ├── operations.policy_evaluation.request.json ├── operations.policy_evaluation.response.json ├── operations.violation_detection.request.json ├── operations.violation_detection.response.json ├── operations.policy_update.request.json ├── operations.policy_update.response.json ├── operations.compliance_query.request.json ├── operations.compliance_query.response.json ├── operations.compliance_assertion.request.json ├── operations.compliance_assertion.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `policy_evaluation` | `schemas/moat/v1/operations.policy_evaluation.request.json` | `schemas/moat/v1/operations.policy_evaluation.response.json` | | `violation_detection` | `schemas/moat/v1/operations.violation_detection.request.json` | `schemas/moat/v1/operations.violation_detection.response.json` | | `policy_update` | `schemas/moat/v1/operations.policy_update.request.json` | `schemas/moat/v1/operations.policy_update.response.json` | | `compliance_query` | `schemas/moat/v1/operations.compliance_query.request.json` | `schemas/moat/v1/operations.compliance_query.response.json` | | `compliance_assertion` | `schemas/moat/v1/operations.compliance_assertion.request.json` | `schemas/moat/v1/operations.compliance_assertion.response.json` | ## Published ```text https://schemas.multiagentic.dev/moat/v1/operations..request.json https://schemas.multiagentic.dev/moat/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/moat/sdks # Rust, TypeScript and HTTP for MOAT. ================================================================================ Every operation on `MOAT` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MOAT", "v1.0.0", "policy_evaluation", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MOAT', version: 'v1.0.0', operation: 'policy_evaluation', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MOAT", "version": "v1.0.0", "operation": "policy_evaluation", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"policy_evaluation"` — Evaluate a request against the active treaty envelope between two orgs. - `map.dispatch(...)` with operation `"violation_detection"` — Detect a treaty violation in the audit chain; surfaces to MOOT for arbitration. - `map.dispatch(...)` with operation `"policy_update"` — Update treaty policy under MACE ratification on both sides. - `map.dispatch(...)` with operation `"compliance_query"` — Query current compliance posture for a treaty. - `map.dispatch(...)` with operation `"compliance_assertion"` — Submit a compliance assertion with supporting attestations. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MOMENT # URL: https://docs.multiagentic.dev/docs/protocols/moment # Multi-Agentic Operational Metrics & Event Notification Tracking · Every observable as a moment. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Every observable as a moment.** > > Operational metrics and event notification tracking. Append-only, monotonic, time-travel queryable. | Field | Value | | --- | --- | | Acronym | `MOMENT` | | Full name | Multi-Agentic Operational Metrics & Event Notification Tracking | | Plane | VII — Awareness | | Kind | Protocol · Stateless | | City role | Clock tower | | Crate | `see-MOTET` | | Status | Stub · interface defined; awaiting implementation. | ## What this is Operational metrics and event notification tracking. Append-only, monotonic, time-travel queryable. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/moment/cli # `map invoke MOMENT` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MOMENT` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `observe` ```bash map invoke MOMENT observe --input '{"example":true}' ``` Record an observation; timestamp monotonic per source. Capability: `map.moment.observe` ### `query` ```bash map invoke MOMENT query --input '{"example":true}' ``` Query observations by time window, source, predicate. Capability: `map.moment.query` ### `rollup` ```bash map invoke MOMENT rollup --input '{"example":true}' ``` Trigger an offline aggregation rollup; source preserved. Capability: `map.moment.rollup` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/moment/governance # Refusal posture, dissent preservation, audit footprint for MOMENT. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOMENT` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MOMENT` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.moment.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MOMENT` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MOMENT` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/moment/internals # Crate path, key types, adjacent protocols for MOMENT. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOMENT` (Multi-Agentic Operational Metrics & Event Notification Tracking) lives in `see-MOTET`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `see-MOTET/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `see-MOTET/src/protocol.rs` | core protocol logic | | `see-MOTET/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `see-MOTET/tests/` | unit + integration tests | | `schemas/moment/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MomentProtocol { fn protocol_name(&self) -> &'static str { "MOMENT" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "observe", "query", "rollup", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "observe" => self.observe(payload, ctx).await, "query" => self.query(payload, ctx).await, "rollup" => self.rollup(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Stub · interface defined; awaiting implementation. ## Tests ```bash cargo test -p mim-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/moment/metering # How MEAL meters MOMENT operations. ================================================================================ Every call on `MOMENT` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `observe` | 0 | yes | `<0.001 kWh` | | `query` | 0 | yes | `<0.001 kWh` | | `rollup` | 0 | yes | `<0.001 kWh` | ## Rate card `MOMENT` is a **protocol** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MOMENT` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MOMENT`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/moment/operations # Every operation on MOMENT. ================================================================================ The full operation table for `MOMENT`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `see-MOTET` crate. ## Index | Operation | Summary | | --- | --- | | `observe` | Record an observation; timestamp monotonic per source. | | `query` | Query observations by time window, source, predicate. | | `rollup` | Trigger an offline aggregation rollup; source preserved. | ## Reference ### `observe` Record an observation; timestamp monotonic per source. | Field | Value | | --- | --- | | Capability | `map.moment.observe` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `query` Query observations by time window, source, predicate. | Field | Value | | --- | --- | | Capability | `map.moment.query` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `rollup` Trigger an offline aggregation rollup; source preserved. | Field | Value | | --- | --- | | Capability | `map.moment.rollup` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/moment/schemas # Request and response JSON schemas for MOMENT. ================================================================================ The OCIP contracts for `MOMENT` live in `/Volumes/L1feAI/l1feosx/map/schemas/moment/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/moment/v1/ ├── index.json ├── operations.observe.request.json ├── operations.observe.response.json ├── operations.query.request.json ├── operations.query.response.json ├── operations.rollup.request.json ├── operations.rollup.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `observe` | `schemas/moment/v1/operations.observe.request.json` | `schemas/moment/v1/operations.observe.response.json` | | `query` | `schemas/moment/v1/operations.query.request.json` | `schemas/moment/v1/operations.query.response.json` | | `rollup` | `schemas/moment/v1/operations.rollup.request.json` | `schemas/moment/v1/operations.rollup.response.json` | ## Published ```text https://schemas.multiagentic.dev/moment/v1/operations..request.json https://schemas.multiagentic.dev/moment/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/moment/sdks # Rust, TypeScript and HTTP for MOMENT. ================================================================================ Every operation on `MOMENT` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MOMENT", "v1.0.0", "observe", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MOMENT', version: 'v1.0.0', operation: 'observe', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MOMENT", "version": "v1.0.0", "operation": "observe", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"observe"` — Record an observation; timestamp monotonic per source. - `map.dispatch(...)` with operation `"query"` — Query observations by time window, source, predicate. - `map.dispatch(...)` with operation `"rollup"` — Trigger an offline aggregation rollup; source preserved. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MOON # URL: https://docs.multiagentic.dev/docs/protocols/moon # Multi-Agentic Organizational & Operational Nexus · The conductor. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **The conductor.** > > Durable orchestration via Flowers. Workflow manifests, deployment, scaling, replay. | Field | Value | | --- | --- | | Acronym | `MOON` | | Full name | Multi-Agentic Organizational & Operational Nexus | | Plane | V — Execution | | Kind | Agent · Autonomous Org | | City role | Scheduling service | | Crate | `protocols/moon-lib` | | Status | Implemented · production-grade. | ## What this is Durable orchestration via Flowers. Workflow manifests, deployment, scaling, replay. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/moon/cli # `map invoke MOON` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MOON` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `submit_manifest` ```bash map invoke MOON submit_manifest --input '{"example":true}' ``` Submit a workflow manifest; journaled from the first instruction. Capability: `map.moon.submit_manifest` ### `execute_workflow` ```bash map invoke MOON execute_workflow --input '{"example":true}' ``` Dispatch a durable workflow with replayable journal. Capability: `map.moon.execute_workflow` ### `workflow_status` ```bash map invoke MOON workflow_status --input '{"example":true}' ``` Query the status of a running or completed workflow. Capability: `map.moon.workflow_status` ### `agent_deployment_status` ```bash map invoke MOON agent_deployment_status --input '{"example":true}' ``` Query the deployment status of an agent worker. Capability: `map.moon.agent_deployment_status` ### `scale_deployment` ```bash map invoke MOON scale_deployment --input '{"example":true}' ``` Scale a deployment up or down under capability scope. Capability: `map.moon.scale_deployment` ### `update_manifest` ```bash map invoke MOON update_manifest --input '{"example":true}' ``` Update a workflow manifest; versioned with diff against prior. Capability: `map.moon.update_manifest` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/moon/governance # Refusal posture, dissent preservation, audit footprint for MOON. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOON` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MOON` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.moon.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MOON` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MOON` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/moon/internals # Crate path, key types, adjacent protocols for MOON. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOON` (Multi-Agentic Organizational & Operational Nexus) lives in `protocols/moon-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/moon-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/moon-lib/src/protocol.rs` | core protocol logic | | `protocols/moon-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/moon-lib/tests/` | unit + integration tests | | `schemas/moon/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MoonProtocol { fn protocol_name(&self) -> &'static str { "MOON" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "submit_manifest", "execute_workflow", "workflow_status", "agent_deployment_status", "scale_deployment", "update_manifest", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "submit_manifest" => self.submit_manifest(payload, ctx).await, "execute_workflow" => self.execute_workflow(payload, ctx).await, "workflow_status" => self.workflow_status(payload, ctx).await, "agent_deployment_status" => self.agent_deployment_status(payload, ctx).await, "scale_deployment" => self.scale_deployment(payload, ctx).await, "update_manifest" => self.update_manifest(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p moon-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/moon/metering # How MEAL meters MOON operations. ================================================================================ Every call on `MOON` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `submit_manifest` | yes | yes | yes | | `execute_workflow` | yes | yes | yes | | `workflow_status` | yes | yes | yes | | `agent_deployment_status` | yes | yes | yes | | `scale_deployment` | yes | yes | yes | | `update_manifest` | yes | yes | yes | ## Rate card `MOON` is an **agent** kind — heavy on tokens and watts. Standard multipliers apply unless the tenant has a Sovereign-tier override. | Dimension | Base rate | Multiplier on `MOON` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 1.0× | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 1.0× – 1.2× | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MOON`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/moon/operations # Every operation on MOON. ================================================================================ The full operation table for `MOON`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/moon-lib` crate. ## Index | Operation | Summary | | --- | --- | | `submit_manifest` | Submit a workflow manifest; journaled from the first instruction. | | `execute_workflow` | Dispatch a durable workflow with replayable journal. | | `workflow_status` | Query the status of a running or completed workflow. | | `agent_deployment_status` | Query the deployment status of an agent worker. | | `scale_deployment` | Scale a deployment up or down under capability scope. | | `update_manifest` | Update a workflow manifest; versioned with diff against prior. | ## Reference ### `submit_manifest` Submit a workflow manifest; journaled from the first instruction. | Field | Value | | --- | --- | | Capability | `map.moon.submit_manifest` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `execute_workflow` Dispatch a durable workflow with replayable journal. | Field | Value | | --- | --- | | Capability | `map.moon.execute_workflow` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `workflow_status` Query the status of a running or completed workflow. | Field | Value | | --- | --- | | Capability | `map.moon.workflow_status` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `agent_deployment_status` Query the deployment status of an agent worker. | Field | Value | | --- | --- | | Capability | `map.moon.agent_deployment_status` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `scale_deployment` Scale a deployment up or down under capability scope. | Field | Value | | --- | --- | | Capability | `map.moon.scale_deployment` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `update_manifest` Update a workflow manifest; versioned with diff against prior. | Field | Value | | --- | --- | | Capability | `map.moon.update_manifest` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/moon/schemas # Request and response JSON schemas for MOON. ================================================================================ The OCIP contracts for `MOON` live in `/Volumes/L1feAI/l1feosx/map/schemas/moon/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/moon/v1/ ├── index.json ├── operations.submit_manifest.request.json ├── operations.submit_manifest.response.json ├── operations.execute_workflow.request.json ├── operations.execute_workflow.response.json ├── operations.workflow_status.request.json ├── operations.workflow_status.response.json ├── operations.agent_deployment_status.request.json ├── operations.agent_deployment_status.response.json ├── operations.scale_deployment.request.json ├── operations.scale_deployment.response.json ├── operations.update_manifest.request.json ├── operations.update_manifest.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `submit_manifest` | `schemas/moon/v1/operations.submit_manifest.request.json` | `schemas/moon/v1/operations.submit_manifest.response.json` | | `execute_workflow` | `schemas/moon/v1/operations.execute_workflow.request.json` | `schemas/moon/v1/operations.execute_workflow.response.json` | | `workflow_status` | `schemas/moon/v1/operations.workflow_status.request.json` | `schemas/moon/v1/operations.workflow_status.response.json` | | `agent_deployment_status` | `schemas/moon/v1/operations.agent_deployment_status.request.json` | `schemas/moon/v1/operations.agent_deployment_status.response.json` | | `scale_deployment` | `schemas/moon/v1/operations.scale_deployment.request.json` | `schemas/moon/v1/operations.scale_deployment.response.json` | | `update_manifest` | `schemas/moon/v1/operations.update_manifest.request.json` | `schemas/moon/v1/operations.update_manifest.response.json` | ## Published ```text https://schemas.multiagentic.dev/moon/v1/operations..request.json https://schemas.multiagentic.dev/moon/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/moon/sdks # Rust, TypeScript and HTTP for MOON. ================================================================================ Every operation on `MOON` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MOON", "v1.0.0", "submit_manifest", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MOON', version: 'v1.0.0', operation: 'submit_manifest', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MOON", "version": "v1.0.0", "operation": "submit_manifest", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"submit_manifest"` — Submit a workflow manifest; journaled from the first instruction. - `map.dispatch(...)` with operation `"execute_workflow"` — Dispatch a durable workflow with replayable journal. - `map.dispatch(...)` with operation `"workflow_status"` — Query the status of a running or completed workflow. - `map.dispatch(...)` with operation `"agent_deployment_status"` — Query the deployment status of an agent worker. - `map.dispatch(...)` with operation `"scale_deployment"` — Scale a deployment up or down under capability scope. - `map.dispatch(...)` with operation `"update_manifest"` — Update a workflow manifest; versioned with diff against prior. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MOOT # URL: https://docs.multiagentic.dev/docs/protocols/moot # Dispute Resolution & Arbitration · Pleading, evidence, binding outcome. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Pleading, evidence, binding outcome.** > > Multi-org operations and dispute resolution. Structured arbitration with binding outcomes. | Field | Value | | --- | --- | | Acronym | `MOOT` | | Full name | Dispute Resolution & Arbitration | | Plane | IV — Governance | | Kind | Hybrid · Protocol + Agent | | City role | Court | | Crate | `protocols/moot-lib` | | Status | Partial · core methods implemented; some features pending. | ## What this is Multi-org operations and dispute resolution. Structured arbitration with binding outcomes. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/moot/cli # `map invoke MOOT` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MOOT` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `file` ```bash map invoke MOOT file --input '{"example":true}' ``` File a case: caller, respondent, claim, evidence, requested remedy. Capability: `map.moot.file` ### `plead` ```bash map invoke MOOT plead --input '{"example":true}' ``` File a structured plea or response; evidence channels open through MAVEN. Capability: `map.moot.plead` ### `rule` ```bash map invoke MOOT rule --input '{"example":true}' ``` Issue a ruling; binding under the active charter; appealable under stated terms. Capability: `map.moot.rule` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/moot/governance # Refusal posture, dissent preservation, audit footprint for MOOT. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOOT` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MOOT` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.moot.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MOOT` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MOOT` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/moot/internals # Crate path, key types, adjacent protocols for MOOT. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOOT` (Dispute Resolution & Arbitration) lives in `protocols/moot-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/moot-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/moot-lib/src/protocol.rs` | core protocol logic | | `protocols/moot-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/moot-lib/tests/` | unit + integration tests | | `schemas/moot/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MootProtocol { fn protocol_name(&self) -> &'static str { "MOOT" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "file", "plead", "rule", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "file" => self.file(payload, ctx).await, "plead" => self.plead(payload, ctx).await, "rule" => self.rule(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Partial · core methods implemented; some features pending. ## Tests ```bash cargo test -p moot-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/moot/metering # How MEAL meters MOOT operations. ================================================================================ Every call on `MOOT` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `file` | 0 | yes | `<0.001 kWh` | | `plead` | 0 | yes | `<0.001 kWh` | | `rule` | 0 | yes | `<0.001 kWh` | ## Rate card `MOOT` is a **hybrid** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MOOT` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MOOT`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/moot/operations # Every operation on MOOT. ================================================================================ The full operation table for `MOOT`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/moot-lib` crate. ## Index | Operation | Summary | | --- | --- | | `file` | File a case: caller, respondent, claim, evidence, requested remedy. | | `plead` | File a structured plea or response; evidence channels open through MAVEN. | | `rule` | Issue a ruling; binding under the active charter; appealable under stated terms. | ## Reference ### `file` File a case: caller, respondent, claim, evidence, requested remedy. | Field | Value | | --- | --- | | Capability | `map.moot.file` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `plead` File a structured plea or response; evidence channels open through MAVEN. | Field | Value | | --- | --- | | Capability | `map.moot.plead` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `rule` Issue a ruling; binding under the active charter; appealable under stated terms. | Field | Value | | --- | --- | | Capability | `map.moot.rule` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/moot/schemas # Request and response JSON schemas for MOOT. ================================================================================ The OCIP contracts for `MOOT` live in `/Volumes/L1feAI/l1feosx/map/schemas/moot/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/moot/v1/ ├── index.json ├── operations.file.request.json ├── operations.file.response.json ├── operations.plead.request.json ├── operations.plead.response.json ├── operations.rule.request.json ├── operations.rule.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `file` | `schemas/moot/v1/operations.file.request.json` | `schemas/moot/v1/operations.file.response.json` | | `plead` | `schemas/moot/v1/operations.plead.request.json` | `schemas/moot/v1/operations.plead.response.json` | | `rule` | `schemas/moot/v1/operations.rule.request.json` | `schemas/moot/v1/operations.rule.response.json` | ## Published ```text https://schemas.multiagentic.dev/moot/v1/operations..request.json https://schemas.multiagentic.dev/moot/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/moot/sdks # Rust, TypeScript and HTTP for MOOT. ================================================================================ Every operation on `MOOT` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MOOT", "v1.0.0", "file", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MOOT', version: 'v1.0.0', operation: 'file', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MOOT", "version": "v1.0.0", "operation": "file", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"file"` — File a case: caller, respondent, claim, evidence, requested remedy. - `map.dispatch(...)` with operation `"plead"` — File a structured plea or response; evidence channels open through MAVEN. - `map.dispatch(...)` with operation `"rule"` — Issue a ruling; binding under the active charter; appealable under stated terms. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MOTE # URL: https://docs.multiagentic.dev/docs/protocols/mote # Multi-Agent Operational Telemetry & Equipment · When the institution acts on the world. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **When the institution acts on the world.** > > Sensors, actuators, vehicles, fabrication. Operational telemetry and equipment bridge. | Field | Value | | --- | --- | | Acronym | `MOTE` | | Full name | Multi-Agent Operational Telemetry & Equipment | | Plane | V — Execution | | Kind | Hybrid · Protocol + Agent | | City role | Physical bridge | | Crate | `protocols/mote-lib` | | Status | Implemented · production-grade. | ## What this is Sensors, actuators, vehicles, fabrication. Operational telemetry and equipment bridge. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/mote/cli # `map invoke MOTE` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MOTE` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `sensor_read` ```bash map invoke MOTE sensor_read --input '{"example":true}' ``` Read a sensor stream into MIND with continuous attestation. Capability: `map.mote.sensor_read` ### `actuator_move` ```bash map invoke MOTE actuator_move --input '{"example":true}' ``` Send a motion actuation command; sandboxed by physical capability declaration. Capability: `map.mote.actuator_move` ### `actuator_set_state` ```bash map invoke MOTE actuator_set_state --input '{"example":true}' ``` Set the state of an actuator (e.g., relay, valve); state change recorded. Capability: `map.mote.actuator_set_state` ### `dispenser_dispense` ```bash map invoke MOTE dispenser_dispense --input '{"example":true}' ``` Dispense from a metered physical resource (printer, fluid, material). Capability: `map.mote.dispenser_dispense` ### `device_discovery` ```bash map invoke MOTE device_discovery --input '{"example":true}' ``` Discover bound devices and their capability declarations. Capability: `map.mote.device_discovery` ### `health_check` ```bash map invoke MOTE health_check --input '{"example":true}' ``` Device health and integrity attestation. Capability: `map.mote.health_check` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/mote/governance # Refusal posture, dissent preservation, audit footprint for MOTE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOTE` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MOTE` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.mote.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MOTE` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MOTE` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/mote/internals # Crate path, key types, adjacent protocols for MOTE. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOTE` (Multi-Agent Operational Telemetry & Equipment) lives in `protocols/mote-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/mote-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/mote-lib/src/protocol.rs` | core protocol logic | | `protocols/mote-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/mote-lib/tests/` | unit + integration tests | | `schemas/mote/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MoteProtocol { fn protocol_name(&self) -> &'static str { "MOTE" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "sensor_read", "actuator_move", "actuator_set_state", "dispenser_dispense", "device_discovery", "health_check", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "sensor_read" => self.sensor_read(payload, ctx).await, "actuator_move" => self.actuator_move(payload, ctx).await, "actuator_set_state" => self.actuator_set_state(payload, ctx).await, "dispenser_dispense" => self.dispenser_dispense(payload, ctx).await, "device_discovery" => self.device_discovery(payload, ctx).await, "health_check" => self.health_check(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p mote-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/mote/metering # How MEAL meters MOTE operations. ================================================================================ Every call on `MOTE` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `sensor_read` | 0 | yes | `<0.001 kWh` | | `actuator_move` | 0 | yes | `<0.001 kWh` | | `actuator_set_state` | 0 | yes | `<0.001 kWh` | | `dispenser_dispense` | 0 | yes | `<0.001 kWh` | | `device_discovery` | 0 | yes | `<0.001 kWh` | | `health_check` | 0 | yes | `<0.001 kWh` | ## Rate card `MOTE` is a **hybrid** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MOTE` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MOTE`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/mote/operations # Every operation on MOTE. ================================================================================ The full operation table for `MOTE`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/mote-lib` crate. ## Index | Operation | Summary | | --- | --- | | `sensor_read` | Read a sensor stream into MIND with continuous attestation. | | `actuator_move` | Send a motion actuation command; sandboxed by physical capability declaration. | | `actuator_set_state` | Set the state of an actuator (e.g., relay, valve); state change recorded. | | `dispenser_dispense` | Dispense from a metered physical resource (printer, fluid, material). | | `device_discovery` | Discover bound devices and their capability declarations. | | `health_check` | Device health and integrity attestation. | ## Reference ### `sensor_read` Read a sensor stream into MIND with continuous attestation. | Field | Value | | --- | --- | | Capability | `map.mote.sensor_read` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `actuator_move` Send a motion actuation command; sandboxed by physical capability declaration. | Field | Value | | --- | --- | | Capability | `map.mote.actuator_move` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `actuator_set_state` Set the state of an actuator (e.g., relay, valve); state change recorded. | Field | Value | | --- | --- | | Capability | `map.mote.actuator_set_state` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `dispenser_dispense` Dispense from a metered physical resource (printer, fluid, material). | Field | Value | | --- | --- | | Capability | `map.mote.dispenser_dispense` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `device_discovery` Discover bound devices and their capability declarations. | Field | Value | | --- | --- | | Capability | `map.mote.device_discovery` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `health_check` Device health and integrity attestation. | Field | Value | | --- | --- | | Capability | `map.mote.health_check` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/mote/schemas # Request and response JSON schemas for MOTE. ================================================================================ The OCIP contracts for `MOTE` live in `/Volumes/L1feAI/l1feosx/map/schemas/mote/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/mote/v1/ ├── index.json ├── operations.sensor_read.request.json ├── operations.sensor_read.response.json ├── operations.actuator_move.request.json ├── operations.actuator_move.response.json ├── operations.actuator_set_state.request.json ├── operations.actuator_set_state.response.json ├── operations.dispenser_dispense.request.json ├── operations.dispenser_dispense.response.json ├── operations.device_discovery.request.json ├── operations.device_discovery.response.json ├── operations.health_check.request.json ├── operations.health_check.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `sensor_read` | `schemas/mote/v1/operations.sensor_read.request.json` | `schemas/mote/v1/operations.sensor_read.response.json` | | `actuator_move` | `schemas/mote/v1/operations.actuator_move.request.json` | `schemas/mote/v1/operations.actuator_move.response.json` | | `actuator_set_state` | `schemas/mote/v1/operations.actuator_set_state.request.json` | `schemas/mote/v1/operations.actuator_set_state.response.json` | | `dispenser_dispense` | `schemas/mote/v1/operations.dispenser_dispense.request.json` | `schemas/mote/v1/operations.dispenser_dispense.response.json` | | `device_discovery` | `schemas/mote/v1/operations.device_discovery.request.json` | `schemas/mote/v1/operations.device_discovery.response.json` | | `health_check` | `schemas/mote/v1/operations.health_check.request.json` | `schemas/mote/v1/operations.health_check.response.json` | ## Published ```text https://schemas.multiagentic.dev/mote/v1/operations..request.json https://schemas.multiagentic.dev/mote/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/mote/sdks # Rust, TypeScript and HTTP for MOTE. ================================================================================ Every operation on `MOTE` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MOTE", "v1.0.0", "sensor_read", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MOTE', version: 'v1.0.0', operation: 'sensor_read', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MOTE", "version": "v1.0.0", "operation": "sensor_read", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"sensor_read"` — Read a sensor stream into MIND with continuous attestation. - `map.dispatch(...)` with operation `"actuator_move"` — Send a motion actuation command; sandboxed by physical capability declaration. - `map.dispatch(...)` with operation `"actuator_set_state"` — Set the state of an actuator (e.g., relay, valve); state change recorded. - `map.dispatch(...)` with operation `"dispenser_dispense"` — Dispense from a metered physical resource (printer, fluid, material). - `map.dispatch(...)` with operation `"device_discovery"` — Discover bound devices and their capability declarations. - `map.dispatch(...)` with operation `"health_check"` — Device health and integrity attestation. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MOTET # URL: https://docs.multiagentic.dev/docs/protocols/motet # Multi-Agentic Operational Telemetry & Event Transport · Polyphonic observability. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Polyphonic observability.** > > Operational telemetry and event transport. Logs, metrics, traces, attestations. W3C trace propagation. | Field | Value | | --- | --- | | Acronym | `MOTET` | | Full name | Multi-Agentic Operational Telemetry & Event Transport | | Plane | VII — Awareness | | Kind | Protocol · Stateless | | City role | Event bus | | Crate | `engine/observability` | | Status | Stub · interface defined; awaiting implementation. | ## What this is Operational telemetry and event transport. Logs, metrics, traces, attestations. W3C trace propagation. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/motet/cli # `map invoke MOTET` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MOTET` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `emit` ```bash map invoke MOTET emit --input '{"example":true}' ``` Emit a telemetry event in any supported voice (log, metric, span, attestation). Capability: `map.motet.emit` ### `trace` ```bash map invoke MOTET trace --input '{"example":true}' ``` Reconstruct the full trace for a trace ID across all voices. Capability: `map.motet.trace` ### `subscribe` ```bash map invoke MOTET subscribe --input '{"example":true}' ``` Subscribe to a filtered stream of telemetry events. Capability: `map.motet.subscribe` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/motet/governance # Refusal posture, dissent preservation, audit footprint for MOTET. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOTET` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MOTET` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.motet.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MOTET` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MOTET` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/motet/internals # Crate path, key types, adjacent protocols for MOTET. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOTET` (Multi-Agentic Operational Telemetry & Event Transport) lives in `engine/observability`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `engine/observability/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `engine/observability/src/protocol.rs` | core protocol logic | | `engine/observability/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `engine/observability/tests/` | unit + integration tests | | `schemas/motet/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MotetProtocol { fn protocol_name(&self) -> &'static str { "MOTET" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "emit", "trace", "subscribe", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "emit" => self.emit(payload, ctx).await, "trace" => self.trace(payload, ctx).await, "subscribe" => self.subscribe(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Stub · interface defined; awaiting implementation. ## Tests ```bash cargo test -p observability --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/motet/metering # How MEAL meters MOTET operations. ================================================================================ Every call on `MOTET` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `emit` | 0 | yes | `<0.001 kWh` | | `trace` | yes | yes | yes | | `subscribe` | 0 | yes | `<0.001 kWh` | ## Rate card `MOTET` is a **protocol** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MOTET` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MOTET`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/motet/operations # Every operation on MOTET. ================================================================================ The full operation table for `MOTET`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `engine/observability` crate. ## Index | Operation | Summary | | --- | --- | | `emit` | Emit a telemetry event in any supported voice (log, metric, span, attestation). | | `trace` | Reconstruct the full trace for a trace ID across all voices. | | `subscribe` | Subscribe to a filtered stream of telemetry events. | ## Reference ### `emit` Emit a telemetry event in any supported voice (log, metric, span, attestation). | Field | Value | | --- | --- | | Capability | `map.motet.emit` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `trace` Reconstruct the full trace for a trace ID across all voices. | Field | Value | | --- | --- | | Capability | `map.motet.trace` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `subscribe` Subscribe to a filtered stream of telemetry events. | Field | Value | | --- | --- | | Capability | `map.motet.subscribe` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/motet/schemas # Request and response JSON schemas for MOTET. ================================================================================ The OCIP contracts for `MOTET` live in `/Volumes/L1feAI/l1feosx/map/schemas/motet/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/motet/v1/ ├── index.json ├── operations.emit.request.json ├── operations.emit.response.json ├── operations.trace.request.json ├── operations.trace.response.json ├── operations.subscribe.request.json ├── operations.subscribe.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `emit` | `schemas/motet/v1/operations.emit.request.json` | `schemas/motet/v1/operations.emit.response.json` | | `trace` | `schemas/motet/v1/operations.trace.request.json` | `schemas/motet/v1/operations.trace.response.json` | | `subscribe` | `schemas/motet/v1/operations.subscribe.request.json` | `schemas/motet/v1/operations.subscribe.response.json` | ## Published ```text https://schemas.multiagentic.dev/motet/v1/operations..request.json https://schemas.multiagentic.dev/motet/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/motet/sdks # Rust, TypeScript and HTTP for MOTET. ================================================================================ Every operation on `MOTET` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MOTET", "v1.0.0", "emit", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MOTET', version: 'v1.0.0', operation: 'emit', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MOTET", "version": "v1.0.0", "operation": "emit", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"emit"` — Emit a telemetry event in any supported voice (log, metric, span, attestation). - `map.dispatch(...)` with operation `"trace"` — Reconstruct the full trace for a trace ID across all voices. - `map.dispatch(...)` with operation `"subscribe"` — Subscribe to a filtered stream of telemetry events. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # MOTIF # URL: https://docs.multiagentic.dev/docs/protocols/motif # Multi-Agentic Observability Traces & Insight Flow · Patterns surface. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **Patterns surface.** > > Observability traces and insight flow. Cross-trace pattern detection. (Implementation merged into MOTET stack.) | Field | Value | | --- | --- | | Acronym | `MOTIF` | | Full name | Multi-Agentic Observability Traces & Insight Flow | | Plane | VII — Awareness | | Kind | Protocol · Stateless | | City role | Signal network | | Crate | `see-MOTET` | | Status | Stub · interface defined; awaiting implementation. | ## What this is Observability traces and insight flow. Cross-trace pattern detection. (Implementation merged into MOTET stack.) ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/motif/cli # `map invoke MOTIF` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `MOTIF` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `detect` ```bash map invoke MOTIF detect --input '{"example":true}' ``` Run pattern-detection over a window of telemetry; named motifs with frequency. Capability: `map.motif.detect` ### `catalog` ```bash map invoke MOTIF catalog --input '{"example":true}' ``` Browse the catalog of known motifs. Capability: `map.motif.catalog` ### `alert` ```bash map invoke MOTIF alert --input '{"example":true}' ``` Subscribe to recurrence of a catalogued motif. Capability: `map.motif.alert` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/motif/governance # Refusal posture, dissent preservation, audit footprint for MOTIF. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOTIF` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `MOTIF` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.motif.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `MOTIF` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `MOTIF` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/motif/internals # Crate path, key types, adjacent protocols for MOTIF. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `MOTIF` (Multi-Agentic Observability Traces & Insight Flow) lives in `see-MOTET`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `see-MOTET/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `see-MOTET/src/protocol.rs` | core protocol logic | | `see-MOTET/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `see-MOTET/tests/` | unit + integration tests | | `schemas/motif/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for MotifProtocol { fn protocol_name(&self) -> &'static str { "MOTIF" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "detect", "catalog", "alert", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "detect" => self.detect(payload, ctx).await, "catalog" => self.catalog(payload, ctx).await, "alert" => self.alert(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Stub · interface defined; awaiting implementation. ## Tests ```bash cargo test -p mim-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/motif/metering # How MEAL meters MOTIF operations. ================================================================================ Every call on `MOTIF` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `detect` | 0 | yes | `<0.001 kWh` | | `catalog` | 0 | yes | `<0.001 kWh` | | `alert` | 0 | yes | `<0.001 kWh` | ## Rate card `MOTIF` is a **protocol** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `MOTIF` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `MOTIF`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/motif/operations # Every operation on MOTIF. ================================================================================ The full operation table for `MOTIF`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `see-MOTET` crate. ## Index | Operation | Summary | | --- | --- | | `detect` | Run pattern-detection over a window of telemetry; named motifs with frequency. | | `catalog` | Browse the catalog of known motifs. | | `alert` | Subscribe to recurrence of a catalogued motif. | ## Reference ### `detect` Run pattern-detection over a window of telemetry; named motifs with frequency. | Field | Value | | --- | --- | | Capability | `map.motif.detect` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `catalog` Browse the catalog of known motifs. | Field | Value | | --- | --- | | Capability | `map.motif.catalog` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `alert` Subscribe to recurrence of a catalogued motif. | Field | Value | | --- | --- | | Capability | `map.motif.alert` | | Idempotent | No — supply `Idempotency-Key` for safe retries | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/motif/schemas # Request and response JSON schemas for MOTIF. ================================================================================ The OCIP contracts for `MOTIF` live in `/Volumes/L1feAI/l1feosx/map/schemas/motif/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/motif/v1/ ├── index.json ├── operations.detect.request.json ├── operations.detect.response.json ├── operations.catalog.request.json ├── operations.catalog.response.json ├── operations.alert.request.json ├── operations.alert.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `detect` | `schemas/motif/v1/operations.detect.request.json` | `schemas/motif/v1/operations.detect.response.json` | | `catalog` | `schemas/motif/v1/operations.catalog.request.json` | `schemas/motif/v1/operations.catalog.response.json` | | `alert` | `schemas/motif/v1/operations.alert.request.json` | `schemas/motif/v1/operations.alert.response.json` | ## Published ```text https://schemas.multiagentic.dev/motif/v1/operations..request.json https://schemas.multiagentic.dev/motif/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/motif/sdks # Rust, TypeScript and HTTP for MOTIF. ================================================================================ Every operation on `MOTIF` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "MOTIF", "v1.0.0", "detect", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'MOTIF', version: 'v1.0.0', operation: 'detect', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "MOTIF", "version": "v1.0.0", "operation": "detect", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"detect"` — Run pattern-detection over a window of telemetry; named motifs with frequency. - `map.dispatch(...)` with operation `"catalog"` — Browse the catalog of known motifs. - `map.dispatch(...)` with operation `"alert"` — Subscribe to recurrence of a catalogued motif. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # OAS # URL: https://docs.multiagentic.dev/docs/protocols/oas # Open Agent Specification · The passport system for autonomous entities. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Card, Cards } from 'fumadocs-ui/components/card'; > **The passport system for autonomous entities.** > > Vendor-neutral W3C-DID identity with lineage to a human root. Eleven entity kinds; offline-verifiable. | Field | Value | | --- | --- | | Acronym | `OAS` | | Full name | Open Agent Specification | | Plane | I — Identity | | Kind | Adapter · External Standard | | City role | Passport office | | Crate | `protocols/oas-lib` | | Status | Implemented · production-grade. | ## What this is Vendor-neutral W3C-DID identity with lineage to a human root. Eleven entity kinds; offline-verifiable. ## Sub-docs ## Adjacent in the mesh | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` | | Subject to | `MAXIM` · `MACE` (for charter-level decisions) | | Settled via | `MEAL` · `MADE` (for cross-org) | ================================================================================ # CLI # URL: https://docs.multiagentic.dev/docs/protocols/oas/cli # `map invoke OAS` recipes for every operation. ================================================================================ The CLI is a Rust binary at `services/map-cli`. After `map login` you can dispatch any operation on `OAS` from the shell. ## Common flags | Flag | Effect | | --- | --- | | `--input ` | Operation payload (or read from stdin) | | `--version v1.0.0` | Pin a specific protocol version | | `--idempotency-key ` | Required for safe retries of state-changing ops | | `--audit-tail` | Print the audit record(s) produced | | `--output human` | Pretty-print response (default: json) | ## Recipes ### `resolve` ```bash map invoke OAS resolve --input '{"example":true}' ``` Resolve a did:oas to its current document. Caller verifies. Capability: `map.oas.resolve` ### `lineage` ```bash map invoke OAS lineage --input '{"example":true}' ``` Walk lineage to the human root with full signature chain for offline verification. Capability: `map.oas.lineage` ### `capabilities` ```bash map invoke OAS capabilities --input '{"example":true}' ``` Enumerate declared capabilities of a DID for MACS to bound. Capability: `map.oas.capabilities` See [CLI reference](/docs/cli) for global flags, login, MCP integration. ================================================================================ # Governance # URL: https://docs.multiagentic.dev/docs/protocols/oas/governance # Refusal posture, dissent preservation, audit footprint for OAS. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `OAS` operates under the standard MAP governance posture — every dispatch checked, every refusal structured, every decision recorded. ## Refusal carries reasons When `OAS` declines, the response is a structured refusal — capability missing, payload tenant mismatch, budget exhausted, policy block. Refusals receive the same audit weight as success. | Refusal | When | HTTP | | --- | --- | --- | | `CapabilityDenied` | Caller lacks `map.oas.` | 403 | | `InvalidPayload` | Schema validation fails | 422 | | `PolicyDenied` | MAXIM-bound policy refuses | 422 | | `RateLimited` | Tenant token bucket exhausted | 429 | | `AdapterError` | Downstream dependency unreachable | 502 | | `Timeout` | Deadline exceeded | 504 | ## Audit footprint Every operation produces audit records in `MAX`: - `ProtocolInvocation` per call (success or refusal) - `AuthorizationCheck` on capability evaluation (sampled in prod) - `SecurityViolation` on missing capability - Protocol-specific events via `ctx.audit().record(...)` Reconstruct the full trace for any call with `MAX::traceability_graph`. ## Treaty awareness Cross-organization calls flow under an active `MOAT` treaty. `OAS` operations are only callable cross-org if the treaty includes the matching capability. See [Concepts → Treaties](/docs/concepts/treaties). ## Dissent preservation When `OAS` produces output that contradicts prior precedent or peer service output, the disagreement is recorded alongside — not erased. `MIMESIS` watches this for emergent custom; `MOOT` may rule. ## See also - [Concepts → Governance](/docs/concepts/governance) - [Operations → Governance](/docs/governance) - [`MAX`](/docs/protocols/max) — the audit chain ================================================================================ # Internals # URL: https://docs.multiagentic.dev/docs/protocols/oas/internals # Crate path, key types, adjacent protocols for OAS. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; `OAS` (Open Agent Specification) lives in `protocols/oas-lib`. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols. ## Source | Path | Contains | | --- | --- | | `protocols/oas-lib/src/lib.rs` | `ProtocolModule` impl, operation dispatch | | `protocols/oas-lib/src/protocol.rs` | core protocol logic | | `protocols/oas-lib/src/types.rs` | request/response types (derive `schemars::JsonSchema`) | | `protocols/oas-lib/tests/` | unit + integration tests | | `schemas/oas/v1/` | published JSON Schemas | ## ProtocolModule contract ```rust impl ProtocolModule for OasProtocol { fn protocol_name(&self) -> &'static str { "OAS" } fn version(&self) -> &'static str { "v1.0.0" } fn operations(&self) -> Vec<&'static str> { vec![ "resolve", "lineage", "capabilities", ] } async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext) -> Result { match op { "resolve" => self.resolve(payload, ctx).await, "lineage" => self.lineage(payload, ctx).await, "capabilities" => self.capabilities(payload, ctx).await, _ => Err(ProtocolError::UnknownOperation(op.into())), } } } ``` ## Adjacent | Relation | Members | | --- | --- | | Consults | — | | Records to | `MAX` · `MOTET` · `MOMENT` | | Subject to | `MAXIM` · `MOAT` (cross-org) · `MOOT` (disputes) | | Settled with | `MEAL` · `MANA` · `MADE` | ## Status Implemented · production-grade. ## Tests ```bash cargo test -p oas-lib --all-features ``` ## See also - [`ProtocolModule` trait](/docs/engine/types) — the contract - [Engine pipeline](/docs/engine/pipeline) — the 8 stages - [Plugins](/docs/plugins) — author your own ================================================================================ # Metering # URL: https://docs.multiagentic.dev/docs/protocols/oas/metering # How MEAL meters OAS operations. ================================================================================ Every call on `OAS` is metered through `MEAL` across three dimensions and may be settled across organizations through `MADE`. ## Per-operation profile | Operation | Tokens | Seconds | Watts | | --- | --- | --- | --- | | `resolve` | 0 | yes | `<0.001 kWh` | | `lineage` | 0 | yes | `<0.001 kWh` | | `capabilities` | 0 | yes | `<0.001 kWh` | ## Rate card `OAS` is a **adapter** kind — metered primarily on seconds with negligible token/watt cost on the protocol path. | Dimension | Base rate | Multiplier on `OAS` | | --- | --- | --- | | Tokens | `$3.00 / M tokens` | 0× (no LLM path) | | Seconds | `$0.018 / second` | 1.0× | | Watts | `$0.42 / kWh` | 0× (no GPU) | ## Runway enforcement `MANA::budget` is consulted at Stage 5. If the tenant's runway is below threshold for any required dimension, `PolicyDenied { reason: "runway exhausted" }` is returned — the call never reaches `OAS`. ## Settlement Cross-organization calls settle via `MADE` on the rail declared in the active `MOAT` treaty. `MEAL::reconcile` cross-checks metered events against settled payments nightly. ## See also - [Concepts → Metering](/docs/concepts/metering) - [Operations → Metering](/docs/metering) - [`MEAL`](/docs/protocols/meal) · [`MANA`](/docs/protocols/mana) · [`MADE`](/docs/protocols/made) ================================================================================ # Operations # URL: https://docs.multiagentic.dev/docs/protocols/oas/operations # Every operation on OAS. ================================================================================ The full operation table for `OAS`. Each entry is dispatched through `MapEngine::handle_request` and matched on `operation` inside the `protocols/oas-lib` crate. ## Index | Operation | Summary | | --- | --- | | `resolve` | Resolve a did:oas to its current document. Caller verifies. | | `lineage` | Walk lineage to the human root with full signature chain for offline verification. | | `capabilities` | Enumerate declared capabilities of a DID for MACS to bound. | ## Reference ### `resolve` Resolve a did:oas to its current document. Caller verifies. | Field | Value | | --- | --- | | Capability | `map.oas.resolve` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `lineage` Walk lineage to the human root with full signature chain for offline verification. | Field | Value | | --- | --- | | Capability | `map.oas.lineage` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ### `capabilities` Enumerate declared capabilities of a DID for MACS to bound. | Field | Value | | --- | --- | | Capability | `map.oas.capabilities` | | Idempotent | Yes | ```json { "example": true } ``` Dispatched through the standard pipeline; see [Engine pipeline](/docs/engine/pipeline) for the 8 stages. ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/protocols/oas/schemas # Request and response JSON schemas for OAS. ================================================================================ The OCIP contracts for `OAS` live in `/Volumes/L1feAI/l1feosx/map/schemas/oas/v1/`. Each operation has a request schema and a response schema, generated from the Rust types via `schemars`. ## Index ```text schemas/oas/v1/ ├── index.json ├── operations.resolve.request.json ├── operations.resolve.response.json ├── operations.lineage.request.json ├── operations.lineage.response.json ├── operations.capabilities.request.json ├── operations.capabilities.response.json ``` ## Map | Operation | Request schema | Response schema | | --- | --- | --- | | `resolve` | `schemas/oas/v1/operations.resolve.request.json` | `schemas/oas/v1/operations.resolve.response.json` | | `lineage` | `schemas/oas/v1/operations.lineage.request.json` | `schemas/oas/v1/operations.lineage.response.json` | | `capabilities` | `schemas/oas/v1/operations.capabilities.request.json` | `schemas/oas/v1/operations.capabilities.response.json` | ## Published ```text https://schemas.multiagentic.dev/oas/v1/operations..request.json https://schemas.multiagentic.dev/oas/v1/operations..response.json ``` See [Schemas](/docs/schemas) for generation, versioning, validation. ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/protocols/oas/sdks # Rust, TypeScript and HTTP for OAS. ================================================================================ Every operation on `OAS` is reachable from every shipped SDK plus the raw HTTP wire. ## Rust ```rust use map_sdk::Client; use serde_json::json; let client = Client::from_env()?; let resp = client .dispatch( "OAS", "v1.0.0", "resolve", json!({ "example": true }), ) .await?; println!("{:#?}", resp); ``` ## TypeScript ```ts import { MapClient } from '@l1fe/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const resp = await map.dispatch({ protocol: 'OAS', version: 'v1.0.0', operation: 'resolve', input: { "example": true } }); ``` ## HTTP wire ```text POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev Authorization: Bearer $MAP_API_KEY X-Agent-Did: $MAP_AGENT_DID X-Tenant-Id: org_acme Content-Type: application/json { "protocol": "OAS", "version": "v1.0.0", "operation": "resolve", "input": { "example": true }, "tenant_id": "org_acme" } ``` ## All operations - `map.dispatch(...)` with operation `"resolve"` — Resolve a did:oas to its current document. Caller verifies. - `map.dispatch(...)` with operation `"lineage"` — Walk lineage to the human root with full signature chain for offline verification. - `map.dispatch(...)` with operation `"capabilities"` — Enumerate declared capabilities of a DID for MACS to bound. See [SDKs](/docs/sdks) for client construction, retry, trace propagation. ================================================================================ # Quickstart # URL: https://docs.multiagentic.dev/docs/quickstart # From a fresh shell to your first dispatched MAP call in under five minutes. ================================================================================ import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; import { Step, Steps } from 'fumadocs-ui/components/steps'; import { Callout } from 'fumadocs-ui/components/callout'; This guide gets you to a verified dispatched call against MAP — `MACS.auth_negotiation` — using the CLI, then walks the same call through the Rust and TypeScript SDKs. ## Prerequisites - A MAP API key. Request one at [pricing](https://multiagentic.dev/pricing). - An [OAS DID](/docs/concepts/identity) for your caller agent (the API key onboarding flow provisions one if you don't have it). - For the CLI: `cargo` or a pre-built binary. - For the Rust SDK: a workspace with `tokio` available. - For the TypeScript SDK: Node 20+ or Bun 1.1+. ## Install the CLI ```bash cargo install --git https://github.com/l1fe-ai/map map-cli ``` ```bash curl -fsSL https://get.multiagentic.dev | sh # Adds `map` to ~/.local/bin ``` ```bash # The CLI is Rust-native; npm/bun cannot install it directly. # Use cargo or the curl installer above. ``` The CLI binary is `map`. The Rust crate that builds it is `services/map-cli`. ## Authenticate ### Run `map login` ```bash map login --auth-url https://auth.l1fe.ai ``` The CLI spawns a local callback server on `127.0.0.1:8600`, opens your browser to the OAuth2 PKCE authorization endpoint, and exchanges the authorization code for `access_token` + `refresh_token`. ### Provision an API key The CLI calls the provisioner endpoint to mint an API key bound to your DID. The result is stored in `~/.map/config.json`: ```json { "auth_url": "https://auth.l1fe.ai", "api_url": "https://api.multiagentic.dev", "agent_did": "did:oas:l1fe:agent:0xa3f9c1a4...", "access_token": "...", "refresh_token": "...", "api_key": "map_live_..." } ``` ### Verify ```bash map whoami ``` Should print your `agent_did` and the active tenant. ## Your first dispatched call ```bash map invoke MACS auth_negotiation --input '{ "profile": "DidAuth", "challenge_kind": "Nonce" }' ``` You should receive a `Response { data, metadata }` envelope back. The shape is defined in `engine/common/src/lib.rs`: ```rust pub struct Response { pub data: Value, pub metadata: Option>, } ``` If the call succeeded, you've passed all eight stages of the [dispatch pipeline](/docs/engine/pipeline): version resolution, context enrichment, rate limiting, security gating, circuit breaking, load balancing, router invocation, and result handling. ## Same call through the SDKs ```toml # Cargo.toml [dependencies] macs-sdk = { git = "https://github.com/l1fe-ai/map", package = "macs-sdk" } tokio = { version = "1", features = ["macros", "rt-multi-thread"] } ``` ```rust use macs_sdk::MacsClient; #[tokio::main] async fn main() -> Result<(), Box> { let client = MacsClient::from_env()?; // reads ~/.map/config.json or MAP_API_KEY let resp = client.auth_negotiation( macs_sdk::AuthNegotiationPayload { profile: macs_sdk::AuthProfile::DidAuth, challenge_kind: macs_sdk::ChallengeKind::Nonce, } ).await?; println!("{resp:#?}"); Ok(()) } ``` ```bash bun add @l1fe/mind-wm # MACS client is bundled in the same SDK family ``` ```ts import { MapClient } from '@l1fe/mind-wm/map'; const map = new MapClient({ apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID! }); const response = await map.dispatch({ protocol: 'MACS', version: 'v1.0.0', operation: 'auth_negotiation', input: { profile: 'DidAuth', challenge_kind: 'Nonce' } }); console.log(response); ``` ## Next import { Card, Cards } from 'fumadocs-ui/components/card'; ================================================================================ # Recipes # URL: https://docs.multiagentic.dev/docs/recipes # Four reference recipes for common institutional patterns — grounded response, policy decision, service transaction, agent deployment. ================================================================================ import { Steps, Step } from 'fumadocs-ui/components/steps'; import { Callout } from 'fumadocs-ui/components/callout'; A **recipe** in MAP is a typed DAG of protocol operations with explicit data flow, audit checkpoints, and governance gates. See [the recipe engine](/docs/engine/recipe) for the type-level details. The repo ships four reference recipes in `DEFAULT_RECIPES.md`. Each one is a complete institutional pattern. ## 1 — Grounded Response > Retrieve from MIND → reason with MARC → verify via MAVEN → audit to MAX. This is the canonical "answer a question with citations" pattern. ### Retrieve ```ts const memories = await map.dispatch({ protocol: 'MIND', operation: 'recall_memory', input: { kind: 'knowledge_graph', subject: 'treaty_acme_globex', limit: 20 } }); ``` ### Reason ```ts const verdict = await map.dispatch({ protocol: 'MARC', operation: 'reasoning_task', input: { intent: 'Is the proposed treaty enforceable?', premises: memories.results.map(m => m.uri), world_model_snapshot: memories.snapshot_uri, budget: { tokens: 16000, deadline_ms: 12000 }, return_fields: ['derivation', 'citations', 'confidence'] } }); ``` ### Verify ```ts for (const cite of verdict.citations) { const attestation = await map.dispatch({ protocol: 'MAVEN', operation: 'cite', input: { source_ref: cite } }); if (!attestation.valid) { throw new Error(`citation invalid: ${cite}`); } } ``` ### Audit The engine has already recorded the calls — but you may add a structured audit at the recipe layer: ```ts await map.dispatch({ protocol: 'MAX', operation: 'audit_log_entry', input: { event_type: 'GroundedResponse', meta: { question: 'Is the proposed treaty enforceable?', verdict: verdict.verdict, citations: verdict.citations, confidence: verdict.confidence } } }); ``` ## 2 — Policy Decision > Collect evidence via MAVEN → deliberate via MACE → consult MAXIM → enforce. For decisions that bind the institution — treaty signing, policy amendment, charter-level changes. ### Collect evidence ```ts const evidence = await map.dispatch({ protocol: 'MAVEN', operation: 'attest', input: { sources: ['mars://record/0x...', 'mars://record/0x...'] } }); ``` ### Convene a council ```ts const motion = await map.dispatch({ protocol: 'MACE', operation: 'convene', input: { motion: 'Approve treaty draft v2 with Globex', composition_rules:{ min_delegates: 5 }, quorum: 'supermajority', deadline_ms: 3600 * 1000 } }); ``` ### Each delegate deliberates ```ts // per-delegate await map.dispatch({ protocol: 'MACE', operation: 'deliberate', input: { motion_id: motion.motion_id, position: 'yea', reasoning: '...', evidence: evidence.attestations } }); ``` ### Consult constitutional policy ```ts const interpretation = await map.dispatch({ protocol: 'MAXIM', operation: 'constitutional_interpretation', input: { motion: motion.motion_id, bind_to: 'charter://v1.0.0' } }); ``` ### Tally + enforce ```ts const verdict = await map.dispatch({ protocol: 'MACE', operation: 'tally', input: { motion_id: motion.motion_id } }); if (verdict.passed) { await map.dispatch({ protocol: 'MAXIM', operation: 'mandate_enforcement', input: { mandate: verdict.binding_text, authority: verdict.signatures, effect: 'immediate' } }); } ``` ## 3 — Service Transaction > Advertise on MARKET → negotiate via MANA → settle via MADE. The agent-to-agent commerce pattern. ### Seller advertises ```ts await map.dispatch({ protocol: 'MARKET', operation: 'create_order', input: { side: 'ask', asset: 'reasoning-service:marc', price_usd: 0.50, capacity: 1000, expires_in_s: 3600 } }); ``` ### Buyer bids ```ts const bid = await map.dispatch({ protocol: 'MANA', operation: 'bid_submission', input: { asset: 'reasoning-service:marc', bid_usd: 0.45, quantity: 10, valid_for_seconds: 60 } }); ``` ### Negotiate Multi-round if needed: ```ts await map.dispatch({ protocol: 'MANA', operation: 'negotiation', input: { bid_id: bid.id, counter: { price_usd: 0.48 }, round: 2 } }); ``` ### Match + assign ```ts const match = await map.dispatch({ protocol: 'MARKET', operation: 'execute_trade', input: { bid_id: bid.id, order_id: '...' } }); await map.dispatch({ protocol: 'MANA', operation: 'task_assignment', input: { match_id: match.id } }); ``` ### Settle ```ts await map.dispatch({ protocol: 'MADE', operation: 'economic_contract_settle', input: { contract_id: match.contract_id, rail: 'x402', amount_usd: 4.80 } }); ``` ## 4 — Agent Deployment > Bootstrap identity via MACS → register on MARS → submit manifest to MOON. The "spin up a new agent worker" pattern. ### Bootstrap identity ```ts const identity = await map.dispatch({ protocol: 'MACS', operation: 'auth_negotiation', input: { profile: 'DidAuth', challenge_kind: 'Nonce' } }); const challenge = await map.dispatch({ protocol: 'MACS', operation: 'generate_challenge', input: { session_id: identity.session_id } }); // (sign challenge with new agent's key — done client-side) const verified = await map.dispatch({ protocol: 'MACS', operation: 'verify_response', input: { session_id: identity.session_id, signed_response: '...' } }); ``` ### Register ```ts await map.dispatch({ protocol: 'MARS', operation: 'register_agent', input: { did: verified.agent_did, capabilities: ['map.mind.recall_memory', 'map.marc.reasoning_task'], service_endpoints: [ { kind: 'did-auth', url: 'https://my-agent.svc/dispatch' } ] } }); ``` ### Submit manifest ```ts await map.dispatch({ protocol: 'MOON', operation: 'submit_manifest', input: { agent_did: verified.agent_did, image: 'oci://registry.example.com/my-agent:v0.1.0', replicas: 3, resources: { cpu: 2, memory_mb: 4096 }, governance: { policy_ref: 'maxim://charter/v1' } } }); ``` ### Deploy ```ts const deployment = await map.dispatch({ protocol: 'MOON', operation: 'execute_workflow', input: { manifest_id: '...', placement: 'closest-to-tenant', health_check_grace_seconds: 30 } }); ``` The recipe engine ([engine/recipe/](/docs/engine/recipe)) can run these patterns as typed DAGs with trust propagation and durability. Until the engine wiring is complete, run the steps directly as shown. ## Custom recipes A custom recipe is a JSON document describing the DAG: ```json { "id": "recipe-grounded-response-v1", "steps": [ { "id": "retrieve", "kind": "Protocol", "protocol": "MIND", "operation": "recall_memory", "payload": { "subject": "$input.subject" }, "depends_on": [] }, { "id": "reason", "kind": "Protocol", "protocol": "MARC", "operation": "reasoning_task", "payload": { "intent": "$input.question", "premises": "$steps.retrieve.output.uris" }, "depends_on": ["retrieve"] }, { "id": "verify_each_citation", "kind": "Parallel", "steps": [/* generated from $steps.reason.output.citations */], "depends_on": ["reason"] }, { "id": "audit", "kind": "Audit", "event_type": "GroundedResponse", "metadata": { "verdict": "$steps.reason.output.verdict" } } ], "audit_checkpoints": [ { "step_id": "reason", "event_type": "ReasoningProduced", "include_step_io": true } ], "governance_gates": [] } ``` Submit: ```ts await map.dispatch({ protocol: 'MAESTRO', operation: 'graph.commit', input: { recipe: /* the JSON above */ } }); ``` `MAESTRO` will validate (Kahn's algorithm, type check, capability check) and only commit the recipe if it can be executed under the caller's capabilities. ## See also - [Engine — Recipe](/docs/engine/recipe) - [`MAESTRO`](/docs/protocols/maestro) - [`MOON`](/docs/protocols/moon) - [Concepts → Dispatch](/docs/concepts/dispatch) ================================================================================ # Schemas # URL: https://docs.multiagentic.dev/docs/schemas # Every protocol operation has a JSON Schema for request and response. Versioned, generated from Rust types via schemars. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; Every protocol operation has a published JSON Schema for its request and response. These are the **OCIP** contracts — Open Cross-Inter-Protocol — and they live in `/Volumes/L1feAI/l1feosx/map/schemas/`. ## Layout ``` schemas/ ├── macs/v1/ │ ├── index.json # protocol metadata + operation list │ ├── operations.auth_negotiation.request.json │ ├── operations.auth_negotiation.response.json │ ├── operations.generate_challenge.request.json │ ├── operations.generate_challenge.response.json │ └── ... ├── mind/v1/ │ ├── index.json │ ├── operations.store_memory.request.json │ ├── operations.store_memory.response.json │ └── ... ├── marc/v1/ │ ├── index.json │ └── ... └── ... (30+ total) ``` Each protocol has a directory; each version is a subdirectory. ## `index.json` ```json { "protocol": "MARC", "version": "v1.0.0", "kind": "agent", "plane": "II", "operations": [ "reasoning_task", "publish_model", "share_model", "causal_analysis" ], "stability": "stable", "last_changed": "2026-05-20" } ``` ## Operation schemas Each operation has two files — request and response. Both are standard JSON Schema with extensions: ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://schemas.multiagentic.dev/marc/v1/reasoning_task.request.json", "title": "MARC::reasoning_task request", "type": "object", "required": ["intent", "budget"], "properties": { "intent": { "type": "string", "description": "Natural-language statement of the reasoning intent." }, "premises": { "type": "array", "items": { "type": "string", "format": "uri" }, "description": "MARS-addressable premises." }, "world_model_snapshot": { "type": "string", "format": "uri", "pattern": "^mind://snapshot/" }, "budget": { "type": "object", "required": ["tokens", "deadline_ms"], "properties": { "tokens": { "type": "integer", "minimum": 1, "maximum": 1000000 }, "deadline_ms": { "type": "integer", "minimum": 100, "maximum": 600000 } } } }, "$comment": "Generated from schemars::JsonSchema on MarcReasoningRequest" } ``` ## Generation Schemas are not hand-written. They are generated from the Rust request/response types using [`schemars`](https://docs.rs/schemars): ```rust use schemars::JsonSchema; #[derive(Debug, Serialize, Deserialize, JsonSchema)] pub struct ReasoningTaskRequest { pub intent: String, pub premises: Vec, #[serde(default)] pub world_model_snapshot: Option, pub budget: Budget, } ``` A workspace script (`scripts/regenerate-schemas.sh`) walks every `protocols/*-lib` crate and emits the JSON Schemas. The CI pipeline asserts the committed schemas match the generated ones — drift is a build failure. ## Versioning Versions are **directory-level**: ``` schemas/ ├── mind/ │ ├── v1/ │ └── v2/ ``` A new version is a copy of the previous one with the type changes applied. The engine routes by the requested `version` field. Multiple versions can be served concurrently during a migration. ### Compatibility levels | Change | Action | | --- | --- | | Adding an optional field | Same major version (`v1.0.x`) | | Removing an unused field | Same major version (`v1.0.x`) | | Renaming a field with a serde alias | Same major version | | Changing a field type | Major version bump (`v2.0.0`) | | Removing a required field | Major version bump | | Renaming an operation | Major version bump | The engine refuses to register two protocols at the same `name:version` — versioning is mandatory for breaking changes. ## Consuming schemas ### In Rust ```rust use schemars::schema::RootSchema; let raw = std::fs::read_to_string("schemas/marc/v1/operations.reasoning_task.request.json")?; let schema: RootSchema = serde_json::from_str(&raw)?; ``` ### In TypeScript (Zod) ```ts import { z } from 'zod'; // Auto-generated from the JSON Schema export const ReasoningTaskRequestSchema = z.object({ intent: z.string(), premises: z.array(z.string()).optional(), world_model_snapshot: z.string().regex(/^mind:\/\/snapshot\//).optional(), budget: z.object({ tokens: z.number().int().min(1).max(1_000_000), deadline_ms: z.number().int().min(100).max(600_000) }) }); export type ReasoningTaskRequest = z.infer; ``` The TypeScript SDK ships these Zod schemas under `@l1fe/mind-wm/schemas/`. ### Externally (any language) Schemas are published at `https://schemas.multiagentic.dev///...`. Any JSON Schema validator works. The CLI also ships a local cache: ```bash map mcp list --json | jq '.tools[] | select(.name=="map.marc.reasoning_task") | .inputSchema' ``` ## Schema-bound validation The engine validates inbound payloads against the JSON Schema before reaching the protocol module's `invoke`. Validation failures return `ProtocolError::InvalidPayload(reason)` with the schema path that failed. ``` 422 Unprocessable Entity { "error": { "code": "invalid_payload", "message": "/budget/tokens: expected integer, got string", "context": { "schema": "marc/v1/operations.reasoning_task.request.json" } } } ``` This means **the protocol module never sees malformed input**. The schema is the canonical contract; the implementation is downstream. ## Extension fields Schemas allow free-form extension under a top-level `extended` property: ```json { "extended": { "vendor_specific_field": { ... } } } ``` Protocols use this for forward-compatibility — new optional fields can be added under `extended` without bumping the major version. For tooling and codegen, the canonical source is the published schema URLs. The Rust types are an implementation detail. Other implementations (in any language) are expected to consume the published JSON Schemas directly. ## See also - [Engine handle_request](/docs/engine/handle-request) - [Wire protocol](/docs/sdks/wire-protocol) - [MCP](/docs/mcp) — schemas are reused for MCP `inputSchema` ================================================================================ # SDKs # URL: https://docs.multiagentic.dev/docs/sdks # Rust (reference) and TypeScript clients for MAP. Authentication, dispatch, retry, error handling. ================================================================================ import { Card, Cards } from 'fumadocs-ui/components/card'; import { Callout } from 'fumadocs-ui/components/callout'; MAP has SDKs in two languages today. The Rust SDKs are the reference implementation; the TypeScript SDK is built against the same wire protocol. ## What lives in each SDK The crates and packages under `/Volumes/L1feAI/l1feosx/map/sdks/`: | Language | Path | Crates / packages | | --- | --- | --- | | Rust | `sdks/rust/macs-sdk` | `MacsClient` (auth profiles, challenge generation) | | Rust | `sdks/rust/marc-sdk` | `MarcClient` (reasoning tasks, model publishing) | | Rust | `sdks/rust/mata-sdk` | `MataClient` (trust queries, reputation updates) | | Rust | `sdks/rust/plugin-sdk` | Plugin development kit (WASM helpers, manifest builder) | | TypeScript | `sdks/typescript/mind-wm` | `MindWmClient`, types for working-memory bridge | | TypeScript | bundled | `MapClient` — general dispatch surface, in same package family | ## The wire protocol is stable All SDKs target the same wire protocol — see [wire protocol](/docs/sdks/wire-protocol). If your language is not listed, you can implement a client in ~200 lines: 1. Authenticate (Bearer token or session cookie) 2. POST `/v1/dispatch` with `{ protocol, version, operation, input, tenant_id }` 3. Propagate `traceparent` for cross-trace correlation 4. Handle the standard error envelope Python, Go, Swift, and Kotlin SDKs are not currently shipped. Build against the wire protocol for now. We accept contributions — see `sdks/CONTRIBUTING.md` in the repo. ## Common patterns ### Authentication Every SDK reads from one of three sources in order: 1. Explicit constructor args (`apiKey`, `agentDid`, `apiUrl`) 2. Environment variables (`MAP_API_KEY`, `MAP_AGENT_DID`, `MAP_API_URL`) 3. The CLI config at `~/.map/config.json` If none of the three is set, the SDK fails fast at construction. ### Retry Built-in retry only on idempotent operations and only for these errors: - `RateLimited` — respects `Retry-After` - `CircuitOpen` — exponential backoff up to 30s - Network errors — 3 retries with jitter State-changing operations (anything that writes) do not retry automatically. Build idempotency keys into your application logic. ### Errors Every SDK maps the wire error envelope to its language's idiom: ```rust // Rust match client.dispatch(...).await { Err(MapError::CapabilityDenied { protocol, operation }) => { ... }, Err(MapError::RateLimited { retry_after }) => { ... }, Ok(response) => { ... }, } ``` ```ts // TypeScript try { const r = await map.dispatch(...); } catch (err) { if (err instanceof CapabilityDeniedError) { // ... } } ``` ### Trace propagation Every SDK accepts an optional `traceparent` header for distributed tracing. If you're calling MAP from inside an OTEL-instrumented service, the SDK reads the active span automatically. ## Building a new client If you need to support a language that does not have an SDK yet, follow [wire protocol](/docs/sdks/wire-protocol). The wire is intentionally small (one `POST /v1/dispatch` endpoint plus the auth header). A working client in a new language is typically a few hundred lines. If you're going to publish it as an official SDK, file a proposal to `map@l1fe.ai` — we'll review and link from this page. ================================================================================ # Rust # URL: https://docs.multiagentic.dev/docs/sdks/rust # The reference SDK. macs-sdk, marc-sdk, mata-sdk, plugin-sdk. Async/await, tokio-native. ================================================================================ import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; import { Callout } from 'fumadocs-ui/components/callout'; The Rust SDKs are the reference clients for MAP. They live in `/Volumes/L1feAI/l1feosx/map/sdks/rust/` and use the same `engine/common` types the engine itself uses — no translation layer. ## Installation The SDKs are published as part of the MAP workspace. Until they're on crates.io, depend by git ref: ```toml [dependencies] macs-sdk = { git = "https://github.com/l1fe-ai/map", package = "macs-sdk" } marc-sdk = { git = "https://github.com/l1fe-ai/map", package = "marc-sdk" } mata-sdk = { git = "https://github.com/l1fe-ai/map", package = "mata-sdk" } plugin-sdk = { git = "https://github.com/l1fe-ai/map", package = "plugin-sdk" } tokio = { version = "1", features = ["macros", "rt-multi-thread"] } serde_json = "1" ``` ## `MacsClient` For authentication, capability derivation, and identity verification. ```rust use macs_sdk::{MacsClient, AuthNegotiationPayload, AuthProfile, ChallengeKind}; #[tokio::main] async fn main() -> Result<(), Box> { let client = MacsClient::from_env()?; let negotiation = client.auth_negotiation(AuthNegotiationPayload { profile: AuthProfile::DidAuth, challenge_kind: ChallengeKind::Nonce, }).await?; let challenge = client.generate_challenge(&negotiation.session_id).await?; let signed = sign_challenge_with_my_key(&challenge.nonce)?; let verified = client.verify_response(&challenge.session_id, &signed).await?; println!("verified envelope: {:#?}", verified); Ok(()) } ``` ## `MarcClient` For reasoning tasks and model publishing. ```rust use marc_sdk::{MarcClient, ReasoningTaskPayload, Budget}; use serde_json::json; let client = MarcClient::from_env()?; let resp = client.reasoning_task(ReasoningTaskPayload { intent: "Is the proposed treaty enforceable under the active charter?".into(), premises: vec![ "mars://treaty/0x91a".into(), "mars://policy/0x12c".into(), ], world_model_snapshot: Some("mind://snapshot/0x4f81b3a".into()), budget: Budget { tokens: 32_000, deadline_ms: 12_000 }, return_fields: vec!["derivation".into(), "citations".into(), "confidence".into()], }).await?; println!("verdict: {}", resp.verdict); println!("derivation: {:?}", resp.derivation_ref); println!("citations: {:?}", resp.citations); println!("confidence band: {:?}", resp.confidence); ``` ## `MataClient` For trust scores and reputation updates. ```rust use mata_sdk::{MataClient, PoolPayload}; let client = MataClient::from_env()?; let pooled = client.pool(PoolPayload { target_claim: "did:oas:l1fe:agent:0xa3f...".into(), sources: vec!["maven://0x12...".into(), "maven://0xb4...".into()], }).await?; println!("composite credence: {}", pooled.credence); ``` ## `plugin-sdk` For developers building Tier-2 WASI plugins. Provides: - `PluginManifest` builder with type-checked operations - `wit-bindgen`-derived bindings to the engine ABI - A `protocol_module!` macro that generates the boilerplate `ProtocolModule` impl from a plain function table ```rust use plugin_sdk::{protocol_module, InvokeContext, Response, ProtocolError}; use serde_json::Value; protocol_module! { name = "MYPROTOCOL"; version = "v0.1.0"; operations { async fn hello(payload: Value, ctx: &InvokeContext) -> Result { let id = ctx.identity().ok_or_else(|| ProtocolError::PolicyDenied { reason: "unresolved".into() })?; Ok(Response { data: serde_json::json!({ "greeting": format!("hello, {}", id.did) }), metadata: None }) } } } ``` Build for WASI: ```bash cargo build --release --target wasm32-wasip2 # Bundle with plugin.toml manifest ``` ## Authentication Every SDK constructor uses `from_env()` which reads in order: 1. Explicit constructor args 2. Env vars: `MAP_API_KEY`, `MAP_AGENT_DID`, `MAP_API_URL` 3. CLI config at `~/.map/config.json` To pass explicitly: ```rust let client = MacsClient::new(macs_sdk::Config { api_url: "https://api.multiagentic.dev".parse()?, api_key: std::env::var("MAP_API_KEY")?, agent_did: "did:oas:l1fe:agent:0xa3f...".into(), tenant_id: "org_acme".into(), }); ``` ## Error model Every SDK shares the `MapError` enum: ```rust #[derive(thiserror::Error, Debug)] pub enum MapError { #[error("rate limited; retry after {0:?}")] RateLimited(std::time::Duration), #[error("capability denied: {protocol}.{operation}")] CapabilityDenied { protocol: String, operation: String }, #[error("circuit open for {0}")] CircuitOpen(String), #[error("timeout")] Timeout, #[error("policy denied: {0}")] PolicyDenied(String), #[error("transport: {0}")] Transport(#[from] reqwest::Error), #[error("decode: {0}")] Decode(#[from] serde_json::Error), #[error("other: {0}")] Other(String), } ``` Match on the variant for retry policy: ```rust match client.dispatch(...).await { Err(MapError::RateLimited(retry)) => { tokio::time::sleep(retry).await; // retry once } Err(MapError::CapabilityDenied { protocol, operation }) => { anyhow::bail!("need capability map.{}.{}", protocol.to_lowercase(), operation); } Ok(resp) => { /* ... */ } Err(e) => { return Err(e.into()); } } ``` ## Trace context If your service is OTEL-instrumented, the SDK reads the active span automatically: ```rust use opentelemetry::trace::TraceContextExt; let span = opentelemetry::Context::current().span(); let resp = client.dispatch(...).with_span(&span).await?; ``` Otherwise, you can supply a trace context explicitly: ```rust use map_common::TraceContext; let resp = client.dispatch(...).with_trace(TraceContext::new("00-4f81b3a...-...-01")).await?; ``` ## Code-property guarantees The SDKs share the engine's strict properties: - `#![forbid(unsafe_code)]` - `#![deny(clippy::unwrap_used)]` - Feature flags: `native-adapter` (default), `wasm-adapter` (WASIP2 target) **Working with the workspace.** If you're contributing to the SDKs, run `cargo test -p macs-sdk` from the workspace root. Tests use `MockTransport` for offline development. ## See also - [Wire protocol](/docs/sdks/wire-protocol) — what the SDK sends and receives - [Engine types](/docs/engine/types) — the shared types - [CLI](/docs/cli) — what the SDK was used to build ================================================================================ # TypeScript # URL: https://docs.multiagentic.dev/docs/sdks/typescript # @l1fe/mind-wm and the MapClient family. Node 20+ / Bun 1.1+. Zod-validated payloads. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; The TypeScript SDK lives in `/Volumes/L1feAI/l1feosx/map/sdks/typescript/`. The primary package is `@l1fe/mind-wm`; it bundles the general `MapClient` for dispatch and specialized clients for MIND (working memory, beliefs) and the common protocols. ## Install ```bash bun add @l1fe/mind-wm # or npm install @l1fe/mind-wm ``` Peer requirements: - Node 20+ or Bun 1.1+ - A `fetch` implementation (built-in on both runtimes) ## `MapClient` ```ts import { MapClient } from '@l1fe/mind-wm/map'; const map = new MapClient({ apiUrl: process.env.MAP_API_URL ?? 'https://api.multiagentic.dev', apiKey: process.env.MAP_API_KEY!, agentDid: process.env.MAP_AGENT_DID!, tenantId: 'org_acme' }); const response = await map.dispatch({ protocol: 'MARC', version: 'v1.0.0', operation: 'reasoning_task', input: { intent: 'is the treaty enforceable?', budget: { tokens: 8000, deadline_ms: 12000 } } }); console.log(response.data, response.metadata); ``` ## `MindWmClient` Working-memory bridge — feature-gated on the engine side (`wm-bridge` feature) and exposed only when bound to a real MIND backend. ```ts import { MindWmClient } from '@l1fe/mind-wm'; const wm = new MindWmClient({ apiUrl: process.env.MAP_API_URL!, capabilityProof: { agent_did: process.env.MAP_AGENT_DID!, capabilities: ['map.mind.wm.bridge'] } }); // Add a working-memory event await wm.add({ slot: 'visual.focus', payload: { kind: 'object', ref: 'mars://asset/0x...' }, ts_ms: Date.now() }); // Set focus await wm.set_focus({ slot: 'visual.focus' }); // Query const result = await wm.query({ slot: 'visual.*', since_ms: Date.now() - 60_000, limit: 100 }); // Snapshot const snap = await wm.snapshot(); ``` ### Types ```ts export type CapabilityProof = { agent_did: string; capabilities: string[]; }; export type SlotPath = string; // dotted, supports wildcards export type WorkingMemoryEvent = { slot: SlotPath; payload: unknown; ts_ms: number; }; export type QueryRequest = { slot: SlotPath; since_ms?: number; until_ms?: number; limit?: number; }; export type QueryResult = { events: WorkingMemoryEvent[]; truncated: boolean; }; export type Snapshot = { taken_at: number; slots: Record; }; ``` ### Errors ```ts import { MindWmError } from '@l1fe/mind-wm'; try { await wm.add(...); } catch (err) { if (err instanceof MindWmError) { console.error(err.code, err.message, err.status); // err.code is one of: 'capability_denied' | 'invalid_payload' | 'rate_limited' | 'timeout' | 'internal' } } ``` ## Validation All payloads are validated with [Zod](https://zod.dev) at the SDK boundary. Type inference is shipped — your IDE shows the exact shape of every input and output: ```ts import { ReasoningTaskInput, ReasoningTaskOutput } from '@l1fe/mind-wm/marc'; // Compile-time check; runtime validation runs automatically: const input: ReasoningTaskInput = { intent: 'is the treaty enforceable?', budget: { tokens: 8000, deadline_ms: 12000 } }; const output: ReasoningTaskOutput = await marc.reasoning_task(input); ``` If a payload doesn't match the schema, `ZodError` is thrown before the request is sent. ## Retry & backoff ```ts const map = new MapClient({ ..., retry: { maxRetries: 3, onRateLimit: 'respect-header', // honor Retry-After onCircuitOpen: { strategy: 'exponential', baseMs: 100, maxMs: 30_000 } } }); ``` Only idempotent operations retry. State-changing operations (writes) never auto-retry — build idempotency keys into your application. ## Trace propagation ```ts import { trace } from '@opentelemetry/api'; const span = trace.getActiveSpan(); const response = await map.dispatch(...).withSpan(span); ``` Or supply explicitly: ```ts const response = await map.dispatch(...).withTraceparent('00-4f81b3a...-...-01'); ``` ## Bun-specific Bun's native `fetch` is used by default. To use a custom fetch (e.g. for proxy), pass it in: ```ts const map = new MapClient({ ..., fetch: customFetch }); ``` Bun's `fetch` supports HTTP/2 out of the box, so latency on dispatch is typically lower than Node 20 (which uses undici). ## Cloudflare Workers The SDK works in Cloudflare Workers — pass an explicit `fetch`: ```ts import { MapClient } from '@l1fe/mind-wm/map'; export default { async fetch(request: Request, env: Env): Promise { const map = new MapClient({ apiUrl: env.MAP_API_URL, apiKey: env.MAP_API_KEY, agentDid: env.MAP_AGENT_DID, tenantId: 'org_acme', fetch: globalThis.fetch }); const r = await map.dispatch(...); return Response.json(r.data); } }; ``` SSL/TLS is handled by the runtime. No certificate handling required. ## See also - [Rust SDK](/docs/sdks/rust) - [Wire protocol](/docs/sdks/wire-protocol) - [Quickstart](/docs/quickstart) ================================================================================ # Wire # URL: https://docs.multiagentic.dev/docs/sdks/wire-protocol # The HTTP envelope, auth headers, trace context, error mapping. Everything a non-shipped language needs to build a MAP client. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; The MAP wire protocol is intentionally small. One endpoint, one request shape, one response shape, four authentication mechanisms. You can build a working client in any language in a few hundred lines. ## Endpoint ``` POST /v1/dispatch HTTP/2 Host: api.multiagentic.dev ``` A single endpoint dispatches every protocol operation. No per-protocol REST surface — MAP is **dispatch-based**, not resource-based. ## Authentication The `Authorization` header carries the bearer token issued by the CLI or your API key: ``` Authorization: Bearer map_live_abcdef1234567890... ``` Plus a header that identifies the caller agent: ``` X-Agent-Did: did:oas:l1fe:agent:0xa3f9c1a4b5... ``` Plus a header that identifies the tenant (organization scope): ``` X-Tenant-Id: org_acme ``` If `X-Tenant-Id` is absent, the tenant is inferred from the API key. ### Optional auth modes | Mode | Header | When | | --- | --- | --- | | API key | `Authorization: Bearer map_live_...` | Default; for service-to-service | | Session cookie | `Cookie: map_session=...` | For browser-originated calls (admin console) | | DID-Auth | `Authorization: DidAuth signature=...` | When the caller has no API key but holds the DID private key | | Treaty token | `Authorization: Treaty $treaty_id $signature` | Cross-organization calls | DID-Auth requires the caller to first run `MACS::auth_negotiation` then `MACS::verify_response` to receive a short-lived stamped envelope. See [MACS](/docs/protocols/macs). ## Request envelope ```json POST /v1/dispatch Content-Type: application/json Authorization: Bearer $TOKEN X-Agent-Did: did:oas:l1fe:agent:0x... X-Tenant-Id: org_acme traceparent: 00-4f81b3a000000000aabbccdd00112233-01020304050607080-01 { "protocol": "MARC", "version": "v1.0.0", "operation": "reasoning_task", "input": { "intent": "is the treaty enforceable?", "budget": { "tokens": 8000, "deadline_ms": 12000 } }, "tenant_id": "org_acme" } ``` Fields: | Field | Type | Required | Notes | | --- | --- | --- | --- | | `protocol` | string | yes | Canonical name, e.g. `MARC`, `MIND` | | `version` | string | yes | Semver, e.g. `v1.0.0` or `v1` for best-in-major | | `operation` | string | yes | One of the protocol's exported operations | | `input` | object | yes | Operation-specific payload | | `tenant_id` | string | yes | Must match `X-Tenant-Id` or be on an active MOAT treaty | ## Response envelope ### Success ```json HTTP/2 200 OK Content-Type: application/json X-Map-Correlation-Id: 4f81b3a-1234-5678-9abc-def012345678 X-Map-Audit-Head: 0x4f81b3acdef... traceparent: 00-... X-RateLimit-Remaining: 9483 X-RateLimit-Reset: 1735689200 { "output": { /* the protocol's response data */ } } ``` `output` is the unwrapped `Response::data` from the protocol. `Response::metadata` (if any) flows through the audit chain — recover via `MAX::traceability_graph` keyed on the correlation ID. ### Error ```json HTTP/2 403 Forbidden Content-Type: application/json X-Map-Correlation-Id: ... { "error": { "code": "capability_denied", "message": "missing capability map.marc.reasoning_task", "context": { "protocol": "MARC", "operation": "reasoning_task", "tenant_id": "org_acme" }, "correlation_id": "..." } } ``` ### Error code → HTTP mapping | `code` | HTTP | Engine error | | --- | --- | --- | | `unknown_protocol` | 404 | `UnknownProtocol` | | `unknown_version` | 404 | `UnknownVersion` | | `rate_limited` | 429 | `RateLimited` (with `Retry-After`) | | `capability_denied` | 403 | `CapabilityDenied` | | `circuit_open` | 503 | `CircuitOpen` | | `no_endpoint_available` | 503 | `NoEndpointAvailable` | | `policy_denied` | 422 | `ProtocolError::PolicyDenied` | | `invalid_payload` | 422 | `ProtocolError::InvalidPayload` | | `missing_capability` | 403 | `ProtocolError::MissingCapability` | | `adapter_error` | 502 | `ProtocolError::AdapterError` | | `timeout` | 504 | `Timeout` | | `internal_error` | 500 | `Internal` | ## Trace context MAP propagates W3C Trace Context throughout. If you send a `traceparent` header, MAP threads it through every internal hop and every audit record. ``` traceparent: 00-{trace-id}-{parent-id}-{flags} tracestate: vendor1=value1,vendor2=value2 ``` On the response, MAP echoes the `traceparent` so you can correlate. ## Rate-limit headers Every successful response carries: ``` X-RateLimit-Limit: 10000 X-RateLimit-Remaining: 9483 X-RateLimit-Reset: 1735689200 ``` When you hit the limit: ``` HTTP/2 429 Too Many Requests Retry-After: 12 X-RateLimit-Limit: 10000 X-RateLimit-Remaining: 0 X-RateLimit-Reset: 1735689212 ``` `Retry-After` is the recommended back-off in seconds. ## Idempotency For idempotent retries, supply an `Idempotency-Key`: ``` Idempotency-Key: my-app-req-abc123 ``` MAP caches the response keyed by `(tenant_id, idempotency_key)` for 24 hours. The second request with the same key returns the cached response without re-dispatching. This is the only safe way to retry state-changing operations. ## Streaming responses For long-running operations (some `MARC::reasoning_task` calls, all `MACE::deliberate`), the engine streams Server-Sent Events: ``` POST /v1/dispatch?stream=1 Accept: text/event-stream ``` ``` event: progress data: { "stage": "world_model_bound", "elapsed_ms": 240 } event: progress data: { "stage": "deliberating", "delegates_voted": 3 } event: result data: { "output": { ... }, "audit_head": "0x..." } ``` Streamed events carry the same `traceparent` and `X-Map-Correlation-Id` as a single-shot response. ## A minimal client in 60 lines Python example: ```python import os, json, urllib.request class MapClient: def __init__(self, *, api_url, api_key, agent_did, tenant_id): self.api_url = api_url.rstrip('/') self.api_key = api_key self.agent_did = agent_did self.tenant_id = tenant_id def dispatch(self, protocol, version, operation, input, idempotency_key=None): body = json.dumps({ 'protocol': protocol, 'version': version, 'operation': operation, 'input': input, 'tenant_id': self.tenant_id }).encode('utf-8') req = urllib.request.Request( self.api_url + '/v1/dispatch', data=body, method='POST', headers={ 'Authorization': f'Bearer {self.api_key}', 'X-Agent-Did': self.agent_did, 'X-Tenant-Id': self.tenant_id, 'Content-Type': 'application/json', **({'Idempotency-Key': idempotency_key} if idempotency_key else {}) } ) try: with urllib.request.urlopen(req) as resp: return json.load(resp)['output'] except urllib.error.HTTPError as e: raise MapError(json.load(e)['error']) class MapError(Exception): def __init__(self, err): self.err = err def __str__(self): return f'{self.err["code"]}: {self.err["message"]}' ``` This is the entire wire surface. Anything more sophisticated — retry logic, trace propagation, validation — is application policy. The MAP wire is intentionally that small. ## See also - [Engine handle_request](/docs/engine/handle-request) — the server-side type - [Engine types](/docs/engine/types) — `HandleRequestInput`, `Response`, errors - [Rust SDK](/docs/sdks/rust) - [TypeScript SDK](/docs/sdks/typescript) ================================================================================ # Security # URL: https://docs.multiagentic.dev/docs/security # Defense in depth — SecurityGateway, MACS verification, Arsenal credential proxy, signed plugins, audit chain, sovereign deployment. ================================================================================ import { Callout } from 'fumadocs-ui/components/callout'; MAP's security model is **defense in depth**. No single layer protects you; every layer must hold. This page describes each layer and how they compose. ## The threat model MAP is designed to operate in environments where: - Autonomous agents act on behalf of human principals - Calls cross organizational boundaries under treaty - Credentials must not leak to agents that use them - Every action must be attributable and auditable - The substrate itself may be one of many adversarial principals' targets The model assumes the gateway, the engine, and the audit chain are all in scope for adversaries. The protections are layered such that compromise of any one does not compromise the institution. ## Layers ### 1. Transport — TLS Every connection terminates TLS 1.3 at the gateway. Rustls (no OpenSSL). Default cert via the platform (Let's Encrypt on Vercel, Fly.io certs on Fly). Sovereign deployments bring their own CA and chain. ```toml [gateway.tls] min_version = "1.3" ciphersuites = [ "TLS_AES_256_GCM_SHA384", "TLS_CHACHA20_POLY1305_SHA256", "TLS_AES_128_GCM_SHA256" ] ``` ### 2. Identity — MACS verification Before any request enters the engine, `MACS::verify_response` runs: 1. Verify the Ed25519 signature on the presented envelope 2. Resolve the OAS DID document 3. Walk the lineage chain to a human root 4. Compute the effective capability set (declared + delegated + treaty) The verification is offline-possible — the lineage chain plus the leaf signature suffice. See [Identity & lineage](/docs/concepts/identity). ### 3. Capability — SecurityGateway Every operation requires a matching capability. Hierarchical matching at Stage 4: ``` map.{protocol}.{operation} → exact match required first map.{protocol}.* → protocol wildcard map.*.* → admin wildcard (rare) ``` Capabilities cannot be amplified through delegation — `Aegis::delegate` enforces this at delegation time and `MACS::derive` re-verifies at every request. See [Capabilities](/docs/concepts/capabilities). ### 4. Policy — MAXIM `MAXIM` evaluates the active policy bound to the tenant for every request. Policies are written in Cedar (or Logos for institutions that prefer it). Refusal returns the policy rule that fired and the facts that triggered it. ```text permit ( principal in TrustedAgents, action == Action::"map.market.execute_trade", resource is Trade ) when { resource.size_usd < 100000 && principal.merit.score >= 80 && context.time_of_day in ["09:00".."17:00"] }; ``` ### 5. Credential proxy — Arsenal The hardest layer: agents need to call third-party APIs that require credentials. Arsenal solves this by issuing **Agent Capability Tokens** (ACTs) bound to the caller, capability, and credential reference — the agent never sees the credential. The 11-step proxy: 1. Agent calls Arsenal proxy with intent + ACT 2. Arsenal verifies ACT and caller identity 3. Arsenal looks up the credential by reference 4. Arsenal validates the outbound URL (SSRF guard + DNS-rebinding defense) 5. Arsenal substitutes the credential at the wire (e.g., adds `Authorization: Bearer ...`) 6. Arsenal sends the request 7. Arsenal receives the response 8. Arsenal records to the hash-chained audit 9. Arsenal redacts the response if necessary 10. Arsenal returns the redacted response to the agent 11. Arsenal optionally triggers HITL consent for new credential surfaces See [`Arsenal` adapter](/docs/protocols/arsenal). ### 6. Sandbox — Wasmtime 37 Tier-2 plugins run in Wasmtime's memory sandbox with the WASIP2 component model. Plugins: - Cannot read host memory outside their imports - Cannot make raw syscalls - Cannot allocate memory beyond their declared limit - Cannot run beyond their declared CPU budget (fuel + epoch) - Can only call host functions explicitly imported in their `wit` interface Compromised plugins cannot affect other plugins or the host. ### 7. Audit — MAX Every layer's decision flows to `MAX::audit_log_entry`. The chain is hash-linked and signed; compromise of an in-flight operation cannot rewrite history. See [Concepts → Audit](/docs/concepts/audit). ## Plugin signing Tier-2 WASI plugins must be signed by a publisher whose DID is in `trusted_publishers`. Tier-3 external HTTP plugins authenticate to the engine via DID-Auth. ```toml [plugins] require_signatures = true trusted_publishers = [ "did:oas:l1fe:agent:0x...", # L1fe official "did:oas:acme:agent:0x...", # Acme — our institution # ... ] ``` Unsigned or invalidly-signed plugins enter `Pending` state and emit a `PluginRejected` audit event. They cannot be promoted to `Registered` without a valid signature. ## Secret management MAP itself stores secrets in: | Secret | Storage | Rotation | | --- | --- | --- | | Engine TLS key | platform (Fly, Vercel, BYO) | per platform | | Engine audit signing key | sealed in secret store | annual | | API keys (issued to tenants) | hashed in PostgreSQL | per tenant policy | | OAuth2 refresh tokens | encrypted at rest | 90 days default | | OAS DID private keys | NEVER stored by MAP | held by entity | MAP **never stores** customer DID private keys. Customers retain custody; MAP verifies signatures against the OAS document. This is what makes sovereign deployment trustworthy — your keys never touch our infrastructure. ## Auth profiles `MACS` supports multiple auth profiles, configured per tenant: | Profile | When to use | Strength | | --- | --- | --- | | `DidAuth` | Production agent-to-agent | Strong: Ed25519 signature | | `Loopy` (nonce) | Browser / interactive | Moderate: nonce-response | | `Zkp` | Privacy-sensitive | Strong + private: zero-knowledge proof | | `OAuth2` (feature-gated) | Human ingress | Moderate: OAuth2 PKCE | | `BioagenticProfile` | Experimental | Per-experiment | Most production traffic uses `DidAuth`. Human ingress through the admin console uses `OAuth2`. ## Sovereign deployment posture For air-gapped or on-prem deployments: - **No outbound telemetry** — `MAP_OTEL_ENDPOINT` unset, no metrics push - **Local OAS mirror** — DID resolution against an internal registry - **Bring-your-own CA** — TLS chain bound to your CA - **Local plugin signing** — `trusted_publishers` configured to your own keys only - **Customer-owned audit signing** — engine signs audit records with a key in your custody The same engine binary runs sovereign-mode and SaaS-mode. Configuration is the only difference. For sovereign deployments handling regulated data, contact `sovereign@l1fe.ai` for the full onboarding package — key custody procedures, compliance attestations, deployment hardening guides. ## Reporting vulnerabilities If you discover a security issue, report to `security@l1fe.ai` with full reproduction steps. We follow a 90-day coordinated disclosure window. Critical findings (CVSS ≥ 9.0) receive same-day patches. ## See also - [Engine pipeline](/docs/engine/pipeline) — where security gating runs - [`MACS`](/docs/protocols/macs) — identity verification - [`Arsenal`](/docs/protocols/arsenal) — credential proxy - [`Aegis`](/docs/protocols/aegis) — keys & delegation - [Plugins](/docs/plugins) — signing - [Concepts → Audit](/docs/concepts/audit)