@oh-story/dsh 0.1.8 → 0.1.9

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.
Files changed (272) hide show
  1. package/README.md +11 -11
  2. package/lib/client.js +35 -14
  3. package/lib/client.js.map +2 -2
  4. package/lib/drama/manifest.json +165 -69
  5. package/lib/drama/skills/short-drama/SKILL.md +5 -1
  6. package/lib/drama/skills/short-drama/scripts/creator_markdown_check.py +126 -9
  7. package/lib/drama/skills/short-drama/scripts/project_tool.py +11 -0
  8. package/lib/drama/skills/short-drama-assets/references/character-and-look.md +18 -0
  9. package/lib/drama/skills/short-drama-assets/references/continuity-lock.md +10 -1
  10. package/lib/drama/skills/short-drama-edit/SKILL.md +148 -0
  11. package/lib/drama/skills/short-drama-edit/agents/openai.yaml +4 -0
  12. package/lib/drama/skills/short-drama-edit/assets/remotion/README.md +60 -0
  13. package/lib/drama/skills/short-drama-edit/assets/remotion/package.json +15 -0
  14. package/lib/drama/skills/short-drama-edit/assets/remotion/remotion.config.ts +6 -0
  15. package/lib/drama/skills/short-drama-edit/assets/remotion/src/Root.tsx +26 -0
  16. package/lib/drama/skills/short-drama-edit/assets/remotion/src/Subtitles.tsx +88 -0
  17. package/lib/drama/skills/short-drama-edit/assets/remotion/src/font.ts +46 -0
  18. package/lib/drama/skills/short-drama-edit/assets/remotion/src/index.ts +4 -0
  19. package/lib/drama/skills/short-drama-edit/assets/remotion/src/schema.ts +32 -0
  20. package/lib/drama/skills/short-drama-edit/assets/remotion/tsconfig.json +13 -0
  21. package/lib/drama/skills/short-drama-edit/assets//345/211/252/350/276/221/345/215/225.md +43 -0
  22. package/lib/drama/skills/short-drama-edit/references/cut-craft.md +81 -0
  23. package/lib/drama/skills/short-drama-edit/references/delivery-verify.md +58 -0
  24. package/lib/drama/skills/short-drama-edit/references/generated-footage.md +96 -0
  25. package/lib/drama/skills/short-drama-edit/references/sound-and-subtitles.md +113 -0
  26. package/lib/drama/skills/short-drama-edit/references/stage-contract.md +55 -0
  27. package/lib/drama/skills/short-drama-edit/scripts/edit_tool.py +1041 -0
  28. package/lib/drama/skills/short-drama-edit/scripts/selftest.py +456 -0
  29. package/lib/drama/skills/short-drama-image-prompts/assets/image-prompts.md +5 -0
  30. package/lib/drama/skills/short-drama-image-prompts/assets/lookdev-prompts.md +3 -0
  31. package/lib/drama/skills/short-drama-novel-analyze/references/aggregation-and-entities.md +2 -2
  32. package/lib/drama/skills/short-drama-novel-analyze/references/chapter-extraction.md +4 -1
  33. package/lib/drama/skills/short-drama-produce/SKILL.md +24 -3
  34. package/lib/drama/skills/short-drama-produce/references/adapter-contract.md +28 -0
  35. package/lib/drama/skills/short-drama-produce/references/providers/minimax-h3-video.md +24 -5
  36. package/lib/drama/skills/short-drama-produce/references/providers/seedance.md +7 -0
  37. package/lib/drama/skills/short-drama-produce/scripts/fixture_adapter.py +18 -1
  38. package/lib/drama/skills/short-drama-produce/scripts/production_tool.py +181 -2
  39. package/lib/drama/skills/short-drama-produce/scripts/provider_adapters.py +57 -2
  40. package/lib/drama/skills/short-drama-review/SKILL.md +3 -0
  41. package/lib/drama/skills/short-drama-review/references/production-quality-gates.md +20 -0
  42. package/lib/drama/skills/short-drama-review/references/rubric-visual-motion.md +36 -0
  43. package/lib/drama/skills/short-drama-storyboard/SKILL.md +7 -0
  44. package/lib/drama/skills/short-drama-storyboard/assets/keyframe-prompts.md +4 -0
  45. package/lib/drama/skills/short-drama-storyboard/references/shot-craft.md +39 -0
  46. package/lib/drama/skills/short-drama-storyboard/references/stage-contract.md +2 -0
  47. package/lib/drama/skills/short-drama-video-prompts/SKILL.md +7 -1
  48. package/lib/drama/skills/short-drama-video-prompts/references/minimax-h3.md +101 -6
  49. package/lib/drama/skills/short-drama-video-prompts/references/motion-recipe.md +7 -1
  50. package/lib/drama/skills/short-drama-video-prompts/references/performance-action-timing.md +35 -0
  51. package/lib/drama/skills/short-drama-video-prompts/references/production-prompt-grammar.md +3 -1
  52. package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.0.md +13 -3
  53. package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.5.md +35 -4
  54. package/lib/drama/skills/short-drama-video-prompts/references/stage-contract.md +1 -1
  55. package/lib/drama/skills/short-drama-write/SKILL.md +13 -2
  56. package/lib/drama/skills/short-drama-write/references/screenplay-format.md +6 -0
  57. package/lib/drama/skills/short-drama-write/references/stage-contract.md +1 -0
  58. package/lib/index.js +4 -2
  59. package/lib/index.js.map +2 -2
  60. package/lib/novel-to-game/VERSION +1 -1
  61. package/lib/novel-to-game/manifest.json +28 -28
  62. package/lib/novel-to-game/skills/game-art-direction/SKILL.md +6 -27
  63. package/lib/novel-to-game/skills/game-build/SKILL.md +12 -29
  64. package/lib/novel-to-game/skills/game-concept/SKILL.md +10 -26
  65. package/lib/novel-to-game/skills/game-qa/SKILL.md +5 -15
  66. package/lib/novel-to-game/skills/game-qa/references/test-design-method.md +1 -1
  67. package/lib/novel-to-game/skills/game-world-design/SKILL.md +19 -28
  68. package/lib/novel-to-game/skills/game-world-design/references/dialogue-design-method.md +1 -2
  69. package/lib/novel-to-game/skills/novel-game-analyze/SKILL.md +6 -9
  70. package/lib/novel-to-game/skills/novel-to-game/SKILL.md +6 -11
  71. package/lib/novel-to-game/skills/novel-to-game/references/intake-benchmark-reference.md +0 -4
  72. package/lib/novel-to-game/skills/novel-to-game/references/intake-method.md +1 -3
  73. package/lib/novel-to-game/skills/novel-to-game/references/pipeline-contract.md +3 -5
  74. package/lib/oh-story/manifest.json +292 -172
  75. package/lib/oh-story/roles/character-designer.md +1 -1
  76. package/lib/oh-story/roles/narrative-writer.md +56 -242
  77. package/lib/oh-story/roles/story-architect.md +1 -1
  78. package/lib/oh-story/skills/story/SKILL.md +1 -1
  79. package/lib/oh-story/skills/story/VERSION +1 -1
  80. package/lib/oh-story/skills/story/references/author-memory.md +10 -8
  81. package/lib/oh-story/skills/story-deslop/SKILL.md +20 -182
  82. package/lib/oh-story/skills/story-deslop/references/anti-ai-writing.md +19 -47
  83. package/lib/oh-story/skills/story-deslop/references/author-memory.md +10 -8
  84. package/lib/oh-story/skills/story-deslop/references/banned-words.md +3 -1
  85. package/lib/oh-story/skills/story-deslop/references/deslop-gates.md +154 -0
  86. package/lib/oh-story/skills/story-deslop/references/style-resolution.md +27 -0
  87. package/lib/oh-story/skills/story-deslop/scripts/check-ai-patterns.js +6 -1
  88. package/lib/oh-story/skills/story-deslop/scripts/check-degeneration.js +39 -20
  89. package/lib/oh-story/skills/story-deslop/scripts/normalize-punctuation.js +10 -5
  90. package/lib/oh-story/skills/story-deslop/scripts/style-whitelist.js +39 -0
  91. package/lib/oh-story/skills/story-import/SKILL.md +2 -2
  92. package/lib/oh-story/skills/story-import/references/format-and-structure.md +2 -2
  93. package/lib/oh-story/skills/story-import/references/tracking-initialization.md +31 -0
  94. package/lib/oh-story/skills/story-import/references/tracking-transaction.md +2 -29
  95. package/lib/oh-story/skills/story-import/scripts/check-outline-contract.js +176 -12
  96. package/lib/oh-story/skills/story-long-analyze/SKILL.md +1 -1
  97. package/lib/oh-story/skills/story-long-write/SKILL.md +20 -193
  98. package/lib/oh-story/skills/story-long-write/references/anti-ai-writing.md +19 -47
  99. package/lib/oh-story/skills/story-long-write/references/artifact-protocols.md +62 -7
  100. package/lib/oh-story/skills/story-long-write/references/author-memory.md +10 -8
  101. package/lib/oh-story/skills/story-long-write/references/banned-words.md +3 -1
  102. package/lib/oh-story/skills/story-long-write/references/benchmark-recall.md +20 -0
  103. package/lib/oh-story/skills/story-long-write/references/dialogue-mastery.md +6 -4
  104. package/lib/oh-story/skills/story-long-write/references/long-chapter-quality.md +2 -2
  105. package/lib/oh-story/skills/story-long-write/references/long-format.md +2 -0
  106. package/lib/oh-story/skills/story-long-write/references/outline-structure-theory.md +2 -0
  107. package/lib/oh-story/skills/story-long-write/references/project-files.md +108 -0
  108. package/lib/oh-story/skills/story-long-write/references/reference-index.md +87 -0
  109. package/lib/oh-story/skills/story-long-write/references/style-combat-face.md +1 -1
  110. package/lib/oh-story/skills/story-long-write/references/style-craft.md +9 -29
  111. package/lib/oh-story/skills/story-long-write/references/style-genre-modules.md +1 -1
  112. package/lib/oh-story/skills/story-long-write/references/style-resolution.md +27 -0
  113. package/lib/oh-story/skills/story-long-write/references/tracking-initialization.md +31 -0
  114. package/lib/oh-story/skills/story-long-write/references/tracking-transaction.md +2 -29
  115. package/lib/oh-story/skills/story-long-write/references/workflow-chapter.md +51 -52
  116. package/lib/oh-story/skills/story-long-write/references/workflow-daily.md +8 -7
  117. package/lib/oh-story/skills/story-long-write/references/workflow-setup.md +36 -15
  118. package/lib/oh-story/skills/story-long-write/references/writer-prompt-fallback.md +22 -0
  119. package/lib/oh-story/skills/story-long-write/references/writing-craft.md +69 -2
  120. package/lib/oh-story/skills/story-long-write/scripts/build_writer_prompt.py +410 -0
  121. package/lib/oh-story/skills/story-long-write/scripts/check-ai-patterns.js +6 -1
  122. package/lib/oh-story/skills/story-long-write/scripts/check-degeneration.js +39 -20
  123. package/lib/oh-story/skills/story-long-write/scripts/check-outline-contract.js +176 -12
  124. package/lib/oh-story/skills/story-long-write/scripts/check-outline-copy.js +90 -23
  125. package/lib/oh-story/skills/story-long-write/scripts/normalize-punctuation.js +10 -5
  126. package/lib/oh-story/skills/story-long-write/scripts/outline_view.py +283 -0
  127. package/lib/oh-story/skills/story-long-write/scripts/style-whitelist.js +39 -0
  128. package/lib/oh-story/skills/story-review/SKILL.md +13 -3
  129. package/lib/oh-story/skills/story-review/references/anti-ai-writing.md +19 -47
  130. package/lib/oh-story/skills/story-review/references/author-memory.md +10 -8
  131. package/lib/oh-story/skills/story-review/references/banned-words.md +3 -1
  132. package/lib/oh-story/skills/story-review/references/dialogue-mastery.md +6 -4
  133. package/lib/oh-story/skills/story-review/references/review-quality.md +2 -2
  134. package/lib/oh-story/skills/story-review/references/style-resolution.md +27 -0
  135. package/lib/oh-story/skills/story-review/references/tracking-initialization.md +31 -0
  136. package/lib/oh-story/skills/story-review/references/tracking-transaction.md +2 -29
  137. package/lib/oh-story/skills/story-review/scripts/check-ai-patterns.js +6 -1
  138. package/lib/oh-story/skills/story-review/scripts/check-degeneration.js +39 -20
  139. package/lib/oh-story/skills/story-review/scripts/normalize-punctuation.js +10 -5
  140. package/lib/oh-story/skills/story-review/scripts/style-whitelist.js +39 -0
  141. package/lib/oh-story/skills/story-setup/SKILL.md +17 -10
  142. package/lib/oh-story/skills/story-setup/references/agent-references/anti-ai-writing.md +19 -47
  143. package/lib/oh-story/skills/story-setup/references/agent-references/banned-words.md +3 -1
  144. package/lib/oh-story/skills/story-setup/references/agent-references/deslop-gates.md +154 -0
  145. package/lib/oh-story/skills/story-setup/references/agent-references/dialogue-mastery.md +6 -4
  146. package/lib/oh-story/skills/story-setup/references/agent-references/format-and-structure.md +2 -2
  147. package/lib/oh-story/skills/story-setup/references/agent-references/short-genre-formulas.md +1 -1
  148. package/lib/oh-story/skills/story-setup/references/agent-references/style-combat-face.md +1 -1
  149. package/lib/oh-story/skills/story-setup/references/agent-references/style-genre-modules.md +1 -1
  150. package/lib/oh-story/skills/story-setup/references/agent-references/style-resolution.md +27 -0
  151. package/lib/oh-story/skills/story-setup/references/agent-references/writing-craft.md +69 -2
  152. package/lib/oh-story/skills/story-setup/references/diagnostics.md +38 -0
  153. package/lib/oh-story/skills/story-short-analyze/references/analysis-writing-techniques.md +1 -1
  154. package/lib/oh-story/skills/story-short-analyze/references/source-story-quality.md +2 -2
  155. package/lib/oh-story/skills/story-short-write/SKILL.md +18 -186
  156. package/lib/oh-story/skills/story-short-write/references/author-memory.md +10 -8
  157. package/lib/oh-story/skills/story-short-write/references/banned-words.md +3 -1
  158. package/lib/oh-story/skills/story-short-write/references/benchmark-recall.md +60 -0
  159. package/lib/oh-story/skills/story-short-write/references/dialogue-mastery.md +6 -4
  160. package/lib/oh-story/skills/story-short-write/references/genre-styles//344/270/226/346/203/205/346/211/223/350/204/270.md +2 -2
  161. package/lib/oh-story/skills/story-short-write/references/genre-styles//345/217/214/347/224/267/344/270/273.md +1 -1
  162. package/lib/oh-story/skills/story-short-write/references/genre-styles//345/244/215/344/273/207/346/211/223/350/204/270.md +3 -3
  163. package/lib/oh-story/skills/story-short-write/references/genre-styles//345/256/205/346/226/227/345/256/253/346/226/227.md +3 -3
  164. package/lib/oh-story/skills/story-short-write/references/genre-styles//346/200/273/350/243/201/350/261/252/351/227/250.md +3 -3
  165. package/lib/oh-story/skills/story-short-write/references/genre-styles//346/202/254/347/226/221.md +5 -5
  166. package/lib/oh-story/skills/story-short-write/references/genre-styles//346/260/221/344/277/227/346/200/252/350/260/210.md +4 -4
  167. package/lib/oh-story/skills/story-short-write/references/genre-styles//347/224/234/345/256/240.md +5 -5
  168. package/lib/oh-story/skills/story-short-write/references/genre-styles//350/277/275/345/246/273/347/201/253/350/221/254/345/234/272.md +3 -3
  169. package/lib/oh-story/skills/story-short-write/references/genre-writing-formulas.md +1 -1
  170. package/lib/oh-story/skills/story-short-write/references/genre-writing-techniques.md +1 -1
  171. package/lib/oh-story/skills/story-short-write/references/reference-index.md +53 -0
  172. package/lib/oh-story/skills/story-short-write/references/short-craft.md +12 -14
  173. package/lib/oh-story/skills/story-short-write/references/short-deslop.md +10 -10
  174. package/lib/oh-story/skills/story-short-write/references/short-format.md +3 -1
  175. package/lib/oh-story/skills/story-short-write/references/short-prose-quality.md +2 -2
  176. package/lib/oh-story/skills/story-short-write/references/style-resolution.md +27 -0
  177. package/lib/oh-story/skills/story-short-write/references/workflow-design.md +77 -0
  178. package/lib/oh-story/skills/story-short-write/references/writing-workflow.md +5 -5
  179. package/lib/oh-story/skills/story-short-write/scripts/check-ai-patterns.js +6 -1
  180. package/lib/oh-story/skills/story-short-write/scripts/check-degeneration.js +39 -20
  181. package/lib/oh-story/skills/story-short-write/scripts/check-delivery-contract.js +34 -5
  182. package/lib/oh-story/skills/story-short-write/scripts/check-outline-copy.js +90 -23
  183. package/lib/oh-story/skills/story-short-write/scripts/normalize-punctuation.js +10 -5
  184. package/lib/oh-story/skills/story-short-write/scripts/style-whitelist.js +39 -0
  185. package/lib/types/client/drama-production-view.d.ts.map +1 -1
  186. package/lib/types/client/index.d.ts.map +1 -1
  187. package/lib/types/client/production-prompts.d.ts.map +1 -1
  188. package/lib/types/client/production-runtime.d.ts +17 -0
  189. package/lib/types/client/production-runtime.d.ts.map +1 -1
  190. package/lib/types/skill-provider.d.ts.map +1 -1
  191. package/lib/video-recap/CHANGELOG.md +31 -1
  192. package/lib/video-recap/manifest.json +162 -162
  193. package/lib/video-recap/skills/video-assemble/scripts/artifacts.py +4 -9
  194. package/lib/video-recap/skills/video-assemble/scripts/assemble.py +47 -60
  195. package/lib/video-recap/skills/video-assemble/scripts/assembly_contract.py +77 -115
  196. package/lib/video-recap/skills/video-assemble/scripts/assembly_settings.py +41 -40
  197. package/lib/video-recap/skills/video-assemble/scripts/audio_automation.py +22 -32
  198. package/lib/video-recap/skills/video-assemble/scripts/audio_mix.py +102 -192
  199. package/lib/video-recap/skills/video-assemble/scripts/jianying_builders.py +14 -35
  200. package/lib/video-recap/skills/video-assemble/scripts/jianying_model.py +14 -12
  201. package/lib/video-recap/skills/video-assemble/scripts/jianying_optional.py +8 -9
  202. package/lib/video-recap/skills/video-assemble/scripts/jianying_schema.py +3 -14
  203. package/lib/video-recap/skills/video-assemble/scripts/jianying_timeline_contract.py +23 -12
  204. package/lib/video-recap/skills/video-assemble/scripts/jianying_tracks.py +1 -4
  205. package/lib/video-recap/skills/video-assemble/scripts/jianying_writer.py +24 -25
  206. package/lib/video-recap/skills/video-assemble/scripts/lib.py +31 -85
  207. package/lib/video-recap/skills/video-assemble/scripts/media.py +100 -144
  208. package/lib/video-recap/skills/video-assemble/scripts/narration_audio.py +101 -195
  209. package/lib/video-recap/skills/video-assemble/scripts/render_preflight.py +10 -21
  210. package/lib/video-recap/skills/video-assemble/scripts/source_subtitles.py +90 -169
  211. package/lib/video-recap/skills/video-assemble/scripts/subtitle_core.py +69 -122
  212. package/lib/video-recap/skills/video-assemble/scripts/subtitle_render.py +10 -17
  213. package/lib/video-recap/skills/video-assemble/scripts/timeline.py +33 -48
  214. package/lib/video-recap/skills/video-assemble/scripts/timeline_emit.py +14 -20
  215. package/lib/video-recap/skills/video-assemble/scripts/visual_render.py +135 -213
  216. package/lib/video-recap/skills/video-cut/scripts/cut_cli.py +49 -57
  217. package/lib/video-recap/skills/video-cut/scripts/cut_contract.py +38 -74
  218. package/lib/video-recap/skills/video-cut/scripts/cut_render.py +46 -95
  219. package/lib/video-recap/skills/video-cut/scripts/lib.py +23 -25
  220. package/lib/video-recap/skills/video-cut/scripts/media_geometry.py +70 -173
  221. package/lib/video-recap/skills/video-cut/scripts/narration_mapping.py +28 -53
  222. package/lib/video-recap/skills/video-cut/scripts/sentence_boundaries.py +162 -322
  223. package/lib/video-recap/skills/video-recap/references/timeline-and-jianying.md +6 -7
  224. package/lib/video-recap/skills/video-recap/scripts/doctor.py +104 -124
  225. package/lib/video-recap/skills/video-recap/scripts/final_qc.py +255 -412
  226. package/lib/video-recap/skills/video-recap/scripts/lib.py +30 -52
  227. package/lib/video-recap/skills/video-recap/scripts/materials.py +97 -120
  228. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_client.py +7 -12
  229. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_evidence.py +46 -97
  230. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_observations.py +18 -36
  231. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_payload.py +29 -47
  232. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_report.py +43 -76
  233. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_runner.py +2 -1
  234. package/lib/video-recap/skills/video-recap/scripts/qc_contract.py +2 -1
  235. package/lib/video-recap/skills/video-recap/scripts/recap_cli.py +2 -2
  236. package/lib/video-recap/skills/video-recap/scripts/recap_inspect.py +129 -145
  237. package/lib/video-recap/skills/video-recap/scripts/recap_review.py +27 -20
  238. package/lib/video-recap/skills/video-recap/scripts/recap_runner.py +20 -31
  239. package/lib/video-recap/skills/video-recap/scripts/recap_runtime.py +31 -106
  240. package/lib/video-recap/skills/video-recap/scripts/recap_stage_qc.py +43 -113
  241. package/lib/video-recap/skills/video-recap/scripts/recap_timeline.py +196 -377
  242. package/lib/video-recap/skills/video-script/scripts/agent_brief.py +1 -1
  243. package/lib/video-recap/skills/video-script/scripts/agent_text.py +63 -172
  244. package/lib/video-recap/skills/video-script/scripts/brief_context.py +80 -135
  245. package/lib/video-recap/skills/video-script/scripts/brief_inputs.py +125 -167
  246. package/lib/video-recap/skills/video-script/scripts/brief_timeline.py +93 -208
  247. package/lib/video-recap/skills/video-script/scripts/deslop_qc.py +20 -46
  248. package/lib/video-recap/skills/video-script/scripts/lib.py +30 -26
  249. package/lib/video-recap/skills/video-script/scripts/narration_lint.py +145 -140
  250. package/lib/video-recap/skills/video-script/scripts/review_response.py +12 -42
  251. package/lib/video-recap/skills/video-script/scripts/review_runner.py +0 -6
  252. package/lib/video-recap/skills/video-script/scripts/speech_ownership.py +39 -100
  253. package/lib/video-recap/skills/video-script/scripts/timeline_fusion.py +33 -124
  254. package/lib/video-recap/skills/video-understanding/scripts/agent_brief.py +1 -1
  255. package/lib/video-recap/skills/video-understanding/scripts/agent_text.py +63 -172
  256. package/lib/video-recap/skills/video-understanding/scripts/asr.py +1 -2
  257. package/lib/video-recap/skills/video-understanding/scripts/brief_context.py +80 -135
  258. package/lib/video-recap/skills/video-understanding/scripts/brief_inputs.py +125 -167
  259. package/lib/video-recap/skills/video-understanding/scripts/brief_timeline.py +93 -208
  260. package/lib/video-recap/skills/video-understanding/scripts/consolidate.py +1 -1
  261. package/lib/video-recap/skills/video-understanding/scripts/deslop_qc.py +20 -46
  262. package/lib/video-recap/skills/video-understanding/scripts/lib.py +31 -26
  263. package/lib/video-recap/skills/video-understanding/scripts/narration_lint.py +145 -140
  264. package/lib/video-recap/skills/video-understanding/scripts/speech_ownership.py +39 -100
  265. package/lib/video-recap/skills/video-understanding/scripts/timeline_fusion.py +33 -124
  266. package/lib/video-recap/skills/video-understanding/scripts/vlm.py +1 -4
  267. package/lib/video-recap/skills/video-voiceover/scripts/dub.py +7 -13
  268. package/lib/video-recap/skills/video-voiceover/scripts/fish_audio.py +12 -30
  269. package/lib/video-recap/skills/video-voiceover/scripts/lib.py +98 -131
  270. package/lib/video-recap/skills/video-voiceover/scripts/tts_audio.py +17 -28
  271. package/lib/video-recap/skills/video-voiceover/scripts/voiceover.py +151 -240
  272. package/package.json +41 -41
