feat(precedents): minimum-effort upload — file+citation, rest auto-extracted
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m35s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m35s
The missing-precedents drawer + general precedent upload both required the user to type chair_name, district, practice_area, court, date etc. upfront — even though those fields can be (and already are, post-upload) extracted from the document text by the LLM. The metadata-extraction wakeup also only fired for the /precedent-library/upload path, leaving missing-precedents committee uploads stuck with whatever stub the user typed. Changes: - Extractor learns chair_name + district, overwrites the new PLACEHOLDER_PENDING_EXTRACTION sentinel for internal_committee rows (the DB CHECK forces non-empty; we stamp the placeholder at insert). - missing_precedent_upload no longer 400s on missing chair/district; it infers district from the citation when possible, falls back to the placeholder, and always fires pc_wake_for_precedent_extraction so the LLM can fill in the rest. - Both upload sheets default to file (+ citation) only; every other field is tucked into a closed <details> labeled "אופציונלי — דריסה ידנית של שדות שיחולצו אוטומטית". Required validators on chair/ district/practice_area dropped — the LLM fills them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -93,10 +93,6 @@ export function PrecedentUploadSheet({ open, onOpenChange }: Props) {
|
||||
toast.error("מראה המקום (citation) חובה");
|
||||
return;
|
||||
}
|
||||
if (!practiceArea) {
|
||||
toast.error("בחר תחום משפט");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const tags = subjectTags
|
||||
.split(",")
|
||||
@@ -132,8 +128,9 @@ export function PrecedentUploadSheet({ open, onOpenChange }: Props) {
|
||||
<SheetHeader>
|
||||
<SheetTitle className="text-navy">העלאת פסיקה לקורפוס הסמכותי</SheetTitle>
|
||||
<SheetDescription className="text-ink-muted">
|
||||
הקובץ יעבור חילוץ טקסט, יצירת embeddings, וחילוץ הלכות אוטומטי.
|
||||
ההלכות יחכו לאישורך לפני שהן זמינות לסוכני הכתיבה.
|
||||
הקובץ יעבור חילוץ טקסט, embeddings, וחילוץ אוטומטי של מטא־דאטה
|
||||
(שם, ערכאה, תאריך, תחום, תת־סוג, תגיות) והלכות. ההלכות ימתינו
|
||||
לאישורך לפני שיהיו זמינות לסוכני הכתיבה.
|
||||
</SheetDescription>
|
||||
</SheetHeader>
|
||||
|
||||
@@ -159,104 +156,109 @@ export function PrecedentUploadSheet({ open, onOpenChange }: Props) {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Two-col grid */}
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="case-name">שם קצר</Label>
|
||||
<Input id="case-name" value={caseName}
|
||||
onChange={(e) => setCaseName(e.target.value)}
|
||||
placeholder="ב. קרן-נכסים" disabled={isProcessing} />
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="court">ערכאה</Label>
|
||||
<Input id="court" value={court}
|
||||
onChange={(e) => setCourt(e.target.value)}
|
||||
placeholder='בית משפט עליון / בג"ץ / מנהלי / ועדת ערר'
|
||||
disabled={isProcessing} />
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="date">תאריך החלטה</Label>
|
||||
<Input id="date" type="date" value={decisionDate}
|
||||
onChange={(e) => setDecisionDate(e.target.value)}
|
||||
disabled={isProcessing} />
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="appeal-subtype">תת-סוג (חופשי)</Label>
|
||||
<Input id="appeal-subtype" value={appealSubtype}
|
||||
onChange={(e) => setAppealSubtype(e.target.value)}
|
||||
placeholder="שימוש חורג / סופיות ההחלטה" disabled={isProcessing} />
|
||||
</div>
|
||||
</div>
|
||||
<details className="group rounded-md border border-rule bg-rule-soft/30">
|
||||
<summary className="cursor-pointer select-none px-3 py-2 text-[0.78rem] text-ink-muted hover:text-navy">
|
||||
אופציונלי — דריסה ידנית של שדות שיחולצו אוטומטית מהמסמך
|
||||
</summary>
|
||||
<div className="space-y-3 border-t border-rule px-3 py-3">
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="case-name">שם קצר</Label>
|
||||
<Input id="case-name" value={caseName}
|
||||
onChange={(e) => setCaseName(e.target.value)}
|
||||
placeholder="ב. קרן-נכסים" disabled={isProcessing} />
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="court">ערכאה</Label>
|
||||
<Input id="court" value={court}
|
||||
onChange={(e) => setCourt(e.target.value)}
|
||||
placeholder='בית משפט עליון / בג"ץ / מנהלי / ועדת ערר'
|
||||
disabled={isProcessing} />
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="date">תאריך החלטה</Label>
|
||||
<Input id="date" type="date" value={decisionDate}
|
||||
onChange={(e) => setDecisionDate(e.target.value)}
|
||||
disabled={isProcessing} />
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="appeal-subtype">תת-סוג (חופשי)</Label>
|
||||
<Input id="appeal-subtype" value={appealSubtype}
|
||||
onChange={(e) => setAppealSubtype(e.target.value)}
|
||||
placeholder="שימוש חורג / סופיות ההחלטה" disabled={isProcessing} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Practice area (required radio) */}
|
||||
<div className="space-y-1">
|
||||
<Label>תחום משפט (חובה)</Label>
|
||||
<div className="flex gap-4 flex-wrap">
|
||||
{PRACTICE_AREAS.map((a) => (
|
||||
<label key={a.value} className="flex items-center gap-2 cursor-pointer">
|
||||
<input
|
||||
type="radio" name="practice_area" value={a.value}
|
||||
checked={practiceArea === a.value}
|
||||
onChange={() => setPracticeArea(a.value as PracticeArea)}
|
||||
disabled={isProcessing}
|
||||
/>
|
||||
<span className="text-sm text-ink">{a.label}</span>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="source-type">סוג מקור</Label>
|
||||
<Select value={sourceType || "_none"}
|
||||
onValueChange={(v) => setSourceType(v === "_none" ? "" : v as SourceType)}
|
||||
disabled={isProcessing}>
|
||||
<SelectTrigger><SelectValue placeholder="—" /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="_none">—</SelectItem>
|
||||
{SOURCE_TYPES.map((s) => (
|
||||
<SelectItem key={s.value} value={s.value}>{s.label}</SelectItem>
|
||||
<div className="space-y-1">
|
||||
<Label>תחום משפט</Label>
|
||||
<div className="flex gap-4 flex-wrap">
|
||||
{PRACTICE_AREAS.map((a) => (
|
||||
<label key={a.value} className="flex items-center gap-2 cursor-pointer">
|
||||
<input
|
||||
type="radio" name="practice_area" value={a.value}
|
||||
checked={practiceArea === a.value}
|
||||
onChange={() => setPracticeArea(a.value as PracticeArea)}
|
||||
disabled={isProcessing}
|
||||
/>
|
||||
<span className="text-sm text-ink">{a.label}</span>
|
||||
</label>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="source-type">סוג מקור</Label>
|
||||
<Select value={sourceType || "_none"}
|
||||
onValueChange={(v) => setSourceType(v === "_none" ? "" : v as SourceType)}
|
||||
disabled={isProcessing}>
|
||||
<SelectTrigger><SelectValue placeholder="—" /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="_none">—</SelectItem>
|
||||
{SOURCE_TYPES.map((s) => (
|
||||
<SelectItem key={s.value} value={s.value}>{s.label}</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="precedent-level">רמת תקדים</Label>
|
||||
<Select value={precedentLevel || "_none"}
|
||||
onValueChange={(v) => setPrecedentLevel(v === "_none" ? "" : v)}
|
||||
disabled={isProcessing}>
|
||||
<SelectTrigger><SelectValue placeholder="—" /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="_none">—</SelectItem>
|
||||
{PRECEDENT_LEVELS.map((l) => (
|
||||
<SelectItem key={l.value} value={l.value}>{l.label}</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="tags">תגיות נושא (מופרדות בפסיקים)</Label>
|
||||
<Input id="tags" value={subjectTags}
|
||||
onChange={(e) => setSubjectTags(e.target.value)}
|
||||
placeholder="חניה, קווי בניין, שיקול דעת" disabled={isProcessing} />
|
||||
</div>
|
||||
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="headnote">תקציר / headnote</Label>
|
||||
<Textarea id="headnote" value={headnote} rows={2}
|
||||
onChange={(e) => setHeadnote(e.target.value)}
|
||||
placeholder="תקציר חופשי שיוצג ברשימה" disabled={isProcessing} dir="rtl" />
|
||||
</div>
|
||||
|
||||
<label className="flex items-center gap-2 cursor-pointer">
|
||||
<input type="checkbox" checked={isBinding}
|
||||
onChange={(e) => setIsBinding(e.target.checked)}
|
||||
disabled={isProcessing} />
|
||||
<span className="text-sm">הלכה מחייבת</span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="precedent-level">רמת תקדים</Label>
|
||||
<Select value={precedentLevel || "_none"}
|
||||
onValueChange={(v) => setPrecedentLevel(v === "_none" ? "" : v)}
|
||||
disabled={isProcessing}>
|
||||
<SelectTrigger><SelectValue placeholder="—" /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="_none">—</SelectItem>
|
||||
{PRECEDENT_LEVELS.map((l) => (
|
||||
<SelectItem key={l.value} value={l.value}>{l.label}</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="tags">תגיות נושא (מופרדות בפסיקים)</Label>
|
||||
<Input id="tags" value={subjectTags}
|
||||
onChange={(e) => setSubjectTags(e.target.value)}
|
||||
placeholder="חניה, קווי בניין, שיקול דעת" disabled={isProcessing} />
|
||||
</div>
|
||||
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="headnote">תקציר / headnote (אופציונלי)</Label>
|
||||
<Textarea id="headnote" value={headnote} rows={2}
|
||||
onChange={(e) => setHeadnote(e.target.value)}
|
||||
placeholder="תקציר חופשי שיוצג ברשימה" disabled={isProcessing} dir="rtl" />
|
||||
</div>
|
||||
|
||||
<label className="flex items-center gap-2 cursor-pointer">
|
||||
<input type="checkbox" checked={isBinding}
|
||||
onChange={(e) => setIsBinding(e.target.checked)}
|
||||
disabled={isProcessing} />
|
||||
<span className="text-sm">הלכה מחייבת</span>
|
||||
</label>
|
||||
</details>
|
||||
|
||||
{isProcessing && (
|
||||
<div className="rounded-lg border border-rule bg-rule-soft/40 p-4 space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user