Commit Graph
160 Commits
Author SHA1 Message Date
hmo f7f7fe3ca0 fix(parser): 节标题锚定解析+脏区间清洗+三值RR
- parse_response: 只认行首【买入区间】【综合结论】等节行(原先取首个关键词行,
  命中修改点段落引用的旧脏值→95~99区间反复写回,17只股票受害);
  信号锚定】后首词,防'观望(不建议买入)'误判; 【买入区间】无→显式清空
- save_result: 区间-现价距离门禁(eh<0.5px或el>1.5px→拒写并清空,不再保留原值养脏)
- recompute_rr: 三值RR(rr_low/rr_ratio中/rr_high,分别对应区下沿/中值/上沿入场)
- 迁移: holding_strategies+rr_low/rr_high列; digest显示RR中(低~高); watch API+前端展示
2026-07-22 22:59:18 +08:00
hmo f35144f3f1 feat(盯盘): 推荐区全展示+可执行/排队徽章(预算内标可执行,不再降级隐藏) 2026-07-22 10:53:32 +08:00
hmo a42e3a16e5 feat(盯盘): 筛选/排序控制条——信号多选chips+排序下拉(RR升降/涨跌升降)+RR下限过滤+重置 2026-07-22 09:31:19 +08:00
hmo c1b38d3d7b feat(盯盘): 推荐操作精选层——72h新鲜度+RR降序+现金预算贪心装入(上限5只)
老爸: 太多推荐=没有推荐。机制:
- 候选: tag非空 且 reassessed_at 72h内(陈旧信号不算推荐)
- 排序: rr_ratio 降序
- 预算: 从 portfolio_summary 读现金/总资产, 每只建议仓位
  (position_advice解析%或默认8%) 贪心累加, 耗尽即止, 最多5只
- 落选者降回持仓/自选自然组
- /api/watch 返回 cash/budget_pct/rec_used_pct, 前端显示预算条
- 推荐行仓位列显示'建议X%'
2026-07-22 00:16:35 +08:00
hmo 9914ff9457 feat(盯盘): 推荐操作区域置顶独立 + tag与XMPP动作级信号自动同步
- mofin_db: write_holding_strategy 内置tag同步语义——动作级信号
  (买入/可买入/可加仓/卖出/止盈)→current_recommend; 信号降级→
  清除current_recommend; active_manual人工标记永不被自动流覆盖/清除
- 新增 sync_recommend_tag() 供裸SQL调用方
- batch_reassess.save_result / per_stock stage-2 调用同步
- 盯盘Tab: '重点推荐'更名'推荐操作', 区域独立琥珀色视觉, 置顶
同步语义: XMPP买入信号(ACTION级告警)的个股=推荐操作区域个股,
信号消失(重评降级)时区域同步消失
2026-07-21 23:31:57 +08:00
hmo a69b246c57 feat(guard): 部署一致性守卫 deploy_guard.py + 知微运维纪律 + 健康JSON移出跟踪
- deploy_guard.py (15min cron): 代码漂移自动回滚(仅未提交改动)+
  session-work可快进时自动merge部署+幂等重链+cron引用完整性,
  状态落盘JSON, 有动作即XMPP报备
- docs/zhiwei-ops-discipline.md: 知微纪律——禁止直接编辑被跟踪代码/
  禁stale提交/禁直调gateway批量LLM; 自愈白名单(rerun/restart/
  sync/switch_key)本不改代码, 与纪律不矛盾; 紧急热修走git流程,
  提交到session-work后guard 15min自动部署
- dev-spec 红线#6 补充部署守卫机制
- static/mofin_health.json 移出git跟踪(运行时产物, 常驻dirty
  会废掉漂移检测)
2026-07-21 01:17:01 +08:00
hmo de9927a627 重评核心重构:ds-v4-pro + 原策略全文 + strategy_history + 前端三改造
后端(重评管线):
- 新增 llm_client.py 共享客户端: REASSESS_MODEL=deepseek-v4-pro 单点,
  gateway预检(fail-fast), 150s超时+1次重试, 永不抛异常