@@ -0,0 +1,154 @@
1
+ # 去AI味 Gate 执行细则
2
+
3
+ 本文件承接调用方选定 Gate;只执行所选范围,不扩大为全量。表达先按 [style-resolution.md](style-resolution.md) 的本书裁决,剧情和信息保护边界仍有效。写作自检与写后审查沿用下方「写手 A-G 判据」;独立去味沿用「删除优先判断」及各门禁详细步骤。模式解释、三遍法与范例见 [anti-ai-writing.md](anti-ai-writing.md)。
4
+
5
+ #### 删除优先判断(先于各 Gate)
6
+
7
+ 每条被标记项先判能否删除,再考虑润色——很多 AI 味句是废话(解释、注水、凑数),润色后照样冗余。
8
+
9
+ 1. 删掉后是否丢失伏笔、钩子、角色特征、情节推进、必要信息或必要转折?都不丢则直接删,不进 Gate。
10
+ 2. 丢任意一项 → 保留信息进对应 Gate 改写(只删"怎么说"的 AI 味,不删"说什么")。
11
+ 3. 删除服从既有"过度去AI味保护"与「诊断与分级」比例上限:不整段删、不删剧情功能;若删后跌破字数下限,改为降AI重写,不删完再用新废话凑字。
12
+ 4. 删完通读:若整段只剩最短句、结构虚词被扫光、每个动作都带「了一下」式尾巴,就是删过头的电报体(见 anti-ai-writing.md 模式 9)——把非峰值叙述句恢复成自然白话,不是接着删。删的是废话,不是中文的自然冗余;这条只调删减的度,禁用词与套路句式的清理力度不因此降低。
13
+
14
+ 以下为各 Gate 的详细规则(删不掉的标记项按此润色;无论 agent 还是主线程执行,均须遵循):
15
+
16
+ #### 门禁 A:禁用词替换
17
+
18
+ 加载 [references/banned-words.md](banned-words.md),对照禁用词表逐项检查。
19
+
20
+ **白名单机制**:按 [references/style-resolution.md](style-resolution.md) 读取书目录的 `.deslop-whitelist`。获准字面片段由深扫、标点整理和 hook 一致豁免;无文件不创建空表,不因检测器报警自行放行,也不继承其他书的白名单。
21
+
22
+ **保护规则优先级**:保留创作意图与剧情功能 > 去AI Gate。Gate A-F 只能改变表达方式;Gate G 删的是非故事性的作者解释/旁白(不是情节)。任何 Gate 都不能删除伏笔、钩子、角色特征、人物记忆、情绪承接、因果锚点、关键信息或必要转折;遇到冲突时改为降AI重写或标注 `[需复核]`。
23
+
24
+ 替换规则:
25
+ - 禁用词 → 具体动作/细节描写
26
+ - 不能简单换成另一个形容词
27
+ - 要用"展示"替代"告诉"
28
+
29
+ 示例:
30
+ - ❌ "眼中闪过一丝不易察觉的悲伤" → ✅ "他垂下眼"
31
+ - ❌ "深吸一口气" → ✅ 直接删;若确有功能,改成角色当下动作(如把话咽回去)
32
+ - ❌ "嘴角勾起一抹冷笑" → ✅ "他冷笑了一声"
33
+
34
+ #### 门禁 B:句式去套路
35
+
36
+ 检测并替换以下AI高频句式:
37
+
38
+ | 句式 | 问题 | 替代方案 |
39
+ |------|------|----------|
40
+ | 否定铺垫后接肯定翻转 | **最毒** 中文 AI 句式之一 | 直接写后项,或改成动作/细节呈现 |
41
+ | 跨段「不是A / 也不是B / 只是C」 | 可能是工整铺排,也可能是辩解、悬念排除或情绪递进 | `formulaic-parallelism` advisory;通读语境,仅在重复提纲或拖慢画面时压缩 |
42
+ | 「至于X不X,怎么X」/同动词「不V A,不V B」 | 工整决策栏、否定清单;正常台词也可能出现 | 结合语境复核;若只是复述前文或细纲,压成一次判断或只留一项 |
43
+ | "...,带着..." | 万能状语,AI最爱 | 用独立短句或动作描写 |
44
+ | "声音不大,却带着……" | AI 最爱声音描写 | 直接写声音特征或动作 |
45
+ | 陈词滥调/万能比喻 | 公式化比喻会显 AI 腔 | 优先直接白描;确需比喻时只留少数生活化、角色化比喻 |
46
+ | "他/她知道..." | 直接告诉读者 | 用行为展示认知 |
47
+ | 对话标签密度过高/公式化标签 | 每句都标注会机械 | 普通"说"可保留;高频或公式化时用动作/上下文替代 |
48
+ | "仿佛/犹如/宛若/如同" | 文言腔过重 | 口语化表达或白描 |
49
+ | "不容置疑/显而易见" | 书面化判断词 | 用具体事实说话 |
50
+
51
+ **修饰词清扫**:检查物品/人物前面的形容词、定语、副词、指示代词、量词,多余即删。删除后阅读不影响才删;含义流失则改成简洁名词。
52
+
53
+ 示例:
54
+ - "白色的药片" → "药片"
55
+ - "飞驰的汽车" → "汽车"
56
+ - "手里那截链子" → "链子"
57
+ - "多年的衣服" → "旧衣服"(保留含义)
58
+
59
+ 形容词原则:一次只用一个形容词修饰或不修饰,不连用、不堆砌。
60
+
61
+ #### 门禁 C:情绪落地
62
+
63
+ 直接写情绪本身不是 AI 味。上下文已让情绪成立,就保留准确的直写或删掉重复说明;需要补足信息时,沿用原文的选择、台词、物件和后果,不为情绪词另配动作。
64
+
65
+ 身体细节按功能取舍:伤势、动作失败、人物习惯或情节后果可以保留;只重复标注情绪的微动作删掉,不换部位或同义动作。具体判据见 `anti-ai-writing.md` 规则 2。
66
+
67
+ **重复描写去重**:当相邻段反复表达同一信息、同一动作或同一情绪时,按 Gate C/D 处理,不另开专项流程。
68
+
69
+ 处理方法:
70
+ - 合并同一瞬间的重复描写,保留最能推动情绪或剧情的细节
71
+ - 如果原文把一个动作拆成"动作概述 → 感知细节 → 身体反应",改成同一段连续画面
72
+ - 若合并后节奏过快,恢复原文中有功能的信息,或把既有信息改成更自然的动作/对话表达;不在原动作后追加描写层,也不新增原文没有的情节
73
+
74
+ 示例:
75
+ - ❌ "他拿起笔。手在抖。笔尖又停住。"
76
+ - ✅ "他拿起笔,笔尖刚碰到纸就偏了,手腕压了两次都没压稳。"
77
+
78
+ **重复语义四类**(同一意思不重复表达,只留一个最合适且简洁的):
79
+
80
+ | 类别 | 错误例 | 修法 |
81
+ |------|--------|------|
82
+ | 形容词重复 | "兴高采烈地笑着跑过来" | "笑着跑过来" |
83
+ | 近义词重复 | "非常重要的关键问题" | "关键问题" |
84
+ | 含义重复 | "我好饿,肚子咕咕叫" | "我好饿" |
85
+ | 上下文主语/物品重复 | 上文说"把抗抑郁药扔了一地",下文不必再写"地上的抗抑郁药",只写"药片" | 模糊简洁口语化即可 |
86
+
87
+ **多余场景/人物/物品描写**:服务情节人物之外的修饰描写直接删。
88
+
89
+ 示例:
90
+ - "游惑手里握着一把短刀,刀锋冷冽" → "游惑手里握着一把短刀"
91
+ - "手铐紧紧扣住两人的手腕,中间连着一截不算长的链条" → "手铐扣住两人的手腕,中间连着链条"
92
+ - "暴雪极地的考场里,风雪没有停下的意思" → "暴雪极地的考场里"
93
+
94
+ #### 门禁 D:节奏调整
95
+
96
+ AI写作的节奏问题:句式过于整齐、段落过于匀称。
97
+
98
+ 处理方法:
99
+ - 打断连续排比句(保留1-2个,删掉其余)
100
+ - 只拆臃肿修饰、堆叠比喻、抽象总结的长句;改写后叙述仍以逗号长句为主(见 anti-ai-writing.md 规则 3),不要把正常的逗号长句拆成短句串
101
+ - 偶尔用不完整句(口语感)
102
+ - 段落长短交错(不要每段都3-5行)
103
+ - 不按硬指标排版:番茄高分样本不是 50-60 字一行,也不是逢句号必换行;按动作/信息变化自然断段,读起来不卡即可
104
+ - 标点节奏跟语气走:避免通篇句号化;保留有功能的 `?` / 少量 `!`,把 `……` / `——` 改成动作、短句、换行、逗号或句号,删除随机堆砌或刷屏符号
105
+
106
+ #### 门禁 E:对话去腔调
107
+
108
+ AI写的对话特征:每句话都信息完整、逻辑清晰、表达精准。
109
+
110
+ 处理方法:
111
+ - 加入口语化表达("嗯""哦""行吧")
112
+ - 适当打断对话(角色可以答非所问);对话被打断或拖长时用动作、换行或短句处理,不用 `——`
113
+ - 用动作穿插对话("她喝了口水。'然后呢?'")
114
+ - 删掉解释性对话(角色不会把自己的动机说清楚)
115
+ - Gate B 同样检查台词:连续工整否定、`至于X不X,怎么X`、同动词 `不V A,不V B` 不能因脚本的台词豁免而漏审;有明确人物/任务功能才保留
116
+ - 不为凑比例硬扩台词;番茄对话占比随题材波动,台词只在角色此刻真会说、必须说时增加
117
+ - 口误、停顿、粗话和重复要服务人物身份与情绪,不作为“真人感”装饰批量添加
118
+ - 不把所有对话末尾改成句号:质问保留问号,爆发峰值保留少量感叹;吞回去/没说完用动作停顿、短句或换行,不用 `……`
119
+
120
+ #### 门禁 F:结尾去升华
121
+
122
+ AI写作的结尾特征:总想总结、升华、点题。
123
+
124
+ 处理方法:
125
+ - 删掉总结性语句
126
+ - 用动作/场景收尾,不要用感慨收尾
127
+ - 如果结尾有"他知道...""这一刻..."→ 基本可以删
128
+
129
+ #### 门禁 G:去解释腔/上帝感/安排感
130
+
131
+ 最难察觉、最"像 AI"的一类(对应 anti-ai-writing.md 模式 8)。叙述者跳出角色当下去解释、剧透、总结、定性、升华,读者闻到"作者在场/剧情被安排"。
132
+
133
+ 处理方法:
134
+ - 删解释因果:「之所以…是因为」「原来…」「这意味着」→ 删,因果让读者从动作对话里自己拼。
135
+ - 删上帝视角剧透:「她不知道的是」「殊不知」「多年以后」「仿佛预示着」→ 删。
136
+ - 删替读者定性:「演得真好」「这出戏她看过一遍」「他就是这样薄情」→ 删,证据留给读者判断。
137
+ - 删隐蔽的软评判:评判性副词(「关切得恰到好处」)、剧透点破(「那点笑她看得分明」)、定性比喻(「像在宣判一件早已定好的事」)→ 删,或改成角色此刻带偏见的瞬间感觉。
138
+ - 注意:Gate G 删的是"非故事性的作者旁白",不是删情节。删完若变薄,靠角色动作/对话补,不补叙述者解说。
139
+
140
+ **任务卡点修法边界**:任务卡点不是固定公式,也不是通用补流程按钮。原文已有任务、证据、手续、物件缺口时,可以把解释总结压成角色当下要处理的具体卡点;原文没有缺口时,只删解释或改动作/对话,不新造剧情。所有卡点都先做“删掉试试”:删掉后不丢伏笔、钩子、信息、关系变化或必要转折,就压缩或删除。
141
+
142
+ ---
143
+
144
+ ## 写手 A-G 判据
145
+
146
+ 以下为原 narrative-writer 的写作自检/审查判据,调用方给了 Gate 就只执行该范围;未给时仍 A-G。
147
+
148
+ - **A 禁用词**:命运齿轮/如潮水般/心猛地一沉类逐一替换(对照 `banned-words.md`;书级文风有裁决按其配额)。
149
+ - **B 句式**:连续排比、刻意对称打散;**禁止高置信否定铺垫后再肯定翻转**——同句「不是A,(而)是B」「没有X没有Y只是Z」直接写肯定内容或改动作承担对比;跨段「不是A / 也不是B / 只是C」、`至于X不X,怎么X`、同动词 `不V A,不V B` 只作语义复核(advisory),重复细纲或拖慢画面时改,承担辩解、悬念排除或情绪递进时可保留(书级文风另有裁定按其执行);普通名词不加引号强调(对话、逐字引用、场内载体原文除外)。
150
+ - **C 情绪**:删空泛 AI 情绪总结句;上下文已成立就删补充说明;不设「情绪词→身体动作」默认转换。
151
+ - **D 节奏**:只拆臃肿修饰、堆叠比喻、信息过载的长句;句长按书级文风带执行,长短随情绪 beat 交错——沉淀放慢、冲突骤短,忌通篇同长度。
152
+ - **E 对话去腔调**:所有角色同一语气→按语言风格档案差异化;犹豫/打断/拖长用动作、短句或换行承担。
153
+ - **F 结尾去升华**:大段抒情收尾→安静细节收尾。
154
+ - **G 去解释腔/上帝感**:先按本书叙述姿态判断;授权的有限全知、评论或旁人内心不因形式删除。删无功能的解释、未经授权的剧透、重复总结和空泛定性(之所以/原来/这意味着/她不知道的是/殊不知/多年以后);承担锚点或情绪的压成角色白话;已有场内载体(手机/公告/屏幕)优先保留为角色看到的文本。
@@ -0,0 +1,27 @@
1
+ # 文风与参考冲突裁决
2
+
3
+ 写正文、改写、去 AI 味和审稿都先做这一步;inline 与 agent 用同一份裁决。无需另建画像或要求作者填写配置。
4
+
5
+ ## 按维度取值,不把整份文件互相覆盖
6
+
7
+ 表达选择按以下顺序取第一个明确、适用的要求:**当前请求 > 本书文风/设定 > 本书 active 作者记忆 > 题材、流程、全局 active 记忆 > 主对标文风 > 题材包与通用 references 默认值**。未声明的维度才向下补齐;本书例外不撤销全局习惯,临时要求不写回长期记忆。
8
+
9
+ 句长、视角、标点、对话落法、情绪直写、修辞、叙述者评论和收尾方式都是表达维度。reference 中的“必须”“禁用”“最高优先级”、示例和检测阈值不使默认写法升级为作者不可覆盖的规则。主对标的低置信观察不压过作者的明确选择。
10
+
11
+ 事实与表达分开裁决:文风不能改变细纲事件、已知事实、信息揭露边界、用户字数范围、改写范围、文件结构或追踪协议;有限全知允许换视角,不等于可提前揭底。转限知时可暂不叙述该人物无从得知的信息,事实本身不变;不得补出“早已知道”“后来发现”或新观察经历来保全原文信息。审稿照常评价因果、可读性与情绪效果,不能仅因使用了作者选定的写法就判错,也不能因为作者喜欢就忽略真实缺陷。
12
+
13
+ ## 加载与传递
14
+
15
+ 1. 从本次正文路径确定书目录(长篇为 `正文/` 的父目录,短篇为 `正文.md` 所在目录)。读该书 `设定/文风.md`;短篇同时读 `设定.md` 的文风约定。无文件就继续,不创建占位文件、不猜其他书。文风无最低字数限制,一句可执行的偏好也有效;空白、纯标题、待补充不算。
16
+ 2. `_文风摘要.md` 只能辅助定位,不能独立替代全文。当前会话已读全文时无需反复读;摘要与全文不一致用全文,不让旧摘要压过作者的新修改。
17
+ 3. 作者记忆 query 显式传当前书名、已知题材和流程以及需要的 kind,避免只取到 global。只用 active;同一维度窄范围覆盖宽范围,不拼成同时满足的清单。无法判定的同范围冲突才问作者,已能按优先级解决的不询问。
18
+ 4. 在现有 prompt 填 `style_resolution`:本次生效的表达要求及来源、被覆盖的默认条款、必须保留的事实/信息边界;只列与任务有关的冲突,无冲突可写“按本书文风”。原样传给正文、去味和文字 reviewer,并传文风全文路径。同一批次复用,当前请求或文风变动时更新。单独调用去味/审稿也执行本步骤,不能靠上一次会话的记忆。
19
+
20
+ ## 检测器如何服从裁决
21
+
22
+ 检测器不理解作者意图。保留现有默认检查;明确采用且有功能的命中,复用**书目录**下的 `.deslop-whitelist`:UTF-8,一行一个原文字面片段,空行和以 `#` 开头的整行注释忽略,不支持正则或通配符。不向父目录找,避免跨书继承。
23
+
24
+ - 本书文风明确允许某种停顿标点时,可登记 `——` 或 `……`;具体修辞登记完整的获准原句,不能登记“不是”“没有”等泛词来关闭整类检查。
25
+ - 每项用上一行 `# 来源:…;用途:…` 说明当前请求或文风依据。只为执行作者已明确的选择登记,不因脚本报警自动放行。当前请求禁止某写法时移除相冲突的豁免;一次性保留只登记该句,不推断长期习惯。
26
+ - 深扫、标点整理和写后/下一章检查读取同一白名单。豁免只影响对应字面片段的风格检查;同一行其他问题照报,事实、字数、占位、工程词、截断和文件结构检查不豁免。
27
+ - 所选 Gate 仍执行:检查该写法是否重复、冗余、破坏节奏或越过信息边界;有这些具体问题才改。裁决与发现可简短写在正常交付报告中,不写进小说正文。
@@ -2,6 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  const fs = require('fs');
5
+ const { loadStyleWhitelist, maskStyleText } = require('./style-whitelist.js');
5
6
  const path = require('path');
