Files
road-compiler/.trellis/tasks/08-31-parameter-panel-binding/research/manifest-range-vs-solver.md
T
que01andClaude Opus 5 4b70b0221d docs: record the crosswalk inset dead zone
Sweeping the declared [0, 8] range and measuring where the group actually lands:
0 to 3.2 tracks one-to-one, and 3.2 to 8 does not move at all. No diagnostic, no
feedback — roughly 60% of the advertised range is inert.

crossingJunctionInset() drives it. targetDistance bottoms out once inset reaches
the approach's cutback, and a 4m cap sits above that, so the real ceiling varies
per approach while the manifest publishes a flat 8 for all of them.

This is worse than the edge-offset case already on file. That one refuses and
says so; this one silently does nothing, which is indistinguishable from a broken
control — the exact failure the interval flag exists to prevent, occurring in the
upper half of a range rather than across a whole handle. A user whose first drag
lands in the dead zone concludes direct editing does not work.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 14:11:57 +08:00

109 lines
4.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# manifest 范围与求解器可行域不一致
日期:2026-08-31
来源:`08-31-parameter-panel-binding` 实施期间对运行中工作台(`osm-KZZP9U`)的实测。
## 现象
手柄 `handle:road-edge-offset:segment:way/-3246/0:left`,manifest 声明
`value.min = -2.925`、`value.max = 2.925`(即 `±width * 0.45`,道路宽 6.5m)。
逐值探测 `POST /api/edit-preview`:
| offsetMeters | 阻塞诊断 |
| --- | --- |
| -2.90 | `direct-edit-outer-edges-cross` |
| -2.00 | `direct-edit-outer-edges-cross` |
| -1.00 | `direct-edit-outer-edges-cross` |
| **-0.50** | **(无)** |
| **0.00** | **(无)** |
| **0.50** | **(无)** |
| **1.00** | **(无)** |
| 2.00 | `direct-edit-outer-edges-cross` |
| 2.90 | `direct-edit-outer-edges-cross` |
| 500 | `direct-edit-outer-edges-cross` |
探针构造已排除误报:小幅值干净,说明请求本身合法。
## 结论
**manifest 宣告的范围比求解器实际接受的可行域宽约 3 倍,且双向都是。**
真实边界落在 `(-1.0, -0.5]` 与 `[1.0, 2.0)` 之间,未进一步二分。
失败原因未查明。`direct-edit-outer-edges-cross` 对应 design.md 的
「同一站点左右外缘不得交叉」不变量,但仅移动**单侧**外缘 1m
(6.5m 宽的路)为何会触发交叉,需要读 `compileGeometry()` 才能确定——
可能经由车道最小宽度 2.4m 派生,也可能诊断名不完全对应其实际判据。
## 与既有行为的关系
这不是本任务引入的。拖拽一直夹到 `±2.925`,所以用户一直能拖进被拒区间——
拖过约 1m 后几何冻结、诊断出现,而手柄继续走到 2.925。
按 design.md「无效草稿不替换最后一个有效预览」,这是既定行为。
参数面板没有改变它,但**把它变可见了**:范围以文字打印,且极值可一键填入。
点击极值会得到一个必被服务端拒绝的值。
## 处理
未在本任务修改。理由:
- 客户端范围校验必须用 manifest 的 `min`/`max`,用别的就是发明第二个真相来源
(`direct-edit-client.md` §2)。
- 收窄范围需要求解器解析地算出外缘交叉的可行区间,属求解器工作,
本任务明确排除。
- 点击极值的结果是一个诚实的服务端拒绝:诊断可见、最后一个有效预览保留、可撤销。
不是静默破坏。
已并入 `08-31-constraint-range-validation` 的需求。
---
# 追加:`junction-crosswalk-inset` 的静默死区
日期:2026-08-31,区域 `nantaizihu-9PTsZg`。
手柄 `handle:junction-crosswalk-inset:node/1140799725:segment:way/-3246/0`
声明 `value.min = 0`、`value.max = 8`。逐值提交预览并测量该组 6 条斑马线的中心位移:
| inset | 相对 inset=0 的位移 | 增量 |
| --- | --- | --- |
| 0 | 0.00 | — |
| 0.5 | 0.50 | +0.50 |
| 1.0 | 1.00 | +0.50 |
| 2.0 | 2.00 | +0.50 |
| 3.0 | 3.00 | +0.50 |
| 4.0 | 3.20 | +0.20 |
| 5.0 | 3.20 | **+0.00** |
| 6.0 | 3.20 | **+0.00** |
| 8.0 | 3.20 | **+0.00** |
`0 → 3.2` 是干净的 1:1 线性响应;`3.2 → 8` **完全无响应,且无任何诊断**。
## 成因
`crossingJunctionInset()`(`native-road.js:1325`):
```js
const targetDistance = Math.max(0, plan.cutbackMeters - inset);
return Math.min(CROSSWALK_MAX_JUNCTION_INSET_METERS,
Math.max(0, candidate.junctionDistanceMeters - targetDistance));
```
inset 增至 `plan.cutbackMeters` 后 `targetDistance` 触底为 0,再增无效;
外层 `CROSSWALK_MAX_JUNCTION_INSET_METERS = 4` 另有封顶。
因此有效上界是 `min(cutbackMeters, …)` 的某个函数,**逐进口不同**,
而 manifest 对所有进口一律发布固定的 `max: 8`。
## 为何比外缘偏移那例更严重
外缘偏移越界会返回阻塞诊断——用户看得到"不行"。
本例越界**什么都不发生**:拖动手柄,几何纹丝不动,没有诊断、没有提示。
与「控件坏了」无法区分。
这正是 `flag.ts` 为 `profile.interval` 立下的规矩所要避免的
(「一个拖了没效果的控件比没有控件更糟」),区别只在于它发生在量程的上半段,
而不是整个控件。
若用户在已处于死区的进口上首次尝试拖拽,得到的印象就是"直接编辑不工作"。