fix(grpc-data): H1 peer takes consume before verifying, scopes snapshot the incarnation per request, wiring faults are BadInternalError (verification 1-3, 7b)

- a take computes its expectation only after consuming the record, so a
  throwing incarnation source cannot leave a token replayable;
- a PeerHistoryContinuationScope is per request and reads the serving
  incarnation once, so a request straddling a failover binds its next
  token to the incarnation it started under (Save never answers null);
- a non-owner principal or a blank/throwing incarnation source raises
  PeerHistoryContinuationWiringException, answered BadInternalError (not
  BadHistoryOperationUnsupported); plan H2 note added;
- ConnectionIncarnation documented as identity only.
This commit is contained in:
Joseph Doherty
2026-11-23 20:09:01 -05:00
parent 6c70c93c62
commit 100dd5ca44
5 changed files with 170 additions and 32 deletions
@@ -1087,8 +1087,11 @@ settle windows are calibrated at the A1 exit (L4), before `state_known` ships.
- origin over the H1 port (H1 review notes): `ReadHistory` is synchronous (it block-bridges like the SDK overrides), so run
it off the RPC thread; it and `PeerHistoryContinuationStore`/`Scope` are `internal` to OpcUaServer, so add
`InternalsVisibleTo` for the serving project or a public facade implementing `IDataHistoryService`; one store per
(principal, connection incarnation), `Clear()`ed on connection close; the scope's serving incarnation comes from the
connection (read live, so an in-process failover invalidates tokens); items carry a view `BindingTag` (mapping id/kind);
(principal, connection incarnation), `Clear()`ed on connection close; ONE `PeerHistoryContinuationScope` per RPC — it
snapshots the serving incarnation (from the connection) at first use, so a later request after an in-process failover
is refused and a request straddling one binds its next token to the incarnation it started under; a miswired scope
(non-owner principal, blank/throwing incarnation source) raises `PeerHistoryContinuationWiringException`, which the
port answers `BadInternalError` — H2 must surface it distinctly (a server fault, never "unsupported" or "denied"); items carry a view `BindingTag` (mapping id/kind);
Processed/AtTime chunking and the consumer's assembly budget live in the transport, not the port; history capabilities
are an additive H2 capabilities field.
- Files: proto/mapper, `Host/Grpc/DataConnectionGrpcService.cs`,