Skip to content

Crate Map

SYNAPSEED is a Cargo workspace with 15 library crates and 1 binary crate.

Overview

CrateDescriptionPriorityKey Dependencies
synapseed-coreShared types, traits, event bus, consistency oracletokio, serde, tracing
synapseed-cortexAST parsing & code graph50tree-sitter (Rust/Python/JS)
synapseed-huskDLP, secret detection & code pattern scanning10aho-corasick, regex
synapseed-rootCommand sandbox & sentinel20regex, synapseed-husk
synapseed-chronosGit history, temporal decay & convergence100git2 (libgit2)
synapseed-searchTantivy semantic search with embeddings160tantivy, fastembed
synapseed-shadow-checkBackground compiler150tokio (process)
synapseed-architectArchitecture analysis & health scoringpetgraph, synapseed-cortex
synapseed-gymCode evaluation sandbox & adversarial testingtempfile, synapseed-core
synapseed-janitorAutomated clippy & dependency cleanupsynapseed-core
synapseed-benchReproducible evaluation frameworksynapseed-whisper
synapseed-decompilerBinary analysis (ELF/Mach-O/PE)goblin
synapseed-whisperIntent router & orchestration999all subsystems
synapseed-telemetry-sinkOTLP gRPC receiver200tonic, prost, opentelemetry-proto
synapseed-mcpMCP protocol bridgeall subsystems
synapseed-cliBinary entry pointall crates, clap

Core (synapseed-core)

The foundation layer. Defines:

  • SynapsePlugin trait
  • SynapseContext (shared state + event bus)
  • SynapseEvent enum
  • ProjectDna configuration
  • ProjectState detection
  • ConsistencyOracle — cross-references workspace members, README, docs, and crate metadata
  • Telemetry initialization (with optional OTLP self-instrumentation)

Brain Layer

Cortex

Multi-language AST parsing via tree-sitter. Produces FileStructure and Symbol types. Supports Rust, Python, and JavaScript.

Builds a Tantivy full-text index over AST symbols. Indexes name, signature, doc comments, body content, and last_modified_epoch for concept-based search with temporal boost.

Security Layer

Husk

Ultra-fast DLP engine using Aho-Corasick for multi-pattern matching. Detects AWS keys, GitHub tokens, generic secrets, and private key markers. Also includes CodePatternScanner for static detection of SQL injection, XSS, command injection, and path traversal patterns.

Root

Command execution sandbox with regex-based whitelist/blacklist policies. Fail-closed by default.

Analysis Layer

Chronos

Git intelligence via libgit2. Provides blame, commit history, churn analysis with exponential temporal decay, co-change detection, semantic commit classification (fix/revert/refactor/security), convergence rate tracking, and rigidity metrics.

Shadow Check

Spawns cargo check --message-format=json in the background. Parses compiler output into structured diagnostics with quick-fix suggestions.

Infrastructure Layer

Telemetry Sink

gRPC server (tonic) implementing the OTLP TraceService. Receives spans, resolves code.file.path + code.line.number to source symbols, stores in a ring buffer (1000 spans).

Quality & Evaluation Layer

Architect

Structural health analysis via petgraph. Builds the module dependency graph, computes coupling metrics (Ce/Ca/Instability), topological density D = E / (V × (V − 1)), cycle detection, god object detection, and layer violation linting. Reports are cached in ReportStore.

Gym

Isolated Rust code evaluation sandbox. Compiles, tests, and benchmarks code in a tempdir. Includes the Saboteur adversarial mutation engine with 5 strategies (ArithmeticSwap, BooleanNegate, BoundaryShift, ReturnRemove, StatementDelete) for mutation testing.

Janitor

Automated maintenance: runs clippy scans and unused dependency detection. Generates fix proposals with UUIDs, supports dry-run preview, and auto-reverts on compilation failure.

Bench

Reproducible evaluation framework for measuring semantic understanding. Runs question suites (JSONL format), calculates F1 scores, SCR (Semantic Compression Ratio), SID (Semantic Information Density), and hallucination rates. Compares grounded vs. blind responses to quantify the value of SYNAPSEED context.

Decompiler

Binary analysis module for understanding compiled code. Supports ELF (Linux), Mach-O (macOS), and PE (Windows) formats. Extracts symbols, classifies strings (URLs, SQL, file paths), builds call graphs, and performs behavioral inference using heuristics. Uses the goblin crate for executable parsing.

Orchestration Layer

Whisper

Intent Router that classifies natural-language queries and orchestrates multiple subsystems in a single call. Reduces LLM roundtrips by providing enriched context objects including convergence rate, rigidity metrics, and SID (Semantic Information Density). Adapts output format based on model tier (Atomic/Molecular/Galactic) and session phase (Discovery/Implementation/Stabilization).

Bridge Layer

MCP

JSON-RPC 2.0 server over stdin/stdout. Exposes 25 tools, 13 resources, and 5 prompt templates. Handles initialization handshake with client fingerprinting (auto-detects model tier), momentum tracking, method routing, and error responses.

Released under the Apache License 2.0.