fix(bridge): audit cron source counts only 'finished' run actions

This commit is contained in:
Manohar 2026-06-10 15:06:24 +00:00
parent 50a6520c20
commit 7e352eea7b

View file

@ -165,6 +165,8 @@ function cronEvents(): AuditEvent[] {
} catch { } catch {
continue; continue;
} }
// Run files log lifecycle actions; only "finished" carries the outcome.
if (run.action && run.action !== "finished") continue;
const ts = run.startedAt ?? run.ts ?? run.runAtMs ?? run.timestamp; const ts = run.startedAt ?? run.ts ?? run.runAtMs ?? run.timestamp;
if (!ts) continue; if (!ts) continue;
const iso = typeof ts === "number" ? new Date(ts).toISOString() : toIso(String(ts)); const iso = typeof ts === "number" ? new Date(ts).toISOString() : toIso(String(ts));