Commit Graph
100 Commits
Author SHA1 Message Date
知微 da4112b430 feat: db_recovery.py——malformed事件DB恢复工具(知微) 2026-07-21 17:31:45 +08:00
知微 a0815bb39b Merge branch 'session-work' 2026-07-21 13:48:55 +08:00
知微 a245c8b4dd fix: price_monitor crash when shares is string + type guard in write_holding_strategy
Root cause: holding_strategies.shares field got set to literal string
'write_holding_strategy' for 6 records, causing TypeError at
price_monitor.py line 611 ('>' not supported between str and int).

Fixes:
1. price_monitor.py: Replace set comprehension with safe loop that
   checks isinstance before comparison. Non-numeric shares treated
   as holdings for safety.
2. mofin_db.py write_holding_strategy: Add type guard that resets
   non-numeric shares to 0 with warning.
3. Data fix: Updated 5 corrupted holding_strategies records from
   holdings table (300035/300308/300750/518880/00700).
   Set 002594 (watchlist) shares=0.
2026-07-21 13:47:52 +08:00
知微 91885f7623 Merge branch 'session-work' 2026-07-21 13:47:31 +08:00
知微 34337fc5b7 clean: 移除早上健康检查/系统审计中的小果残留引用(二次提交—deploy guard恢复旧版后重新应用) 2026-07-21 12:05:43 +08:00
知微 9d3cab2306 clean: 移除盘中自检/早上健康检查/系统审计中的小果残留引用 2026-07-21 12:03:21 +08:00
知微 945941d3d0 fix: 同步scripts/intraday_health_check.py——移除小果残留(与deploy/profile-scripts一致,硬链共享inode)
84d72dfd 只修了 deploy/profile-scripts/ 版本,但 git 里 scripts/ 版本仍是
旧代码(含check_xiaoguo/8645端口/小果Bot/小果信号堆积)。两个文件硬链共享
inode,deploy_guard 检测到 scripts/ 版漂移就 git checkout -- 回滚旧版,
连带覆盖 deploy/profile-scripts/ 版的修复,导致盘中自检持续误报。

同步提交后 deploy_guard 不再回滚。
2026-07-21 11:58:34 +08:00
知微 a782a83953 sync: price_monitor SIGALRM fix to scripts/ (legacy location) 2026-07-21 11:31:44 +08:00
知微 c180129a1a fix: add SIGALRM 120s hard timeout to price_monitor lock
price_monitor.py 进程锁无硬超时,LLM策略重评耗时9-10分钟时
锁文件阻止后续*/2 cron执行,造成10分钟监控盲区。

新增:
- _handle_sigalrm: SIGALRM处理器,自动清理锁后退出
- signal.alarm(120): 获锁后设120s硬上限
- signal.alarm(0): 正常完成时取消定时器
2026-07-21 11:29:06 +08:00
知微 f6d10a41af Merge branch 'session-work'
# Conflicts:
#	deploy/profile-scripts/intraday_health_check.py
2026-07-21 10:43:41 +08:00
知微 84d72dfd85 fix: intraday_health_check移除小果残留——check_xiaoguo/8645端口/小果bot/小果信号堆积
小果已全线归档(2026-07-20 Xiaoxiao重构)。盘中自检脚本仍残留:
- check_xiaoguo()函数
- 小果XMPP Bot离线检测
- 8645端口检测
- xiaoguo信号堆积检查(含import socket)
- main()中check_xiaoguo()调用

