Files
lmxopcua/docs/ui-consistency/evidence/ot13-driver-operations/README.md
T
2026-11-14 00:50:12 -05:00

8.8 KiB

DriverStatusPanel operation and confirmation checkpoint

Owned production scope is only Components/Shared/Drivers/DriverStatusPanel.razor, plus the new DriverOperationConfirmationTests and this evidence. Hosts, shared dialog/Monaco JS, package pins, messages, stores, schema and backend services are not edited by this slice. The coordinator owns the composed Hosts controls modal/native fixture and its final rendered acceptance.

Contract

All original parameters remain. The only addition is optional EventCallback<bool> BusyChanged. An operation captures the originating callback, driver/cluster identity, presentation generation, operation kind and correlation before its first await. Reconnect and Restart share one single-flight guard. Current operation entry emits true once; completion emits false only if that same operation/presentation is still current. Retired/disposed A cannot emit false into B, install an A result or clear B's operation. The owner must reset its own busy state on target/key change and guard captured callback inner work; the coordinator confirmed that Hosts does so.

Both actor operations retain their original typed Ask messages, current claims username/name-identifier/unknown fallback, 15-second operation-local CancellationTokenSource and outcome wording. Claims are re-read at click time and DriverOperator authorization is rechecked before Ask. Current driver/cluster/Enabled/operation identity is checked after each awaited callback/auth/policy step. Disposal does not cancel an already-dispatched actor request; its existing budget still applies. It suppresses later UI/callback effects.

Restart remains an inline named group with linked impact text, never a second modal. Safe Cancel is focused through the existing public ElementReference API. Cancel returns focus to current Restart. Each confirmation has its own epoch: Cancel→reopen on the same driver invalidates an actual retained old Confirm callback, even though the target generation is unchanged. Focus requests are captured, cleared before awaiting, and checked against presentation/confirmation/visibility/busy state; late focus completion has no state-unlocking continuation.

Initialization is identity-bound, so direct driver/cluster/Enabled replacement refreshes only that context. Delayed auth/policy success or failure after retirement/disposal cannot create subscriptions/timers or fault the replacement view. Current initialization failures retain their existing exception semantics. Subscriptions are tracked and retired explicitly. Five-second render ticks, health/resilience callbacks and eight-second outcome expiry marshal to the renderer with current-generation/disposal checks. Old result timers also have an outcome sequence guard.

Preserved domain behavior

source-guard.json confirms health/resilience markup is byte-identical, and driver-state chip/age helpers are byte-identical. The per-reporting-node view still primes from the store's actual local receive times, with the same 30-second health and three-publish/15-second resilience staleness boundaries. State names, error counts, last-success/last-error fields, resilience host/breaker/in-flight meanings and complete DiagnosticDetails are unchanged. Disabled still has no live subscriptions. No invented health verdict is derived from an actor dispatch result.

The five-second tick, eight-second outcome expiry, 15-second Ask budget and existing source-scan assertions are retained. No model, authorizing policy, message wire contract, status store, runtime query or package change occurred. Existing callers without BusyChanged remain valid and are covered by the unchanged tests.

Tests and evidence

Final acceptance-final.trx / acceptance-final.log: 71 passed, zero failed/skipped. This is 24 new cases plus47 existing DriverStatusDiagnostics, DriverStatusByNode, DriverStatusSnapshotStore, HostsDriverView and HostsPanelWiring cases.

New cases cover:

  • Delayed initial auth/policy disposal with no subscription/read/timer installation; late initial auth/policy exceptions after replacement/disposal.
  • Reconnect/Restart shared guard before auth completes; current role revocation; target/Enabled/disposal retirement during both auth and policy waits.
  • Captured current username/driver/cluster/correlation and cancellable existing budget; no view-driven cancellation after dispatch.
  • Current true/false busy notifications; captured asynchronous BusyChanged retarget; late A result/exception unable to clear B's busy state/outcome.
  • Inline accessible group/safe Cancel focus and actual retained Confirm callback across same-driver Cancel/reopen, followed by a valid current confirmation.

