@@ -1839,7 +1839,9 @@ function elapsed(ms) {
18391839 return Math.round(m / 60) + "h";
18401840}
18411841function since(iso) {
1842- const diff = Date.parse(iso) - Date.now();
1842+ const timestamp = Date.parse(iso);
1843+ if (!Number.isFinite(timestamp)) return "";
1844+ const diff = timestamp - Date.now();
18431845 const minutes = Math.round(diff / 60000);
18441846 if (Math.abs(minutes) < 90) return rel.format(minutes, "minute");
18451847 return rel.format(Math.round(minutes / 60), "hour");
@@ -1899,7 +1901,7 @@ const STATUS_CONTAINER_FIELDS = new Set([
18991901 "comment_sync", "automerge", "automerge_reliability", "closed_items", "closed_stats",
19001902 "operation_counts", "events", "reasons", "cursor", "exact_review_queue",
19011903 "recent_durable_publication_events", "collection", "review", "publication", "handoff_health",
1902- "phases", "pressure", "bay_projection", "activity", "queue_stages", "live_stages", "stages",
1904+ "phases", "pending", "dispatching", "leased", " pressure", "bay_projection", "activity", "queue_stages", "live_stages", "stages",
19031905 "active_stages", "window", "direct", "batch", "counts", "buckets", "provenance",
19041906 "backoff_reasons", "parked_reasons", "recovery_reasons", "errors"
19051907]);
@@ -1914,7 +1916,7 @@ const STATUS_TEXT_FIELDS = new Set([
19141916]);
19151917const STATUS_TEXT_VALUES = new Set([
19161918 "active", "apply", "applying", "arriving", "all_clear", "amber", "assist", "automerge",
1917- "background-review", "cancelled", "closing", "congested", "commit-review", "completed",
1919+ "background-review", "cancelled", "closing", "complete", " congested", "commit-review", "completed",
19181920 "completed_review_journeys", "degraded", "exact-review", "failure", "github-checks", "green",
19191921 "healthy", "hot-review", "in_progress", "idle", "issue_to_pr", "job", "live", "neutral",
19201922 "needs_attention", "other", "pending", "processed", "publishing", "pr_repair", "queued",
@@ -2477,11 +2479,12 @@ const DASHBOARD_HEALTH_HISTORY_RANGE_MS = {
24772479};
24782480const DASHBOARD_HEALTH_HISTORY_SAMPLE_MS = 5 * 60 * 1000;
24792481const DASHBOARD_HEALTH_HISTORY_RETENTION_DAYS = 7;
2482+ const DASHBOARD_HEALTH_HISTORY_MAX_TOTAL = 1000000000000;
24802483const DASHBOARD_HEALTH_HISTORY_STATUSES = ["healthy", "degraded", "stalled", "unknown"];
24812484const DASHBOARD_HEALTH_HISTORY_HANDOFF_STATUSES = ["idle", "healthy", "degraded", "stalled"];
24822485const DASHBOARD_HEALTH_HISTORY_WRITER_MODES = ["single_item", "batch", "mixed", "unknown"];
2483- function dashboardHealthHistoryOptionalCount(value) {
2484- return value === undefined ? undefined : dashboardObservabilityCount(value);
2486+ function dashboardHealthHistoryOptionalCount(value, maximum = DASHBOARD_OBSERVABILITY_MAX_COUNT ) {
2487+ return value === undefined ? undefined : dashboardObservabilityCount(value, maximum );
24852488}
24862489function dashboardHealthHistoryPercentiles(value) {
24872490 const source = dashboardObservabilityObject(value);
@@ -2501,8 +2504,8 @@ function dashboardHealthHistoryLane(value, includeShed) {
25012504 const source = dashboardObservabilityObject(value);
25022505 if (!source) return null;
25032506 const pending = dashboardObservabilityCount(source.pending);
2504- const enqueuedTotal = dashboardHealthHistoryOptionalCount(source.enqueued_total);
2505- const completedTotal = dashboardHealthHistoryOptionalCount(source.completed_total);
2507+ const enqueuedTotal = dashboardHealthHistoryOptionalCount(source.enqueued_total, DASHBOARD_HEALTH_HISTORY_MAX_TOTAL );
2508+ const completedTotal = dashboardHealthHistoryOptionalCount(source.completed_total, DASHBOARD_HEALTH_HISTORY_MAX_TOTAL );
25062509 const shedTotal = includeShed ? dashboardHealthHistoryOptionalCount(source.shed_total) : undefined;
25072510 if (
25082511 pending === null || enqueuedTotal === null || completedTotal === null || shedTotal === null ||
@@ -4197,11 +4200,14 @@ function automergeWorkerHealthHtml(reliability) {
41974200 return '<section class="worker-health-section" aria-labelledby="automerge-worker-health-title"><div class="worker-health-subhead"><strong id="automerge-worker-health-title">Automerge worker operations</strong><span class="muted">Repair workflow reliability only · separate from Automerge Product Health success rate.</span></div>' + stats + sample + (rows ? '<div class="side-list">' + rows + '</div>' : '<div class="empty">No automerge worker failures in the recent sample.</div>') + '</section>';
41984201}
41994202function renderClosedItems(rows) {
4200- if (!rows.length) {
4201- document.getElementById("closed").innerHTML = '<div class="empty">No ClawSweeper closes found...</div>';
4203+ const visible = (Array.isArray(rows) ? rows : []).filter(row =>
4204+ Number.isFinite(Date.parse(row?.closed_at || ""))
4205+ );
4206+ if (!visible.length) {
4207+ document.getElementById("closed").innerHTML = '<div class="empty">Individual close details are unavailable; aggregate counts remain above.</div>';
42024208 return;
42034209 }
4204- document.getElementById("closed").innerHTML = '<div class="side-list">' + rows .map(row => '<article class="side-row"><div class="side-main"><div class="row-top"><span class="pill">' + esc(row.type) + '</span>' + linkClass(row.url, row.repository + "#" + row.number, "item-link") + '</div><div class="muted side-title">' + esc(row.title) + '</div></div><div class="side-meta">' + since(row.closed_at) + '</div></article>').join("") + '</div>';
4210+ document.getElementById("closed").innerHTML = '<div class="side-list">' + visible .map(row => '<article class="side-row"><div class="side-main"><div class="row-top"><span class="pill">' + esc(row.type) + '</span>' + linkClass(row.url, row.repository + "#" + row.number, "item-link") + '</div><div class="muted side-title">' + esc(row.title) + '</div></div><div class="side-meta">' + since(row.closed_at) + '</div></article>').join("") + '</div>';
42054211}
42064212function renderClosedStats(stats) {
42074213 const safe = stats || { total: 0, issues: 0, prs: 0, window_hours: 24 };
0 commit comments