assets

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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.jsonnovel_context 注入;commit_chapter 检查 内置基线见 internal/rules/snapshot.goSystemDefaults();用户 .md 零格式、零 YAML,按自然语言归一化
styles/<style>.md 题材写作风格指令 拼进 writer 的 system prompt(agents/build.go 文件名即 config.style 取值。与 references/genres/<style>/ 是同一题材概念的两种载体:前者是风格指令,后者是知识材料

新内容归属判断(五问)

  1. 这个流程必须被保证?→ 不写 prompt,写代码约束(StopAfterTools / 工具守卫 / Flow Router)
  2. 这是裁定判据(什么时候派谁)?→ prompts/coordinator.md
  3. 这是某个角色的审美 / 执行标准?→ prompts/<role>.md
  4. 这是可机械枚举的默认规则(禁词 / 字数 / 阈值)?→ internal/rules/snapshot.goSystemDefaults();用户自定义规则写进 .ainovel/rules/*.md,由归一化快照消费
  5. 这是写作知识材料?→ references/(记得三处接线)

一致性保障

prompt 引用的信封路径(working_memory.* 等)与 writer.md 的 commit_chapter 参数文档 由 prompts_consistency_test.go 机检——这两类漂移不报错、只让模型悄悄变笨,靠测试红灯暴露。 prompt 里的流程段是"用户手册",流程真理在代码层;两者脱节时以代码为准并回头修 prompt。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithSimulationGuidance added in v0.6.0

func WithSimulationGuidance(prompt, role string) string

WithSimulationGuidance 给核心 prompt 追加仿写画像指引。导出供 eval 等外部场景做 variant 覆盖时复用,保证覆盖后的 prompt 与 Load 产出的 baseline 等价(同一包装路径)。

Types

type Bundle

type Bundle struct {
	References tools.References
	Prompts    Prompts
	Styles     map[string]string
}

Bundle 表示运行所需的静态资源集合。

func Load

func Load(style string) Bundle

Load 返回指定风格对应的资源集合。

func (*Bundle) OverridePrompt added in v0.6.0

func (b *Bundle) OverridePrompt(file, raw string) error

OverridePrompt 用 raw 覆盖 bundle 中指定 prompt 文件对应的角色提示词,并走与 Load 完全相同的 WithSimulationGuidance 包装——eval 做 A/B 时只需调它,不必复制包装逻辑, 否则 baseline 带仿写画像后缀、variant 不带,A/B 不等价。file 为 prompt 文件名。

type Prompts

type Prompts struct {
	Coordinator      string
	ArchitectShort   string
	ArchitectLong    string
	Writer           string
	Editor           string
	ImportFoundation string
	ImportAnalyzer   string
	SimulationSource string
	SimulationMerge  string
}

Prompts 表示嵌入的提示词集合。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL