fix(extraction): reconcile לתיקים-יתומים בתור — pending+requested_at=NULL (#139) #264
Reference in New Issue
Block a user
Delete Branch "worktree-extraction-orphan-reconcile"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
הבעיה (#139)
תיק יכול להיות
<kind>_extraction_status='pending'עם_requested_at IS NULL— מעולם-לא-נכנס-לתור (מסלולי bulk/מיגרציה, או status שנכתב לפני החותם). הדריינר סורקrequested_at IS NOT NULL→ עיוור אליו לנצח, וה-backlog מתנקז בשקט.requeue_stale_processing_extractionsמרפא רק'processing'. נצפה 2026-06-14: 96 תיקיםpendingאך 0 בתור (תוקנו ידנית).התיקון (G1 — שחזור invariant במקור · G2 — predicate יחיד · kind-agnostic)
db.reconcile_orphaned_pending_extractions(kind=)— מחזיר את invariant "שורה ברת-חילוץ ⇒ בתור": חותםrequested_atל-rows שהםpending+requested_at IS NULL+EXTRACTION_ELIGIBLE_PREDICATE(אותו מסנן של #140 — cited_only/chunkless לעולם לא נדחפים). אידמפוטנטי.process_pending_extractionsקורא reconcile אחריrequeue_staleולפניlist— תיקים-משוחזרים נקלטים באותו pass. מנגנון-ריפוי יחיד (G2):requeue_stale='processing',reconcile='pending'.request_halacha_extractionמציבstatus='pending'עם החותם (סימטרי ל-request_metadata_extraction) — סוגר את חלון-ה-drift שמייצרpending+NULL מלכתחילה.המצב החי נקי (0 יתומים-כשירים אחרי התיקון-הידני של 14.6); זהו תיקון מונע — הדריינר יְרַפֵּא יתומים עתידיים אוטומטית, לשני התורים.
בדיקות
test_extraction_orphan_reconcile(חדש) — predicate משותף,pending+NULL בלבד, מובחן מ-requeue_stale(לא נוגע ב-processing),request_halachaסימטרי. פרמטרי לשני ה-kinds.undefined-names+leak-guardנקיים.Invariants
EXTRACTION_ELIGIBLE_PREDICATEמשותף עם #140; מנגנון-ריפוי יחיד (לא מסלול מקביל)logger.warning)🤖 Generated with Claude Code