feat: add native road edits document validation

This commit is contained in:
2026-08-26 17:46:02 +08:00
parent 93f09e399e
commit 35002371ae
6 changed files with 460 additions and 3 deletions

View File

@@ -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 无影响。

View File

@@ -12,7 +12,7 @@
"assignee": "dingkang",
"createdAt": "2026-08-26",
"completedAt": null,
"branch": null,
"branch": "feat/direct-edit-documents",
"base_branch": "main",
"worktree_path": null,
"commit": null,