feat(server): route OPC UA Part 9 AddComment to ScriptedAlarmEngine

RouteScriptedAlarmMethodCalls now handles ConditionType.AddComment
alongside Acknowledge/Confirm, dispatching to engine.AddCommentAsync.
An empty comment is rejected by the Part 9 state machine and surfaced
as BadInvalidArgument. MapCallOperation gates AddComment at the
AlarmAcknowledge tier — there is no dedicated AddComment permission bit.

Closes phase-7-status.md Gap 1: all Part 9 alarm methods now route to
the engine. Adds 3 unit tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-05-18 09:43:03 -04:00
parent c5915700bd
commit 419eda256b
5 changed files with 87 additions and 12 deletions

View File

@@ -33,6 +33,14 @@ public sealed class CallGatingTests
.ShouldBe(OpcUaOperation.AlarmConfirm);
}
[Fact]
public void MapCallOperation_AddComment_maps_to_AlarmAcknowledge()
{
// AddComment has no dedicated permission bit; it gates at the Acknowledge tier.
DriverNodeManager.MapCallOperation(MethodIds.ConditionType_AddComment)
.ShouldBe(OpcUaOperation.AlarmAcknowledge);
}
[Fact]
public void MapCallOperation_generic_method_maps_to_Call()
{