LearnNewsExamplesServices
Frontmatter
id12549
titleRemove KB/vector/graph AiConfig B3 defensive reads
stateClosed
labels
enhancementairefactoringarchitecture
assigneesneo-gpt
createdAtJun 4, 2026, 11:34 PM
updatedAtJun 7, 2026, 7:18 PM
githubUrlhttps://github.com/neomjs/neo/issues/12549
authorneo-gpt
commentsCount0
parentIssue12461
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 5, 2026, 3:51 AM

Remove KB/vector/graph AiConfig B3 defensive reads

Closed v13.0.0/archive-v13-0-0-chunk-16 enhancementairefactoringarchitecture
neo-gpt
neo-gpt commented on Jun 4, 2026, 11:34 PM

Context

This is the GPT-owned Cluster B follow-up under #12461 / #12456 after the operator flagged per-leaf B3 ticket proliferation as backlog friction.

Live coordination evidence:

  • PR #12547 is the agreed final already-open per-leaf exception and is approved/green at head 6f67fe05c.
  • @neo-opus-grace and @neo-opus-ada locked the two-cluster shape: no more per-leaf #12461 tickets.
  • Ownership lock: @neo-opus-ada owns Cluster A (memory-core + MCP/runtime); @neo-gpt owns Cluster B (KB/vector/graph/daemon); @neo-opus-grace reviews/closes/resolves.
  • This ticket was updated in place after the ownership lock landed, rather than creating another ticket, to preserve the backlog-friction correction.

V-B-A before filing/update:

  • origin/dev grep shows Cluster B candidates in KnowledgeBaseIngestionService, VectorService, SemanticGraphExtractor, TopologyInferenceEngine, and DreamService.
  • ai/mcp/server/knowledge-base/config.template.mjs declares defaultTenantId, defaultRepoSlug, defaultVisibility, logPath, and mcpSyncMaxChunks leaves.
  • ai/config.template.mjs declares graphProvider, provider subtrees, localModels.chat.*, and orchestrator.intervals.* leaves.
  • Exact GitHub searches for the earlier overlapping MCP runtime boundary returned no open issue/PR; after the ownership lock, MCP/runtime moved to Cluster A and this ticket now only covers the locked Cluster B files.

Problem

The KB/vector/graph/daemon cluster still contains consumer-side defensive reads and hidden defaults around AiConfig-owned leaves, including:

aiConfig.defaultTenantId || 'neo-shared'
aiConfig.defaultRepoSlug || 'neo'
aiConfig.defaultVisibility || 'team'
aiConfig.logPath || `${aiConfig.neoRootDir}/.neo-ai-data/logs`
aiConfig[graphProvider]?.model
aiConfig.remSleepBatchLimit || 10
aiConfig.summarizationBatchLimit || 2000

Under ADR 0019, resolved AiConfig leaves are the use-site source of truth. Consumers should read the Provider-resolved leaf directly when the template owns the default, and missing config shape should fail loudly instead of silently reintroducing local defaults.

Some candidates need validation rather than blind deletion. In particular, remSleepBatchLimit does not appear as a declared leaf in the current template grep, so implementation must either route that site to the correct existing leaf or prove it needs a template leaf before removing the fallback.

Architectural Reality

Cluster B is the non-MCP-runtime half of the remaining B3 sweep:

  • KnowledgeBaseIngestionService consumes Knowledge Base tenant/repo/visibility defaults.
  • VectorService consumes Knowledge Base logging and sync-volume config.
  • SemanticGraphExtractor and TopologyInferenceEngine consume graph-provider config.
  • DreamService consumes Memory Core / orchestrator REM batch limits.

These services are consumers of config leaves, not owners of local defaults. They should not re-implement defaults already declared in the template.

Fix

Update the Cluster B files in one PR:

  • ai/services/knowledge-base/KnowledgeBaseIngestionService.mjs
  • ai/services/knowledge-base/VectorService.mjs
  • ai/services/graph/SemanticGraphExtractor.mjs
  • ai/services/graph/TopologyInferenceEngine.mjs
  • ai/daemons/orchestrator/services/DreamService.mjs

For each candidate:

  • Replace defensive AiConfig reads with direct Provider-resolved leaf reads when the leaf exists.
  • Preserve meaningful payload fallbacks that are not AiConfig defaults, such as explicit request payload overrides.
  • Do not add local fallbacks, aliases, env reads, or subtree defenses.
  • If a current fallback corresponds to no declared leaf, either route it to an existing correct leaf or document/add the missing template leaf as part of this cluster.

Contract Ledger Applicability

Contract Ledger matrix is not required: this is a pure internal refactor of existing config consumers. It does not add, rename, remove, or deprecate an MCP tool, OpenAPI field, config key, CLI flag, env var, or public runtime contract unless implementation proves a missing leaf must be added.

Decision Record impact

Aligned with ADR 0019. The reactive Provider-backed AiConfig singleton remains the SSOT; this ticket removes consumer-side defensive reads and hidden defaults in the KB/vector/graph/daemon cluster.

Acceptance Criteria

  • Cluster B no longer contains B3 AiConfig defensive reads for template-owned leaves in the listed files.
  • KnowledgeBaseIngestionService keeps payload/request fallbacks but no longer re-defaults AiConfig-owned tenant/repo/visibility leaves.
  • VectorService no longer re-derives logPath when the template owns it.
  • Graph-provider model reads fail loudly if the selected provider subtree is missing.
  • DreamService batch-limit handling is resolved through declared config leaves or a documented missing-leaf fix.
  • No local env reads, aliases, or subtree defenses are introduced.
  • Focused KB/graph/daemon unit coverage or existing relevant unit suites pass.
  • Residue grep for the ticket's exact Cluster B patterns is clean.

Out of Scope

  • Cluster A memory-core + MCP/runtime work owned by @neo-opus-ada.
  • Open PR #12528 GitLab HealthService B3 work.
  • Open PR #12547 auth-only TransportService cleanup and its human merge.
  • Open PR #12532 memory-sharing work and any MemoryService.mjs overlap.
  • Logger.mjs, BaseServer.mjs, TransportService.mjs, SessionService.mjs, SummaryService.mjs, TextEmbeddingService.mjs, and CollectionProxy.mjs.

Related

Origin Session ID

dcdaac0b-9ae0-45b5-b4da-da39541af497

Retrieval Hint

KB vector graph daemon AiConfig B3 ADR 0019 cluster B

tobiu referenced in commit 9e4d3e2 - "fix(ai): remove KB graph B3 config defenses (#12549) (#12551) on Jun 5, 2026, 3:51 AM
tobiu closed this issue on Jun 5, 2026, 3:51 AM