6
7
 
7
8
  const USAGE = `Usage: node check-ai-patterns.js [--check] [--json] [--fail-on=blocking|all] <file...>
@@ -30,6 +31,7 @@ Detect high-risk AI-flavor prose patterns that need human rewrite:
30
31
  - 章尾状态总结体 (文末窗口 这一夜注定/这一切都结束了/新的人生才刚刚开始/命运的齿轮)
31
32
  - 引号强调滥用 (叙述里 1-4 字短词加引号强调,密度型)
32
33
 
34
+ Book-local .deslop-whitelist literal spans are excluded from style scanning (no regex or ancestor inheritance).
33
35
  Each finding carries severity: blocking by default for generation/deslop cleanup (not-is-comparison / em-dash / voice-contrast / negation-parade / reverse-not-is / trailer-ending / trailer-summary). This is a local style/readability gate, not an AIGC detector score; functional human text can be marked for review instead of hard-edited for a detector.
34
36
  或 advisory (period-stutter / long-paragraph / micro-action-tic / stock-reaction-tic / action-list-tic / abstract-summary-tic / cliche-density-tic / metaphor-density-tic / reasoning-chain-tic / system-notice-formality-tic / overcompressed-prose-tic / low-connective-density-tic / quote-emphasis-tic / formulaic-parallelism,是提示,justified 的长推理/氛围段可保留)。
35
37
  --fail-on=blocking 只在出现 blocking finding 时退出 1;默认 --fail-on=all 有任何 finding 即退出 1。
@@ -308,7 +310,10 @@ for (const file of options.files) {
308
310
  continue;
309
311
  }
310
312
 
311
- const findings = scanDocument(input).map((finding) => ({ file, ...finding }));
313
+ let whitelist;
314
+ try { whitelist = loadStyleWhitelist(fullPath); }
315
+ catch (error) { die(`${file}: unable to read .deslop-whitelist (${error.message})`); }
316
+ const findings = scanDocument(maskStyleText(input, whitelist)).map((finding) => ({ file, ...finding }));
312
317
  allFindings.push(...findings);
313
318
  }
314
319
 
@@ -43,6 +43,17 @@ const PLACEHOLDER_PATTERNS = [
43
43
  { re: /我(无法|不能)(继续(写|创作|生成|下去)|生成(内容|文本|正文)?|创作|续写|完成(这个|本)?(章|篇|创作|请求))/, label: '元信息泄漏(生成拒绝语)', hard: false },
44
44
  ];
45
45
 
46
+ const QUOTED_SPAN_PATTERNS = [
47
+ /「[^」]*」/g,
48
+ /『[^』]*』/g,
49
+ /【[^】]*】/g,
50
+ /“[^”]*”/g,
51
+ // 单引号须成对;词内撇号(don't、O’Connor)不作为开闭引号。
52
+ /(?<![A-Za-z0-9_])‘(?:[^’]|(?<=[A-Za-z0-9_])’(?=[A-Za-z0-9_]))*(?!(?<=[A-Za-z0-9_])’[A-Za-z0-9_])’/g,
53
+ /"[^"]*"/g,
54
+ /(?<![A-Za-z0-9_])'(?:[^']|(?<=[A-Za-z0-9_])'(?=[A-Za-z0-9_]))*(?!(?<=[A-Za-z0-9_])'[A-Za-z0-9_])'/g,
55
+ ];
56
+
46
57
  // 工程词泄漏(正文元信息扫描的确定性版):弱模型把写作工程词漏进正文,破坏代入感
47
58
  // (DeepSeek-v4 这类会在对话里冒「该到下一章了」)。漏词的模型自己发现不了,靠脚本兜。
48
59
  // tier1 = 纯写作流水线术语,正文里几乎永不合法;tier2 = 章节结构/歧义词,角色在故事内
@@ -150,21 +161,23 @@ function isContent(trimmed) {
150
161
  return trimmed && !trimmed.startsWith('#') && !/^-{3,}$/.test(trimmed);
151
162
  }
152
163
 
153
- function isDialogueLike(trimmed) {
154
- return /[“”"'‘’「」『』【】]/.test(trimmed);
164
+ // 等长遮住成对引号内的内容以保留列号;未闭合引号不豁免。
165
+ function maskQuotedSpans(text) {
166
+ let masked = text;
167
+ for (const pattern of QUOTED_SPAN_PATTERNS) {
168
+ masked = masked.replace(pattern, (match) => ' '.repeat(match.length));
169
+ }
170
+ return masked;
155
171
  }
156
172
 
157
173
  // 去掉成对引号内的片段(台词/系统词/引用物件),只留引号外叙述。复读判定用:重复台词是体裁
158
174
  // 手法(豁免),但「叙述 + 引号内物件/短台词」混合行里引号外叙述的复读仍是退化,不能整行豁免。
159
175
  function stripQuoted(text) {
160
- return text
161
- .replace(/「[^」]*」/g, '')
162
- .replace(/『[^』]*』/g, '')
163
- .replace(/【[^】]*】/g, '')
164
- .replace(/“[^”]*”/g, '')
165
- .replace(/‘[^’]*’/g, '')
166
- .replace(/"[^"]*"/g, '')
167
- .replace(/'[^']*'/g, '');
176
+ let stripped = text;
177
+ for (const pattern of QUOTED_SPAN_PATTERNS) {
178
+ stripped = stripped.replace(pattern, '');
179
+ }
180
+ return stripped;
168
181
  }
169
182
 
170
183
  function visibleLength(text) {
@@ -253,18 +266,19 @@ function findPlaceholders(content) {
253
266
  const findings = [];
254
267
  for (const { trimmed, lineNo } of content) {
255
268
  if (!isContent(trimmed)) continue;
256
- const dialogue = isDialogueLike(trimmed);
269
+ const outsideQuotes = maskQuotedSpans(trimmed);
257
270
  for (const { re, label, hard } of PLACEHOLDER_PATTERNS) {
258
- if (!hard && dialogue) continue; // soft 拒绝语在对话行里可能是正常台词,豁免
259
- const m = re.exec(trimmed);
271
+ // hard 信号仍扫描整行;soft 自指/拒绝语只扫描成对引号外,且遮罩等长以保留列号。
272
+ const m = re.exec(hard ? trimmed : outsideQuotes);
260
273
  if (m) {
274
+ const index = m.index || 0;
261
275
  findings.push({
262
276
  line: lineNo,
263
- column: (m.index || 0) + 1,
277
+ column: index + 1,
264
278
  type: 'placeholder-leak',
265
279
  severity: 'blocking',
266
280
  message: `${label}:正文混入元信息/拒绝语/占位符,重写本段干净落地。`,
267
- excerpt: compact(trimmed.slice(Math.max(0, (m.index || 0) - 4), (m.index || 0) + 20)),
281
+ excerpt: compact(trimmed.slice(Math.max(0, index - 4), index + 20)),
268
282
  });
269
283
  break; // one finding per line is enough
270
284
  }
@@ -283,17 +297,22 @@ function findMetaLeak(content) {
283
297
  // 标题行(第N章 章名,无 ## 前缀时也算)属「标题行以外的正文」之外,排除
284
298
  if (/^第[一二三四五六七八九十百千万两0-9]+章/.test(trimmed)) continue;
285
299
  }
286
- const dialogue = isDialogueLike(trimmed);
287
- let m = META_TIER1_RE.exec(trimmed);
300
+ const outsideQuotes = maskQuotedSpans(trimmed);
301
+ let m = META_TIER1_RE.exec(outsideQuotes);
302
+ let quotedTier1 = false;
303
+ if (!m) {
304
+ m = META_TIER1_RE.exec(trimmed);
305
+ quotedTier1 = Boolean(m);
306
+ }
288
307
  if (m) {
289
308
  // tier1 纯工程词正文里几乎永不合法→blocking;但写手/编剧题材里角色在故事内真讨论创作,
290
- // 台词(对话行)里可能合法,降级为 advisory(仍报告,交人/LLM 判,不强制回炉)。
309
+ // 且命中实际位于成对引号内时可能合法,降级为 advisory。同一行别处出现引号不影响判定。
291
310
  findings.push({
292
311
  line: lineNo,
293
312
  column: m.index + 1,
294
313
  type: 'meta-leak',
295
- severity: dialogue ? 'advisory' : 'blocking',
296
- message: `工程词泄漏:「${m[0]}」是写作流水线术语,正文里不该出现;改成角色/场景内表达。${dialogue ? '例外:角色为作者/编剧、在故事内真实讨论创作时,台词里可能合法。' : ''}`,
314
+ severity: quotedTier1 ? 'advisory' : 'blocking',
315
+ message: `工程词泄漏:「${m[0]}」是写作流水线术语,正文里不该出现;改成角色/场景内表达。${quotedTier1 ? '例外:角色为作者/编剧、在故事内真实讨论创作时,台词里可能合法。' : ''}`,
297
316
  excerpt: compact(trimmed.slice(Math.max(0, m.index - 6), m.index + 18)),
298
317
  });
299
318
  continue; // tier1 命中即可,不再叠 tier2
@@ -2,6 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  const fs = require('fs');
5
+ const { loadStyleWhitelist, styleSpans } = require('./style-whitelist.js');
5
6
  const path = require('path');
6
7
 
7
8
  const USAGE = `Usage: node normalize-punctuation.js [--check] [--quote-mode keep|ascii|yan] <file...>
