diff --git a/docs/superpowers/progress/em-planner-progress.md b/docs/superpowers/progress/em-planner-progress.md index 74bbf4b..a666a32 100644 --- a/docs/superpowers/progress/em-planner-progress.md +++ b/docs/superpowers/progress/em-planner-progress.md @@ -2,10 +2,10 @@ ## Current State -- Current stage: 6 — LS SQP and real scenarios +- Current stage: 7 — ST model and longitudinal optimization - Stage status: Completed - Current branch: `trajplanner` -- Last checkpoint commit: `4d83ed2` (last Stage 6 functional commit; this file is the Stage 6 checkpoint) +- Last checkpoint commit: `510bf97` (last Stage 7 functional commit; this file is the Stage 7 checkpoint) - Protocol design baseline: `554c84f` - Implementation-plan baseline: `8dd8ff0` @@ -30,9 +30,15 @@ | 6 | `2026-08-03-em-planner-lateral-ls-implementation.md` | Task 4 — Sequential Convex Outer Loop and Feasible-Candidate Fallback | `f19df53` | RED: `lateral-integration` failed to build with missing `SequentialConvexOptimizer` and `LateralPlanner`; GREEN: `PASS lateral-integration` scripted validation-before-fallback, invalid-vector rejection, `SolvedInaccurate` residual/geometry rejection, 0.05 m trust centering, complete-primal warm starts, five-call cap, cancellation, timeout and facade behavior. | | 6 | `2026-08-03-em-planner-lateral-ls-implementation.md` | Task 5 — Real-OSQP Lateral Scenarios and Gate | `4d83ed2` | RED: `lateral-all` reached the real forward scenario but rejected the empty initial warm start; the subsequent loader diagnosis confirmed the host output bundle intentionally lacks `osqp.dll`. GREEN: the solver-neutral full initial primal and a clean copied plugin-bundle probe produced `PASS lateral-model`, `PASS lateral-integration`, and `PASS lateral-real-osqp` for deterministic forward/reverse straight, gentle curve, seed-connected obstacle narrowing, gear-switch, and rolling scenarios. | +| 7 | `2026-08-03-em-planner-longitudinal-st-implementation.md` | Task 1 — Speed Envelope over Actual PathS | `62ea9db`, correction `25742ab` | RED: `longitudinal-model` first failed with missing longitudinal input/speed-envelope types; the sparse stopping chord and then the discrete jerk-release tail checks also failed before refinement. GREEN: `PASS longitudinal-model` proves actual strictly increasing LS `PathS` consumption, finite curvature/curvature-rate/stopping limits, stopping-distance precheck, dense actual-PathS stations, and discrete deceleration/jerk tail stations. | +| 7 | `2026-08-03-em-planner-longitudinal-st-implementation.md` | Task 2 — Time-Knot Layout, Dynamics, Objective, and Hard Constraints | `c01d0d5` | RED: `longitudinal-model` failed with missing ST candidate/layout/constraint types. GREEN: `PASS longitudinal-model` inspects normalized objective coefficients, solver-neutral `QuadraticProgram` assembly, exact constant-jerk dynamics, monotonic progress, finite physical bounds, exact start state, and hard terminal `s_N`/`u_N`. | +| 7 | `2026-08-03-em-planner-longitudinal-st-implementation.md` | Task 3 — Longitudinal Outer Loop and Strict Validation | `510bf97` | RED: `longitudinal-integration` failed first with missing optimizer/validator/facade types; focused checks then exposed invalid fallback acceptance, sparse envelope probes, noncanonical endpoints, and loss of a strictly validated initial seed on immediate timeout. GREEN: `PASS longitudinal-integration` covers scripted statuses, strict residual/physical validation, deep-copy last-feasible fallback, complete-primal warm starts, the five-iteration cap, cancellation, and deterministic real OSQP forward/reverse/curvature/jerk-stop/short/zero-start scenarios in a clean copied plugin bundle. | + ## Current Verification - Commands: + - `dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- longitudinal-model` + - `dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- longitudinal-integration` - `dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- lateral-integration` - `dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- lateral-all` - `dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- lateral-model` @@ -45,8 +51,10 @@ - `git diff --check` - Result: The Stage 5 `lateral-model` gate exited 0 after all three Task commits. It proves the `4N-1` layout, exact unequal-station dynamics, immutable lateral inputs/results, normalized OSQP-convention P/q assembly, finite hard corridor/derivative/trust/denominator bounds, terminal distinction, full forward/reverse world reconstruction, actual PathS, and independent validation. `optimization`, `osqp`, and all four `all-foundation` groups exited 0. The dependency list remains `KERNEL32.dll`, `VCRUNTIME140.dll`, and API-set CRT DLLs only—no MKL, CUDA or external QDLDL. `git diff --check` had no whitespace diagnostics; immediately before this checkpoint update the staging area was empty and no Stage 5 scope files were uncommitted. - Result: Stage 6 exit commands all exited 0 at `4d83ed2`: `lateral-integration`; `lateral-all` (model, scripted SQP, and clean-plugin real OSQP groups); `optimization`; `osqp`; `all-foundation`; and `git diff --check`. The real OSQP gate runs every fixed scenario twice and compares status, point count, and all lateral-path numeric fields within `1e-10`; the obstacle scenario stays in the negative, seed-connected corridor interval. The LS implementation remains dependent only on `IQpSolver`/`QuadraticProgram`; no LS P/Invoke, UI, hardware object, or current-working-directory dependency was added. +- Result: Stage 7 exit commands all exited 0 from the repository root at `510bf97`: `longitudinal-model`; `longitudinal-integration`; `lateral-integration`; `lateral-all`; `optimization`; `osqp`; `all-foundation`; and `git diff --check`. ST consumes only actual LS `PathS` and reaches OSQP only through `IQpSolver`/`QuadraticProgram`; no ST P/Invoke, UI, hardware object, or current-working-directory dependency was added. The jerk-stop case retains only the independently validated initial seed when OSQP reaches its 4000-iteration limit; the timed-out solver vector is not accepted. +- Baseline note: invoking the pre-existing `lateral-all` test from the `ClumsyPilot` subdirectory fails its pinned-DLL lookup because that Stage 6 test constructs the source path from `Directory.GetCurrentDirectory()`. Running the documented command from the repository root exits 0. Stage 7 does not modify or bypass the completed LS test. - Normal-project baseline: `dotnet build ClumsyPilot/ClumsyPilot.csproj --no-restore` exits 1 only for the legacy `auto_avoidance/MultiWheelAutoAvoidance.cs` missing `NetTopologySuite` (3) and `OpenCvSharp` (1) references, plus that legacy file's duplicate-using warning. There are no EM Planner errors. -- Verified commits: `104081e`, `2abb465`, `39c1708`, `a957fda`, `61dfa79`, `c225b17`, `f703d41`, `0c48a7d`, `f5c69c2`, `f19df53`, and `4d83ed2` +- Verified commits: `104081e`, `2abb465`, `39c1708`, `a957fda`, `61dfa79`, `c225b17`, `f703d41`, `0c48a7d`, `f5c69c2`, `f19df53`, `4d83ed2`, `62ea9db`, `c01d0d5`, `25742ab`, and `510bf97` ## Preserved Workspace State @@ -57,9 +65,9 @@ ## Decisions Needed -- None. Stage 6 completed within scope. +- None. Stage 7 completed within scope. -## Next Stage +## Prior Stage 7 Entry Record - Stage: 7 — ST model and longitudinal optimization - Readiness: Ready for Stage 7 entry checks after this checkpoint is committed. @@ -79,7 +87,7 @@ - The actual-PathS speed envelope, stopping precheck, ST dynamics/QP, and strict longitudinal validation pass. - The Stage 7 plan's full exit gate and `git diff --check` pass; the staging area is empty; a Stage 7 progress checkpoint is committed alone. -## Next-Window Prompt +## Prior Stage 7 Window Prompt (Historical) ```text 请继续 ParkingRobot 仓库的 EM Planner 多窗口实施。 @@ -122,3 +130,55 @@ - 检查暂存区为空、用户的起始 `git status --short` 修改仍被保留;然后只更新并单独提交 `docs/superpowers/progress/em-planner-progress.md`。 - 最终报告必须给出实际提交、命令/退出码、未处理基线问题,并提供阶段 8(仅轨迹发布与单次规划服务 Task 4–6)的精确下一窗口提示词。 ``` + +## Next Stage + +- Stage: 8 — complete trajectory publication and pure one-shot planning service +- Readiness: Ready for Stage 8 entry checks after this checkpoint is committed. +- Plan: `docs/superpowers/plans/2026-08-03-em-planner-longitudinal-st-implementation.md` +- Authorized tasks only: + - Task 4 — Complete Trajectory Assembly and Redundant-Field Consistency + - Task 5 — Independent World-Space Publication Validator + - Task 6 — Pure One-Shot EmPlanningService +- Explicit exclusions: rolling execution, controller adaptation, dynamic obstacles, UI/hardware integration, and every later phase. + +## Next-Window Prompt + +```text +请继续 ParkingRobot 仓库的 EM Planner 多窗口实施。 + +工作目录:D:\Users\Desktop\项目\prakrobot\ParkingRobot + +本窗口只执行阶段 8:完整轨迹发布与纯单次规划服务。唯一授权范围是: +docs/superpowers/plans/2026-08-03-em-planner-longitudinal-st-implementation.md 的 Task 4、Task 5、Task 6。 +不要开始滚动执行、控制适配、动态障碍物、UI/硬件集成或任何后续阶段。 + +开始前必须完整读取: +1. docs/superpowers/specs/2026-08-03-em-planner-ls-st-design.md +2. docs/superpowers/specs/2026-08-03-em-planner-windowed-execution-design.md +3. docs/superpowers/progress/em-planner-progress.md +4. docs/superpowers/plans/2026-08-03-em-planner-longitudinal-st-implementation.md + +使用 executing-plans、test-driven-development 和 verification-before-completion;不要使用子代理。只在 trajplanner 上工作。 + +开始 Task 4 前: +- 确认 a957fda、61dfa79、c225b17、f703d41、0c48a7d、f5c69c2、f19df53、4d83ed2、62ea9db、c01d0d5、25742ab、510bf97 以及紧随其后的 Stage 7 进度 checkpoint 均可从 HEAD 追溯。 +- 保存完整 git status --short 基线,确认暂存区为空,并保留所有既有用户修改。 +- 从仓库根目录运行并确认退出码为 0:longitudinal-model、longitudinal-integration、lateral-all、optimization、osqp、all-foundation。 +- 不使用 git add .、git add -A、清理命令或破坏性 Git 命令;每次仅显式暂存计划指定文件。 +- 不修复、删除、屏蔽或绕过旧 auto_avoidance/MultiWheelAutoAvoidance.cs 基线依赖失败。 +- 已完成的 Stage 6 lateral-all 测试夹具使用当前工作目录定位固定 DLL,因此必须从仓库根目录运行;不要修改已完成 LS 来改变该基线。 + +执行要求: +- 严格逐任务 TDD;Task 4–6 各自独立提交,提交前运行 git diff --cached --check,并用 git diff-tree 核对范围。 +- Task 4 只创建 EMPlanner/Trajectory 下的轨迹组装代码、TrajectoryChecks.cs,并修改验证宿主 Program.cs。必须保证方向符号、速度分量、yaw rate、严格递增时间、不递减 PathS、精确零速终端及 0.20 s hold tail 一致。 +- Task 5 只创建 EmTrajectoryValidator.cs 并修改 TrajectoryChecks.cs。必须独立重算运动学与冗余字段,使用姿态和 0.025 m 最大步长的 swept collision 检查,不得把求解器状态当成发布证据。 +- Task 6 只创建 IEmPlanningService.cs、EmPlanningService.cs、EmPlanningServiceChecks.cs,并修改 Program.cs 与 EMPlanner/README.md。按计划规定的唯一顺序组织纯 Plan(request, cancellationToken) 管线,使用请求时间戳,不读系统时钟,不发布部分求解向量,不修改请求所有的列表。 +- 只能通过 IQpSolver/QuadraticProgram 使用 OSQP;禁止新增 P/Invoke、当前工作目录依赖、UI 或硬件对象。 +- 不修改无关 Map、CoarsePath、PathSmoothing、旧 auto_avoidance、已完成 LS/ST/OSQP 后端;不实现滚动执行、控制适配或动态障碍物。 + +阶段结束时: +- 仅在 Task 4–6 均有独立 RED/GREEN 证据和计划出口验证后,连续两次运行 em-core-all,并运行 longitudinal-model、longitudinal-integration、lateral-all、optimization、osqp、all-foundation 及 git diff --check。 +- 确认暂存区为空、起始用户修改仍保留;只更新并单独提交 docs/superpowers/progress/em-planner-progress.md。 +- 返回提交、RED/GREEN 证据、命令/退出码、未处理基线问题,并明确停在 Task 6。 +```