Skip to content
Conduit

mcp server

Onyx-Si

🌟Zero-dependency MCP kernel for coding agents. Runs and tests speculative edits in RAM shadow workspaces before touching disk.

xTanTHaix/Onyx-Sicommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

Before you start

  • uv (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "onyx-si": {
      "command": "uvx",
      "args": [
        "onyxsi"
      ]
    }
  }
}

same format Cursor, GitHub Copilot CLI, Junie, JetBrains AI Assistant, Augment (Auggie CLI), Factory Droid, Kiro, Devin CLI +12

Values in angle brackets are placeholders. Restart Claude Desktop after editing its config.Claude Desktop docs

README

synced Oct 25, 2026

⚑ OnyxSi (Onyx-Si)

Pure Headless Zero-Dependency Autonomous Agent Kernel, ContextFS & Causal Execution Box

100% Python Standard Library Β· 100% Headless Β· Strict Token Budget Β· Crash-Safe Writes


Python Version Dependencies Platforms License Tests Boot Audit Schema Rollback Ghost CoW Antigravity OpenCode Claude Desktop Protocol

Why OnyxSi β€’ Connect MCP β€’ Live Transcript β€’ 8 Meta-Tools β€’ Architecture β€’ Benchmarks β€’ Installation


[!IMPORTANT] Zero external dependencies by design. An AST auditor (src/onyxsi/auditor.py) scans the codebase at boot and rejects banned third-party imports and UI packages. The latest audit checked 45 files with 0 violations. OnyxSi needs no pip install step, compiles no native extensions, and runs without a GUI. It communicates over stdio using JSON-RPC 2.0 and persists state to Markdown and JSON files.


🎯 Why OnyxSi Exists

⚠️ The Problem in Modern Coding Agents⚑ The OnyxSi Solution
Context window bloat. Dozens of narrow MCP tools burn tens of thousands of tokens before the model has read a single line of the codebase.8 polymorphic meta-tools, 1,593 tokens total. The whole tool surface is smaller than a typical system prompt. Output is folded into retrievable ref:// handles above 1,250 tokens.
Destructive edits. An agent writes a file, the build breaks, and nobody knows which of forty edits caused it.Tier-0 Ghost-CoW overlay. Every mutation lands in a zero-copy piece table in RAM. Disk is touched only after a syntax gate, a blast-radius test run, and an explicit commit.
Linear trial and error. One hypothesis at a time, each attempt a full round-trip through the model.In-RAM MCTS forking. Several competing fixes are explored simultaneously in RAM, scored against real test runs, and the winner is the only one that reaches disk.
Repeat-offender bugs. The same mistake is re-introduced three weeks later because nobody wrote it down.Autonomous AST antibody vaccine. Every commit is diffed against its own pre-image; the defective pattern that was removed becomes a permanent rule that blocks the reintroduction.
Cross-project contamination. Two repos on one machine share task IDs, progress state, and learned rules.Project-namespaced storage. Task state and antibody rules live under .onyxsi/wiki/projects/<project>/, so nothing bleeds across workspaces.
Lost reasoning. The agent's decision trail evaporates when the session ends.Time-Travel Chronicle. The branch tree and frame-by-frame event log write directly to TIME_TRAVEL_REPLAY.md, readable anytime without extra tools.

🎬 The Architectural Narrative

Figure 1: The Entropy of Modern Coding Agents
Coding agents commonly struggle with three structural issues:

  1. Context Bloat: Dozens of micro-tools consume thousands of prompt tokens on definitions alone before reading a single line of code.
  2. Destructive Edits: Unbuffered disk writes corrupt working trees during multi-step edits, leaving broken builds behind.
  3. Amnesia & Repetition: Without cross-session memory, fixed bugs recur weeks later because reasoning trails disappear when sessions close.

Figure 2: Replacing Linear Trial-and-Error with Governed Architecture
OnyxSi replaces speculative guesswork with deterministic, bounded execution:

  • Efficiency: Eight polymorphic meta-tools capped at 1,593 tokens total, eliminating tool catalog bloat.
  • Safety: A Tier-0 Ghost-CoW overlay buffers mutations in RAM; files touch disk only after passing syntax and blast-radius checks.
  • Multiverse: In-memory MCTS forking tests competing fixes in parallel rather than guessing one attempt at a time.
  • Immunity: AST antibody memory turns fixed bugs into permanent anti-patterns right after a commit lands.