全部移除,匹配已修复的运行版本。
2026-07-21 09:46:43 +08:00
知微 0e13b3edda merge: reassess timeout + zone sanity gate 2026-07-20 22:05:05 +08:00
知微 90f07b4eba chore: sync 2026-07-20 22:05:03 +08:00
知微 8d6082f0c2 merge: ocr pipeline fixes 2026-07-20 21:43:04 +08:00
知微 3eb214f3a6 chore: sync 2026-07-20 21:43:03 +08:00
知微 c01c6cd266 merge: dev-spec v2.1 numbering fix 2026-07-20 21:21:27 +08:00
知微 2b79c1dc44 chore: sync 2026-07-20 21:21:25 +08:00
知微 5ab63b5c9d merge: zhiwei reply doc 2026-07-20 20:57:24 +08:00
知微 ad6a416ef4 merge: watchdog agent.log check 2026-07-20 20:56:05 +08:00
知微 c971d6bced chore: watchdog fix 2026-07-20 20:55:34 +08:00
知微 e5b0335f93 merge: zhiwei briefing doc 2026-07-20 20:37:21 +08:00
知微 dae60bb92f chore: sync before briefing merge 2026-07-20 20:37:20 +08:00
知微 86a93d30e6 merge: deploy-time auto hardlink repair 2026-07-20 20:27:17 +08:00
知微 9f7198dc9c chore: deploy pipeline auto-sync 2026-07-20 20:27:15 +08:00
知微 e69109fde9 merge: L0-L4 self-check architecture 2026-07-20 19:40:24 +08:00
知微 135bfced5a chore: deployed L0-L4 self-check system 2026-07-20 19:40:23 +08:00
知微 c545a82023 merge: hygiene enforcement + full cleanup 2026-07-20 19:05:08 +08:00
知微 54c48dc5d7 chore: deployed cleanup + hygiene system 2026-07-20 19:05:03 +08:00
知微 7f3ff66be4 merge: retire price_events.json 2026-07-20 18:10:40 +08:00
知微 4383c384be chore: deployed JSON retirement 2026-07-20 18:10:35 +08:00
知微 73520464b6 merge: price_events DB unification 2026-07-20 17:48:27 +08:00
知微 d28a32e244 chore: deployed price_events dual-write 2026-07-20 17:47:29 +08:00
知微 c02caeb1da merge: pipeline fixes + false-alarm cleanup 2026-07-20 17:32:13 +08:00
知微 c31736a38d chore: deployed pipeline fixes 2026-07-20 17:31:48 +08:00
知微 5d3b8e6fdd chore: capture deployed state 2026-07-20 17:30:43 +08:00
知微 4dcfee8140 merge: session work — 12-dim pipeline + all session fixes 2026-07-20 08:52:42 +08:00
知微 f946728b7d chore: latest batch_reassess/premarket (HK fix, 3600s timeout) 2026-07-20 08:51:31 +08:00
知微 0190c02064 chore: capture live morning state before session merge 2026-07-20 08:50:29 +08:00
知微 b5dade3b65 docs: 记录 XMPP bot 递归重连修复到 CHANGELOG 和 knowledge-log 2026-07-19 21:00:54 +08:00
知微 e366a6359a fix(bot): 防递归重连 guard - 防止 on_disconnect → reconnect → disconnect 无限递归导致栈溢出 2026-07-19 20:59:18 +08:00
知微 81c6dd2314 fix: 移除deploy/profile-scripts中错放的bot文件 2026-07-17 23:13:03 +08:00
知微 80d59c9331 feat: 统一部署目录——所有运行时文件归入MoFin repo
- deploy/bot/ — XMPP bot核心(xmpp_agent_core + xmpp_zhiwei_bot)
- deploy/profile-scripts/ — cron脚本(price_monitor等)
- 运行时文件已替换为指向MoFin的符号链接
- 改代码只需改MoFin,系统自动生效
2026-07-17 23:12:35 +08:00
知微 ab74188915 chore: 移除已跟踪的pycache文件(已加入gitignore) 2026-07-17 23:09:18 +08:00
知微 90966c63ca chore: 同步运行版本与git一致
- strategy_lifecycle.py: GATE_9D_ANALYSIS → GATE_12D_ANALYSIS(12维交叉验证)
- system_audit.py: 审计策略评估改用holding_strategies.updated_at
- CHANGELOG.md + analyst-knowledge-log.md 日常更新
2026-07-17 23:08:11 +08:00
知微 b4a5020cf5 fix: 暴跌告警仅持仓触发 + 状态立即持久化防重复推送 2026-07-14 15:33:35 +08:00
知微 2c0d6ff587 fix: Gateway看门狗v2 — 新增session健康检查,卡死自动重启 2026-07-14 15:00:56 +08:00
知微 c9ae1e143b fix: cron_to_xmpp取最后一个Response节防误判(parts[1]→parts[-1]) 2026-07-14 12:14:08 +08:00
知微 377bb4d1e4 price_monitor: 5min regenerate_all冷却 + 跳过冗余全量重评 2026-07-14 11:48:34 +08:00
知微 d972553b6e fix: divergence_detector 改用新浪API直接获取指数数据(原mo_data不支持指数代码) 2026-07-14 11:08:07 +08:00
知微 136f3f9fb8 sync scripts/mofin_db.py with root + knowledge log 2026-07-14 11:01:59 +08:00
知微 59e94d135c fix: 盘中脚本统一使用get_conn()替代raw sqlite3.connect防DB死锁
- mofin_health.py, cron_health_monitor.py, intraday_health_check.py,
  self_todo_executor.py: 替换raw sqlite3.connect() → get_conn()
  统一使用WAL模式+busy_timeout=30s连接
- mofin_db.py: get_conn()每次新建连接时WAL checkpoint
  防止被kill进程残留WAL导致后续全部卡死
