fix(style-panel): idempotency + dedup — הרצה חוזרת לא משכפלת לקחים #162

Merged
chaim merged 1 commits from worktree-style-panel-dedup into main 2026-06-08 10:58:16 +00:00
Owner

לפני כתיבת לקחי-ה-2/2-keep, הפאנל מדלג על כל לקח שטקסטו (מנורמל) כבר קיים בקורפוס (מכל מקור), וגם מקפל כפילויות בתוך אותה ריצה. כך כפתור "הרץ למידת-קול" בטוח ללחיצה חוזרת (הרמס עשוי להריץ שוב את ה-pipeline) — הוא מתכנס במקום לצבור כפילויות.

אומת על בל"מ 8126-03-25: הרצת --apply חוזרת עם 7 לקחים קיימים כתבה 0 ("1 כפילויות דולגו"), המספר נשאר 7.

Invariants: INV-LRN1/G10 ללא שינוי (הצעות בלבד, הטמעה ידנית).

🤖 Generated with Claude Code

לפני כתיבת לקחי-ה-2/2-keep, הפאנל מדלג על כל לקח שטקסטו (מנורמל) כבר קיים בקורפוס (מכל מקור), וגם מקפל כפילויות בתוך אותה ריצה. כך כפתור "הרץ למידת-קול" בטוח ללחיצה חוזרת (הרמס עשוי להריץ שוב את ה-pipeline) — הוא מתכנס במקום לצבור כפילויות. **אומת** על בל"מ 8126-03-25: הרצת `--apply` חוזרת עם 7 לקחים קיימים כתבה 0 ("1 כפילויות דולגו"), המספר נשאר 7. Invariants: INV-LRN1/G10 ללא שינוי (הצעות בלבד, הטמעה ידנית). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-08 10:58:11 +00:00
style_lesson_panel.py: before writing 2/2-keep lessons, skip any whose normalized
lesson_text already exists on the corpus (any source), and collapse duplicates within
a run. Makes the run-learning button safe to click repeatedly (the curator may re-run
the pipeline) — it converges instead of piling up duplicate decision_lessons.

Verified on בל"מ 8126-03-25: re-running --apply with 7 existing lessons wrote 0
("1 כפילויות דולגו"), count stayed 7.

Invariants: INV-LRN1/G10 unchanged (proposals only, manual fold).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit 7ebd4187a9 into main 2026-06-08 10:58:16 +00:00
chaim deleted branch worktree-style-panel-dedup 2026-06-08 10:58:16 +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#162