Figure 3: Seven Decoupled Layers Governed at Boot
The runtime divides into seven layers. Before startup, an AST compliance auditor scans all 45 source files to confirm zero banned imports or UI packages:

  • Layer 7 (MCP Daemon): Headless JSON-RPC 2.0 engine over stdio, serving eight meta-tools with zero web server dependencies.
  • Layers 4 & 5 (Gateway & Causal): GBNF grammar checks, token folding, four-stage flight tracking, and a three-strike error budget.
  • Layers 2 & 3 (ContextFS & DeltaFS): Bitplane AST scanner, token governor, memoryview piece table, and in-memory branch leases.
  • Layer 1 (HAL): 64MB shared-memory superblock, lock-free SPSC telemetry ring, and process sandboxing.

🧩 Subsystem Architecture & Capability Matrix

πŸ› οΈ Fixed 8 Meta-Tool Surface🌲 In-RAM MCTS Multiverse Forking
Functional surface capped at 1,593 tokensβ€’ vfs_inspect & vfs_mutate: Zero-copy AST inspection and RAM-buffered editsβ€’ hypothesis_branch & ghost_sandbox: Ephemeral shadow executionβ€’ causal_flight & wiki_task_sync: Trajectory verification and task stateβ€’ graph_compute & mcp_orchestrate: Deterministic ALU & DAG pipelinesTest competing fixes in parallel in RAMβ€’ Fork: Clones candidate fixes in memory with zero disk I/Oβ€’ Test: Runs syntax gates and blast-radius tests in isolated shadow copiesβ€’ Merge: Commits only the highest-scoring branch to disk and drops failed attempts cleanly
πŸ›‘οΈ Autonomous AST Antibody Vaccine⏱️ Time-Travel Chronicle & Flight Recorder
Automatic regression prevention from commit diffsβ€’ Diff Analysis: Evaluates changed code lines on every successful commitβ€’ Forbidden Pattern: The removed bug becomes an active AST anti-patternβ€’ Prescribed Cure: The replacement code becomes the recommended fixβ€’ Deterministic Hashing: SHA-256 keys prevent duplicate rule entriesVerifiable reasoning trace across sessionsβ€’ Project Namespaced: Task state isolates under .onyxsi/wiki/β€’ Decision Trees: Records every branch evaluated during an editβ€’ Ring Buffer Log: Tracks relative timestamps, actions, and test results in TIME_TRAVEL_REPLAY.md
πŸ“Š Empirically Verified InvariantsπŸ”Œ Zero-Install Connection & Stdio Bridge
Empirically verified resource ceilingsβ€’ 1,593 Tokens: Combined schema footprint ceiling strictly maintainedβ€’ 1,250 Tokens: Per-call output limit with folding into ref:// handlesβ€’ 3.9 ΞΌs (0.0039 ms): Ghost-CoW rollback latency (p95)β€’ 669 Passed Tests: Zero failures across chaos, fuzzing, and scenario suitesPure Python stdlib headless orchestrationβ€’ Zero Installation: Runs directly from checkout with python onyxsi-mcp.pyβ€’ Standard Stdio MCP: Connects directly to Google Antigravity, OpenCode, and Claude Desktopβ€’ Minimal Setup: No Node.js runtime, compilers, or UI processes

πŸ”Œ Connect to Antigravity, OpenCode & MCP Clients

OnyxSi is a standard MCP server communicating over stdio using JSON-RPC 2.0. It requires zero package installations and runs straight from source on both Windows and Linux.

1. Google Antigravity

Antigravity natively orchestrates OnyxSi via its global configuration file (~/.gemini/config/mcp_config.json). All 8 Meta-Tools are auto-discovered from ~/.gemini/antigravity/mcp/onyxsi/:

Global Configuration (C:\Users\<user>\.gemini\config\mcp_config.json):

{
  "mcpServers": {
    "onyxsi": {
      "command": "L:\\.Tool\\OnyxSi\\.venv\\Scripts\\python.exe",
      "args": [
        "L:\\.Tool\\OnyxSi\\onyxsi-mcp.py",
        "--workspace",
        "L:\\.Tool\\OnyxSi"
      ],
      "env": {
        "PYTHONUNBUFFERED": "1",
        "PYTHONIOENCODING": "utf-8"
      }
    }
  }
}

[!TIP] Pre-compiled Tool Schemas: Tool schemas and execution instructions are stored directly under ~/.gemini/antigravity/mcp/onyxsi/ (onyxsi_vfs_inspect.json, onyxsi_vfs_mutate.json, etc.), allowing Antigravity to invoke each tool with zero catalog latency.

2. OpenCode v2

OpenCode v2 reads MCP servers from mcp.servers (unlike v1, which read mcp directly). Create opencode.jsonc in your project root, or add the block to ~/.config/opencode/opencode.jsonc to make it available everywhere.

Project-scoped (opencode.jsonc next to your code):

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "onyxsi": {
        "type": "local",
        "command": ["python", "/absolute/path/to/OnyxSi/onyxsi-mcp.py", "--workspace", "."],
        "timeout": { "startup": 60000, "execution": 600000 }
      }
    }
  }
}

