Merge pull request 'fix(halacha-queue): route only true extraction defects to "needs re-extraction"' (#302) from worktree-halacha-fix-bucket-predicate into main
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 43s
G12 Leak-Guard / leak-guard (push) Successful in 4s
Lint — undefined names / undefined-names (push) Successful in 10s

This commit was merged in pull request #302.
This commit is contained in:
2026-06-19 10:09:46 +00:00

View File

@@ -646,11 +646,26 @@ export function useHalachotPending(opts: { limit?: number; search?: string } = {
});
}
/** Genuine extraction defects — the rule TEXT is malformed, so it needs re-extraction
* (not a chair keep/drop judgment). Mirrors the backend's DEFECT set in
* scripts/halacha_panel_approve.py; other flags (e.g. `application` = fact-specific
* application) are judgment signals, NOT defects, and the panel deliberately skips them. */
const EXTRACTION_DEFECT_FLAGS = new Set([
"quote_unverified",
"truncated_quote",
"thin_restatement",
"near_duplicate",
]);
/** A pending item belongs in the "needs extraction fix" segment when it carries a
* quality flag AND the panel never deliberated it (no round). Everything else —
* deliberated items and clean items — is a chair-judgment item. (#133 unified queue) */
* genuine extraction-DEFECT flag AND the panel never deliberated it (no round).
* Everything else — deliberated items, clean items, and items flagged only for
* chair judgment (e.g. `application`) — is a chair-judgment item. (#133 unified queue) */
export function isExtractionFixItem(h: Halacha): boolean {
return !h.panel_round && (h.quality_flags?.length ?? 0) > 0;
return (
!h.panel_round &&
(h.quality_flags ?? []).some((f) => EXTRACTION_DEFECT_FLAGS.has(f))
);
}
export function useHalachotByStatus(status: string, limit = 300) {