fix(ops): שרת ה-MCP עובר ל-S3 — סוגר את דריפט האחסון מול הקונטיינר
All checks were successful
INV-AG3 Agent Tool Grants / agent-tool-grants (pull_request) Successful in 5s
G12 Leak-Guard / leak-guard (pull_request) Successful in 5s
Lint — undefined names / undefined-names (pull_request) Successful in 12s

הקונטיינר רץ `STORAGE_BACKEND=s3` ושרת ה-MCP נפל ל-`filesystem`. כלומר
מסמך שסוכן כתב דרך MCP נחת על הדיסק בעוד ה-web חיפש אותו ב-S3 — שני
מסלולים לאותו נכס, שמתפצלים בשקט (G2 / INV-STG1).

מה נדרש כדי לסגור, ומה נמצא בדרך
- **הסודות לא היו קיימים במקור-האמת.** `MINIO_ENDPOINT`/`ACCESS_KEY`/
  `SECRET_KEY` חיו רק ב-env של Coolify. נוצרו ב-Infisical תחת
  `/apps/legal-ai` (tag `credentials`, באישור חיים) ונטענים
  ל-`~/.legal-mcp-http.env` — אותו דפוס כמו MCP_HTTP_SHARED_SECRET.
  הערכים עברו ב-stdin דרך infisical-set.sh; לא ב-argv ולא בהיסטוריה.
- **`aioboto3` לא היה מותקן ב-venv המקומי.** מוצהר ב-pyproject אך חסר.
  מסלול ה-S3 מייבא אותו **עצלנית**, ולכן השירות היה עולה בהצלחה ונשבר
  רק בפעולת-הקובץ הראשונה — כשל שקט עד לשימוש. זו בדיוק הסיבה שהבדיקה
  רצה לפני ההפעלה ולא אחריה.

אימות מהמארח לפני ההפעלה: put/get/delete מלא מול
https://s3.nautilus.marcusgroup.org, וקריאת בלוב-ייצור קיים
(573KB) מתוך 2,283 אובייקטים בדלי.

ה-runbook עודכן: בלוק-האזהרה הוחלף בתיעוד המצב הסגור, כולל מלכודת
הייבוא-העצל ופקודת-אימות שאפשר להעתיק.

invariants: G2 (מסלול-אחסון אחד לשתי הדלתות) · INV-STG1 · §6
This commit is contained in:
2026-08-05 14:03:15 +00:00
parent 09c737bddf
commit adb9586055
2 changed files with 38 additions and 19 deletions

View File

@@ -63,12 +63,18 @@ const env = {
// question from different result sets. ~/.env sets neither, so both fell to
// the code defaults (false) — the drift was silent.
//
// NOT set here: STORAGE_BACKEND. The container runs `s3`, this service falls
// back to `filesystem`, and closing that gap needs MinIO credentials that do
// not exist in Infisical yet (only in Coolify's env). Flipping the flag
// without them would resolve MINIO_ENDPOINT to the in-cluster default
// `http://minio:9000` — unreachable from the host — and break every blob
// read. Tracked separately; see the note in docs/operations-runbook.md.
// Blob storage must match the container too, for the same reason: a document
// an agent writes through MCP has to be the one the web reads back. The MinIO
// credentials now live in Infisical (/apps/legal-ai) and are loaded from the
// runtime file below, exactly like MCP_HTTP_SHARED_SECRET.
//
// Verified from the host before enabling: put/get/delete round-trip against
// https://s3.nautilus.marcusgroup.org, plus a read of an existing production
// blob out of 2,283 objects. Note the S3 path imports aioboto3 LAZILY, so a
// missing dependency does not fail at boot — it fails on the first blob
// operation. It is declared in mcp-server/pyproject.toml; make sure the venv
// actually has it (`.venv/bin/pip install -e mcp-server`).
STORAGE_BACKEND: "s3",
MULTIMODAL_ENABLED: "true",
MCP_TRANSPORT: "streamable-http",
MCP_HTTP_HOST: "127.0.0.1",