Commit Graph

5579 Commits

Author SHA1 Message Date
Joseph Doherty de185802d7 Merge #996: Deployment reads skip ArtifactBlob, narrow data-connections loader, coordinator ack writes off-thread, AdminOps I/O off mailbox, HistoryReadEvents page cap, reservations page bounded 2026-12-03 10:59:06 -05:00
Joseph Doherty ea976ffa81 fix(perf): #996 Wave 4 — blob-free health probes, narrow data-connections load, off-thread coordinator acks + AdminOps audit, events page cap, capped reservations page
C-6: DeploymentQueries projects Deployment without ArtifactBlob (DbHealthProbe, readiness, ClusterOverview, DriverHost boot).
C-11/A-5: DraftSnapshotFactory.FromConfigDbForDataConnectionsAsync + one-parse-per-artifact LoadAppliedAsync + capped pickers.
H-6: ConfigPublishCoordinator persists acks off the actor thread (AckPersisted); deadline backlog kicked in parallel.
H-3: Restart/Reconnect reply = dispatch; ConfigEdit audit written off-mailbox, failure logged not surfaced.
U-6: ServerHistorian:MaxEventsPerRead (default 10000) pages HistoryReadEvents; advertised as MaxReturnEventValues.
A-8: /reservations active-only by default, projected, capped at 200.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-12-03 10:58:50 -05:00
Joseph Doherty 9d3d0f3ae9 Merge #997: UNS duplicate sibling names friendly + race-safe, Galaxy ack password kept on blank, reaper drains on stop, silent node telemetry not redialled, key delete reloads 2026-12-03 10:52:36 -05:00
Joseph Doherty 3773509888 fix(adminui): #997 duplicate sibling names, Galaxy ack password blanking, browse reaper drain, silent-node telemetry dial, key-delete cleanup now behave correctly
A-3: UnsTreeService pre-checks sibling (cluster,area,line) names on create/update/import, catches DbUpdateException, validates column lengths.
A-4: blank ack password keeps the stored one; first-time blank refused.
A-6: BrowseSessionReaper drains sessions in a finally on shutdown.
A-7: node flushes response headers; central treats them as established; deadline warning throttled.
A-9: key delete always reloads and names leftover ack secrets when cleanup fails.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-12-03 10:52:19 -05:00
Joseph Doherty 3cc05b92c1 Merge #998: ZTag/SAPID + historian-tagname duplicate gate rules, DanglingReference rule, filtered unique indexes fixed, RowVersion on ClusterNode/ServerCluster 2026-12-03 10:50:14 -05:00
Joseph Doherty 486628cf0a fix(config): #998 deploy gate rejects duplicate ZTag/SAPID, duplicate owned historian tagnames and dangling parent links; NULL-keyed unique indexes enforced; node/cluster edits carry a RowVersion
C-3 ZTag/SAPID uniqueness enforced from the draft (reservation ledger has no writer); UI/doc claim corrected.
C-5 HistorianTagnameDuplicate (owned tags, per cluster, case-insensitive; readOnly exempt).
C-8 UX_NodeAcl_PrincipalScope / UX_LdapGroupRoleMapping_Group_Cluster unfiltered (migration with duplicate pre-check) + friendly service/page checks.
C-9 RowVersion on ClusterNode/ServerCluster, edit pages use it; node delete removes its NodeDeploymentState rows.
C-10 DanglingReference rule; dead PathTooLong/EquipmentUuidImmutable rules + PriorEquipment/Enterprise/Site inputs deleted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-12-03 10:49:57 -05:00
Joseph Doherty 6822fd3f5c Merge #977: restart restores last Applied deployment, planner covers every composition field, degraded/revision/restart bookkeeping, superseded deployment closed 2026-12-03 10:47:07 -05:00
Joseph Doherty a0f41a30d8 fix(deploy): #977 deploy/apply bookkeeping — planner sees every composition field, degraded/restarted applies repair, failed deploys restore the last applied revision, superseded deployments close
- 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>
2026-12-03 10:46:47 -05:00
Joseph Doherty 209dd955b0 Merge #1000 + #1001: Client.Shared failover keeps retrying + map reset + batched subscribe; OTOPCUA0001 covers acquisition + write-outcome capabilities 2026-12-03 10:46:28 -05:00
Joseph Doherty 291be3c55c fix(client): #1000 failover retries with backoff, reconnect clears the subscription map, subscriptions batch into one round trip
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.
2026-12-03 10:46:13 -05:00
Joseph Doherty 8e57311f97 Merge #993: Gateway read refusals keep historian healthy, QuestDB capped reverse events read finds its cut first, allocation-free time-weighted aggregate, QuestDB fixture visibility wait 2026-12-03 10:40:49 -05:00
Joseph Doherty 2f6f41441a fix(analyzers): #1001 OTOPCUA0001 now guards IAcknowledgedAcquisitionSource and IWriteOutcomeCapability
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.
2026-12-03 10:40:04 -05:00
Joseph Doherty aecd2461c1 Merge #991: Galaxy secured-write map filled at init, dropped pump events resync, deploy-watch backoff, replay-gap handle release, HTTP/2 keep-alive on driver channels 2026-12-03 10:36:36 -05:00
Joseph Doherty b9955f6946 Merge #988: MQTT bad filter isolated per tag, Sparkplug primary-host unique id + re-claim, rebirth counter fixed, subscribe replay race, browse honours refusals 2026-12-03 10:35:43 -05:00
Joseph Doherty edec69eed0 docs(galaxy): #991 secured-write seeding, dropped-event resync, gap handle release, keep-alive channels, quality limit bits, deploy-watch pacing 2026-12-03 10:35:25 -05:00
Joseph Doherty 028e68edb0 fix(mqtt): #988 one bad filter/tag no longer takes the driver dark; Sparkplug rebirth cap, primary-host claim and browse verdicts behave correctly
- M-2: malformed topic filters are rejected at the reader + deploy gate (MqttTopicFilterRules);
  the manager re-checks, chunks SUBSCRIBEs at 100 filters and bisects content refusals only.
