| 1 | # dotenv.py DOX |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | - Own the `dotenv.py` helper module. |
| 6 | - This module loads and updates `.env` configuration values. |
| 7 | - Keep this file-level DOX profile synchronized with `dotenv.py` because this directory is intentionally flat. |
| 8 | |
| 9 | ## Ownership |
| 10 | |
| 11 | - `dotenv.py` owns the runtime implementation. |
| 12 | - `dotenv.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation. |
| 13 | - Top-level functions: |
| 14 | - `load_dotenv()` |
| 15 | - `get_dotenv_file_path()` |
| 16 | - `get_dotenv_value(key: str, default: Any=...)` |
| 17 | - `save_dotenv_value(key: str, value: str, reload_env: bool=...)` |
| 18 | - Notable constants/configuration names: `KEY_AUTH_LOGIN`, `KEY_AUTH_PASSWORD`, `KEY_RFC_PASSWORD`, `KEY_ROOT_PASSWORD`. |
| 19 | |
| 20 | ## Runtime Contracts |
| 21 | |
| 22 | - Helper modules own reusable framework APIs and must preserve public callers unless all callers, tests, and docs are updated together. |
| 23 | - Update this file whenever public functions, classes, persistence behavior, path/security assumptions, side effects, or cross-module contracts change. |
| 24 | - Observed side-effect areas: filesystem reads, filesystem writes, secret handling. |
| 25 | - Imported dependency areas include: `dotenv`, `files`, `os`, `re`, `typing`. |
| 26 | - `save_dotenv_value(..., reload_env=False)` updates the persisted file without changing the running process environment. |
| 27 | |
| 28 | ## Key Concepts |
| 29 | |
| 30 | - Important called helpers/classes observed in the source: `_load_dotenv`, `get_abs_path`, `os.getenv`, `get_dotenv_file_path`, `load_dotenv`, `os.path.isfile`, `f.readlines`, `f.seek`, `f.writelines`, `f.truncate`, `f.write`, `re.match`. |
| 31 | - Keep request/response, tool, or helper semantics documented here at the same time as source changes. |
| 32 | |
| 33 | ## Work Guidance |
| 34 | |
| 35 | - Preserve public helper APIs used by core code and plugins unless every caller is updated. |
| 36 | - Keep path, auth, secret, persistence, network, and subprocess behavior explicit and bounded. |
| 37 | - Prefer adding cohesive helper functions here only when behavior is reused across modules. |
| 38 | |
| 39 | ## Verification |
| 40 | |
| 41 | - Run targeted tests for changed helper behavior; run security regressions for auth, filesystem, WebSocket, tunnel, upload, or secret-handling helpers. |
| 42 | - Related tests observed by source search: |
| 43 | - `tests/email_parser_test.py` |
| 44 | - `tests/test_model_config_api_keys.py` |
| 45 | - `tests/test_timezone_regressions.py` |
| 46 | |
| 47 | ## Child DOX Index |
| 48 | |
| 49 | No child DOX files. |