After Step 5

This commit is contained in:
GAJ3T 2026-10-30 01:23:14 -04:00
parent 8372b423d7
commit b7baaddcd1
8 changed files with 689 additions and 113 deletions

View File

@ -343,5 +343,32 @@ After the final source-path cleanup, the rebuilt Client was launched again;
actual static-v1 and dynamics-v2 sessions each reached dashboard cycle 1 and
closed cleanly with the panel removed.
## Step-05B range and boundary verification
The Uncertain projection now computes its range status independently of source
quality. Before the fix, the real-provider regression failed on the actual
Uncertain -10 rpm sample: expected `OutOfRangeLow`, actual `null`. After the
fix, the focused unit suite passed 8 cases and the focused integration selection
passed 3 cases, including real-provider Uncertain -10/1100 readings rendered
through both numeric and bar gauges, Uncertain values at both exact bounds,
atomic invalid-definition vectors, and controlled Stop-drain cleanup.
The full post-fix Release build succeeded for all nine projects with 0 warnings
and 0 errors; the MAUI XAML source-generation notice was informational. The full
Release test suite passed 134 unit and 91 integration tests (225 total, 0
failed, 0 skipped).
On the exact rebuilt native Client and an isolated WebView2 profile, the static
editor configured a horizontal bar from the real `SYNTHETIC_STATIC` engine
signal and displayed 850 rpm. The dynamics editor configured a numeric gauge
from the real `SYNTHETIC_DYNAMIC` engine signal and displayed 260 rpm with
logical tick, model step/time, configuration fingerprint and run identity; the
model was paused at step 1 / 0.1 seconds. Both sessions closed with their
dashboards, the exact test processes and port 9351 were verified stopped, and
the isolated test profile was removed. The older shared WebView2 profile was
left untouched. These native observations confirm the dashboard baseline; the
Uncertain and malformed-input cases are established by controlled tests, not
claimed as native UI injection.
Step-05 worker implementation remains pending manual review; these worker
results are not an orchestrator acceptance.

View File

@ -3,13 +3,13 @@
## Status and authority
- Initialized: 2026-10-28.
- Current phase: Step-05A reviewed; narrow range/validation follow-up before dashboard acceptance.
- Active assignment: [Step-05B](Step-05B.md), ready for manual worker execution.
- Last accepted milestone: Step-04 with Step-04A/Step-04B, accepted 2026-10-28.
- Last accepted correction: Step-04B; all Step-04 findings closed.
- Outstanding corrections: remaining independent Uncertain range status and assigned executable-test/cleanup gaps.
- Step-05 status: REQUIRES FOCUSED CORRECTION / NOT ACCEPTED, reviewed 2026-10-29.
- Step-06 status: owner-approved imperial-default display units; BLOCKED / NOT ASSIGNED until corrected Step-05 acceptance.
- Current phase: corrected configurable dashboard accepted; imperial-default display units next.
- Active assignment: [Step-06](Step-06.md), ready for manual worker execution.
- Last accepted milestone: Step-05 with Step-05A/Step-05B, accepted 2026-10-29.
- Last accepted correction: Step-05B; all Step-05 findings closed.
- Outstanding corrections: none.
- Step-05 status: ACCEPTED after Step-05A/Step-05B, 2026-10-29.
- Step-06 status: READY FOR WORKER; display units/preference not implemented yet.
- Step-07 status: recording/replay moved from former Step-06; BLOCKED until display units are accepted.
- Current state and handoff: [STATE.md](STATE.md).
- Authority: the master charter, repository/handoff amendment, and the owner's
@ -136,10 +136,10 @@ corrective assignment or used to reject otherwise completed prior work.
Insert display units as the next major Step-06. Former unassigned Steps 06-20
become 07-21, with dependencies updated below. No completed assignment/report
or historical decision is renumbered. Do not assign Step-06 until Step-05 and
its actual corrections are accepted.
or historical decision is renumbered. The corrected Step-05 is now accepted;
[Step-06](Step-06.md) supplies the frozen implementation/verification contract.
Bounded intended contract for the later Step-06 assignment:
Bounded contract carried into the Step-06 assignment:
- Keep all physics/calculations, canonical configuration, diagnostic values/
units and source metadata unchanged in SI/source units. Conversion is a
@ -351,11 +351,11 @@ UI unrestricted programming authority.
Step-01, Step-01A, corrected Step-02 and corrected Step-03 remain accepted.
Corrected Step-04 is accepted with original and corrective evidence preserved.
Step-05A supplies the configured static/dynamic workflow, session owner,
visible gauges, new tests/docs and native evidence. Dashboard acceptance still
requires the narrow Step-05B range/validation follow-up. Step-05B is the only
active assignment. Newly approved display units are next as Step-06; recording/
replay moves to Step-07. The units request does not alter prior frozen criteria.
Step-05 with Step-05A/05B is accepted: the configured static/dynamic workflow,
single session owner, independent range/quality, safe gauges, decisive tests and
native evidence have been reviewed. Step-06 is the only active assignment for
newly approved display units. Recording/replay remains Step-07 and blocked until
that work is accepted. The units request did not alter prior frozen criteria.
Dependencies indicate acceptance prerequisites, not permission for automatic
handoff. Later assignments refine these scopes using actual implementation
evidence; they must not silently discard required capabilities.
@ -372,10 +372,10 @@ evidence; they must not silently discard required capabilities.
| 04 | Deterministic vehicle dynamics | 03, 03A and 03B accepted | ACCEPTED 2026-10-28 AFTER 04A/04B | Coupled numeric scenario gates, strict config/run/v2 binding, typed failures and deterministic lifecycle ownership inspected |
| 04A | Dynamics input, drivetrain and lifecycle integrity correction | 04 review findings | ACCEPTED 2026-10-28 AFTER 04B | Reference/kinematic/progress/failure/ownership corrections and independent/controlled evidence inspected |
| 04B | Side-effect-free lifecycle rejection during owner drain | Existing 04A R-03/AC-04 | ACCEPTED 2026-10-28 | Frozen five-case overlap/retry contract satisfied; 126 unit/81 integration passes, clean Release/native evidence and worker self-review supplied |
| 05 | First configurable live dashboard | 04 and corrections accepted; 01A foundation | REQUIRES FOCUSED CORRECTION / NOT ACCEPTED | Most original scope inspected as corrected; independent Uncertain low/high status and existing validation/cleanup test obligations remain |
| 05A | Complete and verify the assigned dashboard contract | 05 review R-01 through R-05 | REVIEWED - FOCUSED FOLLOW-UP REQUIRED | Worker reports clean Release build, 133 unit/91 integration passes and actual native workflows; remaining original-scope edge is assigned to 05B |
| 05B | Independent range status and decisive dashboard tests | Remaining 05A R-03/testing contract | READY FOR WORKER | Preserve Uncertain quality plus low/high; executable invalid-input vectors and failure-safe barrier cleanup; no unit conversion scope |
| 06 | Imperial-default metric/imperial display units | 05 and corrections accepted; owner request 2026-10-29 | BLOCKED / NOT ASSIGNED | Shared display preference, Imperial (US) default, verified conversions across current UI; unchanged SI physics/raw source data |
| 05 | First configurable live dashboard | 04 and corrections accepted; 01A foundation | ACCEPTED 2026-10-29 AFTER 05A/05B | Actual static/dynamic numeric/bar dashboard, validated in-memory configuration, one session owner, truthful states and controlled/native evidence inspected |
| 05A | Complete and verify the assigned dashboard contract | 05 review R-01 through R-05 | ACCEPTED 2026-10-29 AFTER 05B | Host/editor/lifetime/failure/rendering/docs/native scope corrected; last range/test obligations closed by 05B |
| 05B | Independent range status and decisive dashboard tests | Remaining 05A R-03/testing contract | ACCEPTED 2026-10-29 | Frozen five-case/five-criterion contract satisfied; reported 134 unit/91 integration passes, clean Release/native recheck and actual pre-fix failure |
| 06 | Imperial-default metric/imperial display units | 05 and corrections accepted; owner request 2026-10-29 | READY FOR WORKER | Shared persisted Imperial (US)/Road default, metric/engineering speed choices and exact display conversions; unchanged SI/source/canonical bounds |
| 07 | Telemetry recording and replay | 06 accepted | BLOCKED / NOT ASSIGNED | Persist raw messages and decoded signals with source units/time/quality; playback/seek/speed controls feed the same gauges without reconstructing missing data |
| 08 | Calibration management and simulated programming | 07 | PLANNED | Versioned definitions/diffs, verified baseline and backup, approved simulated write, readback/unrelated-data checks, audit and supported restore; no physical writes |
| 09 | Local AI, knowledge, and validated runbooks | 08 | PLANNED | Replaceable local inference, applicable knowledge retrieval, structured logical runbook, independent validation/approval and simulation-only execution |
@ -727,27 +727,40 @@ history, not repeated redesign without evidence.
(224 total, zero failed/skipped), actual native static/dynamic workflows and
final rebuilt-Client recheck. Graph/source cases/artifacts corroborate this;
no application commands were executed by the orchestrator.
- Most original findings are corrected. Two consolidated remaining obligations
require [Step-05B](Step-05B.md): Uncertain readings omit independent low/high
status, and boundary tests/barrier cleanup do not fully meet the existing gate.
- At that review, most original findings were corrected but two obligations
required [Step-05B](Step-05B.md): Uncertain low/high status and decisive boundary
tests/barrier cleanup. The acceptance below closes that follow-up.
- Recorded the owner's new imperial-default display requirement separately;
inserted planned Step-06 ahead of recording/replay, now Step-07. Only unassigned
future milestones/dependencies shifted; prior assignments/history are unchanged.
- Reviewed and accepted Step-05B against its frozen C-01..C-05/AC-01..AC-05:
existing range helper now reaches Uncertain readings, real-provider numeric/
bar assertions cover low/high and exact bounds, invalid definitions preserve
the exact previous snapshot, finite-percent tests isolate their guard and
controlled drain cleanup releases barriers in finally.
- Worker reports actual pre-fix OutOfRangeLow-versus-null failure, corrected
focused tests, complete Release build zero warnings/errors and 134 unit +
91 integration passes (225 total, zero failed/skipped), plus exact rebuilt
native static/dynamic baseline recheck. Original numerical/native history and
all prior reports remain distinct. The orchestrator ran no application checks.
- Accepted corrected Step-05/05A/05B and prepared [Step-06](Step-06.md) for the
separately approved units work. No Step-05C is required.
### Remaining
- Worker execution of Step-05B, then one consolidated review against original
Step-05 C-01..C-10/AC-01..AC-07 and the shared quality gate. Do not waive missing
tests/native evidence or bundle the newly approved conversion work into a fix.
- After dashboard acceptance, prepare Step-06 display units before any Step-07
recording/replay assignment. The new units preference is not implemented yet.
- Worker execution of Step-06, then one consolidated review against its frozen
display/preference/conversion/editor matrix and the shared quality gate.
Correct genuine unmet criteria as Step-06A before recording/replay.
- Step-07 recording/replay is blocked and not assigned. The new display preference
and conversions are assigned work, not implemented functionality.
- Profile/module metadata, synthetic virtual-module communication and deterministic
dynamics/v2 are accepted. Dashboard is partial/unaccepted; later features remain planned.
dynamics/v2 and corrected dashboard are accepted; later features remain planned.
Preserve the complete sequence/safety gates.
### Known blockers and uncertainties
Step-05A leaves two focused findings against the existing contract:
No blocking Step-05 deficiency remains. The two Step-05A follow-up findings
below are historical and closed by accepted Step-05B:
- Remaining R-03 range edge: the Uncertain branch preserves quality/value but
never computes RangeState. Uncertain -10 or 1100 over 0..1000 therefore loses
@ -758,8 +771,8 @@ Step-05A leaves two focused findings against the existing contract:
Stop-drain test barrier release/session cleanup is not in finally.
The former Step-05 findings below are historical. The host/editor/owner/failure/
presentation/native/documentation corrections have been inspected as implemented;
only the specific range/test obligations above remain:
presentation/native/documentation corrections and the range/test follow-up have
been inspected as corrected:
- R-01: no basic gauge editor or simulation dashboard; ordinary startup validates
definitions before the new feed knows its bindings, Start stays disabled after
@ -779,7 +792,7 @@ only the specific range/test obligations above remain:
These were source/document review findings, not orchestrator-executed reproductions.
The Step-05A report now supplies the original editor/native workflow evidence.
Step-05B must preserve it and finish the remaining range/decisive-test scope.
Step-05B supplied the remaining range/decisive-test evidence and native recheck.
No blocking Step-04 deficiency remains. The owner-drain finding below is
historical and closed by accepted Step-04B:

