fix(renumber): update Paperclip issue linkage on case renumber #334

Merged
chaim merged 1 commits from worktree-renumber-paperclip-linkage into main 2026-06-28 10:20:00 +00:00
Owner

מה ולמה

renumber_cases.py שלב 6 עדכן רק את שם-הפרויקט ב-Paperclip והשאיר את קישור case↔issue על המספר הישן. get_case_issues() נשען על שני משטחי-טקסט שהסקריפט לא נגע בהם:

  • plugin_state.legal-case-number (value_json) — הקישור האותנטי של issues לתיק
  • issues.title — תגית [ערר {cn}] … שמסלול-החיפוש-לפי-כותרת מתאים

התוצאה: אחרי renumber, ה-issues נשארו על המספר הישן, get_case_issues החזיר [], ופעולות-אחרי-סופי (run-learning / run-halacha) דילגו בשקט עם reason no_issue — מוצג ב-UI כ-"לא הופעלה למידה". התגלה בתיק 8137-11-24 (שמספרו שונה מ-8137-24).

השינוי

  • שלב-Paperclip ב-apply_case מעדכן עכשיו את שלושת המשטחים (projects.name + plugin_state + כותרות-issues).
  • inspect_paperclip + דוח ה-dry-run מציגים את מספר שורות-הקישור וכותרות-ה-issues שישוכתבו.
  • docstring + SCRIPTS.md עודכנו.

המיגרציה של 11 התיקים כבר רצה; שורות-ה-DB התקועות תוקנו ידנית (באותה לוגיקה) לכל התיקים — כולל 8137-11-24 והשאר. השינוי הזה הוא ל-renumber עתידי.

Invariants

  • G1 — נרמול במקור: מתקנים את הקישור עצמו, לא workaround בזמן-קריאה.
  • G12 — הערה: סקריפט-מיגרציה חד-פעמי בצד-המארח שכבר ניגש ישירות ל-Paperclip DB לפי תכנונו (מתחת לשכבת ה-Port, כמו ה-projects/MinIO/Gitea הקיימים) — לא מוסיף מסלול-runtime מקביל דרך agent_platform_port.py.

🤖 Generated with Claude Code

## מה ולמה `renumber_cases.py` שלב 6 עדכן רק את שם-הפרויקט ב-Paperclip והשאיר את קישור case↔issue על המספר הישן. `get_case_issues()` נשען על שני משטחי-טקסט שהסקריפט לא נגע בהם: - `plugin_state.legal-case-number` (value_json) — הקישור האותנטי של issues לתיק - `issues.title` — תגית `[ערר {cn}] …` שמסלול-החיפוש-לפי-כותרת מתאים **התוצאה:** אחרי renumber, ה-issues נשארו על המספר הישן, `get_case_issues` החזיר `[]`, ופעולות-אחרי-סופי (run-learning / run-halacha) דילגו בשקט עם reason `no_issue` — מוצג ב-UI כ-**"לא הופעלה למידה"**. התגלה בתיק **8137-11-24** (שמספרו שונה מ-8137-24). ## השינוי - שלב-Paperclip ב-`apply_case` מעדכן עכשיו את **שלושת** המשטחים (projects.name + plugin_state + כותרות-issues). - `inspect_paperclip` + דוח ה-dry-run מציגים את מספר שורות-הקישור וכותרות-ה-issues שישוכתבו. - docstring + `SCRIPTS.md` עודכנו. המיגרציה של 11 התיקים כבר רצה; שורות-ה-DB התקועות תוקנו ידנית (באותה לוגיקה) לכל התיקים — כולל 8137-11-24 והשאר. השינוי הזה הוא ל-renumber עתידי. ## Invariants - **G1** — נרמול במקור: מתקנים את הקישור עצמו, לא workaround בזמן-קריאה. - **G12** — הערה: סקריפט-מיגרציה חד-פעמי בצד-המארח שכבר ניגש ישירות ל-Paperclip DB לפי תכנונו (מתחת לשכבת ה-Port, כמו ה-projects/MinIO/Gitea הקיימים) — לא מוסיף מסלול-runtime מקביל דרך `agent_platform_port.py`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-28 10:19:53 +00:00
fix(renumber): update Paperclip issue linkage on case renumber
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 4s
Lint — undefined names / undefined-names (pull_request) Successful in 11s
8932bd1f54
renumber_cases.py step 6 only renamed the Paperclip project, leaving the
case↔issue linkage on the OLD case number. get_case_issues() keys on two
text surfaces the script never touched:
  • plugin_state.legal-case-number (value_json) — the authoritative linkage
  • issues.title — the '[ערר {cn}] …' tag the title-path lookup matches

Result: after a renumber the issues kept the old number, get_case_issues
returned [], and post-final actions (run-learning / run-halacha) silently
skipped with reason "no_issue" — surfaced in the UI as "לא הופעלה למידה".
Discovered on case 8137-11-24 (renamed from 8137-24).

Now the Paperclip step rewrites all three surfaces (projects.name +
plugin_state + issue titles); inspect_paperclip + the dry-run report show
the linkage-row and issue-title counts that will be rewritten.

The 11-case migration already ran; the matching DB rows were fixed
manually (incl. this commit's logic) for all stale cases. This change is
for any future renumber.

Invariants: G1 (normalize at source — the linkage, not a read-time
workaround). G12 note: this is a one-time host-side migration script that
already connects directly to the Paperclip DB by design (below the platform
port, like the existing projects/MinIO/Gitea surgery) — it does not add a
parallel runtime path through agent_platform_port.py.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit 0bf787929c into main 2026-06-28 10:20:00 +00:00
chaim deleted branch worktree-renumber-paperclip-linkage 2026-06-28 10:20:01 +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#334