AutoForge/prompts/Step-06A.md

12 KiB

Step-06A - Preference rejection and unavailable display readouts

STEP IDENTIFIER

Step-06A, focused correction of original Step-06 R-01/R-02. Step-06 is NOT ACCEPTED; corrected Step-05 and earlier milestones remain accepted. This is the sole active assignment. Step-07 recording/replay is blocked.

STEP TITLE

Make rejected unit preferences atomic at service/control boundaries and preserve explicit unavailable/typed source semantics across display readouts.

OBJECTIVE

Close two existing-scope failures in Step-06, principally its C-07/C-08/C-09 and all-surfaces/validate-before-mutate requirements. Do not redesign the conversions, preference storage, editor or unit UX.

Read STATE.md, original Step-06, its preserved report and WORKER-QUALITY-GATE.md. Reproduce the applicable failures, fix and self-review within this assignment, write prompts/Step-06A-Report.md, and STOP.

ARCHITECTURAL CONTEXT

Keep all nine projects, one MAUI Client, pure Components and the existing shared Application conversion/preference port -> UI presentation -> native storage boundary. No new package, host, general settings framework or unit family. Source/tests remain under src, tests under src/tests.

The actual Imperial (US)/Road default, Metric/Road/Engineering options and approved exact mappings remain unchanged. SI model/configuration/raw source data, canonical gauge bounds and one session owner remain authoritative.

CURRENT IMPLEMENTATION STATE

Worker-reported Step-06 results: complete nine-project Release build zero warnings/errors; 178 unit + 92 integration passes (270 total, zero failed/ skipped), native default/restore/static/dynamic/four-speed-mode/editor/close smoke. The 44 numeric/preference unit cases and Good-speed 20-toggle integration preserve meaningful positive behavior. Retain all of it.

The orchestrator source review found two gaps; it did not execute a reproduction, build, test or native launch. Reinspect Git and preserve existing worker changes and all assignments/reports before editing.

REQUIRED IMPLEMENTATION

R-01 - Validate before initialization and reconcile rejected controls

TrySet calls Initialize before IsValid. With a fresh service backed by a saved Metric selection, an undefined proposal returns false after reading the store and changing Selection/IsInitialized. Original section A explicitly requires undefined options to reject before any state/store mutation.

MainLayout uses plain value/onchange for both selectors. A browser choice is already changed when TrySet fails; rendering the same previous value does not guarantee that the browser option is restored. The service/error/readouts may retain the prior selection while the control shows the rejected one.

Use the framework-supported binding/reconciliation mechanism, not a reload or second settings state. See the official Blazor guidance. Keep persistence-before-publication, explicit failure messages and successful retry. Validate undefined selections before initialization/read/write; changing the visible error is allowed, but do not load/change active or initialized state as a side effect of rejecting an invalid proposal.

Prove both actual control selections and shared readouts remain consistent on failed unit-system and speed-mode saves. A direct TrySet assertion or static HTML value string alone is not proof of browser/event rollback.

R-02 - Do not echo unavailable/wrong-type values as normal display data

DisplayUnitPresentation returns JsonElement.ToString for every non-number and sourceText when a numeric value is absent. Therefore null may display blank, wrong-type values for numeric units bypass conversion/error handling, and unknown-unit text has no explicit unconverted notice. Current readout callers do not supply source quality for the Unknown-value placeholder contract.

Apply the original availability/quality/typed/unit rules consistently to the diagnostics and simulation primary readouts, retaining their raw source columns/ inspectors. Reuse the shared boundary rather than adding per-page fallbacks.

  • Missing/null/undefined or Unknown current measurement -> explicit -- and appropriate source/unavailable context, not blank, zero or a current converted numeric reading. Do not change the underlying source quality.
  • A known numeric quantity with non-numeric data -> explicit unavailable/error display, not ordinary echoed measurement text. Keep raw source text visible in the separately labeled source inspector.
  • Valid numeric zero and boolean false remain legitimate, distinct pass-through values. Finite Uncertain values remain numeric and visibly Uncertain; retained Stale/Stopped readings preserve their source state/time/range.
  • Unsupported units, including valid non-numeric source content, preserve the actual source value/unit with an explicit unconverted notice. Do not relabel them, invent a conversion or convert them into a fabricated numeric zero.
  • A display/conversion failure stays separate from original source state, as the corrected dashboard path already requires.

Static-v1 accepts null/non-numeric JSON source values, so these are reachable real inputs. Use that existing contract for tests. Do not weaken strict v2 signal validation or alter protocol/schema/model behavior to manufacture cases.

Frozen corrective matrix

ID Input/precondition Required result
C-01 Fresh service, saved Metric selection or faulting read store; undefined system/speed proposal Visible typed rejection before initialization/read/write; original Selection, IsInitialized and persisted-state flag unchanged; zero store calls
C-02 Initialized active preference; user changes either selector while store write fails Explicit error; service, actual selected options and shared readouts all show the previous active preference; no source/model/acquisition mutation
C-03 Store recovers; repeat a valid control change Selection saves/publishes once; both controls/readouts agree and error clears; restoration/default semantics remain intact
C-04 Real v1 null/missing numeric or Unknown quality, including Unknown with a numeric source value Primary readout is --, never blank/current numeric/zero; original raw value/unit/quality/time remain available separately
C-05 Wrong-type data for a known numeric unit; valid zero/false; unsupported-unit numeric/text Numeric type error is explicit; zero/false stay real; unsupported content/unit is retained with notice, not silently treated as a converted measurement
C-06 Unit changes for converted Uncertain/Stale/Stopped/failed-display cases Existing quality/range/reason/time and canonical bounds remain correct; no healthy-state substitution, fake bar or extra read/step
C-07 Existing numeric/default/persistence/editor/raw-source and native baseline All 270 cases and original vectors/source invariants preserved; positive native behavior still works; recording/replay remains unimplemented

