From f008820ec89406e43950d3d40b04d24ccdca1e47 Mon Sep 17 00:00:00 2001 From: Chaim Date: Sat, 30 May 2026 22:08:27 +0000 Subject: [PATCH] feat(reindex): health-check stale_embedding_case_law count (GAP-09, FU-3) Co-Authored-By: Claude Sonnet 4.6 --- mcp-server/src/legal_mcp/services/metrics.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mcp-server/src/legal_mcp/services/metrics.py b/mcp-server/src/legal_mcp/services/metrics.py index 02243c5..230beee 100644 --- a/mcp-server/src/legal_mcp/services/metrics.py +++ b/mcp-server/src/legal_mcp/services/metrics.py @@ -129,6 +129,9 @@ async def get_dashboard() -> dict: cases_with_stale_blocks = await conn.fetchval( "SELECT COUNT(*) FROM cases WHERE blocks_stale" ) + stale_embedding_case_law = await conn.fetchval( + "SELECT COUNT(*) FROM case_law " + "WHERE coalesce(full_text,'') <> '' AND content_hash IS DISTINCT FROM indexed_hash") # QA summary qa_total = await conn.fetchval("SELECT COUNT(DISTINCT case_id) FROM qa_results") @@ -162,6 +165,7 @@ async def get_dashboard() -> dict: "case_law_entries": total_case_law, "non_searchable_case_law": non_searchable_case_law, "cases_with_stale_blocks": cases_with_stale_blocks, + "stale_embedding_case_law": stale_embedding_case_law, }, "cases_by_status": cases_by_status, "qa": {