gateway: alarm-RPC dispatcher seam (PRs A.6 + A.7) #117

Merged
dohertj2 merged 1 commits from track-a6-a7-alarm-rpc-dispatch into main 2026-04-30 22:50:08 -04:00
Owner

Summary

Replaces the inline diagnostic strings in PR A.3's AcknowledgeAlarm + QueryActiveAlarms handlers with an IAlarmRpcDispatcher seam.

  • IAlarmRpcDispatcher (new) — gateway-side abstraction over the worker-RPC path that fronts AlarmClient.AlarmAckByGUID and the active-alarm walk. AcknowledgeAsync returns the AcknowledgeAlarmReply directly; QueryActiveAlarmsAsync yields an IAsyncEnumerable<ActiveAlarmSnapshot>.
  • NotWiredAlarmRpcDispatcher (new, default impl) — returns PROTOCOL_STATUS_OK with a structured worker-pending diagnostic on Acknowledge, yields an empty stream on QueryActiveAlarms. Same observable shape as PR A.3, but the integration seam is now in code instead of hardcoded inside the handler.
  • MxAccessGatewayService — handlers delegate to the dispatcher. Constructor accepts an optional IAlarmRpcDispatcher (default NotWiredAlarmRpcDispatcher); a future WorkerAlarmRpcDispatcher registration in DI swaps in the live worker-IPC routing without changing the public RPC surface.

Test plan

  • 2 new dispatcher tests pin the not-wired contract
  • Full test suite: 281 passed (was 279; 2 new)
  • Server builds clean

Follow-up

Worker-side dispatch — translating Acknowledge / QueryActiveAlarms to the IPC method that calls IMxAccessAlarmConsumer from PR A.5 — is the dev-rig follow-up. It depends on validating the AVEVA GetAlarmChangesCompleted event subscription against a live alarm provider before pinning a wire format.

## Summary Replaces the inline diagnostic strings in PR A.3's `AcknowledgeAlarm` + `QueryActiveAlarms` handlers with an `IAlarmRpcDispatcher` seam. - **`IAlarmRpcDispatcher` (new)** — gateway-side abstraction over the worker-RPC path that fronts `AlarmClient.AlarmAckByGUID` and the active-alarm walk. `AcknowledgeAsync` returns the `AcknowledgeAlarmReply` directly; `QueryActiveAlarmsAsync` yields an `IAsyncEnumerable<ActiveAlarmSnapshot>`. - **`NotWiredAlarmRpcDispatcher` (new, default impl)** — returns `PROTOCOL_STATUS_OK` with a structured worker-pending diagnostic on Acknowledge, yields an empty stream on QueryActiveAlarms. Same observable shape as PR A.3, but the integration seam is now in code instead of hardcoded inside the handler. - **`MxAccessGatewayService`** — handlers delegate to the dispatcher. Constructor accepts an optional `IAlarmRpcDispatcher` (default `NotWiredAlarmRpcDispatcher`); a future `WorkerAlarmRpcDispatcher` registration in DI swaps in the live worker-IPC routing without changing the public RPC surface. ## Test plan - [x] 2 new dispatcher tests pin the not-wired contract - [x] Full test suite: 281 passed (was 279; 2 new) - [x] Server builds clean ## Follow-up Worker-side dispatch — translating Acknowledge / QueryActiveAlarms to the IPC method that calls `IMxAccessAlarmConsumer` from PR A.5 — is the **dev-rig follow-up**. It depends on validating the AVEVA `GetAlarmChangesCompleted` event subscription against a live alarm provider before pinning a wire format.
dohertj2 added 1 commit 2026-04-30 22:50:06 -04:00
Replaces the inline diagnostic strings in PR A.3's AcknowledgeAlarm
+ QueryActiveAlarms handlers with an IAlarmRpcDispatcher seam.

- IAlarmRpcDispatcher (new) — gateway-side abstraction over the
  worker-RPC path that fronts AlarmClient.AlarmAckByGUID and the
  active-alarm walk. AcknowledgeAsync returns the
  AcknowledgeAlarmReply directly; QueryActiveAlarmsAsync yields an
  IAsyncEnumerable<ActiveAlarmSnapshot>.
- NotWiredAlarmRpcDispatcher (new, default impl) — returns
  PROTOCOL_STATUS_OK with a structured worker-pending diagnostic
  on Acknowledge, yields an empty stream on QueryActiveAlarms.
  Same observable shape as PR A.3, but the integration seam is
  now in code instead of hardcoded inside the handler.
- MxAccessGatewayService — handlers delegate to the dispatcher.
  Constructor accepts an optional IAlarmRpcDispatcher (default
  NotWiredAlarmRpcDispatcher); a future WorkerAlarmRpcDispatcher
  registration in DI swaps in the live worker-IPC routing without
  changing the public RPC surface.
- 2 new dispatcher tests pin the not-wired contract; 279 → 281
  total tests, all green.

Worker-side dispatch (translating Acknowledge / QueryActiveAlarms
to the IPC method that calls IMxAccessAlarmConsumer from PR A.5)
is the dev-rig follow-up — it depends on validating the AVEVA
GetAlarmChangesCompleted event subscription against a live alarm
provider before pinning a wire format.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit a739fadb5f into main 2026-04-30 22:50:08 -04:00
dohertj2 deleted branch track-a6-a7-alarm-rpc-dispatch 2026-04-30 22:50:08 -04:00
Sign in to join this conversation.