Global (~/.config/opencode/opencode.jsonc): omit --workspace and OnyxSi targets whichever project the editor is currently in:

{
  "$schema": "https://opencode.ai/config.json",
  "shell": "powershell",
  "mcp": {
    "servers": {
      "onyxsi": {
        "type": "local",
        "command": [
          "python",
          "L:\\.Tool\\OnyxSi\\onyxsi-mcp.py"
        ],
        "timeout": { "startup": 60000, "execution": 600000 }
      }
    }
  }
}

[!TIP] Zero-install bridge. onyxsi-mcp.py puts the checkout's src/ on sys.path, pins stdin/stdout to UTF-8, and disables .pyc writing so the checkout stays pristine. onyxsi-mcp.cmd (Windows) and onyxsi-mcp.sh (Linux/macOS) are thin wrappers around it. No pip install, no PYTHONPATH, no virtualenv.

3. Claude Desktop / Cursor / Windsurf / VS Code

Add to your client's claude_desktop_config.json or MCP settings:

{
  "mcpServers": {
    "onyxsi": {
      "command": "python",
      "args": [
        "/absolute/path/to/OnyxSi/onyxsi-mcp.py",
        "--workspace",
        "/absolute/path/to/your/project"
      ]
    }
  }
}

4. Direct Terminal Verification

Verify the server protocol initialization directly over terminal pipes:

echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"probe","version":"1.0"}}}' \
  | python onyxsi-mcp.py --workspace .
onyxsi --workspace DIR          # serve DIR over JSON-RPC stdio
           --project-name NAME   # namespace for the task wiki + antibody store
                                 # (default: the workspace folder name)
           --no-pre-flight-gate  # allow vfs_mutate without causal_flight pre_flight
           --telemetry-out PATH  # append per-tool JSONL telemetry on shutdown
           --max-index-files N   # cap on indexed .py files          (default: 5000)
           --max-index-mb MB     # per-file size cap                 (default: 2.0)
           --max-index-total-mb MB # total index byte budget         (default: 128.0)
           --max-shadow-mb MB    # temp shadow copy cap for tests    (default: 512.0)

πŸ§ͺ Live MCP Transcript (Verified)

The transcript below was captured directly from an interactive session over stdio JSON-RPC. It exercises the full MCTS loop: forking competing hypotheses in RAM, testing each in an isolated shadow copy of the workspace, scoring the results, merging the winner, and writing the final state to disk.

Step 1: Open a session and stage the baseline fix

β†’ {"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"ghost_sandbox","arguments":{"cmd":"begin"}}}
← {"status":"ok","mode":"ghost_sandbox_active","session_id":"074a5c0c"}

β†’ {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"ghost_sandbox","arguments":{"cmd":"fork","branch_id":"branch_fast","hypothesis":"rename the helper, keep the body"}}}
← {"status":"ok","branch_id":"branch_fast","branches":[
     {"branch_id":"main","parent":null,"hypothesis":"","active":false,"modified_files":1,"score":null},
     {"branch_id":"branch_fast","parent":"main","hypothesis":"rename the helper, keep the body","active":true,"modified_files":1,"score":null}]}

Step 2: Test each branch in an isolated shadow workspace

β†’ {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"ghost_sandbox","arguments":{"cmd":"switch_branch","branch_id":"branch_fast"}}}
β†’ {"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"ghost_sandbox","arguments":{"cmd":"test","command":"python demo_mcts/check.py","timeout_s":60}}}
← {"status":"ok","test_result":"FAILED","mode":"shadow-workspace","exit_code":1,"duration_ms":30.9,
   "shadow_files":132,"staged_files":1,
   "stderr_tail":"AssertionError: add(2, 3) returned -1, expected 5\n",
   "enforcement":{"workspace":"path-prefix; the command ran in a temp copy, the real workspace was not written",
                  "syscall":"none","network":"not isolated"}}

β†’ {"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"ghost_sandbox","arguments":{"cmd":"switch_branch","branch_id":"branch_robust"}}}
β†’ {"jsonrpc":"2.0","id":6,"method":"tools/call","params":{"name":"ghost_sandbox","arguments":{"cmd":"test","command":"python demo_mcts/check.py","timeout_s":60}}}
← {"status":"ok","test_result":"PASSED","exit_code":0,"stdout_tail":"PASS: add(2, 3) == 5\n"}

Step 3: Score, merge the winner, and commit it

β†’ {"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"name":"ghost_sandbox","arguments":{
     "cmd":"merge_best",
     "scores":[{"branch_id":"main","passed_tests":0,"total_tests":1},
               {"branch_id":"branch_fast","passed_tests":0,"total_tests":1},
               {"branch_id":"branch_robust","passed_tests":1,"total_tests":1}]}}}
← {"status":"ok","winner":"branch_robust","score":99.9914,"scores":[
     {"branch_id":"main","score":0},
     {"branch_id":"branch_fast","score":-0.0024},
     {"branch_id":"branch_robust","score":99.9914}],
   "hint":"The winning branch is active and still in RAM; cmd=commit writes it to disk."}

β†’ {"jsonrpc":"2.0","id":8,"method":"tools/call","params":{"name":"ghost_sandbox","arguments":{"cmd":"commit"}}}
← {"status":"ok","committed_files":{"L:\\.Tool\\OnyxSi\\demo_mcts\\calc.py":118}}

The file on disk after the commit:

def add(a, b):
    if not isinstance(a, (int, float)):
        raise TypeError('a must be a number')
    return a + b

Step 4: Write the decision trail to disk

β†’ {"jsonrpc":"2.0","id":9,"method":"tools/call","params":{"name":"wiki_task_sync","arguments":{
     "task_id":"TASK-001","op":"replay","project_name":"OnyxSi",
     "branches":[{"branch_id":"main","hypothesis":"baseline as found on disk","score":0},
                 {"branch_id":"branch_fast","parent":"main","hypothesis":"rename the helper, keep the body","score":-0.0024},
                 {"branch_id":"branch_robust","parent":"main","hypothesis":"fix the operator, guard the type","score":99.9914}]}}}
← {"status":"ok","path":"L:\\.Tool\\OnyxSi\\.onyxsi\\wiki\\projects\\OnyxSi\\tasks\\TASK-001\\TIME_TRAVEL_REPLAY.md"}

Which produced TIME_TRAVEL_REPLAY.md:

# Time-Travel Replay: TASK-001

**Project:** `OnyxSi` | **Generated:** 2026-10-20T11:59:00Z | **Frames:** 0 | **Branches:** 3

## 1. ASCII Decision & State Branch Tree

```text
main  [score=0.00]  β€” baseline as found on disk
β”œβ”€β”€ branch_fast  [score=-0.00]  β€” rename the helper, keep the body
└── branch_robust  [score=99.99]  β€” fix the operator, guard the type

> [!NOTE]
> **The scoring formula:** `score = (passed / max(1, total)) * 100 - drift * 50 - min(10, diff_bytes / 10000)`. The test pass ratio carries the most weight. Drift reflects trajectory divergence measured by the causal engine, and the diff penalty is capped at 10 points so a larger correct patch is not penalized over a smaller incorrect one. If omitted, `drift` defaults to the live trajectory drift.

</details>

---

<a id="-the-fixed-8-meta-tool-surface"></a>
## 🧰 The Fixed 8 Meta-Tool Surface

<details>
<summary><b>πŸ” Click to expand: 8 Meta-Tools Specifications, Verified Payloads & Architectural Deep-Dives</b></summary>
<br>

OnyxSi exposes eight polymorphic meta-tools with a combined schema size of 1,593 tokens. The router enforces an 1,800-token hard ceiling at construction and refuses to start if it is exceeded.

| Meta-Tool | Operations | Purpose |
| :--- | :--- | :--- |
| `vfs_inspect` | `tree`, `skeleton`, `read`, `symbols`, `grammar`, `resolve` | Read-only inspection: directory maps, AST outlines, line ranges, exact/prefix symbol lookup, GBNF grammar export, `ref://` handle resolution. |
| `vfs_mutate` | `replace_file`, `replace_node`, `insert_after`, `slice_patch`, `merge_patches` | Stages a speculative edit in the in-RAM Ghost overlay. Disk stays untouched until commit. `merge_patches` applies non-overlapping agent patches and unifies imports. |
| `ghost_sandbox` | `begin`, `mutate`, `test`, `commit`, `discard`, `fork`, `switch_branch`, `list_branches`, `merge_best` | Ghost overlay lifecycle plus the in-RAM MCTS branch machinery. `test` runs blast-radius selection or an explicit command inside a shadow copy of the workspace. |
| `causal_flight` | `pre_flight`, `ghost_burn`, `verify`, `commit`, `reflect`, `bisect` | The 4-stage flight controller: declares blast radius, checks drift (<15%), re-parses staged files, logs the commit, resets the 3-strike budget, and binary-searches checkpoints for the culprit. |
| `hypothesis_branch` | `register`, `falsify`, `select` | Enforces orthogonal debugging hypotheses (Jaccard ≀ 0.70) with mandatory falsification probes, distilling failures into one-line negative lessons. |
| `wiki_task_sync` | `init`, `update`, `handoff`, `replay` | Project-namespaced task state: spec, progress JSON/Markdown, execution log, `AGENT_HANDOFF.md`, and the `TIME_TRAVEL_REPLAY.md` chronicle. |
| `graph_compute` | `engine=bm25` Β· `engine=blast_radius` Β· `engine=alu` (`type=eval`\|`matrix_matmul`\|`matrix_inv`\|`ieee754`) | Deterministic local compute: CSR+BM25 search, impacted-test selection, safe math evaluation, matrix algebra, IEEE-754 inspection. No LLM involved. |
| `mcp_orchestrate` | `steps[]` with `depends_on` | Runs meta-tools as one dependency-ordered DAG in a single round-trip; later steps read earlier output via `$prev.output` or `$<step>.output`. |

