feat: expose mapped raw and uns data through grpc adapters

This commit is contained in:
Joseph Doherty
2026-11-16 20:43:15 -05:00
parent 47960a6d57
commit 8ad03e9c5d
118 changed files with 12645 additions and 227 deletions
@@ -314,6 +314,7 @@ public sealed class ScriptedAlarmHostActor : ReceiveActor
// burst. The engine upstream is fed per value, so push each item in order — the saving is the
// mailbox hop, not the push.
Receive<VirtualTagActor.DependencyValueBatch>(OnDependencyBatch);
Receive<DependencyMuxActor.ProjectedDependencyWake>(wake => wake.Consume(items => OnDependencyBatch(new(items))));
Receive<EngineEmission>(OnEngineEmission);
// Cluster redundancy snapshots (published on the `redundancy-state` topic, subscribed in PreStart)
// cache this node's role so OnEngineEmission can gate the cluster-wide alerts publish to the Primary.
@@ -512,8 +513,9 @@ public sealed class ScriptedAlarmHostActor : ReceiveActor
// the status code rides through verbatim. This used to convert the incoming value onto a
// 3-state enum and straight back again through a pair of mutually-inverse mappers, which is where
// the input's sub-code was lost before the engine ever cached it.
_upstream.Push(msg.TagId,
new DataValueSnapshot(msg.Value, msg.StatusCode, msg.TimestampUtc, msg.TimestampUtc));
var snapshot = new DataValueSnapshot(msg.Value, msg.StatusCode, msg.TimestampUtc, msg.TimestampUtc);
if (msg.PublicationProof is { } proof) _upstream.Push(msg.TagId, snapshot, proof);
else _upstream.Push(msg.TagId, snapshot);
}
/// <summary>One batched mux delivery — every item already matched this host's registered interest.
@@ -544,6 +546,11 @@ public sealed class ScriptedAlarmHostActor : ReceiveActor
private void OnEngineEmission(EngineEmission msg)
{
var e = msg.Event;
if (e.InputEvidence is { } evidence)
{
try { if (!evidence.IsValid) return; }
catch (Exception) { return; }
}
// None = no meaningful change; Suppressed = shelving ate the emission. Neither should reach a
// sink. (The engine already filters these out of BuildEmission, but guard defensively.)