Configuration Service
The ConfigurationService loads, validates, and merges YAML configuration files sourced from the active profile’s configfile references. It exposes the merged result as a ConfigurationModel to controllers and services.
Load Order
Files are merged in order — later entries override earlier ones for the same key:
1. Platform defaults src/STRATA_platform/data/configuration.yaml
2. Numeric-prefixed config files from active profile (00-*.yaml → 99-*.yaml)
3. Deployment-level overrides (spec.overrides in deployment.yaml)
Numeric prefixes control merge order:
00-defaults.yaml
10-providers.yaml
20-topologies.yaml
30-validation.yaml
99-overrides.yaml
Repo Map
Before any @repo-name/path reference can be resolved, ConfigurationService.get_repo_map() must be called to build a mapping from repo name to local path. This map is passed to utils/system.py::resolve_path() whenever a cross-repo reference appears.
from strata.services.configuration_service import ConfigurationService
config_svc = ConfigurationService.load(work_path)
repo_map = config_svc.get_repo_map()
Two-Phase Validation
Phase |
What it checks |
|---|---|
Phase 1 (Pydantic) |
YAML structure, required fields, type constraints, enum values |
Phase 2 (dynamic) |
Cross-repo |
Phase 2 is triggered via _validate_dynamic(model, work_path) and requires a real filesystem and an active profile with resolved refs.
Caching
Services are singletons per path — BaseService.load(path) returns a cached instance if the same path has been loaded before. Call service_cache.clear() in tests to reset state between test cases.
Key Methods
Method |
Description |
|---|---|
|
Load and cache the service for the given workspace |
|
Return |
|
The validated |
|
True if Phase 1 or Phase 2 validation found errors |
|
List of accumulated error strings |
ConfigurationModel Fields
Defined in src/STRATA_platform/models/. Key fields:
Field |
Type |
Description |
|---|---|---|
|
|
Always |
|
|
Always |
|
|
Workspace-scoped identifier |
|
list |
Declared integration backends (bitwarden, vault, etc.) |
|
list |
Variable/secret/feature store definitions |
Example
from pathlib import Path
from strata.services.configuration_service import ConfigurationService
work_path = Path("/workspace")
config_svc = ConfigurationService.load(work_path)
if config_svc.has_errors():
for err in config_svc.get_errors():
print(err)
else:
repo_map = config_svc.get_repo_map()
print(repo_map)