feat(cases): תצוגת "פסיקה שצוטטה בהחלטה" בעמוד-התיק + שחזור חיווט-הרמס

UI שביקש חיים: בכניסה להחלטה רואים את הפסיקה שצוטטה בתוכה — מקושרת לספרייה
(קליק → /precedents/[id]) מול חסרה (סומנה אוטומטית להעלאה).

- web/app.py: GET /api/cases/{case}/citations — מהשורה internal_committee של
  ההחלטה ב-case_law → precedent_internal_citations: linked (join case_law) +
  missing (unresolved + האם flagged ב-missing_precedents).
- web-ui: lib/api/citations.ts (hook) + CitationsSection ב-drafts-panel
  (מוצג כשההחלטה בספרייה). מקושרת=ירוק/קליק, חסרה=ענבר "סומנה להעלאה".
- scripts/curator_apply_pipeline_branch.py: מקור-אמת לחיווט-הכפתורים של הרמס
  (ה-prompt חי רק ב-Paperclip DB). מקדים branch שמריץ את pipeline-ה-final
  ל-wake reason final_learning_*/final_halacha_* (HOME/DOTENV/DATA_DIR מוחלטים
  → מפתחות DeepSeek+Gemini + DATA_DIR נפתרים נכון). idempotent, שני הסוכנים.
  כבר הוחל ב-DB; הסקריפט לשחזור אחרי reset.

אומת: py_compile ✓ · tsc ✓ · החיווט אומת חי על 8126 (deepseek+gemini, dedup,
✓ pipeline הושלם). G2 (יכולת חסרה) · INV-LRN1/G10 נשמרים.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 11:59:21 +00:00
parent 2c4287fd3d
commit 98c5feff25
5 changed files with 273 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
/**
* Citations domain — precedents CITED inside a case's signed decision.
* Powers the case-page "פסיקה שצוטטה בהחלטה" panel.
*/
import { useQuery } from "@tanstack/react-query";
import { apiRequest } from "./client";
export type LinkedCitation = {
citation: string;
cited_id: string;
case_name: string;
court: string;
precedent_level: string;
};
export type MissingCitation = {
citation: string;
flagged: boolean;
};
export type CaseCitations = {
in_library: boolean;
case_law_id?: string;
linked: LinkedCitation[];
missing: MissingCitation[];
};
export function useCaseCitations(caseNumber: string | undefined) {
return useQuery({
queryKey: ["case-citations", caseNumber ?? ""],
queryFn: ({ signal }) =>
apiRequest<CaseCitations>(`/api/cases/${caseNumber}/citations`, { signal }),
enabled: Boolean(caseNumber),
staleTime: 10_000,
});
}