Commit Graph

1672 Commits

Author SHA1 Message Date
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 099238894c fix(grpc-data): #926 review r2 - deferred alarms and marks replay in arrival order; stale-record guard; F5 count on withdraw
- OpcUaPublishActor: deferred alarm states, qualities and condition marks replay as one
  arrival-ordered list (a withdrawal followed by a re-establishing transition ended
  unknown); marks held per (realm, condition) so withdrawals are bounded by the condition set
- OpcUaClientDriver: signal/withdraw re-check the registration under _alarmStateLock;
  removals take the lock
- DriverHostActor: a withdrawal under a raised F5 diagnostic updates its count
- docs: Unsignalable/backstop residual; AlarmInitialStatePublished must stay in-process
- tests: arrival-order replay (+ mirror), backstop positive control, F5 count
2026-11-28 10:26:39 -05:00
Joseph Doherty cda8221568 Merge #921/#927: live gates — H05 against a pinned pre-H2 origin (wire tap proves no new-shape frame) and A09 native-ack driver-failure revert under the service principal; CLI read --attribute 2026-11-28 10:26:05 -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 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 14ca1b7168 fix(galaxy): an ack does not supersede a re-read entry; a stream reopen discards the re-read (#925 review r1)
- Only full-state live messages (snapshot entry, Raise, Retrigger, Clear) supersede a
  QueryActiveAlarms entry; an Acknowledge merges (Active => ActiveAcked) instead of
  skipping it and then signalling a cold condition known.
- Stream epoch bumped before StreamOpened; a changed epoch at replay drops the replay
  and the signal (an alarm cleared in the gap is absent, never touched); no re-read
  before the current stream's sentinel.
- Lows: dispose race returns false; teardown token on the RPC and the retry wait;
  an unexpected failure keeps a queued follow-up.
