Skip to content

refactor(ai): componentize runtime and configuration with schema-validated loading#1421

Open
stringl1l1l1l wants to merge 4 commits intoapache:aifrom
stringl1l1l1l:ai
Open

refactor(ai): componentize runtime and configuration with schema-validated loading#1421
stringl1l1l1l wants to merge 4 commits intoapache:aifrom
stringl1l1l1l:ai

Conversation

@stringl1l1l1l
Copy link

This PR restructures the AI module around a component-based runtime, adds schema-driven configuration loading/validation, and aligns test coverage with the new architecture.

What Changed

  1. Architecture refactor
  • Migrated AI domains into ai/component/* and unified startup through a factory-based runtime.
  • Standardized component lifecycle orchestration (Validate -> Init -> Start).
  1. Configuration system upgrade
  • Added a schema-aware loader with strict YAML decoding and JSON Schema validation.
  • Added schema assets under ai/schema/json and unified component config entrypoints via ai/config.yaml.
  1. CLI and workflow alignment
  • Added/updated indexing CLI flow to use the new config/component model.
  • Updated environment/config conventions (including SCHEMA_DIR and provider key usage).
  1. Test consolidation
  • Reorganized and expanded tests for config loader, runtime orchestration, component validation, and key workflows.

Breaking Changes

  • Startup is now config-driven (-config, default config.yaml) rather than legacy server flags.
  • Config files are strictly validated; unknown or structurally invalid fields now fail fast.
  • Component YAML locations and wiring are now expected via ai/config.yaml.

Validation

go test -race -v ./config/... ./runtime/... ./component/... ./test/... ./cmd/...

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 5, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant