The Problem
Sandman (DreamService) encountered a critical freeze event during the Vector Apoptosis routine (GraphService.getOrphanedNodes()). The Node.js event pool locked up, completely hanging the backend permanently without any console output or crashing.
Root Cause 1: SQLite Unindexed Left Join Deadlock
The initial SQL implementation relied on a dual-condition LEFT JOIN:
SELECT n.id, n.data
FROM Nodes n
LEFT JOIN Edges e ON n.id = e.source OR n.id = e.target
WHERE e.id IS NULL
SQLite foreign key constraints do not implicitly create child column indices. Compounded by an OR condition in the JOIN ON clause (which negates SQLite's query plan optimization), this query executed an unindexed Cartesian product $O(N \times M)$ scan. At the current Native Edge Graph scale, this generated ~25,000,000 string comparisons synchronously on the better-sqlite3 V8 thread, entirely deadlocking the MCP engine.
Root Cause 2: Chroma SDK Deserialization Noise
The mcp-server-memory-core stderr output was severely polluted with dynamic_text_embedding_service package resolution warnings resulting from Python ChromaDB schema deserialization mismatches.
The Solution
- Topological N-Query Optimization (
SQLite.mjs / GraphService.mjs):
- Rewrote the Vector Apoptosis extraction logic utilizing twin uncorrelated
NOT EXISTS subqueries to explicitly decouple the execution block and circumvent the Cartesian sweep.
- Surgically injected
CREATE INDEX IF NOT EXISTS natively into the WAL Initialization sequence (SQLite.mjs) targeting Edges(source) and Edges(target).
- MCP Terminal Suppression (
ChromaManager.mjs):
- Corrected the
console.warn suppression filter string interpolation to strictly mirror Chromium backend logging specifications (using underscoring: dummy_embedding_function).
Origin Session
Origin Session ID: af26000d-914a-4eb0-8d28-2c09e9cb4cb5
The Problem
Sandman (
DreamService) encountered a critical freeze event during theVector Apoptosisroutine (GraphService.getOrphanedNodes()). The Node.js event pool locked up, completely hanging the backend permanently without any console output or crashing.Root Cause 1: SQLite Unindexed Left Join Deadlock The initial SQL implementation relied on a dual-condition
LEFT JOIN:SELECT n.id, n.data FROM Nodes n LEFT JOIN Edges e ON n.id = e.source OR n.id = e.target WHERE e.id IS NULLSQLite foreign key constraints do not implicitly create child column indices. Compounded by an
ORcondition in theJOIN ONclause (which negates SQLite's query plan optimization), this query executed an unindexed Cartesian product $O(N \times M)$ scan. At the current Native Edge Graph scale, this generated ~25,000,000 string comparisons synchronously on thebetter-sqlite3V8 thread, entirely deadlocking the MCP engine.Root Cause 2: Chroma SDK Deserialization Noise The
mcp-server-memory-corestderr output was severely polluted withdynamic_text_embedding_servicepackage resolution warnings resulting from PythonChromaDBschema deserialization mismatches.The Solution
SQLite.mjs/GraphService.mjs):NOT EXISTSsubqueries to explicitly decouple the execution block and circumvent the Cartesian sweep.CREATE INDEX IF NOT EXISTSnatively into the WAL Initialization sequence (SQLite.mjs) targetingEdges(source)andEdges(target).ChromaManager.mjs):console.warnsuppression filter string interpolation to strictly mirror Chromium backend logging specifications (using underscoring:dummy_embedding_function).Origin Session
Origin Session ID: af26000d-914a-4eb0-8d28-2c09e9cb4cb5