v3 B1-WP6: migrate Core + Server test projects to greenfield schema

Fix TESTS only (production already green) so the four in-scope test projects
compile + pass under the v3 dark address space:

- Core.Abstractions.Tests: drop AllowedNamespaceKinds/NamespaceKindCompatibility
  from DriverTypeMetadata; rewrite EquipmentTagRefResolver tests to the single-func
  RawPath-lookup contract (no parseRef/transient cache).
- Core.Tests: rewrite EquipmentNodeWalkerTests to EquipmentNamespaceContent(Areas,
  Lines,Equipment,VirtualTags?,ScriptedAlarms?) — folders + VirtualTags +
  ScriptedAlarms only; raw-tag variables dark (skipped Batch-4 placeholder). Drop
  retired Equipment.DriverInstanceId.
- Runtime.Tests: rewrite golden corpus + TagConfigCorpusParityTests to the v3
  RawPath/RawTagEntry round-trip (byte + TagConfigIntent parity; EquipmentTags dark).
  Salvage VirtualTag + ScriptedAlarm artifact parity to the new Compose signature.
  Retire the equipment-tag-materialization parity files (Array/Historize/Alias) and
  the equipment-device-binding DeviceHost parity to documented skipped placeholders.
  Skip 34 dark equipment-tag routing/value/alarm/write/discovery actor tests with a
  shared DarkAddressSpaceReasons constant. Re-key cluster-scoped tests to v3 UNS
  line->area attribution.
- ControlPlane.Tests: ConfigComposer round-trips re-keyed to RawFolder/Device (no
  Namespaces); tag-config gate resolves driver via Device; deploy-gate collision test
  re-keyed to UnsEffectiveNameCollision; drop retired BadCrossClusterNamespaceBinding
  case.
This commit is contained in:
Joseph Doherty
2026-07-15 21:26:00 -04:00
parent 604928b29d
commit 329144b1aa
26 changed files with 425 additions and 1445 deletions
@@ -198,7 +198,7 @@ public sealed class DeploymentArtifactTests
/// <c>ns.Kind == NamespaceKind.Equipment</c> predicate (only Equipment-kind namespaces route
/// into EquipmentTags, so such a tag routes nowhere).
/// </summary>
[Fact]
[Fact(Skip = DarkAddressSpaceReasons.EquipmentTagsDarkBatch4)]
public void ParseComposition_reads_EquipmentTags_from_equipment_namespace()
{
var blob = JsonSerializer.SerializeToUtf8Bytes(new
@@ -405,17 +405,20 @@ public sealed class DeploymentArtifactTests
};
[Fact]
public void ParseComposition_scoped_keeps_only_my_clusters_drivers_and_tags()
public void ParseComposition_scoped_keeps_only_my_clusters_drivers()
{
// v3: DriverInstance cluster scoping still holds. The EquipmentTags leg of the original assertion
// is dark this batch (equipment-tag plans don't materialize until Batch 4) — see
// TagConfigCorpusParityTests + DarkAddressSpaceReasons.
var blob = BlobOf(MultiClusterSnapshotWithTags());
var main = DeploymentArtifact.ParseComposition(blob, "central-1:4053");
main.DriverInstancePlans.Select(d => d.DriverInstanceId).ShouldBe(new[] { "main-galaxy" });
main.EquipmentTags.Select(t => t.TagId).ShouldBe(new[] { "t-main" });
main.EquipmentTags.ShouldBeEmpty(); // dark this batch
var siteA = DeploymentArtifact.ParseComposition(blob, "site-a-1:4053");
siteA.DriverInstancePlans.Select(d => d.DriverInstanceId).ShouldBe(new[] { "sa-galaxy" });
siteA.EquipmentTags.Select(t => t.TagId).ShouldBe(new[] { "t-sa" });
siteA.EquipmentTags.ShouldBeEmpty(); // dark this batch
}
[Fact]
@@ -444,10 +447,22 @@ public sealed class DeploymentArtifactTests
new { DriverInstanceId = "main-modbus", DriverType = "Modbus", DriverConfig = "{}", ClusterId = "MAIN", NamespaceId = "main-ns" },
new { DriverInstanceId = "sa-modbus", DriverType = "Modbus", DriverConfig = "{}", ClusterId = "SITE-A", NamespaceId = "sa-ns" },
},
// v3: equipment carries no driver binding — it is attributed to a cluster solely via its UNS
// line's area cluster (Equipment -> UnsLine.UnsAreaId -> UnsArea.ClusterId).
UnsAreas = new[]
{
new { UnsAreaId = "a-main", Name = "AreaMain", ClusterId = "MAIN" },
new { UnsAreaId = "a-sa", Name = "AreaSa", ClusterId = "SITE-A" },
},
UnsLines = new[]
{
new { UnsLineId = "l1", UnsAreaId = "a-main", Name = "L1" },
new { UnsLineId = "l2", UnsAreaId = "a-sa", Name = "L2" },
},
Equipment = new[]
{
new { EquipmentId = "eq-main", Name = "eqm", UnsLineId = "l1", DriverInstanceId = "main-modbus" },
new { EquipmentId = "eq-sa", Name = "eqs", UnsLineId = "l2", DriverInstanceId = "sa-modbus" },
new { EquipmentId = "eq-main", Name = "eqm", UnsLineId = "l1" },
new { EquipmentId = "eq-sa", Name = "eqs", UnsLineId = "l2" },
},
Scripts = new[]
{
@@ -500,7 +515,7 @@ public sealed class DeploymentArtifactTests
/// <summary>Verifies the inconsistency callback fires when a kept equipment's UNS line belongs to
/// another cluster (a cross-cluster orphan binding).</summary>
[Fact]
[Fact(Skip = DarkAddressSpaceReasons.EquipmentDeviceBindingRetired)]
public void ParseComposition_scoped_flags_cross_cluster_orphan_equipment()
{
var warnings = new List<string>();
@@ -622,9 +637,11 @@ public sealed class DeploymentArtifactTests
comp.EquipmentVirtualTags.ShouldBeEmpty();
}
/// <summary>Verifies the unchanged driver-bound path: equipment with an in-cluster DriverInstanceId is
/// kept even when (as here) no UNS line/area rows describe it — attribution is still by driver.</summary>
[Fact]
/// <summary>RETIRED (v3): equipment no longer carries a DriverInstanceId, so there is no driver-bound
/// attribution path — equipment is attributed to a cluster solely via its UNS line's area
/// (Driverless_equipment_kept_when_its_line_area_is_in_cluster is the v3 replacement, and passes).
/// The original premise ("attribution is still by driver") no longer exists.</summary>
[Fact(Skip = DarkAddressSpaceReasons.EquipmentDeviceBindingRetired)]
public void Driverbound_equipment_kept_when_driver_in_cluster()
{
var blob = BlobOf(new