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 leaf — ai/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.mjs — public 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
Related
Parent cluster: #12461. Epic: #12456. Authority: ADR 0019 (#12457).
Origin Session ID: 966c46fb-ad36-4e4c-88d6-899c4d18ed91
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 uniformaiConfig.sourcePaths?.<SourceName>pattern.The Problem (ADR 0019 §3 B3)
sourcePathsis an SSOT leaf —ai/mcp/server/knowledge-base/config.template.mjs:220(sourcePaths: leaf({…})), always present (the overlayconfig.mjsinherits it). SoaiConfig.sourcePaths?.Xis 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.Xacross 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.mjs— public external-workspace template; itsaiConfig.sourcePaths?.ProtoSource ?? 'proto'fallback is an intentional external default (custom-source authors). Left as-is.const X = aiConfig.sourcePaths.Y) — review-only, separate; this PR only removes the B3?..Decision Record impact
aligned-with ADR 0019.
Acceptance Criteria
aiConfig.sourcePaths.X(no?.on the guaranteed subtree).Related
Parent cluster: #12461. Epic: #12456. Authority: ADR 0019 (#12457).
Origin Session ID: 966c46fb-ad36-4e4c-88d6-899c4d18ed91