fix(scope-b): 修评审 4 HIGH + 同步 T6 工具数(15)

1. T6 e2e 工具数同步:list 断言 11→15(含 continue/expand/de-ai/teardown),
   测试名 ...eleven→fifteen;保留 legacy/ingestable 意图。
2. teardown 书名(body.kind)前置入原文 → 进 text_input context(拆书 prompt 期待书名)。
3. text_input 工具(扩写/降AI/拆书)空原文 → 422 VALIDATION,不让 LLM 空跑。
4. 链 UI:busy 守卫加 awaiting,裁决期间禁止重复发起链。

测试:扩 teardown 断言书名入 context + 新增 expand 空原文 422;后端 642 passed,
前端 294 passed,两门禁全绿。
This commit is contained in:
Yaojia Wang
2026-06-23 19:38:56 +02:00
parent e2d798627a
commit 8c7d4e2169
4 changed files with 50 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ ingest 预检调 `build_gateway("analyst")`——故 override **这一个 builde
`Gateway`(假适配器据 output_schema 分支:生成产物 vs ContinuityReview即可覆盖两路。
用例:
1. `GET /skills/toolbox` 返回全 11 keylegacy 3 带 legacy_route+is_legacy=true8
1. `GET /skills/toolbox` 返回全 15 keylegacy 3 带 legacy_route+is_legacy=true12
brainstorm/glossary/golden-finger 的 ingestable 标志符合预期。
2. brainstorm `generate` → 200 ToolGeneratePreviewResponseoutput_kind + preview.ideas
断言 **ledger 真落行** 且 **业务表零新增**world_entities 计数不变)——不变量 #3。
@@ -241,10 +241,10 @@ def _assert_no_secret_leak(payload: object) -> None:
assert needle not in blob, f"sensitive marker leaked into response: {needle!r}"
async def test_t6_list_toolbox_returns_all_eleven_tools(
async def test_t6_list_toolbox_returns_all_fifteen_tools(
e2e_sm: async_sessionmaker[AsyncSession],
) -> None:
"""用例 1GET /skills/toolbox 返回全 11 keylegacy 3 带 legacy_route8 走通用执行器。"""
"""用例 1GET /skills/toolbox 返回全 15 keylegacy 3 带 legacy_route12 走通用执行器。"""
from ww_api.main import create_app
app = create_app()
@@ -256,7 +256,7 @@ async def test_t6_list_toolbox_returns_all_eleven_tools(
body = resp.json()
tools = {t["key"]: t for t in body["tools"]}
# 全 11 keylegacy 3 + 新 8
# 全 15 keylegacy 3 + 新 8 + 竞品快赢 4续写/扩写/降AI率/拆书)。
assert set(tools) == {
"worldbuilding",
"character",
@@ -269,6 +269,10 @@ async def test_t6_list_toolbox_returns_all_eleven_tools(
"glossary",
"opening",
"fine-outline",
"continue",
"expand",
"de-ai",
"teardown",
}
# legacyspec=Noneis_legacy=true + 带 legacy_route不可经通用执行入库。
legacy_keys = {"worldbuilding", "character", "outline"}