worker: alarm event mapper + sink scaffold (PR A.2 — partial) #112

Merged
dohertj2 merged 1 commits from track-a2-worker-alarm-mapper into main 2026-04-30 21:18:54 -04:00
Owner

Summary

Eighteenth PR of the alarms-over-gateway epic. Lands the proto-build path the worker uses to create OnAlarmTransition events. The COM-side subscription that registers an alarm event sink against the MXAccess Toolkit is pinned during dev-rig validation — the exact API differs across AVEVA versions and needs hardware to verify.

Lands today (unit-testable, no hardware):

  • MxAccessEventMapper.CreateOnAlarmTransition — mechanical proto builder. Takes decoded alarm fields (full reference, source object, alarm type, transition kind, severity, timestamps, operator user/comment, category, description) and produces an MxEvent with the OnAlarmTransition body populated. Mirrors CreateOnDataChange / CreateOnWriteComplete / etc.
  • MxAccessAlarmEventSink — scaffolded class with documented Attach / Detach + an internal EnqueueTransition entry point. When dev-rig validation pins the MXAccess Toolkit alarm subscription API, the only edit is wiring the COM delegate inside Attach to call EnqueueTransition.

Pending dev-rig validation:

  • Pin the MXAccess Toolkit alarm event source COM API (likely IAlarmEventSink, IAlarmEventSubscription, or a method on LMXProxyServerClass — verify against the worker host's installed version).
  • Add cancellation/cleanup tests once the COM hook is wired.
  • Parity-rig integration test that fires a real Galaxy alarm and asserts the gateway emits OnAlarmTransition.

Test plan

  • 2 new mapper tests pin full-payload Acknowledge + bare-bones Raise
  • Full Worker.Tests suite green: 123 passed (was 121; 2 new)
  • Worker builds clean (net48, x86)
  • COM-side sink integration — gated on dev-rig MXAccess Toolkit version + the live Galaxy parity-rig validation
## Summary Eighteenth PR of the **alarms-over-gateway** epic. Lands the proto-build path the worker uses to create OnAlarmTransition events. The **COM-side subscription** that registers an alarm event sink against the MXAccess Toolkit is pinned during dev-rig validation — the exact API differs across AVEVA versions and needs hardware to verify. **Lands today** (unit-testable, no hardware): - `MxAccessEventMapper.CreateOnAlarmTransition` — mechanical proto builder. Takes decoded alarm fields (full reference, source object, alarm type, transition kind, severity, timestamps, operator user/comment, category, description) and produces an `MxEvent` with the `OnAlarmTransition` body populated. Mirrors `CreateOnDataChange` / `CreateOnWriteComplete` / etc. - `MxAccessAlarmEventSink` — scaffolded class with documented Attach / Detach + an internal `EnqueueTransition` entry point. When dev-rig validation pins the MXAccess Toolkit alarm subscription API, the only edit is wiring the COM delegate inside Attach to call EnqueueTransition. **Pending dev-rig validation:** - Pin the MXAccess Toolkit alarm event source COM API (likely `IAlarmEventSink`, `IAlarmEventSubscription`, or a method on `LMXProxyServerClass` — verify against the worker host's installed version). - Add cancellation/cleanup tests once the COM hook is wired. - Parity-rig integration test that fires a real Galaxy alarm and asserts the gateway emits `OnAlarmTransition`. ## Test plan - [x] 2 new mapper tests pin full-payload Acknowledge + bare-bones Raise - [x] Full Worker.Tests suite green: 123 passed (was 121; 2 new) - [x] Worker builds clean (net48, x86) - [ ] COM-side sink integration — gated on dev-rig MXAccess Toolkit version + the live Galaxy parity-rig validation
dohertj2 added 1 commit 2026-04-30 21:18:52 -04:00
Eighteenth PR of the alarms-over-gateway epic
(docs/plans/alarms-over-gateway.md). Lands the proto-build path that
the worker uses to create OnAlarmTransition events. The COM-side
subscription that registers an alarm event sink against the MXAccess
Toolkit is pinned during dev-rig validation — the exact API differs
across AVEVA versions and needs hardware to verify.

Lands today (unit-testable, no hardware needed):
- MxAccessEventMapper.CreateOnAlarmTransition — mechanical proto
  builder. Takes decoded alarm fields (full reference, source
  object, alarm type, transition kind, severity, timestamps,
  operator user/comment, category, description) and produces an
  MxEvent with the OnAlarmTransition body populated. Mirrors the
  pattern of CreateOnDataChange / CreateOnWriteComplete / etc.
- MxAccessAlarmEventSink — scaffolded class with documented
  Attach / Detach + an internal EnqueueTransition entry point.
  When dev-rig validation pins the MXAccess Toolkit alarm
  subscription API, the only edit needed is to wire the COM
  delegate inside Attach to call EnqueueTransition. The mapper
  bridge is already done.

Pending dev-rig validation:
- Pin the MXAccess Toolkit alarm event source COM API (likely one
  of IAlarmEventSink, IAlarmEventSubscription, or a method on
  LMXProxyServerClass — verify against the worker host's installed
  version).
- Add cancellation/cleanup tests once the COM hook is wired.
- Integration test against the parity rig that fires a real Galaxy
  alarm and asserts the gateway emits OnAlarmTransition.

Tests:
- 2 new mapper tests pin the full-payload Acknowledge case and
  the bare-bones Raise case.
- Full Worker.Tests suite green: 123 passed (was 121; 2 new).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit bc61598b44 into main 2026-04-30 21:18:54 -04:00
dohertj2 deleted branch track-a2-worker-alarm-mapper 2026-04-30 21:18:55 -04:00
Sign in to join this conversation.