fix(grpc-data): A1 review B1 — a scripted projection never marks its condition known

WriteAlarmCondition set _conditionStateKnown for every projection. Scripted Active is not persisted, so the
post-restart re-assert of a restored unacked/shelved/disabled alarm (or the re-projection of an operator ack
before the inputs arrived) produced a known=true, Active=false record no predicate decided (T2 case i).
Only native transitions are established states now; scripted known-ness comes only from MarkConditionsKnown.
This commit is contained in:
Joseph Doherty
2026-11-24 10:17:34 -05:00
parent eb688a4ee0
commit e9d82a6a5a
3 changed files with 130 additions and 6 deletions
@@ -1419,10 +1419,13 @@ public sealed partial class OtOpcUaNodeManager : CustomNodeManager2, INodeManage
// WireMethodTransitionReporting) equals the node's current state → no delta → suppress, so
// the transition is reported exactly once. ReportConditionEvent
// stamps a fresh EventId, ClearChangeMasks, and ReportEvent — all still under this lock.
// A1 (§5.1): a projected snapshot IS an established state. The record is raised by
// ReportConditionEvent when the gate fires, otherwise here as a state-only record (ConditionClass and
// the other silent fields).
_conditionStateKnown.Add(key);
// A1 (§5.1): a NATIVE driver transition IS an established state. A SCRIPTED projection is not: the
// engine's Active is not persisted, so a post-load re-assert (or a projection after an operator
// ack/shelve/disable before the inputs arrived) can carry Active=false that no predicate decided —
// scripted known-ness comes ONLY from MarkConditionsKnown (the engine's inputs-established flip).
// The record is raised by ReportConditionEvent when the gate fires, otherwise here as a state-only
// record (ConditionClass and the other silent fields).
if (_nativeAlarmNodeIds.Contains(key)) _conditionStateKnown.Add(key);
if (fire)
{
ReportConditionEvent(condition, sourceTimestampUtc);