Resolve all 46 low-severity architecture review findings

This commit is contained in:
Joseph Doherty
2026-09-09 22:56:36 -04:00
parent fef3e7675f
commit 9ee402bbcd
139 changed files with 2621 additions and 1082 deletions
@@ -52,6 +52,35 @@ public class FlowGraphBuilderTests
return [inbound, route, wait, run, write2, write1, cascade];
}
[Fact]
public void InferredDeviceCascade_IsDashed()
{
var parent = ScadaBridgeAuditEventFactory.Create(AuditChannel.ScriptTrace, AuditKind.AttributeWrite,
AuditStatus.Delivered, executionId: Root);
var child = ScadaBridgeAuditEventFactory.Create(AuditChannel.ScriptTrace, AuditKind.ScriptRun,
AuditStatus.Delivered, executionId: SiteRun, parentExecutionId: Root,
extra: new ScriptTraceExtra { TriggerSource = "inferred-device-update" }.ToJson());
var edge = Assert.Single(FlowGraphBuilder.Build([parent, child]).Edges);
Assert.True(edge.Spawn);
Assert.True(edge.External);
}
[Theory]
[InlineData(null, "terminal stack")]
[InlineData("old stack", null)]
public void Fold_UsesLatestErrorDetail(string? initialDetail, string? finalDetail)
{
var correlation = Guid.NewGuid();
var first = ScadaBridgeAuditEventFactory.Create(AuditChannel.ApiOutbound, AuditKind.CachedSubmit,
AuditStatus.Submitted, occurredAtUtc: T0, correlationId: correlation, errorDetail: initialDetail);
var last = ScadaBridgeAuditEventFactory.Create(AuditChannel.ApiOutbound, AuditKind.CachedResolve,
AuditStatus.Failed, occurredAtUtc: T0.AddSeconds(1), correlationId: correlation, errorDetail: finalDetail);
var step = Assert.Single(FlowGraphBuilder.Build([first, last]).Steps);
Assert.Equal(finalDetail, step.ErrorDetail);
Assert.Equal(initialDetail, step.Lifecycle![0].ErrorDetail);
Assert.Equal(finalDetail, step.Lifecycle[1].ErrorDetail);
}
[Fact]
public void DelmiaShape_ProjectsLanes_Edges_AndSynthesizedResponse()
{
@@ -90,6 +119,7 @@ public class FlowGraphBuilderTests
var external = Assert.Single(graph.Edges, e => e.External);
Assert.Equal(graph.Steps[3].EventId, external.FromEventId);
Assert.Equal(graph.Steps[4].EventId, external.ToEventId);
Assert.Equal(graph.Edges.Count, graph.Edges.Select(e => (e.FromEventId, e.ToEventId)).Distinct().Count());
// The cascade run hangs off the write that spawned it (same site, no boundary) — a Spawn edge (D9);
// the route → run edge and every in-chain edge are not.