feat: add native road edits document validation
This commit is contained in:
@@ -14,7 +14,8 @@
|
||||
|
||||
- 目标:`native-road-edits/v2` 的读写与结构校验。
|
||||
- 范围:`src/compile/` 下新增文档模块:6 个 kind、4 种锚点、`anchorSnapshot`、`ConstraintStatus`、`documentVersion`、`operations`。仅结构与取值范围校验。
|
||||
- 验证:`npm run test` 新增 fixture——文档往返无损;越界 `boundaryIndex`(`<1` 或 `>=laneCount`)被拒;非法 station(超出 `0..1`、`start>=end`)被拒;未知 kind 被拒;每次写入 `documentVersion` 递增 1。
|
||||
- 验证:`npm run test` 新增 fixture——文档往返无损;`boundaryIndex` 非整数或 `<1` 被拒;非法 station(超出 `0..1`、`start>=end`)被拒;未知 kind 被拒;kind 与锚点类型不匹配被拒;provenance 指向未记录的 operation 被拒;每次写入 `documentVersion` 递增 1。
|
||||
- 注意:`boundaryIndex >= laneCount` **不**属于 schema 校验——车道数是模型信息,schema 层无从得知。按 `design.md`,该越界在重放时由求解器判定并转 `stale`,归 `direct-edit-solver-api`。
|
||||
- 门禁:校验错误信息能指出具体约束 id 与字段,不是笼统失败。
|
||||
- 回滚点:纯新增模块,无调用方,revert 无影响。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user