feat: add native road edits document validation

This commit is contained in:
que01 committed 2026-08-26 17:46:02 +08:00
1 parent 93f09e399e
commit 35002371ae
6 files changed
+460 -3

No files matched your search

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