Files
lmxopcua/docs/plans/evidence/grpc-data-ext/H1.md
T
2026-11-23 20:20:38 -05:00

43 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# H1 evidence — origin history port at override level
Phase H1 of `docs/plans/2026-11-23-grpc-data-connections-history-alarms-plan.md`, 2026-11-23.
## What changed
- `OpcUaServer/HistoryReadPort.cs`: `ReadHistory(HistoryReadVariant, items, IHistoryContinuationScope, ct)` holds the
aggregate refusals (#897, `SupportsAggregateFor`, `IsServable`), modified+bounds `BadInvalidArgument`, the batch limiter,
deadline, continuation binding and `NormalizeHistoryValues`. The three SDK overrides are `AuthorizeHistoryRead` +
`ServeHistoryReadAdapter`. `ServeNodeAsync` / `ServeRawPagedAsync` / `ServeModifiedPagedAsync` stay in NM. Nothing moved
under `Lock`.
- Continuation binding re-keyed from the NodeId string to `(realm, identifier, binding tag)`; the local tag is the node's
namespace URI, so the binding is as strong as the old NodeId key for every history-served node.
- `OpcUaServer/PeerHistoryContinuationStore.cs` (unwired until H2): 16-byte random tokens, single-use takes (consumed before
any check), idle expiry 60 s, oldest-idle eviction, binds principal, per-request serving-incarnation snapshot, epoch, view,
tag and an invariant details hash. Wiring faults raise `PeerHistoryContinuationWiringException` ⇒ `BadInternalError`.
- `Core.Abstractions/DataConnections/IDataServices.cs`: SDK-free `IDataHistoryService` contract for H2.
## Gates (final HEAD of the H1 branch)
| Gate | Result |
|---|---|
| `dotnet build ZB.MOM.WW.OtOpcUa.slnx` | 0 warnings, 0 errors |
| `run-unit-phase.py H1` | passed (17 Core.Abstractions + 578 OpcUaServer, incl. the 20 legacy history classes) |
| `run-unit-phase.py X0` | passed |
| OpcUaServer unit suite | 1,401 passed, 1 pre-existing skip |
| OpcUaServer.IntegrationTests history classes | 56 passed (4 AVEVA live-gate skips need HistorianGateway + VPN) |
| Core.Abstractions | 852 passed |
| `HistoryReadPortLimiterAndSessionTests` ×20 | 20/20 |
- Paged-vs-unpaged fuzz: 10,000 seeds over SqlServer / QuestDB / Gateway backend shapes, `pageCount <= n` (#736); a
deliberate tie-skip mutation in `ServeRawPagedAsync` failed it at seed 3 (reverted).
- No existing test was edited (`git diff --name-status` over `tests/` shows additions only).
- The tie to pre-H1 behaviour is the pinned literal outcomes in `HistoryReadPortParityTests` plus the unchanged legacy
suites; the parity tests themselves compare the adapter with the port.
- Not run: SqlServer/QuestDB historian integration suites (fixture connection strings) and the AVEVA live gate.
## Review
Three Fable passes: approve-with-changes (GoodNoData status, namespace binding tag, tautological peer binding, hash culture,
log field, fuzz bound, test gaps) → approve-with-changes (token consumed before check, per-request incarnation snapshot,
distinct wiring fault, override-path real-session test) → final fixes checked by the coordinator.