AutoForge/prompts/Step-05A-Report.md

14 KiB
Raw Blame History

# Step-05A Corrective Report

Identifier: Step-05A
Title: Complete and verify the assigned live dashboard
Status: COMPLETE - worker implementation and assigned verification completed; pending manual orchestrator review. Step-05 is not accepted by this worker.

## Summary

Completed the original Step-05 dashboard contract rather than expanding its scope. The same small in-memory numeric/bar editor and panel now work in the existing `/diagnostics` static-v1 and `/simulation` dynamics-v2 workflows. Actual session-verified signal metadata drives choices and readings. Acquisition is shared and owned by the real DiagnosticSession lifetime, independent of widget visibility. The panel exposes definition validation, exact source/sample context, quality, range, and lifecycle state.

No new project, package, host, persistence, charting, unit conversion, hardware access, or real-vehicle claim was introduced. The dashboard remains limited to eight numeric or horizontal-bar gauges.

## Pre-fix failure and correction

Reproduced the reported first-start defect: after unrelated manual signal reads, the host attempted to replace definitions before the new feed had identity-verified bindings. Validation therefore rejected the definitions; starting without prior reads instead left an empty dashboard with no editor. The original host also lacked the shared simulation dashboard and did not render background feed changes reliably.

The shared panel now starts acquisition on the actual session first and exposes only bindings discovered by that feed. Valid definitions can then be added or edited without changing the source. Stop/restart and reset/close follow session ownership. Dashboard UI subscriptions dispatch snapshot changes through the renderer and do not own or stop polling.

## Implementation and interfaces

- Application: `LiveDashboardModels.cs` and `LiveDashboardAcquisition.cs` define validated definitions, snapshots, feed/factory, identity-verified discovery and reads, grouped per-module polling, state/error/range projection, and a controlled scheduler seam. Repeated factory lookup for the same session returns the same owner.
- Session lifecycle: `DiagnosticSessionService.cs` registers the feed as a session-owned resource, cancels before draining, shares concurrent disposal completion, and reports cleanup failures without skipping session cleanup.
- UI: `LiveDashboardPanel.razor` supplies the common editor/panel and snapshot subscription to both existing hosts. The UI composition registers the service once through `AddAutoForgeUi`; no Client-only duplicate registration remains.
- Generic component: `LiveDashboardGauge.razor` in the pure Components project safely renders numeric and bounded bar states without an AutoForge project dependency.
- Host integration: diagnostics and simulation pages/view models host the same panel and dispose session state at the owning feature boundary.
- Tests: `LiveDashboardGaugeRenderingTests.cs`, `LiveDashboardAcquisitionTests.cs`, and updates to `DiagnosticUiCompositionTests.cs` and `DynamicsWorkflowTests.cs`.

## Original contract mapping: C-01–C-10

