From 727534acba31ada6d2292821ee0f976e17c2e495 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 5 Jun 2026 15:36:58 +0100 Subject: [PATCH] Align VoidBot swarm CTB rows --- src/Mimir.EveDashboard/Program.cs | 60 +++++++++++++++++++++++-------- state/evidence.jsonl | 1 + 2 files changed, 46 insertions(+), 15 deletions(-) diff --git a/src/Mimir.EveDashboard/Program.cs b/src/Mimir.EveDashboard/Program.cs index 20ce8e7..f239c61 100644 --- a/src/Mimir.EveDashboard/Program.cs +++ b/src/Mimir.EveDashboard/Program.cs @@ -2520,16 +2520,9 @@ internal sealed class VoidBotSwarmProvider : IDashboardProvider { var turn = upcoming[index]; var identityId = StringValue(turn, "identityId") ?? ""; - var active = !string.IsNullOrWhiteSpace(StringValue(turn, "activeJobId")); - var mentionCount = NumberValue(turn, "pendingMentionCount") ?? 0; - var rest = TryGet(turn, "restState"); - var napping = BoolValue(rest, "isNapping") == true; - var state = active ? "active" : mentionCount > 0 ? "mention" : napping ? "nap" : Minutes(NumberValue(turn, "nextTurnInMinutes")); - var speed = NumberValue(turn, "effectiveSpeed") ?? 0; - var heat = NumberValue(turn, "heat") ?? 0; rows.Add(UiElement.Text( $"ctb-row-{index}-{identityId}", - $"{index + 1,2}. {(StringValue(turn, "displayName") ?? identityId),-10} {state,-7} s{speed:0.###} h{heat:0.##}", + FormatCtbRow(turn, index), "mono")); } @@ -2551,16 +2544,11 @@ internal sealed class VoidBotSwarmProvider : IDashboardProvider .Select((turn, index) => { var identityId = StringValue(turn, "identityId") ?? $"turn-{index}"; - var active = !string.IsNullOrWhiteSpace(StringValue(turn, "activeJobId")); - var mentionCount = NumberValue(turn, "pendingMentionCount") ?? 0; - var rest = TryGet(turn, "restState"); - var napping = BoolValue(rest, "isNapping") == true; - var state = active ? "active" : mentionCount > 0 ? "mention" : napping ? "nap" : Minutes(NumberValue(turn, "nextTurnInMinutes")); var heat = NumberValue(turn, "heat") ?? 0; var speed = NumberValue(turn, "effectiveSpeed") ?? 0; return UiElement.Text( $"upcoming-face-{index}-{identityId}", - $"{index + 1,2}. {(StringValue(turn, "displayName") ?? identityId),-10} {state,-8} {StringValue(turn, "repoName") ?? "repo"} spd {speed:0.###} heat {heat:0.##}", + $"{index + 1,2}. {(StringValue(turn, "displayName") ?? identityId),-10} {TurnStatus(turn),-7} {Minutes(NumberValue(turn, "nextTurnInMinutes")),6} {MentionText(turn),-5} {StringValue(turn, "repoName") ?? "repo"} spd {speed:0.###} heat {heat:0.##}", "mono"); }) .ToArray(); @@ -2898,7 +2886,49 @@ internal sealed class VoidBotSwarmProvider : IDashboardProvider return "unknown"; } - return value <= 0 ? "ready" : $"{value:0.#}m"; + return value <= 0 ? "ready" : value < 10 ? $"{value:0.0}m" : $"{value:0}m"; + } + + private static string FormatCtbRow(JsonElement turn, int index) + { + var identityId = StringValue(turn, "identityId") ?? ""; + var displayName = StringValue(turn, "displayName") ?? identityId; + var speed = NumberValue(turn, "effectiveSpeed") ?? 0; + var heat = NumberValue(turn, "heat") ?? 0; + return $"{index + 1,2}. {displayName,-10} {TurnStatus(turn),-7} {Minutes(NumberValue(turn, "nextTurnInMinutes")),6} {MentionText(turn),-5} s{speed:0.###} h{heat:0.##}"; + } + + private static string TurnStatus(JsonElement turn) + { + if (!string.IsNullOrWhiteSpace(StringValue(turn, "activeJobId"))) + { + return "active"; + } + + if ((NumberValue(turn, "pendingMentionCount") ?? 0) > 0) + { + return "mention"; + } + + return BoolValue(TryGet(turn, "restState"), "isNapping") == true ? "nap" : "idle"; + } + + private static string MentionText(JsonElement turn) + { + var count = (int)Math.Max(0, NumberValue(turn, "pendingMentionCount") ?? 0); + if (count <= 0) + { + return "-"; + } + + var unanchored = (int)Math.Max(0, NumberValue(turn, "unanchoredMentionCount") ?? 0); + var anchored = (int)Math.Max(0, NumberValue(turn, "anchoredMentionCount") ?? count - unanchored); + if (unanchored > 0 && anchored <= 0) + { + return $"m?{count}"; + } + + return unanchored > 0 ? $"m{anchored}?{unanchored}" : $"m{count}"; } private static string Truncate(string value, int max) => diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 11f74c5..386eba9 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -376,3 +376,4 @@ {"ts": "2026-06-03T05:33:56+01:00", "type": "implementation", "status": "ok", "note": "Daemon-status cut: Fensalir now validates pid-file process identity before reporting local daemons online, so reused PIDs surface as stale-pid instead of false health. Move sync remote receiver imports errno, degrades on HID write failures, and bioacoustic render preflight has a timeout. Live supervisor now has relay, recorder, Fensalir, Well, and Move sync resolving to dotnet/exe/python identities; Well remains 6/6 Ready at 40 ms. Current Move sync is online but waiting on Realtek loopback frames, not crashed."} {"ts": "2026-06-03T05:36:16+01:00", "type": "implementation", "status": "ok", "note": "Fensalir daemon status now marks Move sync as waiting when the process identity is valid but move-sync/online-sync.jsonl is missing or empty. Hot-restarted Fensalir; Eve dashboard reported Online Daemons 5/6 while health stayed caught-up, matching the live state: relay, recorder, Fensalir, Well, and Move worker are alive, but Move score has no Realtek loopback frames yet."} {"ts": "2026-06-04T11:07:48+01:00", "type": "decision", "status": "ok", "note": "Existing Well captures are synchronization evidence, not continuous media bodies: future recording/streaming daemons must drink typed stream-frame/body refs from the Well, while the Well owns ingest, clock mapping, source heartbeat/reacquire, and operator-alert publication only."} +{"ts": "2026-06-05T15:36:45+01:00", "type": "implementation", "status": "ok", "note": "Nightwing/Gjallar VoidBot swarm CTB rows now use the same justified rank/name/state/due/mention/speed/heat contract as the provider-owned VoidBot CultMesh surface; Mimir.EveDashboard was published and deployed to Nightwing, and ws://192.168.1.75:8795/eve/deck/voidbot.swarm returned aligned rows."}