Cairnmind

Full Platform Inventory

Everything implemented in Cairnmind

Cairnmind is more than a memory store for coding assistants. It combines verified citation Q&A, optimistic concurrency for plans and handoffs, machine-verified test gates, a 12-language local code graph, human-only confirmation security, and terminal/browser workspaces in one local service.

01 · Verified Knowledge & Citation Engine

Verbatim source quotes or an explicit unknown

Cairnmind never promotes a model claim into independent evidence. Every answer is checked verbatim against current files and passed through deterministic subject, support, and names verification.

Stable 1.0 + Preview

Verbatim quote & multi-stage support checks

Quotes must occur literally in current sources. Subject, support, and product-names checks withhold unsupported claims as partial or unknown instead of fabricating numbers.

$ cairnmind ask my-app "When do accounts lock?" --json

Deterministic-only mode (zero models required)

Runs without Ollama or any LLM: plans, tasks, checks, impact, indexing, and full-text passage search stay operational while ask explicitly reports status: unavailable instead of guessing.

$ cairnmind status --json

Quote self-healing & symbol-anchored evidence

Tracks source lines across refactors using Git diffs, AST symbol context, SHA-256 validation, and CAS audit logs, plus opt-in @decision code-comment ADRs.

$ cairnmind memory heal-audit my-app --json

Optional NLI / VCR verification cascade (Preview)

Optional cairnmind[nli] ONNX verifier layer with verdict caching for local entailment diagnostics alongside the standard support gate.

$ cairnmind ask my-app "…" --verifier-mode nli

02 · Cold Handoffs, OCC & Universal MCP

Move work cleanly between assistants without silent overwrites

Every session reads and acknowledges a checksummed resume packet before writing. Concurrent agents coordinate through monotonic plan versions and optimistic concurrency checks.

Stable 1.0

Checksummed resume packets (v2) & read-before-write ACK

Sessions receive a bounded packet with state_hash, origin attribution (unattributed, external, automatic_extraction), and short readback when unchanged. Session writes are refused until ACK matches live state.

$ cairnmind session show SESSION_ID --json

Versioned plans, stage router & CAS concurrency

Atomic plan and step updates enforce expected_version / expected_plan_version so two assistants never silently clobber each other. The stage next command recommends the next assistant or check.

$ cairnmind plan next my-app --json

First-class & external coding assistants (MCP presets)

Launches Codex CLI, Claude Code (including cairnmind-recorder subagent), GitHub Copilot SDK, and built-in API agents (OpenAI, Anthropic, Ollama, OpenAI-compatible). Generates atomic, backed-up MCP configs for popular editors and any MCP client.

$ cairnmind mcp generate --client claude-code --write

Direct MCP Mode for external editors (transparent provenance)

Cursor, Cline, Windsurf, VS Code, Zed, and Gemini CLI connect via cairnmind mcp --client external. Cairnmind does not wrap the IDE process, so writes carry origin_evidence: degraded in JSON and you always see what was engine-verified vs IDE-reported.

$ cairnmind mcp test-connection

03 · Machine-Verified Done & Serverless CI

An agent cannot claim done after code changes

Test-gated tasks require fresh local runs of named check profiles bound to the worktree code fingerprint. Edit one line and previous passing runs immediately go stale.

Stable 1.0

Named check profiles (.cairnmind/checks.toml)

Executes declared argv directly (no shell, isolated process group, explicit timeouts and output limits) and records exit code + stdout/stderr bound to task definition and code fingerprint.

$ cairnmind check run my-app unit --task TASK_ID

Memory Pulse micro-audit (< 500 ms)

Read-only consistency check inspecting code drift, stale test tasks, degraded entities, and snapshot integrity with exit codes 0 (healthy), 1 (drift with --strict), and 2 (broken) for CI and pre-push hooks.

$ cairnmind pulse my-app --strict --json

Serverless CI scan & blast-radius impact

Run cairnmind scan in CI pipelines without a running service, or query cairnmind impact to see which stored decisions, constraints, and docs are affected by changes since HEAD.

$ cairnmind impact my-app --json

Local answer logging, usage logs & regression replay

Inspect local-only session/token logs with cairnmind usage (never sent anywhere), keep masked project answers on disk, and run cairnmind eval replay or cairnmind eval injection to catch citation regressions and prompt-injection exposure.

$ cairnmind eval injection --runs 3

04 · Multi-Language Code Graph & Hybrid Retrieval

Tree-sitter + SCIP code graph fused with BM25 and HNSW vectors

One local ArcadeDB engine holds documents, dependency edges, full-text indexes, and semantic vectors, plus a lightweight SQLite preview mode for 15-second trials.

Stable 1.0 + Preview
EDITED · SHA CHANGED src/checkout.py calls test_imports src/tax.py · caller ADR: Rounding Rule test_checkout · STALE CAIRNMIND IMPACT 1 ADR · 1 caller done blocked ✕

Tree-sitter (Python/JS/TS) + automatic SCIP (9 more languages)

