LearnNewsExamplesServices
Frontmatter
id12467
titleB3 cleanup: KB source classes — drop redundant `?.` on the guaranteed sourcePaths SSOT subtree
stateClosed
labels
airefactoringarchitecture
assignees[]
createdAtJun 4, 2026, 3:34 AM
updatedAtJun 4, 2026, 3:59 AM
githubUrlhttps://github.com/neomjs/neo/issues/12467
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 4, 2026, 3:59 AM

B3 cleanup: KB source classes — drop redundant ?. on the guaranteed sourcePaths SSOT subtree

Closed v13.0.0/archive-v13-0-0-chunk-16 airefactoringarchitecture
neo-opus-ada
neo-opus-ada commented on Jun 4, 2026, 3:34 AM

Cluster-leaf of #12461 (B3 production read-side) under Epic #12456. Authority = ADR 0019 §3 B3. A well-scoped, V-B-A'd, read-side cleanup (no shared-substrate write risk).

Context

The Diamond-1 census (Epic #12456 comment IC_kwDODSospM8AAAABEz8AaQ) grouped B3 by file-cluster; the largest sub-cluster is the 11 KB Source classes with a uniform aiConfig.sourcePaths?.<SourceName> pattern.

The Problem (ADR 0019 §3 B3)

sourcePaths is an SSOT leafai/mcp/server/knowledge-base/config.template.mjs:220 (sourcePaths: leaf({…})), always present (the overlay config.mjs inherits it). So aiConfig.sourcePaths?.X is a defensive ?. on a guaranteed subtree — it masks fail-loud (B3). The Provider SSOT guarantees the tree; let it fail loud.

The Fix

Drop the ?.aiConfig.sourcePaths.X across the 11 classes. Behavior-equivalent (sourcePaths is always present, so the ?. never triggered) and fail-loud-correct per the SSOT contract.

Files (ai/services/knowledge-base/source/): TicketSource, TestSource, ApiSource, ConceptSource, RawRepoSource, PullRequestSource, LearningSource, ReleaseNotesSource, AdrSource, DiscussionSource, SkillSource.

Out of Scope

  • ai/examples/cloud-deployment/minimal-external-workspace/src/ProtoSource.mjspublic external-workspace template; its aiConfig.sourcePaths?.ProtoSource ?? 'proto' fallback is an intentional external default (custom-source authors). Left as-is.
  • B2 alias decisions (const X = aiConfig.sourcePaths.Y) — review-only, separate; this PR only removes the B3 ?..
  • Other B3 file-clusters (orchestrator, memory-core, …) — their own cluster PRs under #12461.

Decision Record impact

aligned-with ADR 0019.

Acceptance Criteria

  • All 11 KB source classes read aiConfig.sourcePaths.X (no ?. on the guaranteed subtree).
  • KB source specs green (behavior unchanged).

Related

Parent cluster: #12461. Epic: #12456. Authority: ADR 0019 (#12457).

Origin Session ID: 966c46fb-ad36-4e4c-88d6-899c4d18ed91

tobiu referenced in commit fbb633f - "refactor(agentos): drop redundant ?. on guaranteed sourcePaths SSOT in 11 KB source classes (#12467) (#12469) on Jun 4, 2026, 3:59 AM
tobiu closed this issue on Jun 4, 2026, 3:59 AM