fix(api): שינוי-שם תיק מחזיר 500 — ניתוב Paperclip דרך שער-הפלטפורמה (INV-G12) #249

Merged
chaim merged 1 commits from worktree-fix-case-update-port into main 2026-06-14 08:38:23 +00:00
Owner

הבעיה

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 שעדיין מפנים לשמות-המודול הישנים:

שורה קריאה מתי מתפוצץ
app.py:2096 paperclip_client.update_project_name שינוי כותרת תיק (פעיל)
app.py:3806 paperclip_api.emit_export_complete_webhook סיום ייצוא (latent)
app.py:7390 paperclip_api.emit_missing_precedent_webhook יצירת חוסר-פסיקה (latent)

שלושתם background_tasks → שניים נותרו NameError חבויים.

התיקון

חשיפת שלוש הפונקציות דרך agent_platform_port (התפר היחיד מול Paperclip) וקריאה דרך השער — מחזיר את ההתאמה ל-G12.

Invariants

  • מקיים INV-G12 — כל הגישה ל-Paperclip עוברת דרך web/agent_platform_port.py.

בדיקה

py_compile עובר על שני הקבצים; אין הפניות שבורות (paperclip_api./paperclip_client.) שנותרו; כל שמות __all__ בשער נפתרים.

🤖 Generated with Claude Code

## הבעיה `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 שעדיין מפנים לשמות-המודול הישנים: | שורה | קריאה | מתי מתפוצץ | |------|-------|-----------| | app.py:2096 | `paperclip_client.update_project_name` | שינוי כותרת תיק (פעיל) | | app.py:3806 | `paperclip_api.emit_export_complete_webhook` | סיום ייצוא (latent) | | app.py:7390 | `paperclip_api.emit_missing_precedent_webhook` | יצירת חוסר-פסיקה (latent) | שלושתם `background_tasks` → שניים נותרו NameError חבויים. ## התיקון חשיפת שלוש הפונקציות דרך `agent_platform_port` (התפר היחיד מול Paperclip) וקריאה דרך השער — מחזיר את ההתאמה ל-G12. ## Invariants - **מקיים INV-G12** — כל הגישה ל-Paperclip עוברת דרך `web/agent_platform_port.py`. ## בדיקה `py_compile` עובר על שני הקבצים; אין הפניות שבורות (`paperclip_api.`/`paperclip_client.`) שנותרו; כל שמות `__all__` בשער נפתרים. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-14 08:38:15 +00:00
fix(api): route Paperclip title-sync/webhooks through the Port — 500 on case rename (INV-G12)
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 3s
e2c94144d0
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>
chaim merged commit 1fbb1eede6 into main 2026-06-14 08:38:23 +00:00
chaim deleted branch worktree-fix-case-update-port 2026-06-14 08:38:23 +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#249