LearnNewsExamplesServices
Frontmatter
id12139
titleKB + MC external-only + de-auto-trigger: orchestrator as single source of truth
stateClosed
labels
enhancementairefactoringarchitecture
assigneesneo-opus-ada
createdAtMay 28, 2026, 6:50 PM
updatedAtJun 7, 2026, 7:16 PM
githubUrlhttps://github.com/neomjs/neo/issues/12139
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 30, 2026, 6:10 PM

KB + MC external-only + de-auto-trigger: orchestrator as single source of truth

Closed v13.0.0/archive-v13-0-0-chunk-14 enhancementairefactoringarchitecture
neo-opus-ada
neo-opus-ada commented on May 28, 2026, 6:50 PM

Context

Post-unification (KB + MC share one orchestrator-owned Chroma daemon), both MCP servers still carry boot-time auto-trigger flags + managed-mode lifecycle surface that duplicate orchestrator responsibility. The orchestrator daemon already drives every one of these behaviors on its own schedule (per #12065): dream (1h), golden-path (1h), summary (10min), chroma (continuous + 24h recycle), kbSync, and FS-ingest (Phase 1 of the dream cycle). The MCP servers should be pure clients — no boot-time self-triggers, no managed-mode DB lifecycle, no autonomy tools the orchestrator owns.

Empirical smell: every SDK script (ai/services.mjs) and runSandman.mjs already hardcodes these flags to false defensively to prevent double-runs with the orchestrator. That "remember to disable it everywhere" tax is the signal — the flags are a redundant second source of truth.

Inventory (validated against source 2026-05-30)

Memory-Core auto-* flags — ai/mcp/server/memory-core/config.template.mjs

Flag Status Consumer Orchestrator SSOT
autoStartDatabase DEAD none (ai/services.mjs:64 override only) chroma task + recycle
autoStartInference DEAD none (ai/services.mjs:65) mlx/lms tasks
autoGoldenPath DEPRECATED no-op observability only (HealthService:454) golden-path task + event mutate_frontier
realTimeMemoryParsing DEPRECATED no-op MemoryService:348 (logs "skipped") parsing runs in dream cycle
autoSummarize ACTIVE-redundant SessionService:302,866 summary task
autoDream ACTIVE-redundant DreamService:128 dream task
autoIngestFileSystem ACTIVE-redundant GraphService:166 FS-ingest = Phase 1 of dream cycle

Knowledge-Base auto-* flags — ai/mcp/server/knowledge-base/config.template.mjs

Flag Status Consumer Orchestrator SSOT
autoStartDatabase DEAD none (ai/services.mjs:41 override only) chroma task + recycle
autoSync ACTIVE-redundant DatabaseService:557 kbSync task

MCP tools

Tool Action Why
manage_database (KB + MC) REMOVE orchestrator owns Chroma lifecycle; handler already no-op spawn
summarize_sessions (MC) REMOVE orchestrator summary task is the sole driver (operator directive 2026-05-30)
mutate_frontier (MC) KEEP agent-facing frontier-pivot primitive (operator directive 2026-05-30)

The Fix

  1. Delete all 9 boot-time auto-* config leaves (MC 7 + KB 2) + env bindings.
  2. Remove the boot-hook code consuming the ACTIVE flags: SessionService:302,866, DreamService:128, GraphService:166 (MC); DatabaseService:557 (KB autoSync). Remove the dead realTimeMemoryParsing if-block (MemoryService:348). The two DEAD autoStartDatabase flags + DEAD autoStartInference have no hook — leaf + override deletion only.
  3. Remove redundant MCP tools manage_database (both) + summarize_sessions (MC) — registration + handler/lifecycle methods. Keep mutate_frontier.
  4. Simplify HealthService (both): drop the auto-* observability block (MC HealthService:441-456) + the managed/strategy DB branching → external-only payload.
  5. Remove the now-meaningless defensive overrides: ai/services.mjs (KB:40,41; MC:63,64,65) + runSandman.mjs:98-100.
  6. (PR B) Collapse the managed-mode lifecycle: lifecycle services → readiness gate / inline into ChromaManager.connect; drop unused spawn imports / chromaProcess; simplify the two ChromaManagers (lifecycle coupling removed, distinct client logic retained).

Staging (2 PRs)

  • PR A — de-auto-trigger surface (mechanical): items 1-5. Pure removal; orchestrator already drives everything → no behavior lost. Low-risk.
  • PR B — external-only Chroma lifecycle (refactor): item 6.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback
9 auto-* config leaves (MC 7 + KB 2) server configs REMOVED — orchestrator sole trigger orchestrator dream/summary/golden-path/chroma/kbSync tasks
manage_database tool (KB+MC) toolService.mjs REMOVED orchestrator owns Chroma (handler already no-op)
summarize_sessions tool (MC) toolService.mjs REMOVED orchestrator summary task
mutate_frontier (MC) toolService.mjs KEPT n/a (agent primitive)
boot hooks (autoSummarize×2, autoDream, autoIngestFileSystem, realTimeMemoryParsing, KB autoSync) MC/KB services REMOVED orchestrator tasks
HealthService auto-*/managed block HealthService.mjs (both) external-only payload n/a

Acceptance Criteria

  • All 9 boot-time auto-* leaves removed (MC 7 + KB 2) + env bindings.
  • Boot-hook code removed (SessionService:302,866, DreamService:128, GraphService:166, KB DatabaseService:557) + dead realTimeMemoryParsing block.
  • manage_database (both) + summarize_sessions (MC) removed; mutate_frontier retained.
  • HealthService simplified (no auto-*/managed/strategy block; external-only).
  • Defensive …= false overrides removed (ai/services.mjs, runSandman.mjs).
  • Lifecycle services collapsed; ChromaManagers simplified (PR B).
  • Full unit suite green; orchestrator confirmed sole driver of each behavior.

Out of Scope

  • Orchestrator-side Chroma mechanisms (kill-dups PR #12137; recycle) — the supply side.
  • The orchestrator REM pipeline itself (#12065 — already built the replacements).

Decision Record impact

aligned-with ADR 0003 (unified Chroma topology) — establishes the orchestrator as the sole lifecycle + autonomy authority for KB + MC.

Related

  • #12065 (orchestrator REM pipeline — built the replacements)
  • #12133 (dual-daemon corruption — redundant managed-mode was a factor) · PR #12137 (kill-dups)

Scope expanded 2026-05-30 per operator directive (KB added; summarize_sessions removal confirmed; mutate_frontier confirmed keeper) + full source-validated inventory. Filed by @neo-opus-ada.

tobiu referenced in commit f768ec2 - "refactor(ai): remove MC+KB boot-time auto-* self-triggers + redundant MCP tools — orchestrator-SSOT (#12139 PR A) (#12197) on May 30, 2026, 4:51 PM
tobiu referenced in commit 2f3b952 - "feat(ai): extend retired-primitive guard to block re-adding orchestrator-owned config flags + MCP tools (#12198) (#12200) on May 30, 2026, 5:11 PM
tobiu closed this issue on May 30, 2026, 6:10 PM