LearnNewsExamplesServices
Frontmatter
id10035
titleGraph Integration & GapInferenceEngine Refactor
stateClosed
labels
enhancementaiarchitecture
assigneestobiu
createdAtApr 15, 2026, 11:57 PM
updatedAtApr 19, 2026, 12:26 PM
githubUrlhttps://github.com/neomjs/neo/issues/10035
authortobiu
commentsCount0
parentIssue10030
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[x] 10033 Concept Graph Unit Tests
blocking[x] 10036 Memory Core Concept Discovery & Glossary Enhancement
closedAtApr 19, 2026, 12:26 PM

Graph Integration & GapInferenceEngine Refactor

Closed v13.0.0/archive-v13-0-0-chunk-4 enhancementaiarchitecture
tobiu
tobiu commented on Apr 15, 2026, 11:57 PM

Objective

Ingest the standalone JSONL concept graph into the Native Edge Graph (SQLite) and refactor GapInferenceEngine to use deterministic concept traversal instead of regex token matching.

Context

Phase 3, Step 1 of the Concept Ontology epic (#10030). Depends on validated concept graph from Phase 1 (#10031, #10032, #10033) and visualization from Phase 2 (#10034).

Deliverables

1. DreamService Concept Ingestion

Add a new phase to DreamService (or a standalone ingestion script) that:

  1. Reads .neo-ai-data/concepts/nodes.jsonl → creates/updates CONCEPT nodes in SQLite graph
  2. Reads .neo-ai-data/concepts/edges.jsonl → creates typed edges (PARENT_CONCEPT, IMPLEMENTED_BY, EXPLAINED_BY, etc.)
  3. Runs during DreamService Phase 0 (before gap inference)
  4. Differential sync — only update changed concepts (hash comparison)

2. GapInferenceEngine Refactor

Replace the existing regex token matching in executeCapabilityGapInference() with graph traversal:

// OLD (fragile)
const hasGuide = guideFilePaths.some(p => nodeTokens.some(term => regex.test(p)));

// NEW (deterministic)
for (const concept of graphDb.getNodesByLabel('CONCEPT')) {
    const explanations = graphDb.getAdjacentNodes(concept.id, 'outbound', 'EXPLAINED_BY');
    if (explanations.length === 0 && concept.properties.weight >= threshold) {
        gaps.push({ type: 'GUIDE_GAP', concept: concept.name, weight: concept.properties.weight });
    }
}

3. Gap Types

  • GUIDE_GAP: Concept has IMPLEMENTED_BY but no EXPLAINED_BY (high priority)
  • EXAMPLE_GAP: Concept has EXPLAINED_BY but no EXEMPLIFIED_BY (medium priority)
  • ORPHAN_CONCEPT: Concept has no IMPLEMENTED_BY edges (possible dead concept, review needed)

4. Weight-Based Prioritization

Gap priority = concept.weight × (1 - coverage). High-weight concepts missing guides float to the top of Golden Path synthesis.

Acceptance Criteria

  • CONCEPT nodes visible in SQLite graph after DreamService run
  • All concept edges correctly wired
  • GapInferenceEngine uses graph traversal, not regex
  • Gap report priorities align with concept weights
  • Existing DreamService tests still pass

Origin Session ID: 496c0120-29aa-4b02-a804-d5a32ff6b5eb

tobiu added the enhancement label on Apr 15, 2026, 11:57 PM
tobiu added the ai label on Apr 15, 2026, 11:57 PM
tobiu added the architecture label on Apr 15, 2026, 11:57 PM
tobiu cross-referenced by #10036 on Apr 15, 2026, 11:58 PM
tobiu added parent issue #10030 on Apr 15, 2026, 11:58 PM
tobiu marked this issue as being blocked by #10033 on Apr 15, 2026, 11:58 PM
tobiu marked this issue as blocking #10036 on Apr 15, 2026, 11:58 PM
tobiu cross-referenced by #10037 on Apr 16, 2026, 12:12 AM
tobiu cross-referenced by PR #10078 on Apr 19, 2026, 10:28 AM
tobiu cross-referenced by #10079 on Apr 19, 2026, 11:43 AM
tobiu assigned to @tobiu on Apr 19, 2026, 11:55 AM
tobiu referenced in commit 184f3e6 - "feat(ai): add ConceptIngestor for JSONL concept graph ingestion as DreamService Phase 0 (#10035)" on Apr 19, 2026, 12:19 PM
tobiu referenced in commit 6d14e44 - "docs(ai): reframe ConceptIngestor differential-sync rationale to I/O throughput (#10035)" on Apr 19, 2026, 12:19 PM
tobiu referenced in commit 22d3d0d - "refactor(ai): GapInferenceEngine replaces regex+LLM guide verification with deterministic concept-graph traversal (#10035)" on Apr 19, 2026, 12:19 PM
tobiu referenced in commit 3411bb2 - "feat(ai): add EXAMPLE_GAP display section to sandman_handoff.md generation (#10035)" on Apr 19, 2026, 12:19 PM
tobiu referenced in commit 91722d5 - "test(ai): rewrite GUIDE_GAP test for concept-graph traversal + add EXAMPLE_GAP and low-weight-skip coverage; fix SQLite FK by seeding edge-target stub nodes (#10035)" on Apr 19, 2026, 12:19 PM
tobiu cross-referenced by PR #10084 on Apr 19, 2026, 12:20 PM
tobiu referenced in commit 2c949d6 - "feat(ai): refactor GapInferenceEngine to use concept-graph traversal + add ConceptIngestor Phase 0 (#10035) (#10084) on Apr 19, 2026, 12:26 PM
tobiu closed this issue on Apr 19, 2026, 12:26 PM
tobiu cross-referenced by #10085 on Apr 19, 2026, 12:31 PM
tobiu cross-referenced by #10086 on Apr 19, 2026, 12:31 PM
tobiu cross-referenced by #10087 on Apr 19, 2026, 12:31 PM
tobiu cross-referenced by #10030 on Apr 19, 2026, 12:33 PM
tobiu cross-referenced by PR #10100 on Apr 19, 2026, 4:17 PM
tobiu cross-referenced by PR #10101 on Apr 19, 2026, 4:59 PM
tobiu referenced in commit db5bdae - "feat(ai): config-lift guideGapWeightThreshold to aiConfig.data (#10086) on Apr 19, 2026, 5:19 PM
tobiu cross-referenced by PR #10102 on Apr 19, 2026, 5:20 PM
tobiu referenced in commit 45b6f63 - "feat(ai): config-lift guideGapWeightThreshold to aiConfig.data (#10086) (#10102) on Apr 19, 2026, 5:33 PM
tobiu cross-referenced by PR #10105 on Apr 19, 2026, 6:05 PM