feat(agents,core,config): 写章 craft 教条块 + genre-aware 片段 + 开篇黄金三章特判
- 新增 write_craft.md 品类无关写章 craft 内核(网文语域/show-don't-tell/对话 voice/ 反注水/结构性文字质感,灵活原则非穷举清单)+ load_craft_doctrine()(import 期读盘, 不入 SPECS/金标准) - build_write_request 把 craft 教条作为最前的 cache=True system 块注入(craft→stable_core, 守缓存前缀 #9,tier=writer 不写 model) - 新增 packages/config GENRE_CRAFT 题材片段表,assemble 按 project.genre 注入 stable_core; ProjectSpecView + SqlProjectSpecRepo 透传 genre - 开篇前 3 章在 volatile 注入黄金三章提示(含章号→每章易变,不进缓存前缀) - 修正 toolbox_registry 注释:11 条 → 15 条(legacy 3 + 新 8 + Scope B 4)
This commit is contained in:
@@ -46,3 +46,18 @@ def load_prompt(name: str) -> str:
|
||||
|
||||
_CACHE[name] = text
|
||||
return text
|
||||
|
||||
|
||||
# 主写章 craft 教条文件名(灵感①)。它是散文教条、不是结构化产物 spec:
|
||||
# 不入 SPECS、不进 prompt_hashes 金标准、不参与计数断言——但复用同一读盘/规整/缓存路径,
|
||||
# 保证字节稳定(不变量 #9)。
|
||||
CRAFT_DOCTRINE_NAME: Final = "write_craft"
|
||||
|
||||
|
||||
def load_craft_doctrine() -> str:
|
||||
"""读 `prompts/write_craft.md`(品类无关写章 craft 内核)→ 规整 → 缓存 → 返回。
|
||||
|
||||
与 `load_prompt` 同一读盘/规整/缓存逻辑(DRY),文件缺失同样 fail-fast
|
||||
(`PromptNotFoundError`)。调用方在 import 期取常量即触发读盘。
|
||||
"""
|
||||
return load_prompt(CRAFT_DOCTRINE_NAME)
|
||||
|
||||
Reference in New Issue
Block a user