LearnNewsExamplesServices
Frontmatter
id9935
titleFix Cascading Graph Deletion Bug inside FileSystemIngestor
stateClosed
labels
bugai
assigneestobiu
createdAtApr 12, 2026, 7:36 PM
updatedAtApr 12, 2026, 7:43 PM
githubUrlhttps://github.com/neomjs/neo/issues/9935
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 12, 2026, 7:43 PM

Fix Cascading Graph Deletion Bug inside FileSystemIngestor

tobiu
tobiu commented on Apr 12, 2026, 7:36 PM

Bug Description

A critical regression caused ~50,000 structural graph nodes to be wiped from the memory-core.sqlite database natively due to a cascading deletion bug between the FileSystemIngestor edge assertions and the Vector Apoptosis loop in DreamService.

Root Cause

  1. Top-level files and directories generated by FileSystemIngestor lacked a root parentId, bypassing CONTAINS edge creation.
  2. DreamService's Vector Apoptosis process deletes unanchored (edge-less) nodes, therefore culling the workspace root nodes.
  3. On the next GC loop, SQLite edges referencing the now-culled root nodes were deleted to maintain referential integrity.
  4. Because FileSystemIngestor skips re-evaluating edges for files whose mtimeMs/hash have not changed (isUnchanged), the missing edges were never recreated.
  5. In the subsequent Apoptosis runs, the child nodes sequentially lost their physical anchors bottom-up and were annihilated natively.

Proposed Resolution

  • Anchor the workspace natively to a project-root (SYSTEM_ANCHOR) node, newly dubbed "Neo.mjs Ecosystem Root", so root structures always maintain edge-health validation natively inside the graph.
  • Relocate edge creation strictly outside the isUnchanged file-hashing check inside FileSystemIngestor.walkDirectory() so that topology drift is autonomously healed without requiring full MTime disk thrashing.
tobiu added the bug label on Apr 12, 2026, 7:36 PM
tobiu added the ai label on Apr 12, 2026, 7:36 PM
tobiu referenced in commit ff7904a - "fix(ai): Resolve cascading graph deletion bug in FileSystemIngestor (#9935)" on Apr 12, 2026, 7:36 PM
tobiu cross-referenced by PR #9936 on Apr 12, 2026, 7:37 PM
tobiu assigned to @tobiu on Apr 12, 2026, 7:40 PM
tobiu closed this issue on Apr 12, 2026, 7:43 PM
tobiu referenced in commit 6f3c9a4 - "fix(ai): Resolve cascading graph deletion bug in FileSystemIngestor (#9935) (#9936)" on Apr 12, 2026, 7:43 PM