LearnNewsExamplesServices
Frontmatter
id12452
titleRename Neo.ai.BaseConfig → ConfigProvider (name it as the Neo.state.Provider it is; keep AiConfig)
stateClosed
labels
enhancementairefactoringarchitecture
assigneesneo-gpt
createdAtJun 3, 2026, 10:04 PM
updatedAtJun 5, 2026, 3:56 PM
githubUrlhttps://github.com/neomjs/neo/issues/12452
authorneo-claude-opus
commentsCount2
parentIssue12456
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 5, 2026, 3:56 PM

Rename Neo.ai.BaseConfig → ConfigProvider (name it as the Neo.state.Provider it is; keep AiConfig)

Closed Backlog/active-chunk-17 enhancementairefactoringarchitecture
neo-claude-opus
neo-claude-opus commented on Jun 3, 2026, 10:04 PM

Quick win surfaced by @tobiu (2026-06-03) during the #12420 AiConfig-SSOT brainstorm.

Why (not cosmetic)

ai/BaseConfig.mjs (Neo.ai.BaseConfig) extends Neo.state.Provider — it is a reactive hierarchical state provider (formulas, bindings, chain resolution, deep-merge overlays). "BaseConfig" reads as a passive config base / value-bag, which obscures that. That mis-frame is plausibly a contributor to #12420's -90: reviewers (me included) saw "BaseConfig + leaf defaults" and treated AiConfig as a value-bag to re-derive from, instead of a Provider to read and let resolve. A name that says what it is (ConfigProvider) is a category-error guard.

Scope (bounded)

  • Rename class Neo.ai.BaseConfig -> Neo.ai.ConfigProvider; git mv ai/BaseConfig.mjs ai/ConfigProvider.mjs; update className.
  • Update importers: the 4 config.template.mjs (Tier-1 + KB/MC/neural-link) + their overlays + specs (import BaseConfig, {createConfigProxy, leaf} from '.../BaseConfig.mjs').
  • Keep AiConfig (the Tier-1 singleton Neo.ai.Config) — only the base class renames (per @tobiu).
  • Verify the config + unit suites green.

Contract Ledger

Classification: T3 (Explicit Matrix) per learn/agentos/contract-ledger.md. Surface-Anchor V-B-A refreshed by @neo-gpt on 2026-06-05 against current source:

  • rg -n "BaseConfig|ConfigProvider|createConfigProxy|leaf\}" ai test/playwright/unit/ai learn/agentos -g "*.mjs" -g "*.md" confirms the live consumed surfaces: ai/BaseConfig.mjs, Tier-1/server config imports, config template specs, and docs/ADR references.
  • gh pr list --state all --search "BaseConfig ConfigProvider 12452" returns no existing PR.
  • ADR 0019 remains the current authority: BaseConfig extends Neo.state.Provider, leaf() owns env/default resolution, and createConfigProxy() is the consumer-facing proxy wrapper.
Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
ai/BaseConfig.mjs file path ADR 0019 + this ticket Rename to ai/ConfigProvider.mjs via git mv; update all live imports to the new file path. No compatibility shim unless explicitly justified; stale imports should fail during tests/grep. Update file-level JSDoc and docs links that point at the live primitive. rg residue check for ai/BaseConfig.mjs; focused config/template unit specs.
Neo.ai.BaseConfig class namespace ADR 0019 + ai/BaseConfig.mjs current className Rename class/config namespace to Neo.ai.ConfigProvider. Historical issue/PR archive references may remain out of scope; live docs/source should move to the new name. Update @class, @extends, log strings, and live docs that describe the primitive. rg residue check for Neo.ai.BaseConfig outside archived content; config-provider/config-template specs green after rename.
Default export consumed by config templates/overlays Current importers under ai/config*.mjs and ai/mcp/server/**/config*.mjs Keep default export behavior identical; only local symbol/file name changes to ConfigProvider. No consumer behavior change; child configs still extend the same Provider-backed primitive. Import statements and @extends docs updated consistently. Import/runtime smoke through config template specs.
Named export leaf ADR 0019 leaf contract + current named export Preserve named export and behavior unchanged. No rename of leaf; no new helper or duplicate env/default parser. Existing leaf() JSDoc remains or is updated only for class/file rename context. test/playwright/unit/ai/BaseConfig.spec.mjs coverage, renamed as appropriate, still proves leaf/env/type behavior.
Named export createConfigProxy Current config proxy contract + ADR 0019 hierarchical read model Preserve named export and proxy behavior unchanged. No consumer-facing proxy behavior change; direct reads still resolve via Provider hierarchy. Existing proxy JSDoc updated from BaseConfig wording to ConfigProvider wording. BaseConfig.spec.mjs / renamed spec proxy tests and config template specs remain green.
Live docs / decision records learn/agentos/AiConfigModel.md and ADR 0019 Update live explanatory docs to use ConfigProvider for the primitive while preserving historical context where it is explicitly about prior naming. Historical references to the old name in provenance sections can remain if clearly historical. Update live guidance links from ai/BaseConfig.mjs to ai/ConfigProvider.mjs. rg over learn/agentos plus review of ADR wording for historical-vs-current precision.
Test files Current test/playwright/unit/ai/** import surfaces Rename/update tests that import or describe BaseConfig; preserve behavioral assertions. No test-only alias masking stale imports. Test descriptions may use ConfigProvider while noting former BaseConfig only where useful. Focused unit command for config provider + config template specs; source residue grep.

Out of scope

  • The consumers-read-the-Provider redesign (the #12420 -90 fix — @neo-gpt's lane).
  • The rule-of-thumb ADR + the SSOT lint (brainstorm -> ideation-sandbox).

The rule of thumb this serves

AiConfig + its child providers are the single source of truth; consumers READ resolved leaves, never re-derive; derived values are formulas, never imperative cascades.

Origin: @tobiu-surfaced, session e886ae3e-13c0-4a94-9713-f8316e2342d0. Lane: @neo-claude-opus.

tobiu referenced in commit 3573b01 - "refactor(ai): rename BaseConfig to ConfigProvider (#12452) (#12564)" on Jun 5, 2026, 3:56 PM
tobiu closed this issue on Jun 5, 2026, 3:56 PM