Gate #1026 (2048 projected items, rig seed --scale 2048) still failed after #1115. Three defects, found by
first making the origin and the consumer say why:
Diagnostics (origin + consumer)
- SourceInvalidationReason (bounded enum, classified from the publisher's reason constants): counted per
reason (`otopcua.dataconn.source.invalidations{reason}`, `Invalidate.<Reason>` in SourceIngressDiagnostics),
recorded on the source and logged at Debug (PartitionedSampleHub.Logger).
- An interest lease records why it stopped; the origin Subscribe stream's Reset text names it ("Source
invalidated (<reason>).", "Source retired.", "Source interest released.", "Source routing changed.",
"Source partition reset.", "Source binding replaced.") instead of always "Source change history expired.";
logged at Information (Released at Debug). The texts are for people/counters only: the consumer classifies
them into ResetSourceInvalidated / ResetInterestLost (no peer branches on them; the rig probe whitelist is
updated).
- Consumer: renewal started/succeeded/failed/budget/slot counters, RenewalFail.<point> and
AttemptEnd.<reason> (bounded, constant keys).
1. Origin: a binding check invalidated live sources. The driver actor's source-binding retry re-walks every
desired reference (offset 0, every <= 30 s once any one failed); for an already-bound reference it took the
source's serialization gate, and when the poll thread was publishing that source both sides invalidated it
(BindingContention / SerializationContention) and reset every origin stream holding it. Live s1026-c: the
only invalidation reasons were those two (5+5 during the open, recurring every ~30 s). EnsureDriverBinding now
answers an already-bound, current source without the gate. Live after: 0 BindingContention.
2. Consumer: per-item metadata lease renewal could not keep up. Each projected item renewed its 15 s lease with
its own capabilities + GetMetadata pair holding a 256 KiB unary reservation; at the default 1 MiB budget four
ran at once and the rest retried on the next 250 ms tick (~16 items/s). Live s1026-d: 155 703 renewals
started, 153 019 refused by the unary budget, 2 564 committed; ~1900 of 2048 items stood down
BadUserAccessDenied; 0 recovered after the origin restart. RemoteNamespaceResolver.RenewExactBatchAsync renews
many items with one capabilities call and one GetMetadata per origin MaxBatchItems (the single-item renewal is
now the batch of one: same checks, lease bound and commit); a cohort renews every due item of a tick in
batches of 128, and the between-attempt renewal (every item after an origin restart) is batched too.
3. Consumer: two demands of one node in one cohort deadlocked the batch: the second joined (#969) the first's
claim, and the batch waited for the joiner before publishing its verdict. The batch now publishes first.
Live (OrbStack rig, 160 + 1888 items, 4 Hz churn, SOURCE pair restart): s1026-f run 1 open 10.2 s, recovery
1.5 s, 0 resets of any kind; s1026-h run 2 PASS (open 3.1 s, recovery 3.6 s, 0 resets, no history-expired or
source-invalidated log line). Remaining (not fixed here): s1026-h run 1 recovered only 852 of 1888 large-mapping
items after the restart: their renewals fail in the catalog cache's predecessor-chain bound
(RenewalFail.Cache.PredecessorChain 81 163).
Tests: GrpcData1026BindingContentionTests (fails without the fast path), GrpcData1026RenewalBatchWireTests
(one tick renews all due items in one metadata call - fails with per-item renewals; two demands of one node -
fails without the ordering fix), GrpcData1026ResetReasonTests.
Co-Authored-By: Claude <noreply@anthropic.com>
- device: read-only scale block (holding registers 1000..5095) + scale_set control action
- seed: GRPC_DATA_SCALE=N adds SOURCE driver modscale/dev with N UInt16 tags in TagGroups
small (first 160) / large (rest), one RawTagGroup export + CONSUMER mapping each
(map-scale-small|large); fixture.json records the counts
- rig.py: seed --scale N; deploy trigger gets a 60 s socket timeout (the AdminUI's
StartDeployment ask waits up to 45 s; a 2048-tag snapshot read took ~25 s, so the
general 15 s cap aborted the POST)
- scale_gate.py: opens a >128 and a >1024-item mapping via Client CLI recursive
subscribes on CONSUMER, requires all Good, churns the block, restarts the SOURCE pair,
requires all Good with a post-restart value, checks the consumer ResetHistory counter
and the container logs for 'history expired'; PASS/FAIL + evidence/S1026-results.json
Co-Authored-By: Claude <noreply@anthropic.com>
Native AddComment shares HandleAlarmCommand but is applied at the node only;
asking the scripted host made it BadInvalidState (live A02 on fu937-1).
Co-Authored-By: Claude <noreply@anthropic.com>
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>
Round-trips NodeDiagnosticsSnapshot (OriginHistory, HistoryVariants and the other H4 members) through
the serializer Akka picks for the fleet-diagnostics reply, and decodes payloads stripped of the H4
members. The origin flag is renamed NoPeerTrafficYet (default false): Akka's JSON serializer fills a
missing constructor argument with the CLR default, so a payload without it must never claim it.
Consumer and origin history evidence for data connections (plan §6):
- DataConnectionHistoryDiagnostics: otopcua.dataconn.history.reads{variant,status_class,side} and
otopcua.dataconn.history.continuations.active{side} on the exported OtOpcUa meter (the H2 origin
counter sat on a private meter the host never exported); the plan's unknown-bits counter is the
existing X0 otopcua.dataconnection.unknown_operations_dropped, reused
- per-connection projected answers by status class and open consumer continuations (settled on
resume claim or release); origin sessions, open continuations and answers by status class
- negotiated features and advertised history variants/aggregates per connection
- AdminUI data-connections page renders them plus the dropped unknown-operation bits (#919)
- H4 unit-phase manifest key
The review re-run showed a re-browse served from the cached page does not
renew an idle projected node's 15 s metadata lease (value Read is refused the
same way; pre-existing v1 projection behaviour). Each held H06 leg now starts
right after a baseline restore + re-browse.
Found on the review re-run (H06d, SqlServer): a projected node read more than
MetadataLeaseMilliseconds (15 s) after its last browse/renewal is
BadUserAccessDenied — the same for a value Read (pre-existing v1 projection
behaviour, confirmed in the Runtime harness), not an H3 defect. The gate now
re-browses before each held read.
Seed profile historizes a Float32 (registers 30..31) driven through two values;
H01/H03 compare its projected rows/types with the origin (Good Singles). H06(a)
also reads the denied and the unhistorized node through the consumer's deployed
connection (node probe) so the origin's per-item refusal itself is compared,
not only the metadata that drops the access bit.
Found by the H3 live gate (H02): a Double Average of a UInt16 node was decoded
against the node's catalog kind and came back null + BadTypeMismatch per
interval (the result status stayed Good, which is why the wire test missed
it). Raw/AtTime values are still checked against the catalog kind; Processed
values accept any scalar kind. The wire test now asserts the interval's value.
Gate: re-browse the projected leaves after every deploy (a deploy retires cold
projected nodes; the same opaque ids come back).
rig.py up --history --history-backend questdb adds a run-owned QuestDB for the
SOURCE historian. History seed profile: mappings grant HistoryRead, the CLI
principal's CONSUMER HistoryRead comes only from mapping-scoped grants, text is
historized (per-type aggregate refusal), new acl_permissions mutation.
history_gate.py drives H01-H06 through the Client CLI on projected NodeIds
resolved by browse from the mapping anchor, compares with the origin, and
restores the baseline after every scenario. The node probe reports the
origin's open history continuations (LocalDataServices.HistoryOpenContinuations,
now public).
A real consumer OPC UA session HistoryReads a projected variable whose
projected half is forwarded to a real origin node manager's history port:
mixed batch keeps slots, page-through to completion, single use, session
close returns the origin store count to 0, mapped grant with ACLs on and off.
Manifest key H3 (OpcUaServer.Tests + Runtime.Tests; OI runs separately — the
runner accepts unit projects only).