feat(vtags): decode VirtualTag Historize from artifact, byte-parity with composer (H5b, stillpending §1)

This commit is contained in:
Joseph Doherty
2026-06-15 10:17:08 -04:00
parent fc8121cbf3
commit 9c5a091395
2 changed files with 182 additions and 1 deletions
@@ -523,6 +523,14 @@ public static class DeploymentArtifact
var source = scriptId is not null && scriptSourceById.TryGetValue(scriptId, out var src)
? src : string.Empty;
// Historize: the artifact carries a Pascal-case "Historize" bool (ConfigComposer serialises
// the whole VirtualTag entity with DefaultIgnoreCondition.Never). Robust parse — default
// false; only honoured when the JSON value is an actual boolean — so absent/non-bool ⇒ false,
// byte-parity with Phase7Composer's entity-default-false behaviour.
var historize = el.TryGetProperty("Historize", out var hEl)
&& (hEl.ValueKind == JsonValueKind.True || hEl.ValueKind == JsonValueKind.False)
&& hEl.GetBoolean();
// Substitute the {{equip}} token with the owning equipment's tag base BEFORE extracting
// refs, so both Expression and DependencyRefs are machine-specific — byte-parity with
// Phase7Composer.Compose.
@@ -536,7 +544,8 @@ public static class DeploymentArtifact
Name: name!,
DataType: dataType ?? "BaseDataType",
Expression: expanded,
DependencyRefs: EquipmentScriptPaths.ExtractDependencyRefs(expanded)));
DependencyRefs: EquipmentScriptPaths.ExtractDependencyRefs(expanded),
Historize: historize));
}
result.Sort((a, b) =>