Deployment Strategy
Relevant source files
The following files were used as context for generating this wiki page:
The deployment strategy for ZINC-Fusion-V15 is designed around a decoupled, hybrid architecture that separates the Machine Learning (ML) pipeline from the user-facing dashboard. The system utilizes a combination of Vercel for the frontend and serverless orchestration, and a Python-based environment for ML model training and execution. This strategy ensures institutional-grade stability and prevents cross-project contamination through strict environment boundaries.
Sources: AGENTS.md:7-14, README.md:5-10
Multi-Platform Infrastructure
ZINC-Fusion-V15 operates across two primary environments. The frontend is built with Next.js and deployed to Vercel, while the backend/ML core runs on Python 3.11. A cloud-hosted Prisma Postgres database serves as the single source of truth, facilitating communication between the decoupled layers.
Environment Boundaries
The project maintains strict directory-level isolation to manage different tech stacks and prevent build-time conflicts:
- Root (
/): Python ML pipeline managed byuv. - Frontend (
/frontend): Next.js dashboard deployed to Vercel. - Config (
/config): Prisma CLI dependencies.
Sources: AGENTS.md:12-23, CLAUDE.md:12-16, README.md:323-328
Infrastructure Component Summary
| Component | Technology | Role |
|---|---|---|
| Frontend | Next.js (Vercel) | User dashboard and UI |
| Orchestration | Inngest (Serverless) | Daily data ingestion and periodic jobs |
| Backend/ML | Python 3.11, FastAPI | Model training, inference, and API |
| Database | Prisma Postgres | Authoritative storage across 12 schemas |
| ML Tracking | MLflow | Local model and experiment tracking |
Sources: AGENTS.md:7-14, README.md:16-20
Serverless Orchestration with Inngest
Deployment includes a sophisticated orchestration layer using Inngest running on Vercel. This layer manages approximately 88 serverless functions responsible for historical backfills, daily data ingestion (e.g., Yahoo Finance, FRED, EIA), and periodic maintenance tasks.
Concurrency and Isolation Policy
To prevent infrastructure overloads and cross-project incidents, the following deployment constraints are enforced:
- Inngest Client ID: Must be set to
fusion-jobs. - Database Concurrency: Capped at 5 with a scope of
envto prevent exhaustion of the connection pool. - Durable Execution: Side effects must be wrapped in
step.run()to avoid duplicate API calls during replays.
Sources: cubic.yaml:26-30, cubic.yaml:37-56, README.md:307-310
Deployment Flow Diagram
The diagram above illustrates the decoupled nature of the Vercel-hosted frontend/orchestration and the Python-hosted ML core, both interfacing with the centralized Postgres database. Sources: AGENTS.md:12-20, README.md:307-315
Database Deployment and Migration
The database strategy relies on Prisma exclusively for schema management and migrations, while runtime queries utilize direct drivers (pg for TypeScript and psycopg2 for Python).
Schema Governance
The database is organized into 12 specific schemas (e.g., mkt, econ, supply, forecasts). Deployment rules prohibit "silent" schema changes; all modifications to frontend/prisma/schema.prisma require a formal migration review.
Sources: AGENTS.md:25-30, cubic.yaml:239-245
Operational Guardrails
Critical safety checks are integrated into the deployment process to ensure data integrity and system availability:
- Ingest Logging: Every function writing to the database must log to
ops.ingest_runto enable failure detection. - Quarantine Logic: Invalid records must be moved to
ops.quarantined_recordrather than being silently dropped. - Append-Only Semantics: Deployment prohibits
DELETE FROMorUPDATEstatements on landing tables (e.g.,mkt.*,econ.*) to preserve historical training data. - Timeout Policy: All external API calls (USDA, EIA, FRED) must include explicit timeouts to prevent hanging serverless slots.
Sources: cubic.yaml:81-93, cubic.yaml:123-145, cubic.yaml:263-270
Conclusion
The ZINC-Fusion-V15 deployment strategy prioritizes the isolation of the high-compute ML pipeline from the responsive frontend dashboard. By leveraging Vercel for serverless orchestration and enforcing strict concurrency limits through Inngest, the system maintains high availability while safeguarding the integrity of the centralized data warehouse. This multi-layered approach ensures that the institutional-grade forecasting engine remains stable and scalable.
Sources: README.md:5-10, cubic.yaml:26-30