Teknium
5820d0b0d5
refactor(gateway/config): extract the config.yaml phase to gateway/config_loader.py; table-driven from_dict; defensive collapse
...
- load_gateway_config (536 LOC) is now a thin orchestrator: legacy gateway.json
-> config_loader.load_yaml_layer -> GatewayConfig.from_dict -> env overrides
-> validation. The yaml phase lives in gateway/config_loader.py as small
functions driven by tables: _TOPLEVEL_BRIDGE (23 top-level/nested
gateway.<key> bridges with 5 fallback modes), _SHARED_KEYS (28 per-platform
keys copied into extra, with per-platform restrictions and transforms) and
_PORT_BRIDGE_KEYS. Logger name kept as "gateway.config".
- GatewayConfig.from_dict: shared pick()/key_label() helpers replace the
repeated "top-level key present else nested gateway.<key>" blocks; warning
order preserved.
- _normalize_unauthorized_dm_behavior / _normalize_notice_delivery unified into
_normalize_choice; _ensure_platform_extra_dict -> _dict_slot (also used by
persist_home_channel); _getenv_int removed (dead since the env pass moved to
config_env, which has its own _int_or).
- Platform._missing_: one _add_pseudo_member helper for both branches.
- Single warning sites in _coerce_optional_positive_int and
coerce_systemd_watchdog_seconds; _validate_gateway_config placeholder pass
flattened; small to_dict/getter collapses. Ruff F401/SIM102 clean.
- tests/hermes_cli/test_config_read_guard.py: allowlist gateway/config_loader.py
(same owner as gateway/config.py — the extracted load_gateway_config phase).
gateway/config.py 2684 -> 1319 LOC (-50.9%); largest function now
GatewayConfig.from_dict at 119 LOC. Resolved-config parity: 160 cells
(16 yaml fixtures x 10 env sets) byte-identical to the integration base,
including captured log records and stderr.
2026-09-02 16:48:36 -07:00
..
2026-08-31 12:36:33 -07:00
2026-09-02 05:32:20 -07:00
2026-09-01 22:42:27 +05:30
2026-08-22 23:25:29 -07:00
2026-08-29 18:01:25 -07:00
2026-08-31 12:05:07 -07:00
2026-08-31 11:19:05 -07:00
2026-08-23 20:00:53 -07:00
2026-08-24 03:22:57 -07:00
2026-08-22 23:25:43 -07:00
2026-08-16 06:29:53 -07:00
2026-08-29 18:34:35 -07:00
2026-08-16 22:06:24 -07:00
2026-08-21 13:01:35 -07:00
2026-08-20 01:47:06 -07:00
2026-09-01 16:01:53 -04:00
2026-08-16 06:25:46 -07:00
2026-08-22 19:30:10 -07:00
2026-09-02 15:03:42 -07:00
2026-09-01 16:01:53 -04:00
2026-08-16 06:32:08 -07:00
2026-08-29 18:13:33 -07:00
2026-09-01 16:01:53 -04:00
2026-08-29 07:25:17 -07:00
2026-08-28 02:59:17 -07:00
2026-09-01 16:01:53 -04:00
2026-09-01 16:01:53 -04:00
2026-09-01 16:01:53 -04:00
2026-08-16 06:31:26 -07:00
2026-08-21 15:23:51 -07:00
2026-08-24 15:42:58 +05:30
2026-09-01 00:26:55 +05:30
2026-08-16 01:52:00 -07:00
2026-08-26 11:41:04 -07:00
2026-08-26 11:41:04 -07:00
2026-08-31 12:58:14 -07:00
2026-08-23 02:14:35 -07:00
2026-09-02 13:29:45 -07:00
2026-08-15 00:36:03 -07:00
2026-08-20 04:08:57 -07:00
2026-08-16 11:34:40 -07:00
2026-08-31 12:18:47 -07:00
2026-09-02 06:19:03 -07:00
2026-09-01 07:00:22 -07:00
2026-09-02 16:48:36 -07:00
2026-08-27 11:49:58 +05:30
2026-08-16 22:18:04 -07:00
2026-09-02 00:07:15 -07:00
2026-09-02 06:16:54 -07:00
2026-08-27 13:27:24 +05:30
2026-09-02 05:34:28 -07:00
2026-09-01 16:01:53 -04:00
2026-08-19 19:22:48 -07:00
2026-09-02 20:51:07 +05:30
2026-08-31 03:37:43 -07:00
2026-09-03 01:57:09 +05:30
2026-09-01 08:31:37 -07:00
2026-09-02 06:27:24 -07:00
2026-08-31 10:00:29 -07:00
2026-08-15 00:32:53 -07:00
2026-08-31 06:02:32 -07:00
2026-09-02 00:56:52 -07:00
2026-09-02 04:53:59 -07:00
2026-08-23 21:12:20 -07:00
2026-08-29 19:14:15 -07:00
2026-08-24 15:45:52 +05:30
2026-08-20 20:21:12 -07:00
2026-08-18 14:26:16 -07:00
2026-09-01 01:39:59 -07:00
2026-09-01 11:47:38 +10:00
2026-08-27 10:35:22 -07:00
2026-08-23 16:09:14 -07:00
2026-08-31 15:57:21 +10:00
2026-08-23 15:49:44 -07:00
2026-09-01 11:47:38 +10:00
2026-08-21 22:33:45 +05:30
2026-08-26 07:57:04 -07:00
2026-08-26 04:03:21 -07:00
2026-08-23 19:55:17 -07:00
2026-08-28 05:27:15 -07:00
2026-08-19 19:24:41 -07:00
2026-08-24 03:14:30 -07:00
2026-09-02 06:53:20 -07:00
2026-08-22 21:36:44 -07:00
2026-09-01 16:01:53 -04:00
2026-08-17 02:56:17 -07:00
2026-08-17 14:02:07 +05:30
2026-09-02 06:17:25 -07:00
2026-09-01 10:56:49 -07:00
2026-08-15 03:54:07 -07:00
2026-08-22 13:39:04 -04:00
2026-08-22 13:38:56 -04:00
2026-08-31 03:37:43 -07:00
2026-08-15 03:54:07 -07:00
2026-09-02 20:51:07 +05:30
2026-09-02 09:57:39 -07:00
2026-09-02 06:06:47 -07:00
2026-08-23 05:12:59 -07:00
2026-08-26 16:14:32 -07:00
2026-08-15 18:15:13 -07:00
2026-08-21 14:13:28 +10:00
2026-08-16 01:54:35 -07:00
2026-08-16 02:01:15 -07:00
2026-09-01 11:43:36 -07:00
2026-09-02 06:36:16 -07:00
2026-08-21 03:51:03 -07:00
2026-09-02 13:30:50 -07:00
2026-08-27 20:39:11 +05:30
2026-09-01 10:06:06 -07:00
2026-08-16 06:26:12 -07:00
2026-09-02 13:31:44 -07:00
2026-08-31 12:21:46 -07:00
2026-08-26 16:45:22 -07:00
2026-08-15 00:36:03 -07:00
2026-08-21 02:48:14 +08:00
2026-08-18 16:08:29 -07:00
2026-09-02 05:32:01 -07:00
2026-09-02 06:53:20 -07:00
2026-08-19 19:42:31 -07:00
2026-09-01 16:01:53 -04:00
2026-08-19 16:10:01 -07:00
2026-08-25 21:59:52 -07:00
2026-08-30 19:46:14 -07:00
2026-08-21 14:38:41 -07:00
2026-08-19 23:28:14 -05:00
2026-08-27 11:31:21 -05:00
2026-08-27 17:45:43 -05:00
2026-08-18 11:58:48 -07:00
2026-08-27 19:07:15 +05:30
2026-09-02 05:32:01 -07:00
2026-08-17 14:16:21 +05:30
2026-09-01 10:52:42 -07:00
2026-08-17 14:16:21 +05:30
2026-09-02 05:32:10 -07:00
2026-08-28 22:38:01 -05:00
2026-08-16 21:56:30 -07:00
2026-09-01 22:42:27 +05:30
2026-08-15 00:36:03 -07:00
2026-08-23 03:55:14 -07:00
2026-09-01 22:09:24 -05:00
2026-09-01 02:32:39 -07:00
2026-08-18 14:26:16 -07:00
2026-09-01 16:01:53 -04:00
2026-09-01 16:01:53 -04:00
2026-09-01 16:01:53 -04:00
2026-09-01 16:01:53 -04:00
2026-09-01 16:01:53 -04:00
2026-09-01 16:01:53 -04:00
2026-09-01 16:01:53 -04:00
2026-09-02 15:03:42 -07:00
2026-09-01 16:01:53 -04:00
2026-09-01 16:01:53 -04:00
2026-09-02 15:03:42 -07:00
2026-09-01 16:01:53 -04:00
2026-09-02 05:32:01 -07:00
2026-08-26 06:26:07 -07:00
2026-08-28 09:05:19 +05:30
2026-09-02 15:03:42 -07:00
2026-08-31 12:50:29 -07:00
2026-09-01 16:01:53 -04:00
2026-08-26 09:54:31 -07:00
2026-08-25 04:21:37 -07:00
2026-08-26 17:42:58 -07:00
2026-08-26 15:48:39 -07:00
2026-08-26 15:48:39 -07:00
2026-08-17 12:58:51 -07:00
2026-09-02 15:03:42 -07:00
2026-08-31 10:59:45 -07:00
2026-08-31 04:40:24 -07:00
2026-08-15 00:34:29 -07:00
2026-09-02 06:16:54 -07:00
2026-09-01 12:07:35 -07:00
2026-08-21 14:38:19 -07:00
2026-08-31 04:40:24 -07:00
2026-08-27 11:31:21 -05:00
2026-08-17 12:58:51 -07:00
2026-09-02 05:33:33 -07:00
2026-09-02 15:03:42 -07:00
2026-09-02 15:03:42 -07:00
2026-08-29 20:39:44 +05:30
2026-09-01 07:00:22 -07:00
2026-09-02 10:33:43 -07:00
2026-09-02 10:22:30 -07:00
2026-09-02 15:03:42 -07:00
2026-09-01 16:37:36 -03:00
2026-09-01 16:34:48 -03:00
2026-08-19 23:28:14 -05:00
2026-09-01 10:56:49 -07:00
2026-08-19 19:41:52 -07:00
2026-08-29 05:02:54 -07:00
2026-09-02 15:03:42 -07:00
2026-08-31 11:19:26 -07:00
2026-08-23 00:52:50 -07:00
2026-08-31 01:04:11 -07:00
2026-08-15 00:32:44 -07:00
2026-09-02 15:03:42 -07:00
2026-08-23 04:45:29 -07:00
2026-09-02 06:59:11 -07:00
2026-08-31 08:41:15 -07:00
2026-09-02 13:31:44 -07:00
2026-08-16 22:08:37 -07:00
2026-08-31 00:56:41 -07:00
2026-08-19 08:52:03 -07:00
2026-09-02 07:00:13 -07:00
2026-08-16 11:34:40 -07:00
2026-08-20 04:30:33 -07:00
2026-09-01 16:35:47 -03:00
2026-08-20 04:47:38 -07:00
2026-08-18 02:27:18 -07:00
2026-09-02 15:03:42 -07:00
2026-09-01 01:00:23 -07:00
2026-09-01 22:42:19 -05:00
2026-09-02 15:03:42 -07:00
2026-08-15 00:33:11 -07:00
2026-08-21 00:24:32 -07:00
2026-08-27 11:31:21 -05:00
2026-08-21 00:24:32 -07:00
2026-09-03 01:56:32 +05:30
2026-09-01 10:12:21 -07:00
2026-08-20 01:46:20 -07:00
2026-08-15 14:24:35 -07:00
2026-08-23 01:47:26 -07:00
2026-08-19 23:28:14 -05:00
2026-08-25 02:45:10 -07:00
2026-09-02 13:29:48 -07:00
2026-08-17 15:47:17 -07:00
2026-09-01 07:00:38 -07:00
2026-08-20 04:50:39 -07:00
2026-09-02 00:42:53 -07:00
2026-09-01 09:27:47 -07:00
2026-08-29 20:29:04 +05:30
2026-09-01 16:01:53 -04:00
2026-09-01 16:01:53 -04:00
2026-08-28 02:04:54 -07:00
2026-09-01 22:42:27 +05:30
2026-08-21 14:38:41 -07:00
2026-09-01 01:30:09 -07:00
2026-09-02 15:03:42 -07:00
2026-08-28 05:15:06 -07:00
2026-09-02 06:19:08 -07:00
2026-08-16 02:14:35 -07:00
2026-08-27 17:11:56 +05:30
2026-09-01 07:00:54 -07:00
2026-08-20 12:37:16 -05:00
2026-08-15 02:04:49 -07:00
2026-08-31 12:08:30 -07:00
2026-09-01 22:42:19 -05:00
2026-08-31 14:40:09 -07:00
2026-08-27 02:17:56 -07:00
2026-08-15 00:55:20 -07:00
2026-09-02 00:00:55 -07:00
2026-08-15 02:04:49 -07:00
2026-08-16 01:55:25 -07:00
2026-08-20 02:06:05 -07:00
2026-08-16 22:09:17 -07:00
2026-09-02 06:19:03 -07:00
2026-08-29 18:23:07 -07:00
2026-08-24 15:45:52 +05:30
2026-08-24 15:45:52 +05:30
2026-08-27 10:42:31 +10:00
2026-09-02 13:29:29 -07:00
2026-08-27 13:30:25 +10:00
2026-08-27 09:47:47 +10:00
2026-08-26 15:39:47 +10:00
2026-08-27 13:30:25 +10:00
2026-08-28 15:22:16 +10:00
2026-08-28 15:22:16 +10:00
2026-08-27 09:09:47 +10:00
2026-08-22 19:30:10 -07:00
2026-08-23 05:12:59 -07:00
2026-08-19 01:23:17 +05:30
2026-08-19 10:19:35 -07:00
2026-08-20 02:58:31 +05:30
2026-08-20 02:58:31 +05:30
2026-09-01 10:12:21 -07:00
2026-08-26 07:03:04 -07:00
2026-08-31 10:41:54 -07:00
2026-09-01 12:07:35 -07:00
2026-08-24 03:20:37 -07:00
2026-09-02 15:03:42 -07:00
2026-09-01 10:56:49 -07:00
2026-08-16 01:54:35 -07:00
2026-08-19 16:10:01 -07:00
2026-08-20 03:05:46 -07:00
2026-09-02 13:29:44 -07:00
2026-08-31 10:41:54 -07:00
2026-09-02 15:05:48 -07:00
2026-08-29 20:51:17 +05:30
2026-08-15 18:15:18 -07:00
2026-08-24 15:45:52 +05:30
2026-09-02 06:17:10 -07:00
2026-09-01 10:56:49 -07:00
2026-08-31 10:08:31 -07:00
2026-08-24 03:20:37 -07:00
2026-08-15 00:36:03 -07:00
2026-08-25 12:09:08 -07:00
2026-09-01 16:01:53 -04:00
2026-08-22 23:10:32 -04:00
2026-09-02 13:30:54 -07:00
2026-09-02 01:50:21 +05:30
2026-09-01 07:01:12 -07:00
2026-09-02 12:34:26 -07:00
2026-08-26 16:45:31 -07:00
2026-08-31 10:41:54 -07:00
2026-09-01 08:27:58 -07:00
2026-08-26 17:42:50 -07:00
2026-08-26 11:41:04 -07:00
2026-09-01 08:34:51 -07:00
2026-09-01 08:27:58 -07:00
2026-08-31 12:58:14 -07:00
2026-09-02 12:34:26 -07:00
2026-09-02 13:30:54 -07:00
2026-08-26 18:23:33 -07:00
2026-09-02 00:42:53 -07:00
2026-08-16 10:51:50 -07:00
2026-08-23 04:25:18 -07:00
2026-08-20 04:14:42 -07:00
2026-09-01 08:27:58 -07:00
2026-08-24 03:21:28 -07:00
2026-08-17 23:53:05 -07:00
2026-09-01 00:26:55 +05:30
2026-08-23 04:45:29 -07:00
2026-08-23 04:45:29 -07:00
2026-08-25 14:10:10 -07:00
2026-08-25 14:10:10 -07:00
2026-08-31 10:41:54 -07:00
2026-08-21 15:23:49 -07:00
2026-08-23 00:50:41 -07:00
2026-09-01 07:00:54 -07:00
2026-09-01 07:00:54 -07:00
2026-08-15 13:28:14 -07:00
2026-09-02 13:30:54 -07:00
2026-09-01 07:00:54 -07:00
2026-08-22 19:30:10 -07:00
2026-08-20 03:43:00 -07:00
2026-08-20 12:41:33 -05:00
2026-09-01 08:27:58 -07:00
2026-09-01 07:00:54 -07:00
2026-08-20 05:02:36 -07:00
2026-08-23 02:16:33 -07:00
2026-09-02 01:52:11 +05:30
2026-08-28 13:33:56 -04:00
2026-08-31 12:00:33 -07:00
2026-08-31 10:04:40 -07:00
2026-08-16 22:07:09 -07:00
2026-09-02 00:07:17 -07:00
2026-08-27 21:07:34 +05:30
2026-08-21 22:08:16 -07:00
2026-08-21 22:08:16 -07:00
2026-08-21 19:11:55 -07:00
2026-08-31 13:11:54 -07:00
2026-08-19 16:10:01 -07:00
2026-08-15 01:05:39 -07:00
2026-08-29 18:34:35 -07:00
2026-09-03 01:56:47 +05:30
2026-09-03 01:56:47 +05:30
2026-08-16 11:34:40 -07:00
2026-08-19 01:23:39 -05:00
2026-08-30 22:19:06 -07:00
2026-08-29 19:19:40 -07:00
2026-08-26 21:38:20 -07:00
2026-08-15 01:53:34 -07:00
2026-08-15 00:37:00 -07:00
2026-08-16 20:32:09 -07:00
2026-08-16 20:53:44 -07:00
2026-08-23 19:55:17 -07:00
2026-09-01 12:07:00 -07:00
2026-08-15 00:32:53 -07:00
2026-08-24 03:21:49 -07:00
2026-09-01 21:43:59 -07:00
2026-09-01 22:42:19 -05:00
2026-08-16 01:59:58 -07:00
2026-08-26 16:45:31 -07:00
2026-09-01 11:43:36 -07:00
2026-08-22 13:38:56 -04:00
2026-09-02 13:30:54 -07:00
2026-08-20 01:45:56 -07:00
2026-08-19 23:55:20 -07:00