View File

@ -5,24 +5,24 @@
| Field | Value |
|---|---|
| Updated | 2026-10-29 |
| Phase | Step-05A reviewed; narrow range/test follow-up remains |
| Active step | Step-05B - Independent range status and decisive tests |
| Assignment | [Step-05B.md](Step-05B.md) |
| Phase | Corrected dashboard accepted; imperial-default display units next |
| Active step | Step-06 - Imperial-default metric/imperial display units |
| Assignment | [Step-06.md](Step-06.md) |
| Assignment status | READY FOR WORKER / AWAITING MANUAL HANDOFF |
| Expected worker report | `prompts/Step-05B-Report.md` - not yet created |
| Last accepted correction | Step-04B - accepted 2026-10-28 |
| Last accepted major milestone | Step-04 with Step-04A/Step-04B - accepted 2026-10-28 |
| Outstanding corrections | Uncertain low/high range projection and existing boundary-test/finally-cleanup obligations |
| Expected worker report | `prompts/Step-06-Report.md` - not yet created |
| Last accepted correction | Step-05B - accepted 2026-10-29 |
| Last accepted major milestone | Step-05 with Step-05A/Step-05B - accepted 2026-10-29 |
| Outstanding corrections | None |
| Step-02 status | ACCEPTED after Step-02A |
| Step-03 status | ACCEPTED after Step-03A/Step-03B |
| Step-04 status | ACCEPTED after Step-04A/Step-04B |
| Step-04A review | All original corrective criteria closed with Step-04B |
| Step-05 status | REQUIRES FOCUSED CORRECTION / NOT ACCEPTED |
| Step-05A review | Most scope corrected; two focused remaining obligations require Step-05B |
| Step-06 status | Imperial-default display units approved; BLOCKED / NOT ASSIGNED until corrected Step-05 acceptance |
| Step-05 status | ACCEPTED after Step-05A/Step-05B |
| Step-05A review | All original corrective criteria closed with Step-05B |
| Step-06 status | READY FOR WORKER; Imperial (US) first-use default with metric toggle |
| Step-07 status | Recording/replay, formerly Step-06; BLOCKED until display-unit work is accepted |
| Worker execution | Step-05A returned; Step-05B not invoked |
| Immediate next action | User manually directs the worker to execute Step-05B only; display units are separate future work |
| Worker execution | Step-05B returned and accepted; Step-06 not invoked |
| Immediate next action | User manually directs the worker to execute Step-06 and shared quality gate only |
| Next orchestrator action | After manual return, inspect the assignment, report, implementation, tests, Git changes, documentation and recorded command evidence |
## Repository baseline at initialization
@ -675,12 +675,12 @@ blocker and INCOMPLETE/BLOCKED, not PASS or an acceptance waiver.
At that review Step-06 denoted recording/replay. Its assignment was withheld.
The owner decision below now inserts display units first.
## Step-05A review and focused follow-up
## Historical Step-05A review and focused follow-up
Decision: **MOST SCOPE CORRECTED; FOCUSED FOLLOW-UP REQUIRED**, 2026-10-29.
Step-05 and Step-05A remain unaccepted until [Step-05B](Step-05B.md) closes the
remaining existing range/test obligations. The new units request is not used
as an acceptance criterion for these completed assignments.
Decision at that review: most scope was corrected, but Step-05B was required
for the remaining existing range/test obligations. The closing review below
now accepts corrected Step-05/05A/05B. The new units request was not used as
an acceptance criterion for these completed assignments.
Reviewed [Step-05A report](Step-05A-Report.md), all dashboard/session-lifetime/
host/component changes, all new dashboard tests and existing route assertions,
@ -720,6 +720,38 @@ explicit stepping and paused polls not advancing physics; old routes and a
final-build static/dynamic cycle-1/close recheck. Preserve this positive evidence.
Do not redo corrected features or add conversion work to Step-05B.
## Step-05B acceptance and corrected Step-05
Decision: **ACCEPTED**, 2026-10-29. Frozen C-01..C-05 and AC-01..AC-05 are
satisfied. Step-05 with Step-05A/05B is accepted; no Step-05C is required.
Reviewed [Step-05B](Step-05B.md), its [report](Step-05B-Report.md), the focused
projection diff, actual real-provider/rendered range tests, independent invalid
definition vectors, isolated finite-percent assertions, finally/async cleanup,
documentation and existing Release/native artifacts.
| Criterion | Decision | Evidence |
|---|---|---|
| AC-01 | ACCEPTED | Actual pre-fix Uncertain -10 expected OutOfRangeLow/actual null; shared helper now supplies range without changing quality/value; real numeric/bar low/high and exact-bound assertions |
| AC-02 | ACCEPTED | Independent invalid bounds/precision/kind/ID/label/source/unit/count vectors assert exact prior snapshot/source/Running state; Good numeric percent-only null/NaN/infinities test and actual 85% width/accessibility control |
| AC-03 | ACCEPTED | Stop-drain finally releases its barrier before awaiting cleanup; session disposal is protected on failed assertions; other new session tests use async lifetime cleanup |
| AC-04 | ACCEPTED ON WORKER EXECUTION EVIDENCE | Reported complete nine-project Release build zero warnings/errors; 134 unit + 91 integration passes (225 total, zero failed/skipped); rebuilt native static-v1 bar/dynamics-v2 numeric baseline and close recheck |
| AC-05 | ACCEPTED | Focused projection/tests/verification-doc change and single corrective report; no future feature/dependency/project/interface/physics/wire expansion; original assignments/history preserved |
Worker self-review maps finite-value validation through independent quality/
range to actual numeric/bar consumers and safe test cleanup. Native observations
are distinguished from controlled Uncertain/invalid-input proof; no production
fault selector or fabricated native fault claim was introduced.
Source case inventory, unchanged nine-project acyclic references and existing
Release outputs corroborate the report. The orchestrator ran no application
builds/tests/native/workload commands and did not execute the reproduction.
Original Step-05 findings and its Step-05A follow-up are closed. Preserve the
207-/224-/225-case reports and original dynamics numerical/native history.
Step-06 is the sole ready assignment for new display units, with one shared
preference/conversion contract and explicit editor/raw-data invariants.
## Owner decision - imperial-default display units
The owner approves a Metric / Imperial toggle with Imperial (US) default while
@ -744,8 +776,12 @@ navigation/restarts. Unsupported units remain explicitly unconverted, and no
fuel mass-to-volume conversion may invent density. Apply consistently across
current human-facing simulation/diagnostic/dashboard surfaces.
No display-unit implementation or Step-06 assignment exists yet. After actual
Step-05B acceptance, prepare that bounded assignment before recording/replay.
No display-unit implementation exists yet. Following Step-05B acceptance,
[Step-06](Step-06.md) is ready before recording/replay. It freezes the two unit
systems plus Road/Engineering speed presentation, first-use/saved/error behavior,
exact conversion vectors and stable source-unit gauge bounds. Open editor
drafts retain their explicitly captured input unit until saved/cancelled, so a
toggle cannot reinterpret unsaved numbers.
## Prerequisites, limitations, and known issues
@ -770,28 +806,26 @@ Step-05B acceptance, prepare that bounded assignment before recording/replay.
- Profile Step-02 R-01/R-02 remain closed and accepted; do not regress those fixes.
- Step-03 R-01/R-02/R-03/R-04 remain closed; preserve all correction invariants.
- Step-04 reference/coupling/progress/failure/UI/owner fixes are accepted with
Step-04B. Step-05's open findings are listed above. Preserve the 190-/
Step-04B. Step-05's original and follow-up findings are closed. Preserve the 190-/
202-/207-case reports and original numerical/native evidence distinctly.
- Profile metadata/UI, synthetic diagnostics and deterministic dynamics/v2 are
accepted. Dashboard is implemented but has the focused range/test acceptance
gap above. Display units, replay, calibration values,
- Profile metadata/UI, synthetic diagnostics, deterministic dynamics/v2 and the
corrected dashboard are accepted. Display units, replay, calibration values,
persistence, AI and physical hardware operations remain unimplemented.
- No application build or test has been executed by the orchestrator.
## Review and progression gate
On manual return, evaluate Step-05B and the original Step-05 frozen contract/shared gate using the
On manual return, evaluate Step-06 and its frozen display-unit contract/shared gate using the
assignment, worker report, actual code/tests, dependency graph, Git changes,
README/docs, and recorded build/test evidence. Do not accept solely on a success
claim; do not claim independent runtime verification.
- Inspect pure gauge projections/states, validated definitions, one session-owned
feed, independent visibility/acquisition, source replacement and real UI/native
evidence. Do not add deferred persistence/charts/conversion requirements.
- If accepted: close Step-05A/05B, accept corrected Step-05, update roadmap/state,
create Step-06 for imperial-default display units and stop for manual handoff.
Do not create recording/replay Step-07 before the units gate is accepted.
- If deficient: issue narrowly scoped Step-05C only for a material unmet contract/
- Inspect shared default/saved preferences, conversion vectors, all assigned UI
surfaces, canonical bounds/draft invariants, raw/source preservation and real
provider/native evidence. Do not add deferred recording/layout/unit families.
- If accepted: accept Step-06, update roadmap/state, prepare Step-07
recording/replay and stop for manual handoff.
- If deficient: issue narrowly scoped Step-06A only for a material unmet contract/
regression, then stop. Planned new features are not corrections.
- If blocked: retain the active step, document the prerequisite and required
worker evidence; do not advance or mark unexecuted checks as successful.
@ -844,13 +878,15 @@ claim; do not claim independent runtime verification.
| 2026-10-29 | Owner approved imperial-default display units | SI calculations unchanged; global metric/Imperial (US) preference and conversions must precede recording/replay; not a Step-05A acceptance change |
| 2026-10-29 | Future numbering updated | Display units inserted as unassigned Step-06; former unassigned 06-20 become 07-21; completed assignments/history preserved |
| 2026-10-29 | Step-05B prepared | Narrow range/test correction only; next major handoff is units after dashboard acceptance, not recording/replay |
| 2026-10-29 | Step-05B returned and ACCEPTED | Frozen range/test/cleanup matrix satisfied; actual red regression, 225-case/clean Release/native recheck evidence and source-path self-review inspected |
| 2026-10-29 | Corrected Step-05 ACCEPTED | Original and 05A/05B criteria closed; no 05C; reports/source/numerical history preserved |
| 2026-10-29 | Step-06 prepared | Imperial-default shared presentation preference/conversions, stable canonical source bounds and explicit editor/raw-data policy; manual handoff pending, Step-07 blocked |
## Manual handoff instruction
Provide [Step-05B.md](Step-05B.md), original [Step-05.md](Step-05.md),
[Step-05A.md](Step-05A.md) and the shared
Provide [Step-06.md](Step-06.md) and the shared
[worker gate](WORKER-QUALITY-GATE.md) to the separate worker and request execution
of the focused correction only. The worker must produce `prompts/Step-05B-Report.md`
and stop for review. Do not begin Step-06 units or Step-07 recording/replay.
of that assignment only. The worker must produce `prompts/Step-06-Report.md`
and stop for review. Do not begin Step-07 recording/replay.
Return manually to the orchestrator for review. Reports, including final chat
reports, must follow the single plain triple-backtick copy-window requirement.

