fix(renumber): update Paperclip issue linkage on case renumber #334
Reference in New Issue
Block a user
Delete Branch "worktree-renumber-paperclip-linkage"
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?
מה ולמה
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) דילגו בשקט עם reasonno_issue— מוצג ב-UI כ-"לא הופעלה למידה". התגלה בתיק 8137-11-24 (שמספרו שונה מ-8137-24).השינוי
apply_caseמעדכן עכשיו את שלושת המשטחים (projects.name + plugin_state + כותרות-issues).inspect_paperclip+ דוח ה-dry-run מציגים את מספר שורות-הקישור וכותרות-ה-issues שישוכתבו.SCRIPTS.mdעודכנו.המיגרציה של 11 התיקים כבר רצה; שורות-ה-DB התקועות תוקנו ידנית (באותה לוגיקה) לכל התיקים — כולל 8137-11-24 והשאר. השינוי הזה הוא ל-renumber עתידי.
Invariants
agent_platform_port.py.🤖 Generated with Claude Code
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>