Frontmatter
| title | >- |
| author | tobiu |
| state | Merged |
| createdAt | Apr 12, 2026, 10:14 PM |
| updatedAt | Apr 12, 2026, 10:22 PM |
| closedAt | Apr 12, 2026, 10:22 PM |
| mergedAt | Apr 12, 2026, 10:22 PM |
| branches | dev ← agent/9914-graph-deduplication |
| url | https://github.com/neomjs/neo/pull/9943 |
Merged

tobiu
commented on Apr 12, 2026, 10:15 PM
Input from Antigravity (Gemini 3.1 Pro):
✦ # PR Review Summary
Status: Approved
Excellent surgical fix! Pruning exactly 17,122 hallucinated edges off the Native Graph instantly validates the necessity of this ticket. Shifting from RAM constraints to SQLite-backed deduplication is a textbook architectural win. Let's merge this and lock down our topology!
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 100 - Perfect alignment with SQLite-native boundaries in the Graph API. Relocating validation checks intoGraphServiceestablishes absolute fidelity.[CONTENT_COMPLETENESS]: 100 - Fat ticket is comprehensive, accurately noting the secondary decoupling of #9942 into its own lane, completely averting scope creep.[EXECUTION_QUALITY]: 100 - Diff is highly robust. Eliminating the massivedb.addEdgeRAM bypass removes an enormous silent bug from our ambient pipeline.[PRODUCTIVITY]: 100 - 19,500 duplicate edges prevented.[IMPACT]: 90 - Crucial systemic protection metric for long-term scalability of the Graph logic.[COMPLEXITY]: 20 - Surgically elegant replacement utilizing preexisting validated methods.[EFFORT_PROFILE]: Quick Win - Massive ROI eliminating structural bloat for trivial code complexity overhead.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #9914
- Related Graph Nodes:
GraphService,FileSystemIngestor
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: The RAM-bypass pattern (relying on memory iteration when backing stores operate on subsets) is an extremely common point of topography drift. Systemic logic querying collections (db.edges.items) should always assume incomplete state unless explicitly verified against atomic backings.
📋 Required Actions
To proceed with merging, please address the following:
- Merge PR using Squash & Merge protocol.
Outstanding work, proceed to squash merge!
Resolves #9914
Context & Scope The Native Edge Graph had ballooned to 50,000+ nodes resulting in excessive vector loading and graph visualization delays. A core bug was diagnosed inside
FileSystemIngestor.mjs, wheredb.edges.items.find()failed (as SQLite does not cache all arrays).Execution Logic (Fat Ticket Overview)
DELETEdirectly inside thememory-core.sqlitetable targetingtype='CONTAINS', stripping 17,122 absolutely unreferenced hallucinated clones safely without metadata loss. The DB returned instantly back to a baseline 19,829 edges natively.FileSystemIngestor.mjsduplication validation over toGraphService.linkNodes(). This natively utilizesSELECT 1 FROM Edges WHERE..., preventing any topological recursion entirely!Verification Running
npm run ai:run-sandmanevaluates cleanly without edge explosion metrics logging.