Files
CM95/docs/CM95_S52_ProductionPipeline_v2.md
2026-09-18 07:33:17 +08:00

111 lines
3.2 KiB
Markdown
Raw 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.
# CM95 S-52 Production Pipeline v2
## 1. 目标
Production Pipeline v2 将已经通过单 Tile 验证的 S-52 runtime PBF 正式接入现有 CM95 生产编排层,并增加可审计 AOI 计划能力。
核心要求是:同一个 release identity 不允许混入不同 S-52 Lookup、不同 mariner mode 或不同 AOI 的 Tile。
## 2. Production Plan v2
新计划 schema:
```text
navsea.cm95.production-plan/v2
```
Pipeline 版本:
```text
cm95pbf-production/2.0-s52-aoi
```
Plan immutable hash 现在除 Dataset、mapping、policy、FID manifest、Builder Contract、jobs 外,还冻结:
- S-52 是否启用;
- S-52 Lookup SHA256;
- Point Table;
- Boundary Table;
- `runtime/reference` mariner mode;
- AOI name;
- AOI WGS84 bbox。
S-52 Lookup 路径本身不参与 identity,内容 SHA256 才参与 identity;同内容换路径不会制造新 release。
## 3. AOI 枚举
`plan-production` 新增:
```text
--aoi-name
--aoi-bbox west,south,east,north
```
AOI 在 Web Mercator 中与 Dataset coverage 几何相交并裁剪后再枚举 XYZ job。这样不是简单按 Tile 中心筛选,边界 coverage 也不会被漏掉。
Plan `source_stats` 同时记录 AOI 裁剪前后的 coverage piece 数量。
## 4. S-52 生产参数
`plan-production` 新增:
```text
--s52-lookups
--s52-point-table Simplified|Paper
--s52-boundary-table Plain|Symbolized
--s52-mariner-mode runtime|reference
```
`build-production` 不再从命令行临时接收这些值,而是只能读取冻结 plan,随后传给 `Cm95TileBuilder`。
Build 启动前重新校验 Lookup 文件存在且 SHA256 与 plan 一致;文件发生变化时 fail-closed。
## 5. Runtime release gate
`finalize-production` 在 S-52 runtime plan 下增加 release 级 runtime contract gate。
它会解码所有输出 PBF,并检查:
- `s52_mariner_dependent` 与 `s52_runtime_csp` 一致;
- DEPARE 存在 `depth_min_m`,且没有静态 `s52_area_color` 泄漏;
- DEPCNT 存在 `contour_depth_m`;
- SOUNDG 存在 `s52_sounding_depth_m`;
- OBSTRN/WRECKS 存在 `s52_hazard_depth_m`;
- 不允许 `s52_is_safety_contour`、`s52_isolated_danger`、`s52_display_base_promoted` 等动态最终状态泄漏。
失败会把整个 release 标记为 FAIL。
## 6. Style contract 过渡
当前旧 NavSea semantic style/sprite contract 不是 S-52 runtime Adapter 的最终 contract。
因此 CLI 新增:
```text
--skip-style-contract
```
它只跳过旧 style/sprite 审计,不跳过 PBF 计数、FID、hard gate、encoder、名称冲突和 S-52 runtime contract。待 NavSea `S52RuntimePresentationAdapter` 完成后,再接入正式 S-52 style/runtime contract。
## 7. 兼容性
Loader 继续接受历史 `production-plan/v1`,但新建 plan 一律生成 v2。
旧 release 若没有与新 plan 完全一致的 S-52 production contract,不允许直接通过 `migrate-production-release` 复用 Tile。
## 8. 九州首次运行
本次 AOI:
```text
name = kyushu-main-nearby-v1
bbox = 128.0,29.5,132.5,34.8
zooms = 0-12
profile = delivery
point_table = Paper
boundary_table = Plain
mariner_mode = runtime
```
该范围用于本轮工程验证,覆盖九州本岛、对马、五岛、种子岛/屋久岛及近海,不作为日本行政区边界定义。