Commit Graph

37 Commits

Author SHA1 Message Date
Joseph Doherty 6a9c787307 Merge #923: gRPC data H4 Gateway-backend remote history live leg vs the real AVEVA Historian (read-only gateway), H01–H08 pass; rig --history-backend gateway; drop the #922 H01 re-browse workaround now that #922 is fixed
v2-ci / unit-tests (push) Has been cancelled
2026-11-28 11:48:10 -05:00
Joseph Doherty ac96d1f3d3 docs(grpc-data): Gateway origin remote history verified live (H01–H08 vs real AVEVA, read-only) — drop the unverified wording (#923) 2026-11-28 11:47:21 -05:00
Joseph Doherty e076ceae64 test(grpc-data): #922 review r1 — batch, crowd-out, slow-origin, revoked/removed/invalidated; docs + evidence 2026-11-28 10:58:12 -05:00
Joseph Doherty b569d5c5dd Merge branch 'master' into worktree-agent-aad6291e992ef79ba 2026-11-28 10:48:21 -05:00
Joseph Doherty 1a4f16de5b Merge #916/#917: stop sending stable_source_id (field 10 deprecated, never encoded/decoded); alarm-bearing raw tags are unsupported value nodes hidden from browse; review fixes 2026-11-28 10:43:51 -05:00
Joseph Doherty 053c69f1c8 fix(grpc-data): #916/#917 review r1 — mapper never encodes/decodes stable_source_id (proto field deprecated); browse skip does not consume the scan bound (no empty incomplete pages); unsupported nodes never writable; comment fixes 2026-11-28 10:43:32 -05:00
Joseph Doherty c8b68940a8 Merge #926: OpcUaClient RefreshEnd signals initial alarm state only for a lossless bracket; post-signal loss withdraws known; deferred alarm/mark replay in arrival order; 2 review rounds 2026-11-28 10:26:58 -05:00
Joseph Doherty efb3a39229 test(grpc-data): live H05 vs pinned 0c86edc1 origin PASS 25/25 (#921) and A09 driver-failure ack revert PASS 12/12 (#927); v1 listener refuses HistoryRead PERMISSION_DENIED; evidence 2026-11-28 10:25:31 -05:00
Joseph Doherty 06da40a909 fix(opcuaclient): #926 review r1 - loss after the signal withdraws known; gaps outside a bracket, overlapping starts, failed refreshes
- a sequence gap outside a bracket is a loss (re-refresh, same budget); older/repeated
  sequence numbers are ignored and not recorded
- AlarmInitialStateEventArgs.Withdrawn (additive): the driver withdraws 'known' once per
  signalled episode on its first loss; DriverHostActor sends MarkConditionsKnown(Known:false)
  for those conditions, drops them from the backstop and re-arms F5
- a RefreshStart while a bracket is open is a loss (never erases the open bracket's)
- a failed ConditionRefresh call is retried through the same bounded retry
- retry generation token (a finished retry never clears a newer retry's pending flag)
- spent budget renews after a 5-min cool-down; RefreshRequired sweeps coalesced
Red/green per fix (7 mutations) + live opc-plc gate re-run.
2026-11-28 10:07:08 -05:00
Joseph Doherty 70539999f9 fix(grpc-data): Browse does not list unsupported value nodes (#917)
Live gate fu916-1 found that listing an alarm-bearing tag as
UnsupportedVariable made the consumer's whole remote-opc folder unbrowsable
(BadNoCommunication): ProjectedNamespaceApplier applies a page all-or-nothing
and TryEnsureProjectedVariable rejects any kind but Folder/Variable/Tag, on
every consumer build. The origin now skips unsupported value nodes in Browse;
they stay addressable (Unsupported) and exportable.
2026-11-28 09:49:12 -05:00
Joseph Doherty 7f071955ba docs(grpc-data): lapsed-lease behaviour; H3 gate drops the re-browse workaround and idles past the lease (#922) 2026-11-28 09:45:04 -05:00
Joseph Doherty 99f2b9d8b7 fix(opcuaclient): RefreshEnd signals initial alarm state only for a lossless refresh bracket (#926)
Track RefreshStart..RefreshEnd per alarm subscription. EventQueueOverflow (matched by
EventType before the source filter - it comes from the Server object), RefreshRequired,
a publish-sequence gap the SDK skipped (EventFieldList.Message.SequenceNumber; SDK 2.0.1's
Republish publish-state never fires for a gap that blocks delivery) or a missing
RefreshStart suppress the A1 signal and re-run ConditionRefresh, bounded (3, 2/4/8 s);
exhausted = conditions stay unknown (Uncertain), never Unsignalable. Alarm event queue
1000 -> 10000; new counters alarm_event_queue_overflow / alarm_refresh_lossy.
Unit + real-SDK gap tests, live overflow gate on opc-plc --alm; plan G2 text corrected.
2026-11-28 09:42:06 -05:00
Joseph Doherty b7ca71f188 fix(grpc-data): stop sending stable_source_id (#916); export alarm-bearing raw tags as UnsupportedVariable (#917)
#916: Metadata.stable_source_id carried the internal acquisition key
(<len>:<driverInstanceId><RawPath>) on every export, so a UNS-only peer learned
driver ids and RawPaths. No consumer uses the field beyond byte accounting; it is
optional on the wire and absent decodes as null. It is now never sent; the
internal BackingSourceKey is unchanged.

#917: alarm-bearing raw tags never get a value but were exported as Variables.
They are now the existing explicit UnsupportedVariable kind (browsable,
Unsupported on every value op). The node is kept so exports rooted at it still
compile and A1 condition placements are unaffected.

The real-origin v1 goldens are not re-recorded: GrpcDataV1RealOriginCorrections
applies exactly these two edits to the parsed goldens, pinned by a test.
Evidence: docs/plans/evidence/grpc-data-ext/V1-916-917.md
2026-11-28 09:23:34 -05:00
Joseph Doherty e61db01686 fix(grpc-data): removal admission keyed on the credential, lazy + bounded, no stale verdict write-back (#936 review r1)
S3: the SDK installs a new identity object on every ActivateSession (decompiled
Opc.Ua.Server 2.0.1: Session.UpdateUserIdentity assigns EffectiveIdentity;
MonitoredItem/Subscription.EffectiveIdentity read the current session's), so an
object-keyed admission forgot a re-activated or transferred session. Admission
is now keyed on RoleCarryingUserIdentity.AdmissionKey (principal + api key id),
and a removal also tells an item that passes the current gate (uncached).
S4: the per-condition record is a lazily allocated locked HashSet<string> (no
ConditionalWeakTable per condition), one entry per credential, capped at 1024,
dropped after the removal's RefreshRequired is decided.
N4: Verdict writes back only while that instance is still live.
Tests: OI re-activation (red on revert), unit S3/S4 + N4 (red on revert); docs.
Also DataConnections.md for #933 r1 S1/S2.
2026-11-25 12:06:02 -05:00
Joseph Doherty 5d946fde55 fix(grpc-data): move the in-stream root re-resolve off the condition frame loop (#934)
RetryDueAsync awaited the root metadata request (10 s budget) inside the
frame loop, stalling every mapping's frames on that connection while the
origin's metadata was slow. The request now runs as a task (FetchRootsAsync
reads only the immutable root views); the task joins the loop's wake set
beside the retry timer, and its answer is applied on the loop
(ApplyResolvedAsync: RootView or MarkRefused, then the re-add). All runner
state stays loop-owned. While resolving the mapping is Unavailable (unknown,
T2) and is not re-scheduled. Test: a hung second metadata call no longer
blocks another mapping's delta; releasing it re-adds the item exactly once.
2026-11-25 10:58:28 -05:00
Joseph Doherty 2eb31f62d2 fix(grpc-data): bound the unknown-mapping hold of imported conditions (#933)
A key no known mapping lists was kept stale for as long as ANY mapping of the
connection was unknown; a durably Denied/Unavailable mapping therefore kept
retired conditions forever. Scoping the hold to mappings that could list the
key is not provable on the consumer (placements are origin deploy-time config;
a dropped key may have moved into the unknown mapping's root), so the hold is
time-boxed per key: ProjectedConditionOptions.MaxUnknownHold (20 min) — past it
the key is removed (+ RefreshRequired at the sink), never known-inactive. The
since-time survives stream ends and hand-overs; the earliest expiry shares the
loop's retry timer. DataConnections.md: lifetime rule + troubleshooting row.
2026-11-25 10:56:23 -05:00
Joseph Doherty dc5ed011ce test(grpc-data): A03 phase 1 permits exactly one RefreshRequired after the held-set takeover (still forbids extra condition events); docs: the deploy hold settles on any completion, is bounded, reports held, and resyncs once
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-25 04:07:58 -05:00
Joseph Doherty 0c253b66df docs(grpc-data): A4 F1–F4 root causes, design decision (consumer holds imported conditions across its own deploy; promote-on-admission), native ack freeze = opc-plc behaviour; #935 #936 filed 2026-11-25 03:10:38 -05:00
Joseph Doherty 0cac09cee3 fix(grpc-data): A4 review r1 — AdminUI helpers null-safe + doc comments restored; metric descriptions name both sides; docs: S1/S2/S3 behaviour, RefreshRequired only on a changed incomplete set, SourceName vs runtime status (S4), scripted Good = applied, A4-docs citations 2026-11-25 00:22:54 -05:00
Joseph Doherty b2fab8b075 test(grpc-data): #928 — overflow test asserted one of two legal outcomes; deterministic Reset test + either-outcome contract test; DataConnections.md A4 reconcile (#930 retries, condition metrics, AdminUI fields)
The origin item sees a hub eviction only at its next hub read: Reset if the last snapshot chunk is
still undelivered, otherwise a silent fresh snapshot on the same stream (both per A2, both loss-free
since the A3 consumer swaps a buffered re-snapshot in as a full replacement). Since A2 review S5 the
3,000-record snapshot is 59 chunks and the silent path wins when run alone (fails 3/3 alone at the A2
merge too; passes in its class). No product change. Also fixes the stale ack/confirm/shelve comment on
ConditionMethodTimeoutMilliseconds.
2026-11-25 00:08:06 -05:00
Joseph Doherty 916c14eca1 docs(grpc-data): A4 docs — feature negotiation, imported conditions end to end, method status table, limits, security, ScadaBridge impact
DataConnections.md: x-otopcua-data-features negotiation; condition forwarding (key secret, bits 64/128/256, AllowGalaxyServiceAck,
methods + status codes, limits/defaults, troubleshooting); corrects the A2a 'deploy adds/removes arrive as deltas' claim (a deploy
ends the stream). AlarmTracking.md: Imported conditions. ScriptedAlarms.md: known after the first completed evaluation; what
forwards. security.md: imported-condition gate, per-caller method re-check, service principal, on_behalf_of, audit category.
Evidence A4-docs.md: plan-vs-code disagreements, TODO markers for the A4 code merge, ScadaBridge consumer impact.
2026-11-24 22:58:23 -05:00
Joseph Doherty 1977d8ce84 feat(grpc-data): A2a — byte-bounded condition chunks (256 KiB estimate); DataConnections.md condition streams 2026-11-24 12:30:28 -05:00
Joseph Doherty b5509dfc48 docs(grpc-data): H4 review 3 — origin history reads are counted per item per wire call 2026-11-24 08:37:58 -05:00
Joseph Doherty 005720bd02 fix(grpc-data): H4 review 2 — a fresh origin reports 'no peer traffic yet', not 'unavailable'
The origin services are composed on the first peer call (they need the driver host actor), so
CaptureOrigin returned null until then and a fresh H4 origin read like a pre-H4 build. The DI
singleton now probes the same deferred history port for backend availability and reports zeros
with PeerServicesStarted=false; the page says 'no peer has called since start'.
2026-11-24 08:37:38 -05:00
Joseph Doherty 1efe084833 docs(grpc-data): H4 remote history supported (SqlServer/QuestDB verified, Gateway pending #923), diagnostics and metrics, CLI projected-history note 2026-11-24 08:02:41 -05:00
Joseph Doherty 7aaa98751a fix(grpc-data): H3 review round 2 — no batch probe; budget stop; orphan tokens; lease-retired status
1: the separate capability probe is gone (through the unary path a cancelled
probe recorded an endpoint failure and put the connection into discovery
backoff). Projected calls split at the deployed connection's batch size;
GrpcDataConnection splits again at the origin's advertised MaxBatchItems from
the capabilities the history call already negotiated, sharing the assembly
budget across sub-batches. 3: once the connection reports the assembly budget
spent, no further origin call is made. 4: an answer that never became an
outcome (mismatch, exception mid-answer) releases its new origin token. 5: a
cancel that is neither the caller's nor the deadline (a lease retired by a
redeploy) is BadNoCommunication / BadContinuationPointInvalid, not BadTimeout.
Flush delay on the access's clock. Docs: the request deadline covers the local
half too; shared non-local slots; split. Red/green for each by mutation.
2026-11-24 06:25:19 -05:00
Joseph Doherty 86c0934ad6 refactor(client): HistoryReadPageAsync is abstract; docs for the H3 review fixes
The page API is a required member of IOpcUaClientService / ISessionAdapter (the
fakes implement it). DataConnections.md: projected slot sub-limit, per-node
fault handling, request-order runs and sub-batches. Client.CLI.md: --aggregate
now asks for the server's default aggregate configuration.
2026-11-24 01:49:46 -05:00
Joseph Doherty 763669562e docs(grpc-data): H3 OPC UA HistoryRead on projected nodes; rig H3 gate recipe 2026-11-24 00:44:04 -05:00
Joseph Doherty f3f0af87a2 docs(grpc-data): missing export grant is PERMISSION_DENIED for the call; ACL-denied/unhistorized/unknown nodes are 0x80720000 2026-11-23 23:32:26 -05:00
Joseph Doherty 1d824da124 docs(grpc-data): precise wording for history limit changes 2026-11-23 23:21:11 -05:00
Joseph Doherty 3c89a49fa1 docs(grpc-data): H2 review2-7b/f - limiter share at N=1, limit changes clear live history sessions 2026-11-23 23:21:01 -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 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 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 d89bc86194 docs(grpc-data): X0 evidence (rev-4 investigations + scratch harness) and mixed-version rollout note 2026-11-23 17:52:54 -05:00
Joseph Doherty 29fec57fac test: validate grpc data connections with local docker and opcua cli 2026-11-23 09:55:04 -05:00
Joseph Doherty 1df29a3124 feat: author and inspect grpc data connections 2026-11-23 09:55:04 -05:00