ElkSharp: gateway face overflow redirect, under-node push-first routing, boundary-slot snap

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-04-01 10:35:23 +03:00
parent 5af14cf212
commit f275b8a267
30 changed files with 5632 additions and 2647 deletions

View File

@@ -181,7 +181,8 @@ internal static class ElkLayoutDiagnostics
Console.WriteLine(line);
if (!string.IsNullOrWhiteSpace(diagnostics.ProgressLogPath))
{
File.AppendAllText(diagnostics.ProgressLogPath, line + Environment.NewLine);
try { File.AppendAllText(diagnostics.ProgressLogPath, line + Environment.NewLine); }
catch { /* best effort */ }
}
WriteSnapshotLocked(diagnostics);
@@ -254,9 +255,16 @@ internal static class ElkLayoutDiagnostics
Directory.CreateDirectory(snapshotDir);
}
var tempPath = snapshotPath + ".tmp";
File.WriteAllText(tempPath, JsonSerializer.Serialize(diagnostics, SnapshotJsonOptions));
File.Copy(tempPath, snapshotPath, overwrite: true);
File.Delete(tempPath);
try
{
var tempPath = snapshotPath + ".tmp";
File.WriteAllText(tempPath, JsonSerializer.Serialize(diagnostics, SnapshotJsonOptions));
File.Copy(tempPath, snapshotPath, overwrite: true);
try { File.Delete(tempPath); } catch { /* best effort cleanup */ }
}
catch
{
// Diagnostics snapshot is best-effort; never crash the layout engine.
}
}
}