Files
cms-website/apps/api
浅念 8f42c838c1 feat(build): 冻结 Render Snapshot 物化与 build job
Plan 4 Task 2:build_jobs 生命周期(queued→snapshotting→validating(空)→succeeded)
+ build_input_snapshots 行(三哈希/主题/config 引用/真实版本列)+ 六文件物化
(site/content/taxonomies/routes/assets/render-manifest——canonicalJson 确定性落盘)。

- render-snapshot.ts:纯物化(db 只读)——published 修订(ADR-010 冻结语义)+
  路由/媒体 ready 集合 → 六文件;bodyHtml URL 重写(剥 host 按 path 与 ready 集合
  public_path/source_url 双源比对,命中根相对化、未命中保留+计数);媒体实体路径
  三候选解析(快照 storageRoot→仓库存储根→incoming 兜底)
- build.service.ts:幂等键 = site+published 集合哈希+主题版本(复用不重跑);
  repeatable read 单事务一致性读取+落盘+快照行;报告 artifacts/jobs/<id>/reports/
  build.json 先于终态落行;解析期失败零 job 行(NOT_PUBLISHED/SITE_NOT_FOUND)
- sf.ts + build:create;build.module.ts Nest 薄壳
- tests/integration/build-snapshot.test.ts:10 测试(状态机/六文件面/URL 重写/
  字节确定性/NOT_PUBLISHED/ADR-010 双修订/重写器纯函数四例)

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-22 07:46:23 +08:00
..