fix(SSOT): 库文件统一硬链到MoFin根目录canonical——今晚三处改造差点跑在陈旧副本上

- mo_data.py 提升为根目录canonical(含tag修复), deploy/profile-scripts/
  scripts/ profile脚本目录 全部硬链到根
- mofin_db.py 同理(含strategy_history/tag迁移), 四处硬链统一
- sync_profile_scripts.sh 增加库文件链接步骤, merge后自动恢复
- 根因: deploy/profile-scripts/mofin_db.py 是7-20陈旧副本(无snapshot),
  profile脚本目录mo_data.py无tag——hygiene分叉副本检查正确报警
This commit is contained in:
hmo
2026-07-21 02:00:26 +08:00
parent 2054c6e6f9
commit 6d1d4a5164
2 changed files with 329 additions and 0 deletions
@@ -11,6 +11,19 @@ for f in "$SRC"/*.py; do
count=$((count+1))
done
ln -f "$SRC/sync_profile_scripts.sh" "$DST/sync_profile_scripts.sh" 2>/dev/null || true
# ── 库文件 SSOTcanonical 在 MoFin 根目录,其他位置只许硬链(红线#6)──
# git checkout/merge 会重写文件破坏硬链,这里强制恢复
ROOT="/home/hmo/MoFin"
for lib in mofin_db.py mo_data.py; do
if [ -f "$ROOT/$lib" ]; then
ln -f "$ROOT/$lib" "$ROOT/deploy/profile-scripts/$lib" 2>/dev/null || true
ln -f "$ROOT/$lib" "$ROOT/scripts/$lib" 2>/dev/null || true
ln -f "$ROOT/$lib" "/home/hmo/web-dashboard/$lib" 2>/dev/null || true
ln -f "$ROOT/$lib" "$DST/$lib" 2>/dev/null || true
fi
done
echo "synced $count scripts (hardlink)"
mkdir -p /home/hmo/MoFin/gateway/logs
echo "$(date '+%F %T') synced $count scripts" >> /home/hmo/MoFin/gateway/logs/link_sync.log