feat(storage): X14 Phase 2c — remaining sync write-sites through storage.py #156

Merged
chaim merged 1 commits from worktree-storage-minio-phase2c into main 2026-06-08 08:26:35 +00:00
Owner

מה זה

משלים את חיווט-הכתיבה (INV-STG1) לאתרים שרצים בהקשר סינכרוני, דרך facade חוסם חדש ב-storage.py (put_bytes_sync/put_file_syncasyncio.run, או thread-עובד כשכבר רץ loop):

  • services/extractor.py — thumbnails (JPEG) → DERIVED (render ב-to_thread)
  • services/docx_reviser.py — track-changes save + copy ריק-diff → DOCUMENTS
  • services/docx_retrofit.py — גיבוי retrofit in-place → DOCUMENTS

כל אתר עם נפילה-לאחור לכתיבה ישירה כשהיעד מחוץ ל-DATA_DIR. תחת STORAGE_BACKEND=filesystem — אפס שינוי-התנהגות.

גם

ברירת-המחדל של MINIO_ENDPOINT בקטלוג עודכנה לשם-הקונטיינר העמיד (http://minio-bx2ykvw94xbutsex41hz4vv8:9000), עקבי עם הפעלת Coolify "Connect to Predefined Network" שעשיתי לעמידות-רשת.

משמעות

כל אתרי-הכתיבה הבינאריים זורמים עכשיו דרך storage.py. טקסט git-tracked (case.json/notes/research/draft-md) נשאר בדיסק מתוכנן (INV-STG7); temp-files של court-fetch זמניים.

בדיקות

+2 (thumbnail דרך storage; put_bytes_sync round-trip); 55 storage/docx/track-changes ירוקות; 244 נאספות ללא שבירה.

מקיים G2; משלים כיסוי-כתיבה של INV-STG1. ספ: docs/spec/X14-storage-minio.md.

🤖 Generated with Claude Code

## מה זה משלים את חיווט-הכתיבה (INV-STG1) לאתרים שרצים ב**הקשר סינכרוני**, דרך facade חוסם חדש ב-`storage.py` (`put_bytes_sync`/`put_file_sync` — `asyncio.run`, או thread-עובד כשכבר רץ loop): - `services/extractor.py` — thumbnails (JPEG) → **DERIVED** (render ב-to_thread) - `services/docx_reviser.py` — track-changes save + copy ריק-diff → **DOCUMENTS** - `services/docx_retrofit.py` — גיבוי retrofit in-place → **DOCUMENTS** כל אתר עם נפילה-לאחור לכתיבה ישירה כשהיעד מחוץ ל-DATA_DIR. תחת `STORAGE_BACKEND=filesystem` — אפס שינוי-התנהגות. ## גם ברירת-המחדל של `MINIO_ENDPOINT` בקטלוג עודכנה לשם-הקונטיינר העמיד (`http://minio-bx2ykvw94xbutsex41hz4vv8:9000`), עקבי עם הפעלת **Coolify "Connect to Predefined Network"** שעשיתי לעמידות-רשת. ## משמעות **כל אתרי-הכתיבה הבינאריים זורמים עכשיו דרך storage.py.** טקסט git-tracked (case.json/notes/research/draft-md) נשאר בדיסק מתוכנן (INV-STG7); temp-files של court-fetch זמניים. ## בדיקות +2 (thumbnail דרך storage; put_bytes_sync round-trip); 55 storage/docx/track-changes ירוקות; 244 נאספות ללא שבירה. מקיים **G2**; **משלים כיסוי-כתיבה של INV-STG1**. ספ: `docs/spec/X14-storage-minio.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-08 08:26:29 +00:00
Completes the write-side rewiring (INV-STG1) for the call-sites that run in
synchronous contexts, via a new blocking facade in storage.py
(put_bytes_sync / put_file_sync — asyncio.run, or a worker thread when a loop
is already running):
- services/extractor.py: multimodal thumbnail JPEGs → DERIVED (rendered in a
  to_thread worker)
- services/docx_reviser.py: track-changes save (_save_docx_xml) + empty-diff
  copy (copy_with_revisions) → DOCUMENTS
- services/docx_retrofit.py: in-place retrofit backup → DOCUMENTS

Each site keeps a fallback to a direct disk write when the target path is
outside DATA_DIR (caller-provided). Under the default STORAGE_BACKEND=
filesystem the bytes land exactly where they did before — zero behaviour
change.

Also: mcp_env_catalog MINIO_ENDPOINT default updated to the durable
container-name endpoint (http://minio-bx2ykvw94xbutsex41hz4vv8:9000), matching
the Coolify "Connect to Predefined Network" change made for network durability.

All binary write-sites now flow through storage.py. git-tracked text
(case.json/notes/research-md/draft-md) stays on disk by design (INV-STG7);
court-fetch temp files are ephemeral.

tests: +2 (thumbnail renderer routes through storage; put_bytes_sync
round-trip); 55 storage/docx/track-changes green; 244 collected, no import
breakage.

Keeps G2; completes INV-STG1 write coverage. Spec: docs/spec/X14-storage-minio.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit 6647aa92e6 into main 2026-06-08 08:26:35 +00:00
chaim deleted branch worktree-storage-minio-phase2c 2026-06-08 08:26:35 +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#156