Repository responsibility matrix
| Repository | Must own | Must not own (target state) |
|---|---|---|
| prego-control-plane | Tenant lifecycle orchestration, provisioning webhooks, internal system APIs, control-plane D1 schema for tenants; trial email classification (/v1/trial/email/check), manual approval funnel (/v1/trial/manual-approval/* — draft, work-email OTP, submit-details; SMS OTP removed), runtime free-domain dictionary, signup attempt logs, operator tools; Phase 2: D1 0029 nullable connector_kind / connector_credential_ref on tenants_master, read on GET /internal/tenants-directory, write on PATCH /internal/tenant-connector-metadata (Bearer — not a public/Zuplo route) — connector slots · Scheduled automation key material lives in prego_ai KV runbook (not CP) | ERP business rules, LLM retrieval pipeline product logic, gateway route tables |
| prego-zuplo | Routing, authentication integration, rate limits, quotas policies, OpenAPI (including public POST /api/trial/* trial-access routes → CP, e.g. email/check, manual-approval/*), upstream proxy, browser CORS (allowed origins / headers, e.g. optional x-trace-id for funnel correlation — see repo docs/runbook/) | Persistent business state, Frappe DocType logic |
| prego_ai | Ingestion/embedding/retrieval/generation pipelines, AI HTTP API, tenant-scoped storage usage; Phase 2: ConnectorKind, optional CP control-plane-connector, Scheduled automation erp-connector-fetch (dispatch) / erp-fetch (Frappe only) / optional erp-credential-ref + CACHE (erp_cred: / ERP_CREDENTIAL_KV_PREFIX, cp:conn: / CP_CONNECTOR_METADATA_KV_PREFIX) — connector slots · KV runbook | Frappe UI, ERPNext schema as source of truth |
| prego_saas | ERP domain, DocTypes, business validations | Cloudflare Worker bindings, Zuplo policy code |
| Prego (monorepo) | Next.js UI, design system, thin BFF if needed | Sole owner of API contracts (contracts live with gateway / package) |
| prego-pulumi | Cloud resources, env wiring | Application business rules |
| prego-ansible | OS/bench provisioning | Application business rules |
| prego-docker | Images and compose for runtime | Application business rules |
Frappe rule
Treat Frappe as an external adapter from the platform’s perspective: the platform knows site / hostname ↔ tenant mapping, not arbitrary DocType internals.
Cross-repo communication
Only contract-based calls (OpenAPI-documented or explicitly versioned internal APIs). No “import from another repo’s src” across Git boundaries.
한국어
각 레포는 위 표의 Must 영역만 책임지고, Must not 에 해당하는 로직은 다른 레포로 옮기거나 삭제하는 것이 목표입니다. Frappe는 외부 어댑터이며, 레포 간 연결은 스키마가 있는 HTTP 계약으로만 합니다. www 트라이얼 분류·수동 승인(이메일 OTP·제출)·D1 사전·로그는 prego-control-plane; 브라우저 공개 POST /api/trial/*(예: email/check, manual-approval/*)는 prego-zuplo OpenAPI·프록시. prego-zuplo는 브라우저 CORS·ALLOWED_ORIGINS·선택적 x-trace-id 허용까지 포함합니다(저장소 docs/runbook/). Phase 2 멀티 ERP 는 connector slots — prego-control-plane D1·prego_ai 어댑터·@platform/contracts Zod 가 같은 축입니다.