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.
- 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>
#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>
- 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.
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.
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.
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.
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.
P-5 Long on MicroLogix/PLC-5 is BadConfigurationError per tag (init no longer throws), deploy gate warns via family-aware Inspect.
P-14 Bit array wire read sized in 16-bit words. P-15 Bit without /n RMWs bit 0; Bit on non-bit file refused.
P-18 native T/C/R sub-elements coalesce into one whole-element block read.
P-23f local OutOfBounds/TooLarge no longer count as answers, element/file >65535 is malformed; g block read re-resolves under the gate with identity-checked eviction; h null scalar write BadTypeMismatch.
Closes the A-1 SSRF: ?node= / the typed box resolved straight into an Akka ActorSelection, so any
signed-in user could make the admin node open a remoting association to an arbitrary host:port.
Page policy stays AuthenticatedRead (same tier as /fleet and /hosts). Akka untrusted-mode audit
recorded in docs/security.md as an open follow-up.
Scheduler faults everything queued behind a failed channel exchange; per-device read
windows plus a per-call fault latch fail a dead device's remaining items fast; throttled
creates no longer throw+log per tag (one Warning per device per outage, Info on recovery).
H-1: ActorSystemTerminationWatchdog flushes logs and exits the process with code 1 instead of StopApplication (clean SCM stop never triggers sc failure recovery).
H-2: AuditWriterActor re-buffers a batch when the DB did not answer; bounded 10k drop-oldest with counter; threshold flush suppressed while failing.
H-5: DedicatedListenerGuard throws instead of log-and-zero when an HTTPS binding blocks a requested dedicated h2c listener.
S-1: ModbusRtuOverTcpTransport.SendOnceAsync tears the socket down on any exit after the write
without a validated reply (caller cancellation included), so a late reply can no longer answer
the next request at Good. S-2: SubscribeAsync/SubscribeAcquisitionAsync drop the deadband
baselines of their refs before polling starts. S-8: a family-recognised prefix whose body the
family parser rejects no longer falls through to the generic mnemonic table.
#968 made OtOpcUaNodeManager.TryResolve/TryResolveForRenewal re-evaluate a
definition replaced mid-check, but at most 16 times. A reader preempted while a
renewer swapped the definition back to back exhausted the bound and answered
'no such node' for a live node, which tears a physical stream down
(A_definition_replaced_by_a_renewal_never_resolves_as_missing failed 22/280
under load, on master too).
The bound is removed; the double read stays (it is what stops a removed node
being answered). The loop provably ends: the committed map compares values by
reference, so a retry happens only when a replacement of THIS node was
committed during that pass. Iterations are at most 1 + the replacements
committed during the call (lock-free progress; commits are serialized under
Lock and each needs a renewal or page apply); a removed node or a disposing
manager ends it at once.
Regression: A_lookup_outlasting_many_back_to_back_replacements_never_resolves_as_missing
(deterministic: the definition's authority check commits a replacement each time
it is evaluated, 64 times in a row; red on master, green now). Stress at the
same load: 280/280 runs of the 5 renewal tests pass (master: 22/280 failed).
Two Subscribe cadences of one node reach the renewal window on the same tick
and each ran its own overlap renewal of the same predecessor: two origin
metadata calls, and the second commit adopted the first's successor yet
replaced the node's committed definition again (harmless since #968, wasted).
ProjectedDataAccess now keeps in-flight cadence renewals per predecessor proof
(reference identity, same node). A cadence that finds one waits for it; a
committed shared renewal is its success too (it adopts the committed successor
exactly as the existing already-committed shortcut does, its own caller
re-authorized by TryPrepareBinding). A shared renewal that did not commit is no
verdict: the joiner renews for itself, so one cadence stopping or being refused
only delays the other. No sink interface change.
Tests: Concurrent_cadence_renewals_of_one_predecessor_share_one_metadata_call_and_one_commit
(red: 2 metadata calls; green: 1 call, 1 definition replacement, both streams
kept) plus a variant where the shared renewal fails and the joiner renews
itself. The #968 adoption wire test keeps exercising the unshared path via a
test switch.
OtOpcUaNodeManager.TryResolve/TryResolveForRenewal read the committed
definition map twice and answered false when a renewal replaced the
definition between the reads. Every subscription demand check racing a
renewal could then see its live node as gone and tear its physical stream
down (freshness check breaking the attempt, 'Source unavailable' on the
rebind baseline). Two cadences of one node made it likely: both renew on
the same tick and the second, redundant renewal replaces the definition
again while the first cadence rebinds - the residual ~1% hang of
Two_sdk_cadences_renew_before_expiry (the barrier timeout was a victim).
A lookup now re-evaluates a definition replaced mid-check (bounded).
Regression: A_definition_replaced_by_a_renewal_never_resolves_as_missing
(red: ~19% of lookups racing renewals answered missing), plus a wire test
for two cadences committing the same successor.
- ProjectedDataAccess: internal queued/handled renewal-tick counters (RenewalTicksQuiescentForTests) so a test can wait until every tick a clock advance fired has been handled.
- ManualTimeProvider.AdvanceInOneStep: all timers see the final instant (successor lease is stamped from request start).
- Live_predecessor_cadence...: Task.Delay(20/100) pacing replaced by advance-and-settle; 10 s waits widened.
- Two_sdk_cadences...: 9 s jump in one step (deterministic successor issue time, fixes the 7.45 s margin flake); read each item's notifications until its expected value (8 vs 9 flake); barrier timeout widened.
Residual ~1% hang tracked in #968.