- Found while pinning M-2: retain handling rides only a 5.0 SUBSCRIBE; on 3.1.1 one
  retainSeed:false tag made MQTTnet refuse the whole batch.
- M-1: metadata rebirths capped per scope, counted when sent, re-armed only by clean data
  (not by the NBIRTH a request provokes); gap rebirths escalate to 5 min after 3 in a row.
- M-3: blank clientId => random per-instance spbhost-<12 hex> claim id (was literal -spbhost).
- M-6: a Faulted/Disposed claim connection is not held; it is disposed and re-claimed.
- M-9: subscribe-time replay re-raises a value pushed mid-replay (plain + Sparkplug).
- M-11: same-type Sparkplug arrays are served by copy, not boxed element by element.
- M-12: span JSONPath walk; span pre-filter for unauthored Sparkplug nodes; guarded Debug
  logs; WarnOnce without ConcurrentDictionary.Count.
- M-13: handles a later subscribe fully took over are retired.
- M-14: browse open fails on a refused CONNACK or root SUBACK.
- M-15: Scalar/Raw booleans publish true/false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 10:35:21 -05:00
Joseph Doherty afaf6b97d5 fix(galaxy): #991 G-19 gateway channels send HTTP/2 keep-alive pings so a silently dead connection faults the event stream 2026-12-03 10:34:51 -05:00
Joseph Doherty c6dec9ed7f Merge #974 + #987: dialect-aware Sql read-only guard + read-only execution (13 bypasses closed), provider-semantics key matching, trigger-safe SQL Server rowcount 2026-12-03 10:34:08 -05:00
Joseph Doherty 65c4330a68 fix(sql): #974 #987 named queries are lexed per dialect and run read-only + single-statement; key rows attribute by server semantics; SQL Server writes count only the target statement
#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.
2026-12-03 10:33:45 -05:00
Joseph Doherty 23867ed9d7 Merge #979: refused write reverts to last confirmed value (raw+UNS); dependents of a removed input go BadWaitingForInitialData 2026-12-03 10:30:00 -05:00
Joseph Doherty e0f133f640 fix(runtime,opcua): #979 refused overlapping writes revert to the last confirmed value; dependents of a removed input go BadWaitingForInitialData
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).
2026-12-03 10:29:38 -05:00
Joseph Doherty eef278fc3b Merge #978: one UNS leaf-name authority (modal = service = deploy gate), script-existence gate + in-use delete guard, VirtualTagHost skips invalid tags 2026-12-03 10:28:50 -05:00
Joseph Doherty d66aa5e9ff fix(galaxy): #991 G-5 the per-event subscriber lookup no longer allocates and the pump reuses one handle per subscription 2026-12-03 10:28:36 -05:00
Joseph Doherty d2818e2ef2 fix(uns): #978 one UNS name authority and a script-reference gate — an illegal VirtualTag name or override is refused in the editor and at publish, and an in-use script cannot be deleted
- 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.
2026-12-03 10:28:27 -05:00
Joseph Doherty 9ba33e7caa fix(galaxy): #991 G-1 authored SecuredWrite/VerifiedWrite tags route to WriteSecured without DiscoverAsync (security map seeded at init and on redeploy) 2026-12-03 10:25:53 -05:00
Joseph Doherty dd1d02e25f fix(historian): #993 gateway read refusals no longer degrade health, QuestDB reverse events read finds its cut by backward scan, time-weighted aggregator stops allocating per sample
G-9: a gateway-answered InvalidArgument/OutOfRange/NotFound/Unimplemented read is a connectivity observation (open, streak ends), not a failure; outages still degrade.
G-17: capped reverse/end-only QuestDB events reads find the n+1-th latest ts with an early-exit backward scan, then read ts >= cut ordered (ts DESC, event_id DESC).
G-18: Distribute takes a bridged/nonGood flag instead of per-sample delegates (O(buckets) allocation).
QuestDB integration fixture waits up to 60 s for WAL visibility (shared host is CPU-saturated; the 5 s production default made alarm-writer tests read back fewer rows).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-12-03 10:24:50 -05:00
Joseph Doherty bf0440776b fix(galaxy): #991 G-4/G-6 a change dropped by the full event channel is re-advised once it drains; same-session re-advises release the handles they supersede 2026-12-03 10:21:52 -05:00
Joseph Doherty f47ff00c92 Merge #992: OpcUaClient indexed recovery re-publish, safe unsubscribe ordering, Bad publish for refused refs, post-dispatch BadTimeout, IPv6 probe preflight 2026-12-03 10:21:21 -05:00
Joseph Doherty 888bc73c0d fix(opcuaclient): #992 G-10..G-15 recovery re-publish indexed, unsubscribe ordering, subscribe refusals published Bad, non-condition events dropped, post-dispatch write failures BadTimeout, dual-mode probe preflight
Co-Authored-By: Claude <noreply@anthropic.com>
2026-12-03 10:21:07 -05:00
Joseph Doherty d82d0ff1f3 Merge #971: script sandbox is an allow-list; narrowed BCL reference set (K-1 closed) 2026-12-03 10:18:28 -05:00
Joseph Doherty 9d1e6e8b86 Merge #989: MTConnect condition last-wins in /sample, subscription release on shutdown, restart re-baseline, parser skips bad observations, subscribe/unsubscribe races 2026-12-03 10:16:27 -05:00
Joseph Doherty af32984383 fix(mtconnect): #989 condition word last-wins on /sample, subscriptions released on shutdown, read-path restart re-baselines, malformed observation skipped not fatal, replay cannot overwrite a newer value, unsubscribe cannot kill a concurrent subscribe's pump
Review 2026-12-02 M-4, M-5, M-7, M-8, M-9 (MTConnect half), M-10.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-12-03 10:16:12 -05:00
Joseph Doherty 660a2ce9c0 fix(galaxy): #991 G-2/G-3 limit-bit qualities map without a per-event warning; a cleanly completed deploy-watch stream is re-subscribed with backoff 2026-12-03 10:15:00 -05:00
Joseph Doherty abdb8f3ab0 Merge #975: AdminUI re-validates role grants every 5 min (cookie + open circuits), absolute session cap 2026-12-03 10:13:08 -05:00
Joseph Doherty 019ba96376 fix(adminui-auth): #975 AdminUI roles are re-validated on a timer (cookie OnValidatePrincipal + revalidating circuit provider); demoted users lose elevated policies within the window 2026-12-03 10:12:54 -05:00
Joseph Doherty a97e85e06c Merge #986 + #990: S7 bad write values are refusals; Heidenhain dispose/backoff/login-retry fixes 2026-12-03 10:12:40 -05:00
Joseph Doherty cfd453ae34 fix(heidenhain): #990 deterministic control-loop stop, stable down-host status, throttled optional-role login, backoff survives re-init 2026-12-03 10:12:29 -05:00
Joseph Doherty c00ebf1320 fix(scripting): #971 the script sandbox is an allow-list — the K-1 bypasses (CreateDelegate, Expressions, XML/Tar I/O, X509Store, Timers/BackgroundWorker/AsParallel, Serilog.Log) are refused
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>
2026-12-03 10:09:39 -05:00
Joseph Doherty 89c7f5d49c fix(s7): #986 out-of-range/unconvertible scalar write values report BadOutOfRange/BadTypeMismatch without degrading health 2026-12-03 10:06:52 -05:00
Joseph Doherty be5641fc06 Merge #985: FOCAS closes session on protocol desync, refusals keep health, dead CNC no longer stalls others, slot indexes kept 2026-12-03 10:05:04 -05:00
Joseph Doherty e68d856fcb fix(focas): #985 refusals stay Healthy, protocol faults close the session, dead CNCs no longer stall others
- P-6: the wire adapter throws refused fixed-tree calls as FocasWireException carrying the rc
  (was InvalidOperationException, so a refusing control looked silent, degraded and was
  reconnect-looped by the #527 watchdog); a refused axis is per-node BadNoData and the tick continues.
- P-7: bootstrap capability probes latch only an ANSWER (rc, or session still up); a transport
  failure/timeout or a session dropped mid-pass retries the bootstrap.
- P-21: CoalesceRejected latches only range-shaped codes (not EW_BUSY/EW_SOCKET/EW_UNEXP/EW_HANDLE/unknown).
  Macro/param multi-block batching deferred (unproven on hardware).
- P-10: any fault once a request is on the wire closes the session (bad magic/version, unexpected
  PDU, malformed blocks); replies must echo the request's command ids in order (verified against
  every 31i-B capture). A refusal never closes the session.
