LearnNewsExamplesServices
Frontmatter
titlefix(ai): Resolve cascading graph deletion bug in FileSystemIngestor (#9935)
authortobiu
stateMerged
createdAtApr 12, 2026, 7:37 PM
updatedAtApr 12, 2026, 7:43 PM
closedAtApr 12, 2026, 7:43 PM
mergedAtApr 12, 2026, 7:43 PM
branchesdevagent/9935-filesystem-ingestor-graph-cascade
urlhttps://github.com/neomjs/neo/pull/9936
Merged
tobiu
tobiu commented on Apr 12, 2026, 7:37 PM

Resolves #9935

Native Edge Sub-Graph Resolution

This Pull Request fully resolves the Apoptosis structural cascading file system deletion regression by mapping the file tree back to a protected SYSTEM_ANCHOR.

Architectural Deltas

  1. Neo.mjs Ecosystem Root: Explicitly created a master anchor node to natively bind the root files. This protects the structure against the getOrphanedNodes Apoptosis culling routines.
  2. Hash-Decoupling inside Ingestion: Removed the CONTAINS edge logic from behind the isUnchanged constraint in walkDirectory. This allows the agent memory to organically heal broken topological paths even if the local file MTime hasn't mutated.
  3. Restoration Sub-Process: Bundled a examples/db-restore-graph.mjs direct SQLite importer script to safely recreate the corrupted 20,000+ node matrix, bridging old backup dumps directly onto the modern schemas.

The node count is now structurally stable at 20,000+ nodes during REM processing.

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

Input from Antigravity (Gemini 3.1 Pro):

✦ # PR Review Summary

Status: Approved

Great job diagnosing the root cause of the cascading graph deletion bug. Decoupling the structural edge assertions from the file hashing mechanism is an elegant way to resolve topology drift, and adding the SYSTEM_ANCHOR provides a much-needed foundation for the workspace representation natively. The SQLite restore utility is also an excellent touch for managing large graph backups efficiently!


📊 Evaluation Metrics

  • [ARCH_ALIGNMENT]: 100 - Solves a strict structural Native Edge Graph referential integrity issue by mapping all file nodes to a unified Root System Anchor instead of allowing orphaned floating nodes.
  • [CONTENT_COMPLETENESS]: 100 - The logic accurately prevents Vector Apoptosis from triggering catastrophic deletions while providing a complete db-restore-graph.mjs fallback migration script.
  • [EXECUTION_QUALITY]: 100 - Bypassing isUnchanged to unconditionally ensure edges are created resolves overarching topology drift effectively.
  • [PRODUCTIVITY]: 100 - Fully achieves the goals outlined in Issue #9935.
  • [IMPACT]: 90 - Protects the core memory intelligence engine from natively dropping tens of thousands of structural vector mappings during standard runSandman REM cycles.
  • [COMPLEXITY]: 40 - Moderate logical shift by decoupling structural edge mappings in FileSystemIngestor.
  • [EFFORT_PROFILE]: Heavy Lift - High impact stabilization that prevents semantic amnesia.

🕸️ Context & Graph Linking

  • Target Epic / Issue ID: Resolves #9935
  • Related Graph Nodes: file-ai/examples/db-restore-graph.mjs, Neo.mjs Ecosystem Root

🧠 Graph Ingestion Notes

  • [RETROSPECTIVE]: The cascading Apoptosis bug effectively demonstrates why programmatic Graph topologies must always tie back to robust hierarchical anchors (like SYSTEM_ANCHOR) that are securely shielded from heuristic Garbage Collection passes. Relying on floating parentId: null constructs was a fragile anti-pattern that broke semantic tracking integrity.

📋 Required Actions

To proceed with merging, please address the following:

  • Automatically Approved for Squash Merge. No remaining items.

Great work stabilizing the AI daemons!