feat(scripts): ScriptAlarm.IsMesReportable + Alarms.MesReportableAsync() mirrored on both compile surfaces

Claude-Session: https://claude.ai/code/session_01Y5ef34iUUMjmwnMpL9xgmB
This commit is contained in:
Joseph Doherty
2026-09-11 10:12:47 -04:00
parent ce8fc092c8
commit 17d9a4cd2c
8 changed files with 92 additions and 4 deletions
@@ -56,6 +56,8 @@ public class RoslynScriptCompilerTests
var scope = Scope;
var currentAlarms = await Alarms.CurrentAsync();
var viaInstance = await Instance.Alarms.CurrentAsync();
var mesReportable = await Alarms.MesReportableAsync();
var flaggedAlarms = mesReportable.Where(a => a.IsMesReportable).ToList();
""";
var diagnostics = RoslynScriptCompiler.Compile(code, typeof(ScriptCompileSurface));
@@ -101,7 +103,12 @@ public class RoslynScriptCompilerTests
AckComment = a.OperatorComment,
}).ToList();
return new { WasSuccessful = true, ErrorText = (string)null, Alarms = infos };
// The pre-filtered accessor + the configured flag are the supported shape for
// "which alarms does MES care about?" — both must bind at design time.
var r = await Alarms.MesReportableAsync();
var f = r.Where(a => a.IsMesReportable).ToList();
return new { WasSuccessful = true, ErrorText = (string)null, Alarms = infos, Flagged = f.Count };
""";
Assert.Empty(RoslynScriptCompiler.Compile(code, typeof(ScriptCompileSurface)));