From 56cac3921697da98c9f6207bc72db4cf44a6d2a9 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Sun, 7 Jun 2026 15:10:00 -0400 Subject: [PATCH] refactor(scripting): extract script-callable types into Roslyn-free Core.Scripting.Abstractions (A0) --- ZB.MOM.WW.OtOpcUa.slnx | 1 + ...B.MOM.WW.OtOpcUa.Core.ScriptedAlarms.csproj | 1 + .../AlarmPredicateContext.cs | 0 .../ScriptContext.cs | 4 ++-- .../ScriptGlobals.cs | 0 .../VirtualTagContext.cs | 4 ++-- ....OtOpcUa.Core.Scripting.Abstractions.csproj | 18 ++++++++++++++++++ .../ZB.MOM.WW.OtOpcUa.Core.Scripting.csproj | 1 + .../ZB.MOM.WW.OtOpcUa.Core.VirtualTags.csproj | 1 + 9 files changed, 26 insertions(+), 4 deletions(-) rename src/Core/{ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms => ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions}/AlarmPredicateContext.cs (100%) rename src/Core/{ZB.MOM.WW.OtOpcUa.Core.Scripting => ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions}/ScriptContext.cs (96%) rename src/Core/{ZB.MOM.WW.OtOpcUa.Core.Scripting => ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions}/ScriptGlobals.cs (100%) rename src/Core/{ZB.MOM.WW.OtOpcUa.Core.VirtualTags => ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions}/VirtualTagContext.cs (95%) create mode 100644 src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions.csproj diff --git a/ZB.MOM.WW.OtOpcUa.slnx b/ZB.MOM.WW.OtOpcUa.slnx index 9b882fad..84564d37 100644 --- a/ZB.MOM.WW.OtOpcUa.slnx +++ b/ZB.MOM.WW.OtOpcUa.slnx @@ -6,6 +6,7 @@ + diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms.csproj b/src/Core/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms.csproj index 397e8537..86529489 100644 --- a/src/Core/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms.csproj +++ b/src/Core/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms.csproj @@ -17,6 +17,7 @@ + diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms/AlarmPredicateContext.cs b/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/AlarmPredicateContext.cs similarity index 100% rename from src/Core/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms/AlarmPredicateContext.cs rename to src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/AlarmPredicateContext.cs diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting/ScriptContext.cs b/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/ScriptContext.cs similarity index 96% rename from src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting/ScriptContext.cs rename to src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/ScriptContext.cs index 8b1d0767..8b6993dd 100644 --- a/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting/ScriptContext.cs +++ b/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/ScriptContext.cs @@ -13,7 +13,7 @@ namespace ZB.MOM.WW.OtOpcUa.Core.Scripting; /// /// /// Every member on this type MUST be serializable in the narrow sense that -/// can recognize tag-access call sites from the +/// DependencyExtractor can recognize tag-access call sites from the /// script AST. Method names used from scripts are locked — renaming /// or is a breaking change for every /// authored script and the dependency extractor must update in lockstep. @@ -36,7 +36,7 @@ public abstract class ScriptContext /// /// MUST be a string literal in the script source — dynamic /// paths (variables, concatenation, method-returned strings) are rejected at - /// publish by . This is intentional: the static + /// publish by DependencyExtractor. This is intentional: the static /// dependency set is required for the change-driven scheduler to subscribe to the /// right upstream tags at load time. /// diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting/ScriptGlobals.cs b/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/ScriptGlobals.cs similarity index 100% rename from src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting/ScriptGlobals.cs rename to src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/ScriptGlobals.cs diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Core.VirtualTags/VirtualTagContext.cs b/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/VirtualTagContext.cs similarity index 95% rename from src/Core/ZB.MOM.WW.OtOpcUa.Core.VirtualTags/VirtualTagContext.cs rename to src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/VirtualTagContext.cs index 1ca555a2..fafff3fb 100644 --- a/src/Core/ZB.MOM.WW.OtOpcUa.Core.VirtualTags/VirtualTagContext.cs +++ b/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/VirtualTagContext.cs @@ -7,8 +7,8 @@ namespace ZB.MOM.WW.OtOpcUa.Core.VirtualTags; /// /// Per-evaluation for a virtual-tag script. Reads come /// out of the engine's last-known-value cache (driver tags updated via the -/// subscription, virtual tags updated by prior -/// evaluations). Writes route through 's +/// ITagUpstreamSource subscription, virtual tags updated by prior +/// evaluations). Writes route through VirtualTagEngine's /// OnScriptSetVirtualTag callback so cross-tag write side effects still /// participate in change-trigger cascades (via the engine's CascadeAsync). /// diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions.csproj b/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions.csproj new file mode 100644 index 00000000..3b51d96a --- /dev/null +++ b/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions.csproj @@ -0,0 +1,18 @@ + + + + net10.0 + enable + enable + latest + true + true + $(NoWarn);CS1591 + + + + + + + + diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting/ZB.MOM.WW.OtOpcUa.Core.Scripting.csproj b/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting/ZB.MOM.WW.OtOpcUa.Core.Scripting.csproj index 2be3ecff..a99df539 100644 --- a/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting/ZB.MOM.WW.OtOpcUa.Core.Scripting.csproj +++ b/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting/ZB.MOM.WW.OtOpcUa.Core.Scripting.csproj @@ -21,6 +21,7 @@ + diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Core.VirtualTags/ZB.MOM.WW.OtOpcUa.Core.VirtualTags.csproj b/src/Core/ZB.MOM.WW.OtOpcUa.Core.VirtualTags/ZB.MOM.WW.OtOpcUa.Core.VirtualTags.csproj index 36b2e4e9..4e3e6f24 100644 --- a/src/Core/ZB.MOM.WW.OtOpcUa.Core.VirtualTags/ZB.MOM.WW.OtOpcUa.Core.VirtualTags.csproj +++ b/src/Core/ZB.MOM.WW.OtOpcUa.Core.VirtualTags/ZB.MOM.WW.OtOpcUa.Core.VirtualTags.csproj @@ -17,6 +17,7 @@ +