With Security:Acl:Enabled=false a revalidation pass over local Raw/UNS items is an unconditional allow; it still paid a
(session, ns, id) memo entry and the full Permits walk per item. Measured over 10k items: ~6.5-7 ms and ~1.4 MB per pass
-> ~0.5-1 ms and ~0.2 KB. IsLocalNodeUngated mirrors exactly what Permits concludes there and excludes the one wiring
where it differs (mapped resolver without the projected predicate). The same shortcut inside the per-request Permits was
measured and NOT taken: a 1,000-node flag-off Read stayed ~1.5-1.9 ms either way (SDK read dominates).
Co-Authored-By: Claude <noreply@anthropic.com>
U-8: a warm cached decision on a UNS node allocated 416-680 B/call ahead of the cache (live id-chain list, identifier
split, LINQ, segment array, string.Join key, DataCallerIdentity). Now 0 B: the live chain is cached per folder instance
(re-verified against the live ancestry every call), the generation hands out one segment array per path, the authorizer
keys its resolved cache keys on that array, reference variables key on their own identifier (scope = its split), and
the caller identity is built once per session identity.
R-25: ConfiguredProjectedInterestOwner re-ran discovery for an unresolvable configured reference every 1 s sweep forever;
a failed resolve now backs off 1 s doubling to 30 s (60 s unreachable: 61 discoveries -> 6). Publishing into the source hub
only for sources with interest is DECLINED: that cache answers a new subscription's first snapshot and projected Reads.
Restart comms latch (decided: keep): the nodes stay Bad across an operator Restart and the respawned incarnation must
re-publish them; the stopped child's PostStop announcement already re-latches and cancels the old audit. Pinned by test.
Co-Authored-By: Claude <noreply@anthropic.com>
- AuditWriterActor: every buffer-full drop is added to OtOpcUaTelemetry.AuditDropped
(otopcua.audit.dropped{reason=buffer_full, actor}) — the count used to be readable only
through the actor's own property.
- scripts/install/tests/Test-ScmRestartAfterClusterExit.Windows.ps1: the windev manual gate
of 2026-12-03 as a script (qfailure restart action; failover/command trigger => non-zero exit,
7031, Running under a new pid; Stop-Service stays stopped; optional kill control). Parse-checked
with pwsh on macOS; must be run elevated on a Windows box hosting OtOpcUaHost.
Co-Authored-By: Claude <noreply@anthropic.com>
New DriverCapability.AcquisitionSubscribe (appended): RetryCount 0 in every tier and forced 0 by the parser, 30 s timeout
(outlasts the actor's 10 s acquisition timeout), breaker 5 (Tier C none). PendingAcquisition.Start routes through the
invoker keyed on the driver instance; an open breaker fails fast and the capacity reservation is released.
Co-Authored-By: Claude <noreply@anthropic.com>
H-6 remainder: ConfigPublishCoordinator runs the dispatch guard/seed (incl. the #977 superseded close) and the
Sealed/PartiallyFailed/TimedOut writes through RunDbWork - a pool-thread task whose outcome is applied on the actor
thread while a Busy behaviour stashes everything else. A failed write is rethrown when it reports back (same
restart-and-recover contract as before); recovery runs the same work inline (failure = failed load).
H-3 remainder: a transient Restart/Reconnect ConfigEdit audit failure is retried (1 s doubling, 30 s cap, 6 attempts);
a ConfigDb rejection (poison allowlist) is not.
Co-Authored-By: Claude <noreply@anthropic.com>
Root cause of the ~1-in-20 flake in GrpcDataCohortScaleTests.R2_a_cohort_above_1024_items_opens_on_one_origin_stream
(Opens = 2): a production race in the origin DataSubscriptionSession, not a fixture artifact.
The session's bounded outbound window (MaxPendingFrames) is shared by values, snapshot controls and command acks. The
snapshot pump leaves exactly one slot "for command acknowledgements", but a peer may have up to MaxCommands commands
in flight (the #994 projected cohort keeps 4 outstanding). When the reader was a few frames behind, an open/add's
snapshot filled the window, the next add's ack took the reserved slot, and the following ack's TryWrite failed;
EnqueueAsync then CloseWithReset("Pending control capacity exhausted.") the whole stream, and the cohort re-opened
all 1100 items on a second origin stream. Instrumented repro: the failing run's trace shows exactly that reset on the
1100-item cohort's first stream, then a second COHORT OPEN with epoch=2; the reset never appeared in passing runs.
Fix: EnqueueAsync (production callers all on the command worker) now awaits the window when it is full instead of
resetting — backpressure on the worker, never on the reader. A reader that never drains is still bounded by the ack
deadline, the session lifetime and the bounded command queue. The values cap (MaxPendingFrames - 2) still resets.
Regression: GrpcDataDeliveryWindowTests drives an 8-frame window with an unread open + 3 adds on a frozen clock; the
OutboundFullForTests seam proves an ack met a full window. Before the fix the stream ended with that reset; after it
every ack, SnapshotEnd and baseline arrives with no Reset.
Verified: GrpcDataCohortScaleTests + GrpcDataDeliveryWindowTests 30/30 consecutive passes (plus 30/30 instrumented
with zero "Pending control capacity" resets); full Runtime.Tests (Category!=SlowUnit) 2283 passed / 0 failed.
FleetDiagnosticsTargets.IsWellFormed used \d (any Unicode decimal digit, so
'host:٤٠٥٣' matched and int.Parse threw FormatException, crashing the page) and
$ (matches before a trailing '\n', which int.Parse then ignored, so
'host:4053\n' was 'well-formed' and could reach the akka.tcp address). Now
[0-9]{1,5}\z and int.TryParse(NumberStyles.None). Regression rows for trailing
newline, Arabic-Indic / full-width / mixed digits, and Resolve refusing them
without throwing (positive control kept); all failed first.
Co-Authored-By: Claude <noreply@anthropic.com>
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>
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 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).
In-flight ack writes were tracked by node only and ResetForNext (supersede + every terminal path) cleared the
parked-behind acks but not the in-flight set. With deployment A's ack write for node N still running, B
superseding A (or A closing at the deadline-deferral cap) and N acking B parked B's ack behind A's write; A's
stale completion then deleted it and B timed out naming N, though N applied it.
- In-flight writes are per deployment: ResetForNext clears _persisting; an ack parks only behind a write of the
SAME deployment; a completion removes only its own entry (reference match).
- The stale-completion branch starts a parked ack of the current deployment instead of dropping it.
- The deferral cap counts only current-deployment in-flight (and parked, newest-wins) acks; the deadline deferral
and its early re-fire, and the retry-tick guard, consider only the current deployment's writes.
Tests: ConfigPublishCoordinatorSupersededAckWriteTests — supersede and deferral-cap variants (both failed before
the fix) plus a positive control.
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.
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.
- 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>
An unwrapped SubscribeAcquisitionAsync / WriteWithOutcomesAsync call now fails the build.
Full-solution build flags exactly one production site (DriverInstanceActor acquisition start),
suppressed inline with the reason the stock retrying/timeout pipeline cannot own that call,
and one wire-level Runtime test call.
#974 (S-7) — the named-query guard had one lexer for five dialects and took live SQL for literal text
where a provider ends a literal earlier (MySQL backslash escapes, PostgreSQL dollar quotes, T-SQL ]],
nested comments, MySQL # / "--x", bare-CR line comments, Oracle q'..'). All 13 bypass strings were
accepted; the MySQL and PostgreSQL ones were executed against the live fixtures and the smuggled
UPDATE committed past the always-rolled-back transaction.
- SqlReadOnlyStatement (own file) lexes per provider and REFUSES constructs dialects disagree on;
Odbc / no provider = every dialect must agree. Factory and AdminUI form pass the provider; the form
re-validates queries on a provider change.
- ISqlDialect.BeginNamedQueryAsync / SealNamedQueryCommand / EndNamedQueryAsync: PostgreSQL and Oracle
SET TRANSACTION READ ONLY; MySQL read-only session + transaction (restored after); PostgreSQL rewrites
@name markers to positional $n (a parameterless query gets one unused typed $1) so Npgsql sends the
text unsplit and the server refuses a second statement.
#987 (S-6) — key-value rows are attributed by SqlKeyMatcher (exact, then typed / padding-insensitive,
then case/accent-insensitive — only for rows the server matched); a named query's rowKey uses the
exact + representational stages only.
#987 (S-10) — SQL Server table writes read the target statement's own @@ROWCOUNT through an OUTPUT
parameter; SqlClient's ExecuteNonQuery sums trigger DML (reproduced: 1 + 2 audit rows = 3, every write
rolled back BadConfigurationError).
Tests: per-dialect bypass theory + positive controls, matcher + SQLite collation/affinity attribution,
Postgres seal, dialect-hook wiring, SQL Server write-plan capture; live NamedQueryBypassLiveTests
(PG/MySQL/Oracle), SqlServerTriggerWriteLiveTests, MySQL writing-function now refused.
U-4: EquipmentVariableState tracks an overlap window per node — the confirmed
(value, status, source timestamp) snapshotted when the first optimistic commit
lands on an unowned node, advanced by an older attempt the device confirms
while a newer one owns it. A refused owner reverts to it (never to the
previous attempt's unconfirmed value at Good); audit OldValue follows. Applies
per NodeId, so raw and UNS mirrors each revert to the fanned value. Mapped
completions use the same tuple.
R-6: DriverHostActor diffs the value-ref index on apply and sends
DependencyMuxActor.ValueRefsRemoved; the mux (and VirtualTagOutputsRemoved)
hands every replay-opting dependent BadWaitingForInitialData (the recorder is
not told), and late bursts for removed refs are withheld until the next apply.
Tests: Sdk2EquipmentVariableTests (overlap both orders x both realms, confirmed
older write, interleaved raw+UNS), GrpcDataMappedWriteCompletionTests,
RemovedInputQualityTests, DriverHostActorSourceRemovedTests,
VirtualTagToVirtualTagFlowTests (Roslyn, identical-value recovery).
- V3NodeIds.ValidateSegment is the single rule Uns()/UnsChild() enforce; the VirtualTag modal
([UnsLeafName]), UnsTreeService (VirtualTag create/update, SetReferenceOverrideAsync) and the
deploy gate (VirtualTagNameInvalid, UnsEffectiveNameInvalid) all call it (C-1, C-4).
- Effective name is stated once (EquipmentReferenceMap.EffectiveName): an empty override falls
back to the tag name in the gate and the Monaco catalog, as at both compose seams (C-4).
- UnsSegment patterns anchored \A..\z, so a trailing newline is rejected (C-7).
- VirtualTagScriptNotFound / ScriptedAlarmScriptNotFound deploy-gate rules; ScriptEdit refuses to
delete a script used by a VirtualTag, ScriptedAlarm or Calculation tag and names them (C-2).
- R-5 backstop: VirtualTagHostActor skips (Error log) a plan whose NodeId cannot be built instead
of crashing on every apply; AddressSpaceApplier counts it as a failed node instead of aborting
the VirtualTag materialise pass.
ForbiddenTypeAnalyzer inverted from a BCL deny-list to an allow-list of types/members (ctx API, value/time/maths
types, collections, LINQ-to-objects, string/Regex/formatting; System.Type and CancellationToken with member
allow-lists). Every named type, expression type and used member (incl. return type and generic args) is checked;
__makeref/__arglist, lock and extern local functions refused syntactically. ScriptSandbox references only eight BCL
assemblies (defence in depth). The Monaco editor and the publish gate share both, so parity holds.
Tests: theory over the K-1 snippets (publish gate + analyzer alone against the full host), every-public-type
enumeration, shipped-sample + idiom regression, editor/publish parity. Differential over every script-shaped literal
in src/tests: all 511 previously-compiling scripts still compile (one expression-tree test intentionally refused).
PE cache signing by the host (option 4) deferred as a follow-up.
Co-Authored-By: Claude <noreply@anthropic.com>