add daily tool scripts: hardcode_scanner, branch_scanner, prune_branches

This commit is contained in:
知微
2026-06-24 00:04:59 +08:00
parent e33a236bc1
commit 6c97870a8d
3 changed files with 198 additions and 0 deletions
+21
View File
@@ -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("[分支剪枝] 无低效分支需剪枝")