From 49c7e5b0c0af90ce770506f7928efb0a4e773e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E8=96=84=E4=BA=91?= Date: Fri, 31 Jul 2026 16:09:20 +0800 Subject: [PATCH] docs: snapshot Local G2 detector report order --- .../2026-07-30-local-g2-path-presmoothing.md | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/superpowers/plans/2026-07-30-local-g2-path-presmoothing.md b/docs/superpowers/plans/2026-07-30-local-g2-path-presmoothing.md index 3a6f98b..32bf1fb 100644 --- a/docs/superpowers/plans/2026-07-30-local-g2-path-presmoothing.md +++ b/docs/superpowers/plans/2026-07-30-local-g2-path-presmoothing.md @@ -1194,14 +1194,26 @@ git commit -m "feat: validate local G2 candidate quality" - Create: `ClumsyPilot/tests/verify_path_smoothing_local_g2_integration.ps1` - Modify: `ClumsyPilot/tests/verify_path_smoothing_service.ps1` +**Planned imports:** + +```csharp +using System.Collections.ObjectModel; +``` + **Interfaces:** - Consumes: validated request, prepared path and fair raw baseline. -- Consumes `LocalG2RegionWorkOrder.TryCreate(...)`; pipeline iteration must not use report-order regions directly. -- Publishes region reports in the detector's original ascending order, independently of processing order. +- Snapshots detector-order regions into an immutable read-only `reportOrder` before + calling `LocalG2RegionWorkOrder.TryCreate(...)`; work-order creation does not + mutate this snapshot, and pipeline iteration must not use report-order regions + directly. +- Publishes region reports by indexed iteration over `reportOrder` in the + detector's original ascending order, independently of processing order. - Produces: ```csharp +private readonly LocalG2RegionWorkOrder _workOrder = new LocalG2RegionWorkOrder(); + internal PathSmoothingResult Smooth( PathSmoothingRequest request, PreparedPath preparedPath, @@ -1291,8 +1303,11 @@ Expected: fail because the service cannot resolve `LocalG2Quintic`. Pipeline pseudocode must be implemented directly: ```csharp +IReadOnlyList reportOrder = + new ReadOnlyCollection(new List(regions)); + if (!_workOrder.TryCreate( - regions, + reportOrder, out IReadOnlyList workRegions, out string orderReason)) { @@ -1350,9 +1365,9 @@ foreach (LocalG2SmoothingRegion region in workRegions) } } -var reports = new List(regions.Count); -for (int reportIndex = 0; reportIndex < regions.Count; reportIndex++) - reports.Add(reportsByRegion[regions[reportIndex]]); +var reports = new List(reportOrder.Count); +for (int reportIndex = 0; reportIndex < reportOrder.Count; reportIndex++) + reports.Add(reportsByRegion[reportOrder[reportIndex]]); ``` Regions are disjoint after merging, so successful earlier replacements remain when a later region fails.