feat(toolbox): F1 拆书 teardown 落库成项目 rules

- teardown_spec.writes=["rules"](只声明 tier,入库仍经白名单 gate,不变量 #3)
- toolbox_registry teardown entry 加 ingest=IngestSpec(table="rules")
- routers/toolbox.py 通用 ingest dispatcher 加 _ingest_rules:
  BookTeardownResult(themes/archetypes/structure/hooks) 拍平为可读 rules 条目,
  落项目级(无 continuity 预检,仿 _ingest_outline 无 409)
- schemas/toolbox.py 加 TeardownIngestView + ToolIngestRequest.teardown
- 单测:teardown ingest→rules 真落行 + 预览(generate)不写库

后端门禁绿:ruff/format/mypy clean · alembic no drift · pytest 644 passed
This commit is contained in:
Yaojia Wang
2026-06-23 20:00:25 +02:00
parent 44642c37b4
commit 61398a1452
8 changed files with 216 additions and 17 deletions

View File

@@ -571,8 +571,8 @@ class DeAiResult(BaseModel):
class BookTeardownResult(BaseModel):
"""拆书生成器结构化产出样本作品的结构化拆解Scope B 竞品快赢)。
纯预览产物——不映射任何业务表、不入库(`teardown_spec.writes=[]`,不变量 #3
拆书「落库成 rules」为可选 follow-up需 `KNOWN_TABLES` + `_ingest_rules`),本期不做
F1可经 ingest 端点把结论拍平为项目 `rules` 条目落库(`teardown_spec.writes=["rules"]`
入库仍经白名单 gate不变量 #3预览generate不写库
"""
themes: list[str] = Field(