- MxAccess.SecuredWrites = Refuse (default, unchanged #991 local BadUserAccessDenied) |
ApiKeyIdentity. Opted in, a SecuredWrite runs as the calling key's own /api-keys Galaxy
identity (ResolveKeyIdentityAsync: no fallback account; anonymous / no identity / broken
identity refused before the wire): own plain-advised handle (apart from the raw path's
supervisory handle) -> AuthenticateUser every write -> WriteSecured(userId, 0), the sequence
mxaccessgw live-captured committing. Auth failure / user id 0 -> BadUserAccessDenied; password
only in the AuthenticateUser command, scrubbed from every log. Identity resolved once per batch.
- VerifiedWrite is refused in every mode: an OPC UA Write carries no verifier (MXAccess refuses
no verifier 1008 / self-verifier 8018), and a stored verifier would defeat the two-person rule.
- Caller plumbing: WriteCaller + optional ICallerAwareWritable (Core.Abstractions); node manager
passes principal + key id -> IOpcUaNodeWriteGateway caller overload (default drops it) ->
RouteNodeWrite.Caller -> WriteAttribute.Caller -> ICallerAwareWritable. The gRPC data-connection
write path carries no caller yet (secured writes refused there).
- AdminUI Galaxy form 'Secured writes' select (owned path); enum serialises as its name; factory
refuses an unknown value. Docs: Galaxy.md design + live-gate checklist. Not live-gated.
- SubscriptionsViewModel collects the subtree's variables first (deduped, already-subscribed
skipped) and creates them in one SubscribeManyAsync; per-node failures are named in
StatusMessage, a whole-batch failure adds nothing. RestoreSubscriptionsAsync batches too.
- CLI: ConnectionLossWatch ends subscribe/alarms when the service lands Disconnected on its
own, or stays out of Connected past --reconnect-timeout (default 300 s, 0 = no limit):
WARNING line, summary (subscribe adds 'Connection: LOST'), exit code 3. A recovery inside
the window re-arms the watch.
A blank password box means 'keep the stored password' (#997 A-4) and is refused first time,
so an account whose password is genuinely empty could not be mapped. The /apikeys editor
now has an 'Empty password' checkbox (disables + clears the box) that calls the new
IApiKeyGalaxyAckIdentityService.SetWithEmptyPasswordAsync: writes an empty password secret
first, then the user, audited like any set. The driver already accepts an empty password.
- KeepAlivePingDelaySeconds / KeepAlivePingTimeoutSeconds get form fields and round-trip
through FromRecord/ToRecord (a 0 = no-pings opt-out used to reset to 15 on any save).
- Save overlays only the form-owned paths onto the stored JSON (DriverConfigJsonOverlay,
as AbCip/AbLegacy do), so a key the form does not model survives.
- Guard test: every leaf the record serialises is an owned path.
AdminSessionRevalidator re-mapped the groups frozen into the cookie at sign-in,
so removing a user from a directory group changed nothing until
MaxSessionMinutes ended the session.
Bump ZB.MOM.WW.Auth.{Abstractions,Ldap,AspNetCore} 0.4.1 -> 0.5.0 (additive
ILdapGroupLookup; 0.4.2-0.4.4 changes only affect BindMode=User / API-key SQL
stores, unused here; solution builds clean). OtOpcUaLdapAuthService now
implements ILdapGroupLookup with the same Enabled / DevStubMode / insecure-
transport rules as sign-in, registered as the same singleton (a stub
ILdapAuthService gets a NotSupported lookup).
At each re-validation interval the revalidator looks the user up: Found ->
fresh groups replace the session's otopcua:group claims and are mapped;
UserNotFound / UserDisabled / AmbiguousUser / Found-with-no-groups -> reject;
DirectoryUnavailable (or a lookup fault) -> fail-soft on the last known groups
(still re-mapped), bounded by MaxSessionMinutes; NotSupported / ProviderDisabled
-> previous behaviour. Never queried under DisableLogin.
Tests (directory rows failed first): group removal / addition picked up after
the window, unchanged membership kept (positive control), four end-the-session
statuses, outage keeps the session until the absolute cap, DisableLogin issues
no lookup (control: one lookup otherwise); wrapper lookup rules + DI
registration. docs/security.md drops the 'no password-less lookup' claim.
Co-Authored-By: Claude <noreply@anthropic.com>
The named-query guard's only statement boundary was ';', but T-SQL runs
';'-less batches: 'SELECT 1 COMMIT KILL 55', '... COMMIT DISABLE TRIGGER ALL ON
DATABASE', '... COMMIT SHUTDOWN WITH NOWAIT' and a TEXTPTR/WRITETEXT write were
all accepted for SqlServer AND Odbc — a COMMIT ending the rolled-back
transaction, then anything not on the keyword list.
For SqlServer, and for Odbc / no provider (backend unknown: strictest reading),
SqlReadOnlyStatement now also parses the statement with
Microsoft.SqlServer.TransactSql.ScriptDom 180.154.0 (central package pin; both
QUOTED_IDENTIFIER settings) and requires exactly one batch holding exactly one
SelectStatement, no INTO, and no OPENQUERY/OPENROWSET/OPENDATASOURCE. Odbc '?'
markers are read as variables for the parse. The lexical guard stays as a
second layer.
Tests: SqlReadOnlyStatementTransactSqlTests (11 batch strings x SqlServer/Odbc/
none, pass-through rowsets — all failed first; CTE/subquery/window/param/UNION/
FOR XML/OPTION and ODBC '?' positive controls). SqlNamedQueryTests' SQLite-backed
Odbc stand-in used the T-SQL reserved word 'top' as an alias (renamed).
Live (SQL Server 10.100.0.35,14330): SqlServerNamedQueryBatchLiveTests proves
'SELECT 1 AS v COMMIT UPDATE ...' commits the old way, the guard refuses it,
and a CTE+window+subquery+@param query reads Good; SqlServerReadTests /
write-mode / trigger suites unchanged (30/30). Class comment and
docs/drivers/Sql.md corrected.
Co-Authored-By: Claude <noreply@anthropic.com>
Sibling hunt for the #779 stack guard: recursion with NO script frame. A BCL or
compiler-synthesized ToString/Equals/GetHashCode/CompareTo/Message recursing
over a structure the script nested a million deep in a loop (or made cyclic)
terminated the host with 'Stack overflow.' — Tuple/ValueTuple/KeyValuePair/
anonymous-type chains, a self-referencing Lazy, StructuralComparisons over a
self-containing array, DictionaryEntry, FormattableString holes, inner-exception
/ AggregateException / ArgumentOutOfRange(actualValue) chains, DataValueSnapshot
built or with-copied around itself. Host code does the same to a returned value:
OwnedDataSample.CopyLegacy and VirtualTagActor.SameValue recurse over nested /
self-containing object[] results.
The analyzer now refuses what builds such a structure: holders with an open
element type (object / ValueType / interface / type parameter; a tuple literal
that is only deconstructed stays legal), arrays whose element can be an array,
Array.CreateInstance, Lazy, the structural comparers, DictionaryEntry,
AggregateException, exception constructors taking an inner exception or an
object, FormattableString outside FormattableString.Invariant/CurrentCulture,
and host-record construction / 'with' when the record has an open member.
System.Comparison is dropped: Array/List Sort and BinarySearch rethrow a
comparer's exception from a BCL catch block, so a comparer recursing through
Sort overflowed while unwinding (use OrderBy/ThenBy).
Regression rows for every vector (all failed first), plus closed-neighbour rows
that must keep compiling. The script-literal differential over src/tests/docs/
scripts (238 accepted before) and the reviewer's 35 legit probes are unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>
- ReadviseSubscriptionAsync: a reconnect completing between two subscriptions of a pass
(dropped-event resync loop had no per-iteration check) sent the next SubscribeBulk to the
NEW gateway session under the OLD session number; TryRebind refused it (SessionChanged)
and the live new-session advises were never bound or released, then duplicated by the
replay. The pass now refuses to dial once its session moved. Releasing afterwards was
rejected: once the session moved, which session issued the reply's handles is ambiguous and
old numbers are reused (#861); not dialling is the unambiguous fix.
- Dropped-event resync passes are at least 5 s apart (DropResyncMinInterval); drops reported
meanwhile coalesce into the next pass, so repeated overflow bursts no longer churn
re-advises into the overflowing channel.
- Test seams: ResyncDroppedHandlesForTestsAsync, NotifyEventsDroppedForTests,
DropResyncMinIntervalForTests; AdvisingSubscriber gained after-subscribe/unsubscribe hooks.
Sibling hunt for the #779 stack guard: a catch or finally runs as a funclet on
top of the frames being unwound, so a handler that throws starts a nested
dispatch deeper still (~6 KB/level). 'catch { throw; }' on every frame killed
the host while unwinding from the guard's own exception, and 300 frames that
each rethrow (or whose finally throws) killed it with no guard involvement.
The stack-guard rewrite now gives every script catch the filter
'when (ScriptStackGuard.CanHandle() && (filter))' and wraps every finally body
in 'if (ScriptStackGuard.CanHandle())'. Once the stack is low, script handlers
are skipped and the in-flight exception reaches the host in one dispatch.
Verified on 1.5 MB / 1 MB / 512 KB / 256 KB threads. Seven new child-process
scenarios in ScriptRecursionContainmentTests (all crashed before), plus
semantics-preservation rows for filters, declaration-less catch, pattern
variables and finally on both paths.
Co-Authored-By: Claude <noreply@anthropic.com>
P-22 moved the probe's own short timeout (default 2 s) onto the probe runtime's cold
InitializeAsync too — on the native transport the TCP connect + RegisterSession + Forward
Open, which the pooled connection bounds with the driver's Timeout. A slow-but-healthy open
longer than the probe timeout never completed: the probe re-created and timed out every
tick and the host stayed Stopped. Initialisation now runs under the loop token only; the
probe timeout bounds the read.
- On libplctag each tag is its own request with its own timeout: one tag's Timeout latched
the whole device for the call, failing (and evicting) every later sibling. The latch now
fires on BadConnection/Abort/socket-IO failures always, and on Timeout only on the native
transport, where a reply timeout faults the device's one shared channel
(AbCipRefusals.LatchesDevice).
- Items latched out were never attempted: their handles are kept (evicting re-created, and
for a sole lease holder re-Forward-Opened, each one next poll). The failed item's handle is
still evicted, and a throttled cold create now latches the device so kept warm handles
fail fast instead of each paying a timeout.
- AbCipDeadDeviceBatchTests recovery leg: the device's kept warm handles answer again.
Three scripts passed the allow-list and the deploy gate and then terminated the
host (exit 134): an async void local function / async lambda (the compiler's
AsyncVoidMethodBuilder rethrows on the thread pool) and an over-sized stackalloc
(overflows in one frame, before the #779 guard). IsForbiddenSyntax now refuses
every async form (await included) and both stackalloc forms.
Siblings: [MethodImpl] may set only the JIT-hint bits (InternalCall passed the
gate then failed to load; Synchronized is a lock; numeric casts are checked by
constant value), and a collection initializer's compiler-called Add is checked
like a named member. Regression rows for each, plus rows pinning the lowered
constructs that stay safe (iterators, goto, checked, filters, collection
expressions, interpolation handlers, params Span, using/deconstruction) and the
declarations the wrapper already refuses (records, local types, finalizers,
static ctors, unsafe/fixed, SkipLocalsInit, ThreadStatic).
Co-Authored-By: Claude <noreply@anthropic.com>
#976 made StatusCode.Unknown (the gateway's handler threw) and non-RPC non-transport exceptions
RetryPlease. On the SendEvents path a RetryPlease marked the whole chunk and every later chunk
RetryPlease; with no Ack the sink treats the drain as an outage and counts nothing, so ONE such
event at the queue head stalled all Gateway alarm history until the 1,000,000-row capacity evicted
it silently. The SQL writers already isolate unrecognised failures (AlarmBatchWrite); the Gateway
writer had no equivalent.
Gateway: a RetryPlease failure that is not a known outage (IsSystemicFailure: Unavailable,
DeadlineExceeded, Cancelled, ResourceExhausted, Aborted, auth codes, typed Unavailable/auth client
exceptions, or a socket/IO/HTTP/disposed/timeout/cancellation cause) re-sends the chunk singly at
once: siblings Ack, the culprit keeps RetryPlease and dead-letters via MaxAttempts. If no single
Acks it is treated as systemic (later chunks not sent) — bounded to one chunk of singles per drain.
SQL (LOW): AlarmBatchWrite stops isolating at the first single that fails with a known outage
error; the SQL Server alarm writer passes the wider SqlHistorianConnection.IsOutage (login failed
18456/18452, unreachable/refused 2/40/53/64/121/10061/10065/-1, severity >= 20, pool timeout) —
IsTransient is unchanged for its retry callers. Fixes the false claim in docs/AlarmHistorian.md.
Tests: GatewayAlarmPoisonDrainTests (real LocalDb sink + real writer: poison at the queue head ⇒
siblings Ack on the first drain, poison dead-letters via MaxAttempts; positive control: Unavailable
outage ⇒ no single sends, nothing dead-lettered), writer-level isolation + bounded fan-out tests,
AlarmBatchWrite early-stop + no-stop-on-adjacent-poison control, SqlOutageClassificationTests.
OpcUaPublishActor reported AddressSpaceRebuilt only after a real full rebuild, so the empty-plan repair of a degraded
composition, the #977 R-4 whole-composition re-ensure, and the re-diff after a degraded non-rebuild all reported a
clean non-rebuild. The degraded apply's own re-push had run while the node it failed to place was missing; the apply
that finally created it skipped the node's driver (fingerprint unchanged), so the node stayed
BadWaitingForInitialData until its value changed — forever for a constant.
- The publish actor now reports AddressSpaceRebuilt=true when the apply ran a repair pass (either branch) or when the
previous apply of any kind ended degraded (final outcome, completion + catalog included); DriverHostActor re-pushes
the deploy's skipped drivers on it. A clean apply after the repair reports false again.
- DriverLifecycle.md / rules note the widened signal.
Tests: DriverHostActorDegradedRepairReseedTests (REAL publish actor: degraded add, degraded rebuild + empty-plan
repair, degraded rebuild + R-4 repair; skip still works afterwards) and OpcUaPublishActorApplyOutcomeTests (outcome
on both repair branches + after a degraded non-rebuild, with clean-no-op controls) — all six failed before the fix.
Wave 3 of the 2026-12-02 review (docs/reviews/2026-12-02/01-runtime.md R-2/3/7/8/9/10/12/13/21/22/23/24,
02-opcuaserver.md U-10/11/12/13).
Consumer (ProjectedDataAccess cohort):
- R-2: a cohort's OpenSubscription declared a snapshot budget of 1 item, which the origin uses to size the stream's
handle table, so the 2nd item was refused LimitExceeded and the cohort re-opened in a loop (two projected items of
one interval broke each other). Opens/adds/removes are now batched (IDataSubscriptionCommandLimits, <=256 items,
bounded by estimated snapshot bytes) and paced (32 burst, 32/s, <=4 commands or snapshots outstanding).
- R-7: control events no longer share the bounded frame queue; a failed Remove can no longer Stop() the cohort.
- R-10: a local capacity refusal (TryPublishOrBackpressure -> CapacityExhausted) is retried for up to 2 s instead of
invalidating healthy evidence and retiring the route.
- R-13: RemoteSubscription mutates its handle/version tables in place; the cohort caches the source per binding and
drops the per-sample LINQ in EvidenceFor.
- R-8: only an unselectable endpoint arms the discovery backoff; a caller cancel is OperationCanceledException.
- R-24: the condition stream cancels and observes a pending frame read before disposing the enumerator.
Origin (DataSubscriptionSession / SamplePartition / SourceInterestLease):
- R-2 (found by the perf harness): the delivery index was sized MaxPendingFrames x 16 = 1024, so the 1025th item of a
stream stopped the session after its ack; it now covers MaxMonitoredItems.
- R-3: interest reads count only own-ticket matches (scan budget separate), re-queue a lagging tick, and catch up from
per-source last-change versions when the bounded history rolled off - no more "Source change history expired".
- R-9: a partition quiet bump resets a lease only when one of ITS sources was invalidated (per-source quiet version)
or its binding retired; partition-wide invalidation still resets all.
- R-12: the per-item publish verdict is memoised per (catalog instance, authority generation) for <=1 s; Commit
under the session lock re-checks identity only.
- R-21/R-22/R-23: registry prune is interval/capacity driven; a cleared history session refuses chunks; the snapshot
barrier is decided and armed under the same gate its release is decided under.
Node manager: U-10 projected live items indexed by node; U-11 anchor removal / root-leaf swap tombstone the anchor's
own monitored node; U-12 per-parent child count; U-13 per-condition verdict index.
Also: Issue934_r1_N1 test clears its metadata failure before ending the stream (test-only sequencing race,
reproduced with a 200 ms delay; production behaviour correct).
Perf (Category=Perf, OTOPCUA_GRPCDATA_PERF=1): 10k-item cohort opens in 3.3 s / 80 commands / 1 stream (before: never
opens); 100 source versions at 1k/s -> 11,036 item values in 569 ms.
The S-8 gate (no generic mnemonic fallback once a family grammar claimed the address) made
the MELSEC D-register grammar, which claimed every D prefix, reject DI100 as a malformed
D-register. MELSEC has no DI device, so DI... is no longer claimed; every other D... stays
native and DL205's non-octal C rejection is untouched.
MicroLogix 1100/1200/1400/1500 all have L (32-bit integer) files (only the ML 1000 lacks
them, and the family flag cannot tell it apart — an ML 1000 refuses an L read itself, per
tag). SupportsLongFile: false made the P-5 per-tag rule refuse every Long tag on the family
the parser, coalescer and L-bit RMW already handle. The per-tag rejection tests now pin
PLC-5, the one family without L files. Pending hardware confirmation: one L-tag read on an
ML 1400 (Vitamine press fleet).
- _facing was keyed by runtime instance: it grew one entry per re-init (watchdog every ~90 s
while a control is down) and each new runtime restarted at Unknown, so a down control's
status flapped Stopped -> Unknown -> Stopped across every re-init. Now keyed by host:port,
pruned to the configured hosts at init and cleared at shutdown; a runtime no longer in
_devices (being stopped by re-init/shutdown) announces nothing.
- DeviceRuntime.DisposeAsync cancels the loop BEFORE closing the session: closing first woke
an in-flight read while the token was live, and the loop's normal tail set Backoff (host
Stopped) for a plain stop. Seam AfterSessionCloseForTests makes the race deterministic.
The first #980 fix stayed quiet whenever ApplicationStopping was already cancelled. Akka.Hosting
1.5.62's AkkaHostedService hooks WhenTerminated earlier and, for ClusterLeavingReason /
ClusterDowningReason, sets Environment.ExitCode = -1 and calls StopApplication() BEFORE the
watchdog's continuation — so manual failover, endpoint step-down and auto-down all still ended in a
graceful stop (SERVICE_STOPPED, win32 exit 0 — SCM reads ServiceBase.ExitCode, not the -1) that
Windows SCM never restarts.
"Expected" is now decided from signals Akka.Hosting never produces: a host stop requested while
the ActorSystem still runs (SCM stop / Ctrl-C / GracefulClusterLeaveService), the watchdog's own
StopAsync before termination, or CoordinatedShutdown reason ClrExitReason. Everything else exits 1.
After an unexpected termination the watchdog's StopAsync holds host shutdown until the exit is
issued, so the service host cannot report SERVICE_STOPPED first. Registration moved to
AddOtOpcUaTerminationWatchdog (shared with tests).
Tests: TerminationWatchdogAkkaHostingTests — real AddAkka host + production cluster bootstrap +
GracefulClusterLeave: Leave(self)/Down(self) => exit 1 (both fail on the old logic); host StopAsync
and StopApplication-while-running => no exit. Live gate on windev SCM passed (7031 + restart; old
logic => Stopped, exit -1, no recovery; sc stop => clean stop).
G-1 routed secured/verified writes to WriteSecured, which cannot succeed (no AuthenticateUser
identity, no supervisory advise for it, the key needs invoke:secure), and the gateway's
refusal surfaced as BadCommunicationError.
- WriteOneAsync refuses SecuredWrite/VerifiedWrite BadUserAccessDenied before AddItem/advise/
Write (one Warning per attribute, no health impact). InvokeWriteSecuredAsync removed until a
real per-caller identity flow exists.
- gRPC PermissionDenied/Unauthenticated on the write or its supervisory advise ->
BadUserAccessDenied (handle still forgotten; not counted as advise_failed).
- The classification seed is KEPT: it is what makes the refusal local. Unseeded, a secured
attribute takes the supervisory raw path and the refusal would rest on MXAccess answering
MX_E_SecuredWrite (1012) to a supervisory write, a code no live capture has shown.
- docs/drivers/Galaxy.md + Configuration.md updated.
The M-3 fix made the blank-clientId claim id random per instance, breaking single-claim
exclusivity on a redundant pair: a Secondary cold-starting before its cluster join claimed
alongside the Primary, and its stand-down OFFLINE was left retained, newer than the
Primary's ONLINE, with nothing to correct it.
- Claim id = spbhost-<12 hex of SHA-256(hostId, groupId)>: a pair shares one id (broker
takeover keeps the claim single; the evicted Primary reconnects and re-asserts), distinct
groups/hosts differ; 20 chars.
- The claim subscribes to its own STATE topic. An OFFLINE seen while the claim is held (its
own stand-down detaches first, so the echo is ignored) is re-asserted: ts <= session ts ->
republish the session's ONLINE; newer ts -> fresh claim whose timestamp out-dates it
(Sparkplug 3.0 edges ignore older STATE). Coalesced, <= 1 per 2 s. Reconnect re-subscribes
before republishing so the takeover's leftover is seen.
- MiniBroker can inject a PUBLISH and records SUBSCRIBE filters; live pair test against the
Mosquitto fixture.
A RawPath segment may contain backslash, quote, braces, line breaks or non-ASCII text.
SubstituteEquipmentToken pasted it raw into a regular C# string literal, so a device named
de\qv failed to compile and x\vy silently read a different tag path (\v became a vertical tab).
The paste is now encoded (EscapeForRegularLiteral) and the <RefName> / dependency refs are
decoded (TryDecodeRegularLiteral), so GetTag receives the exact RawPath at both compose seams
and the mux subscribes to the real key. The path-literal regex is escape-aware. The Monaco
OTSCRIPT_EQUIPREF diagnostic and completion share the same scan/escape. The deploy gate's
SubstitutionPreservesCompilation is now a verified round trip, so its pinned device-name case
flips from rejected to accepted.
The deploy gate never compiled scripts, so a stored script the #971 allow-list
now refuses only failed after the deploy (VirtualTag/Calculation Bad "sandbox
violation", scripted-alarm load failing for every alarm on the node).
- Core.Scripting.Abstractions: IDeployScriptChecker (Roslyn-free) + request/result
records; ScriptContextKind moved here (same namespace).
- Core.Scripting: ScriptEvaluator.Verify shares a private BuildCheckedCompilation
factory with CompileToImage (wrap, injection guard, sandbox compile,
ForbiddenTypeAnalyzer; no stack-guard rewrite, no emit). RoslynDeployScriptChecker
checks per seam (VT/Calc as VirtualTagContext->object?, passthrough/blank skipped;
predicates DependencyExtractor first then AlarmPredicateContext->bool), caches by
(compile identity, SHA-256), parallel, bounded.
- ControlPlane: DeployScriptGate collects enabled VTs / enabled alarm predicates /
Calculation tags, resolves {{equip}} through EquipmentReferenceMap exactly as the
compose seams do (template compiled once when SubstitutionPreservesCompilation,
else the resolved source), groups findings per script naming its users.
AdminOperationsActor warms the cache before the snapshot transaction and runs the
authoritative pass on the same snapshot; Deployment:ScriptCompileGateMode =
Error (default) | Warn | Off; an absent checker or an internal failure never blocks.
- Host binds RoslynDeployScriptChecker on admin nodes.
- Docs: VirtualTags.md (gate + upgrade note), ScriptEditor.md, security.md, CLAUDE.md.
Found while testing: {{equip}} substitution pastes RawPaths into C# literals
unescaped, so a segment containing \ or " breaks (or silently alters) the
script; the gate now reports it at deploy.
R-11: DriverHostActor skips the deploy bulk push for a kept child whose seeding
fingerprint (value refs + raw/UNS fan-out + historization + alarm refs) is unchanged
and none of whose refs gained a mux consumer (VirtualTag / scripted alarm /
IDependencyConsumer driver). Skipped drivers are re-pushed when the address-space
outcome reports a rebuild (new additive RebuildCompleted.AddressSpaceRebuilt,
default true), degraded, timed out, or the apply threw. Boot/restore still push all.
R-14: ParsedDeploymentArtifact memoises the data projection + its validation per node
id (a throw re-thrown to every caller), and the row parsers skip it when the three data
arrays are empty. OpcUaPublishActor hashes the artifact once (RebuildAddressSpace.
ArtifactRevision) and reads the cluster redundancy mode from the plan step's parse
instead of a second parse on the pinned thread. InjectScriptSource skips JsonNode.Parse
for tag configs without a scriptId.
At most one evaluation is pending per calc tag; a re-trigger only moves its
timestamp forward and the dependency snapshot is taken when the pump dequeues
it. Previously every dependency arrival enqueued a separate evaluation per
dependent with a trigger-time snapshot: k inputs of one cycle ran k times
(publishing intermediates computed from mixed old/new inputs) and the queue had
no bound when triggers outpaced the pump. The out-of-process batch pump now
dequeues every pending tag once per batch.
R-19: VirtualTagActor folds inputs that arrive during an in-flight evaluation
(latest value per input) and evaluates once when it completes, instead of
stashing one message per trigger and replaying one script run each (unbounded,
O(M^2) re-stash hops). One-dimensional array results compare element-wise in
the value dedup, so an unchanged array output is not republished, re-routed or
historized on every evaluation.
R-17: VirtualTagHostActor's source-binding retry re-attempts only the tags whose
binding failed (spawning the child / publishing the disabled status on
success), 250 ms doubling to 5 s, instead of re-delivering the whole
ApplyVirtualTags every 250 ms (quarantine reset, re-assert of every child,
BadOutOfService republish, cycle-graph recompute each time).
Whenever any monitored item was stood down, each TombstoneMonitoredNode ended with a full scan of
_liveItems + _eventItems, and the rebuild ran it once per monitored node plus once more: removals were
O(nodes x items) under the node-manager Lock. Tracked items are now indexed by NodeId (a superset index
added on track, dropped on client delete, re-validated and pruned by the sweep, so it never has to
follow the Suppressed flips); a per-node sweep is a lookup, and TombstoneAllMonitoredNodes skips the
per-node sweep in favour of its single unfiltered one.
Measured (counter): removing 200 stood-down nodes one by one visited 20,300 tracked items before,
~201 after.
Every LoadAsync cleared the compile cache and recompiled every predicate serially while holding _evalGate
(and, uncontended, on the ScriptedAlarmHostActor thread). Now the compile phase runs first on the thread
pool (bounded parallelism) without the gate, reusing source-hash-cached compiles; only the swap holds the
gate, and CompiledScriptCache.RetainOnly disposes just the retired predicates' ALCs. Out of process the
host's validation compile is remembered per source too.
Measured, 500 alarms (distinct predicates, in process, Release): reload of unchanged defs 1303 ms -> 15 ms;
one edited 1040 -> 16 ms; all-new reload 1002 -> 748 ms; ack issued during that reload waited 800 -> 1 ms.
- U-2: planner diffs the rich scripted-alarm plans; an Enabled flip is a surgical add/remove of the one
condition, a Name/AlarmType/Severity edit on an enabled alarm rebuilds.
- U-3: planner diffs UNS Areas/Lines in full; a Line moved to another Area rebuilds, added/removed
Areas/Lines are surgical.
- U-9: removing the last VirtualTag in a FolderPath removes the sub-folder in place.
- AddressSpacePlannerFieldCoverageTests reflects over every composition list + record field.
- R-4: while the last applied composition is degraded, a non-rebuild apply re-ensures the full composition.
- R-20: a supervision restart of OpcUaPublishActor forces its first apply to rebuild.
- R-1: Direct boot with a Failed/orphan newest row restores the newest Applied deployment, then the cache.
- R-15: the revision advances after the last throwing apply step; a throw marks it unconfirmed.
- H-4: ConfigPublishCoordinator closes a superseded in-flight deployment (TimedOut + reason).
Co-Authored-By: Claude <noreply@anthropic.com>
S-4: a failover that finds every endpoint down stays Reconnecting and cycles the endpoints with a
1s..15s capped backoff until it connects or the connection epoch moves on; the backoff is woken by
the epoch so it never pins the failover slot. S-3: ConnectAsync/DisconnectAsync/landing Disconnected
clear the recorded subscriptions, so a re-subscribe of the same node creates a monitored item.
S-12: SubscribeManyAsync + ISubscriptionAdapter batch add (one CreateMonitoredItems), used by the CLI
subscribe and the failover replay. CLI subscribe/alarms print connection transitions.