Work with configuration
Use configuration when you need to project configuration and settings management.
Prerequisites
- Access to the project source code
- Familiarity with the files under src/attune/config/**
Steps
-
Understand the current behavior. Read the entry points to see what configuration does today before making changes. The primary functions are:
get_attune_env()insrc/attune/config/env_compat.py— Get an environment variable, checking ATTUNE_ first then EMPATHY_ fallback.iter_attune_env_prefix()insrc/attune/config/env_compat.py— Yield (middle_part, value) for env vars matching ATTUNE_{prefix}*{suffix}.get_loader()insrc/attune/config/loader.py— Get the global ConfigLoader instance.load_unified_config()insrc/attune/config/loader.py— Convenience function to load unified configuration.save_unified_config()insrc/attune/config/loader.py— Convenience function to save unified configuration.
-
Locate the right function to change. Each function has a single responsibility. Read its docstring, parameters, and return type to confirm it owns the behavior you need to modify.
-
Make your change. Follow existing patterns in the file — naming conventions, error handling style, and logging.
-
Run the related tests. This catches regressions before they reach other developers. Target with
pytest -k "configuration".
Key files
src/attune/config/**
Common modifications
Functions you are most likely to modify:
get_attune_env()insrc/attune/config/env_compat.pyiter_attune_env_prefix()insrc/attune/config/env_compat.pyget_loader()insrc/attune/config/loader.pyload_unified_config()insrc/attune/config/loader.pysave_unified_config()insrc/attune/config/loader.pyvalidate_config()insrc/attune/config/validation.pyget_config()insrc/attune/config/xml_config.pyset_config()insrc/attune/config/xml_config.py