LearnNewsExamplesServices
Frontmatter
id12538
titleB3 cleanup: ConceptDiscoveryService AiConfig defensive reads fail loud
stateClosed
labels
enhancementai
assigneesneo-gpt
createdAtJun 4, 2026, 10:11 PM
updatedAtJun 5, 2026, 3:48 AM
githubUrlhttps://github.com/neomjs/neo/issues/12538
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 5, 2026, 3:48 AM

B3 cleanup: ConceptDiscoveryService AiConfig defensive reads fail loud

neo-opus-ada
neo-opus-ada commented on Jun 4, 2026, 10:11 PM

Context

Sub of Epic #12461 (Eliminate B3 defensive reads of the AiConfig SSOT in production source). Authority: ADR 0019 (#12457). Continues the per-surface B3 cleanup after the KB-daemon (#12529 / PR #12530), GitLab (#12526 / PR #12528), ProtoSource (#12504), and orchestrator (#12515) legs. Lane surfaced by @neo-gpt's collision-aware [lanes-available] DM (graph/ingestion cluster, unclaimed).

The Problem

ai/services/ingestion/ConceptDiscoveryService.mjs defends SSOT-guaranteed AiConfig subtree reads with optional-chaining ?., masking fail-loud per ADR 0019 §3. V-B-A'd instances on dev (4):

  • L157 aiConfig.conceptDiscovery?.minSourceLength
  • L163-165 aiConfig.openAiCompatible?.{model, host, keep_alive}
  • L289 aiConfig.conceptDiscovery?.prScanLimit

The Fix

Per ADR 0019 §5: read the resolved leaf at the use site (aiConfig.conceptDiscovery.minSourceLength, aiConfig.openAiCompatible.model, …), letting it fail loud — the Provider SSOT guarantees the resolved subtree. The this.prScanLimit ?? aiConfig… explicit-override-else-SSOT pattern stays (compliant; not a hidden default).

Acceptance Criteria

  • All 4 aiConfig.*?. defensive reads in ConceptDiscoveryService.mjs read the resolved leaf directly.
  • No hidden-default ||/??-literal introduced.
  • Relevant unit spec(s) green.

Contract Ledger

Not required — pure internal refactoring under the existing ADR-0019 contract, no new or changed observable public surface (learn/agentos/contract-ledger.md trigger-exclusion: "pure refactoring that does not change the observable public shape"). Sibling B3 legs (#12529 → PR #12530) set this precedent. Stated explicitly per the contract-ledger pre-filing discipline.

Related

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

tobiu referenced in commit a815db5 - "fix(ai): remove ConceptDiscoveryService B3 defenses (#12538) (#12539) on Jun 5, 2026, 3:48 AM
tobiu closed this issue on Jun 5, 2026, 3:48 AM