| Case | Executed evidence and outcome |
|---|---|
| C-01 | `StaticSession_FirstStartGroupsReadsAndSharesOneOwner` asserts the actual static 850 rpm value, exact rpm unit, Good state, 85% bar projection and source origin. `NumericGauge_RendersARealZeroAndMissingBarNeverCreatesAZeroReading` verifies real zero. `BarGauge_RendersFiniteProjectionStateAndSafeText` verifies visible geometry and escaped text. |
| C-02 | `RealStaticReadsPreserveRangeQualityFailureAndRecoveryStates` asserts actual -10 and 1100 values, low/high range states, and 0%/100% clamped geometry. `BarGauge_ShowsActualOutOfRangeValueAndClampedAccessibleGeometry` checks visible value, range description and accessible geometry. |
| C-03 | `RealStaticReadsPreserveRangeQualityFailureAndRecoveryStates` checks Unknown `--` with no bar percentage and finite Uncertain data with an explicit Uncertain state/reason. `BarGauge_InvalidGeometryDoesNotRenderAWidth` covers NaN and both infinities without invalid CSS geometry or a false meter. |
| C-04 | `InvalidDefinitionReplacementIsAtomicAndEnforcesZeroToEightLimit` verifies rejection without mutation and the zero-to-eight limit. Native editor smoke visibly rejected an invalid range and an rpm-to-km/h unit mismatch without adding a gauge or stopping acquisition. The validation path also checks finite bounds/span, precision, kind, binding, unit, and identifier constraints before replacement. |
| C-05 | `StaticSession_FirstStartGroupsReadsAndSharesOneOwner` checks same-session factory identity and repeated Start without additional reads. `StopDrainRejectsStartWithoutMutationAndAllowsRetryAfterCleanup` uses a controlled cancellation barrier to verify rejection during drain, unchanged Stopping state, cleanup, and a successful single retry. |
| C-06 | `DirectSessionDisposalDrainsTheFeedAndFactoryRejectsTheClosedSource`, `DiagnosticFeatureScopeDisposalClosesTheSessionOwnedFeed`, and `SessionCloseDrainsPendingReadAndCannotPublishItsLateResponseIntoANewSource` verify actual lifetime cleanup and old-generation isolation, including a delayed response barrier. Native reset/close smoke verified new session/run data did not retain the prior dashboard values. |
| C-07 | `StaticSession_FirstStartGroupsReadsAndSharesOneOwner` verifies a mounted panel receives a later poll on the renderer dispatcher; disposing its renderer leaves the feed Running and subsequent polling continues. Native hide/remove/close smoke also verified widget visibility does not stop monitoring. |
| C-08 | `RealStaticReadsPreserveRangeQualityFailureAndRecoveryStates` covers Good to read-failure Stale with retained sample/reason, no-prior-value Error/`--`, successful recovery, and stopped state. `TerminalSchedulerFailureRetainsLastGoodAsStaleAndStopStillCleansUp` verifies terminal scheduler failure and cleanup. |
| C-09 | `StaticSession_FirstStartGroupsReadsAndSharesOneOwner` asserts one `read.signals` per eligible module per cycle with multiple gauges and no increase on repeated Start; it also checks later polling after panel disposal. `DynamicsSessionKeepsActualV2ModelContextAndMonitoringDoesNotAdvancePausedRun` verifies true v2 model/config/run context and unchanged paused step/time after polling. |
| C-10 | `DiagnosticDashboard_FirstStartAfterManualReadsUsesTheSameSessionsBindings` is the rendered real-DI startup regression. `RealApplicationAndRenderedRoute_RunAndReadDynamicTelemetryWithoutOracle` covers the existing dynamics route. Native workflows exercised the shared editor/panel with actual static and dynamics sessions, without an oracle or parallel host. |

## Acceptance mapping: AC-01–AC-07

| Criterion | Evidence |
|---|---|
| AC-01 | C-01–C-04 above: rendering, range/quality/error projection, invalid geometry and atomic definition validation; focused component and real-provider integration tests passed. |
| AC-02 | C-05–C-08 above: single session owner, controlled drain, direct session/scope cleanup, delayed old-generation isolation, widget-independent acquisition and failure-state cleanup. |
| AC-03 | C-09 above: real static and dynamics providers, grouped reads, per-source timing/context, and paused physics independence; native dynamics smoke additionally verified explicit stepping and non-advancing polls while paused. |
| AC-04 | C-10 above: both existing hosts use the actual Application feed and the generic pure Components gauge; rendered-route and native evidence passed. |
| AC-05 | Original 207 tests remain; final complete Release run passed 133 unit and 91 integration tests (224 total, 0 failed, 0 skipped). All nine solution projects built in Release. The required native static/dynamics workflow was executed, with the final rebuilt Client also rechecked as detailed below. |
| AC-06 | README, documentation index, architecture, build/test guide, simulation guide, and new live-dashboard guide were updated. This report distinguishes controlled tests from native observations and records scope limits. |
| AC-07 | Protected pre-existing prompt history and workflow state were preserved; this corrective report is the only prompt file newly created for this assignment. Worker verification is complete; manual orchestrator review remains pending. |

## Commands and results

Focused component test: `dotnet test .\src\tests\AutoForge.UnitTests\AutoForge.UnitTests.csproj --configuration Release --no-restore --filter FullyQualifiedName~LiveDashboardGaugeRenderingTests` — 7 passed, 0 failed, 0 skipped.

Focused feed/rendered-route tests: `dotnet test .\src\tests\AutoForge.IntegrationTests\AutoForge.IntegrationTests.csproj --configuration Release --no-restore --filter "FullyQualifiedName~LiveDashboard|FullyQualifiedName~RealApplicationAndRenderedRoute"` — 10 passed, 0 failed, 0 skipped.

Focused real dynamics route: `dotnet test .\src\tests\AutoForge.IntegrationTests\AutoForge.IntegrationTests.csproj --configuration Release --no-restore --filter FullyQualifiedName~RealApplicationAndRenderedRoute_RunAndReadDynamicTelemetryWithoutOracle` — 1 passed, 0 failed, 0 skipped.

Required sequential full commands:

- `dotnet build .\src\AutoForge.slnx --configuration Release --no-restore` — all nine projects succeeded; 0 warnings, 0 errors. The MAUI XAML source-generation notice was informational.
- `dotnet test .\src\AutoForge.slnx --configuration Release --no-build` — 133 unit and 91 integration tests passed; 224 total, 0 failed, 0 skipped. This preserves the recorded 126-unit/81-integration baseline and adds 17 dashboard-focused cases.
- `git diff --check` — passed; Git emitted only line-ending conversion notices for existing documentation files.

## Native versus controlled verification

Controlled evidence uses the real diagnostic session/service/provider and rewriting transport with a deterministic dashboard scheduler/barriers; it is not a mock dashboard service. It covers transport read failure/recovery, unit change/removal, terminal scheduler failure, delayed replies, and controlled stop drain. Native editor smoke exercised actual visible validation. A production native transport-failure selector was not added; the corresponding failure/recovery behavior is covered in the controlled real-provider tests.

The full Windows Client/WebView2 smoke exercised:

- `/diagnostics`: actual synthetic static profile/provider/session; numeric 850 rpm; bar 850 rpm at 0% below range and 85% after editing to 0..1000; invalid range and unit rejection; gauge edit/remove/hide while polling; Stop/restart; reset to a new empty session; new feed and close.
- `/simulation`: actual v2 dynamics session with `SYNTHETIC_DYNAMIC` signals and request/model/config/run context; explicit 200-step command updated readings to step 201 / 20.1 seconds; two subsequent polls did not advance the paused model; reset opened a new step-0 run without old values; close.
- Existing execution-target, profile, home and not-found routes also loaded.

After final source-path review removed the redundant Client dashboard registration, the exact rebuilt Client was relaunched. Both a real static-v1 session and a real dynamics-v2 session reached dashboard cycle 1; each session was closed and its panel removed. This final-build recheck complements, rather than overstates, the complete workflow smoke above.

Observed environment: Windows SDK target 10.0.26100.0; .NET SDK 10.0.402/runtime 10.0.13; MAUI workload 10.0.403 with `maui-windows` manifest 10.0.110; WebView2 Runtime 156.0.4314.50. No dependency restore, package installation, SDK/workload modification, or system update was performed. Both native Client/WebView2 processes were stopped, the final smoke listener on port 9349 was verified closed, and its exact isolated user-data folder was removed.

## Documentation and limitations

The docs describe the in-memory zero-to-eight numeric/bar configuration, explicit identity-verified module/signal/unit binding, exact-unit/no-conversion rule, identifier matching, 250 ms completion-to-next-cycle polling, session-owned acquisition and subscription independence, truthful quality/range/freshness states, and distinct static-v1/dynamics-v2 request versus model context. Step-04 acceptance remains recorded; Step-05 remains pending manual review.

The panel is a current-session live view, not persistence, charts, recording, replay, interpolation, unit conversion, or hardware telemetry. Captures across modules are not claimed simultaneous; polling is not a real-time guarantee and does not advance paused physics. Native smoke uses the synthetic profiles/providers, not a physical vehicle.

## Source-path self-review

Reviewed the first-start ordering and both host paths, then consolidated service registration in `AddAutoForgeUi()` so the UI feature owns composition and the Client contains no redundant dashboard registration. Confirmed one feed per actual DiagnosticSession; cancel-before-drain; retries after a completed Stop; current-unit verification; explicit Unknown/Uncertain/Stale/Error/Stopped/Pending states; finite bounded gauge geometry; renderer-dispatched snapshot updates; and session/reset/close cleanup. `git diff --check` passed. No unrelated pre-existing issue was changed intentionally.

## Preservation review

The pre-existing modified `prompts/ROADMAP.md` and `prompts/STATE.md` were not edited by this corrective task. The pre-existing untracked `prompts/Step-05.md`, `prompts/Step-05-Report.md`, and `prompts/Step-05A.md` were preserved unchanged. No shared gate, protected instruction, assignment, or historical report was altered. Only this `prompts/Step-05A-Report.md` was added under `prompts`.

Worker stop point: implementation and assigned worker verification are complete. Do not treat this report as orchestrator acceptance; Step-05 remains pending manual review.