refactor: ECR-002 拆分 runtime 包并加深 analyze 契约(已审)

将 web/services/runtime.py 拆为 runtime/ 子模块并保持门面兼容;补齐 ESS 文档、门面/契约/TF_DF 测试与 CODE_REVIEW Approve。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-06 18:15:23 +08:00
co-authored by Cursor
parent 9f1e7361b6
commit df27b4dde8
33 changed files with 2029 additions and 1206 deletions
+23
View File
@@ -0,0 +1,23 @@
"""ECR-002TF_DF 全量 __init__ 冒烟(CODE_REVIEW ECR-001 Finding 5)。"""
from __future__ import annotations
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT))
from tests.generate_golden import make_ohlcv # noqa: E402
def test_tf_df_full_init_smoke():
from chanlun import TF_DF
df = make_ohlcv(400)
# interval=1:不重采样,走完整 init_TF_DF 流水线
tf = TF_DF(df, interval=1, timeframe="5m")
assert tf is not None
assert len(getattr(tf, "klu_list", []) or []) > 0
assert hasattr(tf, "bi_list")
assert hasattr(tf, "seg_list")
assert getattr(tf, "chanmacd", None) is not None