docs(alarms): #656 re-statement flag + ActiveAcknowledged kind (AlarmTracking, OpcUaClient, Galaxy, ScriptedAlarms, CLAUDE.md)

Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
Joseph Doherty
2026-10-08 23:43:09 -04:00
parent b39bb6794d
commit e138e39778
5 changed files with 33 additions and 3 deletions
+19
View File
@@ -67,6 +67,25 @@ same condition is wired as an **event notifier of every referencing equipment fo
counter) would un-ack on every respawn — conservative, never hiding an alarm — and a source whose message omits
what changed (a new alarm under identical text) would keep a stale ack across a respawn. A native source must also set `Kind`: an
`Unspecified` kind projects no state change.
- **Snapshot / first-sight re-statements (#656).** A source that RE-STATES upstream's current state — Galaxy's
reconnect snapshot entries, OpcUaClient's first event per condition after a start or deploy respawn — flags
`AlarmEventArgs.IsRestatement` (optional, default `false`; FOCAS, MTConnect, AbCip and live Galaxy transitions never
set it). The flag governs **history only, never node state**: the projector still projects, but a flagged `Retrigger`
on a condition already Active+unacked with the **same message AND severity**, or a flagged `Clear` on an
already-inactive condition, writes no `/alerts` row. Before this every gateway reconnect wrote a duplicate
"Activated" (and "Cleared") row per alarm while clients saw no event. A **live** `Retrigger` is a genuine
re-occurrence and keeps its row; a changed severity (an MTConnect Warning→Fault that keeps its text) does too.
Residual: a Galaxy alarm that genuinely re-occurred during an outage and is still Active+unacked with identical
text/severity at reconnect loses that row (indistinguishable upstream; the node shows no change either). A process
restart still writes a fresh "Activated" for every already-active alarm — the projector has no memory, correctly.
- **`AlarmTransitionKind.ActiveAcknowledged` (#656)** — "active AND acknowledged" in ONE projection (one node write,
at most one client event). `NativeAlarmProjector.Project(..., out historyKinds)` expands it into the rows that
actually changed: "Activated" (stamped `OriginalRaiseTimestampUtc`, no operator comment) only if the condition
was not already showing that alarm active, then "Acknowledged" (carrying the comment) only if it was not acked.
Galaxy maps a snapshot `ActiveAcked` entry to it — it used to map to `Acknowledge`, which kept the host's prior
`Active = false` on a cold host or an inactive prior, so an alarm active in AVEVA projected **inactive** and was
invisible to clients. OpcUaClient emits it for inactive → (active, acked) instead of `Raise` + `Acknowledge`,
which showed clients an Active+**unacked** intermediate event.
### Native condition state survives a full rebuild (Gitea #641)