2026-11-28 09:34:24 -05:00
Joseph Doherty cdbbe22a9d docs(grpc-data): rig README for the pinned SOURCE / H05V1 gate and A09; CLI read --attribute (#921, #927) 2026-11-28 09:34:15 -05:00
Joseph Doherty b4c27bd5b8 fix(galaxy): establish a changed alarm subscription by a QueryActiveAlarms re-read instead of waiting for a stream reopen (#925)
A sentinel comes only when StreamAlarms opens, so a subscription that became live
after the current stream's sentinel (or changed during its snapshot phase, F4)
stayed unknown until a reopen. The feed now re-reads the active set via the
gateway's existing QueryActiveAlarms (same monitor cache), replays entries as
restatements except where the live stream already delivered a newer message for
that alarm, and the driver then signals the still-live subscription. Coalesced
(one in flight + one follow-up), 3 bounded retries, Unimplemented not retried,
a failed re-read never signals.
2026-11-28 09:24:26 -05:00
Joseph Doherty 05f431f5d8 Merge #933/#934/#936: bounded hold for keys held by a definitively refused mapping, off-loop root re-resolve, removal RefreshRequired reaches admitted holders
v2-ci / unit-tests (push) Failing after 2h34m59s
2026-11-25 12:36:56 -05:00
Joseph Doherty 9929ded66c docs(grpc-data): A4 evidence — follow-ups review round 1 (#933/#934/#936): outcomes, red/green, S3 SDK evidence, gates, live fu933-2 8/8 2026-11-25 12:36:33 -05:00
Joseph Doherty 024b074fe1 docs(evidence): #935 review round 1 — finding outcomes, S1/S3 decisions, red/green, gates, live fu935-2 F935 + A01–A08 8/8 2026-11-25 12:16:56 -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 939ad2337d docs(grpc-data): A4 evidence — follow-ups #933/#934/#936 decisions, red/green, gates, live fu933-1 8/8 2026-11-25 11:51:03 -05:00
Joseph Doherty 4df38b8642 docs(scripted-alarms): #935 review round 1 — engine incarnation, failed load ends the generation, commands under the gate, no write-back of a restatement, production store is LocalDb 2026-11-25 11:45:00 -05:00
Joseph Doherty 18154eeff4 fix(grpc-data): removal RefreshRequired reaches the holders after their mapping left the deployed set (#936)
QueueRefreshRequired decided per item with the CURRENT gate (CanSee over the
current mapping set), so when a deploy removed the mapping or its connection
nobody passed and the §5.2 removal + RefreshRequired was never delivered.
Each imported condition instance now records (weakly, per identity) every
identity the §5.4 gate admitted to it — the verdict cache's compute is the
only place a positive verdict is made, and every delivery, refresh replay and
Read/Browse goes through it. A removal's RefreshRequired goes to the collected
targets whose identity was admitted to the removed instance. The event carries
no condition data (SourceNode=Server); a never-admitted session still gets
nothing. OI test pins both: holders told after the gate admits nobody, the
ungranted session not (with a must-arrive RefreshEnd control).
2026-11-25 11:01:01 -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 f0526753ac docs(scripted-alarms): a redeploy is a restatement; restart behaviour stated accurately (#935) 2026-11-25 10:58:01 -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 e68e4cc8bf docs(grpc-data): A4 review round 2 — S1–S4 + NIT outcomes with red/green, degraded-apply decision, gates, live a4s-7 8/8 PASS
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-25 04:44:07 -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 5752243724 docs(grpc-data): A4 gates after F1–F4 fixes + full A01–A08 run (2) a4s-6 — 8/8 PASS 2026-11-25 03:45:02 -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 688cff5812 docs(grpc-data): A4 live scenarios part 2 + full A01–A08 run (a4s-5) — A06/A07 PASS, A03 plan path PASS with findings F1–F3 (deploy-driven EventId invalidation, phantom re-assert event, duplicate transition across stream reset), F4 folder-first refusal; D6/D7 verdicts; CLI EventType line 2026-11-25 02:46:06 -05:00
Joseph Doherty 42e3800f2c test(grpc-data): A4 part 2 — A03 gap via pause+stop, origin watcher + re-assert mirror check, latest-EventId positive control; duplicate-transition checks (A03/A06/A07); docs: folder-first event item still refused BadNotSupported (workaround: i=2253 first) 2026-11-25 02:04:30 -05:00
Joseph Doherty c82b8683b0 docs(grpc-data): A4 live scenarios part 1 — A01/A02/A04/A05/A08 PASS on a4s-2, observations, part-2 harness notes 2026-11-25 01:37:21 -05:00
Joseph Doherty 283790a646 docs(grpc-data): A4 review round 1 — findings table, red/green, S4 decision, gates, live a4r1-cond-1 PASS 2026-11-25 00:51:13 -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 3be51e3b13 Merge a4-docs into a4-code 2026-11-24 23:47:13 -05:00
Joseph Doherty 4d11787745 docs(grpc-data): A4 code evidence — #930/#931 red/green, diagnostics, live a4c-cond-1 PASS, L1 PASS, L5 docker-dev PASS (production blocked), gates
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-24 23:46:37 -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 81ac1d5263 docs(grpc-data): A3 verification review round 2 — N1 fix + red/green, clone pin, gates, live a3v2-cond-1 PASS 2026-11-24 22:46:42 -05:00
Joseph Doherty 5bece2a5a5 docs(grpc-data): A3 round 2 — pooled EventFieldList root cause, L2 re-measured (PASS), gates, live a3r2-cond-1 PASS 2026-11-24 22:11:28 -05:00
Joseph Doherty 159ce9d13d docs(grpc-data): A3b review r1 — live a3br1-cond-1 PASS 2026-11-24 20:45:32 -05:00
Joseph Doherty c82ea04e4d docs(grpc-data): A3b review round 1 — finding → resolution → test → red-on-revert, real-path L3, worst-case L2 (fails 200 MiB), OI refresh-failure investigation, gates 2026-11-24 20:38:24 -05:00
Joseph Doherty 01a4e8db9d docs(grpc-data): A3a review round 1 — finding → resolution → test → red-on-revert table, gates, live a3r1-cond-1 PASS 2026-11-24 19:24:54 -05:00
Joseph Doherty 3c941458f5 docs(grpc-data): A3b evidence — implementation, A3a live defects, tests + red-on-revert, L2/L3 numbers, live a3b-cond-3 PASS, deviations, gates 2026-11-24 18:14:57 -05:00
Joseph Doherty b5ab6e7cde docs(grpc-data): A3a evidence — progress, implementation, tests, mutation record, deviations, gates 2026-11-24 17:00:02 -05:00
Joseph Doherty 83e607d437 docs(grpc-data): A2b security review fixes — findings, resolutions, red/green, gates, live conditions_smoke a2s1-cond-1 PASS 2026-11-24 16:08:07 -05:00
Joseph Doherty 16ae92258f docs(grpc-data): A2 review round 1 — live conditions_smoke a2r1-cond-1 PASS 2026-11-24 15:29:49 -05:00
Joseph Doherty 5d91d886df docs(grpc-data): A2 review round 1 evidence — findings, resolutions, red/green, A1 root cause, gates 2026-11-24 15:21:57 -05:00
Joseph Doherty 0b827a3f81 docs(grpc-data): plan §5.1/§5.5 — readiness is withheld snapshot_complete; a deploy ends the condition stream; removal/begin bypass the version gate; A3 removes an over-total item 2026-11-24 14:59:39 -05:00
Joseph Doherty 95d90c1933 docs(grpc-data): A2b live smoke a2b-cond-2 PASS (remote ack: one origin event, acked delta, audit), AdminUI editor driven live 2026-11-24 14:35:06 -05:00
Joseph Doherty 3a2c426beb docs(grpc-data): A2b evidence — tests, mutation checks, gates 2026-11-24 14:18:21 -05:00
Joseph Doherty e29d9559ad docs(grpc-data): A2b evidence — what changed, decisions, deviations 2026-11-24 13:53:49 -05:00
Joseph Doherty d6f189ec6d docs(grpc-data): A2b progress log 2026-11-24 13:33:41 -05:00
Joseph Doherty 81cee9b5e8 docs(grpc-data): A2a evidence — tests, mutation checks, gates, live smoke a2a-cond-2 PASS 2026-11-24 13:20:24 -05:00
Joseph Doherty ba0555d4a5 docs(grpc-data): A2a evidence — decisions, deviations, seams for A2b 2026-11-24 12:31:09 -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