- P-8: close handshake bounded to 1 s and run under the request gate (sync + async dispose).
- P-11: data-path callers check the backoff before ConnectGate and fail fast behind an in-flight
  reconnect to a device whose last connect failed.
- P-9: axes/spindles carry their wire slot (FocasAxisName/FocasSpindleName.Slot); cnc_rddynamic2 and
  the spindle-meter lookup use it.
- P-20: a truncated (>= 32) alarm list never clears/retriggers a told-active condition unless it
  shows a new key; unseen told keys are kept.
- P-25: a refused connect-time sysinfo is not cached; a short PARAM payload reads BadTypeMismatch.

Tests: loopback MockFocasWireServer drives the real wire client; every fix mutation-checked
(reverting it fails its test). FOCAS.Tests 619/619, FOCAS.IntegrationTests 19/19 vs the sim on
10.100.0.35, Runtime.Tests FOCAS 7/7, FOCAS.Cli.Tests 57/57.
2026-12-03 10:04:42 -05:00
Joseph Doherty 864843e4d9 Merge #982: TwinCAT re-resolves symbols after online change/download, dead device fails fast, refusal ≠ comms fault 2026-12-03 10:04:34 -05:00
Joseph Doherty 0eb620a223 fix(twincat): #982 symbol-table changes re-resolve on a fresh client; one dead device no longer stalls the rest
Review 2026-12-02 (09-ab-twincat-focas.md) TwinCAT findings:

