feat(migrate): Halo 全量内容迁移(压缩版)——6文/21图/1瞬间 URL 1:1

- 正文源=线上渲染页(Halo 快照层 patch 残迹:泥潭/赎罪仅 2 字符),
  pandoc html→gfm + tags API 显示名换算后分类:5 书评(五档情绪色)+1 技术
- 图库 21 张:长边 2400/q86 压缩入仓(原图 196M→9.5M——公开仓历史膨胀
  与 nginx 100M 推送上限双杀;原图在 Phase 0 备份 tar 中永久留档)
- 瞬间 1 条;URL 1:1(6 slug 全等,零 301)
- 本提交由 7 个本地提交重写而成(清除已进历史的 196M blob,未推送过);
  因 reset --soft 暂存竞态,一并包含 spec 归档文件
  (.spec/specs/archive/2026-10-24_migrate-blog-content/)

验证: check_urls.py 6==6;astro build 11 页 exit 0(8.67s);
      EXIF 管线跑通;staging 更新;halo healthy+200 全程未动

Co-authored-by: GLM-5.3
This commit is contained in:
wait4xandGLM-5.3 committed 2026-10-25 00:39:08 +08:00
1 parent 7b71acf223
commit aea21c8694
74 files changed
+1381 -97

No files matched your search

@@ -0,0 +1,42 @@
# Phase 2:Halo 内容迁移(6文/21图/1瞬间,URL 1:1)- 任务拆解
## 使用规则
- 每个任务 boundary/verify 齐备;verify 首个反引号 span 为执行命令
- 迁移中间产物只落 .migration/(gitignore)
## 阶段一:实现
- [x] T1 Halo 全量导出脚本
- claim: orchestrator
- boundary: 只写 scripts/migrate/halo_export.py 与 .migration/ 产物;对 Halo 仅 GET
- verify: `python3 scripts/migrate/halo_export.py && test -s .migration/posts.json -a -s .migration/photos.json -a -s .migration/moments.json`
- [x] T2 文章转换入库
- depends-on: task_0001
- claim: orchestrator
- boundary: 只写 scripts/migrate/posts_to_md.py 与 content/posts/*.md(图片落 content/posts/ 同名资产目录或引用 photos 集合);书评 mood 按篇分配五档色
- verify: `pnpm astro build && test $(ls content/posts/*.md | wc -l) -eq 6`
- [x] T3 图库迁移
- depends-on: task_0001
- boundary: 只写 scripts/migrate/photos_migrate.py 与 content/photos/(jpg+json sidecar;分组沿用 Halo 数据)
- verify: `test $(ls content/photos/*.jpg | wc -l) -eq 21 && pnpm astro build`
- [x] T4 瞬间迁移
- depends-on: task_0001
- boundary: 只写 scripts/migrate/moments_migrate.py 与 content/moments/
- verify: `test $(ls content/moments/*.md | wc -l) -ge 1 && pnpm astro build`
- [x] T5 URL 1:1 断言
- depends-on: task_0002
- boundary: 只写 scripts/migrate/check_urls.py(读 .migration/posts.json 与 content/posts/ 比对 slug 集)
- verify: `python3 scripts/migrate/check_urls.py`
- [x] T6 构建验收 + staging + 抽检清单 + 生产复查
- depends-on: task_0002, task_0003, task_0004, task_0005
- boundary: 跑 build.sh 更新 staging;抽检清单写 .spec/specs/2026-10-24_migrate-blog-content/evidence/spot-check.md;复查 halo 容器与本机 200
- verify: `bash infra/deploy/build.sh && docker inspect -f {{.State.Health.Status}} halo-halo-1 | grep -q healthy`
---
**当前进度**:由脚本计算,无需手动维护