refactor(api): TOML 配置 SSOT、统一错误契约、Auth/事务加固与可观测性 (#33)
配置 SSOT(TOML + .env) 统一错误契约 Auth 与事务边界 Redis / Celery 可靠性:业务 Redis(DB/0)与 Celery broker/backend(DB/1)显式拆分;连接池、sync client 可观测性(OpenTelemetry + LGTM)
This commit is contained in:
23
api/tests/test_default_toml_legacy_parity.py
Normal file
23
api/tests/test_default_toml_legacy_parity.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""Guard: config/default.toml defaults stay aligned with pre-TOML Settings."""
|
||||
|
||||
from app.core.app_config_loader import default_config_dir, load_app_config
|
||||
|
||||
|
||||
def test_default_toml_matches_legacy_settings_defaults() -> None:
|
||||
cfg = load_app_config("development", config_dir=default_config_dir())
|
||||
|
||||
assert cfg.chat.interview_persona == "default"
|
||||
assert cfg.chat.interview_temperature == 0.93
|
||||
assert cfg.chat.memory_top_k == 8
|
||||
assert cfg.chat.memory_evidence_max_chars == 4096
|
||||
assert cfg.chat.reply_planner_llm_enabled is False
|
||||
|
||||
assert cfg.memoir.oral_normalize_mode == "rules"
|
||||
|
||||
assert cfg.story.image_min_body_chars == 400
|
||||
|
||||
assert cfg.asr.provider == "whisper"
|
||||
assert cfg.asr.device == "auto"
|
||||
assert cfg.asr.compute_type == "auto"
|
||||
|
||||
assert cfg.misc.tencent_sms_template_param_count == 2
|
||||
Reference in New Issue
Block a user