Files
ParkingRobot/docs/superpowers/handoffs/em-full-direction-visualization/phase-01.md
T

85 lines
5.4 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.
# EM 完整方向段规划与可视化修复:阶段 01 交接
## 状态
完成(此前阻塞的构造调用传播已获用户明确授权扩展范围)。
## 环境、入口与前置核验
- 执行时间:2026-08-06T20:56:08.7268822+08:00Windows / PowerShell / .NET SDK 10.0.302。
- 入口分支与 HEAD`trajplanner` / `57ea36b8595c621783aba844e18d9969bccea378`
- 恢复交接祖先:`fcf7df17d54d84904278e993104e131afe8e405d`
- 以下提交均以 `git merge-base --is-ancestor` 返回 0`c354f113060a5f95aa3b06c6f2b0be2d0c7d5da1``dff223c33a439d545537c803cb3531a673c7f2a3``46d5f9762d3d9972daea918c9fb43562ce25ce3b``57ea36b8595c621783aba844e18d9969bccea378``fcf7df17d54d84904278e993104e131afe8e405d`
## 实现提交
- Task 1`f4e89b4b4fe67f4924420ba8b3e06dea1d4ccc8b``feat: define full-direction EM planning scope`
- Task 2`048b4f618e2237cd0cb3d257bf6ee04a1d13670b``feat: select complete EM direction segments`
## 接口与实际修改
- 新增 `EmPlanningScope.RollingHorizon``FullDirectionSegment`request 与 metadata 均保存不可变 scope。
- 新增 desired speed、优化结点/发布上限、终端位置/yaw 容差、复制和交叉校验;默认值为 1.0/0.5 m/s、0.20 s、0.10 m、401、5001、0.03 m、5°。
- 新增 `NoProgress``TerminalPoseMismatch``FullSegmentResourceLimitExceeded` 状态。
- `PlanningHorizonSelector.Select` 显式接收 scopefull 模式仅接受 Goal/GearSwitch,选择真实方向段末端并使用 `ExactStopAtBoundary`rolling 分支保持原有窗口/approach/exact 行为。
- `EmPlanningService` 传递 scopemetadata 与 diagnostics 均携带 scope。
- 用户随后授权的必需构造调用传播:`TrajectoryObservationPipeline.cs` 及 EM 验证宿主中的 coordinator/executor/trajectory/observation 构造夹具;所有旧调用显式使用 `RollingHorizon`,没有改变 MovementTest 的规划行为。
实际修改文件为两个实现提交的 `git show --stat` 所列 21 个文件;Task 2 没有修改 `EmTrajectoryAssembler.cs`,因为现有 assembler 已基于 metadata 保留终端边界,完整段选择无需额外 assembly 行为。
## 新鲜 TDD 与回归证据
### Task 1
RED
```powershell
dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- foundation
dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- em-planning-service
```
首次失败为缺少 `EmPlanningScope`CS0246/CS0103)。同次曾出现 `TrajectoryPlanningVisualization.dll` 瞬时写锁;单独复现后锁未持续,已按 systematic-debugging 认定为外部构建竞争,未作为功能 RED。之后完整构造调用传播获授权。
GREEN:相同两个命令均退出 0,输出:`PASS foundation``PASS em-planning-service`
### Task 2
RED
```powershell
dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- longitudinal-model
```
失败为 `PlanningHorizonSelector.Select` 没有接收新增 scope 参数(CS1501),符合预期。
GREEN
```powershell
dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- longitudinal-model
dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- em-planning-service
```
均退出 0,输出:`PASS longitudinal-model``PASS em-planning-service`。测试覆盖 10 m/投影 3 m/legacy 1 m 的 full 真实末端、rolling 4 m 截断及 GearSwitch 边界;服务测试覆盖 scope metadata 和发布起止边界。
阶段回归:
```powershell
dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- em-core-all
```
退出 0,完整摘要:`PASS longitudinal-model``PASS longitudinal-integration``PASS trajectory``PASS em-planning-service`。首次回归时 `TrajectoryChecks` 的速度夹具受批准的硬上限变更影响,先触发加速度而非速度;夹具改为 1.10 m/s 以继续隔离速度上限,之后回归通过。
## 脏工作区与范围保护
- `EmPlannerConfiguration.cs` 的用户 `DistanceHorizonMeters = 500d` 和两条中文注释先保存 diff、始终未暂存;提交前以 index-only staging 核验其不在两个实现提交中。
- `MovementTest.TrajectoryObservationTest.cs` 未编辑、未暂存、未提交。
- 既有大量脏修改/未跟踪项均未清理;暂存区在本交接创建前为空。
- 未使用 `git stash``git reset --hard``git checkout --``git add .``git add -A`
- `git diff --check 57ea36b8595c621783aba844e18d9969bccea378..048b4f618e2237cd0cb3d257bf6ee04a1d13670b` 通过。
## 未执行内容与阶段 02 输入
阶段 02–09 均未实现。尤其没有实现自适应 knot/T_end、静止起步、NoProgress 发布门禁、终端世界位姿门禁、MovementTest one-shot、Web 或 Painter。
阶段 02 从 `048b4f618e2237cd0cb3d257bf6ee04a1d13670b` 开始,消费本阶段的 scope/configuration。只允许总计划 Task 3 列出的 Longitudinal 文件、`EmPlanningService.cs``LongitudinalModelChecks.cs``LongitudinalIntegrationChecks.cs``phase-02.md`;不得触及静止起步、终端位姿或任何 MovementTest/UI。先运行 Task 3 RED `longitudinal-model`,再运行 `longitudinal-model``longitudinal-integration` GREEN,提交 `feat: derive adaptive full-segment ST schedule`,运行 `em-core-all`,最后单独提交 `phase-02.md`