@@ -9,6 +10,7 @@ const USAGE = `Usage: node normalize-punctuation.js [--check] [--quote-mode keep
9
10
  Normalize正文 punctuation deterministically:
10
11
  - replace ellipses, em dashes, and double hyphens with Chinese punctuation
11
12
  - remove markdown divider lines (---) from正文
13
+ - preserve pause punctuation covered by book-local .deslop-whitelist literals
12
14
  - keep quote style by default; convert quotes only when explicitly requested
13
15
  `;
14
16
 
@@ -61,7 +63,10 @@ for (const file of options.files) {
61
63
  continue;
62
64
  }
63
65
 
64
- const result = normalizeDocument(input, options.quoteMode);
66
+ let whitelist;
67
+ try { whitelist = loadStyleWhitelist(fullPath); }
68
+ catch (error) { die(`${file}: unable to read .deslop-whitelist (${error.message})`); }
69
+ const result = normalizeDocument(input, options.quoteMode, whitelist);
65
70
  totalFindings += result.findings.length;
66
71
 
67
72
  if (options.check) {
@@ -94,7 +99,7 @@ function die(message) {
94
99
  process.exit(2);
95
100
  }
96
101
 
97
- function normalizeDocument(input, quoteMode) {
102
+ function normalizeDocument(input, quoteMode, whitelist) {
98
103
  const { lines, endings } = splitLinesKeepingEndings(input);
99
104
 
100
105
  const findings = [];
@@ -159,7 +164,7 @@ function normalizeDocument(input, quoteMode) {
159
164
  }
160
165
 
161
166
  const commentOpenBefore = commentOpen;
162
- const punctuationResult = normalizePausePunctuation(line, lineNo, commentOpen);
167
+ const punctuationResult = normalizePausePunctuation(line, lineNo, commentOpen, whitelist);
163
168
  findings.push(...punctuationResult.findings);
164
169
  line = punctuationResult.line;
165
170
  commentOpen = punctuationResult.commentOpen;
@@ -237,7 +242,7 @@ function isClosingFence(line, fence) {
237
242
  // 一遍归一化留不干净,再跑一遍还会改已定稿的正文;所以反复归一化到不动点。
238
243
  // 每遍至少把一个 `…/./—/-` 换成非停顿字符,字符数严格递减,必然收敛。
239
244
  // findings 只留第一遍:同一处不重复计数,column 也仍然是原行的偏移。
240
- function normalizePausePunctuation(line, lineNo, commentOpen) {
245
+ function normalizePausePunctuation(line, lineNo, commentOpen, whitelist) {
241
246
  let current = line;
242
247
  let findings = null;
243
248
  let commentOpenAfter = commentOpen;
@@ -245,7 +250,7 @@ function normalizePausePunctuation(line, lineNo, commentOpen) {
245
250
  for (;;) {
246
251
  const comments = htmlCommentSpans(current, commentOpen);
247
252
  commentOpenAfter = comments.open;
248
- const pass = normalizePausePunctuationPass(current, lineNo, comments.spans);
253
+ const pass = normalizePausePunctuationPass(current, lineNo, comments.spans.concat(styleSpans(current, whitelist)));
249
254
  if (findings === null) findings = pass.findings;
250
255
  if (pass.line === current) break;
251
256
  current = pass.line;
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ // Book-local only: never inherit an unrelated workspace or another book's choices.
7
+ function loadStyleWhitelist(file) {
8
+ const parent = path.dirname(path.resolve(file));
9
+ const book = path.basename(parent) === '正文' ? path.dirname(parent) : parent;
10
+ try {
11
+ return fs.readFileSync(path.join(book, '.deslop-whitelist'), 'utf8')
12
+ .split(/\r?\n/).map(line => line.trim())
13
+ .filter(line => line && !line.startsWith('#'))
14
+ .sort((a, b) => b.length - a.length);
15
+ } catch (error) {
16
+ if (error.code === 'ENOENT') return [];
17
+ throw error;
18
+ }
19
+ }
20
+
21
+ function styleSpans(text, whitelist) {
22
+ const spans = [];
23
+ for (const literal of whitelist) {
24
+ for (let at = text.indexOf(literal); at !== -1; at = text.indexOf(literal, at + 1)) {
25
+ spans.push([at, at + literal.length]);
26
+ }
27
+ }
28
+ return spans;
29
+ }
30
+
31
+ function maskStyleText(text, whitelist) {
32
+ const chars = text.split('');
33
+ for (const [start, end] of styleSpans(text, whitelist)) {
34
+ chars.fill('?', start, end);
35
+ }
36
+ return chars.join('');
37
+ }
38
+
39
+ module.exports = { loadStyleWhitelist, styleSpans, maskStyleText };
@@ -14,7 +14,7 @@ metadata: {"openclaw":{"source":"https://github.com/zenstory-ai/oh-story-claudec
14
14
 
15
15
  > Agent 兼容性:只检查当前运行时的 canonical 目录:Claude `.claude/agents/{agent}.md`、OpenCode `.opencode/agents/{agent}.md`、Codex `.codex/agents/{agent}.toml`、Antigravity `.agents/agents/agent-name/agent.md`(`agent-name` 为目标 agent 名),不得因其他端文件存在而误判。Codex 使用同名 `agent_type`;Antigravity 使用 `invoke_subagent` + `TypeName`。对应运行时未暴露 custom-agent registry / `invoke_subagent` 或返回未知 agent 时,必须降级 solo/direct。检测到 `.zcode/` 时同样直接 solo/direct,因为 ZCode 3.3.4 不执行项目 custom agents;报告 `Fallback: project custom agents unavailable -> solo`。Claude/OpenCode 兼容面保留 `subagent_type`。
16
16
  >
17
- > Spawn 版本提示(不阻断 spawn):先读取项目根 `.story-deployed` 的 `agents_version`。与本版 `agents_version: 29` 不一致时(标记缺失、字段缺失/非整数、小于或大于 29)**照常按文件存在性检查并 spawn**,同时报告 `Notice: agents bundle 版本不匹配(项目 {N},本版 29)` 并提示重新运行 `/story-setup` 后新开会话;大于 29 时额外提示先更新 oh-story-claudecode,不要用本地旧版 setup 降级覆盖。只有 agent 文件缺失、或运行时不暴露 custom agent 时才降级 solo/direct,报告 `Fallback: ... -> solo`。
17
+ > Spawn 版本提示(不阻断 spawn):先读取项目根 `.story-deployed` 的 `agents_version`。与本版 `agents_version: 30` 不一致时(标记缺失、字段缺失/非整数、小于或大于 30)**照常按文件存在性检查并 spawn**,同时报告 `Notice: agents bundle 版本不匹配(项目 {N},本版 30)` 并提示重新运行 `/story-setup` 后新开会话;大于 30 时额外提示先更新 oh-story-claudecode,不要用本地旧版 setup 降级覆盖。只有 agent 文件缺失、或运行时不暴露 custom agent 时才降级 solo/direct,报告 `Fallback: ... -> solo`。
18
18
 
19
19
  ## 核心原则
20
20
 
@@ -54,7 +54,7 @@ metadata: {"openclaw":{"source":"https://github.com/zenstory-ai/oh-story-claudec
54
54
 
55
55
  1. 数清最后一个完整章号 `N`(`正文/第NNN章_*.md` 的最大值)。
56
56
  2. 从旧 `追踪/` 现有文件(角色状态、伏笔、时间线等,文件名按项目实际情况)和最近 3-5 章正文,重建当前状态:核心角色快照、未回收伏笔、已揭示时间线事件、长期约束、下一章承诺。角色快照的反推方法见 [references/character-state-reverse.md](references/character-state-reverse.md)。
57
- 3. 按 [references/tracking-transaction.md](references/tracking-transaction.md) 的初始化事务格式构造 JSON,`last_chapter` 写 `N`(第 1..N 章不伪造逐章记录),执行 `tracking_commit.py init`。
57
+ 3. 完整读取 [references/tracking-initialization.md](references/tracking-initialization.md),按其初始化事务格式构造 JSON,`last_chapter` 写 `N`(第 1..N 章不伪造逐章记录),执行 `tracking_commit.py init`。
58
58
  4. `init` 会把旧追踪结构按原样整体移入 `追踪/_旧追踪存档/` 再建当前协议——旧内容不删除、不参与解析,留给作者查阅。
59
59
  5. 跑 `tracking_commit.py check` 确认通过,再回 `/story-long-write 日更` 续写。
60
60
 
@@ -108,7 +108,7 @@
108
108
 
109
109
  执行规则:
110
110
  - 写对话时先看角色关系和权力位置:强势角色常短句收束,试探角色多问号和半句,崩溃角色才允许少量感叹/省略。
111
- - 写叙述时用句长、逗号停顿和单句成段制造节奏;不要把破折号当节奏工具,对话里也不要用。
111
+ - 写叙述时用句长、逗号停顿和单句成段制造节奏;默认不用破折号硬造节奏;本书文风明确授权的功能性用法保留。
112
112
  - 精修时检查两类问题:**通篇句号化**(语气全被压平)与**随机标点堆砌**(问号/感叹号不承载情绪功能,或用省略号/破折号硬造停顿)。
113
113
  - 引号风格按项目/平台约定;知乎盐言的 `「」` 是合法对话格式,`quote-mode keep` 时不得擅自改掉。
114
114
 
@@ -163,6 +163,6 @@
163
163
  3. **避免对话标签机械化**:高频或公式化的「他说」「她道」「他笑了笑说」用动作/上下文替代;普通“说”可保留
164
164
  4. **禁止缩进**:不使用 `  `(全角空格)或半角空格缩进
165
165
  5. **禁止正文段落 Markdown 渲染**:除统一的小节/章节标记(如 `###1.`)外,正文段落中不使用加粗 `**`、斜体 `*`、标题 `#`、分隔线 `---` 等 Markdown 语法
166
- 6. **正文不使用破折号**:正文(含叙述、对话、心理描写)不使用破折号 `——`/`—` 或双连字符 `--`,改用句号、逗号、换行、动作 beat 或短句断开;不再设置“对话例外”
166
+ 6. **默认停顿写法**:正文默认用句号、逗号、换行、动作 beat 或短句承担停顿;本书明确选择的功能性破折号/省略号按调用方文风裁决与书级白名单保留。标点偏好不属于不可覆盖的文件结构协议。
167
167
  7. **禁止通篇句号化或随机标点堆砌**:标点必须跟语气/人物声线/情绪功能匹配;该质问时用问号,该爆发时少量感叹;犹豫、吞咽、未说完用动作或句长变化表达,不用 `……` / `——` 硬造停顿,也不得无功能地乱撒 `?`/`!`
168
168
  8. **禁止正文混入章节元信息**:章节号只允许出现在标题/小节标记/文件名/追踪记录中。正文叙述、对话、心理描写里不得出现 `第[一二三四五六七八九十百千万两0-9]+章|上一章|上章|前一章|本章|这一章|前文|后文|伏笔|细纲|读者` 这类写作工程词;要改成角色能感知的事件锚点或相对时间,例如把“比第一章那三秒开火更疼”改成“比那三秒开火更疼”。例外:角色在故事世界内真实阅读/讨论“第X章”文本,或真实身为作者/读者并谈论读者身份时,可保留相应词。
@@ -0,0 +1,31 @@
1
+ # 追踪初始化事务
2
+
3
+ ## 初始化事务
4
+
5
+ 新书从第 0 章初始化。`story-import` 导入已有小说时把最后完整章写入 `last_chapter=N`;第 1..N 章不伪造日更记录,常规续写从 N+1 章开始。
6
+
7
+ ```json
8
+ {
9
+ "schema_version": 1,
10
+ "book_title": "让你管账号,你高燃混剪炸全网",
11
+ "last_chapter": 0,
12
+ "context": {
13
+ "position": {
14
+ "volume": "第一卷·军宣整顿",
15
+ "volume_start_chapter": 1,
16
+ "story_time": "江晨到火箭军文工团报到前",
17
+ "scene": "火箭军文工团"
18
+ },
19
+ "long_term_constraints": ["军宣爽点要用作品效果和围观反应链兑现,不能只靠系统播报"],
20
+ "active_character_names": [],
21
+ "continuity_risks": [],
22
+ "recent_chapters": [],
23
+ "next_chapter_commitments": ["让江晨报到,并落下五天百万粉的新手任务"]
24
+ },
25
+ "character_snapshots": {},
26
+ "foreshadow": [],
27
+ "timeline_events": []
28
+ }
29
+ ```
30
+
31
+ 导入初始化时直接传入当前核心角色快照、伏笔当前行、时间线事件和固定 7 栏状态输入。阶段/卷级回看按需查询正文,不作为每章强一致追踪产物。
@@ -20,14 +20,13 @@ Markdown 只负责给作者和 Agent 阅读,工具不再反向解析 Markdown
20
20
  ```text
21
21
  {PYTHON} {当前 skill 根}/scripts/tracking_commit.py init --project {书项目根} --input {初始化事务.json}
22
22
  {PYTHON} {当前 skill 根}/scripts/tracking_commit.py check --project {书项目根}
23
- {PYTHON} {story-long-write skill 根}/scripts/storyctl.py wordcount checkpoint --file {前半段临时文件} --target {目标} --chapter {N}
24
23
  {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter check --project {书项目根} --chapter {N}
25
24
  {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter commit --project {书项目根} --chapter {N} --input {逐章事务.json}
26
25
  {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter accept-current-length --project {书项目根} --chapter {N} --input {逐章事务.json}
27
26
  ```
28
27
 
29
28
  - `init`:只在 `_tracking-state.json` 不存在时执行,绝不覆盖已初始化项目。
30
- - `wordcount checkpoint`:纯测量;返回当前实际字数、用户带与剩余用户区间,不写正文、不写 tracking、不做语义判断。每章最多调用一次。
29
+ - `wordcount measure` / `wordcount checkpoint`:纯测量入口;不写正文、不写 tracking、不做语义判断。长篇正文流程一次写完整章,**不在章中调用测量**,长度由 `chapter check` 一次收口;这两个入口供导入、审查等其他场景使用。
31
30
  - `chapter check`:重新读取当前正文与细纲目标,返回确定性长度状态、现有 blocking quality、`state_revision` 和当前可执行动作,不保存 approval。`under` 不提供自动补写;`over` 额外返回一次净删型 `compress-once` 及进入内带/用户带所需的机器删除区间。
32
31
  - `chapter commit`:再次读取当前文件、重新计数并重跑 blocking quality;只接受用户带内章节,把简短字数记录与逐章事务一起原子提交。
33
32
  - `chapter accept-current-length`:只接受带外但 quality pass 的章节;接受动作发生时重新读取、重新计数并立即原子提交,不保存可陈旧的历史决议。
@@ -43,33 +42,7 @@ Markdown 只负责给作者和 Agent 阅读,工具不再反向解析 Markdown
43
42
 
44
43
  ## 初始化事务
45
44
 
46
- 新书从第 0 章初始化。`story-import` 导入已有小说时把最后完整章写入 `last_chapter=N`;第 1..N 章不伪造日更记录,常规续写从 N+1 章开始。
47
-
48
- ```json
49
- {
50
- "schema_version": 1,
51
- "book_title": "让你管账号,你高燃混剪炸全网",
52
- "last_chapter": 0,
53
- "context": {
54
- "position": {
55
- "volume": "第一卷·军宣整顿",
56
- "volume_start_chapter": 1,
57
- "story_time": "江晨到火箭军文工团报到前",
58
- "scene": "火箭军文工团"
59
- },
60
- "long_term_constraints": ["军宣爽点要用作品效果和围观反应链兑现,不能只靠系统播报"],
61
- "active_character_names": [],
62
- "continuity_risks": [],
63
- "recent_chapters": [],
64
- "next_chapter_commitments": ["让江晨报到,并落下五天百万粉的新手任务"]
65
- },
66
- "character_snapshots": {},
67
- "foreshadow": [],
68
- "timeline_events": []
69
- }
70
- ```
71
-
72
- 导入初始化时直接传入当前核心角色快照、伏笔当前行、时间线事件和固定 7 栏状态输入。阶段/卷级回看按需查询正文,不作为每章强一致追踪产物。
45
+ 仅新书或导入初始化时,执行 `init` 前必须完整读取 [tracking-initialization.md](tracking-initialization.md),按其中原始 JSON 与导入边界构造事务。已有项目续写直接使用下方逐章事务,不重复读初始化示例。
73
46
 
74
47
  调用方的逐章 JSON 不写 `wordcount`;正式入口 `chapter commit` 或 `chapter accept-current-length` 在提交当下生成并注入。最终 state 只为已提交章节保留 `metric / target / actual / status / resolution / body_sha256`,不保存 MEASURE/RESOLVE 事件、ID 链、policy fingerprint 或独立 chapter state。
75
48