Commit Graph
484 Commits
Author SHA1 Message Date
知微 5239f481b0 fix: feature tree pipes中schedule字段类型从dict改为display字符串 2026-07-08 16:56:20 +08:00
知微 63397ec0bd fix: 前端node.pipes显示bug+自动归类关键词精确化 2026-07-08 16:47:45 +08:00
知微 dba9e2e759 fix: 功能树自动归集未分类cron,保证100%覆盖 2026-07-08 16:41:58 +08:00
知微 c614eee8b1 fix: 功能树每个节点嵌入cron管道信息,修复数据采集节点不显示cron的问题 2026-07-08 16:29:02 +08:00
知微 f367c8c94c feat: 报告模板系统 - prepare_report_data + generate_report + 5模板 2026-07-08 16:18:26 +08:00
知微 400b7f6f45 fix: volume_deep DB路径修复+全面接入策略 — 所有重评自动识别量价模式 2026-07-08 12:41:06 +08:00
知微 b5c4302b5e fix: 批量修复scripts/*.py中所有Path(__file__).parent/'data'路径错误—统一指向MoFin/data/ 2026-07-08 12:37:36 +08:00
知微 258b8871ef fix: MA排序bug(用日期代替价格)+量价历史存储+deep_vol接入full_analysis+DB路径统一 2026-07-08 12:36:10 +08:00
知微 2762ddf3ae fix: DB路径大面积修复——mofin_db/server/technical_analysis/strategy_tree等脚本的Path(__file__).parent/data错误指向scripts/data而非data/ 导致读写分离
- 量价分析: full_analysis输出volume_deep+成交量存储在price_history.json
- FK约束移除: holding_strategies外键->holdings阻止自选股写入
- #000850 重评已写入(止损3.74/止盈4.06/RR1.67)含量价信号
2026-07-08 12:34:39 +08:00
知微 c11a11849f fix: 策略系统新增深度量价分析(放量建仓/出货/洗盘检测) — 结束版本 2026-07-08 12:30:17 +08:00
知微 f72559665d fix: 策略系统新增深度量价分析 — analyze_volume_deep(量价齐升/背离/洗盘检测)+接入reassess_strategy 2026-07-08 12:25:56 +08:00
知微 ee1231b32f feat: 功能树+Cron合并视图+数据实体描述列 2026-07-08 12:23:34 +08:00
知微 398b6990b3 fix: 策略缺失量价分析系统 — 新增深度量价分析(放量建仓/出货/洗盘检测)+接入reassess_strategy 2026-07-08 12:21:18 +08:00
知微 a288316a5e fix: 健康JSON同时写入static供dashboard serve 2026-07-08 12:13:38 +08:00
知微 b23e7736ee feat: 首页加🏥健康tab, 内嵌iframe加载三Tab监控 2026-07-08 12:10:54 +08:00
知微 bcf922fb6a feat: 健康监控三Tab + DB→JSON同步 + decisions.json 19条 2026-07-08 11:44:05 +08:00
知微 ec3a148088 fix: evaluation独立连接写+管道审计6条+holding_strategies+decisions.json 2026-07-08 11:23:31 +08:00
知微 8cc0aa13c5 fix: reassess结果写入strategy_evaluations表(持仓/自选/无策略3种路径) 2026-07-08 11:19:48 +08:00
知微 8a77b43ea1 fix: 管道审计覆盖6条关键数据流+holding_strategies+decisions.json 2026-07-08 11:13:59 +08:00
知微 9f5bc8b004 fix: macro_context_log 12天不更新+自检覆盖+JSON文件问题 2026-07-08 11:09:33 +08:00
知微 0793162bbf fix: 自检加第4项——gateway实际LLM推理检测(发ok→5tok) 2026-07-08 10:25:54 +08:00
知微 d75694c9e5 fix: 磁盘IO优化——state.db auto_vacuum+cache增大+每周压缩 2026-07-08 10:13:49 +08:00
知微 7cebcba13a Implement proposal #19: Score-and-Retry + JSON format validation for 知微 pipeline
- Create json_validator.py utility module:
  - validate_json_syntax(): JSON syntax scoring (0-100) with auto-fix
  - validate_with_schema(): Multi-layer validation (syntax + schema)
  - score_and_retry(): Generic retry wrapper with error feedback
  - safe_parse_structured(): Safe <structured_data> extraction
  - FormatErrorLibrary: Persistent error tracking + stats + auto recommendations
  - CLI entry point for standalone use

- Integrate into strategy_lifecycle.py:
  - safe_json_load() now uses json_validator for auto-fix + error logging
  - Falls back to legacy repair on ImportError

- Integrate into update_data.py:
  - parse_report() uses safe_parse_structured() instead of bare json.loads()
  - Errors logged to FormatErrorLibrary silently

- Convert strategy_lifecycle.py to Unix line endings
2026-07-08 01:18:48 +08:00
知微 073cc1a2de fix: 注入市场状态(A股交易中/已收盘 港股交易中/已收盘)防交易时段幻觉 2026-07-07 15:47:14 +08:00
知微 bdd0611275 fix: 去掉ping骚扰+注入datetime防日期幻觉
1. cron_health_monitor/verify_reassess_pipeline: bridge检测从发ping改为TCP端口检测
2. xmpp_agent_core: call_hermes注入当前时间防止LLM日期幻觉
   [当前时间: 2026-07-07 15:32 Tuesday]
3. 修复import datetime缺失
2026-07-07 15:33:14 +08:00
知微 ad74ede2b8 fix: 自选股强制重评+潜力股管道解冻+健康监控阈值修正
1. mofin_collect.py: 加入自选股(watchlist_stocks)强制重评, 输出持仓+自选两段
2. cron_health_monitor: 只监控7个实时管道, 排除日/周任务
3. 解冻: 知微洞察生成(a1f06826) + 市场精选推荐(759064f5)
2026-07-07 13:37:07 +08:00
知微 8f34681e8d fix: 宏观风险扫描是日任务改到正确job名 宏观风险信号消费 2026-07-07 12:49:47 +08:00
知微 6237a01f61 fix: cron健康监控只监控实时管道, 排除日/周任务 2026-07-07 12:29:34 +08:00
知微 583db09090 fix: cron健康监控v2——空闲超时检测+自检+去重冷却+price_monitor直查DB 2026-07-07 12:28:31 +08:00
知微 9f44715b61 feat: add watchlist auto-reassessment to per_stock_reassess
- Add scan_watchlist_stocks() function that scans watchlist_stocks table
- Deviation formula: max(|price-entry_low|,|price-entry_high|)/entry_low*100 > 20%
- Calls technical_analysis.full_analysis() to get latest support/resistance
- Updates entry_low/entry_high/stop_loss/price/analysis_json in DB
- Records changelog in analysis_json with old/new values
- Limits to 3 stocks per run, logs remaining=N for overflow
- Scans watchlist AFTER decisions scan in main() (no changes to decisions logic)
2026-07-07 11:48:45 +08:00
知微 43bd84a7c0 feat: 全局cron job健康监控, failed时主动推XMPP 2026-07-07 11:29:56 +08:00
知微 5ffc487659 fix: 审计度量修正——reassess写strategy_evaluations非holding_strategies 2026-07-07 11:27:56 +08:00
知微 ae35631208 自选股自动重评机制+000850华茂股份9维分析
fix: per_stock_reassess 现在支持自选股(不在decisions.json)触发的重评
  - 不在decisions_map的code→查watchlist_stocks表构建entry
  - 重评完成后同步回watchlist_stocks表
  - is_watchlist=True传给reassess_strategy确保正确分类

fix: stale_detector的[AUTO_REASSESS]路径现在能真正触发自选股重评
  - 价格偏离买入区中心>15%→触发per_stock_reassess
  - 结果写回DB watchlist_stocks表+decisions.json

feat: 000850华茂股份完整9维分析
  - 横: 大盘偏弱但个股独立/纺织板块/金融资产折价
  - 纵: PE72.79虚高(被金融收益摊薄)/PB0.80破净(安全垫)
  - 消息面: 7/16临时股东会催化
  - 技术面: MA5>MA10>MA20多头初成/缩量回踩健康
  - 资金流: 量比1.21放量上攻后缩量回踩(正常)
  - 买入区3.70~3.90现价3.81在区内→策略有效维持
  - 止损3.50/止盈4.30/RR=1.6
2026-07-07 11:27:46 +08:00
知微 4689849c9d fix: 管道审计+全局cron失败监控, 异常时主动推XMPP 2026-07-07 11:27:09 +08:00
知微 5320509893 fix: stale_detector per_stock_reassess参数修正(--code→位置参数) 2026-07-07 11:20:28 +08:00
知微 7b4826777a 自选股自动重评机制+000850华茂股份全面重评
1. stale_detector新增自选股买入区偏离自动重评:
   - 每轮扫描watchlist_stocks, price偏离买入区中心>15%自动触发per_stock_reassess
   - 之前只标记[STRATEGY_STALE]不输出,改为标记+触发重评两步完成
   - 策略完毕直接输出结果,不再等下次cron通知

2. 000850华茂股份全面重评:
   - 核心价值:纺织是壳,金融股权投资才是核心(国泰海通/广发/徽商银行)
   - PB=0.78破净, 7月3日分红3675万占年净利17.85%
   - 7/16临时股东会催化剂
   - 结论:3.70~3.90区间可建仓1~2%,止损3.50,止盈4.30
   - 修复:之前说'观望不建仓'是错的,低估了破净安全垫

3. watchlist_stocks DB加000850记录
2026-07-07 11:20:04 +08:00
知微 096fbbf5f6 fix: sqlite3.Row没有.get()方法, r.get('cost',0)静默失败→改为r['cost'] if r['cost'] else 0 2026-07-07 11:05:21 +08:00
知微 7c255d5234 fix: 统一DB路径+管道审计脚本
mo_data.py DB_PATH: /home/hmo/web-dashboard/data/mofin.db → /home/hmo/MoFin/data/mofin.db
新增 verify_reassess_pipeline.py:管道审计,静默时无声、异常时报警
2026-07-07 10:37:05 +08:00
知微 26e2794cca fix: 代码级约束 —— 推荐前必须同步重评, 不输出无操作信号的信息
1. price_monitor: 区间突破后同步调reassess_with_context(), 明确信号推XMPP
2. stale_detector: 只输出有[PUSH]/[STRATEGY_STALE]标记的行, 静默无操作信号的买入区
3. mofin_collect: stale/无策略持仓同步重评, 不靠TODO异步
2026-07-07 10:31:50 +08:00
知微 2138ae2bfd fix: 代码级强制约束——LLM看到数据前必须同步重评(stale/无策略), 不等TODO异步
mofin_collect.py步骤0改造:
  stale(>4h未更新) → 立即调reassess_with_context()强制重评, 不靠TODO异步
  无策略(holding_strategies无记录) → 立即调reassess_with_context()创建策略
  只有重评成功后才允许LLM给出建议
2026-07-07 10:14:21 +08:00
知微 bbd90a005e feat: 代码级策略新鲜度强制检查 — mofin_collect.py步骤0, 推荐前先检策略是否最新, 过期自动创TODO 2026-07-07 10:10:01 +08:00
知微 fbbb96020f fix: system_health_check不再误报market.json/decisions.json缺失(DB-only已迁移) 2026-07-07 09:20:49 +08:00
知微 6e03b62f69 chore: .gitignore排除运行时数据文件和db 2026-07-06 14:03:55 +08:00
知微 de6e5f6624 docs: 更新CHANGELOG — 2026-07-06全面系统修复记录 2026-07-06 14:03:27 +08:00
知微 e055485f53 chore: 加 .gitignore(取自code_only分支) 2026-07-06 14:02:24 +08:00
知微 66962ae190 fix: 全面系统修复 — delivery目标修正 + 脚本同步 + refresh_mtf_cache import修复 + clean_watchlist硬编码修复
修复清单:
- cron delivery修正:10个job从deliver=origin/all改为local,消除推送错误
- refresh_mtf_cache.py:替换strategy_lifecycle.PORTFOLIO_PATH导入为mofin_db直接读DB
- clean_watchlist.py:修复mo_data导入名错误和JSON硬编码路径
- MoFin/scripts/与profile scripts互相补全,双向sync到一致
- price_monitor.py:现金源从portfolio_summary表改为cash_log(Dad确认的现金权威)
- 更新watchlist.json加入000850华茂股份
2026-07-06 14:01:54 +08:00
知微 3e2f0315eb 完全DB版: 移除JSON写入/回退,所有操作直走SQLite
- price_monitor: 完全DB版,不再读写 portfolio.json/watchlist.json
  - holdings代码从DB读取(SELECT code FROM holdings WHERE is_active=1)
  - 价格写入DB holdings表 + portfolio_summary + live_prices
  - 3次重试+指数退避防锁
- server.py: 移除API的JSON回退,DB失败直接返回500
- mofin_db.py: execute_with_retry/commit_with_retry + 15s timeout + busy_timeout
- mo_data.py: 已是纯DB模式(无JSON fallback)

这是推进的完全DB化。下一步可删除 data/portfolio.json data/decisions.json data/watchlist.json 等遗留JSON。
2026-07-06 12:08:08 +08:00
知微 e185b4e4dc feat: DB-first architecture with lock-safe writes
- price_monitor: writes live prices to both JSON and mofin.db (holdings + live_prices + portfolio_summary)
- mofin_db: added execute_with_retry/commit_with_retry with exponential backoff on 'database is locked'
- mofin_db: increased timeout 5s->15s, added PRAGMA busy_timeout=15000
- price_monitor retry loop: fixed break-before-if-ok bug (was not retrying on write failure)
- DB connection: WAL mode + retry decorator for all write operations
- cash sync: preserves DB authoritative cash (JSON cash not pushed to DB)

This is the DB-first version. JSON writes remain for dashboard compatibility.
Next step: remove JSON writes entirely for full DB-only architecture.
2026-07-06 12:02:11 +08:00
知微 687155487d feat: strategy-staleness-check auto-creates TODOs for STRATEGY_STALE stocks 2026-07-05 01:41:10 +08:00
知微 320353348d feat: add todos table to mofin_db + DB_PATH fix for self_todo_executor 2026-07-05 01:37:40 +08:00