From 64e310a678acb275cc420b2d9b457441c85357d6 Mon Sep 17 00:00:00 2001 From: Harlan GitHub Agent Date: Sat, 12 Sep 2026 08:04:10 +1000 Subject: [PATCH] fix(identity): exclude broken repos from stuck leaderboard alarm --- .../identity/server/utils/daily-health-check.spec.ts | 9 +++++++++ layers/identity/server/utils/daily-health-check.ts | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/layers/identity/server/utils/daily-health-check.spec.ts b/layers/identity/server/utils/daily-health-check.spec.ts index 723c601b..a3c6eebf 100644 --- a/layers/identity/server/utils/daily-health-check.spec.ts +++ b/layers/identity/server/utils/daily-health-check.spec.ts @@ -520,6 +520,15 @@ describe('buildDailyHealthCheck', () => { 'organization', 'missing-repo', 'eligible', 'Reviewed purpose', 'test', ${nowSec - 901} ); + -- An upstream-deleted repository keeps its repos row with broken_since + -- set and no skills, so its review looks invisible forever. The + -- breakage is already known, so the review must not re-alarm nightly. + INSERT INTO owners VALUES ('gone-owner', 'user'); + INSERT INTO repos VALUES ('gone-owner', 'gone-repo', ${nowSec - 900}); + INSERT INTO skill_repo_eligibility VALUES ( + 'gone-owner', 'gone-repo', 'eligible', 'Reviewed purpose', 'test', + ${nowSec - 901} + ); `) const uncertain = await buildDailyHealthCheck(db, { now, fetcher, workerVersion: 'version-1' }) expect(uncertain.activity.digestsFailed24h).toBe(1) diff --git a/layers/identity/server/utils/daily-health-check.ts b/layers/identity/server/utils/daily-health-check.ts index 785002dc..124fe9c7 100644 --- a/layers/identity/server/utils/daily-health-check.ts +++ b/layers/identity/server/utils/daily-health-check.ts @@ -922,6 +922,10 @@ async function loadWeeklyRun(db: D1Database): Promise