fix(api): שינוי-שם תיק מחזיר 500 — ניתוב Paperclip דרך שער-הפלטפורמה (INV-G12) #249
Reference in New Issue
Block a user
Delete Branch "worktree-fix-case-update-port"
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?
הבעיה
PUT /api/cases/{n}קרס ב-500 (NameError: name 'paperclip_client' is not defined) בכל פעם שהכותרת השתנתה. כך הופיע למשתמש בקונסול:/api/cases/8125-09-24 500.השורש
רפקטור שער-הפלטפורמה (G12) הסיר את ייבוא המודולים
paperclip_client/paperclip_apiמ-app.py, אבל השאיר שלושה call sites שעדיין מפנים לשמות-המודול הישנים:paperclip_client.update_project_namepaperclip_api.emit_export_complete_webhookpaperclip_api.emit_missing_precedent_webhookשלושתם
background_tasks→ שניים נותרו NameError חבויים.התיקון
חשיפת שלוש הפונקציות דרך
agent_platform_port(התפר היחיד מול Paperclip) וקריאה דרך השער — מחזיר את ההתאמה ל-G12.Invariants
web/agent_platform_port.py.בדיקה
py_compileעובר על שני הקבצים; אין הפניות שבורות (paperclip_api./paperclip_client.) שנותרו; כל שמות__all__בשער נפתרים.🤖 Generated with Claude Code
PUT /api/cases/{n} crashed with 500 (NameError: 'paperclip_client' is not defined) whenever the title changed. The G12 platform-port refactor dropped the `paperclip_client`/`paperclip_api` module imports from app.py but left three call sites still referencing the old module names: - app.py:2096 paperclip_client.update_project_name (title sync → fires on every rename) - app.py:3806 paperclip_api.emit_export_complete_webhook - app.py:7390 paperclip_api.emit_missing_precedent_webhook All three are background_tasks, so the latter two were latent NameErrors waiting to fire. Expose the three functions through agent_platform_port (the single Paperclip seam) and call them via the Port, restoring G12. Invariants: upholds INV-G12 (all Paperclip access via agent_platform_port). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>