forked from EduCraft/curriculum-project-hub
feat(hub): Prisma schema + DB singleton,对齐 spec/System 契约
按 ADR-0001..0004/0017 重塑 schema,非照搬旧服务: - ADR-0001: ProjectGroupBinding project↔chat 1:1(chatId @unique 钉单射不变式) - ADR-0002: ProjectAgentLock projectId @id(at-most-one)+runId @unique;holder=run 非 session - ADR-0004: PermissionGrant(resource×principal×role)+PermissionSettings(六旋钮)新落; PermissionRole=read/edit/manage 与 PlatformRole=admin/teacher 分离(旧 schema 混淆了) - ADR-0017: AgentSession 无 claudeSessionId,改 provider+model(切 model 即新 session) - RunState 对齐 spec:加 WAITING_FOR_USER/TIMED_OUT(枚举完整性 OPEN) - Audit:runId 是 PINNED 关系,其余 OPEN 旧 schema 的 FeishuProjectBinding(user/chat 混表)拆为单一 ProjectGroupBinding。 prisma validate 通过;generate 通过;tsc --noEmit rc=0; 类型级 schema 约束检查全部通过(ADR-0002 主键/唯一、ADR-0017 无 claudeSessionId 等)。
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# Hub runtime configuration. Copy to .env and fill in.
|
||||
|
||||
# PostgreSQL connection string. Used by Prisma and the Hub server.
|
||||
DATABASE_URL="postgresql://paradigm:paradigm@127.0.0.1:5432/paradigm"
|
||||
|
||||
# OpenRouter (or any OpenAI-compatible) API key + base URL.
|
||||
# The Hub's agent layer is provider-agnostic (ADR-0017); this points the
|
||||
# OpenAI-compatible client at OpenRouter by default.
|
||||
OPENROUTER_API_KEY=""
|
||||
# Optional: override the base URL (e.g. direct vendor API, local gateway).
|
||||
# OPENROUTER_BASE_URL="https://openrouter.ai/api/v1"
|
||||
|
||||
# Hub server port. Defaults to 8788.
|
||||
PORT=8788
|
||||
Reference in New Issue
Block a user