IsRowSiteAllowedAsync on the Notification Outbox and Site Calls pages returned
'resolved is not null && ...', so a parked row whose source site no longer
resolves (deleted / renamed) - which the grid deliberately keeps listing - was
refused for everyone, Administrator included, and could not be cleared.
Now a system-wide user short-circuits to allowed before the site lookup; a
site-scoped user is still denied an unresolvable row (no Site.Id to authorize
against). Deletes NotificationReport's unused IsRowSiteAllowedSync, whose
'unresolvable defaults to allowed' contract contradicted the async check.
Design doc updated (Notification Outbox, Site Calls).
Tests: NotificationReportPageTests / SiteCallsReportPageTests
Retry_OnRowFromADeletedSite_AllowedSystemWide_DeniedScoped (system-wide case fails
pre-fix; scoped denial pinned).
A navigation while an awaited load was still running disposed the component
first; the continuation then created a timer / added a singleton handler that
nothing ever disposed, rooting the dead circuit for the life of the process.
- Health: refresh timer created under _timerLock only if not disposed.
- DataConnections: same for the health-poll timer; also stops before touching
the disposed CTS when disposed during the first load.
- Deployments: subscribe to IDeploymentStatusNotifier BEFORE the first load
(the handler only schedules a reload; the generation guard orders flights).
- PendingUpdatesHealthTiles: the Invalidated subscription and the poll timer are
both created under a lifetime lock after a disposed check; Dispose unsubscribes
only what was subscribed (covers a dispose during the auth-state await too).
- AlarmSummary: StartTimer/StopTimer/Dispose atomic under _timerLock; StartTimer
refuses after dispose (Topology.StartLiveUpdatesTimer idiom).
Tests (each fails on the pre-fix component): HealthPageTests, DataConnectionsPageTests,
DeploymentsPerFlightScopeTests, PendingUpdatesHealthTilesTests (x2),
AlarmSummaryRenderTests - dispose mid-load, release the load, assert no timer and
no handler left.
The circuit-lifetime ScadaBridgeDbContext tracked every entity a page ever
loaded, so a reload returned the first-loaded instance and never saw changes
made in another scope (Move to Site, Topology area renames, a template script
edited by the CLI/import - which a later save then silently reverted).
- CircuitDbContextTrackingHandler (CircuitHandler, registered by AddCentralUI)
sets QueryTrackingBehavior.NoTracking on the circuit scope's context only,
when the circuit host is built (before any component). Management-actor,
command-transaction, HTTP-request and hosted-service scopes keep TrackAll.
- Every remaining page mutation that ran a load-modify-save service on the
circuit context now runs it via ScopeFactory.InNewScopeAsync (fresh tracking
context): TemplateEdit (17 TemplateService calls), Templates (5 TemplateService
+ 5 TemplateFolderService), TemplateCreate, SharedScripts, SharedScriptForm,
TransportImport.ApplyAsync. (Sites/Topology moved in 5.2.)
- Design doc: Component-CentralUI.md 'Circuit DbContext lifetime'.
Tests: CircuitDbContextTrackingTests - handler scoping + registration, the three
finding scenarios against a real SQLite context (moved connection also asserts
the pre-fix staleness without the handler), and a source-scan guard that fails
on any mutating call through a circuit-injected load-modify-save service.
- Deployments: every LoadDataAsync flight reads through its own scope, so
overlapping flights (push reload, debounce, page/tile click) no longer
collide on the circuit DbContext; the generation guard still orders results.
- Sites: Deploy Artifacts (per site and to all sites) resolves
ArtifactDeploymentService from a fresh scope, so the post-fan-out record,
audit rows and revision stamp neither share the circuit context nor die
with the circuit.
- Topology: Diff and Enable/Disable/Delete resolve DeploymentService from
their own scope (like Deploy/Deploy all), so they cannot overlap the 15 s
live tick; drops the unused AreaService/InstanceService injections.
- New ScopedServiceExtensions.InNewScopeAsync helper.
Tests: DeploymentsPerFlightScopeTests, SitesPageTests
DeployToAllSites_RunsInItsOwnScope_DisposedAfterTheAction, TopologyPageTests
UI8_InstanceActions_RunOnTheirOwnScope (all fail on the pre-fix pages).
Mirror of mxaccessgw#237 (659bb831). DEV vd03 showed 229k context switches
in ZB.MOM.WW.ScadaBridge.Host at ~240 MxGateway events/s. Akka's default
dispatcher, gRPC/Kestrel and async continuations all run on the .NET thread
pool, so a trickle of small work items makes idle pool workers spin with
Sleep(0) (default limit 70) before parking.
- Host csproj: RuntimeHostConfigurationOption
System.Threading.ThreadPool.UnfairSemaphoreSpinLimit=10, written into
ZB.MOM.WW.ScadaBridge.Host.runtimeconfig.json (verified in the publish
output, which docker/Dockerfile copies into the image).
- RuntimeConfigTests pins the value in the built runtimeconfig.
- Component-Host.md: new "Runtime thread-pool settings" section (what, why,
override/revert via DOTNET_ThreadPool_UnfairSemaphoreSpinLimit).
Local synthetic trickle bench (macOS, ~185 chains/s): involuntary context
switches 17-28k -> 6-13k, CPU 430-560 -> 200-295 ms per 20 s. The vd03
before/after WPR measurement is pending the next vd03 deploy.
OtOpcUa now exposes conditions imported over gRPC data connections in the
namespace https://zb.com/otopcua/mapped/conditions. Their ConditionId is
an opaque c1. NodeId stable for the life of the connection, but their
SourceName (<anchor>/<placement path>) moves when the primary placement
mapping changes. ScadaBridge keyed every condition on
SourceName.ConditionName, so a mapping change read as one alarm clearing
and a new one raising.
- Event filter selects ConditionId (select clause 19: ConditionType,
empty browse path, AttributeId = NodeId).
- When the ConditionId (or SourceNode, which OtOpcUa sets to it) is in the
mapped/conditions namespace, the per-condition key is its durable
nsu=... string (index-proof across an OtOpcUa pair / upgrade). Every
other OPC UA condition keeps the SourceName.ConditionName key, so no
existing persisted row, MES script or operator view is re-keyed.
- The old SourceName.ConditionName text becomes an additive, display-only
DisplayName: NativeAlarmTransition -> AlarmStateChanged ->
AlarmStateUpdate.display_name (26) / DebugAlarmStateDto.display_name
(22) -> ScriptAlarm.DisplayName. Persisted in native_alarm_state
metadata_json (no column, no CDC trigger change); updates in place on
every transition under the fixed key. Protos regenerated.
- Alarm Summary and Debug View show DisplayName (key as tooltip) and
filter on it; site event log writes "label [key]".
- Upgrade: a pre-#147 row for an imported condition is retired by the
first completed refresh snapshot (one return-to-normal + drop), then the
condition continues under its ConditionId.
Tests: RealOpcUaImportedConditionKeyTests, OpcUaAlarmMapperTests,
NativeAlarmActorTests (DisplayName, rehydration, legacy-row retirement),
StreamRelayActorTests, SiteCommand golden sample, AlarmsAccessorTests,
DebugTreeBuilderTests; filter select-clause count 19 -> 20.
Docs: Component-DataConnectionLayer/Commons/Communication/SiteRuntime.
OtOpcUa now emits RefreshRequiredEventType (SourceNode = Server, no
condition fields) on an incomplete condition snapshot, a removed imported
condition, or a resync that leaves pre-failover EventIds answering
BadEventIdUnknown. RealOpcUaClient had no branch for it: the event fell
through HandleAlarmEvent as a phantom condition keyed "Server" and no
refresh was issued, so the mirror could hold stale / un-ackable state.
- HandleAlarmEvent recognises RefreshRequiredEventType, emits nothing, and
hands the item's handle to the new ConditionRefreshCoalescer.
- The coalescer runs off the SDK publish thread, debounces 500 ms so a
burst (one event per affected item) costs one refresh, never overlaps
refreshes (a request during an in-flight refresh is served by the next),
logs and swallows failures, and is cleared on disconnect.
- Execution: targeted ConditionRefresh2(eventSubscription, item) per asking
item; one subscription-wide ConditionRefresh when every live alarm item
asked, an item has no server id, or ConditionRefresh2 fails. The replay is
the usual RefreshStart/End frame, so NativeAlarmActor's snapshot swap
clears conditions the refreshed snapshot no longer lists.
- The server-side OfType WhereClause built from a condition filter now ORs
in OfType(RefreshRequiredEventType): the server queues RefreshRequired
through the item's filter, so a bare condition-type clause dropped it.
Tests: RealOpcUaRefreshRequiredTests (branch, no-session tolerance, burst
coalescing, no overlap, failure tolerance, Clear, framing intact);
RealOpcUaClientAlarmFilterTests updated for the added operand.
Component-DataConnectionLayer.md documents the behaviour.
The Test Run banner in TemplateScriptDialog and SharedScriptForm claimed
External, Database and Notify all fire for real ("real emails"). Notify
is SandboxNotifyTarget, which returns a random GUID and sends nothing.
The banner now says External/Database are real and Notify is simulated,
pointing at Flow Debugger on a deployed instance for a real send. The
sandbox Send also writes a [sandbox] ... not delivered line to the
console pane. Notify.Status is unchanged (reports Unknown). Tests pin
the banner wording and the console line; Component-CentralUI.md notes
the simulated Notify.
The semantic validator treated each comma-separated argument after the
script name as a positional parameter and required the count to equal the
declared ParameterDefinitions. The runtime has no positional form: both
calls take ONE parameters object that ScriptArgs.Normalize turns into a
name -> value dictionary, so every Scripts.CallShared("X", new { ... })
was rejected unless exactly one parameter was declared, blocking deploy.
Call sites are now found with a Roslyn script-mode syntax parse (named
arguments and a trailing CancellationToken handled; calls in comments or
strings ignored). The parameters argument is classified as:
- anonymous object: validated by name (ordinal) - missing required
parameter = error, undeclared member = warning, clear literal type
mismatch per member = error (same conservative inference as before);
- any other expression (variable, dictionary, call, null): not checked;
- absent: error only if the target declares required parameters.
Required-ness comes from the shared InboundApiSchema parser (JSON Schema
'required' list; legacy array entries required unless required:false).
Positional-argument tests replaced by by-name CallShared/CallScript tests;
Component-TemplateEngine.md updated.
SmtpConfiguration.MaxRetries/RetryDelay (and ConnectionTimeoutSeconds/
MaxConcurrentConnections) drive the outbox Email policy but had no write
path, so every row sat at 0/0 and was clamped with a Warning; DEV vd03 had
to be fixed by direct SQL.
- Update/CreateSmtpConfigCommand: four trailing additive nullable fields
(null = preserve on update / entity default on create; 0 = fallback).
- ManagementActor: preserve-if-null, negatives refused.
- CLI notification smtp create|update: --max-retries, --retry-delay-seconds,
--connection-timeout-seconds, --max-concurrent-connections (>= 0).
- Central UI /notifications/smtp: fields on the form + read-only panel;
new rows pre-fill 10 retries / 60 s.
- README + Component-NotificationService; tests for apply/preserve/reject.
Component-Security "No role, no login": replace the "HTTP Basic is not covered
yet" note with the Basic and Bearer behaviour, the throttle and log details;
bearer section notes a role-less token is refused. Component-CLI: a zero-role
user sees the bad-password 401. Component-ManagementService: 401 covers it.
CLAUDE.md Security & Auth bullet updated.
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
ManagementAuthenticator — the only identity source for POST /management, the
audit REST endpoints and the debug-stream hub — now enforces "no role, no
login" the way #144 does for /auth/login and /auth/token:
- HTTP Basic: a bind whose groups map to zero roles, or whose role mapping
throws, answers the bad-password 401 AUTH_FAILED body and counts as a
LoginThrottle failure. RecordSuccess moved after the mapping, so a refusal
no longer clears earlier failures. Request cancellation still propagates.
- Bearer: a token with no role claim (minted before #144 shipped) gets the
invalid-token 401; no throttle, as for every bearer failure.
- Each refusal is logged at Warning (category ManagementAuthenticator) with
the request path, the username and the reason.
Before this, a zero-role Basic caller reached every command that
ManagementActor.GetRequiredRoles opens to any authenticated user.
DisableLogin is unchanged.
Tests: ManagementZeroRoleRefusalTests — zero roles / mapper throws / one role
over Basic and Bearer for /management (ListSites), /api/audit/query and the
debug-stream hub; every null-role command is unreachable by a zero-role
principal; throttle accounting. 47 of the 58 fail against the old
authenticator (the 11 that pass are the one-role/bypass regression guards).
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
The integration factory's in-memory configuration database is never seeded, so
it holds no LdapGroupMappings and the live GLAuth users mapped to zero roles.
LoginEndpoint_WithValidLdapCredentials_SetsCookieAndRedirects and
ActiveSession_GroupsAreReReadFromTheDirectory_AndAnUnknownUserIsEnded were
passing only because zero-role sign-in and zero-role sessions were allowed.
They now run against a factory variant whose IGroupRoleMapper mirrors the
seeded mappings (SecurityConfiguration.HasData).
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
The mid-session refresh ended a session only when the directory returned no
groups (or the user was gone/disabled/ambiguous). A user still in some groups
but in no mapped one, or whose DB mappings were all revoked, kept a signed-in,
role-less session that could read the bare-[Authorize] pages. CookieSessionValidator
now rejects when the re-map yields zero roles, on ordinary and fail-closed paths.
A mapper fault keeps its existing policy (keep grants; fail closed when asked).
Docs: Component-Security "No role, no login" (incl. the HTTP Basic gap left as a
follow-up), Component-CentralUI, CLAUDE.md.
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
A successful LDAP bind whose groups map to no ScadaBridge role, or whose role
mapping throws, is now refused at both sign-in endpoints exactly like a bad
password: the same redirect/401 body, no cookie, no token, and a login-throttle
failure (so the throttle is not an oracle). The reason is logged server-side at
Warning with the endpoint and username. Family standard: scadaproj NAM AD
cutover plan §3.2 (Phase A2, §2A).
Tests: zero roles, mapper throws, and one role for both endpoints, plus the
throttle accounting; RoutePolicyCoverageTests now notes that the two bare
[Authorize] pages rely on this rule.
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
SplitBrainResolverStrategy now defaults to leader-auto-down (the in-repo
LeaderAutoDowningProvider, #106, with the #132 shut-out restart on). auto-down and
keep-oldest stay supported. Drilled on the docker rig, docker-env2 and the QA pair
(central + site, kill and stop-and-hold) before the flip.
- ClusterOptions default + validator/HOCON comments updated.
- Shipped Host appsettings.Central/Site.json and every docker/ and docker-env2/
node appsettings now say leader-auto-down. The leader-auto-down overlays are
kept as no-ops (drill records reference them); new docker-compose.auto-down.yml
overlays keep Akka AutoDowning available for comparison drills.
- Tests: default asserts leader-auto-down; new HOCON test for an unset strategy;
TwoNodeClusterFixture defaults to the production posture.
- Docs: CLAUDE.md, Component-ClusterInfrastructure, components/Host + Cluster,
README, failover procedures, Traefik, docker + env2 READMEs; register row 70 closed.
No deploy needed: DEV, QA and both rigs set the key explicitly.
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
One key per file: ScadaBridge:Cluster:SplitBrainResolverStrategy auto-down ->
leader-auto-down in appsettings.Central.json and appsettings.Site.json, build
061432c8 unchanged. G6 boot lines on both services, health 200, MxGateway and
Z28062 at baseline, bogus key 401, Overview 6/6 Up. Downtime ~23 s central,
~30 s site. No drill: single-node clusters.
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
vq04 (active central) killed with SCM auto-restart disabled and held down 94 s:
UNREACHABLE +11.4 s, [leader-auto-down] DOWNING +26.4 s, survivor vq03 active
+26.7 s. Recovery config restored byte-identical before Start-Service; vq04 rejoined
as standby in ~4.7 s with no exit-75. Also corrects the earlier Drill A 'sampler gap'
(an awk keying error; vq04 was ready at +20.8 s).
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
Both centrals killed in turn (Stop-Process on the service PID). SCM restart in ~5 s;
the survivor downed the old incarnation at ~+9-10 s and took the active role; the
victim rejoined as standby at ~+21 s. leader-auto-down stood aside (already Down),
so its 15 s timer path was not exercised on QA. Site-pair drill still pending
(Z28061 slot, #142).
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
Component-AuditLog (Security & Tamper-Evidence now a removal note, archive format v2, config),
Component-CLI, Component-ManagementService, HighLevelReqs AL-11/AL-12, docs/components/CLI, the CLI
README, alog.md §11.4/§15 and CLAUDE.md. New production script docs/plans/sql/RemoveAuditLogHashChain.sql
(idempotent, from migration 64); AddAuditLogHashChain.sql marked superseded. Historical plans,
deployment records and deploy-prep packs are left as written.
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
Owner decision 2026-11-15, at IT security's request, pending a family-wide general solution.
Removed: the chaining service, hasher, verifier, chain head/tombstone entities and store, the #139
chain-start cutoff, AuditLog:HashChain (incl. ChainBacklog and HeadExport with its File/Syslog sinks
and export service), the audit-chain-head-export health check, the VerifyAuditChain /
VerifyAuditChainHeads management commands and the `audit verify-chain` / `audit verify-heads` CLI
commands, and the two-login plumbing (AuditLog:MaintenanceConnectionString, AuditMaintenanceContext,
the keyed audit-maintenance repository/archive). Purge, archive, retention, partition roll-forward
and backfill-source-node all run on the runtime connection again, as before #107.
Parquet archive (#42) kept, chain-free: format v2 (ten stored columns, no tombstone file, manifest
without chain state), the switch guard is the row count only (51003 gone), verify = data-file size,
SHA-256 and row count, and superseded-stale cleanup proves coverage by EventId. Format-v1 archives
still list, verify and are cleaned up (their tombstone file too).
Migration RemoveAuditLogHashChain drops the chain indexes, the scadabridge_audit_chainer role
(members first), both chain tables, ChainSeq/RowHash and the purger's AuditMaintenanceGrants grants;
writer/purger roles stay. Down restores them. Every chain-column reference is EXEC-deferred for the
idempotent script (#126); FlipAuditLogClusteredKey's two chain index statements get the same
deferral, behaviour unchanged, so re-running the idempotent script on a migrated database works.
The partition-switch staging table adds the chain columns only when the live table has them, so the
new binary purges either schema. Deploy gate: old binaries map the chain columns, so the migration
ships with the new binaries, both centrals stopped.
A leftover AuditLog:HashChain section or MaintenanceConnectionString (DEV/QA still carry
AuditLog__HashChain__Enabled=true) is ignored with one startup warning (RetiredAuditSettingsWarning).
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
CvdReactor.ProcessRecipeDownload now addresses Children["DelmiaReceiver"] on DEV vd03
and QA vq03/vq04. Redeployed DEV Z28062 + Z28061Sim, QA Z28062-Z28069; Z28061 left
stale on both tiers (shared with another team, no slot agreed). Traced read-only call
on Z28062 (ReadyFlag False): the pre-fix 'DelmiaRecv.ReadyFlag not found' warning is
gone after the fix.
apply.sh: every CLI call passes --url/--username/--password explicitly (an env-only
SCADABRIDGE_URL silently reached DEV), plus SB_EXPECT (refuse unless the expected
instances exist = tier proof) and SB_SKIP (never deploy the listed instances).
Record: docs/deployment/deployment-records/2026-11-15-gate-52-delmiareceiver-fix.md
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
QA Warm gate (lmxopcua#907, 2026-11-13): a graceful stop of the Warm Primary
reported ServiceLevel 0 for ~6 s - shorter than the 10 s degraded window - the
next unreadable sample cleared the streak, and the connection retried the stopped
node FailoverRetryCount times: Good on the peer after 66 s, peer Active in 0.2 s.
Two going-away triggers on top of #138, both still requiring a Healthy (>= 200),
higher level on the other endpoint and honouring the minimum dwell:
- ServiceLevel 0 (Part 4 Maintenance) probes the other endpoint at once instead
of waiting out the window - once per degraded streak, so a non-Healthy peer is
re-probed once per window, not every poll. Other Degraded levels (standby 90/50,
booting 1) still wait the window.
- A lost link whose session's last KNOWN ServiceLevel was < 200 (unreadable
samples don't overwrite it) probes the other endpoint before the first
reconnect attempt, holding the reconnect timer. Healthy -> switch and reconnect
at zero delay, the stopped node is never retried; otherwise the ordinary retry
cycle runs (less the probe's time). After only Healthy levels (250/240, Unset),
inside the dwell, or with the feature off: unchanged retry-then-failover.
Tests: DataConnectionGoingAwayFailoverTests (10 cases, each trigger and
non-trigger with positive controls, connect-order artifact assertions) and a real
in-process OPC UA server pair graceful-stop e2e on production defaults: 1.1 s
(lost-link trigger alone 12.1 s, neither 33.1 s -> fails the 10 s bound).
13 mutants, all killed. DCL tests 608/608 (3 full runs); solution 0 warnings.
Docs: Component-DataConnectionLayer, components/DataConnectionLayer.
Not deployed; QA live re-check pending.
Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi