fix(#78): trigger extraction wakeup on committee-decision upload + surface silent failures #39

Merged
chaim merged 1 commits from fix/78-precedent-extraction-wakeup into main 2026-06-02 12:06:56 +00:00
Owner

הבעיה (שורש #78)

נתיב /api/internal-decisions/upload — שבו ה-UI משתמש להעלאת החלטות ועדת-ערר — לא קרא ל-pc_wake_for_precedent_extraction, אז ה-CEO מעולם לא הוער והחילוץ נתקע ב-halacha_extraction_status='pending' לנצח. זה השורש מאחורי 8027-25 התקוע. שני נתיבי ההעלאה האחרים (precedent_library, missing-precedent) כן מעירים — רק זה היה חסר.

בנוסף: pc_wake_for_precedent_extraction מחזיר {ok:False} בלי לזרוק כש-wakeup מדולג/נכשל → השגיאה נבלעה בשקט והתיק נשאר pending בלי שום אינדיקציה.

התיקון

  • internal-decisions upload: הוספת ה-wakeup, עם ניתוב חברה לפי prefix מספר התיק (1xxx→רישוי, 8xxx→היטל, 9xxx→פיצויים) כשה-practice_area ריק — אחרת תיק 8xxx מנותב בטעות ל-CEO של רישוי.
  • שלושת נתיבי ההעלאה: כשל wakeup שלא-זורק נרשם עכשיו כ-WARNING עם הסיבה, וה-progress נושא extraction_queued.

נדחה

מנקז מתוזמן (scheduled precedent_process_pending) — ה-wakeup החסר היה הכשל בפועל; הרצה ידנית נשארת מסלול ההתאוששות.

🤖 Generated with Claude Code

## הבעיה (שורש #78) נתיב `/api/internal-decisions/upload` — שבו ה-UI משתמש להעלאת החלטות ועדת-ערר — **לא קרא** ל-`pc_wake_for_precedent_extraction`, אז ה-CEO מעולם לא הוער והחילוץ נתקע ב-`halacha_extraction_status='pending'` לנצח. זה השורש מאחורי 8027-25 התקוע. שני נתיבי ההעלאה האחרים (precedent_library, missing-precedent) כן מעירים — רק זה היה חסר. בנוסף: `pc_wake_for_precedent_extraction` מחזיר `{ok:False}` **בלי לזרוק** כש-wakeup מדולג/נכשל → השגיאה נבלעה בשקט והתיק נשאר pending בלי שום אינדיקציה. ## התיקון - **internal-decisions upload**: הוספת ה-wakeup, עם ניתוב חברה לפי prefix מספר התיק (1xxx→רישוי, 8xxx→היטל, 9xxx→פיצויים) כשה-practice_area ריק — אחרת תיק 8xxx מנותב בטעות ל-CEO של רישוי. - **שלושת נתיבי ההעלאה**: כשל wakeup שלא-זורק נרשם עכשיו כ-WARNING עם הסיבה, וה-progress נושא `extraction_queued`. ## נדחה מנקז מתוזמן (scheduled `precedent_process_pending`) — ה-wakeup החסר היה הכשל בפועל; הרצה ידנית נשארת מסלול ההתאוששות. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-02 12:06:52 +00:00
The /api/internal-decisions/upload path (used by the UI for ועדת-ערר
decisions) never called pc_wake_for_precedent_extraction, so committee
decisions were stuck at halacha_extraction_status='pending' forever — the
CEO was never woken to drain the queue. Root cause behind 8027-25's stuck
extraction. The other two upload paths (precedent_library, missing-precedent)
already wake the CEO; this one was missing it.

- internal-decisions upload: add the wakeup, routing the company by case
  number prefix (1xxx→רישוי, 8xxx→היטל, 9xxx→פיצויים) when practice_area is
  empty (else an 8xxx case wrongly routes to the licensing CEO).
- all three call sites: the wake helper returns {ok:False} WITHOUT raising
  on a skipped/failed wakeup; that was silently dropped. Now logged at
  WARNING with the reason, and the upload progress carries extraction_queued.

Fallback drainer (scheduled precedent_process_pending) deferred — the
missing wakeup was the actual failure; manual precedent_process_pending
remains the recovery path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit 2d7ab26c71 into main 2026-06-02 12:06:56 +00:00
chaim deleted branch fix/78-precedent-extraction-wakeup 2026-06-02 12:06:56 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ezer-mishpati/legal-ai#39