Every argument is validated against the declared JSON schema **before** a handler runs: unknown properties are rejected, enums are enforced, and a tool without a bound handler fails closed rather than echoing its input.

### πŸ”¬ Verified Meta-Tool & Resource Schema Reference

The examples below show tested payloads from stdio JSON-RPC and Google Antigravity MCP sessions:

<details>
<summary><b>πŸ“‹ Click to expand: Verified Payloads & Empirical Responses for all 8 Meta-Tools</b></summary>

#### 1. `vfs_inspect`: AST Outline & Read-Only Navigation
- **Operations (`action`):** `tree` Β· `skeleton` Β· `read` Β· `symbols` Β· `grammar` Β· `resolve`
- **Example Call:**
  ```json
  {"name": "vfs_inspect", "arguments": {"action": "tree", "target": "src/onyxsi", "max_tokens": 500}}
  • Verified Output: Compact hierarchical tree representation with token budget folding.

2. vfs_mutate: In-RAM Speculative Edits (Ghost-CoW)

  • Operations (op): slice_patch Β· replace_file Β· replace_node Β· insert_after Β· merge_patches
  • Example Call:
    {"name": "vfs_mutate", "arguments": {"op": "slice_patch", "path": "src/onyxsi/contracts.py", "start_line": 1, "end_line": 1, "code": "# contracts\n"}}
    
  • Verified Output: In-RAM piece-table diff and staged hash; disk remains completely untouched until committed.

3. ghost_sandbox: In-RAM MCTS Branching & Isolated Shadow Tests

  • Operations (cmd): begin Β· fork Β· test Β· switch_branch Β· list_branches Β· merge_best Β· commit Β· discard
  • Example Call:
    {"name": "ghost_sandbox", "arguments": {"cmd": "begin"}}
    
  • Verified Output: Active session ID (session_id) and branch table for branch isolation.

4. causal_flight: 4-Stage Trajectory & Drift Guard

  • Stages (stage): pre_flight Β· ghost_burn Β· verify Β· commit Β· reflect Β· bisect
  • Example Call:
    {"name": "causal_flight", "arguments": {"stage": "pre_flight", "blast_radius": ["src/onyxsi/contracts.py"], "hypothesis": "Inspect contracts"}}
    
  • Verified Output: Stage authorization, drift index check (<15%), and error budget counter verification.

5. hypothesis_branch: Orthogonal Debugging Exploration

  • Modes (mode): register Β· falsify Β· select
  • Example Call:
    {
      "name": "hypothesis_branch",
      "arguments": {
        "mode": "register",
        "branches": [
          {"branch_id": "H1", "statement": "Verify causal tracking", "target_nodes": ["contracts.py"], "probe": "probe_test"}
        ]
      }
    }
    
  • Verified Output: Hypothesis registered with Jaccard divergence check (≀ 0.70) against competing hypotheses.

6. wiki_task_sync: Project-Namespaced Task & Replay Engine

  • Operations (op): init Β· update Β· handoff Β· replay
  • Example Call:
    {"name": "wiki_task_sync", "arguments": {"op": "init", "task_id": "TASK-ANTIGRAVITY", "spec": "Verify Antigravity MCP"}}
    
  • Verified Output: Isolated state persistence initialized under .onyxsi/wiki/projects/<project>/tasks/.

7. graph_compute: Deterministic Local Compute ALU & Graph Engine

  • Engines (engine): alu (type=eval|matrix_matmul|matrix_inv|ieee754) Β· bm25 (query) Β· blast_radius (changed_files)
  • Example Call:
    {"name": "graph_compute", "arguments": {"engine": "alu", "type": "eval", "query": "2 + 2"}}
    
  • Verified Output: Deterministic evaluation result (4) computed in-process with 0 LLM latency.

8. mcp_orchestrate: Zero-Round-Trip Meta-Tool DAG Pipeline

  • Parameters: steps[] with id, tool, arguments, and optional depends_on
  • Example Call:
    {
      "name": "mcp_orchestrate",
      "arguments": {
        "steps": [
          {"id": "s1", "tool": "graph_compute", "arguments": {"engine": "alu", "type": "eval", "query": "40 + 2"}}
        ]
      }
    }
    
  • Verified Output: Multi-step pipeline output resolved and merged in a single transport cycle.

πŸ“¦ Live MCP Resources

OnyxSi exposes direct state and compliance resources over the MCP protocol:

  • onyxsi://schema: JSON-RPC 2.0 schema for all eight meta-tools with exact token counts (1,593 tokens).
  • onyxsi://audit: AST auditor report verifying zero third-party dependencies and zero UI packages.

1. In-RAM MCTS speculative forking

                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚     main      β”‚  ← the baseline every branch forks from
                     β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β–Ό                β–Ό                β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚ branch_fastβ”‚  β”‚ branch_robustβ”‚  β”‚ branch_alt β”‚
     β”‚ score 41.0 β”‚  β”‚ score 99.99  β”‚  β”‚ score 62.5 β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚                β”‚
            └──── fork β”€β”€β”€β”€β”€β”€β”˜
                  β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚ merge_best   β”‚  β†’ winner stays active in RAM, losers are released
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β–Ό
             ghost_commit()  β†’ one atomic write to disk

Each branch owns its own piece-table documents and tombstones. Forking clones the source branch in RAM so mutations cannot corrupt parent branches. Switching branches requires only a pointer rebind with no copying, write-back, or state loss.

2. Autonomous AST antibody auto-vaccine

commit ──► diff(baseline, fixed)
              β”‚
              β”œβ”€ removed line  ──► forbidden_pattern   (blocks the reintroduction)
              └─ added line    ──► prescribed_alternative   (the cure)
              β”‚
              └─► AB-<sha256(file, pattern)[:10] ──► .onyxsi/wiki/projects/<p>/ANTIBODIES.json

The antibody generates only after a successful commit. A rolled-back write leaves no rules behind for unmerged code. The generated antibody_id uses a deterministic SHA-256 hash, so committing an identical fix never creates duplicate entries.

3. Time-Travel Chronicle

wiki_task_sync op=replay renders two sections: an ASCII decision tree of all explored branches and a table logging the 64-event ring buffer (Frame, Relative Time, Branch, Action, Target, Outcome). Writes are atomic.


πŸ›οΈ Architecture & System Topology

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Layer 7 β€” MCP Daemon (server.py)                   β”‚
β”‚              JSON-RPC 2.0 over stdio Β· 8 fixed meta-tools                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Layer 4 β€” Headless Gateway & Shields                   β”‚
β”‚   Fixed 8 Meta-Tools Β· Grammar Shield Β· Stream Folder Β· Policy Gate      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚                       β”‚                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Layer 2 β€” ContextFS     β”‚ β”‚   Layer 3 β€” DeltaFS  β”‚ β”‚   Layer 5 β€” Causal   β”‚
β”‚  Bitplane AST Β· Piece Table  β”‚ β”‚  Ghost-CoW Overlay   β”‚ β”‚  4-Stage Flight     β”‚
β”‚  Token Governor Β· ref://     β”‚ β”‚  MCTS Branching      β”‚ β”‚  Error Budget Β· WAL  β”‚
β”‚  Virtual Handles             β”‚ β”‚  AST Lease & Merger  β”‚ β”‚  Antibody Vaccine   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚                       β”‚                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Layer 6 β€” Knowledge, Graph & Deterministic ALU            β”‚
β”‚     Project-Namespaced Task Wiki Β· CSR Graph + BM25 Β· Blast-Radius Runner   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Layer 1 β€” HAL: SHM Superblock Β· SPSC Ring Β· Radix Trie Β· Proc     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Layer 0 β€” Contracts & Error Codes (E0001 – E9004)               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The architecture consists of seven layers, verified at startup by the AST compliance auditor:

LayerModuleResponsibility
0onyxsi.contractsOnyxError / OnyxErrorCode (E0001–E9004) and the shared data contracts.
1onyxsi.hal64MB shared-memory superblock (POSIX /dev/shm + Windows tagged mmap), lock-free SPSC ring buffer, flat array('I') radix trie, process supervisor, syscall guard, sandbox enclave, non-blocking cross-process wakeup, telemetry ring.
2onyxsi.contextfsSWAR/DBP bitplane AST scanner and skeleton pruner, memoryview piece table with nano-checkpoints, token ceiling governor, ref:// virtual handle registry, workspace scanner.
3onyxsi.deltafsTier-0 Ghost-CoW overlay (now with MCTS branches), 4KB sparse page delta map with reflink + disk spillover to .onyxsi/spill/, granular AST node leases, conflict-free bottom-up patch merger.
4onyxsi.gatewayFixed 8 meta-tool router, deterministic JSON auto-repair shield, GBNF grammar exporter, macro pipeline fusion, stream folder, policy gate with secret masking.
5onyxsi.causal4-stage trajectory enforcer, 3-strike error budget, micro-WAL flight recorder, orthogonal hypothesis engine, in-RAM causal bisect, antibody memory with the auto-vaccine.
6onyxsi.knowledgeProject-namespaced task wiki, vectorless CSR graph + tuned BM25, blast-radius differential test runner, safe compute ALU.
7onyxsi.serverThe headless JSON-RPC 2.0 daemon and the MCP bridge.
OnyxSi/
β”œβ”€β”€ onyxsi-mcp.py                  # Zero-install UTF-8 MCP bridge
β”œβ”€β”€ onyxsi-mcp.sh                  # Linux/macOS launcher wrapper
β”œβ”€β”€ onyxsi-mcp.cmd                 # Windows batch launcher wrapper
β”œβ”€β”€ opencode.jsonc                 # OpenCode MCP server definition
β”œβ”€β”€ pyproject.toml                 # Build config (zero dependencies, MIT)
β”œβ”€β”€ src/onyxsi/
β”‚   β”œβ”€β”€ __init__.py                # Root facade exposing Layers 0-6
β”‚   β”œβ”€β”€ __main__.py                # python -m onyxsi entry point
β”‚   β”œβ”€β”€ server.py                  # JSON-RPC 2.0 stdio daemon
β”‚   β”œβ”€β”€ contracts.py               # OnyxError, OnyxErrorCode, path-segment sanitizer
β”‚   β”œβ”€β”€ auditor.py                 # AST zero-dependency & zero-UI auditor
β”‚   β”œβ”€β”€ hal/                       # Layer 1
β”‚   β”œβ”€β”€ contextfs/                 # Layer 2
β”‚   β”œβ”€β”€ deltafs/                   # Layer 3
β”‚   β”œβ”€β”€ gateway/                   # Layer 4
β”‚   β”œβ”€β”€ causal/                    # Layer 5
β”‚   └── knowledge/                 # Layer 6
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ run_tests.py               # Zero-dependency stdlib test runner
β”‚   β”œβ”€β”€ test_killer_features.py    # Namespacing / MCTS / vaccine / replay / dispatch
β”‚   β”œβ”€β”€ normal/                    # 45 spec-verification modules
β”‚   β”œβ”€β”€ street/                    # 11 chaos, fuzz and concurrency modules
β”‚   └── character/                 # 10 end-to-end scenario modules
β”œβ”€β”€ benchmarks/
β”‚   β”œβ”€β”€ bench_onyxsi.py            # Automated benchmark harness
β”‚   β”œβ”€β”€ recall_eval.py             # Labelled-corpus retrieval evaluator
β”‚   β”œβ”€β”€ BENCHMARKS.md              # Measured performance report
β”‚   └── results_v1.0.json          # Telemetry snapshot
└── md/                            # Architectural blueprints & phase specs

On-disk state

<workspace>/.onyxsi/
β”œβ”€β”€ leases/                                          # Cross-process AST leases
β”œβ”€β”€ spill/                                           # CoW workspace disk spillover
β”œβ”€β”€ FLIGHT_LOG.md                                    # Stage 4 commit trail
β”œβ”€β”€ CRASH_REPRO.md                                   # Written on a daemon crash
└── wiki/
    β”œβ”€β”€ ANTIBODIES.json                              # Legacy store (still read)
    └── projects/
        └── <project>/
            β”œβ”€β”€ ANTIBODIES.json                      # Project-scoped vaccine
            └── tasks/
                └── TASK-<ID>/
                    β”œβ”€β”€ TASK_SPEC.md
                    β”œβ”€β”€ PROGRESS.json
                    β”œβ”€β”€ PROGRESS.md
                    β”œβ”€β”€ EXECUTION_LOG.md
                    β”œβ”€β”€ AGENT_HANDOFF.md
                    └── TIME_TRAVEL_REPLAY.md

πŸ“Š Verification & Empirical Metrics

[!NOTE] Benchmark sources: Every metric below is drawn directly from benchmarks/results_v1.0.json, generated by running python benchmarks/bench_onyxsi.py on the test environment described below.

Telemetry MetricMeasuredCeilingStatus
Meta-tool schema footprint1,593 tokens≀ 1,800PASS
Output token ceiling1,250 tokens≀ 1,250PASS
Virtual handle resolvability (ref://)resolvabletruePASS
Bitplane AST scanner throughput35.98 MB/sβ‰₯ 20.0 MB/sPASS
Piece-table rollback latency (p95)0.0039 ms≀ 1.0 msPASS
Ghost overlay discard latency (p95, 25 files)3.26 ms≀ 5.0 msPASS
Blast-radius test selection (p95, 500 tests)0.625 ms≀ 5.0 msPASS
Causal bisect search latency (p95, 64 steps)0.0105 ms≀ 1,000 msPASS
Antibody check latency (p95)0.0051 ms≀ 5.0 msPASS
CSR + BM25 hybrid search (p95, 5,000 nodes)5.70 ms≀ 50.0 msPASS
JSON-RPC stdio round-trip (p95)0.52 ms≀ 50.0 msPASS
Held-out retrieval Hit@5 (150 queries)54.67%β‰₯ 50.0%PASS
Held-out retrieval Recall@5 (150 queries)39.11%β‰₯ 30.0%PASS

Measurement environment: Windows 11 Β· AMD64 Β· 8 logical CPUs Β· Python 3.15.0rc2 Β· benchmarks/results_v1.0.json (Updated 2026-10-21).

⚑ Multi-Runtime & Dual-OS Benchmark Comparison

Comparison across deployment environments tested on the same physical hardware:

Invariant / Telemetry MetricWindows 11 (Py 3.12.10)Windows 11 (Py 3.15.0rc2)WSL2 Ubuntu (Py 3.14.4)Target CeilingStatus
Bitplane AST Scanner Throughput26.54 MB/s35.98 MB/s43.29 MB/s$\ge$ 20.0 MB/sPASS
Piece-Table Rollback (p95)0.0054 ms0.0039 ms0.0031 ms$\le$ 1.0 msPASS
Ghost Overlay Discard (p95)3.27 ms3.26 ms0.33 ms$\le$ 5.0 msPASS
Blast-Radius Test Selection (p95)0.631 ms0.625 ms0.472 ms$\le$ 5.0 msPASS
Causal Bisect Latency (p95)0.0122 ms0.0105 ms0.0089 ms$\le$ 1,000 msPASS
Antibody Vaccine Check (p95)0.0049 ms0.0051 ms0.0045 ms$\le$ 5.0 msPASS
CSR Graph + BM25 Search (p95)6.47 ms5.70 ms5.94 ms$\le$ 50.0 msPASS
JSON-RPC stdio Round-Trip (p95)0.56 ms0.52 ms0.12 ms$\le$ 50.0 msPASS
Full Benchmark Suite Wall Clock1.76 s1.47 s1.74 sβ€”ALL PASS

[!IMPORTANT] Measurement details: The AST skeleton pruner reports the measured ratio (skeleton Γ· source = 0.683, roughly 32% smaller than original source files across the benchmark corpus) rather than theoretical estimates. Retrieval evaluations use held-out test data without docstring leakage. While indexing docstrings directly yields an artificial 100% Hit@5, held-out retrieval reflects actual search performance.

Test suite

# Full suite under pytest
python -m pytest -v

# Same suite, zero third-party dependencies
python tests/run_tests.py

# Reproduce the benchmark table
python benchmarks/bench_onyxsi.py
SuiteScope
tests/normal/ (45 modules)1:1 specification verification across every layer: superblock, SPSC ring, bitplane AST, piece table, ghost overlay, leases, merger, router, grammar shield, trajectory, error budget, hypothesis engine, bisect, antibody, task wiki, CSR+BM25, blast runner, ALU, daemon, MCP protocol.
tests/street/ (11 modules)Fuzzing: unclosed JSON brackets, circular DAG pipelines, lease races, concurrent writers, simulated power cuts during atomic writes, boundary conditions.
tests/character/ (10 modules)End-to-end personas: amnesiac handoffs, rapid single-byte patching, deep recursion bombs, hostile string manipulation, multi-agent swarms.
tests/test_killer_features.pyThe v1.0.0-PROD features: project namespacing, Time-Travel Chronicle, MCTS forking and merge, the auto-vaccine, and JSON-RPC dispatch.

Result: 669 tests passing, 0 failures. Verified on Windows (Python 3.12.10, Python 3.15.0rc2) and Ubuntu WSL2 (Python 3.14.4 / pytest 9.0.2).


πŸš€ Installation & Quick Start

Prerequisites: Python 3.11 or newer. Nothing else.

# Option 1 (zero install): run straight from the checkout
python onyxsi-mcp.py --workspace /path/to/your/project

# Option 2 (install as an editable package):
pip install -e .
onyxsi --workspace /path/to/your/project
# Linux / macOS
./onyxsi-mcp.sh --workspace /path/to/your/project

# Windows
onyxsi-mcp.cmd --workspace C:\path\to\your\project

β˜• Support & Sponsor

If OnyxSi is useful in your agent workflows or saves context tokens, consider supporting continued development:


πŸ“œ License

MIT license. See LICENSE. Copyright Β© 2026 xTanTHaix.

Deterministic, headless, and dependency-free by construction.

↑↓ navigate openesc close