Commit Graph

1688 Commits

Author SHA1 Message Date
Joseph Doherty 66b75aed0f Merge master into #937 (scenarios: keep A09 + F937) 2026-11-28 11:32:41 -05:00
Joseph Doherty 4ac8308510 Merge #920/#929: a demand disposed mid-publish no longer republishes a fresh baseline (retained proof-candidate leak); SDK async delivery race in test; memory figures re-measured with GC memory info (~79 KB/condition node tree)
v2-ci / unit-tests (push) Waiting to run
2026-11-28 11:28:20 -05:00
Joseph Doherty a105363832 docs(grpc-data): #920 evidence — root causes, red/green, 30/30 class runs 2026-11-28 11:27:54 -05:00
Joseph Doherty 4a5d5930a4 docs(evidence): #937 live leg fu937-1/fu937-2 (F937 + A01/A02/A04/A05/A08 6/6), gates
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-28 11:25:43 -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 1b1cf7b45b docs(evidence): #922 red/green, gates, live f922a-sqlserver H01-H06 + lapsed value-read probe 2026-11-28 10:42:06 -05:00
Joseph Doherty 4d41e61858 docs(#937): CallAsync remarks + evidence skeleton
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-28 10:41:39 -05:00
Joseph Doherty 4a481cca1c docs(grpc-data): #916/#917 evidence — live gate fu916-1 (found the browse defect) and fu916-3 (A01–A08 8/8), control run, gate counts, #920 note 2026-11-28 10:28:23 -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 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 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 d6f2a1b5e2 fix(alarms): a scripted condition's Part 9 method returns the engine's verdict (#937)
Before: the alarm-commands topic is fire-and-forget, so an OPC UA method (and a
remote gRPC-data condition method) returned Good even when the engine rejected
the command because its last load failed.

- ScriptedAlarmCommandReadinessView: the host's latest load outcome; the node
  manager's handler refuses BadInvalidState before the SDK applies anything
  while the last load failed (lock-free read).
- Bounded ask: inside CallAsync (off Lock) each local request runs base.Call
  alone; the handler only STARTS AlarmCommandAsker (broadcast for the peer +
  DriverHostActor -> ScriptedAlarmHostActor.ExecuteAlarmCommand on the local
  engine, CommandId-deduplicated) and the Call awaits the verdict: refused =>
  BadInvalidState, no answer => BadTimeout OutcomeUnknown.
- Remote CallConditionMethod: ExecuteConditionMethodAsync => DriverConfirmedFailure
  / OutcomeUnknown on the origin.
- Host ownership uses the latest plan set (stable across a load in flight and a
  failed load's half-built set).
- Docs: ScriptedAlarms.md (verdicts, residual, duplicate-activation trade-off),
  DataConnections.md, rules/alarms.md. Live leg scenario F937 + seeder
  scripted_predicate mutation.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-28 09:40:35 -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 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 cb672ea060 docs(grpc-data): re-measure per-condition memory with GC memory info (#929)
The X0 node-only harness used a GC.GetTotalMemory(true) delta, which on .NET 10
counts committed-but-free GC regions. Switched it to the L2 Measure() method
(full blocking GC, HeapSizeBytes - FragmentedBytes, settled working set):
79,085 B heap / ~90 KB WS per OffNormal condition (GetTotalMemory still reads
158,169 B, reproducing the old 160,997). Plan 5.5, X0/A3/A4-docs evidence and the
BytesPerCondition comment corrected; the default (160,000 B from the L2
in-server worst case) is unchanged.
2026-11-28 09:13:48 -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