The first baseline red.trx recorded10 failures. Eight are valid behavior/API-contract reds; two initial-disposal cases were harness failures because bUnit cut.Instance was read after disposal. The corrected tests retain the actual instance before disposal and await its actual initialization lifecycle. green-first.trx retains the same two harness failures alongside56 passes; green-corrected.trx passes all58 then-current cases. These two failures are not claimed as product reds.

confirmation-epoch-actual-red.trx records one meaningful retained-handler failure before implementation: the actual old rendered Confirm delegate restarted the same driver after Cancel/reopen. Its original fixture build intersected the coordinator's partial Hosts markup; that compile log is retained separately, not described as behavioral red. The real renderer snapshot is read through reflection in the test only; no production seam or analyzer suppression was added.

initial-auth-failure-red.trx records four actual late initialization exceptions escaping the base lifecycle before the filtered retired-only catch; final positive cases capture the real lifecycle result in a test-only derived observer. Current exceptions are not globally suppressed. Earlier65/69 green aggregates are historical checkpoints;71 is final.

The unit focus assertions use strict bUnit focus interop, not real native keyboard/scroll evidence. Actual composed Hosts confirmation, busy-close, narrow/zoom layout and focus proof are coordinator-owned and remain a separate acceptance gate. This checkpoint does not claim native/assistive-technology or full OT14 acceptance.

State matrix

Phase Allowed behavior Forbidden stale effect
Initial auth/policy pending Same current context may finish setup Subscribe/create timer after retirement or disposal
Inline restart question Safe Cancel or current explicit Confirm Old Confirm approving a reopened same-driver question
Operation auth/policy pending One shared operation; current reauthorization New Ask after target/Enabled/role retirement
Ask dispatched Existing request and15-second budget finish View cancellation/replay; old UI result/busy false into B
Current result Existing short outcome/full disclosure and8-second expiry Older expiry clearing a newer result
Retarget/dispose Retire callbacks/subscriptions/timers Old callback updating new context

Every managed test invocation used the mandatory owned-loopback private SQL runner, including discovery. The tests themselves register recording in-memory stores and operation/auth fakes; no real driver/cluster/SQL mutation occurred. Private state/credentials were not read, printed or copied. Isolated artifacts are repository-anchored under artifacts/ot13-driver-operations; xUnit3/bUnit2.7.2 and other package versions are unchanged.

Reproduce from the OtOpcUa repository root:

python3 infra/tools/ui-consistency/with_private_sql.py --state "$OT_PRIVATE_SQL_STATE" -- dotnet test tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.csproj -c Debug --artifacts-path artifacts/ot13-driver-operations --filter 'FullyQualifiedName~DriverOperationConfirmationTests|FullyQualifiedName~DriverStatusDiagnosticsTests|FullyQualifiedName~DriverStatusByNodeTests|FullyQualifiedName~DriverStatusSnapshotStoreTests|FullyQualifiedName~HostsDriverViewTests|FullyQualifiedName~HostsPanelWiringTests' --logger 'trx;LogFileName=acceptance-final.trx' --results-directory docs/ui-consistency/evidence/ot13-driver-operations

No independent host was started by this slice. Coordinator native integration, combined suite, route/caller acceptance and final package/release gates remain separate. No deployment, publication, push, schema or data migration is implied.

Early fleet filtering follow-up

Parent review restored the exact Ordinal driver-ID filter before dispatcher scheduling, preserving the original unrelated-fleet event performance boundary. Same 71 cases passed in the combined ScriptEdit baseline run (../ot13-script-edit/red-valid.trx); seven unrelated ScriptEdit baseline failures are separately classified. early-filter-verification.json records the split. Source guard regenerated; no status semantics changed.