- batch_reassess/per_stock_reassess: curl/urllib -> call_llm,
  prompt传入原策略全文+当前参数+最近3条变更, 输出 维持/修改判断+
  修改点理由+最终新策略, max_tokens 4096
- mofin_db: 新增 strategy_history 表 + snapshot_strategy_history(),
  write_holding_strategy 覆写前自动快照(保留20条/code)
- mofin_db: holding_strategies 补 tag 列迁移 + 写入保留
  (tag缺席=保留旧值, 显式传''=允许清除), 修复推荐标签被静默丢弃
- mo_data.read_decisions: SELECT 补 tag
- stale_detector/promote_candidates: 子进程超时 240/60 -> 480s

前端:
- 移除 报告Tab -> mofin_health 全部流程/Cron 表加 最后十次 列
  (modal列表->详情), /api/reports 支持 cron+script 多路匹配
  (jobs.json name->id 解析 + 文件名/标题子串兜底)
- 移除 决策库Tab
- 盯盘Tab 重构: 全部持仓+自选, sort_group 分组(推荐/持仓/自选),
  推荐行琥珀高亮+🔥badge+行内策略, 新增 操作策略 列查看
  最近3次完整策略(/api/strategy_history/<code>, 表缺失时降级当前行)
- 提示词Tab: registry.py 数据路径改回 /home/hmo/MoFin/data/prompts
  (红线: 数据只在规范数据根), 空态提示初始化命令
2026-07-20 23:51:24 +08:00
知微 90f07b4eba chore: sync 2026-07-20 22:05:03 +08:00
知微 3eb214f3a6 chore: sync 2026-07-20 21:43:03 +08:00
知微 2b79c1dc44 chore: sync 2026-07-20 21:21:25 +08:00
知微 c971d6bced chore: watchdog fix 2026-07-20 20:55:34 +08:00
知微 dae60bb92f chore: sync before briefing merge 2026-07-20 20:37:20 +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
hmo 08eef1e181 feat(self-check): L0-L4 layered self-check architecture with LLM auto-repair
User directive: daily not weekly; clear responsibilities per layer with no
overlap; functional criteria (does the function WORK) not process liveness;
problems get FIXED via LLM with file-and-report discipline (act first,
report after); plus a meta-layer watching the watchers; deeply integrated
into F健康.

Architecture (responsibility matrix in dev-spec.md):
- L0 agents_health_check (5min): port/HTTP/DB liveness + auto_heal executor
- L1 functional_health_check (15min trading): per-module FUNCTIONAL
  criteria — output freshness/validity per REGISTRY (live_prices/market_
  snapshots/mtf_cache/macro_context/bot/LLM/cron engine), not process alive
- L2 system_hygiene_audit (daily 08:20, was weekly): divergence/hardlink/
  zombie/orphan/dead-cron/db-freshness
- L3 self_repair (30min): reads L1/L2 failures -> LLM diagnoses -> executes
  WHITELISTED repair actions directly (rerun_script/restart_service/
  sync_links/switch_llm_key/none) -> repair_log.jsonl + XMPP report.
  Max 2 repairs/module/day anti-loop. LLM unavailable -> rule fallback.
- L4 meta_watchdog (hourly): checks L0-L3 output freshness + L3 cron
  registration + XMPP bridge; direct XMPP alert as last resort

Retired (overlap): Cron监护-高频 (cron_watchdog -> L3), 全局cron健康监控
(cron_health_monitor -> L1).

Dashboard: mofin_health.py now emits self_check section (functional/meta/
hygiene/recent_repairs); mofin_health.html new '🩺 自检体系' tab rendering
L4 layers, L1 module checks, L2 issues, L3 repair history.

