#1084 - DataExport.AllowSecuredWrites (default false; migration AddDataExportAllowSecuredWrites, a bit NOT NULL DEFAULT 0
column, no constraint => no MigrationPreChecks twin; the preflight's legacy-schema tolerance covers the missing column).
- Valid only with Write: validator code DataExportSecuredWriteInvalid at authoring, the deploy gate and on a deployed
row (an artifact row breaking it fails closed), modelled on AllowGalaxyServiceAck.
- LocalExportCatalog keeps it per rule (counts only with Write) and answers AllowsSecuredWrite(principal, node): an
export of the principal, in the node's realm, granting Write, opted in, whose root contains the node.
- DataWriteExecutor stamps DataWriteAdmission.AllowsSecuredWrite (new, default false) from the catalog generation that
admitted the write (re-checked by the dispatch gate's commit), never from the request.
- DriverInstanceActor.RichCaller returns null without it, so the driver gets NO caller: the driver option
MxAccess.SecuredWritesOverDataConnections alone no longer lets a forwarding consumer cluster's link key write
SecuredWrite attributes. Fail closed by default.
- AdminUI export editor: "Allow secured writes under this peer's key identity" checkbox (enabled only with Write).
#1091 (a) - GalaxyDriver implements IWriteOutcomeCapability + ICallerAwareWriteOutcomeCapability. GalaxyWriteOutcomes
maps BadUserAccessDenied and the OnWriteComplete verdicts BadNotWritable/BadTypeMismatch/BadOutOfRange/
BadConfigurationError to DriverConfirmedFailure, Good to AcceptedUnconfirmed (a provisional Good is indistinguishable),
everything else to OutcomeUnknown. A refused secured write is now a definite BadUserAccessDenied, not OutcomeUnknown.
- RunRichWriteAsync precedence: caller-aware outcome overload (caller present) -> outcome overload -> ICallerAwareWritable
(caller present) -> IWritable. Both earlier behaviours kept; the OPC UA path is unchanged.
Tests (each failed before its fix where applicable):
- End to end through the runtime path (artifact -> catalog -> DataWriteRuntime executor -> ActorDataWriteRoute ->
DriverInstanceActor behind the real dispatch gate -> real GalaxyDriver): export opt-in x driver option matrix; only
both commit as the key's identity, either alone refuses BadUserAccessDenied definitively with no identity lookup.
Ignoring the flag in RichCaller fails 3 tests.
- Catalog scope (root containment, Write, principal), artifact round-trip + fail-closed row, validator, migration SQL +
no pending model changes, AdminUI checkbox enable/save (bUnit), actor precedence, Galaxy outcome mapping.
- ScriptForeignKeysAndExternalIdUniquenessMigrationTests now migrate to THEIR migration, not the latest.
Docs: DataConnections.md (two-gate table), Galaxy.md, security.md, rules/drivers.md.
- ICallerAwareWritable and the new ICallerAwareWriteOutcomeCapability join the guarded-interface list. Each derives
from a guarded interface but declares its OWN member, which is not an implementation of the base's, so
callerAware.WriteAsync(writes, caller, ct) on an interface or concrete receiver passed unflagged.
- ICallerAwareWriteOutcomeCapability (Core.Abstractions.DataConnections): IWriteOutcomeCapability on behalf of a
WriteCaller, for the gRPC data-connection write path (used by the Galaxy driver, next commit).
- Tests: unwrapped caller-aware WriteAsync trips on interface AND concrete receivers; the caller-aware outcome
overload trips unwrapped and passes wrapped (positive control). Both failed (0 diagnostics) with the two
entries removed from the list.
- WriteCaller gains an additive Origin (WriteCallerOrigin: Unspecified (default) | OpcUaSession | DataConnection),
stamped by the runtime at the receiving seam: OtOpcUaNodeManager -> OpcUaSession, the rich (gRPC data-connection)
write path -> DataConnection. Never parsed from the principal/key.
- New driver-config option MxAccess.SecuredWritesOverDataConnections (default false; factory key
mxAccess.securedWritesOverDataConnections; AdminUI "Also for gRPC data-connection writes", owned path). The
Galaxy driver gives a caller an identity source only in ApiKeyIdentity mode AND for an allowed origin:
OpcUaSession always, DataConnection only with the option, Unspecified never (fail closed). Off => a secured write
over a data connection is refused exactly as before #1074 (local BadUserAccessDenied, no identity lookup; the gRPC
caller sees the same OutcomeUnknown as before).
- Tests: option off refuses a gRPC write end to end into the real GalaxyDriver (with an OPC UA positive control on
the same driver); option-on end-to-end kept; driver-level origin matrix incl. Unspecified; factory binding; AdminUI
round-trip; node-manager callers now carry OpcUaSession.
- Docs: Galaxy.md (origin table, opt-in, forwarded-write delegation caveat, live-gate leg), security.md,
DataConnections.md, Configuration.md, rules/drivers.md.
- DriverInstanceActor's rich write path (RouteRichWrite -> WriteAttributeWithOutcome) now hands an
ICallerAwareWritable driver WriteCaller(principal, apiKeyId) taken from the DataWriteAdmission, i.e.
the connection's authenticated DataAuthenticatedContext (never the request payload), re-checked by the
dispatch gate's commit. Same caller shape as the OPC UA path (#1017). No proto change: the identity was
already server-side. IWriteOutcomeCapability keeps precedence (no driver implements both today).
- Fail-closed unchanged: Galaxy resolves only the key's own identity (no fallback); no identity => refused.
- Tests: rich write reaches the caller-aware overload with the admitted principal/key (failed before: the
caller-less overload was used); OPC UA WriteAttribute and gRPC rich write deliver equal WriteCallers; a
real GalaxyDriver in ApiKeyIdentity mode resolves the connection key's identity end to end.
- Docs: Galaxy.md (gRPC path, federated writes run as the LINK key's identity, refusal reported as
OutcomeUnknown on the legacy path), DataConnections.md, security.md, rules/drivers.md.
- PendingDelivery is an abstract base: ValueDelivery carries a value's state in fields (was a closure +
seven delegates per value), DelegateDelivery keeps the delegate form for controls/acks/conditions.
One ValueLease replaces BudgetLease + one or two CompositeLeases (same release order).
- EnqueueAsync returns ValueTask and completes synchronously when a slot is free. A full window waits on
the session's reused SlotWaiter (signalled by every dequeue and by Stop, which sets _closed first)
instead of the channel's WriteAsync (a writer operation + cancellation registration per wait); the
wait and TickAsync/PumpSnapshotsAsync/ConsiderAsync use PoolingAsyncValueTaskMethodBuilder, as do the
reader's MoveNextAsync/NextPendingAsync. The #994 behaviour is unchanged: an ack meeting a full window
waits for the reader and never resets the stream.
- ConsiderAsync decides 'already considered / not yet due' on a version peek before taking a full
cache read (CachedSourceRead + sample copy + value).
- The tick signal is one shared immutable Work.
New test: a worker waiting on a full window ends when the stream stops and releases what it held
(fails if Stop does not wake the waiter).
The held runner's stale timer was created only after its loop had unwound, so under load the
BadNoCommunication mark came a full stale timeout after a slow unwind - late, or skipped when the
MaxHold release (timed from the hold) ended the hold first. The timer now starts with the hold; a
mark due before the unwind waits for it (no late Good from that loop can follow the mark) and lands
at the unwind.
Tests (fake clock, ProjectedConditionAccess on ManualTimeProvider; the fixture can gate the runner's
lease release to model a slow unwind): the mark lands at the unwind when it fell due earlier, still
before MaxHold (failed before the fix: no mark, the release came first); and lands exactly at hold
start + stale timeout with a prompt unwind.
#1063: the Monaco diagnostics dropped every Roslyn error located in the synthesized
wrapper as 'phantom', so CS0161 (not all code paths return a value, pinned on Run)
passed the editor and failed the deploy gate. ScriptCompileRules (Core.Scripting) now
states which diagnostics refuse (every Error, wherever located; LMX001/002 injection)
and which sources skip the compile (blank/passthrough value scripts); ScriptEvaluator
and the editor both use it, and the editor wraps with ScriptEvaluator.WrapperPreamble/
WrapperSuffix instead of its own copy. Wrapper-located refusals are drawn on the
script's last line. EditorGateParityTests runs one corpus through editor and gate in
all three modes.
#1065: a Calculation tag is raw/device-level with no equipment and its seam never
substitutes {{equip}}, so such a script deployed clean and read Bad forever. Refused
rather than substituted: EquipTokenLiteralScanner.FindInCalculation is run by
RoslynDeployScriptChecker for every Calculation use (before the passthrough shortcut,
outside the shared VT/Calc cache) and by the editor in the new 'calculation' mode
(Calculation tag editor; ScriptEdit defaults to it when a Calculation tag uses the
script).
Confirmed, deterministically: Context.Stop is asynchronous and messages from two children are unordered, so an operator
Restart's old child announced comms loss from PostStop AFTER the replacement had connected and pushed its initial values
(the old child reaches its stop only once a synchronous driver call returns). The host then stamped every value node
BadNoCommunication with nothing left to re-publish them, re-latched them and cancelled the new incarnation's recovery
audit - nodes stuck Bad, tripwire disarmed. Pre-fix the new test saw 2 status batches where 1 is correct.
Fix at the root, in DriverHostActor.OnDriverConnectivityChanged: IsStaleRetiredConnectivity drops, whole, any
Connected=true from a retired child, and its Connected=false once the current child of the same id has announced
Connected (new ChildEntry.Connected, set only from the current child's own edges). A retired Bad edge is still applied
while the replacement has not connected (or there is none) - the 03/S15 gap cover Restart/respawn rely on; same rule the
condition-signal tracker already applied. Senders that were never children are not filtered.
Tests (DriverHostStaleConnectivityTests): the race made deterministic by wedging the old child in a blocking
GetHostStatuses; positive control = a Force Reconnect of the current child must yield exactly one status batch before the
re-subscribe push. Companion: a retired Bad edge before the replacement connects still stamps Bad and the push recovers.
Co-Authored-By: Claude <noreply@anthropic.com>
RawTree gains an opt-in single-select NodePickMode (any entity kind); new UnsRootPicker and
DataRootPickerModal; cluster-scoped trees built from the draft snapshot. Stored kinds and
validation unchanged.
The #1033 flag-off revalidation fast path (IsLocalNodeUngated) answers a local Raw/UNS item allow without the
authorizer, sound only while those two delegates are the node manager's own ClassifyImportedCondition /
IsProjectedDescendant. Source-scan guard over src/**/*.cs (RoleAuthorityGuardTests idiom): any assignment outside
OtOpcUaNodeManager.cs, or one there to another delegate, fails; non-vacuity counts the real wiring sites; a
falsification test feeds offending snippets. Mutation-checked against the real tree (a rogue assignment in
DataPlaneAuthorizer.cs fails it).
Co-Authored-By: Claude <noreply@anthropic.com>
Intermittent failure in a full Runtime.Tests run. Test timing, not a production defect: the held runner's stale mark is
armed only after its loop has unwound (no late Good can follow it) and fires 100 ms later, while MaxHold runs from the
hold itself. Measured with the thread pool saturated: stale mark ~1.9 s after the hold, MaxHold release at ~0.9 s, so
the release ended the hold first (stale skipped / removal seen by the 'not removed before MaxHold' check). Production
MaxHold is 5 min. With 5 s the ordering holds under that load (stale ~1.9 s, release ~5 s).
One command, run from the NEW build against a ConfigDb BEFORE its migrations, that names every row
the upgrade or the next deploy would refuse; exit 1 if any, 2 if unreachable / not v3.
- migration:* — row-naming twins of the constraint-adding migrations' pre-checks
(ConfigurationGapsIndexesAndRowVersions: duplicate NodeAcl / LdapGroupRoleMapping;
ScriptForeignKeysAndExternalIdUniqueness: NULL ScriptId, dangling VT/alarm scripts, duplicate
ZTag/SAPID, reservation rows). (#1021)
- deploy-gate — DeployGateRules, the gate's rule pass now extracted from AdminOperationsActor so
both run the same code: every DraftValidator rule incl. VirtualTagNameInvalid /
UnsEffectiveNameInvalid / *ScriptNotFound (#1015) and SqlNamedQueryInvalid (#1058), topology,
TagConfig inspection.
- script-gate — DeployScriptGate through RoslynDeployScriptChecker, plus every unused stored
script (Warning). (#1013)
An older schema is read through this build's model: tables a pending migration creates map to a
typed zero-row query, added columns are left out of the model (LegacySchemaTolerance). SNAPSHOT
read when allowed. Logic in ControlPlane/Preflight (Roslyn-free); the console shell binds Roslyn.
Real-SQL tests: an old-schema DB with every finding class (and nothing written), clean controls,
NULL ScriptId -> SnapshotUnreadable, non-v3 refused. docs/v2/upgrade-preflight.md records the dev
runs; production runs stay user-gated (wonder-box hold).
The driver runs SqlNamedQueryRules.Describe over every queries entry with its provider at
construction, and one refused query fails the whole driver (every tag BadNodeIdUnknown). Since #974
that includes a T-SQL parse for SqlServer/Odbc/no-provider, so an Odbc query written in another
dialect (LIMIT, ILIKE, 'a'::text) that used to pass is refused after the upgrade. The gate now runs
the same rule over the same merged config (factory-equivalent JSON options), naming the instance.
Noted: a bare col::type PARSES as T-SQL static-member syntax and is accepted by both.
Follow-up of #973 (review 2026-12-02 A-1). New Cluster:Remoting section (AkkaRemotingOptions):
- UntrustedMode (default ON): akka.remote.untrusted-mode with trusted-selection-paths =
every path this code base reaches by ActorSelection across nodes, enumerated from the Akka
1.5.62 sources + src/: cluster core daemon + heartbeat receiver, remote-watcher, the DPS
mediator, /user/{s} + /user/{s}/{s} for each ControlPlane singleton, /user/driver-host.
Remote deployment and peer PoisonPill/Kill are dropped. Receive-side only, so a mixed
old/new pair keeps working through a rolling upgrade. Drops (Akka logs them at Debug)
become a Warning per path + otopcua.cluster.remoting.untrusted_drops.
AdditionalTrustedSelectionPaths / UntrustedMode=false are the escape hatches.
- Tls (default OFF): mutual TLS on the DotNetty transport (PFX or store cert, mutual auth
on by default, thumbprint pinning or chain validation, optional hostname check). Seeds and
the diagnostics selection follow the transport scheme (akka.ssl.tcp); the bootstrap guard
parses it. Validated at boot.
Proven on real clusters: pair formation, singleton via proxy + hand-over on leave, DPS, zero
drops; untrusted selection dropped (and delivered with the mode off); pinned TLS peers form,
an unpinned node cannot join; full two-node Host harness (deploys from both nodes,
diagnostics, node restart) with zero drops + positive control. Guards fail when a new
singleton or ActorSelection appears without its trusted path.
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>
Measured with GrpcDataWave3PerfTests (10k-item cohort, 100 source versions at 1k/s; numbers in the issue report).
- Core: MappedSubjectResolver.Resolve returns shared immutable resolutions (built once per subject) and compares
scope/ancestry by index (no MappedSubjectResolution + 2 enumerators per call, several calls per value);
DataOperationPolicy checks segments by index and builds its local scope key with one exact-length string.Create.
- Origin: LocalExportCatalog.TryResolve compares the view field by field instead of building 'view with { Address }'
(and LocalAddress no longer copies an exactly-spelled address); the frame Eligible check peeks the latest READY
version (PartitionedSampleHub.TryPeekReadyVersion) instead of retaining a second sample per value; TickAsync reuses
worker-owned lists (interest groups, changes via SourceInterestLease.TryReadChanges(into), delivery slice via
DeliveryScheduler.TakeSlice(into), due items) and the delivery index reuses one ready-list node per source.
- Consumer: PublishPacedAsync is a ValueTask; the cohort and RemoteSubscription walk frame items by index; renewal
prunes expired witnesses in place.
- 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.
Root cause of the intermittent VirtualTagActorTimerTests coalesce failure (full suite only):
Akka's HashedWheelTimer does not skip ticks it missed while its thread was stalled (GC pause,
CPU starvation) - it delivers them all in one burst when it resumes. Measured with a parked
scheduler thread: a 600 ms stall => 12 ticks within the same millisecond. Ticks that fell due
during the gated run therefore landed just after the release, each a fresh evaluation, and broke
the post-release bound. In production the same burst multiplied every timer tag's script runs by
stall/interval after any stall.
VirtualTagActor now drops a tick that lands within half an interval of the last timer
evaluation (scheduler monotonic clock); the regular cadence is unaffected. New deterministic
test parks the scheduler thread for 600 ms with the release inside the stall: failed 3/3
before the fix, passes after, with a cadence positive control. The in-flight assertion
(Calls == 1 while gated) has no such mechanism - ticks during a run are dropped - and did not
fail in 3 full-suite + 12 class-scoped trx runs under load average ~490.
Every evaluation through the in-process, shadow and out-of-process runners built its
"{kind}:{key}" string afresh, and InProcessScriptRunner also concatenated the WHOLE script
source into its negative-cache key per evaluation. ScopedKeys.For returns a cached string
(bounded 65,536 keys per kind, cleared on overflow); the compile-failure map is keyed by a
(kind, source) tuple.
Measured: 10,000 scoped-key lookups 1,520,000 B -> 0 B (ScopedKeyCacheTests);
InProcessScriptRunner.RunAsync with a ~2 KB source 9,161 -> ~4,900-5,000 B per evaluation.
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>
The origin admitted MaxStreamsPerPrincipal (8) concurrent snapshots per PRINCIPAL, shared by every stream that principal
held. A consumer opens one stream per (connection, identity, publishing interval) and each cohort keeps up to 4 commands
or snapshots outstanding, so a third cohort's add was refused and its whole stream reset ('Snapshot admission
exhausted'). SubscriptionTransportCapacity.ForDataPlane (used by LocalDataRuntimeComposition) now gives each stream 8
slots (SnapshotSlotsPerStream) and sizes the principal and node caps so every admitted stream can hold all of them; the
snapshot byte budgets still bound memory. A session's background waiting-item recoveries may take at most half its
slots, so the peer's outstanding commands always find theirs. Capacities built without a per-session cap (tests) keep
the old per-principal behaviour.