View File

@ -0,0 +1,76 @@
```
# Step-05B Worker Report
Identifier: Step-05B
Title: Independent range status and decisive dashboard tests
Status: COMPLETE — assigned worker implementation and verification passed; pending manual review. Step-05 and Step-05A remain NOT ACCEPTED pending orchestrator review.
## Summary and files
Corrected the Uncertain-value projection so range status is computed independently of signal quality. Added decisive real-provider/rendered assertions for low/high, in-range and exact-bound Uncertain values; expanded invalid-definition and finite-percent boundary coverage; and made controlled Stop-drain cleanup failure-safe. The dashboard feature, session ownership, providers, hosts, public contracts, schemas, protocols and lifecycle model were otherwise left unchanged.
Files changed:
- `src/AutoForge.Application/Features/Vehicles/Telemetry/LiveDashboard/LiveDashboardAcquisition.cs` — Uncertain finite readings now pass the existing shared `GetRangeState` result into the gauge projection.
- `src/tests/AutoForge.IntegrationTests/LiveDashboardAcquisitionTests.cs` — real-provider range/render assertions, full independent invalid-definition vectors, unchanged snapshot checks, and owned-session cleanup.
- `src/tests/AutoForge.UnitTests/LiveDashboardGaugeRenderingTests.cs` — isolated invalid-percent geometry inputs with a Good finite numeric presentation and a measurable visible 85% control.
- `docs/build-and-test.md` — appended the Step-05B pre-fix, focused/full test, and final native recheck evidence without rewriting Step-05A history.
- `prompts/Step-05B-Report.md` — this report; the only new prompt file.
## Actual pre-fix reproduction
Before changing the projection, ran:
`dotnet test .\src\tests\AutoForge.IntegrationTests\AutoForge.IntegrationTests.csproj --configuration Release --no-restore --filter FullyQualifiedName~RealStaticReadsPreserveRangeQualityFailureAndRecoveryStates`
Exit code 1; the real static-provider/rewrite-transport regression failed on the actual finite Uncertain -10 rpm response: expected `OutOfRangeLow`, actual `null`. This was a behavioral assertion failure, not a compilation failure. After the fix, the same test passed with rendered numeric and bar states.
## Corrective matrix and evidence
| ID | Input / precondition | Executed assertion and result |
|---|---|---|
| C-01 | Real finite Uncertain -10 and 1100 rpm against 0..1000 | `RealStaticReadsPreserveRangeQualityFailureAndRecoveryStates` asserts exact numeric values, `Uncertain` quality, independent low/high `RangeState`, and 0%/100% bar projection. Its rendered panel asserts the same range and quality separately on both numeric and bar gauge cards; bar accessibility reports 0/100. Passed after fix. |
| C-02 | Uncertain in-range and exact minimum/maximum; existing Good/Stale/Stopped behavior | The same real-provider test asserts Uncertain 100 has Good range status and Uncertain values exactly 0 and 1000 have no low/high status (`RangeState.Good`) with 0%/100% geometry. It also checks stale and stopped last-known 850 rpm remain range-Good, while existing Good/out-of-range behavior remains intact. Passed. |
| C-03 | Start with one valid definition and a Running feed; reject each invalid vector | `InvalidDefinitionReplacementIsAtomicAndEnforcesZeroToEightLimit` tests NaN and positive/negative infinity in bounds; equal, reversed and finite-span-overflow ranges; precision -1/4; undefined kind; blank/padded/case-duplicate gauge IDs; blank/padded labels; blank/padded/unknown module and signal IDs; blank and nonmatching exact unit. Every rejection is typed and asserts the exact prior snapshot object, definitions, source identity and Running feed remain unchanged. Empty and eight definitions are accepted; the ninth is rejected with the same prior snapshot, source and feed. Passed. |
| C-04 | Good state and real numeric text `850 rpm`, changing only Percent | `BarGauge_GoodNumericValueWithInvalidPercentDoesNotRenderGeometry` separately tests null, NaN, positive infinity and negative infinity; each has no meter, no zero-width fallback, no invalid CSS value, and still displays 850 rpm/Good. The valid control `BarGauge_RendersFiniteProjectionStateAndSafeText` asserts visible `width: 85%` and accessible `aria-valuenow=85`. Passed. |
| C-05 | Assertion/command failure while controlled Stop cancellation is held | `StopDrainRejectsStartWithoutMutationAndAllowsRetryAfterCleanup` now releases the controlled cancellation barrier and disposes the session in `finally`, while preserving the rejection during drain and successful retry assertions. The other new session tests use async session disposal for failure paths; the pending-response barrier test already releases its barrier and disposes both sessions in `finally`. Passed. |
## Existing criteria mapping
| Criterion | Evidence |
|---|---|
| AC-01 | Pre-fix real-provider failure recorded above. Post-fix C-01/C-02 prove numeric, range, quality, geometry, and rendered accessibility are independent and correct. |
| AC-02 | C-03 executes the assigned invalid boundaries one at a time and proves exact atomic preservation; C-04 isolates the finite-number guard from Unknown/missing values and verifies the valid visible 85% control. |
| AC-03 | C-05 `finally` cleanup releases the scheduler barrier, drains the owner and disposes the source even if assertions fail; existing controlled reject/retry behavior remains asserted. |
| AC-04 | Complete nine-project Release build and 225-case Release regression suite passed. The exact rebuilt native Client configured and read gauges through actual static-v1 and dynamics-v2 sessions; native evidence and its limits follow. |
| AC-05 | Only the assigned Application projection, focused tests, directly related build/test documentation, and this report changed. Assignments, State/Roadmap, shared gate, prior reports and protected files are unchanged. No future feature was implemented. |
## Commands and outcomes
- Pre-fix regression command shown above: exit 1, expected behavior failure (`OutOfRangeLow` vs null).
- `dotnet test .\src\tests\AutoForge.UnitTests\AutoForge.UnitTests.csproj --configuration Release --no-restore --filter FullyQualifiedName~LiveDashboardGaugeRenderingTests` — exit 0; 8 passed, 0 failed, 0 skipped.
- `dotnet test .\src\tests\AutoForge.IntegrationTests\AutoForge.IntegrationTests.csproj --configuration Release --no-restore --filter "FullyQualifiedName~RealStaticReadsPreserveRangeQualityFailureAndRecoveryStates|FullyQualifiedName~InvalidDefinitionReplacementIsAtomicAndEnforcesZeroToEightLimit|FullyQualifiedName~StopDrainRejectsStartWithoutMutationAndAllowsRetryAfterCleanup"` — exit 0; 3 passed, 0 failed, 0 skipped.
- `dotnet build .\src\AutoForge.slnx --configuration Release --no-restore` — exit 0; Core, Diagnostics, Components, Simulation, Application, UI, UnitTests, IntegrationTests and Client built successfully; 0 warnings, 0 errors. The MAUI XAML SourceGen notice was informational.
- `dotnet test .\src\AutoForge.slnx --configuration Release --no-build` — exit 0; UnitTests 134 passed and IntegrationTests 91 passed; 225 total, 0 failed, 0 skipped. The previous 224 cases were preserved; the new percent-null theory case accounts for the one additional case.
- `git diff --check` — passed; only the existing documentation LF-to-CRLF conversion notice was emitted.
## Native versus controlled evidence
The final native recheck ran the exact Release Client with an isolated WebView2 user-data folder. On `/diagnostics`, the editor bound a horizontal bar to the actual `module.engine.primary / synthetic.engine.speed` static-v1 signal and rendered 850 rpm from `SYNTHETIC_STATIC`. On `/simulation`, it bound a numeric gauge to the actual `module.engine.primary / engine.speed` dynamics-v2 signal and rendered 260 rpm from `SYNTHETIC_DYNAMIC`, with logical request tick, model step 1 / 0.1 seconds, configuration fingerprint and `dynamics-run-000002`. The dynamics model was paused. Both actual sessions were closed and their panels removed.
The native run validates that the existing configured dashboard baseline still works on both providers. It did not inject Uncertain samples or malformed definitions into the native UI; those specific vectors are asserted through the real static provider/rewrite transport and rendered component/integration tests. Native runtime: .NET SDK 10.0.402 and .NET 10.0.13; MAUI workload 10.0.403, `maui-windows` manifest 10.0.110; Windows SDK target 10.0.26100.0; WebView2 Runtime 156.0.4314.50. The exact native Client/WebView2 processes and port 9351 were verified stopped; the isolated task profile was removed. A separate pre-existing default WebView2 profile discovered during an initial smoke attempt was left untouched.
No package restore/install, SDK/workload modification, system update, staging, commit, push or destructive Git action occurred.
## Documentation and source-path self-review
`docs/build-and-test.md` now records the actual red pre-fix assertion, post-fix focused vectors, full suite counts and final native observations. Existing live-dashboard documentation already describes range/quality independence and exact-unit behavior, so no unrelated guide rewrite was needed. Imperial/metric preferences and conversion remain future, unassigned scope.
Reviewed the changed source path from finite-value/quality classification through the shared range helper, gauge projection and numeric/bar panel consumers. The range helper is reached only after finite numeric validation, uses strict below/above comparisons (so exact bounds remain Good range status), and does not change `Uncertain` source quality or raw numeric values. Rejected definitions still validate before snapshot mutation; assertions confirm the exact old snapshot and feed/source context survive. The invalid-percent test holds all presentation parameters constant except Percent, while the 85% control checks actual accessible geometry. Stop cleanup releases its cancellation barrier before awaiting session disposal. Focused tests and the complete build/test suite were rerun after the self-review assertions.
## Preservation review and stop point
The worktree was clean before this assignment. No pre-existing changes were present to overwrite. No assignment, historical report, `prompts/STATE.md`, `prompts/ROADMAP.md`, shared gate or protected instruction was edited. Only the four listed implementation/test/documentation paths and this new report are changed.
Worker implementation and assigned verification are COMPLETE. Step-05 and Step-05A remain NOT ACCEPTED until manual orchestrator review. Stop here; no next step or automatic handoff was performed.
```

