diff --git a/docs/superpowers/progress/em-planner-progress.md b/docs/superpowers/progress/em-planner-progress.md index e65c18f..74bbf4b 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: 5 — LS model and geometry validation +- Current stage: 6 — LS SQP and real scenarios - Stage status: Completed - Current branch: `trajplanner` -- Last checkpoint commit: `0c48a7d` (last Stage 5 functional commit; this file is the Stage 5 checkpoint) +- Last checkpoint commit: `4d83ed2` (last Stage 6 functional commit; this file is the Stage 6 checkpoint) - Protocol design baseline: `554c84f` - Implementation-plan baseline: `8dd8ff0` @@ -27,10 +27,14 @@ | 5 | `2026-08-03-em-planner-lateral-ls-implementation.md` | Task 1 — Variable Layout and Exact Discrete Lateral Dynamics | `c225b17` | RED: `lateral-model` failed to build with missing `LateralVariableLayout`; GREEN: `PASS lateral-model` covered contiguous `4N-1` indices, range checks, unequal-S exact integration, station/corridor/start validation, defensive copies, and the lateral result publication contract. | | 5 | `2026-08-03-em-planner-lateral-ls-implementation.md` | Task 2 — Normalized Objective and Linear Hard Constraints | `f703d41` | RED: `lateral-model` failed to build with missing `LateralObjectiveBuilder`; GREEN: `PASS lateral-model` inspected normalized P/q coefficients with `1e-12` comparisons, exact integration equalities, finite hard bounds, goal/gear versus rolling terminal behavior, empty-intersection early failure, and the solver-neutral fake-QP boundary. | | 5 | `2026-08-03-em-planner-lateral-ls-implementation.md` | Task 3 — Nonlinear Geometry Evaluation and Independent Validation | `0c48a7d` | RED: `lateral-model` failed to build with missing `LateralGeometryEvaluator`; GREEN: `PASS lateral-model` covered straight and constant-curvature references in forward/reverse, full Frenet curvature, actual strictly increasing PathS, curvature/yaw-rate signs, and rejection of denominator, curvature, non-finite, and independently recomputed world-geometry violations. | +| 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. | ## Current Verification - Commands: + - `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` - `1..20 | ForEach-Object { dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- osqp; if ($LASTEXITCODE -ne 0) { throw "OSQP verification failed on iteration $_" } }` - `dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- optimization` @@ -40,38 +44,40 @@ - Clean copied plugin bundle: run `EMPlannerVerificationHost.exe osqp-probe` from a separate working directory. - `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. - 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`, and `0c48a7d` +- Verified commits: `104081e`, `2abb465`, `39c1708`, `a957fda`, `61dfa79`, `c225b17`, `f703d41`, `0c48a7d`, `f5c69c2`, `f19df53`, and `4d83ed2` ## Preserved Workspace State -- The workspace continues to contain many unrelated Map, CoarsePath, PathSmoothing, project-file, report, and documentation changes. They belong to the user and remain untouched and unstaged. +- The workspace continues to contain the same unrelated Map, CoarsePath, PathSmoothing, project-file, report, and documentation changes captured at Stage 6 entry. They belong to the user and remain untouched and unstaged. - Use explicit file paths for every `git add`; never stage the whole workspace. - The existing user hunk in `ClumsyPilot/ClumsyPilot.csproj` remains preserved. Do not clean, rewrite, or stage it. - The normal `ClumsyPilot.csproj` build remains blocked by legacy `auto_avoidance/MultiWheelAutoAvoidance.cs` references to `NetTopologySuite` and `OpenCvSharp`; do not delete or bypass legacy functionality to change this baseline. ## Decisions Needed -- None. Stage 5 completed within scope. +- None. Stage 6 completed within scope. ## Next Stage -- Stage: 6 — LS SQP and real scenarios -- Readiness: Ready for Stage 6 entry checks after this checkpoint is committed. -- Plan: `docs/superpowers/plans/2026-08-03-em-planner-lateral-ls-implementation.md` +- Stage: 7 — ST model and longitudinal optimization +- Readiness: Ready for Stage 7 entry checks after this checkpoint is committed. +- Plan: `docs/superpowers/plans/2026-08-03-em-planner-longitudinal-st-implementation.md` - Tasks: - - Task 4 — Sequential Convex Outer Loop and Feasible-Candidate Fallback - - Task 5 — Real-OSQP Lateral Scenarios and Gate + - Task 1 — Speed Envelope over Actual PathS + - Task 2 — Time-Knot Layout, Dynamics, Objective, and Hard Constraints + - Task 3 — Longitudinal Outer Loop and Strict Validation - Entry checks: - - Confirm branch `trajplanner`, `a957fda`, `61dfa79`, `c225b17`, `f703d41`, and `0c48a7d` are ancestors of `HEAD`, and the Stage 5 progress checkpoint is present. + - Confirm branch `trajplanner`, `a957fda`, `61dfa79`, `c225b17`, `f703d41`, `0c48a7d`, `f5c69c2`, `f19df53`, and `4d83ed2` are ancestors of `HEAD`, and the Stage 6 progress checkpoint is present. - Capture `git status --short` before editing and preserve every unrelated user change. - - Read the two EM Planner design documents, this progress file, and the lateral-LS implementation plan in full. - - Run `lateral-model`, `optimization`, `osqp`, and `all-foundation` before Task 4. - - Keep the OSQP boundary solver-neutral; SQP must consume `IQpSolver` rather than native OSQP types. + - Read the two EM Planner design documents, this progress file, and the longitudinal-ST implementation plan in full. + - Run `lateral-integration`, `lateral-all`, `optimization`, `osqp`, and `all-foundation` before Task 1. + - ST must consume actual, strictly increasing LS `PathS` and keep the OSQP boundary solver-neutral through `IQpSolver`. - Exit gate: - - Tasks 4–5 each have an independent commit and their prescribed RED/GREEN evidence. - - SQP trust-region/last-feasible fallback tests and fixed real-OSQP lateral scenarios pass; the output uses actual PathS. - - `lateral-integration`, `lateral-all`, `optimization`, `osqp`, `all-foundation`, and `git diff --check` pass; the staging area is empty; a Stage 6 progress checkpoint is committed alone. + - Tasks 1–3 each have an independent commit and their prescribed RED/GREEN evidence. + - 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 @@ -80,24 +86,25 @@ 工作目录:D:\Users\Desktop\项目\prakrobot\ParkingRobot -本窗口只执行阶段 6:LS SQP 与真实场景。唯一授权范围是: -`docs/superpowers/plans/2026-08-03-em-planner-lateral-ls-implementation.md` 的 Task 4、Task 5。 -不要开始 ST、轨迹发布、滚动执行、控制适配、动态障碍物或任何后续阶段。 +本窗口只执行阶段 7:ST 模型与纵向优化。唯一授权范围是: +`docs/superpowers/plans/2026-08-03-em-planner-longitudinal-st-implementation.md` 的 Task 1、Task 2、Task 3。 +不要开始轨迹发布、单次规划服务、滚动执行、控制适配、动态障碍物或任何后续阶段。 -开始任何检查或编辑前,必须完整读取: +开始前必须完整读取: 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-lateral-ls-implementation.md` +4. `docs/superpowers/plans/2026-08-03-em-planner-longitudinal-st-implementation.md` -使用 `executing-plans`、`test-driven-development` 和 `verification-before-completion`;不要使用子代理。只在 `trajplanner` 上工作。Stage 5 的功能提交必须可从 `HEAD` 追溯:`c225b17`(LS 模型)、`f703d41`(LS QP 装配)与 `0c48a7d`(LS 几何验证);随后是本进度文件的独立 Stage 5 checkpoint。若这些提交、进度记录或入口验证任一不一致,停止实施并先报告事实,不要猜测或重做已提交工作。 +使用 `executing-plans`、`test-driven-development` 和 `verification-before-completion`;不要使用子代理。只在 `trajplanner` 上工作。Stage 4–6 提交必须可从 `HEAD` 追溯:`a957fda`、`61dfa79`、`c225b17`、`f703d41`、`0c48a7d`、`f5c69c2`、`f19df53` 和 `4d83ed2`;随后是本进度文件的独立 Stage 6 checkpoint。若这些提交、进度记录或入口验证任一不一致,停止实施并先报告事实,不要猜测或重做已提交工作。 -开始 Task 4 前: +开始 Task 1 前: - 保存完整 `git status --short` 基线,确认暂存区为空;工作区已有大量与 EM 无关的 Map、CoarsePath、PathSmoothing、报告、文档、项目文件和未跟踪修改,必须完整保留。 - 不得使用 `git add .`、`git add -A`、`git reset --hard`、`git checkout --` 或任何清理命令;每次只用显式路径暂存计划指定文件。 - 运行以下隔离入口验证,并确认全部退出码为 0: ```powershell - dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- lateral-model + 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 -- optimization dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- osqp dotnet run --project ClumsyPilot/tests/EMPlannerVerificationHost/EMPlannerVerificationHost.csproj -- all-foundation @@ -106,12 +113,12 @@ 实施约束: - 严格逐任务 TDD:先增加该任务的最小失败检查,观察其因缺少目标行为而失败,再写最小生产代码,并运行计划指定 GREEN 验证。 -- Task 4、5 各自形成独立功能提交;提交前用 `git diff --cached --check` 和 `git diff-tree` 核对文件集合。 -- LS 只能通过既有的 solver-neutral `IQpSolver`/`QuadraticProgram` 边界使用 OSQP,不能向 LS 引入 P/Invoke、当前工作目录依赖、UI 或硬件对象。 -- 不修改无关的 Map、CoarsePath、PathSmoothing、旧 `auto_avoidance` 或 Stage 4 已完成的 OSQP 后端,除非该 LS 计划明确列出且变更为完成 Task 4–5 所必需。 +- Task 1、2、3 各自形成独立功能提交;提交前用 `git diff --cached --check` 和 `git diff-tree` 核对文件集合。 +- ST 只能消费 LS 输出的实际、严格递增 `PathS`,并且只能通过既有 solver-neutral `IQpSolver`/`QuadraticProgram` 边界使用 OSQP;不能向 ST 引入 P/Invoke、当前工作目录依赖、UI 或硬件对象。 +- 不修改无关的 Map、CoarsePath、PathSmoothing、旧 `auto_avoidance`、已完成 LS 或 OSQP 后端;不实现轨迹发布、滚动执行、控制适配或动态障碍物。 阶段结束条件: -- 仅在 Task 4–5 均有独立提交、各自 RED/GREEN 证据和该计划全部出口验证通过后,运行 `lateral-integration`、`lateral-all`、`optimization`、`osqp`、`all-foundation` 及 `git diff --check`。 +- 仅在 Task 1–3 均有独立提交、各自 RED/GREEN 证据和该计划全部出口验证通过后,运行 Stage 7 规定的 LS/ST/优化/OSQP/Foundation 回归及 `git diff --check`。 - 检查暂存区为空、用户的起始 `git status --short` 修改仍被保留;然后只更新并单独提交 `docs/superpowers/progress/em-planner-progress.md`。 -- 最终报告必须给出实际提交、命令/退出码、未处理基线问题,并提供阶段 7(仅 ST Task 1–3)的精确下一窗口提示词。 +- 最终报告必须给出实际提交、命令/退出码、未处理基线问题,并提供阶段 8(仅轨迹发布与单次规划服务 Task 4–6)的精确下一窗口提示词。 ```