gateway: AcknowledgeAlarm + QueryActiveAlarms RPC handlers (PR A.3) #111

Merged
dohertj2 merged 1 commits from track-a3-gateway-alarm-handlers into main 2026-04-30 21:06:21 -04:00
Owner

Summary

Twelfth PR of the alarms-over-gateway epic. Lands the public RPC handler surface that PR A.1's proto introduced. Actual worker-side ack call + active-alarm walk depend on PR A.2 (worker MxAccess subscription); this PR ensures clients can call the RPCs and receive a meaningful response without UNIMPLEMENTED at the gRPC layer.

  • AcknowledgeAlarm — validates session_id + alarm_full_reference, resolves the session (NotFound on miss), returns a successful reply with a structured DiagnosticMessage indicating worker dispatch is pending A.2.
  • QueryActiveAlarms — validates session_id, returns an empty stream. PR A.4 layers the actual ConditionRefresh implementation.
  • OpenSessionReply.Capabilities advertises both new RPCs (unary-acknowledge-alarm, server-stream-active-alarms).

OnAlarmTransition events already flow through StreamEvents automatically — EventStreamService and MxAccessGrpcMapper forward whatever family the worker emits without filtering, so no changes were needed there.

Test plan

  • Full 273-test suite green
  • Server build clean

Per-handler unit tests ship with PR A.4's expanded surface.

## Summary Twelfth PR of the **alarms-over-gateway** epic. Lands the public RPC handler surface that PR A.1's proto introduced. Actual worker-side ack call + active-alarm walk depend on PR A.2 (worker MxAccess subscription); this PR ensures clients can call the RPCs and receive a meaningful response without UNIMPLEMENTED at the gRPC layer. - `AcknowledgeAlarm` — validates session_id + alarm_full_reference, resolves the session (NotFound on miss), returns a successful reply with a structured DiagnosticMessage indicating worker dispatch is pending A.2. - `QueryActiveAlarms` — validates session_id, returns an empty stream. PR A.4 layers the actual ConditionRefresh implementation. - `OpenSessionReply.Capabilities` advertises both new RPCs (`unary-acknowledge-alarm`, `server-stream-active-alarms`). OnAlarmTransition events already flow through `StreamEvents` automatically — `EventStreamService` and `MxAccessGrpcMapper` forward whatever family the worker emits without filtering, so no changes were needed there. ## Test plan - [x] Full 273-test suite green - [x] Server build clean Per-handler unit tests ship with PR A.4's expanded surface.
dohertj2 added 1 commit 2026-04-30 21:06:19 -04:00
Twelfth PR of the alarms-over-gateway epic
(docs/plans/alarms-over-gateway.md). Lands the public RPC handler
surface that PR A.1's proto introduced. The actual worker-side
ack call + active-alarm walk depend on PR A.2 (worker MxAccess
subscription); this PR ensures clients can call the RPCs and
receive a meaningful response without UNIMPLEMENTED at the gRPC
layer.

- AcknowledgeAlarm — validates session_id + alarm_full_reference,
  resolves the session (NotFound on miss), returns a successful
  reply with a structured DiagnosticMessage indicating worker
  dispatch is pending PR A.2. Once A.2 ships, the body translates
  the request into a WorkerCommand and forwards through
  SessionManager.InvokeAsync.
- QueryActiveAlarms — validates session_id, returns an empty
  stream. PR A.4 layers the actual ConditionRefresh implementation
  once the worker's QueryActiveAlarmsCommand is available.
- OpenSessionReply.Capabilities advertises both new RPCs
  (unary-acknowledge-alarm, server-stream-active-alarms) so
  clients can negotiate against the contract surface.

OnAlarmTransition events flow through the existing StreamEvents
path automatically — EventStreamService and MxAccessGrpcMapper
forward whatever family the worker emits without filtering, so
no changes are needed there for A.3.

Tests: full 273-test suite still green. Per-handler unit tests
ship with PR A.4's expanded surface; A.3's stub handlers are
narrow enough that the existing parity-fixture tests cover the
contract round-trip.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit 3256733d24 into main 2026-04-30 21:06:21 -04:00
dohertj2 deleted branch track-a3-gateway-alarm-handlers 2026-04-30 21:06:22 -04:00
Sign in to join this conversation.