From 7bbec7771679ba6ffcdc42544d6a7ce1c2208fc1 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Mon, 13 Jul 2026 10:46:30 -0400 Subject: [PATCH] refactor(runtime,opcuaserver): device-host normalization re-homed to Commons DeviceConfigIntent (R2-11) --- ...tagconfig-consolidation-plan.md.tasks.json | 2 +- .../AddressSpaceComposer.cs | 58 +++---------------- .../Drivers/DeploymentArtifact.cs | 4 +- .../Drivers/DriverHostActor.cs | 6 +- .../AddressSpaceComposerDeviceHostTests.cs | 35 ++--------- ...DeploymentArtifactDeviceHostParityTests.cs | 2 +- .../Drivers/DriverHostActorDiscoveryTests.cs | 2 +- 7 files changed, 19 insertions(+), 90 deletions(-) diff --git a/archreview/plans/R2-11-tagconfig-consolidation-plan.md.tasks.json b/archreview/plans/R2-11-tagconfig-consolidation-plan.md.tasks.json index 8db81f17..b38dcc59 100644 --- a/archreview/plans/R2-11-tagconfig-consolidation-plan.md.tasks.json +++ b/archreview/plans/R2-11-tagconfig-consolidation-plan.md.tasks.json @@ -7,7 +7,7 @@ { "id": "T3", "subject": "TagConfigIntent + TagAlarmIntent in Commons/Types (TDD; port composer semantics verbatim + OpcUaServer ExtractTag* test tables)", "status": "completed", "blockedBy": [] }, { "id": "T4", "subject": "DeviceConfigIntent (TryExtractHost/NormalizeHost) in Commons/Types (TDD)", "status": "completed", "blockedBy": [] }, { "id": "T5", "subject": "AddressSpaceComposer swap: single TagConfigIntent.Parse per tag, delete 4 Extract* statics (P-1 parse-once)", "status": "completed", "blockedBy": ["T1", "T3"] }, - { "id": "T6", "subject": "Device-host re-home: composer TryExtractDeviceHost/NormalizeDeviceHost → DeviceConfigIntent; update DriverHostActor + DeploymentArtifact callers", "status": "pending", "blockedBy": ["T4", "T5"] }, + { "id": "T6", "subject": "Device-host re-home: composer TryExtractDeviceHost/NormalizeDeviceHost → DeviceConfigIntent; update DriverHostActor + DeploymentArtifact callers", "status": "completed", "blockedBy": ["T4", "T5"] }, { "id": "T7", "subject": "DeploymentArtifact swap: delete 4 private mirrors, parse once per tag element via TagConfigIntent", "status": "pending", "blockedBy": ["T5"] }, { "id": "T8", "subject": "DraftValidator swap: Configuration→Commons ProjectReference; ExtractTagConfigFullName → TagConfigIntent.ExplicitFullName (null-on-absent preserved)", "status": "pending", "blockedBy": ["T2", "T3"] }, { "id": "T9", "subject": "EquipmentNodeWalker.ExtractFullName delegates to TagConfigIntent; repoint tree-wide canonical-parser doc cites", "status": "pending", "blockedBy": ["T2", "T3"] }, diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/AddressSpaceComposer.cs b/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/AddressSpaceComposer.cs index fe429e78..eff3d232 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/AddressSpaceComposer.cs +++ b/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/AddressSpaceComposer.cs @@ -1,5 +1,4 @@ using System.Diagnostics; -using System.Text.Json; using ZB.MOM.WW.OtOpcUa.Commons.Types; using ZB.MOM.WW.OtOpcUa.Configuration.Entities; using ZB.MOM.WW.OtOpcUa.Configuration.Enums; @@ -66,11 +65,11 @@ public sealed record UnsLineProjection(string UnsLineId, string UnsAreaId, strin /// (both null ⇒ driver-less / no device), copied straight from the Equipment row. /// is the device's connection host (e.g. "10.0.0.5:8193") resolved from the /// bound Device's schemaless DeviceConfig JSON via -/// null when there is no device, no -/// HostAddress in its config, or the host cannot be parsed. These three let a later task graft a -/// driver's discovered FixedTree onto an equipment that has zero authored tags, and partition a +/// null when there +/// is no device, no HostAddress in its config, or the host cannot be parsed. These three let a later +/// task graft a driver's discovered FixedTree onto an equipment that has zero authored tags, and partition a /// multi-device driver by host. The value is normalized identically on both the live-edit composer and -/// the artifact-decode sides (single source of truth: ); +/// the artifact-decode sides (single source of truth: ); /// the later partition task MUST normalize the driver-discovered device-host folder segment the same way /// (trim + lower-case) so the two compare equal. /// Address-space-rebuild interaction (accepted trade-off). These three fields participate in @@ -350,8 +349,8 @@ public static class AddressSpaceComposer var resolvedScripts = scripts ?? Array.Empty