Skip to content

MINAP File Service ​

Version: 1.2
Date: 2026-11-22
Status: Working baseline

SoT chi tiết cho File Service trong repo platform-file. Applications tích hợp qua File Service — không gắn trực tiếp object store. Metadata SoT nằm PostgreSQL schema minap_file; bytes nằm disk (temp/local/variant) và cloud S3-compatible.

Đọc nhanh ​

Đối tượngBắt đầu tại
OwnerBản đồ đọc → Ranh giới → Quyết định → OPEN catalog
ImplementerDatabase overview → Schema → Config keys → Temp & promote → API surfaces
OpsRuntime web+worker → Disk roots & Infisical → storage_connections

Nguyên tắc cốt lõi ​

  • Domain bắt buộc soft-ref …_file_id + display projection …_file_meta để UI render không gọi FS trước — FS vẫn SoT metadata/bytes (D-005 DECIDED; ví dụ Core avatar).
  • File Service độc lập Platform Core: soft ref acc_… / ws_…, không FK bắt buộc sang Core (DEC-011).
  • workspace_id nullable trên metadata — foresight quota; không thay authorization (DEC-008/009).
  • Không bảng quota/usage trong FS; malware scan và FS audit_events = DEFERRED.
  • Lifecycle: temp → promote đồng bộ (file_id, tier=local) → migrate/purge/GC async (DEC-012).
  • Video: ffmpeg cover lúc promote (cover_storage_name); variant gen từ cover; không API /cover (DEC-014/015).
  • Runtime: Next.js web minap-file (API + Admin/platform-ui sau) + worker minap-file-worker; node-cron chỉ trên worker; jobs orchestrator đọc config rồi đăng ký children; Redis lock jobs.lock.*; poll + POST /v1/ops/jobs/reload (DEC-016/017).
  • Secrets: Infisical (D-016) — wiring implement sau; dev có thể dùng .env local tạm, không commit secrets.
  • HTTP paths + ErrorResponse = PROPOSED đến khi Owner/Gate đánh dấu DECIDED. OPEN catalog phải đọc trước khi invent DECIDED.

Hub platform-docs giữ overview nền tảng và link về SoT này — xem Refs platform-docs.

platform-file/docs = SoT chi tiết File Service · hub platform-docs giữ overview + ref