✨ feat: WP-02 角色域——完整生命周期、铸魂、内驱力与随缘

- 迁移 6:character(生命周期六态检查约束、起源、现实人物治理标记、道体基线、内驱力)+ character_version(baseline/first_statement/drive_revision/reforging/persona_candidate 五类不可变版本与审核态)
- 创建:手动与随缘(确定性词库组合,同种子同候选、一次一个——不是抽卡);现实人物治理(已故拒绝、未声明授权拒绝)
- 启镜(draft→active + 首个 baseline 版本)与初照自陈(候选→确认归真并入道体)
- 生命周期端点:静修/归藏/复照(归档可恢复、复照不抹历史)+ 死亡两步确认(7 天冷静期可撤销、未满确认 422);非法状态迁移 422
- 铸魂(显式 confirm 强确认,直接更新道体)与人格候选(pending→审核批准才并入道体,不静默覆盖)
- 内驱力编辑:写当前值并落 drive_revision 版本(可追溯,ADR-018)
- 测试 52 项全绿(+8):状态机全路径、随缘确定性、现实人物三例、铸魂确认、候选审核与重复审核 409、跨域 fail-closed
This commit is contained in:
chenxin committed 2026-09-10 18:11:15 +08:00
1 parent 603a683c14
commit 40221170ae
7 files changed
+859

No files matched your search

+2
View File
@@ -3,6 +3,7 @@
from fastapi import FastAPI
from app.auth.routes import router as auth_router
from app.characters.routes import router as characters_router
from app.conversations.routes import message_router, run_router
from app.conversations.routes import router as conversations_router
from app.core.config import get_settings
@@ -28,6 +29,7 @@ def create_app() -> FastAPI:
app.include_router(conversations_router)
app.include_router(run_router)
app.include_router(message_router)
app.include_router(characters_router)
@app.get("/healthz", tags=["ops"])
async def healthz() -> dict[str, str]: