M1:镜生域后端闭环——灵胚/照心试演/启镜原子闸门/执镜关系/命台租约/魂籍签名导出/死亡冷静期(迁移 001,测试 7 用例)

This commit is contained in:
chenxin committed 2026-08-21 22:39:07 +08:00
1 parent c090893e63
commit 1cd0069d65
24 files changed
+1508 -9

No files matched your search

+8 -1
View File
@@ -14,11 +14,18 @@ class Run(Base):
__tablename__ = "runs"
id: Mapped[str] = mapped_column(String(80), primary_key=True, default=new_run_id)
character_id: Mapped[str] = mapped_column(String(80), ForeignKey("characters.id"), index=True)
# rewrite/1.0:照心试演(kind=rehearsal)无正式人物,character_id 允许为空
character_id: Mapped[str | None] = mapped_column(
String(80), ForeignKey("characters.id"), index=True, nullable=True
)
session_id: Mapped[str | None] = mapped_column(
String(80), ForeignKey("chat_sessions.id"), index=True
)
status: Mapped[str] = mapped_column(String(40), nullable=False, default="queued", index=True)
# run.kind:foreground / background_task / awakening / rehearsal(契约词典 §8.2)
kind: Mapped[str] = mapped_column(
String(40), nullable=False, default="foreground", server_default="foreground"
)
goal: Mapped[str | None] = mapped_column(String(300))
origin: Mapped[str] = mapped_column(String(40), nullable=False, default="chat")
model_hint: Mapped[str | None] = mapped_column(String(120))