feat(ux): T4-b 后端 — draft 端点接收本章指令 directive 直通 assemble(volatile)

assemble/_build_volatile 加 directive 参数(仅入 volatile,守缓存前缀不变量 #9);stream_draft 加可选 body {directive} 透传;不持久化、无迁移;directive 长度入 log 不记原文。新 DraftStreamRequest schema + 重生成 TS 客户端。后端门禁绿: ruff/mypy/pytest。契约记 memory/contracts.md。
This commit is contained in:
Yaojia Wang
2026-06-20 18:25:00 +02:00
parent 8779530806
commit 2155193cdc
7 changed files with 94 additions and 5 deletions

View File

@@ -293,6 +293,18 @@ async def test_assemble_override_recent_n_limits_digests() -> None:
assert "实体1" not in names
async def test_assemble_directive_in_volatile_not_stable() -> None:
repos = build_repos(
characters=[char("林动", role="主角")],
spec=ProjectSpecView(title=""),
)
ctx = await assemble(repos, PROJECT, 1, directive="多写战斗")
assert "本章指令" in ctx.volatile
assert "多写战斗" in ctx.volatile
assert "多写战斗" not in ctx.stable_core
assert "本章指令" not in ctx.stable_core
# ---- render_cards ----