FILES OR PROJECTS EXPECTED TO CHANGE

Existing preference service guard, shared shell selector binding, shared display presentation and necessary diagnostic/simulation caller context, focused tests and directly related docs/README/verification record. Native adapter or panel changes only if an actual coupled assertion requires them; no redesign. Only prompts/Step-06A-Report.md under prompts.

INTERFACE AND DEPENDENCY REQUIREMENTS

Keep exact source binding/unit/canonical bounds and all 1e-9 representative conversion vectors, Imperial first-use default, explicit persisted/error status, one shared preference and native MAUI storage. No silent in-memory native fallback, source alteration, engine oracle, new dependency or protocol relaxation.

Preserve the nine-project graph, diagnostic/partial-discovery/verified-clear gates and independent physics time. No workload/system install/restore/update/ repair/rollback, staging/commit/push, destructive Git, or protected/history edit.

TESTING REQUIREMENTS

Record actual pre-fix failures for C-01/C-02 and the reachable R-02 readout paths, then verify corrected behavior. No compilation failure or invented browser observation counts as reproduction. If an inspected path behaves differently under actual event testing, record the decisive evidence, not an assumed failure.

Use the real service plus explicit faulting store below its boundary. Exercise the actual selector event/DOM or framework-supported event/render reconciliation, not only direct service calls. No production platform-failure selector or additional host/package is assigned.

Use real v1 session/provider/rewrite transport and rendered diagnostics/readouts for nullable/non-numeric/Unknown values; preserve v2's boolean/numeric shape. Add meaningful shared-helper and converted quality-state assertions rather than citing only the old Good/rpm tests. Retain source text/quality/time/trace bytes, canonical definitions and request/model counts. Release resources in finally.

Run focused cases, then sequentially:

  • dotnet build .\src\AutoForge.slnx --configuration Release --no-restore
  • dotnet test .\src\AutoForge.slnx --configuration Release --no-build

Preserve the 270 baseline cases (178 unit, 92 integration) plus meaningful new coverage. Map intentional display-only assertion updates; do not remove source/ safety/error checks. No dependency restore/install absent a real missing failure.

Recheck the rebuilt native static/dynamic selector/readout/editor baseline and persistence/close. Controlled fault-store/invalid-source tests establish error paths; do not represent them as native platform-failure observations. Preserve task-owned-only preference/profile cleanup and unrelated user data. If required verification is blocked, report its exact unmet criterion honestly.

DOCUMENTATION REQUIREMENTS

Align preference rejection, unavailable/source-quality/unsupported-unit display semantics and verification evidence with actual behavior. Keep the approved default/mapping/draft policy and positive Step-06 native report as history. Do not claim Step-06 acceptance or Step-07 implementation.

ACCEPTANCE CRITERIA

ID Criterion Evidence
AC-01 R-01/C-01..C-03 invalid/rejected preference changes are atomic through service and controls Actual pre-fix/service/event failures and corrected control/readout/store assertions
AC-02 R-02/C-04..C-06 all assigned primary readouts apply explicit typed/quality/availability/unit rules Real v1/rendered/helper tests, correct zero/false/unsupported handling and preserved converted states/source
AC-03 C-07 original numeric/preferences/editor/source/model behavior and 270 regressions preserved Focused plus complete nine-project Release build/tests and native baseline evidence
AC-04 Original C-07/C-08/C-09 and related acceptance mapping, self-review and docs are accurate Named executed cases, exact inputs/results and source-path self-review after first green
AC-05 Existing history/protection/dependencies/manual workflow preserved; report saved and worker stops prompts/Step-06A-Report.md and preservation/Git review

OUT-OF-SCOPE WORK

Recording/replay, new unit families/pressure/volume/economy, preference/editor/ layout redesign, charts/dashboard persistence, schema/protocol/physics/clock, new host/project/package, AI/hardware and unrelated cleanup. No agents/automatic handoff, future assignment, orchestration/shared-gate edit, stage, commit or push.

REPORTING REQUIREMENTS

Save prompts/Step-06A-Report.md entirely inside exactly one plain triple-backtick fence, no language tag/outside content/nested fences. Include identifier/title/ status, implementation/files/interfaces, R-01/R-02 and C-01..C-07/AC-01..AC-05 mapping, named actual pre/post results, precise service versus control/browser evidence, commands/exits/warnings/per-project counts, native versus controlled coverage, docs/README, self-review after first green, limitations/deviations/ blockers and preservation review.

COMPLETE requires all assigned checks; otherwise report INCOMPLETE/BLOCKED and the precise missing criterion. Save and STOP for manual review; no Step-07.