Background SCIP worker indexes Go, Rust, Java, Kotlin, C, C++, C#, PHP, and Ruby into the same defines/imports/calls/references/test_imports graph, with offline cairnmind scip import support.

$ cairnmind scip status --json

Hybrid RAG + GraphRAG retrieval

Fuses BM25 full-text search, HNSW vector similarity, definition lookup, and graph traversal, then re-checks every returned passage against live files on disk.

$ cairnmind index my-app

Pinned ArcadeDB 26.11.1 + lossless SQLite preview

Run managed native ArcadeDB (Java 21), digest-pinned Docker container, remote server/Kubernetes connect-only, or zero-dependency SQLite WAL+FTS5 (Preview) with lossless cairnmind migrate --to server.

$ cairnmind migrate --to server

Checksummed backups & single-writer protection

Streamed .cairnmind.json.gz backups (with staged restore & before-restore safety copy) and installation.json single-writer locks prevent accidental split-brain writes.

$ cairnmind backup backup.cairnmind.json.gz

05 · Human Sovereignty & Zero-Plugin Security

Only a person confirms, enforced outside the model

Trust boundaries live in the OS and storage service, never in polite prompt instructions. Neither an MCP tool nor a CLI call can confirm a record, approve a plan, or bypass the secrets gate.

Stable 1.0

OS-enforced person-confirmation key

Confirming/disputing records, resolving conflicts, confirming plans, releasing secrets, or deleting project memory requires the live workspace key (a tmux server on POSIX, an owner-only Named Pipe on native Windows).

$ cairnmind brief my-app

Secret masking & publication gate

Masks registered secrets and high-entropy tokens before indexing or transcript conversion, and blocks publication in .memory/cairnmind-published/ until a person reviews or explicitly releases it.

$ cairnmind memory publish my-app --preview --json

Sensitivity-class egress control

Remote model servers require HTTPS plus --allow-remote consent. Hosted built-in agents obey memory_remote_classes (default ["project"]) and hold back conversations and third-party sources automatically.

$ cairnmind setup --json

Zero in-process plugins & out-of-process converters

Third-party MCP tools and custom history converters (cairnmind importer add / import --via) run strictly out of process with scrubbed environments, bounded timeouts, and degraded provenance.

$ cairnmind importer list --json

06 · Workspaces, Git Team Memory & 1.0 Contract

Built for terminal engineers, with a frozen 1.0 contract

Operate from a multi-pane terminal cockpit, an optional loopback Obsidian web inspector, or pure --json scripts backed by CI-frozen contract fixtures.

Stable 1.0 + Preview

Cross-platform terminal workspaces

Multi-pane tmux + Textual cockpit on Linux, WSL2, and macOS. Standalone Textual workspace on native Windows PowerShell, with no tmux requirement and full keyboard navigation.

$ cairnmind

Local web Engineer Cockpit (Preview)

Optional loopback-only (127.0.0.1:4310) Obsidian Glass browser inspector streaming SSE updates for OCC session alignment, task test gates, SHA-256 verbatim diffs, and 4-column blast-radius graphs.

$ cairnmind ui --port 4310 --project my-app

Portable snapshots & Git team memory

Share reviewed decisions, constraints, and plans across teammates through Git (.memory/cairnmind-published/ FORMAT v1) with diff, validate, and zero credentials committed.

$ cairnmind memory publish my-app

Frozen 1.0 CLI, MCP & storage contract (v0.12 → 1.0)

Contract frozen ahead of 1.0 (no breaking changes planned from v0.12): 35 CLI --json shapes, 9 captures across all 8 MCP tools, and cross-release store/backup upgrade fixtures guarded on every PR.

$ cairnmind doctor --contract --format text

System architecture & security boundaries

Honest System Architecture

One local service outside every coding assistant