- P-1: a stale client (ADS symbol-version event, a 1809, an invalidated
  notification, a probe non-Run -> Run transition, or a moved OnlineChangeCnt
  sampled every healthy probe tick) is never handed out again: the next call
  retires it (fresh Beckhoff symbol cache), native registrations replay on the
  fresh client (background or probe tick), its pushes are dropped, refused
  registrations re-arm, rediscovery is raised once per event. Verified against
  decompiled Beckhoff.TwinCAT.Ads 7.0.172: SymbolCache cleans itself only on
  the symbol-version event, which an online change does not raise.
- P-3: devices are read concurrently; the first comms failure on a device is
  checked against its ADS state once - gone => remaining tags fail fast with no
  wire attempt, alive => per-tag failure. Probe-unreachable devices fail fast;
  native subscribe applies the same rule.
- P-4: the probe connects without replaying registrations, probes, and
  re-registers only after the device answered; a replay against a dead device
  stops dialling it; one Warning per device per outage, Bad published once.
- P-12: unlisted device-layer ADS codes (0x700-0x73F) map to BadDeviceFailure
  (refusal, no health write, refusal backoff); 1817 DeviceTimeOut = BadTimeout;
  marshal/type read exceptions = BadTypeMismatch; the read guard refuses a
  scalar over a struct/FB (pointers/references still read as their address).
- P-19: symbol name / bit index pre-computed at init; health re-derived once
  per device per read call (health updates now serialised under a lock).
- P-22: the ADS client always carries the driver Timeout; the probe bounds
  only its own ReadState with Probe.Timeout.
- P-25: bit-indexed BOOL poll reads resolve the parent and read it at its own
  width; poll / notification / write agree on BadOutOfRange / BadTypeMismatch.

