package
Version:
v0.6.1
Opens a new window with list of versions in this module.
Published: Jul 2, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
assets 内容地图
给系统加"一段话 / 一篇资料 / 一条规则"之前,先查下表确定归属,再看接线方式。
| 目录 |
装什么 |
谁消费 |
接线方式 |
prompts/ |
常驻角色 system prompt(coordinator / writer / editor / architect×2)与一次性任务 prompt(import×2 / simulation×2) |
agents/build.go 装配;imp / sim runner |
load.go Prompts 字段。注意:simulation_guidance 由 load.go 加载时注入,md 文件里看不到 |
references/ |
题材无关的写作知识材料。不进 system prompt,由 novel_context 按角色 / 章节裁剪后注入 reference_pack |
writer / editor / architect |
三处接线:tools.References 加字段 + load.go loadReferences 读取 + novel_context.go writerReferences / architectReferences 注入。放进目录不会自动加载 |
references/genres/<style>/ |
题材专属知识(style-references / arc-templates) |
同上,style != default 时加载 |
load.go loadReferences |
rules/ |
已废弃的旧内置规则目录;机械基线已迁到代码,用户规则来自 ~/.ainovel/rules/*.md / ./.ainovel/rules/*.md 的自然语言快照 |
userrules.Service 归一化为 meta/user_rules.json;novel_context 注入;commit_chapter 检查 |
内置基线见 internal/rules/snapshot.go 的 SystemDefaults();用户 .md 零格式、零 YAML,按自然语言归一化 |
styles/<style>.md |
题材写作风格指令 |
拼进 writer 的 system prompt(agents/build.go) |
文件名即 config.style 取值。与 references/genres/<style>/ 是同一题材概念的两种载体:前者是风格指令,后者是知识材料 |
新内容归属判断(五问)
- 这个流程必须被保证?→ 不写 prompt,写代码约束(StopAfterTools / 工具守卫 / Flow Router)
- 这是裁定判据(什么时候派谁)?→
prompts/coordinator.md
- 这是某个角色的审美 / 执行标准?→
prompts/<role>.md
- 这是可机械枚举的默认规则(禁词 / 字数 / 阈值)?→
internal/rules/snapshot.go 的 SystemDefaults();用户自定义规则写进 .ainovel/rules/*.md,由归一化快照消费
- 这是写作知识材料?→
references/(记得三处接线)
一致性保障
prompt 引用的信封路径(working_memory.* 等)与 writer.md 的 commit_chapter 参数文档
由 prompts_consistency_test.go 机检——这两类漂移不报错、只让模型悄悄变笨,靠测试红灯暴露。
prompt 里的流程段是"用户手册",流程真理在代码层;两者脱节时以代码为准并回头修 prompt。
Documentation
¶
WithSimulationGuidance 给核心 prompt 追加仿写画像指引。导出供 eval 等外部场景做
variant 覆盖时复用,保证覆盖后的 prompt 与 Load 产出的 baseline 等价(同一包装路径)。
Bundle 表示运行所需的静态资源集合。
OverridePrompt 用 raw 覆盖 bundle 中指定 prompt 文件对应的角色提示词,并走与 Load
完全相同的 WithSimulationGuidance 包装——eval 做 A/B 时只需调它,不必复制包装逻辑,
否则 baseline 带仿写画像后缀、variant 不带,A/B 不等价。file 为 prompt 文件名。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.