Zero in-process plugins · Local-first
Cairnmind Local Architecture Diagram Top row: Terminal Workspace (tmux + Textual or native Windows standalone) and Local Web Cockpit beside Coding Assistants (Codex CLI, Claude Code, Copilot SDK, API agents, and Direct MCP Mode for Cursor, VS Code, Windsurf, Zed, Cline, and Gemini CLI). Middle layer: Local Cairnmind Service enforcing Resume/ACK gate, OCC versioned plans, verbatim quote and subject/support/names checks, person confirmation key, secrets gate, and priority queue. Bottom layer: Optional Local or HTTPS Models (Ollama qwen3.5:9b and qwen3-embedding:0.6b, or deterministic-only mode) beside Multi-Language Code Graph (Tree-sitter + 9 SCIP indexers) and ArcadeDB 26.11.1 hybrid storage (or SQLite preview). HUMAN WORKSPACE · PERSON-CONFIRMED KEY Terminal Workspace & Local Web Cockpit tmux + Textual (POSIX) · Standalone (Windows) cairnmind ui (:4310) · Only a person confirms CODING ASSISTANTS & DIRECT MCP CLIENTS Codex CLI · Claude Code · Copilot SDK · API Agents Direct MCP: Cursor · VS Code · Windsurf · Zed · Cline · Gemini Protocol: 8 MCP tools + CLI --json · Propose only, never confirm tmux / Named Pipe key MCP stdio (resume / ACK / ask / plans) LOCAL CAIRNMIND SERVICE (127.0.0.1:8765 · PRIORITY QUEUE · INDEPENDENT ARCHIVING) Quote & Support Gate Verbatim · Subject · Names · NLI Resume ACK & OCC Plans Packet v2 · state_hash · CAS Fingerprint Check Gates checks.toml · pulse · CI scan Secrets & Egress Gate Masking · Egress · Git publish KNOWLEDGE MODELS (OPTIONAL) Ollama Local or HTTPS OpenAI-Compatible Default: qwen3.5:9b (16k ctx) + qwen3-embedding:0.6b No models? Deterministic-only mode works with 0 GPU CODE GRAPH & HYBRID STORAGE (SINGLE-WRITER LOCK) ArcadeDB 26.11.1 (Java 21 / Docker / Remote) · SQLite Preview Tree-sitter (Py/JS/TS) + Auto SCIP (Go/Rust/Java/Kotlin/C/C++/C#/PHP/Ruby) Hybrid BM25 + HNSW Vectors + GraphRAG · Checksummed .cairnmind.json.gz
Source: docs/ARCHITECTURE.md and docs/CONTRACTS.md. Direct MCP clients carry origin_evidence: "degraded" in JSON because the IDE session is not wrapped by Cairnmind’s launcher.

Live CI-frozen contract outputs (35 CLI + 9 MCP captures)

Live Contract Explorer

Inspect real CI-frozen JSON & MCP outputs

Loaded directly from tests/fixtures/contracts/
MCP Tool · Handoff & OCC

What an assistant receives on cold start: active plan version, active task, live worktree code fingerprint, recomputed state_hash, and server-enforced degraded evidence warnings for external clients.

packet.schema_version: 2

Versioned resume contract locked for 1.0

packet.state_hash

Must be acknowledged before any session write succeeds

packet.evidence: "degraded"

Server-stamped provenance for external MCP clients

$ mcp.resume_context(full_packet=true)
{
  "epoch": 1,
  "packet": {
    "active_plan": {
      "constraints": [
        "Preserve field names across minor releases"
      ],
      "goal": "Freeze JSON/MCP shapes for 1.0.0",
      "id": "<UUID_1>",
      "source_ids": [
        "<UUID_2>"
      ],
      "title": "Contract stabilization",
      "version": 1
    },
    "active_task": {
      "acceptance_criteria": [
        "All frozen JSON fields match"
      ],
      "content": "Verify frozen CLI and MCP responses.",
      "depends_on": [],
      "id": "<UUID_3>",
      "required_profiles": [],
      "requires_review": false,
      "requires_test": false,
      "source_ids": [
        "<UUID_2>"
      ],
      "state": "todo",
      "version": 1
    },
    "archive": {
      "scope": "captured EOFs only; this client's own conversation is not archived",
      "status": "complete"
    },
    "archive_watermarks": [],
    "blockers": [],
    "client": "external",
    "code": {
      "branch": "main",
      "fingerprint": "<SHA256_1>",
      "head": "<GIT_SHA_SHORT>828475baa1899a45ef503e5c6fa1",
      "manifest_hash": "<SHA256_2>",
      "status": "fresh",
      "unknowns": [],
      "worktree": "<WORKTREE>"
    },
    "created_at": "<TIMESTAMP>",
    "epoch": 1,
    "evidence": "degraded",
    "extraction": {
      "counts": {
        "pending": 1
      },
      "status": "pending"
    },
    "hash": "<SHA256_3>",
    "history": "unarchived",
    "id": "<UUID_4>",
    "indexing": {
      "counts": {
        "pending": 5
      },
      "status": "pending"
    },
    "next_action": "ready",
    "no_history": false,
    "omitted_by_origin": {},
    "omitted_records": 0,
    "omitted_unknowns": 0,
    "project_id": "<UUID_5>",
    "records": [
      {
        "content": "Keep compute_total synchronous and deterministic.",
        "content_truncated": false,
        "id": "<UUID_6>",
        "kind": "decision",
        "origin": "unattributed",
        "source_ids": [
          "<UUID_7>",
          "<UUID_8>"
        ],
        "status": "proposed",
        "version": 1
      },
      {
        "content": "Verify frozen CLI and MCP responses.",
        "content_truncated": false,
        "id": "<UUID_3>",
        "kind": "task",
        "origin": "unattributed",
        "source_ids": [
          "<UUID_2>"
        ],
        "status": "proposed",
        "version": 1
      }
    ],
    "schema_version": 2,
    "session_id": "<UUID_9>",
    "state_hash": "<SHA256_4>",
    "status": "ready",
    "unknowns": [],
    "warnings": [
      "External client: Cairnmind cannot read or archive this client's own conversation (history: unarchived), so nothing said in it can be verified (evidence: degraded). What this session records is kept as reported by an external session and is never shown or counted as verified."
    ],
    "worktree": "<WORKTREE>"
  },
  "session_id": "<UUID_9>",
  "status": "ready",
  "unknowns": []
}