M1: a scripted method whose request deadline leaves < the dispatch floor, or that
follows an unanswered scripted method in the same Call, is refused BadTimeout in
its handler (unsent, unapplied); OpcUa:Quotas:MaxNodesPerMethodCall = 1000.
M2: ExecuteAlarmCommand carries the asker's deadline; an expired ask skips the
engine and is not remembered (the broadcast copy applies).
L1: revert guarded by a per-condition mutation counter; raw severity restored.
L5 + nits: docs, stale comment. SDK check: no Part 9 handler calls our delegate
before its own validation.
Co-Authored-By: Claude <noreply@anthropic.com>
1. A post-dispatch refusal now puts the node back to its captured pre-call state
with one corrective event (skipped when the node changed since) — the SDK had
already applied and reported the change. Blank scripted AddComment is refused
in the handler before the SDK runs.
2. ScriptedAlarmCommandDispatch: ask the local engine first, broadcast to the peer
only on Applied/OutcomeUnknown — a refusal now reached no engine anywhere.
3. ApplyAsync no longer checks 'loaded' before _evalGate: a command racing the
first load queues behind it; never loaded => refusal (nothing applied).
4. One Call's requests are settled sequentially (no request runs against a node
state the engine refused); <= 64 asks in flight node-wide, else
BadTooManyOperations before anything applies; per-request bound starts at send.
Measured 300 acks through one host + LocalDb: 59 ms sequential, max 24 ms/ask
with 64 outstanding.
5. Mixed-batch wire test (scripted refused + native + imported + scripted applied
+ core-manager method): per-item status in order, one scripted ask at a time.
L6: readiness from the engine's HasCompleteGeneration on a load fault.
L7: the verdict slot is closed when its SDK call returns (timer-captured
AsyncLocal can no longer park an ask). L10: remote budget never stretched.
Co-Authored-By: Claude <noreply@anthropic.com>
ACompletedApply_NeverReportsAWedge failed whenever it ran first in its process: the
wedge timer was armed BEFORE the synchronous UpsertNodeDeploymentState(Applying), and
the cold EF Core model build on that first write (~350 ms) outlasted the 200 ms delay,
so the tick was enqueued ahead of the fetch's pipe-back and reported an immediately
answered fetch as WEDGED. The watchdog now arms immediately before the read/fetch starts
on both begin-paths, so it times what its Warning claims. New deterministic red/green
test ASlowApplyingRowWrite_IsNotReportedAsAWedgedFetch (row writes slowed to 4x delay).
OpcUaPublishActorWarmTests cluster-mode-mismatch test compared against
OtOpcUaTelemetry.RedundancyModeMismatch inside InstrumentPublished; when the static
initializer ran under the live listener the field still read null, so the counter was
never enabled. Capture the counter into a local before creating the listener.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- OpcUaPublishActor: deferred alarm states, qualities and condition marks replay as one
arrival-ordered list (a withdrawal followed by a re-establishing transition ended
unknown); marks held per (realm, condition) so withdrawals are bounded by the condition set
- OpcUaClientDriver: signal/withdraw re-check the registration under _alarmStateLock;
removals take the lock
- DriverHostActor: a withdrawal under a raised F5 diagnostic updates its count
- docs: Unsignalable/backstop residual; AlarmInitialStatePublished must stay in-process
- tests: arrival-order replay (+ mirror), backstop positive control, F5 count
Root cause of the Failed_sdk_item_construction flake: a failed SDK item
construction disposes its demand while the stream pump publishes that
registration's snapshot. The duplicate-baseline check read the dying demand's
IsValid as 'cache not fresh', so the same acquisition was re-published as a new
complete baseline to every item on the node, leaving an orphan proof candidate
(and shared budget charge) the SDK never consumes. HasFreshCachedLocked no
longer depends on demand validity; Publish re-checks the demand after it.
Regression test with a pump seam: red without the fix, green with it.
Bad_null different_timestamp flake is a test race: SDK 2.0.1 delivers node
changes to items asynchronously (MonitoredNode2 channel), so the published
sample could land after the mode cycle and overwrite the injected
notification. The test now waits until the SDK queued it.
- a sequence gap outside a bracket is a loss (re-refresh, same budget); older/repeated
sequence numbers are ignored and not recorded
- AlarmInitialStateEventArgs.Withdrawn (additive): the driver withdraws 'known' once per
signalled episode on its first loss; DriverHostActor sends MarkConditionsKnown(Known:false)
for those conditions, drops them from the backstop and re-arms F5
- a RefreshStart while a bracket is open is a loss (never erases the open bracket's)
- a failed ConditionRefresh call is retried through the same bounded retry
- retry generation token (a finished retry never clears a newer retry's pending flag)
- spent budget renews after a 5-min cool-down; RefreshRequired sweeps coalesced
Red/green per fix (7 mutations) + live opc-plc gate re-run.
Before: the alarm-commands topic is fire-and-forget, so an OPC UA method (and a
remote gRPC-data condition method) returned Good even when the engine rejected
the command because its last load failed.
- ScriptedAlarmCommandReadinessView: the host's latest load outcome; the node
manager's handler refuses BadInvalidState before the SDK applies anything
while the last load failed (lock-free read).
- Bounded ask: inside CallAsync (off Lock) each local request runs base.Call
alone; the handler only STARTS AlarmCommandAsker (broadcast for the peer +
DriverHostActor -> ScriptedAlarmHostActor.ExecuteAlarmCommand on the local
engine, CommandId-deduplicated) and the Call awaits the verdict: refused =>
BadInvalidState, no answer => BadTimeout OutcomeUnknown.
- Remote CallConditionMethod: ExecuteConditionMethodAsync => DriverConfirmedFailure
/ OutcomeUnknown on the origin.
- Host ownership uses the latest plan set (stable across a load in flight and a
failed load's half-built set).
- Docs: ScriptedAlarms.md (verdicts, residual, duplicate-activation trade-off),
DataConnections.md, rules/alarms.md. Live leg scenario F937 + seeder
scripted_predicate mutation.
Co-Authored-By: Claude <noreply@anthropic.com>
#916: Metadata.stable_source_id carried the internal acquisition key
(<len>:<driverInstanceId><RawPath>) on every export, so a UNS-only peer learned
driver ids and RawPaths. No consumer uses the field beyond byte accounting; it is
optional on the wire and absent decodes as null. It is now never sent; the
internal BackingSourceKey is unchanged.
#917: alarm-bearing raw tags never get a value but were exported as Variables.
They are now the existing explicit UnsupportedVariable kind (browsable,
Unsupported on every value op). The node is kept so exports rooted at it still
compile and A1 condition placements are unaffected.
The real-origin v1 goldens are not re-recorded: GrpcDataV1RealOriginCorrections
applies exactly these two edits to the parsed goldens, pinned by a test.
Evidence: docs/plans/evidence/grpc-data-ext/V1-916-917.md
S1: a held key that a transiently unknown mapping listed itself (_lastListed) is
held without a bound; only a definitive refusal of that mapping (Denied /
NotFound / Unsupported / ConditionCapacity, remembered across retries and stream
ends) starts its MaxUnknownHold clock. Consistent with a never-opening stream.
S2: the hold clock runs only while a stream is past its barrier (paused at the
stream end, shifted at the next barrier).
N1: in-stream root re-resolves run under a per-stream source cancelled when the
stream ends. N2: no held-expiry timer without a sink (spin). N3: MaxUnknownHold
must be positive. N5: #933 test lower bound taken before the hold starts; tests
for S1, S2, N1, N2, N3 and a second failed re-resolve — each red on revert.
RetryDueAsync awaited the root metadata request (10 s budget) inside the
frame loop, stalling every mapping's frames on that connection while the
origin's metadata was slow. The request now runs as a task (FetchRootsAsync
reads only the immutable root views); the task joins the loop's wake set
beside the retry timer, and its answer is applied on the loop
(ApplyResolvedAsync: RootView or MarkRefused, then the re-add). All runner
state stays loop-owned. While resolving the mapping is Unavailable (unknown,
T2) and is not re-scheduled. Test: a hung second metadata call no longer
blocks another mapping's delta; releasing it re-adds the item exactly once.
A key no known mapping lists was kept stale for as long as ANY mapping of the
connection was unknown; a durably Denied/Unavailable mapping therefore kept
retired conditions forever. Scoping the hold to mappings that could list the
key is not provable on the consumer (placements are origin deploy-time config;
a dropped key may have moved into the unknown mapping's root), so the hold is
time-boxed per key: ProjectedConditionOptions.MaxUnknownHold (20 min) — past it
the key is removed (+ RefreshRequired at the sink), never known-inactive. The
since-time survives stream ends and hand-overs; the earliest expiry shares the
loop's retry timer. DataConnections.md: lifetime rule + troubleshooting row.
- S1: ProjectedMappingDeploymentRuntime publishes ProjectedMappingSet (placements + undecided + sequence) captured under
its lock; DeployedConditionMappings keeps it as one volatile value (highest sequence wins); ReconcileRunners reads
IProjectedConditionMappings.Snapshot. Deterministic window test via a Changed handler registered before the adapter.
- S2: a separate _undecided flag clears on ANY completion (failed/degraded/throwing build ⇒ settled empty ⇒ release);
browse-anchor Suspended semantics unchanged. A held set goes BadNoCommunication on the stale timeout and is released
past ProjectedConditionOptions.MaxHold (5 min); diagnostics report "held" and keep its counters; Dispose clears _held.
- S3: a runner that took over a non-empty held set sends RequireRefresh once at its first barrier.
- S4/NITs: runtime-level Began/Completed tests, F1 must-arrive control, linger-expiry-while-held.
Co-Authored-By: Claude <noreply@anthropic.com>
Every deploy begins a catalog attempt whose published mapping set is empty
(ProjectedMappingDeploymentRuntime.AttemptBegan → Notify([])). The consumer read
that as 'connection removed': runner Stop(removeConditions: true) tore down every
imported condition, and the post-deploy runner re-created them on fresh nodes —
one phantom event per condition (F2), an origin transition delivered twice (F3),
and every outstanding consumer EventId BadEventIdUnknown with no RefreshRequired
(F1; the removal's RefreshRequired was gated away because nothing was visible).
Root-caused live on a4dbg-1 (consumer applies a fresh-node 'marker null->M' record
right after its own deploy).
IProjectedConditionMappings.Suspended (DeployedConditionMappings → runtime
Suspended): while suspended a dropped connection's runner is stopped WITHOUT
removal and held; the next runner takes its materialised set over and
re-snapshots onto the same nodes (same marker ⇒ no event, EventIds kept). Only a
SETTLED set without the connection (or demand linger) releases the held runner,
which removes its conditions then.
Test: F1_a_deploys_empty_suspended_mapping_set_holds_the_conditions_… (red with
the hold disabled: removal on the suspended set).
The origin item sees a hub eviction only at its next hub read: Reset if the last snapshot chunk is
still undelivered, otherwise a silent fresh snapshot on the same stream (both per A2, both loss-free
since the A3 consumer swaps a buffered re-snapshot in as a full replacement). Since A2 review S5 the
3,000-record snapshot is 59 chunks and the silent path wins when run alone (fails 3/3 alone at the A2
merge too; passes in its class). No product change. Also fixes the stale ack/confirm/shelve comment on
ConditionMethodTimeoutMilliseconds.
#930 N2: an Unavailable mapping (refused item, failed root, snapshot timeout) is retried on the OPEN stream by
re-adding its item (AddSubscriptionItems) on its own backoff — definitive refusals (Denied/NotFound/Unsupported)
on LongRetryDelay (5 min, doubling to 4x), transient ones on the snapshot timeout x 2^n (<= 8x) — so healthy
mappings are never re-snapshotted for it; an incomplete barrier whose incomplete set equals the previous barrier's
sends no RefreshRequired. N3: ConditionCapacity is retried in-stream on the long timer and recovers.
#931 N4 exponential reconnect backoff (MaxReconnectDelay 60 s); N5 held-but-unlisted keys charged beside known
claims (overlapping unknown ones) + SetMaterialised cap report; N6 method calls read Serving without _gate;
N7 a capacity reset that removed conditions sends no second RefreshRequired; N8 a parked runner is released once
its removal finished.
A4 diagnostics core: DataConnectionConditionDiagnostics (side-labelled items/resyncs/capacity/method metrics, new
refresh_required counter, consumer + origin evidence), Commons contracts, DI + deployment-runtime + driver-host wiring.
Co-Authored-By: Claude <noreply@anthropic.com>
S2: one condition item per (stream, root) (InvalidArgument + diagnostic), SubscriptionSessionLimits
.MaxConditionItems (32) per stream (LimitExceeded), each snapshot's estimated bytes charged against
the principal's snapshot memory budget until its last chunk is delivered (refused ⇒ retried).
S3: a native condition in a UNS listing is named by its placement's browse name (effective name);
a raw-derived message (raw name, raw leaf, RawPath) is replaced by it.
S4: the item limit rides ConditionItemScope and is re-read with every listing.
S5: chunk budget = min(256 KiB, MaxPendingBytes, MaxMessageBytes) − frame overhead; an oversized
record's free text is truncated (no split surrogate); one that cannot fit resets with a diagnostic.
N1: one queued v1 frame after every 8 condition frames. N2: removal/snapshot-begin bypass rule documented.
N4: min(limit, DefaultMaxConditionsPerHold) per Lock hold. N5: losing channel waits are reused.
N6: ConditionTestAssertions deleted; probe seams reduced to three primitives; class doc moved back.
S1 (tests): the fixture 'deploy' test renamed to what it is (a listing swap without an attempt);
a real LocalCatalogCoordinator republish ends the stream.
budget = Max(1, …) pulled a chunk on a full queue every 100 ms tick, TryWrite failed and the stream was
reset, so a backlog above MaxPendingFrames chunks never completed its snapshot. Max(0, …) produces
nothing until the consumer drains. Test: 25-chunk backlog, stalled sink, 20 ticks ⇒ no reset, snapshot
completes (red before).
The A1 phase-run failure of A_native_transition_leaves_the_F5_pending_set was a real defect: when the
600 ms F5 window closed before the transition was processed (a loaded run), the diagnostic kept the
count from when it was raised (2) although the node manager held the condition established (1).
New deterministic test closes the window first; red before, green after.
New GrpcDataConditionArtifactReadTests: defaults on a pre-A2 artifact, authored values + AlarmSubscribe round-trip, an
out-of-range deployed limit fails the row closed, AllowGalaxyServiceAck without AlarmAcknowledge fails closed and with it
(newer central) is tolerated and inert. GrpcDataArtifactReadTests' X0 reserved-bit rows move from 64 to 128 now that
AlarmSubscribe is understood.