E2E verified: stopped xmpp bot -> L1 flagged fail -> systemd recovered ->
L3 LLM correctly diagnosed 'none needed' and logged; rerun_script whitelist
path executes real scripts successfully; meta_watchdog all-green after fix.
2026-07-20 19:39:58 +08:00
知微 5d3b8e6fdd chore: capture deployed state 2026-07-20 17:30:43 +08:00
hmo a05c118cbc feat(dashboard): restore lost monitoring + add 开发原则 tab (AgentsMeeting parity)
Two regressions fixed:

1. RESTORED: original health monitoring (功能树/全部Cron/数据实体/数据流)
   was an iframe to /mofin_health.html — refactor replaced it with a
   minimal services-only panel and lost all of it. mofin_health.json
   (86KB, fresh) was still being generated the whole time.
   - 健康 tab: XMPP panel (native) + restored iframe below

2. ADDED: 开发原则 parent tab replicating AgentsMeeting structure:
   - G 规范: /api/spec renders docs/dev-spec.md + git history
   - K 测试: /api/tests renders agents_health_check report as pass/fail
   - F 健康: iframe to /mofin_health.html + link to 健康 tab
   - H 需求: /api/prd (placeholder — prd.md not yet created)
   - mdRender() ported from AgentsMeeting dashboard
2026-07-20 00:40:32 +08:00
hmo 058c42ce27 feat(health): recent XMPP conversation log panel + stale error fix
User requirement: health tab should show recent XMPP conversations.
- bot hooks log_xmpp on inbound (on_msg) and outbound (_deliver_loop)
  so real chats land in xmpp_messages.jsonl (was: only cron/scanner)
- index.html health tab: new '最近对话' panel (last 10 msgs, dir arrow,
  preview, status, time); refreshHealth updates it incrementally
- last_error now shows age and resolved state: once a successful
  outbound happens after an error, it's shown gray as '已恢复'
  instead of alarming red forever; unresolved errors still red
- health() status no longer degraded by errors that were later
  resolved by successful outbound
