add daily tool scripts: hardcode_scanner, branch_scanner, prune_branches
This commit is contained in:
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
prune_branches.py — 每周六凌晨6点执行
|
||||
|
||||
低效分支剪枝:
|
||||
- 触发≥5次且成功率<30% → 剪枝归档
|
||||
- 输出报告(stdout → cron delivery)
|
||||
"""
|
||||
import sys, json
|
||||
sys.path.insert(0, '/home/hmo/MoFin')
|
||||
from strategy_tree import prune_low_performance_branches
|
||||
|
||||
result = prune_low_performance_branches(min_triggers=5, min_success_rate=0.3)
|
||||
|
||||
if result:
|
||||
print(f"[分支剪枝] 已剪枝 {len(result)} 条低效分支:")
|
||||
for item in result:
|
||||
print(f" ✂ {item}")
|
||||
print("[分支剪枝] 剪枝完成")
|
||||
else:
|
||||
print("[分支剪枝] 无低效分支需剪枝")
|
||||
Reference in New Issue
Block a user