feat(mesh-phase5): telemetry.proto contract + oneof + contract-lock test

Claude-Session: https://claude.ai/code/session_01GASWkNEi68FSCtvr6rLoEW
This commit is contained in:
Joseph Doherty
2026-07-23 14:58:53 -04:00
parent 094c29d13d
commit a845a6d2fd
4 changed files with 141 additions and 0 deletions
@@ -0,0 +1,25 @@
using ZB.MOM.WW.OtOpcUa.Commons.Protos.Telemetry.V1;
namespace ZB.MOM.WW.OtOpcUa.Commons.Protos;
/// <summary>
/// The single source of truth for which <see cref="TelemetryEvent.EventOneofCase"/> variants the
/// Phase 5 telemetry transport actually handles. Both the contract-lock test (which proves this
/// list stays in lock-step with the generated oneof) and the later oneof↔domain converter
/// reference this array, so adding a fifth channel to <c>telemetry.proto</c> forces a matching
/// entry here or the build/test goes red.
/// </summary>
public static class TelemetryProtoContract
{
/// <summary>
/// Exactly the four telemetry oneof cases mirrored from the domain records:
/// alerts / script-logs / driver-health / driver-resilience-status.
/// </summary>
public static readonly TelemetryEvent.EventOneofCase[] HandledCases =
[
TelemetryEvent.EventOneofCase.AlarmTransition,
TelemetryEvent.EventOneofCase.ScriptLog,
TelemetryEvent.EventOneofCase.DriverHealth,
TelemetryEvent.EventOneofCase.DriverResilience,
];
}