2026-07-20 00:07:28 +08:00
hmo 0802046d5c feat: Hermes Gateway + LLM provider monitoring, root cause visible in health tab 2026-07-19 13:25:37 +08:00
hmo 50ae4e1cc9 feat: XMPP bot journal monitoring — detect inbound/outbound/errors, smooth health refresh 2026-07-19 13:15:37 +08:00
hmo 9f3d1d8106 refactor: remove redundant dashboard tab, health tab now unified 2026-07-19 12:57:08 +08:00
hmo b41bed7959 feat: XMPP observability — logger, monitor endpoints, clean dead xiaoguo refs 2026-07-19 12:47:15 +08:00
hmo fec2bc9106 refactor: integrate spec system into all 9 tabs — ?§ buttons, native health monitoring 2026-07-19 11:22:56 +08:00
hmo 8356946de3 refactor: health tab now uses new dashboard, added dashboard tab 2026-07-19 11:11:59 +08:00
hmo e45c3bb01f feat: integrate dashboard tab into main index.html navbar 2026-07-19 11:11: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
知微 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
知微 9905294496 chore: 清理残留mo_data.py+数据文件 2026-07-10 01:30:27 +08:00
知微 016258bc09 feat: 批量LLM九维分析+仓位建议列+Dashboard显示 2026-07-09 23:16:47 +08:00
知微 93dd2f8732 fix: 完整九维分析显示链接 2026-07-09 20:55:27 +08:00
知微 14690a64e5 fix: 自选按信号优先级排序+策略显示tech_snapshot/sector_context 2026-07-09 20:24:43 +08:00
知微 cc9e9e066e fix: 自选Tab两行布局(策略全显)+新增RR列 2026-07-09 19:52:29 +08:00
知微 ffef8cdd29 fix: 自选Tab显示策略数据(买入区间/信号/策略)+live_prices涨跌 2026-07-09 19:49:07 +08:00
知微 a83c0ea11e fix: watchlist API改用holding_strategies+市场Tabtrend变量 2026-07-09 19:24:45 +08:00
知微 223c708507 fix: 市场Tab候选管道JS语法错误 2026-07-09 19:21:07 +08:00
知微 52e70bde26 fix: 14个LLM cron prompt添加数据真实性铁律(置顶)+注册到提示词系统 2026-07-09 13:38:36 +08:00
知微 c745f1318a stale_push_wlin: 按Dad确认流程重构推送逻辑
1. 加重评冷却(4小时)— 查holding_strategies.updated_at
2. 修zone_notes早退bug — 有区间说明时不静默退出
3. zone_notes冷却30分→4小时(匹配重评冷却)
4. 标题自适应:有推荐→自选买入提醒 | 仅区间提醒→操作区间提醒
5. 区间说明格式:'进入操作区间,但重评结果:x'
6. 操作建议标题只在有可操作项时显示
7. has_actionable判定改用实际lines内容
2026-07-09 10:33:50 +08:00
知微 ea750f2cb3 feat: 数据流Tab-28张表全量详细说明(写/读/总结) 2026-07-09 08:47:03 +08:00
知微 1e0bf0e00b fix: JS大括号不平衡(重复if导致) 2026-07-09 08:38:40 +08:00
知微 50a7be1f59 feat: 功能树添加"说明"列(64项描述) 2026-07-09 08:32:13 +08:00
知微 9674e7ff1c fix: 全部流程Tab添加profile过滤器,默认只看知微 2026-07-09 00:30:18 +08:00
知微 5139d46dc9 cleanup: 清理3张死表(stock_daily/weekly/monthly)+补录漏检写入方 2026-07-09 00:24:23 +08:00
知微 ccea9fcf09 cleanup: 去冗余+归档一次性脚本
- 移除重复的系统健康检查-每日(no_agent版,与LLM版重叠)
- 归档42个一次性脚本(移出MoFin/scripts→archive/scripts):
  - fix_*: 历史数据修复(11个)
  - migrate_*/rollback_*: 数据迁移(2个)
  - 一次性数据修复: bulk/close/data_freshness等(16个)
  - check_*/verify_*/diagnose_*: 历史诊断工具(12个)
  - test_*: 测试脚本(3个)
- 84个活跃脚本, 0架构违规, 31张healthy数据表
2026-07-09 00:19:00 +08:00
知微 9fef32413b refactor: 统一价格入口 mo_data.get_price() - 22个脚本移除自拉腾讯API
所有价格获取统一走 mo_data.get_price() / get_prices_batch():
  - 优先读 live_prices(DB) → 无/过期才调 stock_quote(API) → 自动写回DB
  - 22个脚本全部替换:branch_scanner chip_factors divergence_detector
    market_screener mo_provider mofin_collect monitor_300308 300308_monitor
    multi_timeframe refresh_macro_context stale_detector stale_push_wlin
    stock_profile strategy_evaluator strategy_lifecycle strategy_review
    strategy-staleness-check technical_analysis xiaoguo_signal_consumer
    collect_evaluation_data
2026-07-08 23:54:01 +08:00
知微 0e21a3ae83 feat: 数据流架构审计-22个脚本自拉API违规标记 2026-07-08 23:35:56 +08:00
知微 84a147b6f2 feat: 数据流四态分类(healthy/write_only/read_only/orphan)+僵尸表清理 2026-07-08 19:43:04 +08:00
知微 f20bac075c feat: 数据流Tab(🔀)+功能树折叠 2026-07-08 18:08:58 +08:00
知微 ab85173902 fix: 功能树只显示position-analyst(知微)的cron,default(莫荷)的cron不混入 2026-07-08 17:25:08 +08:00
知微 63397ec0bd fix: 前端node.pipes显示bug+自动归类关键词精确化 2026-07-08 16:47:45 +08:00