LearnNewsExamplesServices
Frontmatter
id10013
title[Sub-Epic] DreamService Decomposition
stateClosed
labels
epicairefactoringarchitecture
assigneestobiu
createdAtApr 14, 2026, 6:43 PM
updatedAtMay 12, 2026, 4:10 AM
githubUrlhttps://github.com/neomjs/neo/issues/10013
authortobiu
commentsCount0
parentIssue9999
subIssues
10028 Finalize DreamService Decomposition: Tri-Vector & Topology Extractors
subIssuesCompleted1
subIssuesTotal1
blockedBy[]
blocking[x] 10014 [Sub-Epic] Macro Knowledge Base & Semantic Gap Inference
closedAtApr 15, 2026, 2:07 PM

[Sub-Epic] DreamService Decomposition

Closed v13.0.0/archive-v13-0-0-chunk-4 epicairefactoringarchitecture
tobiu
tobiu commented on Apr 14, 2026, 6:43 PM

Objective

Decompose the monolithic DreamService.mjs (~1400 lines) into a thin orchestrator backed by focused, independently testable services. This is a structural prerequisite for the Macro KB, Dynamic Topology, and Multi-Tenant Identity workstreams.

Rationale

DreamService currently owns file ingestion, tri-vector extraction, topological conflict detection, capability gap inference, garbage collection, issue/discussion/PR ingestion, and Golden Path synthesis. Adding Macro DB queries, federated ChromaClient routing, batching, and userId-scoped queries would push it past 2000 lines of mixed concerns.

Proposed Extraction

New Service Methods Extracted Responsibility
IssueIngestor ingestIssueStates(), ingestDiscussionStates(), ingestPullRequestFeedback() Structural ingestion of tickets, discussions, PRs into the Native Edge Graph
GapInferenceEngine executeCapabilityGapInference() Deterministic gap detection + future Macro DB vector distance queries
GoldenPathSynthesizer synthesizeGoldenPath() + scoring algebra Hybrid GraphRAG priority scoring and sandman_handoff.md generation
GraphMaintenanceService runGarbageCollection() Hebbian decay, orphan pruning, semantic edge management

DreamService itself becomes a ~200-line orchestrator sequencing these services through the REM pipeline phases.

Acceptance Criteria

  • Each extracted service extends Neo.core.Base with Neo.setupClass()
  • Each service has full JSDoc with @summary tags
  • DreamService orchestrator delegates to extracted services
  • All existing Playwright tests pass without modification
  • No behavioral change — pure structural refactor

Parent Epic: #9999 Origin Session ID: 69b726ca-97c8-406c-9106-c63b6642c4c0

tobiu added the epic label on Apr 14, 2026, 6:43 PM
tobiu added the ai label on Apr 14, 2026, 6:43 PM
tobiu added the refactoring label on Apr 14, 2026, 6:43 PM
tobiu added the architecture label on Apr 14, 2026, 6:43 PM
tobiu added parent issue #9999 on Apr 14, 2026, 6:43 PM
tobiu marked this issue as blocking #10014 on Apr 14, 2026, 6:44 PM
tobiu referenced in commit faea291 - "refactor: Decompose DreamService into modular services (#10013)" on Apr 15, 2026, 1:55 PM
tobiu cross-referenced by PR #10027 on Apr 15, 2026, 1:55 PM
tobiu referenced in commit 8473a76 - "refactor: Decompose DreamService into modular services (#10013) (#10027)" on Apr 15, 2026, 2:07 PM
tobiu closed this issue on Apr 15, 2026, 2:07 PM
tobiu added sub-issue #10028 on Apr 15, 2026, 2:18 PM
tobiu assigned to @tobiu on Apr 18, 2026, 5:22 PM
tobiu cross-referenced by #9748 on Apr 20, 2026, 1:13 PM