From 376427d270477574332febd39fae552aef00a942 Mon Sep 17 00:00:00 2001 From: que01 Date: Fri, 11 Sep 2026 12:40:46 +0800 Subject: [PATCH] fix: default complex junction crosswalks --- .../validation-report.md | 2 +- src/compile/complex-junction.js | 3 +-- test/index.js | 9 +++------ test/workbench-edit-api.js | 4 ++-- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.trellis/tasks/09-08-junction-reference-fidelity/validation-report.md b/.trellis/tasks/09-08-junction-reference-fidelity/validation-report.md index f916ecd..d4d14fb 100644 --- a/.trellis/tasks/09-08-junction-reference-fidelity/validation-report.md +++ b/.trellis/tasks/09-08-junction-reference-fidelity/validation-report.md @@ -16,7 +16,7 @@ | A3 | 通过(可行结构);分隔核心按规则拒绝 | 入口环有限、闭合、正面积、无自交;必要连接、孔洞和排除区回归;共享接缝实测误差 ≤1 cm,并覆盖人为 2 m 损坏检测。 | | A4 | 通过 | `test/e2e/workbench.spec.ts` 的 12 项浏览器回归覆盖三臂结构和真实五臂工作台的位姿、方向、左右边界、过渡长度、撤销、保存、重编译、刷新。 | | A5 | 通过 | solver/manifest 共用可行域;越界、来源长度不足、拓扑变化和 409 均返回明确诊断或重检状态,不静默截断。 | -| A6 | 通过 | 来源 crossing 节点才生成复杂斑马线;无来源标记 `unknown-no-crossing-source` 并省略;已知排除区和步行连接保留 provenance。 | +| A6 | 通过 | 复杂路口在有效进口铺装上默认生成斑马线;有来源 crossing 节点时保留来源 provenance,无来源时标记 `unknown-no-crossing-source`。简单路口继续使用原有设施路径。已知排除区和步行连接保留 provenance。 | | A7 | 通过 | 工作台 API/E2E 验证预览、保存、409 重试、撤销重做、刷新回放和版本保护。 | | A8 | 部分通过,待用户视觉确认 | 未调参真实 OSM 的纯效果和调试效果已刷新;原始三组图片只作定性观察,未配准不作为几何真值。 | diff --git a/src/compile/complex-junction.js b/src/compile/complex-junction.js index fbe8e15..3cd7c04 100644 --- a/src/compile/complex-junction.js +++ b/src/compile/complex-junction.js @@ -250,11 +250,10 @@ function buildComplexJunctionGeometry(model, cluster, helpers) { `crossing:${arm.key}`, arm.members.flatMap((item) => item.approach.roadIds.map(String)), 'complex-junction-crossing-source-missing', - '该进口未找到匹配的 OSM 过街节点,过街状态未知,未生成斑马线。', + '该进口未找到匹配的 OSM 过街节点,过街来源未知,按复杂路口默认生成斑马线。', envelope.center, ), ); - continue; } arm.crosswalkFrame = { center: envelope.center, diff --git a/test/index.js b/test/index.js index d0d54ad..cd9511d 100644 --- a/test/index.js +++ b/test/index.js @@ -424,14 +424,11 @@ assert.equal( assert.ok(complexGeometry.diagnostics.some((item) => item.rule === 'complex-junction-corner-facilities-omitted')); assert.equal( complexGeometry.crosswalks.features.some((feature) => feature.properties?.kind === 'complex-crosswalk'), - false, - 'complex approaches without source crossing evidence must not synthesize zebra crossings', + true, + 'complex approaches default to zebra crossings when pavement is available', ); assert.ok(complexGeometry.diagnostics.some((item) => item.rule === 'complex-junction-crossing-source-missing')); -assert.match( - complexGeometry.diagnostics.find((item) => item.rule === 'complex-junction-generated').message, - /0 组斑马线/, -); +assert.match(complexGeometry.diagnostics.find((item) => item.rule === 'complex-junction-generated').message, /斑马线/); const inferredStopLine = complexGeometry.vehicleStopLines.features.find( (feature) => feature.properties?.kind === 'complex-stop-line', ); diff --git a/test/workbench-edit-api.js b/test/workbench-edit-api.js index bcc458a..bdd5b8e 100644 --- a/test/workbench-edit-api.js +++ b/test/workbench-edit-api.js @@ -262,8 +262,8 @@ const unsourcedPreview = editPreview(unsourcedComplexArea, { }); assert.equal( unsourcedPreview.layers.crosswalks.features.some((feature) => feature.properties.kind === 'complex-crosswalk'), - false, - 'the default fixture must not synthesize complex crossings without source evidence', + true, + 'complex junctions default to crossings when pavement is available', ); for (const response of [unsourcedState, unsourcedPreview]) assert.equal(