Files
MoFin/deploy/profile-scripts/evolution_daily.py
T

30 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
"""evolution_daily.py — 策略进化引擎 cron 入口(每周六 22:00hermes cron
放在 deploy/profile-scripts(硬链接进 cron scripts 目录),
内部调用 evolution/evolution_engine.py(真正逻辑所在,含单例守卫)。
设计依据:docs/decisions/2026-08-15-策略自我进化闭环重构.md
- 每周六 22:00 运行(策略评估 21:00 之后)
- 无退化/变体不达标 → 静默
- 达标变体 → strategy_evolution + XMPP 推送老莫(永不自动 promote)
"""
import subprocess, sys, os
REPO = "/home/hmo/MoFin"
ENGINE = f"{REPO}/evolution/evolution_engine.py"
PY = f"{REPO}/venv/bin/python"
def main():
if not os.path.exists(ENGINE):
print(f"evolution_engine.py 不存在: {ENGINE}", flush=True)
sys.exit(1)
# 单例守卫在 engine 内部(fcntl),这里直接调用
r = subprocess.run([PY, ENGINE], cwd=REPO, capture_output=False, timeout=3600)
sys.exit(r.returncode)
if __name__ == "__main__":
main()