docs(spec): 采纳复审三条建议——字段重命名显式化、storage/sitemap 入目录树、媒体tier2与redirect目标测试用例

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-10-20 16:19:49 +08:00
parent 2922bb2e10
commit 2f4110f856
@@ -64,7 +64,7 @@ cms-one/
packages/adapter-wordpress/ # WXR 解析器(WP REST 客户端为后续阶段实现,本切片不含)
themes/pilot-minimal/ # 极简 Astro 主题
scripts/ # CLI:import.ts / publish.ts / build.ts / gate.ts / preview.ts
storage/wxr/ storage/media/ # 试点数据副本(git 忽略)
storage/wxr/ storage/media/ storage/sitemap/ # 试点数据副本:WXR、媒体、老站 sitemap(git 忽略)
infra/docker-compose.yml # 仅 PostgreSQL
tests/fixtures/ # WXR/媒体夹具
docs/
@@ -94,7 +94,7 @@ cms-one/
### 5.2 route_registry(独立表,禁止塞 settings JSONB——cms 教训)
切片字段子集(V3.0 §6.4):`site_id / original_path / normalized_lookup_key / route_kind / target_content_id / target_file / redirect_location / indexable / source_status / source_snapshot_id`。
切片字段子集(V3.0 §6.4):`site_id / original_path / normalized_lookup_key / route_kind / target_content_id / target_file / redirect_location / indexable / source_status / source_snapshot_id`(其中 `source_snapshot_id` 在本切片实现为 `source_import_job_id` → import_jobs,正式快照表后续阶段引入)。
规范化键规则(仅作查重与对照,原始路径永不改写):percent-decode → Unicode NFC → 小写 → 去尾部斜杠。查重命中仅大小写/尾斜杠差异时**报告冲突**,不静默合并(V3.0 §6.3)。
@@ -209,8 +209,8 @@ Astro 构建(themes/pilot-minimal):
| 单元:WXR 解析 | 夹具必须覆盖:`_thumbnail_id`、`_product_image_gallery`、`wppop_sections`(PHP serialize 的 Tab 数据)、Yoast `_yoast_wpseo_title/metadesc`、全角/编码损坏文件名、分页与术语 URL 推导、`.html` 后缀 permalink(全部来自 cms 实际踩坑清单) |
| 单元:路由规则 | §5.1 每行规则一个用例;大小写/尾斜杠冲突报告 |
| 单元:解析器限额 | 超大/畸形 XML(节点数、大小、时限超限)→ 明确失败不崩溃;CDATA、实体、命名空间边界夹具 |
| 单元:媒体安全 | 魔数与扩展名不符 → 报告;SVG → 进隔离清单 |
| 单元:重定向图 | 环 → 🔴;多跳 → 告警 |
| 单元:媒体安全 | 魔数与扩展名不符 → 报告;SVG → 进隔离清单;**tier 2 专项**:已注册但本地文件缺失 → 构建成功 + 门禁 🔴 |
| 单元:重定向图 | 环 → 🔴;多跳 → 告警;redirect 目标不存在 → 🔴 |
| 集成:导入 | 真实 WXR 小切片夹具 → 落库 → 断言修订/checksum/幂等(第二次 0 新修订) |
| 集成:构建 | 快照物化 → Astro 构建 → 产物结构断言(sitemap/robots/媒体旧路径/_redirects) |
| 负向 | 输入损坏 → 构建失败(兜底禁令);route_registry 缺目标 → 门禁 🔴 |