diff --git a/mcp-server/src/legal_mcp/services/db.py b/mcp-server/src/legal_mcp/services/db.py index 45669fe..708ad27 100644 --- a/mcp-server/src/legal_mcp/services/db.py +++ b/mcp-server/src/legal_mcp/services/db.py @@ -7915,7 +7915,33 @@ _MP_PROVENANCE_COLS = """, WHERE pic.cited_case_law_id = mp.linked_case_law_id AND COALESCE(src.case_number, '') <> '' ) AS cited_by_precedents, - substring(mp.notes from 'מס''?\\s*([0-9]+)') AS yomon_number""" + substring(mp.notes from 'מס''?\\s*([0-9]+)') AS yomon_number, + -- Bridge to the corpus citation graph (G2: read-time, no stored + -- duplication). For an OPEN gap (no linked_case_law_id yet) find + -- which committee DECISIONS cite this ruling, matched on the + -- normalized docket number (same normalization the relinker uses: + -- strip to digits/dashes, slash->dash). Surfaces "צוטט ע\"י <יו\"ר>" + -- + the deciding case number in the UI. + (SELECT array_agg(DISTINCT src.chair_name ORDER BY src.chair_name) + FROM precedent_internal_citations picc + JOIN case_law src ON src.id = picc.source_case_law_id + AND src.source_kind = 'internal_committee' + WHERE split_part(mp.citation_norm, '|', 2) <> '' + AND regexp_replace(replace(picc.cited_case_number, '/', '-'), + '[^0-9-]', '', 'g') + = split_part(mp.citation_norm, '|', 2) + AND COALESCE(src.chair_name, '') <> '' + ) AS cited_by_chairs, + (SELECT array_agg(DISTINCT src.case_number ORDER BY src.case_number) + FROM precedent_internal_citations picd + JOIN case_law src ON src.id = picd.source_case_law_id + AND src.source_kind = 'internal_committee' + WHERE split_part(mp.citation_norm, '|', 2) <> '' + AND regexp_replace(replace(picd.cited_case_number, '/', '-'), + '[^0-9-]', '', 'g') + = split_part(mp.citation_norm, '|', 2) + AND COALESCE(src.case_number, '') <> '' + ) AS cited_by_decisions""" async def list_missing_precedents( diff --git a/web-ui/src/app/missing-precedents/page.tsx b/web-ui/src/app/missing-precedents/page.tsx index 5188f8b..197b276 100644 --- a/web-ui/src/app/missing-precedents/page.tsx +++ b/web-ui/src/app/missing-precedents/page.tsx @@ -22,12 +22,12 @@ import { MissingPrecedentsTable } from "@/components/missing-precedents/missing- type StatusFilter = MissingPrecedentStatus | "all"; +// Only the two states the chair acts on: open gaps to fill, and closed gaps for +// reference. "הועלה" (transient) and "לא-רלוונטי" were dropped from the filter, +// and "הכל" with them (chair's request, design 09). const STATUS_CHIPS: { value: StatusFilter; label: string }[] = [ { value: "open", label: "פתוח" }, - { value: "uploaded", label: "הועלה" }, { value: "closed", label: "נסגר" }, - { value: "irrelevant", label: "לא-רלוונטי" }, - { value: "all", label: "הכל" }, ]; export default function MissingPrecedentsPage() { @@ -145,15 +145,13 @@ export default function MissingPrecedentsPage() {
linked_case_law_id
{" "}
- ונסגר. פריט שאינו רלוונטי מסומן{" "}
-