Configuration
Titancore keeps configuration in a small repository created by the
LoadConfiguration bootstrapper. The repository provides framework-style
dotted access while the bootstrapper loads trusted YAML files from the
application's config/ directory. Python configuration is not loaded.
For example, config/app.yaml can contain:
name: Titancore application
debug: false
The application exposes that file as the app configuration group:
from titancore import Application
from titancore.foundation.bootstrap import default_bootstrappers
application = Application()
application.bootstrap_with(default_bootstrappers())
assert application["config"]("app.name") == "Titancore application"
assert application["config"].boolean("app.debug") is False
After bootstrap, the same repository is available through the thin
Config facade. Env provides the corresponding environment repository
facade:
from titancore.facades import Config, Env
assert Config.string("app.name") == "Titancore application"
assert Env.get("APP_ENV", "local") == "local"
Environment values are loaded separately by LoadEnvironmentVariables, which
creates and binds application["env"]. Configuration loading does not own
environment parsing or dependency resolution. The configured resolver receives
both repositories through the same application context as other providers.
Environment-aware files¶
For values that depend on the environment, use explicit YAML references:
name: !env [APP_NAME, My application]
debug: !env [APP_DEBUG, false]
workers: !env [APP_WORKERS, 8]
The environment bootstrap runs first. Process variables override dotenv values. Each reference reads that application's Env repository and falls back to its scalar default when absent. The default determines the resolved type: string, boolean, integer or float. A null default preserves the Env value. Invalid conversions fail bootstrap rather than silently changing the value.
Only .yaml files are discovered. Nested paths become dotted groups; empty
files produce empty groups and non-mapping roots fail. PyYAML's safe loader
rejects Python object tags. There is no expression evaluation, automatic
importing, implicit interpolation or configuration cache.
Keep model classes, seeders and callbacks in application wiring. Register these references in the application-owned repository after YAML bootstrap, before resolving their services. Configuration defaults stay in YAML.