From b03ab11d8a4d40b1f98a350f57b844419ff28a64 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Sun, 31 May 2026 02:41:45 -0400 Subject: [PATCH] chore(plans): native alarms execution progress (24/28) + batch-7 notes --- docs/plans/2026-05-29-native-alarms.RESUME.md | 11 ++++++++--- docs/plans/2026-05-29-native-alarms.md.tasks.json | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/plans/2026-05-29-native-alarms.RESUME.md b/docs/plans/2026-05-29-native-alarms.RESUME.md index caada7ec..6bc2a4f0 100644 --- a/docs/plans/2026-05-29-native-alarms.RESUME.md +++ b/docs/plans/2026-05-29-native-alarms.RESUME.md @@ -8,10 +8,15 @@ - Do all work here; `main` checkout stays untouched. Build: `dotnet build ZB.MOM.WW.ScadaBridge.slnx`. - The shared MS SQL container `scadabridge-mssql` is up (the ConfigDB MsSql migration-fixture tests use it). -## Progress: Tasks 1–21 done & committed; 22–28 pending -Commits (oldest→newest): `696da92` T1 … `20b41b8` T18, `0c6f9a9` T19, `b1df6d5` T20, `3bf1d26` T21. (Full list in git log.) +## Progress: Tasks 1–24 done & committed; 25–28 pending +Commits (oldest→newest): `696da92` T1 … `3bf1d26` T21, `a6dcbf6` T22, `1f6c420` T23, (T24 next). (Full list in git log.) -**Cadence is batches of 3 (user choice on resume).** Batch 4 = T13–15 ✅, Batch 5 = T16–18 ✅, Batch 6 = T19–21 ✅. Greens: SiteRuntime.Tests 313/313, Communication.Tests 200/200, ManagementService.Tests 111/111, Commons.Tests registry 8/8. Next: **Batch 7 = T22 (CLI) → T23 (DebugView UI) → T24 (Template editor UI)**. Then 25 (instance UI), 26 (seed), 27 (docs), 28 (live integration). +**Cadence is batches of 3 (user choice on resume).** Batch 4 = T13–15 ✅, Batch 5 = T16–18 ✅, Batch 6 = T19–21 ✅, Batch 7 = T22–24 ✅. Greens: SiteRuntime 313/313, Communication 200/200, ManagementService 111/111, CentralUI 581/581, CLI CommandTree 21/21. Next: **Batch 8 = T25 (instance override panel) → T26 (docker-env2 seed) → T27 (docs)**, then T28 (live integration). + +## Decisions / deviations — Batch 7 (T22–24) +- **T22:** CLI `template native-alarm-source add/list/remove` + `instance native-alarm-source set/clear` + README. **Known-flaky:** `CliConfigTests.Load_MalformedConfigFile…` fails ~deterministically in the FULL CLI suite (passes in isolation) due to process-global `HOME`/`Console.SetError` racing under xUnit parallelism — **confirmed pre-existing** (baseline fails 3/3 full runs; my added tests merely perturbed scheduling). Not my regression; treat as known-flaky like the StaleTagMonitor set. +- **T23:** DebugView alarm table enriched — added Kind + Sev columns, folded SourceReference into the Alarm cell (monospace subtitle), condition badges (Unacked/Shelved/Suppressed) into the State cell, Type/Category/operator/raise-time/value into the row tooltip; `FilteredAlarmStates` also matches SourceReference. bUnit test sets `_connected`/`_snapshot`/`_alarmStates` via reflection then asserts markup. +- **T24:** Template editor got a new **"Native Alarms" tab** (not a sub-panel) — fits the existing tabbed editor. **Repo-direct, NOT the plan's "management HTTP client":** TemplateEdit is Blazor Server in-process and calls `ITemplateEngineRepository` + `SaveChangesAsync` directly (mirrors how `_alarms` load/save works). Connection dropdown loads alarm-capable (OpcUa/MxGateway) connections via `ICentralUiRepository.GetAllDataConnectionsAsync` deduped by name. **Test is structural** (source-text assertions like `TestRunWarningTests`), NOT a full interactive bUnit render — TemplateEdit has ~10 injected services with their own graphs (ScriptAnalysisService/IMemoryCache/ISharedScriptCatalog/BuildParentContextsAsync/GetInstancesFilteredAsync…); the codebase has no precedent for fully rendering it, and the CRUD path is already covered behaviorally by the T21 ManagementActor tests. **T25 (InstanceConfigure) may be lighter to full-render — check first.** ## Decisions / deviations — Batch 6 (T19–21) - **T19:** `AlarmShelveStateCodec` (string↔enum, default Unshelved). Server `StreamRelayActor` maps `msg.Condition.*` + `Kind.ToString()` + nullable `OriginalRaiseTime` out; client `ConvertToDomainEvent` rebuilds `Condition` (severity = wire `Priority`) + `ParseAlarmKind` back. **Gotcha:** client imports `Google.Protobuf.WellKnownTypes`, so `Enum` is ambiguous — used `System.Enum.TryParse`. `confirmed` proto bool → domain `bool?` (false, never null after round-trip). diff --git a/docs/plans/2026-05-29-native-alarms.md.tasks.json b/docs/plans/2026-05-29-native-alarms.md.tasks.json index 8678acbd..70ba8e69 100644 --- a/docs/plans/2026-05-29-native-alarms.md.tasks.json +++ b/docs/plans/2026-05-29-native-alarms.md.tasks.json @@ -22,13 +22,13 @@ {"id": 19, "subject": "Task 19: gRPC alarm mapping (server + client)", "status": "completed", "blockedBy": [2, 18]}, {"id": 20, "subject": "Task 20: Management command contracts + registry", "status": "completed", "blockedBy": [4]}, {"id": 21, "subject": "Task 21: ManagementActor handlers", "status": "completed", "blockedBy": [6, 20]}, - {"id": 22, "subject": "Task 22: CLI commands", "status": "pending", "blockedBy": [20]}, - {"id": 23, "subject": "Task 23: DebugView alarm table enrichment", "status": "pending", "blockedBy": [2, 19]}, - {"id": 24, "subject": "Task 24: Template editor Native Alarm Sources subsection", "status": "pending", "blockedBy": [20]}, + {"id": 22, "subject": "Task 22: CLI commands", "status": "completed", "blockedBy": [20]}, + {"id": 23, "subject": "Task 23: DebugView alarm table enrichment", "status": "completed", "blockedBy": [2, 19]}, + {"id": 24, "subject": "Task 24: Template editor Native Alarm Sources subsection", "status": "completed", "blockedBy": [20]}, {"id": 25, "subject": "Task 25: Instance Configure native alarm source override panel", "status": "pending", "blockedBy": [20]}, {"id": 26, "subject": "Task 26: docker-env2 seed sample native alarm source", "status": "pending", "blockedBy": [22]}, {"id": 27, "subject": "Task 27: Documentation sync", "status": "pending", "blockedBy": [16, 19, 22, 23, 24, 25]}, {"id": 28, "subject": "Task 28: Integration / live verification", "status": "pending", "blockedBy": [10, 11, 12, 16, 19]} ], - "lastUpdated": "2026-05-31 batch-6-complete" + "lastUpdated": "2026-05-31 batch-7-complete" }