Merge pull request 'feat(goldset): soft consistency warning between is_holding and type' (#103) from worktree-goldset-consistency-warn into main
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 37s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 37s
This commit was merged in pull request #103.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { Check, X, ChevronDown, ChevronLeft, Info } from "lucide-react";
|
import { Check, X, ChevronDown, ChevronLeft, Info, AlertTriangle } from "lucide-react";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
@@ -21,6 +21,23 @@ const TYPES: { value: string; label: string }[] = [
|
|||||||
{ value: "persuasive", label: "משכנע" },
|
{ value: "persuasive", label: "משכנע" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Consistency between is_holding and the type (#81.7): a real holding is
|
||||||
|
// binding/interpretive/procedural/persuasive; a NON-holding is its reason —
|
||||||
|
// application (fact-bound) or obiter (not decided). Other pairings contradict.
|
||||||
|
const HOLDING_TYPES = new Set(["binding", "interpretive", "procedural", "persuasive"]);
|
||||||
|
const NON_HOLDING_TYPES = new Set(["application", "obiter"]);
|
||||||
|
|
||||||
|
function inconsistentTag(it: GoldsetItem): string | null {
|
||||||
|
if (it.is_holding === null || !it.correct_type) return null;
|
||||||
|
if (it.is_holding === true && NON_HOLDING_TYPES.has(it.correct_type)) {
|
||||||
|
return "סימנת \"הלכה\" אך הסוג הוא יישום/אמרת-אגב — אלה דווקא הסיבות שמשהו אינו הלכה.";
|
||||||
|
}
|
||||||
|
if (it.is_holding === false && HOLDING_TYPES.has(it.correct_type)) {
|
||||||
|
return "סימנת \"לא הלכה\" אך הסוג מציין הלכה (מחייבת/פרשני/…); ל\"לא\" מתאים יישום או אמרת-אגב.";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const FLAG_LABELS: Record<string, string> = {
|
const FLAG_LABELS: Record<string, string> = {
|
||||||
non_decision: "אי-הכרעה", truncated_quote: "ציטוט קטוע", thin_restatement: "ניסוח דק",
|
non_decision: "אי-הכרעה", truncated_quote: "ציטוט קטוע", thin_restatement: "ניסוח דק",
|
||||||
quote_unverified: "ציטוט לא מאומת", nli_unsupported: "כלל לא נגזר", application: "יישום",
|
quote_unverified: "ציטוט לא מאומת", nli_unsupported: "כלל לא נגזר", application: "יישום",
|
||||||
@@ -232,6 +249,12 @@ function TagCard({
|
|||||||
onClick={() => onTag({ correct_type: t.value })}>{t.label}</Button>
|
onClick={() => onTag({ correct_type: t.value })}>{t.label}</Button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
{inconsistentTag(it) && (
|
||||||
|
<p className="mt-1 text-[0.68rem] text-amber-700 flex items-start gap-1">
|
||||||
|
<AlertTriangle className="w-3 h-3 mt-0.5 shrink-0" />
|
||||||
|
{inconsistentTag(it)}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{/* quote_complete */}
|
{/* quote_complete */}
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user