Commit Graph

5199 Commits

Author SHA1 Message Date
Joseph Doherty b66ee52086 test(grpc-data): H2 manifest gains the review-fix test classes 2026-11-23 22:31:15 -05:00
Joseph Doherty 9a808ba218 test(grpc-data): H2 review 10 - real Kestrel HTTP/2 proves the connection-close hook clears the session
In-process loopback h2c host: IConnectionLifetimeFeature.ConnectionClosed is exposed on the HTTP/2 stream context,
two requests on one connection share one session, and disposing the client connection clears it.
2026-11-23 22:12:28 -05:00
Joseph Doherty 7e22601ee7 test(grpc-data): H2 review 7 - mapped HistoryRead on a projected node stays BadHistoryOperationUnsupported until H3
With the mapping HistoryRead bit and a local HistoryRead grant, a real SDK HistoryRead on a projected variable is
refused (no HistoryRead access-level bit on projected nodes) with no data and no continuation.
2026-11-23 22:11:28 -05:00
Joseph Doherty 54d49e6cb6 fix(grpc-data): H2 review 9 - remote peers cannot starve local HistoryRead
Remote reads hold at most N - max(1, N/4) of the node manager's N process-wide history batch slots
(MaxConcurrentHistoryReadBatches); past that a remote request is BadTooManyOperations unsent, so local OPC UA clients
always keep at least one slot.
2026-11-23 22:09:49 -05:00
Joseph Doherty 6f1faaeb0b perf(grpc-data): H2 review 6 - Implemented(target) once per node; history serving cached per source
Metadata no longer rebuilds the history view per node x operation (and checks the ACL before the tagname, the
ingress order); OriginHistoryPort caches its served-aggregate set per historian source instance.
2026-11-23 22:06:02 -05:00
Joseph Doherty 3c5cbea931 fix(grpc-data): H2 review 2/3/4/9 - readiness is Ready()'s job; client faults never escape
Origin advertises history whenever it has a historian, so a not-ready/demoted endpoint answers HistoryRead
Unavailable (ungranted: PermissionDenied) and the consumer fails over like v1 Read instead of 'unsupported'.
Client: malformed/undecodable answers are endpoint failures (fresh read moves on); a resumed item is
ContinuationPointInvalid while a fresh item of the same batch is BadNoCommunication; a fresh read tries the next
endpoint when one lacks history; discovery backoff honoured; origin Cancelled without a caller cancel is BadTimeout
(no RecordFailure); caller cancel throws. The deployment lease maps inner/scope faults to BadNoCommunication.
The UnaryTimeout cap is documented next to the AdminUI field and in DataConnections.md.
2026-11-23 22:04:23 -05:00
Joseph Doherty 53e3970f27 fix(grpc-data): H2 review 1/5/9 - bound origin history memory per request and per principal
Nodes are read in sub-batches sized to the response budget and no sub-batch starts once it is spent: the rest are
DEFERRED chunk tokens (transport; read on resume from their original continuation) or BadTooManyOperations (direct
consumer). Processed intervals and AtTime times above MaxHistoryValuesPerPage are refused unsent. Remainder bytes are
charged to a per-principal budget across sessions (concurrent reads x max(response budget, one page)); sizes come
from the encoded CalculateSize; a single value above the response budget is a per-item BadTooManyOperations.
Sessions are capped per principal (own LRU evicted first) and globally (the heaviest principal pays); a release never
creates a session; channel-close registrations are unregistered on clear.
2026-11-23 21:59:59 -05:00
Joseph Doherty 82d34b84a8 fix(grpc-data): H2 review 9 - upper bounds on the history limits (validator + AdminUI max) 2026-11-23 21:54:38 -05:00
Joseph Doherty 6a621423f4 fix(grpc-data): H2 review 8 - history timeout rides the artifact, not the trust-scope fingerprint
DataConnectionScopeRevision covers consumer/connection/secret scope only; limits (TimeoutMilliseconds and now
HistoryTimeoutMilliseconds) reach DB-less nodes and the LocalDb cache in the artifact's entity JSON. Dropping the field
also avoids a one-time scope-version bump on upgrade. Plan 6 corrected.
2026-11-23 21:53:58 -05:00
Joseph Doherty e0956a55d6 docs(grpc-data): H2 evidence and docker-dev smoke recipe 2026-11-23 21:44:42 -05:00
Joseph Doherty 9bcdf92ff3 docs(grpc-data): remote history for runtime consumers; plan 4.1 probe-vs-RPC negotiation decision 2026-11-23 21:07:25 -05:00
Joseph Doherty 9b5bb29619 test(grpc-data): H2 manifest key and artifact projection of the history fields 2026-11-23 21:02:04 -05:00
Joseph Doherty 6fd4c2b0b5 feat(grpc-data): H2 AdminUI HistoryRead checkbox, history limit fields, X0 banner
Connection/export/mapping editors offer HistoryRead (DataOperationAuthoring, never ahead of the validator) and the
HistoryTimeoutMilliseconds / MaxConcurrentHistoryReads / MaxHistoryValuesPerPage / MaxHistoryResponseBytes /
MaxHistoryAssemblyBytesPerRequest fields; an informational banner shows while a post-v1 bit is ticked (plan 4.3).
2026-11-23 20:59:32 -05:00
Joseph Doherty b36c8d8716 feat(grpc-data): H2 consumer history client and deployed-connection history
GrpcDataConnection implements IDataHistoryService (explicitly; ReadHistoryAsync/ReleaseHistoryAsync avoid an overload
clash with ReadAsync): the capabilities probe always asks for history, other calls send it only when the selected
endpoint advertised it; per-call deadline min(remaining, HistoryTimeoutMilliseconds); FAILED_PRECONDITION/UNIMPLEMENTED
=> BadHistoryOperationUnsupported; chunks assembled within the request budget (BadTooManyOperations past it); page
tokens wrapped with the issuing endpoint + serving incarnation so a resumed read never moves; release forwarded. The
deployment lease gates history on the row's HistoryRead bit and carries HistoryTimeout. Decoded capabilities drop
HistoryRead without the history field. X0 tests that used bit 32 as the unknown bit now use a still-reserved bit.
2026-11-23 20:57:35 -05:00
Joseph Doherty d0756bb78e test(grpc-data): H2 wire suite; both v1 gates extended with history-shaped data
Both recorded-v1-client gates now run against origins that grant HistoryRead, advertise history capabilities and
carry HistoryInfo; header-less bytes stay identical to the goldens (not re-recorded). GrpcDataHistoryWireTests: probe
shapes, FAILED_PRECONDITION without the feature, denied/unhistorized/unknown byte-identical with no backend call,
admission, cancel, wiring fault, chunking + lost chunk, release, direct runtime consumer. Endpoint allowlist gains
HistoryRead (the auth middleware rejected it).
2026-11-23 20:48:56 -05:00
Joseph Doherty 025e6a075a Merge master (#918 real-origin compatibility gate) into H2 2026-11-23 20:42:51 -05:00
Joseph Doherty e7cacd2ac9 feat(grpc-data): H2 origin HistoryRead ingress, header gating, LocalDataConnection history
Service: HistoryRead rpc; history (field 16, Metadata.history, bit 32) emitted only on a call whose header requested
history AND whose origin can serve it, otherwise stripped to the v1 shape; un-negotiated HistoryRead is
FAILED_PRECONDITION. Origin: Implemented(target) grows by HistoryRead when a historian backend is configured;
per-item gate catalog -> export grant + origin ACL HistoryRead -> tagname, every refusal the same
BadHistoryOperationUnsupported; per-principal admission (BadTooManyOperations), per-page ceiling, response-byte chunking
with single-use chunk tokens; one session per (principal, credential, HTTP/2 connection) cleared on close; wiring
faults BadInternalError + error log; caller cancel never a backend outcome. DataOperationPolicy maps HistoryRead.
2026-11-23 20:42:51 -05:00
Joseph Doherty 0c86edc194 Merge #918: real-origin variant of the recorded-v1-client compatibility gate
v2-ci / unit-tests (push) Waiting to run
Goldens captured on pre-H2 master 1086593a over the real LocalDataServices,
LocalExportCatalog, DataCapabilitiesProvider, sample hub, write executor and
subscription service; only the physical driver write/acquisition, transport and
clock are faked. Closes #918.
2026-11-23 20:39:55 -05:00
Joseph Doherty 880cd89fe9 test(grpc-data): real-origin variant of the recorded-v1-client gate (#918)
Replays recorded v1 requests against the real DataConnectionGrpcService over the
real origin stack (LocalExportCatalog.Compile from a DraftSnapshot with Raw + UNS
exports, DataCapabilitiesProvider, PartitionedSampleHub, LocalDataServices,
DataWriteExecutor, LocalSubscriptionService/DataSubscriptionSession). Only the
physical driver write dispatch, upstream acquisition, transport and clock are
faked. Goldens captured on pre-H2 master 1086593a; nothing normalised.

Runtime gains InternalsVisibleTo Host.Tests for the Subscribe/Write seams.
Class added to the X0 manifest; X0.md section 2 records real vs faked,
determinism, the perturbation proof and the rule for H2/A2/A3.
2026-11-23 20:39:24 -05:00
Joseph Doherty b6895c19d4 feat(grpc-data): H2 AddDataConnectionHistory schema; authoring accepts HistoryRead
Migration per plan 6 (HistoryTimeoutMilliseconds 30000; MaxConcurrentHistoryReads 4, MaxHistoryValuesPerPage
10000, MaxHistoryResponseBytes 4 MiB; MaxHistoryAssemblyBytesPerRequest 16 MiB) with non-null defaults and widened
check constraints. Validator known set grows by HistoryRead (mapping bits still subset of connection bits; history
limits positive); scope revision includes the history timeout.
2026-11-23 20:38:31 -05:00
Joseph Doherty 9d194a7e97 feat(grpc-data): H2 SDK-free origin history facade over the H1 port
OriginHistoryPort (public, implements IOriginHistoryPort) keeps SDK types inside OpcUaServer instead of an
InternalsVisibleTo: runs the synchronous ReadHistory off the caller's thread, one PeerHistoryContinuationScope per
request, absent bounds -> port MinValue, miswired scope surfaced as WiringFault. Exposed through the SDK sink so
DeferredOriginHistoryPort resolves it after server start; aggregate wire table pinned to AggregateFunctionMap.
2026-11-23 20:36:02 -05:00
Joseph Doherty 619b0c378d feat(grpc-data): H2 history wire contract and codecs; HistoryRead understood
HistoryRead rpc + HistoryCapabilities (16) / HistoryInfo (14) per plan 4.2; DataHistoryProtoMapper keeps the full
uint32 status, ns Timestamps, absent start/end/sample timestamps, verbatim aggregate configuration, and BadTypeMismatch
for a value kind disagreeing with the catalog. DataOperationSets.Understood gains HistoryRead; X0 tripwire replaced.
2026-11-23 20:33:26 -05:00
Joseph Doherty 1086593ab6 Merge H1: origin history port at override level
v2-ci / unit-tests (push) Has been cancelled
Phase H1 of docs/plans/2026-11-23-grpc-data-connections-history-alarms-plan.md.
HistoryRead (Raw/Processed/AtTime) logic extracted from the SDK overrides into
HistoryReadPort; overrides become adapters; continuation binding re-keyed to
(realm, identifier, namespace tag); unwired PeerHistoryContinuationStore; SDK-free
IDataHistoryService contract. Zero local behaviour change (legacy history suites
unchanged), 10k-seed paging fuzz clean. Three Fable passes.
2026-11-23 20:20:46 -05:00
Joseph Doherty 4c29eaf266 docs(grpc-data): H1 evidence 2026-11-23 20:20:38 -05:00
Joseph Doherty efea401915 test(grpc-data): H1 override paging over a real Session, override-path cross-kind refusal, deterministic limiter holder (verification 4-6, 7a) 2026-11-23 20:10:18 -05:00
Joseph Doherty 100dd5ca44 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.
2026-11-23 20:09:01 -05:00
Joseph Doherty 6c70c93c62 docs(grpc-data): H1 review notes for H2/H3 (details resend, store lifecycle, off-thread port, IVT/facade, transport chunking) 2026-11-23 19:54:08 -05:00
Joseph Doherty cfc051de21 test(grpc-data): H1 port coverage for index mapping, modified paging, limiter, deadline/cancel and the real session store (review 7) 2026-11-23 19:53:41 -05:00
Joseph Doherty 111c9c3566 fix(grpc-data): H1 history logs keep {NodeId} a NodeId on the local path (review 5) 2026-11-23 19:51:06 -05:00
Joseph Doherty 19a7c7af01 fix(grpc-data): H1 cursors bind an opaque namespace/view tag besides (realm, identifier) (review 2)
The realm folds mapped/raw into Raw (and every other index into Uns), so
(realm, identifier) alone could resume a raw node's cursor on the same
identifier in a mapped namespace. Items and cursor state now carry a
binding tag: the SDK adapter (and the events path) passes the node's
namespace URI, restoring the pre-port namespace-qualified binding; a peer
passes its view tag. The peer key binds it too.
2026-11-23 19:49:59 -05:00
Joseph Doherty 1bacabb24f fix(grpc-data): H1 peer cursors bind the caller's principal and the live serving incarnation (review 3)
The store used to build the expected key from its own fields, so the
principal/incarnation check could never fail. The scope now supplies the
caller's principal and reads the serving incarnation at save and at take, so
an in-process failover on a still-open connection invalidates its tokens; a
save for a non-owner principal is refused.
2026-11-23 19:47:17 -05:00
Joseph Doherty e04a8b419e fix(grpc-data): H1 details hash formats every field invariant-culture (review 4) 2026-11-23 19:45:55 -05:00
Joseph Doherty 561e6de52b test(grpc-data): H1 port fuzz holds every page to NumValuesPerNode, bounds included (review 6) 2026-11-23 19:45:14 -05:00
Joseph Doherty 7f32edf036 fix(grpc-data): H1 port outcome Status passes GoodNoData through (review 1) 2026-11-23 19:44:52 -05:00
Joseph Doherty b68c0a9af1 test(grpc-data): H1 unit-phase manifest key (new classes + existing history classes) 2026-11-23 19:36:21 -05:00
Joseph Doherty 4ac019754f feat(grpc-data): H1 SDK-free IDataHistoryService contract in Core.Abstractions 2026-11-23 19:36:21 -05:00
Joseph Doherty b530692abb test(grpc-data): H1 port-vs-override parity cases and 10k-seed paged-vs-unpaged port fuzz 2026-11-23 19:36:21 -05:00
Joseph Doherty 8f59c0c6bc test(grpc-data): H1 PeerHistoryContinuationStore binding, expiry, eviction and token tests 2026-11-23 19:36:21 -05:00
Joseph Doherty 4e6b1eb127 feat(grpc-data): H1 override-level history port; SDK HistoryRead overrides become adapters
Raw/modified, Processed and AtTime serving (aggregate refusals incl. #897 and
SupportsAggregateFor, non-default AggregateConfiguration, modified+bounds
BadInvalidArgument, batch limiter, deadline, continuation binding, value
normalisation) now runs through OtOpcUaNodeManager.ReadHistory, addressed by
(realm, identifier) instead of SDK node handles. Continuation cursors are
re-keyed from the NodeId string to (realm, identifier). Adds the production
PeerHistoryContinuationStore (per principal + incarnation, random 16-byte
single-use tokens, 60 s idle expiry, oldest-idle eviction) for H2.
2026-11-23 19:36:21 -05:00
Joseph Doherty a15912539f Merge X0: gRPC data tolerant readers, contract reservation, per-RPC feature header
v2-ci / unit-tests (push) Has been cancelled
Phase X0 of docs/plans/2026-11-23-grpc-data-connections-history-alarms-plan.md.
Unknown DataOperations bits are dropped fail-closed (and counted) at the runtime,
decoders, artifact parse and catalog compile; bits 32-512 reserved; proto fields
reserved with descriptor golden tests; x-otopcua-data-features parsed on every RPC
(effective set empty); recorded-v1-client gate byte-identical. Two Fable passes,
approve. Follow-ups #918, #919.
2026-11-23 19:12:04 -05:00
Joseph Doherty 4ded3b004b docs(grpc-data): X0 evidence — final review round results, follow-ups #918 #919 2026-11-23 19:11:59 -05:00
Joseph Doherty 87c9f9c0b4 fix(grpc-data): X0 inert all-unknown export rule no longer lowers the principal's limits; ValidateDeployed doc 2026-11-23 19:01:53 -05:00
Joseph Doherty 5453c20d94 fix(grpc-data): X0 report dropped mapping bits only for enabled mappings (every mapping is still masked) 2026-11-23 19:01:53 -05:00
Joseph Doherty 9b29a5f652 test(grpc-data): X0 v1 gate pins Write without a write grant (per-item RejectedBeforeDispatch bytes, recorded on the pre-X0 service) 2026-11-23 19:00:41 -05:00
Joseph Doherty ffa70287ac docs(grpc-data): X0 gate results on 981c60784 after review fixes 2026-11-23 18:55:55 -05:00
Joseph Doherty 981c60784c docs(grpc-data): X0 review - real vs faked layers of the v1 gate, extension rule, extra tolerance sites, drop counter semantics 2026-11-23 18:28:53 -05:00
Joseph Doherty 4c03d9025d test(grpc-data): X0 review - reservations pin message type, cardinality and oneof 2026-11-23 18:28:48 -05:00
Joseph Doherty dac185a963 test(grpc-data): X0 review - v1 gate drives the service from golden request hex and pins rejection statuses 2026-11-23 18:28:48 -05:00
Joseph Doherty 4d29d539d8 feat(grpc-data): X0 review - tolerate any unknown bit at the artifact/catalog seam; drop diagnostics for exports and mappings
- ValidateDeployed ignores every bit outside Understood (understood subset still validated); P02's two
  1<<30 rows become 'tolerated, grants nothing'.
- UnknownOperationDrops: Warning + counter tagged kind=connection|export|mapping, counted once per row per
  accepted artifact change; collected under each lock, logged after release. Mappings masked at Stage.
- Surfaced via DataConnectionDiagnosticsSnapshot (DroppedUnknownOperations, MappingsWithDroppedOperations)
  and NodeDiagnosticsSnapshot.DroppedExportOperations.
- End-to-end test: 1<<30 through parse -> catalog compile -> mapping stage -> runtime apply.
- DataConnectionProtoContract.Validate() now runs at AddOtOpcUaDataConnections.
2026-11-23 18:28:48 -05:00
Joseph Doherty 59a1654dfe docs(grpc-data): X0 gate results 2026-11-23 18:14:06 -05:00