chore(task): correct the elementId premise and split the first gate

Measured rather than assumed: grouping the 48 stripes by crossing_node_id yields
exactly 8 groups of 6, and no crossing maps to more than one road. The uniqueness
is structural — compileControlMarkings() iterates model.crossings and each pass
emits one group from one candidate — so crosswalk:node/<crossingId> is already a
stable group id and needs no compiler change.

The earlier claim that no group id existed conflated the crossing node
(node/-26452, the pedestrian crossing) with the junction node (node/1140799725).
Different ids. Grouping client-side therefore reads a published identifier rather
than clustering by proximity, which is what the PRD forbids.

The missing affects entries are real and unchanged, but they only degrade
drag highlighting; they do not block selection. The two are now separate steps,
and selection moves first because it costs nothing on the server.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
que01andClaude Opus 5 committed 2026-08-31 13:13:09 +08:00
1 parent 086939be93
commit 623481fd2c
3 files changed
+43 -31

No files matched your search

@@ -39,26 +39,36 @@ interface EditableElement {
第一阶段发布 `position` 与 `length` / `width`:位置沿用现有 `junction-crosswalk-inset`,尺寸需要新的回写规则(见「尺寸的语义」)。`rotation` **不在本任务范围**,理由见文末。
## `affects` 与 `elementId` 是同一个洞
## `elementId` 已经存在
`junctionAffects()`(`direct-edit-solver.js:628`)构造的是
实测:48 条条带按 `crossing_node_id` 分组恰好得到 8 组、每组 6 条,且没有任何
crossing 对应多条道路。唯一性是结构性的——`compileControlMarkings()` 的循环是
`for (const crossing of model.crossings)`,每次迭代由单个 `crosswalkCandidate`
产出一组。
因此 **`crosswalk:node/<crossingId>` 就是稳定的组标识**,无需新增编译器字段。
条带 `native_id` 形如 `crosswalk:node/-26452:1`,组前缀直接可用;
`crossing_node_id` 也已在 feature 属性里。
客户端据此分组**不构成** PRD 禁止的「按经纬度近似聚类」——它读的是已发布的稳定
标识,不是空间猜测。
> 早期分析曾断言组标识缺失,理由是「同一节点的多个进口共用它」。那是把
> **crossing 节点**(`node/-26452`,人行横道)与 **junction 节点**
> (`node/1140799725`,路口)混为一谈了。两者不是同一个 id。
## `affects` 缺失仍是真问题
上一节不影响这一节。`junctionAffects()`(`direct-edit-solver.js:628`)构造的是
`junctionSurfaceId + roadAffects + connectors`,**从不加入 crosswalk 或 stop-line**。
实测在有 48 条斑马线的区域,`junction-crosswalk-inset` 手柄的 `affects` 共 59 项,
其中 crosswalk **为 0**。
crosswalk 为 **0**。
成因是同一个:斑马线 feature id 用的是 `crosswalk:node/<crossing 节点>:<序号>`,
而求解器手上没有「进口 → 斑马线组」的映射。那个关系只存在于编译器的
`compileControlMarkings()` 内部,从未对外发布。
成因是求解器手上没有「进口 → crossing」的映射:该关系在编译器的
`compileControlMarkings()` 内部由 `arrivalEndpointIds` 与距离阈值算出,从未对外发布。
因此下面三件事是一次工作,不是三次:
| 症状 | 需要的东西 |
| --- | --- |
| `affects` 不含斑马线,拖拽高亮会亮错 | 进口 ↔ 斑马线组映射 |
| 没有稳定 `elementId` | 同上 |
| 点条带无法选中整组 | 同上 |
补上映射并随 manifest 发布,三者一起解决。这也是第一阶段的第一个门禁。
后果限于**拖拽高亮会亮错一片**(PRD 第 2 条要求高亮受影响对象)。
它**不阻塞选中**,因为选中走的是上一节的组标识。两者是独立的两步。
## 编辑与预览