diff --git a/docs/superpowers/plans/2026-10-21-slice-build-preview-phase4.md b/docs/superpowers/plans/2026-10-21-slice-build-preview-phase4.md index c644e3a..4aa15d5 100644 --- a/docs/superpowers/plans/2026-10-21-slice-build-preview-phase4.md +++ b/docs/superpowers/plans/2026-10-21-slice-build-preview-phase4.md @@ -56,7 +56,7 @@ scripts/sf.ts # + content:publish / build:create / preview:star - [ ] 实现:一致性读取(单事务 repeatable read 或快照时点标记——简化:顺序读取+记录行数基线,差异检查);媒体实体路径解析用 register 快照 metadata 的 storageRoot+storage_path(`storage/snapshots/media_bundle/…` 已存在的 content-addressed 副本)+ incoming 副本兜底 - [ ] 绿 → commit `feat(build): 冻结 Render Snapshot 物化与 build job` -### Task 3: pilot-minimal 主题骨架 + 布局组件 +### Task 3: pilot-minimal 主题骨架 + 布局组件 ✅ 完成(1cd309d + 修复 eb81a57,双审通过;372 测试;审查战果:**payload 契约上提 contracts 双端咬合**、空路由明错(静默 0 页消除)、eslint astro ignore、routeHrefFor 预备。遗留:og:type/og:image、footer 年份可复现、origin 空守卫——均记 Plan 5/Task 5) **Files:** `themes/pilot-minimal/`(package.json/tsconfig/theme.manifest.ts/src/{layouts,components,lib});根 workspace 已含 themes/*;Test `themes/pilot-minimal/test/manifest.test.ts` @@ -76,7 +76,7 @@ scripts/sf.ts # + content:publish / build:create / preview:star **Files:** `build.service.ts` 扩展(spawn astro build→媒体复制→sitemap→产物登记);Test `tests/integration/build-pipeline.test.ts` -- [ ] 失败测试(小夹具全链):① spawn `pnpm --filter pilot-minimal build`(SF_BUILD_INPUT 指输入目录)→ dist/ 页面按 routes.json 的 html 行路径落盘——**映射规则钉死**:尾斜杠→`index.html`;`.html` 后缀→字面文件(仅夹具);**百分号编码路径→编码原样目录结构**(Astro 产物若不符则构建后按 manifest 重命名/移动对齐——manifest 的 target_file 是唯一权威);② 媒体复制:assets.json 逐条复制到 dist 的 public_path(跳过 quarantined);sha256 抽检;③ sitemap.xml(origin+indexable html 行,**编码 URL 原样进 sitemap**)+ robots.txt(Allow / + Sitemap 行);④ **route-manifest.json 生成与字段面断言**(spec §12.1:manifest_version/site_id/build_job_id/origin/generated_from_route_snapshot_hash/routes[] 含 exact_key/query_policy/kind/target_file/status/location/content_type/indexable——含 redirect 行与 ?attachment_id= 查询形态)+ build_artifacts 行(dist/manifest 各 kind+哈希);⑤ 构建环境五禁断言:SF_BUILD_INPUT 之外零数据源(loader 单一入口 grep + **DATABASE_URL 置空跑构建仍成功** + **无网证明**:构建进程内 stub global fetch 抛错仍成功——spec §10.4 明文要求) +- [ ] 失败测试(小夹具全链):① spawn **`pnpm --filter @sf/theme-pilot-minimal build`**(SF_BUILD_INPUT 指输入目录;**Task 3 备忘:包全名 filter;Windows astro 构建失败判据="非零退出+stderr 标记"勿匹配精确码——127+libuv 噪音**)→ dist/ 页面按 routes.json 的 html 行路径落盘——**映射规则钉死**:尾斜杠→`index.html`;`.html` 后缀→字面文件(仅夹具);**百分号编码路径→编码原样目录结构**(Astro 产物若不符则构建后按 manifest 重命名/移动对齐——manifest 的 target_file 是唯一权威);② 媒体复制:assets.json 逐条复制到 dist 的 public_path(跳过 quarantined);sha256 抽检;③ sitemap.xml(origin+indexable html 行,**编码 URL 原样进 sitemap**)+ robots.txt(Allow / + Sitemap 行);④ **route-manifest.json 生成与字段面断言**(spec §12.1:manifest_version/site_id/build_job_id/origin/generated_from_route_snapshot_hash/routes[] 含 exact_key/query_policy/kind/target_file/status/location/content_type/indexable——含 redirect 行与 ?attachment_id= 查询形态)+ build_artifacts 行(dist/manifest 各 kind+哈希);⑤ 构建环境五禁断言:SF_BUILD_INPUT 之外零数据源(loader 单一入口 grep + **DATABASE_URL 置空跑构建仍成功** + **无网证明**:构建进程内 stub global fetch 抛错仍成功——spec §10.4 明文要求) - [ ] 实现:build.service 编排(快照→astro→媒体→sitemap→登记);产物落 `artifacts/jobs//{input,dist,manifests}` - [ ] 绿 → commit `feat(build): astro 构建管线与媒体落盘`