feat(scripts): ScriptAlarm.IsMesReportable + Alarms.MesReportableAsync() mirrored on both compile surfaces
Claude-Session: https://claude.ai/code/session_01Y5ef34iUUMjmwnMpL9xgmB
This commit is contained in:
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user