Tests: TwinCATReview20261202Tests (39 cases; the behavioural ones failed before
the fix). TwinCAT.Tests 712/712.
2026-12-03 10:04:09 -05:00
Joseph Doherty 77ba6d5f2b Merge #976: historian outages never dead-letter alarm history; gateway transient codes retry; outbox ack never drops an unindexed append 2026-12-03 10:03:50 -05:00
Joseph Doherty 07ee9e4888 fix(historian): #976 a historian outage no longer dead-letters alarm history, and an outbox ack never truncates an un-indexed value
G-16 / K-2 (LocalDbStoreAndForwardSink): a RetryPlease counts toward MaxAttempts only on a
drain where some event was Ack'd. A drain with no Ack is an outage: RetryPlease rows are left
untouched (no attempt, no dead letter), the backoff climbs to its 60 s cap, LastError reports
the deferral; PermanentFail rows still dead-letter. An outage longer than ~6.5 min used to
dead-letter the oldest queued alarm events, 100 more every ~10 min.

G-8 (GatewayAlarmHistorianWriter): only InvalidArgument/FailedPrecondition/OutOfRange/
NotFound/AlreadyExists/Unimplemented and unmappable events are PermanentFail; Cancelled,
Unknown, DataLoss, every unlisted code and every non-RPC transport exception retry (the
default used to be dead-letter, so a gateway restart dead-lettered a whole drained batch).

G-16 secondary (AlarmBatchWrite, both SQL writers): a multi-event chunk failing with an
error that is neither a recognised data error nor a known transient is re-sent event by
event, so one unrecognised poison event no longer drags its chunk-mates with it.

G-7 (FasterLogHistorizationOutbox): RemoveAsync of the newest indexed entry truncates to
that record's own end (recorded by the peek, else a one-record scan), never to the live
tail that may already hold an enqueued-but-unindexed append; peeks return only indexed
records so every peeked entry can be acked.

Tests: simulated multi-hour outage (fake clock, 200 drain cycles) loses 0 events and
drains in order on reconnect; positive controls for PermanentFail and a RetryPlease-forever
poison row getting exactly its MaxAttempts budget; gRPC/transport classification theory;
AlarmBatchWrite isolation + known-outage control; G-7 parked-append race + peek-only-indexed.
2026-12-03 10:03:25 -05:00
Joseph Doherty 03e85ab752 Merge #972: ACL revalidation honours Security:Acl:Enabled=false (no flag-off stand-downs); dead SecurityFilteringActive removed 2026-12-03 10:01:19 -05:00
Joseph Doherty 40637b9954 Merge #983: AbCip dead device fails fast, BOOL arrays read in DWORDs, throttled logging, RMW lock + probe fixes 2026-12-03 10:00:15 -05:00
Joseph Doherty 85d479e23e fix(opcua-acl): #972 revalidation no longer stands down subscriptions while Security:Acl:Enabled=false
IsSubscriptionStillPermitted now asks Permits(identity, CreateMonitoredItems, node) — the creation
gate's own seam and the one place the flag-off bypass lives — instead of the bypass-less
IsAllowedCached. Since 8ad03e9c5 the pass ran with the flag off (SecurityFilteringActive's
'|| NamespaceIndexes.Count >= 4' term was always true: five namespaces are always registered) and
stood every ungranted/Anonymous subscription down within 60 s or on the next deploy (review U-1).

- SecurityFilteringActive deleted: it was a dead toggle, and the gated request paths it guarded are
  also the projected-data routing path; Permits alone decides the flag.
- pass-local verdict memo keyed by namespace index (realm folded projected/imported ids into Raw/UNS).
- _authorizer null-guarded in the pass (no authorizer wired => no NRE).
- AclRevalidationTimer / AclOptions remarks, docs/security.md and the data-plane-auth rule corrected.

Tests: unit flag-off (keyed + Anonymous, empty authority, no authorizer) x5 passes with a flag-on
positive control; wire flag-off data + folder-event subscriptions survive 5 ticks + a no-grant deploy,
with flag-on controls on the same items.
2026-12-03 10:00:02 -05:00
Joseph Doherty e6ca58148b fix(abcip): #983 packed structure reads, non-blocking lease release, allocation trims, docs (P-24)
Structure reads of a known size pack into one MSP; browse/template lease release no longer
blocks a thread-pool thread up to 2 s; scheduler packs with running totals; CipReply empty
extended-status array shared. AbCip.md documents P-2/P-13/P-16/P-22/P-23/P-24.
2026-12-03 10:00:00 -05:00
Joseph Doherty 7d6cf97fdd fix(abcip): #983 RMW lock keying + whole-word lock, bit selector 0-63, interval floors, cycle guard on struct type, browse surfaces transport faults (P-23 a-e) 2026-12-03 09:55:25 -05:00