273
prompts/Step-06.md Normal file
View File

@ -0,0 +1,273 @@
# Step-06 - Imperial-default metric/imperial display units
## STEP IDENTIFIER
Step-06. Corrected Step-05/05A/05B was accepted on 2026-10-29.
This is the sole active implementation assignment. Recording/replay is Step-07
and remains blocked until this work is accepted.
## STEP TITLE
Use one shared metric/Imperial (US) presentation preference, defaulting to imperial,
while preserving SI calculations and exact raw/source data.
## OBJECTIVE
One user outcome: current human-facing measurements use the selected unit system
consistently, without changing the vehicle model, source or physical gauge range.
One primary new contract: a shared locally remembered display preference and
pure, validated presentation conversion boundary.
Read [STATE.md](STATE.md), the dated owner decision in [ROADMAP.md](ROADMAP.md),
[live dashboard contracts](../docs/live-dashboard.md) and
[WORKER-QUALITY-GATE.md](WORKER-QUALITY-GATE.md). Build the frozen case matrix
before coding, self-review after the first green run, write
`prompts/Step-06-Report.md`, and STOP.
## ARCHITECTURAL CONTEXT
Keep the nine-project .NET 10 modular monolith and sole MAUI Client. Components
remains generic with no AutoForge project reference. Application may own a small
display-unit feature/pure conversion and preference port; UI owns presentation/
interaction, and Client supplies real local MAUI preference storage/composition.
An equally simple existing-boundary arrangement is acceptable without duplicated
conversion logic. No new project, package, host or units/settings framework.
Use existing MAUI storage primitives, not new dependencies. Portable tests use
an explicitly isolated store behind the same port; the native host must not
silently fall back to an in-memory implementation. All source/tests stay under
`src`, tests under `src/tests`.
## CURRENT IMPLEMENTATION STATE
Accepted dashboard behavior includes real static-v1/dynamic-v2 signal reads,
zero-to-eight immutable definitions with exact source-unit binding, one session
acquisition owner, independent quality/range and explicit stale/error states.
The worker reports a clean nine-project Release build, 134 unit + 91 integration
passes (225 total, zero failed/skipped) and native baseline recheck.
The orchestrator did not run those commands.
Relevant existing surfaces:
- [MainLayout](../src/AutoForge.UI/Layout/MainLayout.razor): shared shell/navigation.
- [DiagnosticsPage](../src/AutoForge.UI/Features/Vehicles/Diagnostics/DiagnosticsPage.razor):
human-readable signals and separate raw trace.
- [SimulationPage](../src/AutoForge.UI/Features/Vehicles/Simulation/SimulationPage.razor):
scenario target summaries, decoded telemetry and raw configuration JSON.
- [LiveDashboardPanel](../src/AutoForge.UI/Features/Vehicles/Telemetry/LiveDashboard/LiveDashboardPanel.razor):
values, editor bounds and source/sample context.
- [LiveDashboardAcquisition](../src/AutoForge.Application/Features/Vehicles/Telemetry/LiveDashboard/LiveDashboardAcquisition.cs):
canonical definitions/source values/states; not a new physics or conversion owner.
- [MauiProgram](../src/AutoForge.Client/MauiProgram.cs): native DI/composition.
There is no shared unit preference/conversion implementation yet. Reinspect Git,
existing tests/helpers and real source-unit metadata before editing; preserve
dirty work, accepted behavior and all historical reports.
## REQUIRED IMPLEMENTATION
### Frozen contract matrix
| ID | Input/precondition | Required result |
|---|---|---|
| C-01 | No saved preference; any route/culture | Imperial (US), Road-speed presentation by default; shared accessible control is visible before a session opens. No ambient region chooses the default. |
| C-02 | Known source units and representative conversion vectors below | Correct finite forward/inverse result within 1e-9 absolute target units for these vectors; consistent value/unit text. RPM/V/ratio/count/gear/boolean remain unchanged. |
| C-03 | Actual speed 20.1168 m/s, source bounds 0..40.2336 m/s | Imperial Road: 45 mph, bounds 0..90; Imperial Engineering: 66 ft/s, 0..132; Metric Road: 72.42048 km/h, 0..144.84096; Metric Engineering: source m/s. All retain 50% geometry and identical source bounds/state/context. |
| C-04 | At least 20 system/speed-mode toggles and rerenders on a bound paused session | Canonical definitions/source snapshots/configuration/time/step/request counts and owner stay unchanged; no drift or extra wire request/physics action. |
| C-05 | Gauge range editor in display units; valid/invalid saves; unedited Save | Convert edited bounds once to source units and validate atomically. 32..212 degF becomes 0..100 degC. Unedited saves/toggles retain original canonical bounds exactly. Invalid/overflowing bounds preserve prior definitions/feed/source. |
| C-06 | Active unsaved editor draft while global units change | Draft keeps its captured input unit and numbers, visibly labeled until Save/Cancel; Save uses that unit. Other readouts update; new/reset editor uses current selection. Never reinterpret typed numbers under a new label. |
| C-07 | Pending/Unknown/Uncertain/Stale/Error/Stopped, low/high or missing values | Preserve source quality/range/freshness/reason/time; missing stays `--`, never zero. Conversion cannot turn stale/uncertain data Good or clamp the numeric value. |
| C-08 | Known unchanged units, unsupported units, invalid preference/value or non-finite conversion | Pass-through units stay exact. Unsupported units remain explicitly unconverted with source unit/notice, never relabeled. Invalid input/overflow yields a handled visible error/unavailable result, not fabricated data or invalid geometry. |
| C-09 | Valid stored selection; navigation/restart; corrupt/unreadable store; failed write | Valid choice restores across routes/restarts. Missing is documented default. Invalid/read failure is visible with clearly labeled Imperial/Road default, not claimed restored or silently overwritten. Failed selection save preserves previous active preference and shows error. |
| C-10 | Human readouts versus raw/config/source inspectors | Assigned readouts convert consistently; original payloads, source-unit values, JSON/import/export/fingerprint and raw context remain byte/value-identical and labeled source/SI. |
| C-11 | Numeric source 0.4 m/s with display precision 0 | Convert NumericValue before formatting: Imperial Road displays 1 mph, not 0 from parsing the feed's already-rounded text. Never chain conversions through formatted display values. |
| C-12 | Actual static/dynamic Application/UI/Client paths | Real ports, preference adapter, shared selector and generic gauge path operate together; native toggling/restart/close and original routes work without an oracle or parallel host. |
### A. Shared display preference and exact supported mappings
Expose Metric / Imperial (US) and Road / Engineering speed presentation through
one application-wide control, preferably in the existing shared shell.
Defaults are Imperial (US) + Road; ordinary vehicle speed therefore shows mph.
Engineering is the explicit ft/s option, not a second poller or per-gauge layout
system. Switching unit system keeps the selected speed style.
Use one immutable validated selection shared across routes and mounted panels.
Persist only this small local preference through existing platform primitives.
Missing data means first-use default. Invalid/unreadable saved state shows an
explicit preference error and clearly identified default; do not overwrite it
silently. A successful explicit selection can recover. Persist a proposed
selection before publishing it; save failure leaves the prior active selection.
Undefined enum/options must reject before any state/store mutation.
Do not silently substitute an in-memory native store.
Current required source-to-display mappings:
| Exact source unit | Metric display | Imperial (US) display |
|---|---|---|
| m/s | km/h for Road; m/s for Engineering | mph for Road; ft/s for Engineering |
| m | m | ft |
| kg | kg | lb |
| kg/s | kg/s | lb/h |
| N*m | N*m | lbf*ft |
| degC | degC | degF |
| m/s^2 | m/s^2 | ft/s^2 |
| rpm, V, ratio, count, gear, boolean | Same source unit | Same source unit |
Use exact definitions: 1 ft = 0.3048 m; 1 mile = 1609.344 m;
1 lb = 0.45359237 kg; 1 lbf = 4.4482216152605 N; 1 hour = 3600 s;
degF = degC * 9/5 + 32. Do not introduce UK gallons or fuel-volume/economy
conversion without sourced density. No additional unit families are assigned.
Representative independent vectors: 20.1168 m/s -> 45 mph -> 66 ft/s;
0.3048 m -> 1 ft; 0.45359237 kg -> 1 lb;
(0.45359237 / 3600) kg/s -> 1 lb/h;
1.3558179483314004 N*m -> 1 lbf*ft;
0/100/-40 degC -> 32/212/-40 degF;
0.3048 m/s^2 -> 1 ft/s^2. Test inverse mappings too.
Map actual exact source units, not labels, module roles or guessed signal aliases.
Unknown units are not errors in the original source: retain their source value/
unit with an explicit unconverted notice. Preserve source quality independently.
Reject non-finite input/output and overflow through a typed handled result/error;
never return a success-shaped zero.
### B. Canonical data stays unchanged; conversion is presentation only
Keep raw diagnostic values, DiagnosticSignal.Unit, configuration/export/import,
fingerprints, physics inputs/results and time in their existing source/SI units.
Keep DashboardGaugeDefinition.Unit and bounds as exact source-unit contracts.
Do not weaken source-unit matching to make an imperial display work.
Project a separate display value/unit/bounds from original finite numeric data,
then apply the existing 0..3 decimal precision once. Never parse DisplayValue,
mutate a signal/definition, convert a prior display result again or change
acquisition rate/ownership/model control in response to a preference.
Reuse source-computed range/quality and bar percentage unchanged. Temperature
offset conversion must preserve physical boundaries, not merely change the
value label. Bounds are converted for editor display and converted back only
for actual edits; preserve original canonical numbers on an unedited Save.
Validate finite ordered source span as well as display input before committing.
Display precision must not quantize canonical editor bounds.
Pin an active editor draft's unit when its binding/edit begins and label that
unit explicitly. Global changes must not reinterpret its text. Save parses in
the captured unit; Cancel/Reset/new draft adopts the current preference.
Changing binding starts a clearly labeled draft for the new actual source.
Missing/failed/unknown/stale/stopped values retain their established states,
reason and actual source/sample time. Preserve independent Uncertain low/high
status and actual out-of-range readings; only bar geometry stays clamped.
Subscribe/unsubscribe presentation notifications safely on the renderer
dispatcher; view disposal must not stop session acquisition.
### C. Wire all current relevant surfaces, not just gauges
Use the shared conversion path in dashboard numeric/bar values and range labels/
editor, diagnostics human-readable signal readings, simulation decoded-telemetry
rows and scenario target-speed summaries. Keep timing/percent/count fields
unchanged. Retain accessible unit/state/value descriptions and safe text.
Source metadata/inspectors must still expose the exact original value and unit.
Raw trace/payloads, protocol fields, profile facts and configuration JSON remain
source data, explicitly labeled as unaffected by display preference. Do not
attempt to convert arbitrary text/profile metadata or rewrite historical docs/
reports. The global control and any load/save error are visible without a session.
## FILES OR PROJECTS EXPECTED TO CHANGE
Focused Application/UI presentation/preference/conversion code, shared layout
and current host/panel wiring, a small real Client preference adapter/DI, unit/
integration tests and directly related docs/README.
Components remains generic; Core/Diagnostics/Simulation implementation/schema/
physics changes are not expected or authorized by this display-only work.
Only `prompts/Step-06-Report.md` under `prompts`.
## INTERFACE AND DEPENDENCY REQUIREMENTS
Keep all nine projects, current references and one Client. No new dependency,
host, global active-session registry or generic settings framework. Tests may
use an explicit isolated preference store, not mock away conversion/feed/session.
Client must use actual MAUI preference primitives through the portable boundary.
Preserve static v1/dynamic v2, strict wire/profile/config contracts, source/
run identity, partial discovery/verified clear and one acquisition/physics owner.
No new oracle, hardware capability, silent fallback or broad exception mask.
No workload/system restore/install/update/repair/rollback is authorized.
Preserve existing dirty work and protected/history files; no stage/commit/push
or destructive Git action.
## TESTING REQUIREMENTS
Map C-01..C-12 to meaningful named tests before handoff:
- Pure forward/inverse vectors with independently specified expected values,
temperature offset, true zero/negative boundaries, finite/overflow checks,
exact pass-through/unknown units and conversion-before-rounding.
- First-use versus restored/error preferences using the real shared service and
isolated store seam. Verify failed writes/invalid options are atomic; do not
treat an always-working mock store as persistence failure coverage.
- Controlled real-provider/rendered static and dynamic routes/panel: all speed
modes, values/bounds/accessibility, 20 toggles, canonical equality, preserved
quality/range/time, editor draft pinning/invalid saves and zero added reads/
unchanged paused model state. Count at the real wire boundary.
- Raw source/config export/fingerprint/trace values and bytes remain unchanged.
Keep meaningful existing 225-case regressions; map necessary presentation-only
assertion updates without deleting source/safety/error checks.
Run focused cases, then sequential full checks:
- `dotnet build .\src\AutoForge.slnx --configuration Release --no-restore`
- `dotnet test .\src\AutoForge.slnx --configuration Release --no-build`
The complete build includes all nine projects and the real Windows Client.
No dependency install/restore absent a real missing-dependency failure.
Native smoke on the rebuilt Client: observe initial/default or restored selection
honestly; configure real static/dynamic gauges; toggle systems/speed styles and
compare source versus display; edit a range and switch with a draft open; check
scenario/telemetry readouts and raw SI JSON; pause and prove toggles do not step;
restart to verify the chosen preference; reset/close and check old routes.
Do not wipe shared preferences or unrelated user data. Preserve/restore only
exact task-owned preference values when needed for smoke cleanup. Distinguish
native observations from controlled storage-error/invalid-data proof.
## DOCUMENTATION REQUIREMENTS
Update README/index/architecture/build guide and live-dashboard/simulation usage:
Imperial (US) first use, Metric and Road/Engineering options, persistence/error
behavior, mappings/limits, source versus display, canonical editor/draft policy
and actual validation evidence. Mark Step-05/05A/05B accepted; Step-06 remains
pending orchestrator review. Recording/replay is Step-07 and not implemented.
## ACCEPTANCE CRITERIA
| ID | Criterion | Evidence |
|---|---|---|
| AC-01 | C-01/C-09 shared Imperial/Road default, persistence/restoration and explicit atomic failure behavior | Service/store/DI tests plus actual native adapter/restart evidence |
| AC-02 | C-02/C-03/C-08/C-11 exact supported conversions, safe unknown/invalid inputs and convert-before-rounding | Independent numeric vectors, inverse/finite checks and exact rendered units/values |
| AC-03 | C-04..C-07 stable canonical bounds, pinned drafts and unchanged acquisition/model/source states | Controlled real-provider/wire-count/source-equality and editor/render tests |
| AC-04 | C-10/C-12 all assigned current UI surfaces use the shared path; raw/source/config contracts unchanged | Real routes/panel/Client integration, raw bytes and accessible native smoke |
| AC-05 | 225 baseline cases preserved, meaningful new coverage, complete Release/native build and required smoke pass | Exact commands/exits/warnings/per-project counts; native versus controlled evidence |
| AC-06 | Frozen matrix/self-review/docs/README accurately describe implemented behavior and limitations | Case/test mapping, own source-path review after first green and documentation summary |
| AC-07 | Protected files/history/dependencies/manual workflow preserved; report saved and worker stops | Preservation review and `prompts/Step-06-Report.md` |
## OUT-OF-SCOPE WORK
Recording/replay, charts/layouts/dashboard persistence/schema, additional unit
families/fuel-volume/MPG, new clock/model/protocol/physics, calibration/AI/hardware,
new project/package/host and unrelated cleanup. No future assignment, agents,
automatic handoff, orchestration/shared-gate edit, stage, commit or push.
## REPORTING REQUIREMENTS
Create `prompts/Step-06-Report.md` entirely inside exactly one plain triple-backtick
fence, no language tag/outside text/nested fences. Include identifier/title/status,
implemented functions/files/interfaces, C-01..C-12/AC-01..AC-07 evidence with
named executed tests and exact vectors/tolerances, commands/exits/warnings/
per-project counts, native versus controlled coverage, docs/README, own source-
path self-review after the first green run, limitations/deviations/blockers and
preservation review. COMPLETE requires all assigned checks; otherwise report
INCOMPLETE/BLOCKED and the precise unmet criterion.
Save and STOP for manual orchestrator review. Do not begin Step-07.

