From 27d1501b690f6d6ea87c8726b7f64c59186867fb Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Tue, 24 Nov 2026 09:08:52 -0500 Subject: [PATCH] =?UTF-8?q?docs(grpc-data):=20H4=20evidence=20=E2=80=94=20?= =?UTF-8?q?review=20table,=20gates=20and=20live=20re-run=20after=20the=20r?= =?UTF-8?q?eview=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/plans/evidence/grpc-data-ext/H4.md | 50 +++++++++++++++++++++---- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/docs/plans/evidence/grpc-data-ext/H4.md b/docs/plans/evidence/grpc-data-ext/H4.md index da798f502..422212bc4 100644 --- a/docs/plans/evidence/grpc-data-ext/H4.md +++ b/docs/plans/evidence/grpc-data-ext/H4.md @@ -10,8 +10,8 @@ the alarm diagnostics are A4. (`DataConnectionDeploymentRuntime`, `DriverHostActor`), so none of them depends on another (the origin composition is resolved lazily after the driver host exists; a direct dependency would be a cycle). - **Metrics** on `OtOpcUaTelemetry.Meter` (`ZB.MOM.WW.OtOpcUa`, already in the host's exported-meter allowlist), no ids in labels: - - `otopcua.dataconn.history.reads{variant,status_class,side}` — origin: one per item answered to a peer; consumer: one per - projected node answered to a local OPC UA client. + - `otopcua.dataconn.history.reads{variant,status_class,side}` — origin: one per item per wire call served to a peer (review 3); + consumer: one per projected node per local HistoryRead, with the status the client got (review 1). - `otopcua.dataconn.history.continuations.active{side}` — observable gauge over the live diagnostics instances (weak table). - `…operations.unknown_bits_dropped`: **reused, not added.** X0's `otopcua.dataconnection.unknown_operations_dropped{kind}` counts exactly that (one per row per accepted artifact change); a second instrument would double-count. Pinned by @@ -96,6 +96,43 @@ historian is down. Per the plan's fallback, **#923** (`type:deploy-gate`, `block verified on the **SqlServer and QuestDB** origin backends only, with the **Gateway backend unverified pending #923** (`DataConnections.md`, `Historian.md`, `Client.CLI.md`). +## Review (Fable, approve-with-changes) — fixes + +One focused commit per item (5 and 6 share one AdminUI commit). Red/green by reverting the fix and re-running its test, unless noted. + +| # | Finding | Resolution | Red/green | +|---|---|---|---| +| 1 should-fix | Consumer reads were counted from the gateway's outcomes: the non-local and batch limiter `BadTooManyOperations`, the pre-call `BadTimeout` and the count-mismatch `BadInternalError` were never counted, and a serve-time throw after the gateway returned counted Good | The node manager counts where each projected status is set (`Refuse` + the served path) and hands the request's answers to `IProjectedHistoryAccess.RecordAnswered` (default no-op) in a `finally`; a fault escaping to the SDK (the service fails) counts every projected node of the request Bad. Attribution to a connection via `ProjectedDataAccess.ConnectionOf` (best effort, no authorization). Variant gains `modified`. `2f11a9c60` | O `Every_projected_answer_is_recorded_once_with_the_status_the_client_sees` (served, unknown aggregate, modified, non-local limiter saturated, batch limiter saturated, spent deadline, count mismatch, serve-time throw) — red with the non-local limiter refusal routed back to the uncounted path | +| 2 should-fix | `CaptureOrigin` null until the first peer call composes the origin services ⇒ a fresh H4 origin read like a pre-H4 build | Eager resolution is not clean: `LocalDataRuntimeComposition` needs the driver host actor registered and is composed by the first peer call through `DeferredFactory`. Instead the DI singleton gets a provisional probe of the same `DeferredOriginHistoryPort` (backend availability) and reports zeros with `NoPeerTrafficYet = true`; the page adds "no peer has called since start". Docs updated. `005720bd0` (+ rename in `7498f1ce8`) | R `Before_any_peer_call_a_provisional_origin_reports_no_peer_traffic_yet_not_unavailable`; live (below) | +| 3 nit | Origin reads count wire calls (chunk-token follow-ups count again) | Kept per call; docs, the class remarks and this file say "per item per wire call". `b5509dfc4` | — (doc) | +| 4 nit | `OpenContinuations = Cursors.Count + ChunkCount` double-counted a chunk holding its page cursor | `OriginHistorySession.OpenContinuations` counts chunks + cursors − cursors referenced by a live chunk (`OriginHistoryCursors.Contains`). `79cf50d50` | R `Open_continuations_count_a_chunk_holding_its_page_cursor_once` (3, was 4) — red on revert | +| 5 nit | `HistoryServed` said "not advertised" with no handshake evidence | "unavailable" when both `NegotiatedFeatures` and `HistoryVariants` are null. `2fba03617` | AdminUI display test (new assertion fails against the previous helper by inspection) | +| 6 nit | `Features()` hid unknown bits beside a known one; `DroppedBits` scanned bits 0–30 | Both render every set bit of all 32, named when known, hex otherwise. `2fba03617` | AdminUI display tests: `History, 0x8`, `0x80000000`, `HistoryRead, 0x80000000` (fail against the previous helpers by inspection) | +| 7 nit (tests) | No unit round-trip of the snapshot on the cluster serializer; no mixed-version payload | `GrpcDataDiagnosticsSerializationTests` round-trips a `NodeDiagnosticsSnapshot` with every H4 member through `Sys.Serialization.FindSerializerFor` (Akka's default JSON serializer — the fleet-diagnostics Ask has no custom binding), and decodes payloads stripped of the H4 members (null = "unavailable"). **Found by it:** Newtonsoft fills a missing constructor argument with the CLR default, not the C# default — the item-2 flag, first named `PeerServicesStarted = true`, would have decoded `false` from a sender without it; renamed `NoPeerTrafficYet` (default false) with a test. Also: a C# collection expression typed `IReadOnlyList` is a synthesized type Newtonsoft cannot construct — production builds arrays (checked), the test fixture uses arrays. `7498f1ce8` | new tests | + +Left as notes (no code change, per the review): + +- `OriginHistoryPort._serving` caches an unsynchronised nullable tuple — a pre-existing benign race (two callers may both compute + it); H4 adds the metrics scrape thread as a caller through `HistoryServing`. +- `DataConnectionHistoryDiagnostics._consumer` is never pruned; bounded by the deployed connection ids a process has seen. + +**Gates after the review fixes** (HEAD `7498f1ce8`), run one at a time: build 0 warnings / 0 errors; `run-unit-phase.py` H4 +(9 + 12 + 29), H3 (107 + 145), H2, H1, X0 all passed; AdminUI.Tests 2698; Runtime.Tests 1915 (+3 skips); OpcUaServer.Tests 1420 +(+1 skip) (`Category!=E2E&Category!=LiveIntegration`); no `GrpcDataConfiguredDiscoveryWireTests` (#920) failure. + +**Live re-run** (fresh `h4b-sqlserver`, 2026-11-24): items 1 and 2 changed runtime behaviour (the consumer count moved into the node +manager; a new DI-built provisional origin state), so the SqlServer leg was re-run. +- Right after deploy, before any history traffic, the CONSUMER page's origin panel showed consumer-1/2 "remote history no historian + backend · peer history sessions 0 · open origin continuations 0 · … · no peer has called since start", and source-2 (no peer + call yet) "remote history served · … · no peer has called since start" — where `h4a` had shown "remote history evidence + unavailable" (item 2). +- H01–H06 **all PASS** (47 / 34 / 35 / 71 / 58 / 238, all restored). +- After the gate: consumer-1 page "projected history reads good 36 · uncertain 0 · bad 3" = its `reads{side=consumer}` series + (raw good 33, processed good 1, attime good 2; raw bad 2, processed bad 1); source-2 page "good 7 · bad 2" = its origin series. +- Held probe: while held, consumer gauge 1, source-2 origin gauge 1, page "open remote continuations (local sessions) 1" and + source-2 "peer history sessions 1"; after resume to completion all 0, projected good 37 ⇒ 56. +- `down` ⇒ 0 run containers, 0 run volumes. + ## Not verified / notes - **Gateway backend** remotely (#923, above). @@ -103,13 +140,12 @@ verified on the **SqlServer and QuestDB** origin backends only, with the **Gatew passed H01–H06 on QuestDB at `713cbfb21`. The brief asked for one SqlServer leg. - **Browser-rendered** page not driven (no Chrome session used); verified from the server-prerendered HTML, which runs the same `OnInitializedAsync` + render as the interactive circuit. -- **Akka serialization of the new snapshot members** was exercised only live (the rig's control node read data-node snapshots - through the fleet-diagnostics path and rendered every new field), not by a unit round-trip test. +- **Akka serialization**: now unit-tested (review 7) as well as exercised live. - **Deviation:** the reads counter carries a third label `side` (origin | consumer) beyond the plan's `{variant,status_class}` — a node can be both, and without it the two populations would be summed into one series. The gauge carries `side` too. -- Consumer counts include every projected node answered (Bad included), but a node refused by the node manager BEFORE the gateway - (no local HistoryRead grant ⇒ `BadUserAccessDenied`, unhistorized ⇒ `BadHistoryOperationUnsupported` from the SDK) is not counted. - A consumer node shows "remote history evidence unavailable" in the origin panel until something resolves its origin services. +- Consumer counts cover every projected node that reaches the projected half (review 1). A node the SDK or the node manager's + authorization refuses before the split (no local HistoryRead grant ⇒ `BadUserAccessDenied`; not Historizing ⇒ + `BadHistoryOperationUnsupported` from the SDK's access-level check) is not counted: it never reaches the projected half. - Counts are since process start (no persistence), as the docs say. - `GrpcDataConfiguredDiscoveryWireTests` (#920 flaky class): no failure in any run this phase (H4 manifest, H3 manifest, full Runtime suite). - Umbrella history entry (plan exit gate): **not done here** — it is a commit on `scadaproj` `main` plus a push, and this worktree brief forbids pushing; left to the orchestrator (append to `../scadaproj/.claude/skills/sister-project-history/otopcua.md`). The Gitea close of #919 likewise belongs with the merge.