- 并发测试验证: 3x price_monitor + 3x mofin_health同时运行
  6/6通过,WAL仅32bytes

关联问题: 2026-07-14 SQLite写锁死锁根因诊断
2026-07-14 10:56:38 +08:00
知微 3ee3d9ba6c fix: price_monitor添加os.nice(10)降低优先级减少DB竞争 2026-07-14 10:47:58 +08:00
知微 93dce81413 fix: price_monitor DB写锁死锁根治 + mofin_db.py reassessed_at同步
1. price_monitor.py: 统一BEGIN IMMEDIATE包裹所有DB写操作,
   5次重试+指数退避(1→2→4→8→16s),重试耗尽后自动
   emergency WAL checkpoint,try/finally确保conn释放
2. 补充进程锁:防止cron每2分钟触发但脚本跑3分钟时的并发
3. mofin_db.py: 同步cron版本的reassessed_at列处理逻辑
2026-07-14 10:42:54 +08:00
知微 02d1c93923 fix(price_monitor): DB写锁死锁根治 - 统一BEGIN IMMEDIATE + 5次重试指数退避 + emergency WAL checkpoint
- 统一一个BEGIN IMMEDIATE事务包裹所有写操作,替代独立写函数调用
- 5次重试 + 指数退避 (1s,2s,4s,8s,16s),原3次+固定2s
- 重试耗尽后自动 emergency WAL checkpoint(TRUNCATE)释放死锁
- try/except确保连接始终释放,修复conn泄漏
- 三副本同步:profile/scripts + MoFin/scripts + MoFin/root
2026-07-14 10:30:15 +08:00
知微 9239ab40c0 docs: 更新CHANGELOG + 开发日志记录07/13全部变更
- XMPP Bot非阻塞/本地XMPP/MUC修复
- price_monitor推送冷却持久化
- 深套股规则重构+换股规划swap-plan
- 周月线技术分析增强
- 健康Tab写无读清零
- stale_push_wlin/per_stock_reassess/promote_candidates更新
- static/index.html + mofin_health.json + server.py同步
2026-07-13 12:09:25 +08:00
知微 2109289668 feat: 换股规划 swap-plan — 深套股可替代性排序+资金释放方案
- print_swap_plan(): 五维评分(亏损程度/仓位/技术趋势/流动性/前景)
- 排序输出,明确标注"当前亏损X%深套"而非"深套持有"
- --need 参数模拟指定资金需求,自动计算卖几只够
- 可独立运行:python strategy_lifecycle.py swap-plan [--need 金额]
2026-07-13 12:05:36 +08:00
知微 a6d37c6f30 fix: 删除深套股全部硬编码限制——该加就加,一切根据客观判断
- 删除 is_deep_loss 对止损/止盈/买入区/推荐的全部 guard
- 删除 action_note="深套持有" 覆盖
- 删除 position_advice="不补不割" / time_horizon="长期"
- 深套股回归正常分析流程,stock_category="深套"仅作标签
- "深套持有" 改为 "亏损X%深套" 实际状态描述
2026-07-13 12:02:06 +08:00
知微 be961c6af6 fix: _push_cooldown持久化到文件,避免每2分钟重复推送操作区间通知 2026-07-13 11:17:59 +08:00
知微 ab72288296 fix: stock_weekly/monthly/watchlist_log加manual readers消除写无读警告 2026-07-10 21:12:28 +08:00
知微 e92e4473c8 feat: 周线+月线趋势/MA/支撑阻力注入mtf_context 2026-07-10 21:07:59 +08:00
知微 ea139b05b0 fix: 每日汇总只发一次(16:35)+加sent标记防重复 2026-07-10 17:05:29 +08:00
知微 e2f02ad023 fix: 资金流采集器正常运行(修import+科创板null处理) 2026-07-10 14:06:20 +08:00
知微 ea07d8c8df feat: 买入信号写入时自动推XMPP通知(通过5805桥) 2026-07-10 13:58:23 +08:00
知微 49ef74826a fix: 触发重评推送条件收紧(仅买入/加仓/卖出/止盈信号才推) 2026-07-10 13:43:39 +08:00
知微 b9ba737248 fix: 不构成操作建议不推XMPP+代码降级改报错+LLM失败=None 2026-07-10 13:29:32 +08:00
知微 ba70700e4d fix: 代码降级分析也加时间标注+LLM路径日志改为12维 2026-07-10 13:23:34 +08:00
知微 98d6189b69 feat: 每维数据标注时间窗口(MA日数/资金近5日/消息最近3条/财报最新) 2026-07-10 13:17:40 +08:00
知微 005903af83 fix: 9维→12维(3横×4纵:大盘/行业/个股×基本面/消息面/技术面/资金面) 2026-07-10 12:47:05 +08:00
知微 c79fb53722 feat: 盘前全量重评(08:10)+自选退出机制+进出日志 2026-07-10 12:20:18 +08:00
知微 8d733ca16a fix: deploy_sync新增mofin_db.py同步(根目录→profile) 2026-07-10 11:59:08 +08:00
知微 7f65f0cbd2 fix: 九维分析全面升级-资金流+消息面入prompt+交叉综合+capital_flow_collector修mo_data引用 2026-07-10 11:45:03 +08:00
知微 c48429b994 feat: 单日暴跌>7%实时告警(不依赖zone边界) 2026-07-10 11:30:46 +08:00
知微 73df767ac0 fix: 买入区用live_prices+统一DB读取+报告前验价 2026-07-10 10:26:14 +08:00
知微 dbff6b59f9 fix: write_holding_strategy保留full_analysis+reassessed_at防止被清空 2026-07-10 09:53:15 +08:00
知微 e461c57028 fix: stale_detector零标记漏洞(买入区上沿~+20%未覆盖) 2026-07-10 09:43:27 +08:00
知微 9905294496 chore: 清理残留mo_data.py+数据文件 2026-07-10 01:30:27 +08:00
知微 c4de7d6516 docs: 补充今日全量变更文档(扫描/过滤/九维/仓位/冷却/清理) 2026-07-10 01:30:11 +08:00
知微 66c3cfecc3 fix: 健康监控全绿(小果cron移除+死表清理+补录写入方) 2026-07-10 01:02:52 +08:00
知微 b63bfc11f5 fix: 仓位输出要求带一句话理由 2026-07-10 00:54:57 +08:00
知微 ebc3a15f73 fix: 仅买入信号输出仓位+仓位计算公式(RR/大盘/品种) 2026-07-10 00:14:52 +08:00
知微 7026959f58 fix: 信号-仓位一致性校验(观望/卖出→0%, 关注≤5%) 2026-07-10 00:09:38 +08:00
知微 02268405e2 fix: 仓位改为百分比数字(轻仓3%/中仓5%/重仓10%) 2026-07-09 23:21:26 +08:00
知微 016258bc09 feat: 批量LLM九维分析+仓位建议列+Dashboard显示 2026-07-09 23:16:47 +08:00
知微 0c6dd82b30 fix: price_monitor同股同区间30分钟冷却去重 2026-07-09 23:05:00 +08:00
知微 974c4b5d11 fix: 交易时段冷却4h→1h 2026-07-09 22:58:30 +08:00
知微 67c2502f52 feat: 重评冷却期+LLM信号产出+reassessed_at追踪 2026-07-09 22:51:26 +08:00
知微 c84fac58a9 fix: LLM九维分析超时改为300s+urllib导入修复 2026-07-09 22:39:10 +08:00
知微 bd653e300c feat: per_stock_reassess调LLM写九维分析(gateway API) 2026-07-09 22:33:50 +08:00
知微 113119f1a6 fix: 九维分析全维度覆盖(9/9)+LLM调用通过报告cron实现 2026-07-09 22:15:36 +08:00
知微 9e26a3d226 fix: 九维分析补行业+消息面(signal_news) 2026-07-09 21:57:20 +08:00
知微 552645b307 fix: 价格从腾讯API实时拉(盘后可用)+行业从stock_sectors补 2026-07-09 21:30:54 +08:00
知微 35e2486e41 fix: 基本面直接从腾讯API拉(随时可用) 2026-07-09 21:25:08 +08:00
知微 538a6d3bba fix: 九维分析大盘从DB读取+腾讯API兜底 2026-07-09 21:08:52 +08:00
知微 92aa8082c9 fix: 九维分析从DB拉取大盘+基本面数据 2026-07-09 21:03:25 +08:00
知微 e18dbfff6e fix: 九维分析改为结构化叙事格式(①②③...) 2026-07-09 20:59:41 +08:00
知微 93dd2f8732 fix: 完整九维分析显示链接 2026-07-09 20:55:27 +08:00
知微 778b2137f6 fix: 完整九维分析存储+显示(可点击查看) 2026-07-09 20:52:53 +08:00
知微 14690a64e5 fix: 自选按信号优先级排序+策略显示tech_snapshot/sector_context 2026-07-09 20:24:43 +08:00
知微 4e3435c372 fix: per_stock_reassess NoneType比较bug(x3) 2026-07-09 20:17:21 +08:00
知微 823931860f fix: 新入自选生成完整策略文本(买区/损/盈/RR) 2026-07-09 19:58:36 +08:00