feat(composer): admit GalaxyMxGateway-backed equipment alias tags (+byte-parity)

This commit is contained in:
Joseph Doherty
2026-06-11 21:10:21 -04:00
parent 4b4738a891
commit bc9e83ed9f
4 changed files with 211 additions and 3 deletions
@@ -471,8 +471,11 @@ public static class DeploymentArtifact
if (isEquipment) equipmentNamespaces.Add(id!);
}
// driverInstanceId → namespaceId
// driverInstanceId → namespaceId, and driverInstanceId → DriverType. The DriverType map admits
// a Galaxy alias (a GalaxyMxGateway-backed equipment-scoped tag) that lives in a SystemPlatform
// namespace — byte-parity with the composer's `di.DriverType == "GalaxyMxGateway"` clause.
var driverToNamespace = new Dictionary<string, string>(StringComparer.Ordinal);
var driverToType = new Dictionary<string, string>(StringComparer.Ordinal);
foreach (var el in diArr.EnumerateArray())
{
if (el.ValueKind != JsonValueKind.Object) continue;
@@ -480,6 +483,9 @@ public static class DeploymentArtifact
var ns = el.TryGetProperty("NamespaceId", out var nsEl) ? nsEl.GetString() : null;
if (!string.IsNullOrWhiteSpace(id) && !string.IsNullOrWhiteSpace(ns))
driverToNamespace[id!] = ns!;
var dtype = el.TryGetProperty("DriverType", out var dtEl) ? dtEl.GetString() : null;
if (!string.IsNullOrWhiteSpace(id) && !string.IsNullOrWhiteSpace(dtype))
driverToType[id!] = dtype!;
}
var result = new List<EquipmentTagPlan>(tagsArr.GetArrayLength());
@@ -502,7 +508,10 @@ public static class DeploymentArtifact
if (string.IsNullOrWhiteSpace(tagId) || string.IsNullOrWhiteSpace(di) || string.IsNullOrWhiteSpace(name)) continue;
if (!driverToNamespace.TryGetValue(di!, out var nsId)) continue;
if (!equipmentNamespaces.Contains(nsId)) continue;
// A GalaxyMxGateway-backed alias qualifies even though its namespace is SystemPlatform-kind
// (not Equipment) — byte-parity with the composer's broadened equipment-tag filter.
var isGalaxyAlias = driverToType.TryGetValue(di!, out var dtype2) && dtype2 == "GalaxyMxGateway";
if (!equipmentNamespaces.Contains(nsId) && !isGalaxyAlias) continue;
result.Add(new EquipmentTagPlan(
TagId: tagId!,