proto: alarm-transition family + ack/query RPCs (PR A.1) #104

Merged
dohertj2 merged 1 commits from track-a1-alarm-proto into main 2026-04-30 15:37:10 -04:00
Owner

Summary

First PR of the alarms-over-gateway epic (docs/plans/alarms-over-gateway.md in lmxopcua). Pure contract-surface change � no functional wiring yet.

  • Adds MxEventFamily.MX_EVENT_FAMILY_ON_ALARM_TRANSITION (= 5) and OnAlarmTransitionEvent body to MxEvent.
  • Adds two public RPCs to MxAccessGateway: AcknowledgeAlarm (unary) and QueryActiveAlarms (server-streaming).
  • Adds AcknowledgeAlarmRequest/Reply, QueryActiveAlarmsRequest, ActiveAlarmSnapshot, AlarmTransitionKind, AlarmConditionState.
  • Bumps GatewayProtocolVersion 2 ? 3. Fixture manifests + protoset descriptor regenerated.

Mapping MxAccess severity to OPC UA 0-1000 happens server-side in lmxopcua (B.1, MxAccessSeverityMapper). Gateway preserves the native MXAccess scale. Part 9 state machine + ACL + multi-source aggregation stays in lmxopcua per D1.

Test plan

  • Build clean (Contracts + Tests projects, net10.0)
  • All 273 existing unit tests still pass
  • New round-trip tests cover OnAlarmTransition (full + empty-optional), oneof last-wins guard, AcknowledgeAlarmRequest/Reply, ActiveAlarmSnapshot, QueryActiveAlarmsRequest with/without filter
  • Descriptor service-method enumeration asserts the two new RPCs
  • Fixture manifests track the new gatewayProtocolVersion

Follow-up

A.2 wires the worker-side MxAccess alarm sink. A.3 wires the gateway dispatch + ack handler. A.4 adds ConditionRefresh. E.1 regenerates the 5 client SDKs after this lands.

## Summary First PR of the **alarms-over-gateway** epic (`docs/plans/alarms-over-gateway.md` in lmxopcua). Pure contract-surface change � no functional wiring yet. - Adds `MxEventFamily.MX_EVENT_FAMILY_ON_ALARM_TRANSITION` (= 5) and `OnAlarmTransitionEvent` body to `MxEvent`. - Adds two public RPCs to `MxAccessGateway`: `AcknowledgeAlarm` (unary) and `QueryActiveAlarms` (server-streaming). - Adds `AcknowledgeAlarmRequest/Reply`, `QueryActiveAlarmsRequest`, `ActiveAlarmSnapshot`, `AlarmTransitionKind`, `AlarmConditionState`. - Bumps `GatewayProtocolVersion` 2 ? 3. Fixture manifests + protoset descriptor regenerated. Mapping MxAccess severity to OPC UA 0-1000 happens server-side in lmxopcua (B.1, `MxAccessSeverityMapper`). Gateway preserves the native MXAccess scale. Part 9 state machine + ACL + multi-source aggregation stays in lmxopcua per D1. ## Test plan - [x] Build clean (Contracts + Tests projects, net10.0) - [x] All 273 existing unit tests still pass - [x] New round-trip tests cover OnAlarmTransition (full + empty-optional), oneof last-wins guard, AcknowledgeAlarmRequest/Reply, ActiveAlarmSnapshot, QueryActiveAlarmsRequest with/without filter - [x] Descriptor service-method enumeration asserts the two new RPCs - [x] Fixture manifests track the new gatewayProtocolVersion ## Follow-up A.2 wires the worker-side MxAccess alarm sink. A.3 wires the gateway dispatch + ack handler. A.4 adds ConditionRefresh. E.1 regenerates the 5 client SDKs after this lands.
dohertj2 added 1 commit 2026-04-30 15:36:53 -04:00
First PR of the alarms-over-gateway epic
(docs/plans/alarms-over-gateway.md in lmxopcua). Pure contract-surface
change — no functional wiring yet. Worker-side subscription (A.2),
gateway-side dispatch + ack handler (A.3), and ConditionRefresh
(A.4) follow.

mxaccess_gateway.proto:

- Extend MxEventFamily with MX_EVENT_FAMILY_ON_ALARM_TRANSITION = 5.
- Extend MxEvent.body oneof with OnAlarmTransitionEvent on_alarm_transition = 24.
- Add OnAlarmTransitionEvent message carrying the full MxAccess alarm
  payload (full reference, source object, alarm-type-name, transition
  kind, raw severity, original raise timestamp, transition timestamp,
  operator user/comment, category, description, current/limit value).
  Mapping to OPC UA 0-1000 severity ladder happens server-side in
  lmxopcua's MxAccessSeverityMapper (B.1) — gateway preserves the
  native MxAccess scale.
- Add AlarmTransitionKind enum (Raise / Acknowledge / Clear / Retrigger).
- Add ActiveAlarmSnapshot + AlarmConditionState for the
  ConditionRefresh stream.
- Add public RPCs AcknowledgeAlarm (unary) and QueryActiveAlarms
  (server-streaming) on MxAccessGateway service.
- Add AcknowledgeAlarmRequest/Reply + QueryActiveAlarmsRequest.

GatewayContractInfo.GatewayProtocolVersion bumps 2 -> 3. Fixture
manifests (proto-inputs, behavior, parity, golden OpenSessionReply)
and protoset descriptor regenerated.

Tests: round-trip serialization for the new messages with
all-fields-populated and empty-optional-fields cases; oneof
last-write-wins guard between OnDataChange and OnAlarmTransition;
descriptor service-method enumeration includes the two new RPCs.
All 273 existing tests still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit 7b621e3f64 into main 2026-04-30 15:37:10 -04:00
dohertj2 deleted branch track-a1-alarm-proto 2026-04-30 15:37:10 -04:00
Sign in to join this conversation.