Files
memind/docs/regression-guards/103-release-0630004-rollback.md
2026-07-01 18:08:06 +08:00

83 lines
3.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 103 发布 0630004 — 回退说明
**发布编号:** `20260630-093145-2b8dba1`
**Git commit** `2b8dba1`(分支 `0630004`
**发布时间:** 2026-06-30
## 本次内容
- **MindSpace 空间 UI**OA / 公开 / 归档三列布局;公开区与 OA 工作区统计修复;图片预览弹窗;悬浮窗 Skill 与主聊天对齐
- **聊天体验**:连接加载动画;历史列表重试与非阻断提示;Agent 连接超时 60s + `skip_reconcile` 降级
- **页面编辑**:编辑提示 5s 自动折叠;平台页脚 `data-mindspace-page-tag`;域名 `tkmind.cn` 校正
- **微信分享**`og:site_name` + 品牌 favicon,修复转发卡片底部「TKMind 智趣」消失;本地预览工具 `/dev/wechat-share-preview`
- **Agent 能力**:勾选资料确认后删除(`mindspace_asset_agent_delete`);内部 routing/skill 话术过滤;时间锚点含小时
## 103 自动备份(发布脚本已创建)
| 类型 | 路径(103 上) |
|------|----------------|
| 全量 live 备份 | `/Users/john/Project/backups/memind/memind-full-20260630-093145-2b8dba1-before.tar.gz` |
| 持久目录备份 | `/Users/john/Project/backups/memind/memind-persisted-20260630-093145-2b8dba1-before.tar.gz` |
| 旧源码归档 | `/Users/john/Project/archives/Memind-source-before-20260630-093145-2b8dba1` |
| 当前 live | `/Users/john/Project/Memind`(无源码 runtime |
**上一版 live(本发布前):** `20260630-021816-92b0931`commit `92b0931`,分支 `0630003`
## 健康验证
```bash
ssh 58.38.22.103 'curl -sf http://127.0.0.1:8081/api/status && echo'
ssh 58.38.22.103 'curl -s -o /dev/null -w "brand=%{http_code}\n" http://127.0.0.1:8081/brand/tkmind-icon.png'
```
**2026-06-30 发版后验证:** `ok``brand_icon=200`live 目录为无源码 runtime`server.mjs` + `dist/` + `scripts/run-memind-portal-prod.sh`)。
发版前本地已通过:
- `npm test`385 项)
- `npm run verify:mindspace-publish-guards:full`
## 回退到上一版 runtime92b0931 / 0630003
**103** 上执行:
```bash
RELEASE_ID=20260630-093145-2b8dba1
PREV_RELEASE=20260630-021816-92b0931
APP_DIR=/Users/john/Project/Memind
ARCHIVE=/Users/john/Project/archives/Memind-source-before-${RELEASE_ID}
PORTAL_LABEL=cn.tkmind.memind-portal
LAUNCHD_GUI="gui/$(id -u)"
launchctl bootout "${LAUNCHD_GUI}/${PORTAL_LABEL}" 2>/dev/null || true
lsof -tiTCP:8081 -sTCP:LISTEN | xargs kill -9 2>/dev/null || true
mv "${APP_DIR}" "${APP_DIR}.failed-runtime-${RELEASE_ID}"
tar -xzf /Users/john/Project/backups/memind/memind-full-${PREV_RELEASE}-before.tar.gz -C /Users/john/Project
launchctl bootstrap "${LAUNCHD_GUI}" "${HOME}/Library/LaunchAgents/${PORTAL_LABEL}.plist"
launchctl kickstart -k "${LAUNCHD_GUI}/${PORTAL_LABEL}"
curl -sf http://127.0.0.1:8081/api/status
```
## 从全量 tar 恢复(极端情况)
从**本发布前**全量备份恢复(即回到 `92b0931` 上线前的 live 快照):
```bash
cd /Users/john/Project
mv Memind "Memind.broken-$(date +%Y%m%d-%H%M%S)"
tar -xzf backups/memind/memind-full-20260630-093145-2b8dba1-before.tar.gz
# 再启动 Portal LaunchAgent
```
若 runtime 切换失败,发布脚本 remote 段内置 `trap rollback` 会自动尝试恢复。
## 本地复现 / 再发版
```bash
git checkout 0630004
npm run verify:mindspace-publish-guards:full
bash scripts/release-portal-runtime-prod.sh --yes
```