הכיול החד-פעמי של ולידטורי חילוץ-ההלכות (#81.8) הסתיים — הוסר מה-UI: - web-ui/src/app/goldset/page.tsx (הדף) - web-ui/src/components/goldset/goldset-panel.tsx (הרכיב) - web-ui/src/lib/api/goldset.ts (מודול ה-API) - הקישור "מדגם-זהב" מתפריט "פסיקה" + השטחת התת-כותרת "ניתוח וכיול" (נותר רק "מפת הקורפוס" → רשימה שטוחה) - ניקוי אזכורי gold-set מהערות approvals/page.tsx ו-chair.ts ה-backend נשאר במכוון: טבלת halacha_goldset, ה-endpoints (/api/goldset*) ופונקציות ה-DB משמשים את סקריפטי ה-eval/benchmark ומחזיקים נתוני-תיוג אנושיים — אין מחיקת DB ואין שבירת סקריפטים. /api/chair/pending ממילא לא כלל goldset, אז אין קישור שבור במרכז-האישורים. Invariants: G2 (הסרת יכולת-UF מיותרת ללא יצירת מסלול מקביל). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
import { apiRequest } from "./client";
|
|
|
|
/**
|
|
* Chair approval center (INV-G10) — aggregates every pending human-gate item
|
|
* (halacha approvals, missing precedents, unapplied feedback, QA-failed cases)
|
|
* so nothing Dafna must approve is forgotten.
|
|
*
|
|
* Hand-typed (not from the generated types.ts) because /api/chair/pending is a
|
|
* new endpoint; switch to the generated type after the next `npm run api:types`.
|
|
*/
|
|
export type ApprovalSeverity = "high" | "medium" | "low" | "ok";
|
|
|
|
export type ApprovalSample = { text: string; source: string; href?: string | null };
|
|
|
|
export type ApprovalCategory = {
|
|
key: string;
|
|
label: string;
|
|
description: string;
|
|
count: number;
|
|
severity: ApprovalSeverity;
|
|
href: string | null;
|
|
oldest_at?: string | null;
|
|
sample?: ApprovalSample[];
|
|
extra?: { total: number; reviewed: number };
|
|
};
|
|
|
|
export type PendingApprovals = {
|
|
total_pending: number;
|
|
generated_at: string;
|
|
categories: ApprovalCategory[];
|
|
};
|
|
|
|
export function usePendingApprovals() {
|
|
return useQuery({
|
|
queryKey: ["chair", "pending"],
|
|
queryFn: () => apiRequest<PendingApprovals>("/api/chair/pending"),
|
|
refetchInterval: 60_000,
|
|
staleTime: 30_000,
|
|
});
|
|
}
|