LearnNewsExamplesServices
Frontmatter
titlefix(ai): Protect structural graph nodes from Vector Apoptosis
authortobiu
stateMerged
createdAtApr 12, 2026, 9:20 PM
updatedAtApr 12, 2026, 9:24 PM
closedAtApr 12, 2026, 9:20 PM
mergedAtApr 12, 2026, 9:20 PM
branchesdevagent/9912-vector-apoptosis-protection
urlhttps://github.com/neomjs/neo/pull/9941
Merged
tobiu
tobiu commented on Apr 12, 2026, 9:20 PM

Resolves #9912

Fat Ticket Summary

This PR fixes the root cause of DreamService inexplicably re-embedding 100% of OPEN issues and discussions natively during its run. While originally suspected to be an sqlite-vec metadata serialization regression, investigation revealed it was an intentional, yet overly broad, side effect of the Vector Apoptosis garbage collection loop inside GraphService.mjs.

GraphService.getOrphanedNodes() was configured to return any node completely devoid of edges. Because raw unstructured ISSUE and DISCUSSION nodes inherently lack topology links upon basic entry, the Apoptosis engine classified all of them as orphaned. This spawned local deletion in the native engine and a cross-layer purge in ChromaDB, which actively destroyed all hashes. 15 seconds later, ingestIssueStates would recreate and thus re-embed them entirely.

By explicitly protecting ISSUE, DISCUSSION, and PULL_REQUEST from the Apoptosis filter natively, their baseline metadata hashes correctly persist in Chroma, allowing the exMeta.hash === contentHash evaluation to short-circuit redundantly slow LLM embedding transactions natively.

Origin Session ID: e4f479f7-1d8c-4e4d-ae35-3e9dd732c5e5

tobiu
tobiu commented on Apr 12, 2026, 9:24 PM

Input from Antigravity (Gemini 3.1 Pro):

✦ # PR Review Summary

Status: Approved

Excellent investigative work identifying the root cause of the Vector Apoptosis wipe instead of falling for the sqlite-vec serialization red herring.


📊 Evaluation Metrics

  • [ARCH_ALIGNMENT]: 100 - Correctly integrates with existing Memory Core graph service schema requirements without refactoring logic unnecessarily.
  • [CONTENT_COMPLETENESS]: 100 - Solves the exact token burnout problem documented.
  • [EXECUTION_QUALITY]: 100 - Safely whitelists structural nodes without disabling apoptosis.
  • [PRODUCTIVITY]: 100 - The primary goals and hidden root causes were eliminated entirely.
  • [IMPACT]: 85 - High impact on lowering LLM token consumption and runtime of the daemon.
  • [COMPLEXITY]: 20 - Extremely precise and low-complexity file touchpoints.
  • [EFFORT_PROFILE]: Quick Win - Very low complexity with immensely high ROI on token savings.

🕸️ Context & Graph Linking

  • Target Epic / Issue ID: Resolves #9912
  • Related Graph Nodes: agent-dispatcher, memory-core-apoptosis

🧠 Graph Ingestion Notes

  • [KB_GAP]: The concept of "orphaned" nodes was misunderstood; system anchor nodes like issues and discussions inherently do not possess edges on raw ingestion and need strict whitelisting. This establishes a structural knowledge gap that was patched.
  • [TOOLING_GAP]: Local markdown file modification must be mirrored to remote ticket state natively via API (or via `gh`) instead of manually editing `.md` files directly to avoid sync degradation.
  • [RETROSPECTIVE]: The bug was inherently caused by the system running too correctly (i.e. garbage collection doing exactly what it was programmed to do unmitigated by type). Great catch natively checking the database execution layer.

📋 Required Actions

To proceed with merging, please address the following:

  • Merge execution completed.