feat(web-ui): expose citation-corroboration badge on halachot (X11)
- db.list_halachot: aggregate corroboration_count (distinct positive sources) + corroboration_negative from halacha_citation_corroboration (LEFT JOIN) - web-ui: CorroborationBadge — 'מתוקף · N ציטוטים' at ≥2 (gold), soft single citation, danger badge on negative treatment; native title tooltips - shown in ExtractedHalachotSection (per-precedent) + halacha review panel Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
51
web-ui/src/components/precedents/corroboration-badge.tsx
Normal file
51
web-ui/src/components/precedents/corroboration-badge.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
import { Scale, AlertTriangle } from "lucide-react";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import type { Halacha } from "@/lib/api/precedent-library";
|
||||
|
||||
/* X11 — citation corroboration signal for a halacha.
|
||||
*
|
||||
* Shows how many distinct later courts/committees adopted this halacha
|
||||
* (positive treatment). ≥2 distinct positive sources = "מתוקף" (the
|
||||
* auto-approve threshold, INV-COR4); a single citation is shown more
|
||||
* softly. A negative treatment (distinguished/criticized/overruled) is
|
||||
* surfaced as a warning — those never auto-approve and an overruled one
|
||||
* is sent back to the chair gate (INV-COR2). Renders nothing when there
|
||||
* is no citation signal at all. */
|
||||
export function CorroborationBadge({ halacha }: { halacha: Halacha }) {
|
||||
const count = halacha.corroboration_count ?? 0;
|
||||
const negative = halacha.corroboration_negative ?? false;
|
||||
|
||||
if (negative) {
|
||||
return (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="text-[0.65rem] bg-danger-bg text-danger border-danger/40"
|
||||
title="ערכאה/ועדה מאוחרת אבחנה, מתחה ביקורת או ביטלה הלכה זו — אינה מאושרת אוטומטית בתיקוף-ציטוטים (X11)"
|
||||
>
|
||||
<AlertTriangle className="w-3 h-3 me-1" /> טיפול שלילי בציטוט
|
||||
</Badge>
|
||||
);
|
||||
}
|
||||
|
||||
if (count <= 0) return null;
|
||||
|
||||
const corroborated = count >= 2;
|
||||
return (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className={
|
||||
corroborated
|
||||
? "text-[0.65rem] bg-gold-wash text-gold-deep border-gold/40 tabular-nums"
|
||||
: "text-[0.65rem] bg-rule-soft text-ink-muted tabular-nums"
|
||||
}
|
||||
title={
|
||||
corroborated
|
||||
? `מתוקף ע"י ${count} ערכאות/ועדות מאוחרות שאימצו הלכה זו (טיפול שיפוטי מצטבר, X11)`
|
||||
: "ציטוט מאמת בודד — מתחת לסף התיקוף (נדרשים ≥2 מקורות בלתי-תלויים, X11)"
|
||||
}
|
||||
>
|
||||
<Scale className="w-3 h-3 me-1" />
|
||||
{corroborated ? `מתוקף · ${count} ציטוטים` : "ציטוט מאמת · 1"}
|
||||
</Badge>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user