reasonkit-think-mcp 0.1.1

Rust MCP server for auditable sequential and tree-of-thoughts reasoning, aligned with ReasonKit skills.
# Architecture - ReasonKit Think MCP v2

## System Diagram

```mermaid
flowchart TD
  C[Client MCP Host] --> S[reasonkit-think-mcp]
  S --> T[Tool Router]
  S --> P[Prompt Router]
  S --> R[Resource Router]

  T --> DE[Deliberation Engine]
  T --> VE[Verification Engine]
  T --> SA[Skills Adapter]
  T --> AG[Audit Exporter]

  DE --> TS[Thought Store DAG]
  VE --> TS
  SA --> TS
  AG --> TS

  VE --> VM[Verification Matrix]
  SA --> RD[Route Decision]
  AG --> AR[Audit Record JSON]
```

## Reasoning Modes

- `quick`: low overhead, linear thought tracking.
- `deliberate`: branch, evaluate, prune, synthesize.
- `governed`: deliberate + ReasonKit stages + route gate.

## Data Model

## Core entities

- `Session`
  - `session_id`, `created_at`, `mode`, `budgets`.
- `Deliberation`
  - `deliberation_id`, `goal`, `constraints`, `status`.
- `ThoughtNode`
  - `node_id`, `parent_ids`, `content`, `score`, `branch_id`, `created_at`.
- `VerificationClaim`
  - `claim_id`, `text`, `criticality`, `status`.
- `EvidenceItem`
  - `source`, `tier`, `independence_group`, `supports_claims`.
- `RouteDecision`
  - `decision`, `confidence`, `rationale`, `blocking_gaps`.

## Edge types (GoT-ready)

- `supports`
- `conflicts`
- `depends_on`
- `refines`

## Tool Pipeline

```mermaid
sequenceDiagram
  participant Client
  participant MCP
  participant Deliberation
  participant Verification
  participant Skills

  Client->>MCP: start_deliberation
  MCP->>Deliberation: create graph/session
  Client->>MCP: expand_thoughts
  MCP->>Deliberation: generate branch candidates
  Client->>MCP: score_thoughts
  MCP->>Deliberation: score and rank
  Client->>MCP: prune_thoughts
  MCP->>Deliberation: beam prune
  Client->>MCP: verify_thoughts
  MCP->>Verification: CoVe + matrix
  Client->>MCP: run_reasonkit_pipeline
  MCP->>Skills: execute selected stages
  Client->>MCP: consensus_answer
  MCP-->>Client: answer + confidence + route
```

## Policy Guard

Mandatory checks before `consensus_answer` success:

1. No unresolved critical `VerificationClaim`.
2. No unhandled `source-conflict` on critical claims.
3. Diversity floor met when in deliberate mode.
4. Route decision emitted in governed mode.

## Reliability and Performance Controls

- Session budgets:
  - max nodes
  - max depth
  - max expansions per call
  - max verification questions
- Timeouts per tool.
- Bounded in-memory retention with `MAX_HISTORY_SIZE`.
- Optional persisted snapshots in future phase.

## Security Controls

- Existing prompt-injection scan/redaction remains enabled.
- Extend redaction to evidence and claim payloads.
- Validate all tool args with strict schemas.
- Reject unsafe oversized payloads.

## Compatibility

- Keep v1 tools stable and available.
- New tools are additive; no breaking rename.
- Documented protocol contract in `docs/research/SOURCES.md` and per-tool docs.