View File

@ -585,7 +585,8 @@ public sealed class LiveDashboardFeed : IAsyncDisposable
DashboardReadingState.Uncertain,
value,
signal,
"The source marked this finite value Uncertain.");
"The source marked this finite value Uncertain.",
GetRangeState(value, definition));
}
if (signal.Quality != SignalQuality.Good)

View File

@ -26,7 +26,7 @@ public sealed class LiveDashboardAcquisitionTests
{
var scheduler = new ControlledDashboardScheduler();
using var provider = CreateProvider(scheduler);
var session = await OpenStaticSessionAsync(provider);
await using var session = await OpenStaticSessionAsync(provider);
var factory = provider.GetRequiredService<ILiveDashboardFeedFactory>();
var feed = factory.Create(session);
Assert.Same(feed, factory.Create(session));
@ -140,13 +140,16 @@ public sealed class LiveDashboardAcquisitionTests
{
var scheduler = new ControlledDashboardScheduler { BlockCancellationCleanup = true };
using var provider = CreateProvider(scheduler);
var session = await OpenStaticSessionAsync(provider);
await using var session = await OpenStaticSessionAsync(provider);
var feed = provider.GetRequiredService<ILiveDashboardFeedFactory>().Create(session);
Task? stop = null;
try
{
await feed.StartAsync();
var firstWait = await scheduler.NextWaitAsync();
var firstReadCount = CountSignalReads(session);
var stop = feed.StopAsync();
stop = feed.StopAsync();
await scheduler.CancellationObserved.Task;
Assert.Equal(DashboardFeedState.Stopping, feed.Snapshot.FeedState);
@ -161,15 +164,30 @@ public sealed class LiveDashboardAcquisitionTests
var secondWait = await scheduler.NextWaitAsync();
Assert.NotSame(firstWait, secondWait);
await feed.StopAsync();
}
finally
{
scheduler.ReleaseCancellation();
try
{
if (stop is not null)
{
await stop;
}
}
finally
{
await session.DisposeAsync();
}
}
}
[Fact]
public async Task InvalidDefinitionReplacementIsAtomicAndEnforcesZeroToEightLimit()
{
var scheduler = new ControlledDashboardScheduler();
using var provider = CreateProvider(scheduler);
var session = await OpenStaticSessionAsync(provider);
await using var session = await OpenStaticSessionAsync(provider);
var feed = provider.GetRequiredService<ILiveDashboardFeedFactory>().Create(session);
await feed.StartAsync();
var binding = Assert.Single(feed.Snapshot.AvailableSignals, item =>
@ -187,25 +205,55 @@ public sealed class LiveDashboardAcquisitionTests
0);
feed.ReplaceDefinitions([valid]);
Assert.Throws<DashboardConfigurationException>(() => feed.ReplaceDefinitions(
[
valid with { Unit = "mph" }
]));
Assert.Throws<DashboardConfigurationException>(() => feed.ReplaceDefinitions(
[
valid with { Minimum = -double.MaxValue, Maximum = double.MaxValue }
]));
var prior = feed.Snapshot;
var invalidDefinitions = new IReadOnlyList<DashboardGaugeDefinition>[]
{
[valid with { Minimum = double.NaN }],
[valid with { Minimum = double.PositiveInfinity }],
[valid with { Minimum = double.NegativeInfinity }],
[valid with { Maximum = double.PositiveInfinity }],
[valid with { Maximum = double.NegativeInfinity }],
[valid with { Minimum = 5, Maximum = 5 }],
[valid with { Minimum = 10, Maximum = 5 }],
[valid with { Minimum = -double.MaxValue, Maximum = double.MaxValue }],
[valid with { DecimalPrecision = -1 }],
[valid with { DecimalPrecision = 4 }],
[valid with { Kind = (DashboardGaugeKind)99 }],
[valid with { GaugeIdentifier = "" }],
[valid with { GaugeIdentifier = " speed" }],
[valid, valid with { GaugeIdentifier = "SPEED" }],
[valid with { Label = "" }],
[valid with { Label = " Speed" }],
[valid with { ModuleIdentifier = "" }],
[valid with { ModuleIdentifier = $" {binding.ModuleIdentifier}" }],
[valid with { ModuleIdentifier = "module.unknown" }],
[valid with { SignalIdentifier = "" }],
[valid with { SignalIdentifier = $" {binding.SignalIdentifier}" }],
[valid with { SignalIdentifier = "signal.unknown" }],
[valid with { Unit = "" }],
[valid with { Unit = "mph" }]
};
foreach (var invalid in invalidDefinitions)
{
Assert.Throws<DashboardConfigurationException>(() => feed.ReplaceDefinitions(invalid));
Assert.Same(prior, feed.Snapshot);
Assert.Equal([valid], feed.Snapshot.Definitions);
Assert.Equal(session.Identity, feed.Snapshot.Source);
Assert.Equal(DashboardFeedState.Running, feed.Snapshot.FeedState);
}
var eight = Enumerable.Range(0, 8)
.Select(index => valid with { GaugeIdentifier = $"speed-{index}" })
.ToArray();
feed.ReplaceDefinitions(eight);
Assert.Equal(8, feed.Snapshot.Definitions.Count);
var eightSnapshot = feed.Snapshot;
Assert.Throws<DashboardConfigurationException>(() => feed.ReplaceDefinitions(
eight.Append(valid with { GaugeIdentifier = "speed-8" })));
Assert.Same(eightSnapshot, feed.Snapshot);
Assert.Equal(eight, feed.Snapshot.Definitions);
Assert.Equal(session.Identity, feed.Snapshot.Source);
Assert.Equal(DashboardFeedState.Running, feed.Snapshot.FeedState);
feed.ReplaceDefinitions([]);
Assert.Empty(feed.Snapshot.Definitions);
@ -268,6 +316,22 @@ public sealed class LiveDashboardAcquisitionTests
case 9:
signals.Remove(speed);
break;
case 10:
speed["value"] = -10;
speed["quality"] = "Uncertain";
break;
case 11:
speed["value"] = 1100;
speed["quality"] = "Uncertain";
break;
case 12:
speed["value"] = 0;
speed["quality"] = "Uncertain";
break;
case 13:
speed["value"] = 1000;
speed["quality"] = "Uncertain";
break;
}
if (mode != 7)
@ -285,7 +349,7 @@ public sealed class LiveDashboardAcquisitionTests
response.Detail);
});
using var provider = CreateProvider(scheduler, rewriting);
var session = await OpenStaticSessionAsync(provider);
await using var session = await OpenStaticSessionAsync(provider);
var feed = provider.GetRequiredService<ILiveDashboardFeedFactory>().Create(session);
await feed.StartAsync();
var speedBinding = Assert.Single(feed.Snapshot.AvailableSignals, item =>
@ -298,6 +362,8 @@ public sealed class LiveDashboardAcquisitionTests
[
new DashboardGaugeDefinition("speed", "Speed", DashboardGaugeKind.HorizontalBar,
speedBinding.ModuleIdentifier, speedBinding.SignalIdentifier, speedBinding.Unit, 0, 1000, 0),
new DashboardGaugeDefinition("speed-numeric", "Speed numeric", DashboardGaugeKind.Numeric,
speedBinding.ModuleIdentifier, speedBinding.SignalIdentifier, speedBinding.Unit, 0, 1000, 0),
new DashboardGaugeDefinition("battery", "Battery", DashboardGaugeKind.Numeric,
batteryBinding.ModuleIdentifier, batteryBinding.SignalIdentifier, batteryBinding.Unit, 0, 20, 1)
]);
@ -340,6 +406,7 @@ public sealed class LiveDashboardAcquisitionTests
await AdvanceAsync(5);
var uncertain = Assert.Single(feed.Snapshot.Values, item => item.Definition.GaugeIdentifier == "speed");
Assert.Equal(DashboardReadingState.Uncertain, uncertain.State);
Assert.Equal(DashboardReadingState.Good, uncertain.RangeState);
Assert.Equal("100", uncertain.DisplayValue);
Assert.Contains("Uncertain", uncertain.Reason);
@ -359,6 +426,7 @@ public sealed class LiveDashboardAcquisitionTests
await AdvanceAsync(8);
var changedUnit = Assert.Single(feed.Snapshot.Values, item => item.Definition.GaugeIdentifier == "speed");
Assert.Equal(DashboardReadingState.Stale, changedUnit.State);
Assert.Equal(DashboardReadingState.Good, changedUnit.RangeState);
Assert.Equal("rpm", changedUnit.Definition.Unit);
Assert.Equal(850d, changedUnit.NumericValue);
Assert.Contains("changed its verified unit", changedUnit.Reason);
@ -366,10 +434,80 @@ public sealed class LiveDashboardAcquisitionTests
await AdvanceAsync(9);
var missing = Assert.Single(feed.Snapshot.Values, item => item.Definition.GaugeIdentifier == "speed");
Assert.Equal(DashboardReadingState.Stale, missing.State);
Assert.Equal(DashboardReadingState.Good, missing.RangeState);
Assert.Equal(850d, missing.NumericValue);
Assert.Contains("missing from the latest source response", missing.Reason);
await AdvanceAsync(10);
var uncertainLow = Assert.Single(feed.Snapshot.Values, item => item.Definition.GaugeIdentifier == "speed");
var uncertainLowNumeric = Assert.Single(feed.Snapshot.Values, item =>
item.Definition.GaugeIdentifier == "speed-numeric");
Assert.Equal(DashboardReadingState.Uncertain, uncertainLow.State);
Assert.Equal(-10d, uncertainLow.NumericValue);
Assert.Equal(DashboardReadingState.OutOfRangeLow, uncertainLow.RangeState);
Assert.Equal(0d, uncertainLow.BarPercent);
Assert.Equal(DashboardReadingState.OutOfRangeLow, uncertainLowNumeric.RangeState);
Assert.Equal(-10d, uncertainLowNumeric.NumericValue);
await using (var renderer = new HtmlRenderer(
provider,
provider.GetRequiredService<ILoggerFactory>()))
{
var component = await renderer.Dispatcher.InvokeAsync(() =>
renderer.RenderComponentAsync<LiveDashboardPanel>(
ParameterView.FromDictionary(new Dictionary<string, object?>
{
[nameof(LiveDashboardPanel.Session)] = session,
[nameof(LiveDashboardPanel.HeadingId)] = "uncertain-range-dashboard"
})));
var lowHtml = await renderer.Dispatcher.InvokeAsync(component.ToHtmlString);
Assert.Contains("-10 rpm", lowHtml);
var lowBarHtml = GetGaugeMarkup(lowHtml, "speed");
var lowNumericHtml = GetGaugeMarkup(lowHtml, "speed-numeric");
foreach (var gaugeHtml in new[] { lowBarHtml, lowNumericHtml })
{
Assert.Contains("Uncertain", gaugeHtml);
Assert.Contains("Below configured range", gaugeHtml);
}
Assert.Contains("aria-valuenow=\"0\"", lowBarHtml);
Assert.Contains("aria-valuetext=", lowBarHtml);
await AdvanceAsync(11);
var highHtml = await renderer.Dispatcher.InvokeAsync(component.ToHtmlString);
Assert.Contains("1100 rpm", highHtml);
var highBarHtml = GetGaugeMarkup(highHtml, "speed");
var highNumericHtml = GetGaugeMarkup(highHtml, "speed-numeric");
foreach (var gaugeHtml in new[] { highBarHtml, highNumericHtml })
{
Assert.Contains("Uncertain", gaugeHtml);
Assert.Contains("Above configured range", gaugeHtml);
}
Assert.Contains("aria-valuenow=\"100\"", highBarHtml);
}
var uncertainHigh = Assert.Single(feed.Snapshot.Values, item => item.Definition.GaugeIdentifier == "speed");
Assert.Equal(DashboardReadingState.Uncertain, uncertainHigh.State);
Assert.Equal(1100d, uncertainHigh.NumericValue);
Assert.Equal(DashboardReadingState.OutOfRangeHigh, uncertainHigh.RangeState);
Assert.Equal(100d, uncertainHigh.BarPercent);
await AdvanceAsync(12);
var uncertainMinimum = Assert.Single(feed.Snapshot.Values, item => item.Definition.GaugeIdentifier == "speed");
Assert.Equal(DashboardReadingState.Uncertain, uncertainMinimum.State);
Assert.Equal(DashboardReadingState.Good, uncertainMinimum.RangeState);
Assert.Equal(0d, uncertainMinimum.BarPercent);
await AdvanceAsync(13);
var uncertainMaximum = Assert.Single(feed.Snapshot.Values, item => item.Definition.GaugeIdentifier == "speed");
Assert.Equal(DashboardReadingState.Uncertain, uncertainMaximum.State);
Assert.Equal(DashboardReadingState.Good, uncertainMaximum.RangeState);
Assert.Equal(100d, uncertainMaximum.BarPercent);
await feed.StopAsync();
var stopped = Assert.Single(feed.Snapshot.Values, item => item.Definition.GaugeIdentifier == "speed");
Assert.Equal(DashboardReadingState.Stopped, stopped.State);
Assert.Equal(DashboardReadingState.Good, stopped.RangeState);
Assert.Equal(850d, stopped.NumericValue);
await session.DisposeAsync();
}
@ -378,7 +516,7 @@ public sealed class LiveDashboardAcquisitionTests
{
var scheduler = new ControlledDashboardScheduler();
using var provider = CreateProvider(scheduler);
var session = await OpenStaticSessionAsync(provider);
await using var session = await OpenStaticSessionAsync(provider);
var factory = provider.GetRequiredService<ILiveDashboardFeedFactory>();
var feed = factory.Create(session);
@ -390,7 +528,7 @@ public sealed class LiveDashboardAcquisitionTests
Assert.Throws<ObjectDisposedException>(() => factory.Create(session));
await scheduler.CancellationObserved.Task;
var replacement = await OpenStaticSessionAsync(provider);
await using var replacement = await OpenStaticSessionAsync(provider);
var replacementFeed = factory.Create(replacement);
Assert.NotSame(feed, replacementFeed);
Assert.NotEqual(feed.Snapshot.Source.SessionIdentifier, replacementFeed.Snapshot.Source.SessionIdentifier);
@ -402,7 +540,7 @@ public sealed class LiveDashboardAcquisitionTests
public async Task DiagnosticFeatureScopeDisposalClosesTheSessionOwnedFeed()
{
var scheduler = new ControlledDashboardScheduler();
var provider = CreateProvider(scheduler);
using var provider = CreateProvider(scheduler);
var diagnostics = provider.GetRequiredService<AutoForge.UI.Features.Vehicles.Diagnostics.DiagnosticPageViewModel>();
diagnostics.LoadSyntheticExample();
var profile = Assert.Single(diagnostics.AvailableProfiles);
@ -449,7 +587,7 @@ public sealed class LiveDashboardAcquisitionTests
return response;
});
using var provider = CreateProvider(scheduler, rewriting);
var session = await OpenStaticSessionAsync(provider);
await using var session = await OpenStaticSessionAsync(provider);
DiagnosticSession? replacement = null;
try
{
@ -509,7 +647,7 @@ public sealed class LiveDashboardAcquisitionTests
{
var scheduler = new ControlledDashboardScheduler { FailNextWait = true };
using var provider = CreateProvider(scheduler);
var session = await OpenStaticSessionAsync(provider);
await using var session = await OpenStaticSessionAsync(provider);
var feed = provider.GetRequiredService<ILiveDashboardFeedFactory>().Create(session);
var startException = await Record.ExceptionAsync(() => feed.StartAsync());
@ -551,7 +689,7 @@ public sealed class LiveDashboardAcquisitionTests
var configurations = provider.GetRequiredService<IDynamicsConfigurationService>();
var configuration = configurations.CreateExample(profile.ProfileIdentifier, profile.Revision);
var sessions = provider.GetRequiredService<IDiagnosticSessionService>();
var session = await sessions.OpenDynamicsAsync(
await using var session = await sessions.OpenDynamicsAsync(
profile.ProfileIdentifier,
profile.Revision,
DynamicsDiagnosticTransportFactory.ProviderIdentifier,
@ -659,6 +797,15 @@ public sealed class LiveDashboardAcquisitionTests
private static int CountSignalReads(DiagnosticSession session) =>
session.Trace.Entries.Count(entry => entry.Service == DiagnosticServices.ReadSignals);
private static string GetGaugeMarkup(string html, string gaugeIdentifier)
{
var start = html.IndexOf($"data-gauge=\"{gaugeIdentifier}\"", StringComparison.Ordinal);
Assert.True(start >= 0, $"Expected gauge '{gaugeIdentifier}' in rendered dashboard.");
var end = html.IndexOf("</article>", start, StringComparison.Ordinal);
Assert.True(end >= start, $"Expected closing gauge card for '{gaugeIdentifier}'.");
return html[start..end];
}
private sealed class ControlledDashboardScheduler : ILiveDashboardPollScheduler
{
private readonly Channel<TaskCompletionSource> _waits = Channel.CreateUnbounded<TaskCompletionSource>();

View File

@ -24,7 +24,8 @@ public sealed class LiveDashboardGaugeRenderingTests
});
Assert.Contains("850 rpm", html);
Assert.Contains("85", html);
Assert.Contains("aria-valuenow=\"85\"", html);
Assert.Contains("width: 85%", html);
Assert.Contains("height: 100%", html);
Assert.Contains("Good current reading", html);
Assert.Contains("RPM &lt;script&gt;", html);
@ -32,27 +33,29 @@ public sealed class LiveDashboardGaugeRenderingTests
}
[Theory]
[InlineData(null)]
[InlineData(double.NaN)]
[InlineData(double.PositiveInfinity)]
[InlineData(double.NegativeInfinity)]
public async Task BarGauge_InvalidGeometryDoesNotRenderAWidth(double percent)
public async Task BarGauge_GoodNumericValueWithInvalidPercentDoesNotRenderGeometry(double? percent)
{
var html = await RenderAsync(new Dictionary<string, object?>
{
[nameof(LiveDashboardGauge.Label)] = "Speed",
[nameof(LiveDashboardGauge.ValueText)] = "--",
[nameof(LiveDashboardGauge.ValueText)] = "850",
[nameof(LiveDashboardGauge.Unit)] = "rpm",
[nameof(LiveDashboardGauge.Kind)] = "bar",
[nameof(LiveDashboardGauge.State)] = "Unknown",
[nameof(LiveDashboardGauge.Reason)] = "No numeric source value",
[nameof(LiveDashboardGauge.State)] = "Good",
[nameof(LiveDashboardGauge.Percent)] = percent
});
Assert.Contains("-- rpm", html);
Assert.Contains("No numeric source value", html);
Assert.Contains("850 rpm", html);
Assert.Contains("Good", html);
Assert.Contains("Bar geometry is unavailable", html);
Assert.DoesNotContain("role=\"meter\"", html);
Assert.DoesNotContain("width: 0%", html);
Assert.DoesNotContain("NaN", html);
Assert.DoesNotContain("Infinity", html);
Assert.DoesNotContain("role=\"meter\"", html);
}
[Theory]