#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).
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.
- 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.
The value tag of a CONDITION item now reads the tracker's derived word (most severe active nativeCode across chunks),
so Warning(B) can no longer mask a still-active Fault(A) and a same-chunk Fault(A),Warning(B) no longer reads Warning.
A skipped observation that still names its dataItemId (unparseable/missing timestamp) is reported in
MTConnectStreamsResult.MalformedDataItemIds; the index marks the item BadDecodingError and the driver publishes it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- KeepAlivePingDelaySeconds / KeepAlivePingTimeoutSeconds get form fields and round-trip
through FromRecord/ToRecord (a 0 = no-pings opt-out used to reset to 15 on any save).
- Save overlays only the form-owned paths onto the stored JSON (DriverConfigJsonOverlay,
as AbCip/AbLegacy do), so a key the form does not model survives.
- Guard test: every leaf the record serialises is an owned path.
The named-query guard's only statement boundary was ';', but T-SQL runs
';'-less batches: 'SELECT 1 COMMIT KILL 55', '... COMMIT DISABLE TRIGGER ALL ON
DATABASE', '... COMMIT SHUTDOWN WITH NOWAIT' and a TEXTPTR/WRITETEXT write were
all accepted for SqlServer AND Odbc — a COMMIT ending the rolled-back
transaction, then anything not on the keyword list.
For SqlServer, and for Odbc / no provider (backend unknown: strictest reading),
SqlReadOnlyStatement now also parses the statement with
Microsoft.SqlServer.TransactSql.ScriptDom 180.154.0 (central package pin; both
QUOTED_IDENTIFIER settings) and requires exactly one batch holding exactly one
SelectStatement, no INTO, and no OPENQUERY/OPENROWSET/OPENDATASOURCE. Odbc '?'
markers are read as variables for the parse. The lexical guard stays as a
second layer.
Tests: SqlReadOnlyStatementTransactSqlTests (11 batch strings x SqlServer/Odbc/
none, pass-through rowsets — all failed first; CTE/subquery/window/param/UNION/
FOR XML/OPTION and ODBC '?' positive controls). SqlNamedQueryTests' SQLite-backed
Odbc stand-in used the T-SQL reserved word 'top' as an alias (renamed).
Live (SQL Server 10.100.0.35,14330): SqlServerNamedQueryBatchLiveTests proves
'SELECT 1 AS v COMMIT UPDATE ...' commits the old way, the guard refuses it,
and a CTE+window+subquery+@param query reads Good; SqlServerReadTests /
write-mode / trigger suites unchanged (30/30). Class comment and
docs/drivers/Sql.md corrected.
Co-Authored-By: Claude <noreply@anthropic.com>
- ReadviseSubscriptionAsync: a reconnect completing between two subscriptions of a pass
(dropped-event resync loop had no per-iteration check) sent the next SubscribeBulk to the
NEW gateway session under the OLD session number; TryRebind refused it (SessionChanged)
and the live new-session advises were never bound or released, then duplicated by the
replay. The pass now refuses to dial once its session moved. Releasing afterwards was
rejected: once the session moved, which session issued the reply's handles is ambiguous and
old numbers are reused (#861); not dialling is the unambiguous fix.
- Dropped-event resync passes are at least 5 s apart (DropResyncMinInterval); drops reported
meanwhile coalesce into the next pass, so repeated overflow bursts no longer churn
re-advises into the overflowing channel.
- Test seams: ResyncDroppedHandlesForTestsAsync, NotifyEventsDroppedForTests,
DropResyncMinIntervalForTests; AdvisingSubscriber gained after-subscribe/unsubscribe hooks.
P-22 moved the probe's own short timeout (default 2 s) onto the probe runtime's cold
InitializeAsync too — on the native transport the TCP connect + RegisterSession + Forward
Open, which the pooled connection bounds with the driver's Timeout. A slow-but-healthy open
longer than the probe timeout never completed: the probe re-created and timed out every
tick and the host stayed Stopped. Initialisation now runs under the loop token only; the
probe timeout bounds the read.
- On libplctag each tag is its own request with its own timeout: one tag's Timeout latched
the whole device for the call, failing (and evicting) every later sibling. The latch now
fires on BadConnection/Abort/socket-IO failures always, and on Timeout only on the native
transport, where a reply timeout faults the device's one shared channel
(AbCipRefusals.LatchesDevice).
- Items latched out were never attempted: their handles are kept (evicting re-created, and
for a sole lease holder re-Forward-Opened, each one next poll). The failed item's handle is
still evicted, and a throttled cold create now latches the device so kept warm handles
fail fast instead of each paying a timeout.
- AbCipDeadDeviceBatchTests recovery leg: the device's kept warm handles answer again.
The S-8 gate (no generic mnemonic fallback once a family grammar claimed the address) made
the MELSEC D-register grammar, which claimed every D prefix, reject DI100 as a malformed
D-register. MELSEC has no DI device, so DI... is no longer claimed; every other D... stays
native and DL205's non-octal C rejection is untouched.
MicroLogix 1100/1200/1400/1500 all have L (32-bit integer) files (only the ML 1000 lacks
them, and the family flag cannot tell it apart — an ML 1000 refuses an L read itself, per
tag). SupportsLongFile: false made the P-5 per-tag rule refuse every Long tag on the family
the parser, coalescer and L-bit RMW already handle. The per-tag rejection tests now pin
PLC-5, the one family without L files. Pending hardware confirmation: one L-tag read on an
ML 1400 (Vitamine press fleet).
- _facing was keyed by runtime instance: it grew one entry per re-init (watchdog every ~90 s
while a control is down) and each new runtime restarted at Unknown, so a down control's
status flapped Stopped -> Unknown -> Stopped across every re-init. Now keyed by host:port,
pruned to the configured hosts at init and cleared at shutdown; a runtime no longer in
_devices (being stopped by re-init/shutdown) announces nothing.
- DeviceRuntime.DisposeAsync cancels the loop BEFORE closing the session: closing first woke
an in-flight read while the token was live, and the loop's normal tail set Backoff (host
Stopped) for a plain stop. Seam AfterSessionCloseForTests makes the race deterministic.
G-1 routed secured/verified writes to WriteSecured, which cannot succeed (no AuthenticateUser
identity, no supervisory advise for it, the key needs invoke:secure), and the gateway's
refusal surfaced as BadCommunicationError.
- WriteOneAsync refuses SecuredWrite/VerifiedWrite BadUserAccessDenied before AddItem/advise/
Write (one Warning per attribute, no health impact). InvokeWriteSecuredAsync removed until a
real per-caller identity flow exists.
- gRPC PermissionDenied/Unauthenticated on the write or its supervisory advise ->
BadUserAccessDenied (handle still forgotten; not counted as advise_failed).
- The classification seed is KEPT: it is what makes the refusal local. Unseeded, a secured
attribute takes the supervisory raw path and the refusal would rest on MXAccess answering
MX_E_SecuredWrite (1012) to a supervisory write, a code no live capture has shown.
- docs/drivers/Galaxy.md + Configuration.md updated.
The M-3 fix made the blank-clientId claim id random per instance, breaking single-claim
exclusivity on a redundant pair: a Secondary cold-starting before its cluster join claimed
alongside the Primary, and its stand-down OFFLINE was left retained, newer than the
Primary's ONLINE, with nothing to correct it.
- Claim id = spbhost-<12 hex of SHA-256(hostId, groupId)>: a pair shares one id (broker
takeover keeps the claim single; the evicted Primary reconnects and re-asserts), distinct
groups/hosts differ; 20 chars.
- The claim subscribes to its own STATE topic. An OFFLINE seen while the claim is held (its
own stand-down detaches first, so the echo is ignored) is re-asserted: ts <= session ts ->
republish the session's ONLINE; newer ts -> fresh claim whose timestamp out-dates it
(Sparkplug 3.0 edges ignore older STATE). Coalesced, <= 1 per 2 s. Reconnect re-subscribes
before republishing so the takeover's leftover is seen.
- MiniBroker can inject a PUBLISH and records SUBSCRIBE filters; live pair test against the
Mosquitto fixture.
At most one evaluation is pending per calc tag; a re-trigger only moves its
timestamp forward and the dependency snapshot is taken when the pump dequeues
it. Previously every dependency arrival enqueued a separate evaluation per
dependent with a trigger-time snapshot: k inputs of one cycle ran k times
(publishing intermediates computed from mixed old/new inputs) and the queue had
no bound when triggers outpaced the pump. The out-of-process batch pump now
dequeues every pending tag once per batch.
- 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.
- 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.
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.
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.
#944: a snapshot/QueryActiveAlarms lists active alarms only, so a Clear dropped while the
host's OnAlarmEvent handler was detached (or the stream was down) was never recovered. The
driver records which alarms it delivered as active; on a COMPLETE read (sentinel or re-read,
new IGalaxyAlarmFeed.ActiveSetDelivered, raised under the dispatch lock) it synthesises a
restatement Clear for told-active alarms of the live subscription the read does not name,
before the known-state signal. A re-read counts alarms the live stream restated meanwhile as present.
#945: provider_status / snapshot_status no longer fall to the decode-failure default (logged +
counters). A snapshot flagged truncated (snapshot_status or per-record flag) is not complete: no
sweep, no known-state signal; when the gateway clears the verdict the driver re-reads.
Co-Authored-By: Claude <noreply@anthropic.com>
#946: AlarmRefreshRequiredMinInterval (default 10 s, 0 disables) spaces RefreshRequired-triggered ConditionRefresh sweeps per session; a request inside the window is deferred to its end and coalesced, never dropped.
#947: AcknowledgeAsync throws the breaker-exempt DriverOperationRefusedException for Bad per-ack statuses and unresolvable condition ids (BadConditionBranchAlreadyAcked is success) so the #760 revert fires. Docs reverse the O-8 decision.