@oh-story/dsh 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/lib/client.js +204 -72
- package/lib/client.js.map +3 -3
- package/lib/drama/manifest.json +84 -74
- package/lib/drama/skills/short-drama/SKILL.md +2 -2
- package/lib/drama/skills/short-drama/scripts/creator_markdown_check.py +14 -0
- package/lib/drama/skills/short-drama-assets/references/character-and-look.md +10 -0
- package/lib/drama/skills/short-drama-assets/references/continuity-lock.md +6 -9
- package/lib/drama/skills/short-drama-assets/references/voice-direction.md +28 -0
- package/lib/drama/skills/short-drama-edit/SKILL.md +27 -29
- package/lib/drama/skills/short-drama-edit/assets//345/211/252/350/276/221/345/215/225.md +2 -2
- package/lib/drama/skills/short-drama-edit/references/cut-craft.md +24 -67
- package/lib/drama/skills/short-drama-edit/references/delivery-verify.md +27 -56
- package/lib/drama/skills/short-drama-edit/references/generated-footage.md +37 -79
- package/lib/drama/skills/short-drama-edit/references/sound-and-subtitles.md +39 -92
- package/lib/drama/skills/short-drama-edit/references/stage-contract.md +12 -16
- package/lib/drama/skills/short-drama-edit/scripts/edit_tool.py +126 -11
- package/lib/drama/skills/short-drama-edit/scripts/selftest.py +64 -0
- package/lib/drama/skills/short-drama-image-prompts/SKILL.md +2 -0
- package/lib/drama/skills/short-drama-image-prompts/references/common-recipe.md +11 -0
- package/lib/drama/skills/short-drama-produce/SKILL.md +5 -1
- package/lib/drama/skills/short-drama-produce/references/adapter-contract.md +14 -20
- package/lib/drama/skills/short-drama-produce/references/providers/minimax-h3-video.md +8 -26
- package/lib/drama/skills/short-drama-produce/references/providers/minimax-speech.md +41 -0
- package/lib/drama/skills/short-drama-produce/scripts/provider_adapters.py +142 -1
- package/lib/drama/skills/short-drama-review/SKILL.md +2 -3
- package/lib/drama/skills/short-drama-review/references/production-quality-gates.md +6 -19
- package/lib/drama/skills/short-drama-review/references/rubric-visual-motion.md +9 -35
- package/lib/drama/skills/short-drama-storyboard/SKILL.md +10 -6
- package/lib/drama/skills/short-drama-storyboard/references/lighting-craft.md +39 -0
- package/lib/drama/skills/short-drama-storyboard/references/shot-craft.md +58 -21
- package/lib/drama/skills/short-drama-storyboard/references/stage-contract.md +1 -1
- package/lib/drama/skills/short-drama-video-prompts/SKILL.md +10 -9
- package/lib/drama/skills/short-drama-video-prompts/references/camera-audio-continuity.md +17 -0
- package/lib/drama/skills/short-drama-video-prompts/references/minimax-h3.md +12 -38
- package/lib/drama/skills/short-drama-video-prompts/references/motion-recipe.md +4 -7
- package/lib/drama/skills/short-drama-video-prompts/references/performance-action-timing.md +8 -22
- package/lib/drama/skills/short-drama-video-prompts/references/production-prompt-grammar.md +6 -19
- package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.0.md +2 -3
- package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.5.md +34 -9
- package/lib/drama/skills/short-drama-video-prompts/references/stage-contract.md +2 -2
- package/lib/drama/skills/short-drama-write/SKILL.md +2 -4
- package/lib/index.js +289 -91
- package/lib/index.js.map +4 -4
- package/lib/novel-to-game/README.md +299 -59
- package/lib/novel-to-game/README_ZH.md +299 -56
- package/lib/novel-to-game/VERSION +1 -1
- package/lib/novel-to-game/examples/jin-ping-mei/build/BUILD_BRIEF.md +3 -1
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/RUN.md +11 -3
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/new-guofeng.css +397 -8
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/style.css +0 -31
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/data.js +71 -73
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/engine.js +78 -89
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/main.js +37 -14
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/text.js +5 -5
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/package.json +2 -1
- package/lib/novel-to-game/examples/jin-ping-mei/qa/README.md +11 -16
- package/lib/novel-to-game/examples/jin-ping-mei/qa/verification.json +11 -11
- package/lib/novel-to-game/examples/jin-ping-mei/qa/verify_playable_model.mjs +23 -0
- package/lib/novel-to-game/manifest.json +77 -87
- package/lib/novel-to-game/skills/game-art-direction/SKILL.md +7 -12
- package/lib/novel-to-game/skills/game-art-direction/references/art-direction-method.md +27 -106
- package/lib/novel-to-game/skills/game-build/SKILL.md +13 -14
- package/lib/novel-to-game/skills/game-build/references/blender-asset-workflow.md +24 -0
- package/lib/novel-to-game/skills/game-build/references/build-brief-contract.md +45 -82
- package/lib/novel-to-game/skills/game-build/references/generative-media-pipeline.md +14 -45
- package/lib/novel-to-game/skills/game-build/references/playable-model-contract.md +30 -65
- package/lib/novel-to-game/skills/game-build/references/tts-production-contract.md +13 -27
- package/lib/novel-to-game/skills/game-concept/SKILL.md +13 -15
- package/lib/novel-to-game/skills/game-concept/references/concept-method.md +28 -75
- package/lib/novel-to-game/skills/game-qa/SKILL.md +6 -7
- package/lib/novel-to-game/skills/game-qa/references/test-design-method.md +9 -5
- package/lib/novel-to-game/skills/game-world-design/SKILL.md +12 -16
- package/lib/novel-to-game/skills/game-world-design/references/narrative-design-method.md +23 -72
- package/lib/novel-to-game/skills/game-world-design/references/numeric-design-method.md +14 -48
- package/lib/novel-to-game/skills/game-world-design/references/world-design-method.md +36 -103
- package/lib/novel-to-game/skills/novel-game-analyze/SKILL.md +4 -10
- package/lib/novel-to-game/skills/novel-game-analyze/references/gameability-protocol.md +4 -4
- package/lib/novel-to-game/skills/novel-to-game/SKILL.md +9 -21
- package/lib/novel-to-game/skills/novel-to-game/references/intake-method.md +5 -4
- package/lib/novel-to-game/skills/novel-to-game/references/pipeline-contract.md +5 -8
- package/lib/oh-story/manifest.json +230 -185
- package/lib/oh-story/roles/chapter-extractor.md +177 -237
- package/lib/oh-story/roles/consistency-checker.md +4 -4
- package/lib/oh-story/roles/narrative-writer.md +24 -25
- package/lib/oh-story/roles/story-architect.md +5 -5
- package/lib/oh-story/roles/story-explorer.md +11 -11
- package/lib/oh-story/skills/story/SKILL.md +13 -7
- package/lib/oh-story/skills/story/VERSION +1 -1
- package/lib/oh-story/skills/story/references/author-memory.md +54 -24
- package/lib/oh-story/skills/story/scripts/author_memory_commit.py +934 -170
- package/lib/oh-story/skills/story-cover/SKILL.md +10 -1
- package/lib/oh-story/skills/story-deslop/SKILL.md +40 -53
- package/lib/oh-story/skills/story-deslop/references/anti-ai-writing.md +11 -10
- package/lib/oh-story/skills/story-deslop/references/author-memory.md +54 -24
- package/lib/oh-story/skills/story-deslop/references/deslop-gates.md +1 -1
- package/lib/oh-story/skills/story-deslop/scripts/author_memory_commit.py +934 -170
- package/lib/oh-story/skills/story-import/SKILL.md +77 -81
- package/lib/oh-story/skills/story-import/references/character-state-reverse.md +1 -1
- package/lib/oh-story/skills/story-import/references/state-tracking.md +4 -69
- package/lib/oh-story/skills/story-import/references/structure-mapping-long.md +10 -8
- package/lib/oh-story/skills/story-import/references/tracking-transaction.md +8 -6
- package/lib/oh-story/skills/story-import/scripts/check-outline-contract.js +34 -16
- package/lib/oh-story/skills/story-import/scripts/tracking_commit.py +210 -2
- package/lib/oh-story/skills/story-import/scripts/wordcount_core.py +3 -0
- package/lib/oh-story/skills/story-long-analyze/SKILL.md +91 -258
- package/lib/oh-story/skills/story-long-analyze/references/author-facing.md +245 -0
- package/lib/oh-story/skills/story-long-analyze/references/deconstruction-notes.md +2 -2
- package/lib/oh-story/skills/story-long-analyze/references/inspiration-library.md +105 -0
- package/lib/oh-story/skills/story-long-analyze/references/material-decomposition.md +113 -105
- package/lib/oh-story/skills/story-long-analyze/references/output-templates.md +169 -125
- package/lib/oh-story/skills/story-long-analyze/references/pipeline-ops.md +172 -64
- package/lib/oh-story/skills/story-long-analyze/references/semantic-acceptance-fixtures.md +84 -0
- package/lib/oh-story/skills/story-long-analyze/references/style-profile-generator.md +42 -132
- package/lib/oh-story/skills/story-long-analyze/references/style-profile-protocol.md +5 -5
- package/lib/oh-story/skills/story-long-analyze/scripts/build_chapter_index.py +466 -0
- package/lib/oh-story/skills/story-long-analyze/scripts/inspect_existing_assets.py +702 -0
- package/lib/oh-story/skills/story-long-analyze/scripts/inspiration_index.py +864 -0
- package/lib/oh-story/skills/story-long-analyze/scripts/manage_analysis_run.py +1106 -0
- package/lib/oh-story/skills/story-long-analyze/scripts/render_relation_chart.py +425 -0
- package/lib/oh-story/skills/story-long-scan/SKILL.md +4 -1
- package/lib/oh-story/skills/story-long-write/SKILL.md +38 -29
- package/lib/oh-story/skills/story-long-write/references/anti-ai-writing.md +11 -10
- package/lib/oh-story/skills/story-long-write/references/artifact-protocols.md +25 -20
- package/lib/oh-story/skills/story-long-write/references/author-memory.md +54 -24
- package/lib/oh-story/skills/story-long-write/references/benchmark-recall.md +3 -3
- package/lib/oh-story/skills/story-long-write/references/cross-book-recall.md +26 -0
- package/lib/oh-story/skills/story-long-write/references/dialogue-mastery.md +4 -0
- package/lib/oh-story/skills/story-long-write/references/emotional-methods.md +2 -2
- package/lib/oh-story/skills/story-long-write/references/long-chapter-quality.md +4 -13
- package/lib/oh-story/skills/story-long-write/references/outline-structure-theory.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/project-files.md +9 -7
- package/lib/oh-story/skills/story-long-write/references/reader-contract-and-progression.md +12 -4
- package/lib/oh-story/skills/story-long-write/references/reference-index.md +1 -2
- package/lib/oh-story/skills/story-long-write/references/tracking-transaction.md +8 -6
- package/lib/oh-story/skills/story-long-write/references/workflow-chapter.md +86 -115
- package/lib/oh-story/skills/story-long-write/references/workflow-daily.md +55 -120
- package/lib/oh-story/skills/story-long-write/references/workflow-revision.md +15 -11
- package/lib/oh-story/skills/story-long-write/references/workflow-setup.md +66 -68
- package/lib/oh-story/skills/story-long-write/references/writer-prompt-fallback.md +3 -3
- package/lib/oh-story/skills/story-long-write/references/writing-craft.md +4 -12
- package/lib/oh-story/skills/story-long-write/scripts/author_memory_commit.py +934 -170
- package/lib/oh-story/skills/story-long-write/scripts/build_writer_prompt.py +139 -18
- package/lib/oh-story/skills/story-long-write/scripts/check-outline-contract.js +34 -16
- package/lib/oh-story/skills/story-long-write/scripts/outline_view.py +5 -3
- package/lib/oh-story/skills/story-long-write/scripts/storyctl.py +58 -0
- package/lib/oh-story/skills/story-long-write/scripts/tracking_commit.py +210 -2
- package/lib/oh-story/skills/story-long-write/scripts/wordcount_core.py +3 -0
- package/lib/oh-story/skills/story-review/SKILL.md +68 -85
- package/lib/oh-story/skills/story-review/references/anti-ai-writing.md +11 -10
- package/lib/oh-story/skills/story-review/references/author-memory.md +54 -24
- package/lib/oh-story/skills/story-review/references/dialogue-mastery.md +4 -0
- package/lib/oh-story/skills/story-review/references/review-quality.md +4 -10
- package/lib/oh-story/skills/story-review/references/tracking-transaction.md +8 -6
- package/lib/oh-story/skills/story-review/scripts/author_memory_commit.py +934 -170
- package/lib/oh-story/skills/story-review/scripts/tracking_commit.py +210 -2
- package/lib/oh-story/skills/story-review/scripts/wordcount_core.py +3 -0
- package/lib/oh-story/skills/story-setup/SKILL.md +50 -42
- package/lib/oh-story/skills/story-setup/references/agent-references/anti-ai-writing.md +11 -10
- package/lib/oh-story/skills/story-setup/references/agent-references/deslop-gates.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/dialogue-mastery.md +4 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/long-emotional-methods.md +2 -2
- package/lib/oh-story/skills/story-setup/references/agent-references/long-quality.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/writing-craft.md +4 -12
- package/lib/oh-story/skills/story-setup/references/diagnostics.md +1 -1
- package/lib/oh-story/skills/story-short-analyze/SKILL.md +22 -3
- package/lib/oh-story/skills/story-short-analyze/references/material-decomposition.md +5 -1
- package/lib/oh-story/skills/story-short-scan/SKILL.md +5 -1
- package/lib/oh-story/skills/story-short-write/SKILL.md +6 -147
- package/lib/oh-story/skills/story-short-write/references/author-memory.md +54 -24
- package/lib/oh-story/skills/story-short-write/references/dialogue-mastery.md +4 -0
- package/lib/oh-story/skills/story-short-write/references/reference-index.md +2 -0
- package/lib/oh-story/skills/story-short-write/references/workflow-design.md +3 -2
- package/lib/oh-story/skills/story-short-write/references/workflow-draft.md +126 -0
- package/lib/oh-story/skills/story-short-write/references/workflow-revision.md +32 -0
- package/lib/oh-story/skills/story-short-write/scripts/author_memory_commit.py +934 -170
- package/lib/types/client/drama-production-view.d.ts.map +1 -1
- package/lib/types/client/file-activity.d.ts +19 -1
- package/lib/types/client/file-activity.d.ts.map +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/production-prompts.d.ts +7 -0
- package/lib/types/client/production-prompts.d.ts.map +1 -1
- package/lib/types/client/production-runtime.d.ts +16 -0
- package/lib/types/client/production-runtime.d.ts.map +1 -1
- package/lib/types/drama-adapters.d.ts +5 -3
- package/lib/types/drama-adapters.d.ts.map +1 -1
- package/lib/types/native-hooks.d.ts +52 -0
- package/lib/types/native-hooks.d.ts.map +1 -1
- package/lib/types/role-identity.d.ts +17 -0
- package/lib/types/role-identity.d.ts.map +1 -0
- package/lib/types/role-tool.d.ts.map +1 -1
- package/lib/types/skill-provider.d.ts.map +1 -1
- package/package.json +45 -45
- package/lib/novel-to-game/skills/game-world-design/references/dialogue-design-method.md +0 -58
- package/lib/novel-to-game/skills/game-world-design/references/game-writing-craft.md +0 -53
- package/lib/novel-to-game/skills/novel-to-game/references/intake-benchmark-reference.md +0 -38
- package/lib/oh-story/skills/story-long-write/references/state-tracking.md +0 -108
|
@@ -19,23 +19,30 @@
|
|
|
19
19
|
|
|
20
20
|
## 文件与所有权
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
作者记忆分两级存放,记忆随书走:
|
|
23
23
|
|
|
24
24
|
```text
|
|
25
|
-
{工作区}/.story/作者记忆/
|
|
25
|
+
{工作区}/.story/作者记忆/ # 项目级 store:global / genre / workflow 条目,编号 AP
|
|
26
26
|
├── _author-memory-state.json # 唯一结构化权威
|
|
27
27
|
├── 作者画像.md # 仅 active,供作者查看与管理
|
|
28
28
|
├── 待确认.md # pending / conflict,不参与约束
|
|
29
29
|
└── 变更记录.md # 最近 100 次、最新在前的事务记录
|
|
30
|
+
{书}/.story/作者记忆/ # 书级 store:只存这本书的 book 条目,编号 BP,同样四个文件
|
|
30
31
|
```
|
|
31
32
|
|
|
32
|
-
三个 Markdown 文件都从 state 确定性生成,禁止手改;完整历史保留在 state,变更记录只展示最近 100 次。`作者画像.md` 是人类管理视图,普通写作 agent 不整份注入,而是调用 `query`
|
|
33
|
+
三个 Markdown 文件都从 state 确定性生成,禁止手改;完整历史保留在 state,变更记录只展示最近 100 次。`作者画像.md` 是人类管理视图,普通写作 agent 不整份注入,而是调用 `query` 取得本次相关的紧凑上下文。作者记忆不存在时,普通写作、审稿和去味任务直接继续,不自动初始化空目录;首次 `record` 会随事务创建。
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
**定位规则**:`--workspace` 必须显式传给脚本,指创作工作区根——承载多本书、`.active-book`、`长篇/`、`短篇/` 或 `拆文库/` 的那一层;已有记忆时,是项目级 state(不带 `book` 字段)所在的最近祖先。书目录自己的 `.story/作者记忆/` 是书级 store,`长篇/`、`短篇/` 下的书目录永远不当 `--workspace`;不要把用户主目录当默认工作区。`--book-root` 是当前书的项目目录(`.active-book` 指向、或含 `设定/`、`正文/` 的那一层,如 `{工作区}/长篇/{书名}/`);书名默认取书级 state 记录的名字,首次建立时取目录名,`--book` 可覆盖。
|
|
36
|
+
|
|
37
|
+
**单书布局**:书根就是工作区(`--book-root` 与 `--workspace` 同一目录)时,书级 store 改住 `{工作区}/.story/作者记忆/书级/`,与项目级各自一份 state;首次建立的书名优先取项目级存量本书条目里唯一的书名,再取目录名。旧版曾把书级 state 写在项目级位置,此后项目级读写都报 `state.book`;带 `--book-root {工作区}` 运行任一命令(含 `query`)会先把它原样移进 `书级/`,不改内容。这个目录其实是某个工作区里的一本书时(上一层叫 `长篇/` 或 `短篇/`,或某个祖先有 `.active-book` 或项目级 state),工具直接报错、不动任何文件,按报错改传 `--workspace`。
|
|
38
|
+
|
|
39
|
+
**路由规则**:ID 前缀就是 store——`decide` / `forget` 看 `item_id`(`AP` 进项目级,`BP` 进书级),`remember` / `replace` 看 `scope.level`(`book` 进书级,其余进项目级)。书级操作必须传 `--book-root`,没传直接报错,不会退而写进项目级。一份 `commit` 事务只能写一个 store;`replace` 与 `conflicts_with` 不能跨 store——本书例外按优先级覆盖全局规则,不算冲突,直接 `remember` 为 book 条目即可;要把全局规则改成本书规则,拆成 `forget` + `remember` 两个事件。
|
|
40
|
+
|
|
41
|
+
**存量迁移,不做双读**:升级前写进项目级 store 的 book 条目不再参与查询与预算估算,也不再接受新的 book 写入;它们仍在 `作者画像.md` 里可见、可 `decide` / `forget`。对每本书运行一次 `migrate --book-root {书目录}` 即可整批搬回来:断言、证据、确认次数、重要度原样保留,换成 `BP` 编号,原 `AP` 条目标 `superseded` 并注明去向;与全局条目的冲突关系在迁移后不再成立,这类候选退回 `pending`。书级每个源条目一笔事务,重跑只补没做完的一半。「整理作者记忆」看到项目级画像里还有「本书:」条目时,把迁移列为默认提案项。
|
|
35
42
|
|
|
36
43
|
## 什么时候读取
|
|
37
44
|
|
|
38
|
-
长篇、短篇、去 AI 味开始前,如果 state 已存在,用 `query` 按本书、题材、流程和类型筛选 active
|
|
45
|
+
长篇、短篇、去 AI 味开始前,如果 state 已存在,用 `query` 按本书、题材、流程和类型筛选 active 条目:结果是项目级 store 与 `--book-root` 所指书级 store 的合并;不传 `--book-root` 就拿不到任何本书条目。查询输出固定不超过 2048 字节。`--kind` 必传——不传直接报错,不再默认返回全部类型;按任务直接选择 kind:
|
|
39
46
|
|
|
40
47
|
| 任务 | query kinds | 注入位置 |
|
|
41
48
|
|---|---|---|
|
|
@@ -50,10 +57,19 @@
|
|
|
50
57
|
|
|
51
58
|
## 可靠性与负荷边界
|
|
52
59
|
|
|
53
|
-
- 明确“记住 / 确认 / 替换 / 忘掉”的请求走单事件 `record`,不要求 agent 手工读取修订号或拼多操作事务。成功响应会给出 `Author Memory Receipt: rN · APxxx
|
|
60
|
+
- 明确“记住 / 确认 / 替换 / 忘掉”的请求走单事件 `record`,不要求 agent 手工读取修订号或拼多操作事务。成功响应会给出 `Author Memory Receipt: rN · APxxx`;没有回执就不得声称“已经记住”。怎么告诉作者见「回执怎么告诉作者」。
|
|
54
61
|
- 普通创作只做一次本地 `query`,没有 state 时返回空结果且不创建文件;有记忆时也只返回相关 active 条目,硬上限 2048 字节。完整画像、证据、候选和 journal 不进入正文 prompt。
|
|
62
|
+
- **写入不因注入预算失败**:`record` / `commit` 照常成功、给回执;工具按上表四类任务组合估算最坏查询情形(全局条目+各 scope 维度最重的单一切片,切片按大小写无关归并、轻重按写作时真正读到的字段算,与真实查询同一把尺),装不进 2048 字节的组合在返回的 `warnings` 里点名将被略过的条目及其断言首句。收到提醒就用白话转告作者并建议「整理作者记忆」。写入落盘后另一级 store 读不出来(书目录不存在、`--book` 与书级记录不符等)也照常给回执,`warnings` 注明本次提醒没算上它——已有回执就是已记住,不要换 `event_id` 重试。写书级条目时「本书+全局」按实际条目精确计算;写项目级条目时只看得到项目级 store,顺手传 `--book-root` 就把当前这本书也算进提醒。查询按 **重要度 → 本书例外 → 最近更新** 排序装填(同一范围的条目必在同一 store,「最近」按该 store 的修订号比,不跨 store 比较),先丢的恒是重要度较低的条目——`importance` 决定超编时谁留在 prompt 里,写入时按偏好的实际分量填,不要一律 `high`。
|
|
63
|
+
- 注入预算之外还有一道硬上限:`作者画像.md` 超过 12288 字节时写入会直接失败并要求先整理。active 条目攒到几十上百条才会碰到(远在注入预算之后),碰到就走「整理作者记忆」;`forget` 这类减量操作在满编时照常可用。
|
|
55
64
|
- 查询项是低优先级倾向,不是逐条打卡清单。自然吸收即可,不复述画像、不刻意提高词面命中率,也不得为命中偏好牺牲正文连贯、节奏、字数或本书既定笔调。
|
|
56
|
-
- 不安装会记录全部用户消息的 prompt hook
|
|
65
|
+
- 不安装会记录全部用户消息的 prompt hook,也不在作者没开口时观察他:不从反复修改、成稿或操作轨迹推断偏好写入。只记作者明确表达的偏好;自然语言是否属于长期习惯仍需 agent 判断,拿不准就只执行不记录。需要确定写入时,用户可明确说“记住:……”,并以回执验收。
|
|
66
|
+
|
|
67
|
+
## 回执怎么告诉作者
|
|
68
|
+
|
|
69
|
+
回复就两行纯文本,不加代码块或引用格式:第一行用一句人话说记住了什么、管哪本书或哪类场合,如「记住了:《{书名}》的对话一律用「」,以后写这本书都照这个来;想改随时说。」;第二行是机器回执作凭证,如「技术备注:Author Memory Receipt: r1 · BP001」。
|
|
70
|
+
|
|
71
|
+
- 确认、替换、忘掉同理:「好,这条生效了:……」「换成了:……,原来的「……」不再用」「忘掉了:……」。只进待确认时说「这条先记在待确认里,你说"确认"才生效」;有冲突时用原话说明跟哪条旧习惯冲突。
|
|
72
|
+
- `warnings` / `omitted_ids` 不原样贴:说「你的习惯攒得有点多,写正文时这几条可能顾不上:「……」」,并建议说「整理作者记忆」。不提字节、prompt、kind、scope;编号只能跟着原话出现。
|
|
57
73
|
|
|
58
74
|
## 捕获判定
|
|
59
75
|
|
|
@@ -61,13 +77,19 @@
|
|
|
61
77
|
|---|---|
|
|
62
78
|
| “以后都这样”“我一直习惯……”等直接、稳定、范围清楚的原话 | `active`,`source=explicit_user` |
|
|
63
79
|
| 用户明确接受助手提出的长期做法 | `active`,`source=accepted_suggestion` |
|
|
64
|
-
|
|
|
65
|
-
|
|
|
80
|
+
| 作者原话像长期偏好但范围或稳定性含糊 | `pending`,取当前最窄合理范围;待确认只来自作者自己的话 |
|
|
81
|
+
| 同类修改反复出现、从成稿或操作轨迹看出的模式 | 不记录、不推断;作者没开口的偏好不进记忆 |
|
|
66
82
|
| “这一章别……”“这次给我……”等一次性要求 | 只执行,不记录 |
|
|
67
83
|
| 角色、时间线、伏笔、世界观、当前剧情走向 | 写项目设定/追踪,不写作者记忆 |
|
|
68
84
|
| 助手自己生成的文字、默认模板、工具告警、rubric 结论 | 不自我学习 |
|
|
69
85
|
|
|
70
|
-
保留用户的否定词、限定词和适用范围,`quote` 写原话,`assertion`
|
|
86
|
+
保留用户的否定词、限定词和适用范围,`quote` 写原话,`assertion` 只做不改变语义的紧凑归纳,**新建条目限一句话(≤120 字节,约 40 个字)**;需要解释的背景写进 `reason`(不进 prompt 载荷),不另开字段。
|
|
87
|
+
|
|
88
|
+
**一条偏好就是一条记录,例外和限定不许拆出去单列。** 「以后少用破折号,对话里也别用,除非表示打断」是一条带例外的偏好,必须整条写成一个 `assertion`(「破折号少用、对话里也不用,只在表示打断时保留」)。超编时条目是逐条被丢的,把「除非表示打断」拆成独立一条,就可能只丢掉例外、把作者明说过的限定变成送进正文的绝对禁令。只有原话确实塞了**几条互不依赖**的偏好(如「多用短句」+「章末留钩子」)才拆成几条。整句写不进 120 字节时压缩措辞,不要切掉限定词。
|
|
89
|
+
|
|
90
|
+
升级前写下的长断言不受新上限约束:原样重申它会**强化**原条目(确认次数 +1),不会因超长被拒;只有真正新建条目才校验 120 字节。
|
|
91
|
+
|
|
92
|
+
范围规则:
|
|
71
93
|
|
|
72
94
|
- “本书 / 这个角色 / 这次连载” → `book`;
|
|
73
95
|
- “都市文 / 这类题材” → `genre`;
|
|
@@ -75,33 +97,41 @@
|
|
|
75
97
|
- “以后 / 一贯 / 我习惯”且无更窄限定 → `global`;
|
|
76
98
|
- 范围含糊但可能稳定 → 取当前最窄合理范围并置 `pending`。
|
|
77
99
|
|
|
78
|
-
类型可选:`prose_style`、`story_design`、`workflow`、`delivery`、`interaction`。置信度与重要度均为 `low | medium | high
|
|
100
|
+
类型可选:`prose_style`、`story_design`、`workflow`、`delivery`、`interaction`。置信度与重要度均为 `low | medium | high`。`source` 只接受 `explicit_user`、`accepted_suggestion`、`manual`;工具会拒绝推断类来源,存量 state 里的旧来源条目照常可读、可确认、可退役。
|
|
79
101
|
|
|
80
102
|
## 冲突、撤回与强化
|
|
81
103
|
|
|
82
104
|
- 同一类型、范围、归纳文本再次出现时,脚本强化原条目,累加证据和确认次数,不重复建条目。
|
|
83
|
-
-
|
|
84
|
-
- 同一范围的规则改版用 `replace`,启用新条目并将旧条目标成 `superseded`。本书例外用 `remember` 新建 book
|
|
105
|
+
- 新偏好与同一 store 里的 active 条目矛盾时,先以 `conflict` 记候选,并在 `conflicts_with` 列出冲突 ID;当前任务仍按本轮明确要求执行。本书例外与全局规则不算冲突。
|
|
106
|
+
- 同一范围的规则改版用 `replace`,启用新条目并将旧条目标成 `superseded`。本书例外用 `remember` 新建 book 条目(传 `--book-root`),保留 global 习惯;只有作者明确撤销或改变旧规则范围时才跨范围替换,跨 store 时拆成 `forget` + `remember`。
|
|
85
107
|
- pending 可以用 `decide=activate|reject`;冲突候选不能绕过旧规则直接 activate。
|
|
86
108
|
- 作者说“忘掉 / 这不再是我的习惯”时用 `forget`,保留历史证据但不再加载。
|
|
87
109
|
- active 条目的语义不可原地偷改;语义变化必须 replace,历史才可审计。
|
|
88
110
|
|
|
111
|
+
## 整理作者记忆
|
|
112
|
+
|
|
113
|
+
作者说「整理作者记忆」,或回执 `warnings`/查询 `omitted_ids` 提示超编时:读项目级与当前书的 `作者画像.md`(每条都标了范围、重要度、把握和确认次数,重要度就是超编时的去留依据),提出合并同义条(`replace` 多合一)、退役过时条(`forget`)、给错标成 `high` 的条目下调重要度、把超长断言压缩成一句话的提案;项目级画像里还有「本书:」条目时,「对该书运行 `migrate --book-root`」列为默认提案项。清单用原话逐条列给作者确认(编号只放括号里),确认后按 store 各汇成一份 `commit` 事务提交(一份事务只写一个 store)。合并时保住每条的否定词、限定词和适用范围——合不动就退役其中一条,不要靠删限定词把两条凑成一条。整理只由作者发起或确认,不自动执行。
|
|
114
|
+
|
|
89
115
|
## 运行工具
|
|
90
116
|
|
|
91
117
|
先依次尝试 `python3`、`python`、`py -3` 找到 Python 3,再从当前 skill 根运行本地副本:
|
|
92
118
|
|
|
93
119
|
```text
|
|
94
|
-
{PYTHON} {当前 skill 根}/scripts/author_memory_commit.py init
|
|
95
|
-
{PYTHON} {当前 skill 根}/scripts/author_memory_commit.py record
|
|
96
|
-
{PYTHON} {当前 skill 根}/scripts/author_memory_commit.py query
|
|
97
|
-
{PYTHON} {当前 skill 根}/scripts/author_memory_commit.py commit
|
|
98
|
-
{PYTHON} {当前 skill 根}/scripts/author_memory_commit.py
|
|
120
|
+
{PYTHON} {当前 skill 根}/scripts/author_memory_commit.py init --workspace {工作区} [--book-root {书目录}]
|
|
121
|
+
{PYTHON} {当前 skill 根}/scripts/author_memory_commit.py record --workspace {工作区} [--book-root {书目录}] --input {工作区}/.story/work/作者记忆-事件.json
|
|
122
|
+
{PYTHON} {当前 skill 根}/scripts/author_memory_commit.py query --workspace {工作区} --book-root {书目录} --kind {类型}(必传,可重复) [--genre {题材}] [--workflow {流程}]
|
|
123
|
+
{PYTHON} {当前 skill 根}/scripts/author_memory_commit.py commit --workspace {工作区} [--book-root {书目录}] --input {工作区}/.story/work/作者记忆-事务.json
|
|
124
|
+
{PYTHON} {当前 skill 根}/scripts/author_memory_commit.py migrate --workspace {工作区} --book-root {书目录}
|
|
125
|
+
{PYTHON} {当前 skill 根}/scripts/author_memory_commit.py check --workspace {工作区} [--book-root {书目录}]
|
|
99
126
|
```
|
|
100
127
|
|
|
101
|
-
- `
|
|
102
|
-
|
|
103
|
-
- `
|
|
104
|
-
- `
|
|
128
|
+
所有子命令都可加 `--book {书名}` 覆盖书名;正在写某本书时一律带上 `--book-root`,书级操作没有它会直接报错。事件与事务 JSON 写在 `{工作区}/.story/work/` 下(不写系统 `/tmp`),成功后删掉;`book` 条目的 `scope.value` 填书名(书级 store 已记着书名就用它,首次取书目录名)。
|
|
129
|
+
|
|
130
|
+
- `record`:常用单事件入口,按路由规则落到项目级或书级 store,自动读取该 store 的当前修订、首次自动初始化;`event_id` 相同且内容相同会幂等返回原回执,内容不同会失败。原样重申已有条目的 `assertion` 会强化该条(不受 120 字节新建上限约束)。返回里的 `store` / `book` 说明写到了哪一级,`warnings` 是预算提醒,按「回执怎么告诉作者」用白话转告。
|
|
131
|
+
- `query`:只读相关 active 条目,项目级与书级合并返回;`--kind` 必传、可重复,两级 state 都不存在时返回空结果且零写入。输出按 重要度 → 本书例外 → 最近更新 排序装填;装不下的条目跳过而不中断(一条长的不挡后面的短条),漏下的 ID 按同一优先级报进 `omitted_ids`(最多列 20 条,`omitted` 是真实总数)。**`omitted_ids` 非空=记忆超编**——转告作者并建议「整理作者记忆」,它不是「没有更多了」,也不得改读完整画像规避预算。
|
|
132
|
+
- `commit`:高级批量入口;一份事务只写一个 store,先在内存完成 schema、引用、容量和所有视图校验,最后原子替换 state。事务文件在成功前必须保留;过期修订会在任何写入前失败。
|
|
133
|
+
- `migrate`:把项目级 store 里某本书的存量 book 条目整批搬进 `--book-root` 的书级 store,幂等,中途失败直接重跑;返回 `migrated`(源→新编号),没有存量时为空。
|
|
134
|
+
- `check`:从 state 重建并逐字核验所有派生视图;传 `--book-root` 时两级一起核验。
|
|
105
135
|
|
|
106
136
|
## 事务格式
|
|
107
137
|
|
|
@@ -130,7 +160,7 @@
|
|
|
130
160
|
}
|
|
131
161
|
```
|
|
132
162
|
|
|
133
|
-
把文件交给 `record
|
|
163
|
+
把文件交给 `record`(book 范围的事件同时传 `--book-root`)。待确认项的 `status` 用 `pending`;冲突候选用 `conflict` 并填写同一 store 里的 active ID。确认或拒绝候选时,把下列对象作为新事件的 `operation`(`BP` 编号的事件传 `--book-root`):
|
|
134
164
|
|
|
135
165
|
```json
|
|
136
166
|
{"action":"decide","item_id":"AP002","decision":"activate","quote":"对,这就是我的长期习惯。","reason":"作者明确确认"}
|
|
@@ -162,4 +192,4 @@
|
|
|
162
192
|
{"action":"forget","item_id":"AP003","quote":"忘掉这个偏好。","reason":"作者明确撤回"}
|
|
163
193
|
```
|
|
164
194
|
|
|
165
|
-
需要把多个动作绑定成一次原子提交时才用高级 `commit`:顶层传 `schema_version`、唯一 `transaction_id`、当前 `expected_state_revision` 和含 1–32 项的 `operations
|
|
195
|
+
需要把多个动作绑定成一次原子提交时才用高级 `commit`:顶层传 `schema_version`、唯一 `transaction_id`、当前 `expected_state_revision` 和含 1–32 项的 `operations`。操作按数组顺序应用,任一步失败则整份事务零写入。成功后删除临时输入文件;显式记忆请求按「回执怎么告诉作者」转告。
|
|
@@ -160,19 +160,13 @@
|
|
|
160
160
|
| AI 腔重 | de_ai | 替换禁用词、改写句式 |
|
|
161
161
|
| 小问题多 | polish | 打磨语言细节 |
|
|
162
162
|
|
|
163
|
-
###
|
|
163
|
+
### 读者契约审查
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
审稿先问“无毒吗”,再问“好看吗”:没有契约破坏只代表不踩雷,还要确认情绪兑现足够强。
|
|
166
166
|
|
|
167
|
-
- [ ]
|
|
168
|
-
- [ ] 主角代理权:按因果权 + 结算权审查,而非按出场时长;关键节点核对四问——谁决定事情为什么发生、谁作出不可替代的选择、谁承担或选择关键后果、核心收益/认可/权力结算给谁。配角可执行局部动作,但不能无声夺走期待所有权。
|
|
169
|
-
- [ ] 期待债:承诺是否被偿还、延期并支付利息,还是被解释/流程/设定吞掉?
|
|
170
|
-
- [ ] 终局储备:本单元是否动用了本阶段还不该解锁的终局底牌(宿敌/真相/身份/金手指上限)?是否让某条升级线逼近天花板、后面没台阶接?两问皆否即放行——单章一战多得(多线齐涨)是好设计,不算超速。
|
|
171
|
-
- [ ] 兑现归属:期待所有权是否按承诺结算;自愿让渡只有在“长期净收益为负 + 控制/因果权下降”同时出现时亮红灯,战略性让步的更大控制/未来收益/权力/信息交换是否可见?
|
|
172
|
-
- [ ] 节奏续接:高潮/兑现后是否允许短暂低压和小而可见的收益/奖励,而非机械立即加危机?新元素是否支付换书债、没有逃避旧承诺?
|
|
173
|
-
- [ ] 题材特定风险:履约爽文/能力幻想中,主角是否反复以愚蠢或可避免的无能制造灾难并由他人收拾,损害因果权与结算信任?
|
|
167
|
+
- [ ] 按契约四问审:1. 主角是不是靠自己的选择挣到了结果?2. 核心收益或高光有没有被配角、机构或巧合无交换地拿走?3. 有没有动用本阶段还不该解锁的终局底牌,或把某条升级线顶到天花板?4. 旧期待付了利息没,又给读者留了什么期待?新地图、新机构、新谜团有没有被拿来逃避旧承诺?四问都过=契约安全,能靠铺垫、交换、成本补上=需补强,补不上=契约破坏。
|
|
174
168
|
- [ ] 反向审查:若删除“安全解释”,情绪是否更强?若保留风险情节,是否带来更强期待、代价或爽点?
|
|
175
|
-
- [ ]
|
|
169
|
+
- [ ] 高潮或兑现后是否允许短暂低压和小而可见的收益,而非机械立即加危机?
|
|
176
170
|
|
|
177
171
|
---
|
|
178
172
|
|
|
@@ -18,23 +18,25 @@ Markdown 只负责给作者和 Agent 阅读,工具不再反向解析 Markdown
|
|
|
18
18
|
先按运行环境探测 Python 3 解释器(依次尝试 `python3`、`python`、`py -3`)。追踪事务脚本使用当前 skill 根目录;字数与章节闭环统一使用 `story-long-write` skill 根目录:
|
|
19
19
|
|
|
20
20
|
```text
|
|
21
|
-
{PYTHON} {当前 skill 根}/scripts/tracking_commit.py init --project {书项目根} --input {
|
|
21
|
+
{PYTHON} {当前 skill 根}/scripts/tracking_commit.py init --project {书项目根} --input {书项目根}/.story/work/init.json
|
|
22
22
|
{PYTHON} {当前 skill 根}/scripts/tracking_commit.py check --project {书项目根}
|
|
23
|
+
{PYTHON} {当前 skill 根}/scripts/tracking_commit.py draft --project {书项目根} --chapter {N}
|
|
23
24
|
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter check --project {书项目根} --chapter {N}
|
|
24
|
-
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter commit --project {书项目根} --chapter {N} --input {
|
|
25
|
-
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter accept-current-length --project {书项目根} --chapter {N} --input {
|
|
25
|
+
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter commit --project {书项目根} --chapter {N} --input {书项目根}/.story/work/第{NNN}章/tracking.json
|
|
26
|
+
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter accept-current-length --project {书项目根} --chapter {N} --input {书项目根}/.story/work/第{NNN}章/tracking.json
|
|
26
27
|
```
|
|
27
28
|
|
|
28
29
|
- `init`:只在 `_tracking-state.json` 不存在时执行,绝不覆盖已初始化项目。
|
|
29
|
-
- `
|
|
30
|
-
- `
|
|
30
|
+
- `draft`:按当前 state 把逐章事务预填到 `.story/work/第NNN章/tracking.json`(修订号、模式、章名、`context` 四项当前值),并输出各文本字段的字数上限与在场核心角色的当前快照;调用方只填 `delta` 与有变化角色的快照。
|
|
31
|
+
- `wordcount measure` / `wordcount checkpoint`:纯测量入口;不写正文、不写 tracking、不做语义判断。长篇正文只在前组写完后由父流程调用一次 `checkpoint`(见 workflow-chapter 步骤 6),整章长度由 `chapter check` 收口。
|
|
32
|
+
- `chapter check`:重新读取当前正文与细纲目标,返回确定性长度状态、现有 blocking quality、`state_revision` 和当前可执行动作,不保存 approval。`under` 不提供自动补写;`over` 额外返回一次净删型 `compress-once` 及回到内部区间或作者给定区间所需的删除字数。
|
|
31
33
|
- `chapter commit`:再次读取当前文件、重新计数并重跑 blocking quality;只接受用户带内章节,把简短字数记录与逐章事务一起原子提交。
|
|
32
34
|
- `chapter accept-current-length`:只接受带外但 quality pass 的章节;接受动作发生时重新读取、重新计数并立即原子提交,不保存可陈旧的历史决议。
|
|
33
35
|
- `check`:严格验证 state schema、逐章记录连续性/规范名/体积、固定 7 栏、角色快照硬上限、派生文件集合,以及所有派生视图与 state 的逐字一致性。
|
|
34
36
|
|
|
35
37
|
每本书由 `追踪/.tracking-commit.lock` 串行写事务,`expected_state_revision` 再拒绝基于旧状态构造的 stale transaction。两个不同事务并发时至多一个修订成功。字数记录也在锁内对当前正文和目标重新验证,正文或目标变化会让预先构造的记录直接失败。
|
|
36
38
|
|
|
37
|
-
事务 JSON
|
|
39
|
+
事务 JSON 是临时输入,不是项目产物:只写在书目录 `.story/work/` 下(逐章事务放 `.story/work/第NNN章/tracking.json`),不写系统 `/tmp`、书根、`大纲/` 或 `正文/`;成功前必须保留,提交成功后即可删除(`storyctl.py chapter commit` / `accept-current-length` 成功时自动删除该章目录;直接调用 `tracking_commit.py commit` 时由调用方删除)——之后 `check` 失败按下文提交 `mode=revision` 新事务修复,不需要原事务。若文件写入失败,`_tracking-state.json` 尚未推进;修正环境后直接重跑**同一份** `commit`。append 重跑只接受内容完全相同的既有逐章记录,不维护 `dirty/pending/repair` 状态机。
|
|
38
40
|
|
|
39
41
|
校验失败与写入失败处理方式不同:校验失败(字段非法、退役结构、容量超限)要按报错改事务本身,重跑同一份结果不变。派生视图被手改或外部改动导致 `check` 报 `derived view differs from _tracking-state.json` 时,重新提交**该章**的 `mode=revision` 事务让工具整份重建,`expected_state_revision` 取 `追踪/_tracking-state.json` 的 `state_revision` 字段——`check` 失败时只往 stderr 打 ERROR,不输出 JSON;不手改派生文件,也不删 `_tracking-state.json` 重来。手写出的逐章记录会让同章 `append` 永久报 `chapter delta N already exists with different content`——删掉那个手写文件后重跑原事务即可。
|
|
40
42
|
|