@cloud411716/fancy-webnovel 1.0.46 → 2.2.0

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 (134) hide show
  1. package/client.js +183 -0
  2. package/cordis.patch.yml +0 -14
  3. package/index.js +21 -37
  4. package/lib/chinese-num.js +111 -0
  5. package/lib/deployed-state.js +141 -0
  6. package/lib/error-codes.js +104 -0
  7. package/lib/infra.js +569 -0
  8. package/lib/llm-wiki.js +109 -0
  9. package/lib/safe-rm.js +94 -0
  10. package/lib/scraper-utils.js +165 -0
  11. package/package.json +37 -5
  12. package/plugins/fancy-analyze/command-input.js +65 -0
  13. package/plugins/fancy-analyze/index.js +973 -0
  14. package/plugins/fancy-analyze/schema-analyze.md +379 -0
  15. package/plugins/fancy-analyze/schema-write.md +178 -0
  16. package/plugins/fancy-analyze/scripts/split_source.js +292 -0
  17. package/plugins/fancy-analyze/summary-progress.js +431 -0
  18. package/plugins/fancy-analyze/templates.js +881 -0
  19. package/plugins/fancy-bootstrap/index.js +168 -0
  20. package/plugins/fancy-bootstrap/scripts/init.js +143 -0
  21. package/plugins/fancy-bootstrap/scripts/path-utils.js +21 -0
  22. package/plugins/fancy-bootstrap/templates.js +54 -0
  23. package/plugins/fancy-import/import-core.js +1118 -0
  24. package/plugins/fancy-import/import-driver.js +581 -0
  25. package/plugins/fancy-import/index.js +730 -0
  26. package/plugins/fancy-import/prompts/01-import-prompt.md +106 -0
  27. package/plugins/fancy-import/templates.js +49 -0
  28. package/plugins/fancy-scan/index.js +319 -0
  29. package/plugins/fancy-scan/scripts/run-scan.js +520 -0
  30. package/plugins/fancy-scan/scripts/scrapers/fanqie-rank-scraper.js +794 -0
  31. package/plugins/fancy-scan/scripts/scrapers/jjwxc-rank-scraper.js +339 -0
  32. package/plugins/fancy-scan/scripts/scrapers/qimao-rank-scraper.js +611 -0
  33. package/plugins/fancy-scan/templates.js +295 -0
  34. package/plugins/fancy-story-builder/deploy-manifest.js +239 -0
  35. package/plugins/fancy-story-builder/deslop-driver.js +821 -0
  36. package/plugins/fancy-story-builder/flesh-output.js +155 -0
  37. package/plugins/fancy-story-builder/index.js +3152 -0
  38. package/plugins/fancy-story-builder/prompts/01-skeleton-prompt.md +553 -0
  39. package/plugins/fancy-story-builder/prompts/02-flesh-prompt.md +540 -0
  40. package/plugins/fancy-story-builder/prompts/03-rhythm-prompt.md +504 -0
  41. package/plugins/fancy-story-builder/prompts/04-writing-prompt.md +188 -0
  42. package/plugins/fancy-story-builder/prompts/05-deslop-prompt.md +96 -0
  43. package/plugins/fancy-story-builder/purpose-template.md +107 -0
  44. package/plugins/fancy-story-builder/references/formulas-rhythm.json +302 -0
  45. package/plugins/fancy-story-builder/references/formulas-skeleton.json +229 -0
  46. package/plugins/fancy-story-builder/references/glossary.md +585 -0
  47. package/plugins/fancy-story-builder/references/index.md +490 -0
  48. package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/00-index.md +174 -0
  49. package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/01-scene.md +150 -0
  50. package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/02-chapter-workflow.md +99 -0
  51. package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/03-opening-chapter.md +104 -0
  52. package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/04-dialogue-mastery.md +274 -0
  53. package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/05-genre-formulas.md +432 -0
  54. package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/06-tone-ensemble.md +259 -0
  55. package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/07-ledger-audit.md +222 -0
  56. package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/08-diagnosis-revision.md +205 -0
  57. package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/09-reading-power.md +135 -0
  58. package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/10-deslop.md +129 -0
  59. package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/00-index.md +98 -0
  60. package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/01-upgrade-rhythm.md +300 -0
  61. package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/02-arc-rhythm.md +168 -0
  62. package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/03-highpoint-hooks.md +189 -0
  63. package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/04-satisfaction.md +226 -0
  64. package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/05-foreshadow-density.md +195 -0
  65. package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/06-chapter-outline.md +226 -0
  66. package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/07-audit.md +163 -0
  67. package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/00-index.md +100 -0
  68. package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/01-character.md +239 -0
  69. package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/02-worldbuilding.md +245 -0
  70. package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/03-relations.md +181 -0
  71. package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/04-emotion-methods.md +286 -0
  72. package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/05-audit.md +177 -0
  73. package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/00-index.md +91 -0
  74. package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/01-positioning.md +208 -0
  75. package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/02-packaging.md +135 -0
  76. package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/03-entities.md +305 -0
  77. package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/04-conflict.md +328 -0
  78. package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/05-quota.md +187 -0
  79. package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/06-audit.md +142 -0
  80. package/plugins/fancy-story-builder/rhythm-output.js +140 -0
  81. package/plugins/fancy-story-builder/schema-setting.md +324 -0
  82. package/plugins/fancy-story-builder/scripts/ai-patterns.js +619 -0
  83. package/plugins/fancy-story-builder/scripts/check-guide-compliance.js +289 -0
  84. package/plugins/fancy-story-builder/scripts/content-quality.js +413 -0
  85. package/plugins/fancy-story-builder/scripts/deslop-validate.js +143 -0
  86. package/plugins/fancy-story-builder/scripts/error-classes.js +112 -0
  87. package/plugins/fancy-story-builder/scripts/flesh-validate.js +1189 -0
  88. package/plugins/fancy-story-builder/scripts/formula-engine.js +112 -0
  89. package/plugins/fancy-story-builder/scripts/graph-utils.js +1385 -0
  90. package/plugins/fancy-story-builder/scripts/label-coverage.js +171 -0
  91. package/plugins/fancy-story-builder/scripts/prompt-drift-check.js +441 -0
  92. package/plugins/fancy-story-builder/scripts/reading-power.js +298 -0
  93. package/plugins/fancy-story-builder/scripts/rhythm-validate.js +1216 -0
  94. package/plugins/fancy-story-builder/scripts/semantic-lint.js +377 -0
  95. package/plugins/fancy-story-builder/scripts/skeleton-quota.js +145 -0
  96. package/plugins/fancy-story-builder/scripts/skeleton-validate.js +1832 -0
  97. package/plugins/fancy-story-builder/scripts/stage-batches.js +1371 -0
  98. package/plugins/fancy-story-builder/scripts/stage-contract.js +417 -0
  99. package/plugins/fancy-story-builder/scripts/upstream-query.js +198 -0
  100. package/plugins/fancy-story-builder/scripts/writing-rules.js +167 -0
  101. package/plugins/fancy-story-builder/scripts/writing-validate.js +682 -0
  102. package/plugins/fancy-story-builder/skeleton-output.js +199 -0
  103. package/plugins/fancy-story-builder/stage-driver.js +1049 -0
  104. package/plugins/fancy-story-builder/templates//350/212/202/345/245/217//346/227/266/345/272/217/346/230/240/345/260/204/346/250/241/346/235/277.json +204 -0
  105. package/plugins/fancy-story-builder/templates//350/212/202/345/245/217//347/253/240/350/212/202/347/273/206/347/272/262/346/250/241/346/235/277.json +34 -0
  106. package/plugins/fancy-story-builder/templates//350/212/202/345/245/217//347/253/240/350/212/202/350/247/204/345/210/222/346/250/241/346/235/277.json +24 -0
  107. package/plugins/fancy-story-builder/templates//350/212/202/345/245/217//350/212/202/345/245/217/345/217/202/346/225/260/346/250/241/346/235/277.json +27 -0
  108. package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//344/270/226/347/225/214/350/247/202/350/247/204/345/210/231/346/250/241/346/235/277.json +66 -0
  109. package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//345/205/263/351/224/256/351/201/223/345/205/267/346/250/241/346/235/277.json +76 -0
  110. package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//345/206/262/347/252/201/346/250/241/346/235/277.json +72 -0
  111. package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//345/211/247/346/203/205/346/250/241/346/235/277.json +37 -0
  112. package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//345/212/277/345/212/233/346/250/241/346/235/277.json +53 -0
  113. package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//345/234/260/347/202/271/346/250/241/346/235/277.json +40 -0
  114. package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//347/273/223/345/261/200/346/250/241/346/235/277.json +79 -0
  115. package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//350/247/222/350/211/262/346/250/241/346/235/277.json +132 -0
  116. package/plugins/fancy-story-builder/templates//351/252/250/346/236/266//345/205/263/347/263/273/346/250/241/346/235/277.json +133 -0
  117. package/plugins/fancy-story-builder/templates//351/252/250/346/236/266//345/256/236/344/275/223/346/250/241/346/235/277.json +160 -0
  118. package/plugins/fancy-story-builder/templates//351/252/250/346/236/266//345/261/202/347/272/247/346/250/241/346/235/277.json +65 -0
  119. package/plugins/fancy-story-builder/templates//351/252/250/346/236/266//346/241/206/346/236/266/346/250/241/346/235/277.json +134 -0
  120. package/plugins/fancy-story-builder/templates.js +1248 -0
  121. package/plugins/fancy-story-builder/wiki-references.js +204 -0
  122. package/plugins/fancy-story-builder/writing-driver.js +1061 -0
  123. package/plugins/fancy-topic/index.js +704 -0
  124. package/plugins/fancy-topic/scripts/select-topic.js +274 -0
  125. package/plugins/fancy-topic/templates.js +373 -0
  126. package/commands/bootstrap/index.js +0 -164
  127. package/commands/bootstrap/init-project.js +0 -121
  128. package/commands/scan/index.js +0 -283
  129. package/commands/scan/platforms/fanqie.js +0 -146
  130. package/commands/scan/platforms/jinjiang.js +0 -143
  131. package/commands/scan/platforms/qidian.js +0 -102
  132. package/commands/scan/platforms/qimao.js +0 -127
  133. package/commands/scan/scraper.js +0 -195
  134. package/infra.js +0 -160
@@ -0,0 +1,302 @@
1
+ {
2
+ "meta": {
3
+ "name": "formulas-rhythm",
4
+ "description": "节奏阶段的量化约束与参考值。分两部分:constraints(脚本强制的联合可行性约束)+ *-guides(指导文件引用的参考值,脚本不强制校验)。",
5
+ "note": "P0-1 修复:原文件只有 constraints(7 条),本版补全所有被指导文件引用的约束名,分为 10 个节。"
6
+ },
7
+ "variables": {
8
+ "T": "capacity.target_chapters(来自 骨架/框架.json)",
9
+ "V": "quota.volume_count(来自 骨架/框架.json)",
10
+ "BC": "quota.branch_count(来自 骨架/框架.json)",
11
+ "avg": "capacity.avg_words_per_chapter(来自 骨架/框架.json)"
12
+ },
13
+
14
+ "constraints": {
15
+ "branch_chapter_feasible": {
16
+ "name": "branch_chapter_feasible",
17
+ "expr": "节奏参数.branch_chapter_total >= 骨架.quota.branch_count * 3 && 节奏参数.branch_chapter_total <= 骨架.quota.branch_count * 30",
18
+ "source": "骨架.quota.branch_count + 节奏参数.branch_chapter_total",
19
+ "applies_to_field": "branch_chapter_total",
20
+ "message": "支线总章数必须能被 branch_count 条支线以 [3, 30] 章/条 铺满"
21
+ },
22
+ "branch_chapter_ratio": {
23
+ "name": "branch_chapter_ratio",
24
+ "expr": "节奏参数.branch_chapter_total >= Math.floor(骨架.capacity.target_chapters * 0.3) && 节奏参数.branch_chapter_total <= Math.ceil(骨架.capacity.target_chapters * 0.5)",
25
+ "source": "骨架.capacity.target_chapters + 节奏参数.branch_chapter_total",
26
+ "applies_to_field": "branch_chapter_total",
27
+ "message": "支线总章数占 T 的 30%~50%"
28
+ },
29
+ "overlap_le_branch": {
30
+ "name": "overlap_le_branch",
31
+ "expr": "节奏参数.overlap_chapter_count <= 节奏参数.branch_chapter_total",
32
+ "source": "节奏参数.overlap_chapter_count + 节奏参数.branch_chapter_total",
33
+ "applies_to_field": "overlap_chapter_count",
34
+ "message": "重叠章数不能超过支线总章数"
35
+ },
36
+ "overlap_le_main": {
37
+ "name": "overlap_le_main",
38
+ "expr": "节奏参数.overlap_chapter_count <= 节奏参数.main_progress_chapter_count",
39
+ "source": "节奏参数.overlap_chapter_count + 节奏参数.main_progress_chapter_count",
40
+ "applies_to_field": "overlap_chapter_count",
41
+ "message": "重叠章数不能超过主线章数"
42
+ },
43
+ "main_progress_ge_1": {
44
+ "name": "main_progress_ge_1",
45
+ "expr": "节奏参数.main_progress_chapter_count >= 1",
46
+ "source": "节奏参数.main_progress_chapter_count",
47
+ "applies_to_field": "main_progress_chapter_count",
48
+ "message": "至少 1 个主线推进章"
49
+ },
50
+ "main_progress_consistency": {
51
+ "name": "main_progress_consistency",
52
+ "expr": "节奏参数.main_progress_chapter_count === 骨架.capacity.target_chapters - 节奏参数.branch_chapter_total + 节奏参数.overlap_chapter_count",
53
+ "source": "骨架.capacity.target_chapters + 节奏参数.branch_chapter_total + 节奏参数.overlap_chapter_count + 节奏参数.main_progress_chapter_count",
54
+ "applies_to_field": "main_progress_chapter_count",
55
+ "message": "主线章数 = T - 支线总章 + 重叠章"
56
+ },
57
+ "main_progress_le_T": {
58
+ "name": "main_progress_le_T",
59
+ "expr": "节奏参数.main_progress_chapter_count <= 骨架.capacity.target_chapters",
60
+ "source": "骨架.capacity.target_chapters + 节奏参数.main_progress_chapter_count",
61
+ "applies_to_field": "main_progress_chapter_count",
62
+ "message": "主线章数不能超过 T(每章最多 1 个主线 key_node)"
63
+ }
64
+ },
65
+
66
+ "arc_phase_ratio": {
67
+ "_note": "六种弧线的段比例。指导文件引用此节来把'结构段'换算成'章节号'(见 02-arc-rhythm.md §4.2)。脚本不强制校验——这是写作时的参考比例,允许 ±2% 的偏差。",
68
+ "V": {
69
+ "segments": ["起始", "下沉", "谷底", "转折", "治愈上升", "高点收束"],
70
+ "ratios": [0.10, 0.30, 0.15, 0.10, 0.25, 0.10],
71
+ "key_point": "谷底段的段中点"
72
+ },
73
+ "inverted_V": {
74
+ "segments": ["起步", "上升", "顶点", "反转", "坠落", "低谷收束"],
75
+ "ratios": [0.10, 0.35, 0.10, 0.05, 0.30, 0.10],
76
+ "key_point": "顶点段的段中点"
77
+ },
78
+ "W": {
79
+ "segments": ["起步+第1峰", "第1谷", "第2峰", "第2谷", "第3峰", "收束"],
80
+ "ratios": [0.25, 0.10, 0.25, 0.10, 0.20, 0.10],
81
+ "key_point": "第3峰(最终峰)的段中点"
82
+ },
83
+ "progressive": {
84
+ "segments": ["压迫", "第1阶反击", "第2阶反击", "第3阶反击", "收束"],
85
+ "ratios": [0.20, 0.20, 0.25, 0.25, 0.10],
86
+ "key_point": "最高点(最后一个反击阶)"
87
+ },
88
+ "delayed_satisfaction": {
89
+ "segments": ["初始压制", "深层铺垫", "压力最大", "爆发触发", "集中爆发", "收束"],
90
+ "ratios": [0.20, 0.25, 0.15, 0.05, 0.25, 0.10],
91
+ "key_point": "爆发触发段的段起点"
92
+ },
93
+ "twist": {
94
+ "segments": ["建立假象", "推高假象", "假象高点", "急转", "真相展开", "新情绪收束"],
95
+ "ratios": [0.35, 0.30, 0.10, 0.05, 0.15, 0.05],
96
+ "key_point": "急转段的段中点"
97
+ }
98
+ },
99
+
100
+ "upgrade_guides": {
101
+ "_note": "五类升级粒度的频率参考。指导文件引用此节来安排'升级节奏'(见 01-upgrade-rhythm.md §3.2)。脚本不强制校验。",
102
+ "granularity": {
103
+ "大境界": {
104
+ "per_volume_low": 1,
105
+ "per_volume_high": 2,
106
+ "全书_low": "V×1",
107
+ "全书_high": "V×2",
108
+ "satisfaction": "最大,身份/地位质变"
109
+ },
110
+ "小等级": {
111
+ "per_unit_low": 1,
112
+ "per_unit_high": 2,
113
+ "全书_low": "单元总数×1",
114
+ "全书_high": "单元总数×2",
115
+ "satisfaction": "中,能力可见提升"
116
+ },
117
+ "装备技能": {
118
+ "per_bridge_low": 0,
119
+ "per_bridge_high": 1,
120
+ "satisfaction": "中,战斗手段增加"
121
+ },
122
+ "人脉势力": {
123
+ "per_unit_low": 0,
124
+ "per_unit_high": 1,
125
+ "satisfaction": "大,资源结构变化"
126
+ },
127
+ "认知信息": {
128
+ "per_unit_low": 1,
129
+ "per_unit_high": 2,
130
+ "satisfaction": "中,智斗兑现"
131
+ }
132
+ }
133
+ },
134
+
135
+ "bridge_guides": {
136
+ "_note": "桥段/单元/高潮的时长参考。指导文件引用此节来安排'节拍顺序'(见 01-upgrade-rhythm.md §5.2-5.3)。脚本不强制校验。",
137
+ "bridge_duration": {
138
+ "description": "一个桥段(情绪模块完整循环)的章数区间",
139
+ "low": 2,
140
+ "high": 4,
141
+ "note": "基准 2000 字/章时约 2-4 章;平台章字数偏离时按比例换算"
142
+ },
143
+ "unit_duration": {
144
+ "description": "一个单元(4-5 桥段)的章数区间",
145
+ "low": 16,
146
+ "high": 20,
147
+ "note": "基准 2000 字/章时约 16-20 章"
148
+ },
149
+ "climax_duration": {
150
+ "description": "高潮的时长参考",
151
+ "大高潮": {
152
+ "bridge_count_low": 3,
153
+ "bridge_count_high": 4,
154
+ "chapter_low": 12,
155
+ "chapter_high": 16,
156
+ "note": "大高潮跨 3-4 桥段(约 12-16 章)"
157
+ },
158
+ "小高潮": {
159
+ "bridge_count_low": 1,
160
+ "bridge_count_high": 2,
161
+ "chapter_low": 4,
162
+ "chapter_high": 8,
163
+ "note": "小高潮跨 1-2 桥段(约 4-8 章)"
164
+ },
165
+ "中高潮": {
166
+ "chapter_low": 3,
167
+ "chapter_high": 5,
168
+ "note": "中高潮约 3-5 章(兑现节拍)"
169
+ }
170
+ }
171
+ },
172
+
173
+ "hook_guides": {
174
+ "_note": "钩子强度的约束与重复判定。指导文件引用此节来安排'钩子强度'(见 03-highpoint-hooks.md §5.2-5.3)。脚本不强制校验(强度判定是主观的)。",
175
+ "hook_strength_constraint": {
176
+ "description": "钩子强度的判定规则",
177
+ "strong_threshold_emotion_value": 8,
178
+ "strong_threshold_key_chapter": [
179
+ "第1章",
180
+ "每卷首章",
181
+ "每卷末章",
182
+ "大高潮章",
183
+ "结局章"
184
+ ],
185
+ "rule": "情绪值 >= 8 的章必须强钩子;上列关键章必须强钩子"
186
+ },
187
+ "hook_dup_threshold": {
188
+ "description": "连续同类钩子的告警阈值",
189
+ "warning_at_consecutive": 2,
190
+ "error_at_consecutive": 3,
191
+ "exception": "大高潮连续 3-4 章可同大类,需在细纲中标注'高潮期同类允许'"
192
+ }
193
+ },
194
+
195
+ "satisfaction_guides": {
196
+ "_note": "爽点分布、压制时长、压制红线。指导文件引用此节来安排'爽点与压制'(见 04-satisfaction.md §2-3)。脚本不强制校验。",
197
+ "pleasure_distribution": {
198
+ "description": "爽点密度的参考区间",
199
+ "small_per_chapter_low": 0.2,
200
+ "small_per_chapter_high": 0.3,
201
+ "medium_per_bridge_low": 1,
202
+ "medium_per_bridge_high": 1,
203
+ "large_per_volume_low": 1,
204
+ "large_per_volume_high": 2,
205
+ "note": "小爽点每 3-5 章一次;中爽点每桥段一次;大爽点每卷 1-2 次"
206
+ },
207
+ "suppression_duration": {
208
+ "description": "不同弧线/题材的压制时长(章数区间,基准 2000 字/章)",
209
+ "V_shape_valley": { "low": 1, "high": 2, "note": "V 形谷底" },
210
+ "delayed_satisfaction_prefix": { "low": "T×0.6", "high": "T×0.65", "note": "延迟满足的压制段" },
211
+ "formula2_suppression": { "low": 3, "high": 3, "note": "古言宅斗压抑" },
212
+ "bridge_pull": { "low": 1, "high": 1, "note": "桥段拉扯" },
213
+ "爽文_suppression": { "low": 2, "high": 3, "note": "世情/爽文受辱后打脸" },
214
+ "虐恋_suppression": { "low": 5, "high": 8, "note": "虐恋压制" }
215
+ },
216
+ "suppression_redline": {
217
+ "description": "不同题材的连续无转折上限 / 连续压制上限(章数)",
218
+ "爽文": { "no_turn": 3, "suppress": 3 },
219
+ "情感虐心": { "no_turn": 5, "suppress": 8 },
220
+ "悬疑": { "no_turn": 4, "suppress": 5 },
221
+ "古言复仇": { "no_turn": 4, "suppress": 5 },
222
+ "年代亲情": { "no_turn": 4, "suppress": 6 },
223
+ "正剧文学": { "no_turn": 6, "suppress": 10 }
224
+ }
225
+ },
226
+
227
+ "expectation_guides": {
228
+ "_note": "期待管理的参考值。指导文件引用此节来安排'期待开环/闭环'(见 04-satisfaction.md §4.6)。脚本不强制校验。",
229
+ "expectation_vacuum_threshold": {
230
+ "description": "期待真空期的判定",
231
+ "consecutive_chapters_without_open_loop": 3,
232
+ "rule": "连续 3 章无任何开环 = 期待真空期,必须立即插入至少 1 个强开环"
233
+ },
234
+ "open_loop_per_unit": {
235
+ "minimum": 1,
236
+ "rule": "每个单元至少 1 个开环在运行"
237
+ }
238
+ },
239
+
240
+ "foreshadow_guides": {
241
+ "_note": "伏笔的唤醒与超期处理。指导文件引用此节来安排'伏笔密度与唤醒'(见 05-foreshadow-density.md §4.4-5.1)。脚本不强制校验。",
242
+ "foreshadow_wakeup_threshold": {
243
+ "description": "是否需要唤醒的判定",
244
+ "small_foreshadow": { "needs_wakeup": false, "note": "小伏笔回收窗口短,通常不需要唤醒" },
245
+ "medium_foreshadow": { "needs_wakeup_if_gap_over": 15, "note": "中伏笔间隔 > 15 章需要唤醒" },
246
+ "large_foreshadow": { "needs_wakeup": true, "note": "大伏笔几乎都需要唤醒" }
247
+ },
248
+ "foreshadow_overdue_threshold": {
249
+ "description": "伏笔超期判定的阈值",
250
+ "chapter_gap": 20,
251
+ "rule": "当前章 > 预期回收窗口上限 + 20 章 = 超期,必须处理(立即回收/延期/标 abandoned)"
252
+ },
253
+ "foreshadow_density_by_unit": {
254
+ "description": "每单元的伏笔动作密度",
255
+ "bury_per_unit_low": 2,
256
+ "bury_per_unit_high": 4,
257
+ "push_per_unit_low": 2,
258
+ "push_per_unit_high": 3,
259
+ "recover_per_unit_low": 1,
260
+ "recover_per_unit_high": 2
261
+ }
262
+ },
263
+
264
+ "outline_guides": {
265
+ "_note": "章节细纲的覆盖与字数参考。指导文件引用此节来安排'细纲覆盖范围'(见 06-chapter-outline.md §2.3-3.4)。脚本不强制校验。",
266
+ "outline_coverage": {
267
+ "description": "哪些章必须有细纲",
268
+ "must_have": [
269
+ "第1章",
270
+ "每卷首章",
271
+ "每卷末章",
272
+ "大高潮章",
273
+ "转折点章",
274
+ "结局章"
275
+ ],
276
+ "optional_ratio_low": 0.3,
277
+ "optional_ratio_high": 0.5,
278
+ "note": "必须章 + 可选章(约 30%-50% 的章有细纲)"
279
+ },
280
+ "word_target_range": {
281
+ "description": "章节细纲的 word_target 允许偏差",
282
+ "deviation_low": 0.8,
283
+ "deviation_high": 1.2,
284
+ "note": "word_target 应在 avg_words_per_chapter × [0.8, 1.2] 内"
285
+ }
286
+ },
287
+
288
+ "faction_guides": {
289
+ "_note": "势力出场的升级曲线。指导文件引用此节来安排'势力冲突升级'(见 06-chapter-outline.md §6.2)。脚本不强制校验。",
290
+ "faction_escalation_curve": {
291
+ "description": "势力冲突随卷/单元升级",
292
+ "volumes": [
293
+ { "phase": "背景压迫", "note": "第 1-2 单元:势力施压(背景出现)" },
294
+ { "phase": "直接冲突", "note": "第 3-4 单元:势力直接冲突(当面冲突)" },
295
+ { "phase": "势力联合", "note": "第 5-6 单元:势力联合(多势力对立)" },
296
+ { "phase": "势力决战", "note": "第 7+ 单元:势力决战(一方覆灭)" }
297
+ ],
298
+ "miss_threshold_units": 2,
299
+ "rule": "某势力连续 2 单元未出场 = 写丢,需安排提及或出场"
300
+ }
301
+ }
302
+ }
@@ -0,0 +1,229 @@
1
+ {
2
+ "meta": {
3
+ "name": "formulas-skeleton",
4
+ "description": "骨架阶段数量公式。所有 quota 字段必须落在这里定义的区间内。",
5
+ "note": "共 30 条公式(含 fixed.* 固定值)。v1.1 变更:新增 world_rule_counts 3 条;ending_count 用条件表达式让单卷区间收窄;faction_relation_count 下界改为 n-1。v1.2 变更:9 条「绝对上限」型公式的区间在卷数多时会变成空区间(lower > upper → 模型写不出合法 derivations → 重投到上限 → 阶段死循环),改为把硬上限夹进下界,区间恒非空且卷数少时行为不变。 同时把依赖 BC 的 2 条公式(交织冲突数 / 支线道具数)也纳入同一修法。"
6
+ },
7
+ "variables": {
8
+ "T": "capacity.target_chapters(来自 框架.json)",
9
+ "V": "quota.volume_count(来自 框架.json)",
10
+ "P": "quota.character_counts.protagonist(来自 框架.json)",
11
+ "CS": "quota.character_counts.core_supporting(来自 框架.json)",
12
+ "CA": "quota.character_counts.core_antagonist(来自 框架.json)",
13
+ "BC": "quota.branch_count(来自 框架.json)",
14
+ "CC": "quota.conflict_counts.core(来自 框架.json)",
15
+ "n": "quota.faction_count(势力数,仅用于 faction_relation_count 的公式文本)"
16
+ },
17
+ "formulas": {
18
+ "structure.volume_count": {
19
+ "formula": "max(1, ceil(T/120)) ~ max(max(1, ceil(T/120)), min(max(1, ceil(T/40)), 30))",
20
+ "expr_low": "Math.max(1, Math.ceil(T / 120))",
21
+ "expr_high": "Math.max(Math.max(1, Math.ceil(T / 120)), Math.min(Math.max(1, Math.ceil(T / 40)), 30))",
22
+ "note": "每卷 40~120 章,至少 1 卷。上界取 max(下界, min(ceil(T/40), 30)):下界 ceil(T/120) 保证每卷不超过 120 章,所以 T 很大时(上界那个 30 卷的硬顶被顶穿)区间仍然是 [ceil(T/120), ceil(T/120)] —— 也就是每卷刚好 120 章、卷数随 T 增长,而不是下界 > 上界的空区间(空区间会让模型写不出合法 derivations,重投到上限后阶段死循环)",
23
+ "applies_to_field": "quota.volume_count"
24
+ },
25
+ "structure.branch_count": {
26
+ "formula": "max(1, ceil(V/2), ceil(floor(T*0.3)/30)) ~ max(max(1, ceil(V/2), ceil(floor(T*0.3)/30)), min(floor(ceil(T*0.5)/3), max(V*3, 15, ceil(floor(T*0.3)/30))))",
27
+ "expr_low": "Math.max(1, Math.ceil(V / 2), Math.ceil(Math.floor(T * 0.3) / 30))",
28
+ "expr_high": "Math.max(Math.max(1, Math.ceil(V / 2), Math.ceil(Math.floor(T * 0.3) / 30)), Math.min(Math.floor(Math.ceil(T * 0.5) / 3), Math.max(V * 3, 15, Math.ceil(Math.floor(T * 0.3) / 30))))",
29
+ "note": "以卷为基数,通常上限 V*3(至少 15);下界还要保证节奏阶段的支线章数区间可行(BC×30 ≥ floor(T×0.3),否则节奏阶段无解)。上界额外夹住节奏侧的硬约束 floor(ceil(T×0.5)/3) —— 节奏要求 lower=max(BC*3, floor(T×0.3)) ≤ upper=min(BC×30, ceil(T×0.5)),也就是 BC ≤ floor(ceil(T×0.5)/3);不把它纳入上界,公式就会允许选出节奏无解的 BC(短书和高 T 都会踩到)。最后再对下界取 max,保证区间恒非空",
30
+ "applies_to_field": "quota.branch_count"
31
+ },
32
+ "character_elements.volume_supporting_count": {
33
+ "formula": "min(V*3, 30) ~ min(V*5, 30)",
34
+ "expr_low": "Math.min(V * 3, 30)",
35
+ "expr_high": "Math.min(V * 5, 30)",
36
+ "note": "卷级重要配角数,全书上限 30;卷数多时下界收敛到 30(否则区间为空,模型写不出合法值)",
37
+ "applies_to_field": "quota.character_counts.volume_supporting"
38
+ },
39
+ "character_elements.volume_antagonist_count": {
40
+ "formula": "min(V, 15) ~ min(V*2, 15)",
41
+ "expr_low": "Math.min(V, 15)",
42
+ "expr_high": "Math.min(V * 2, 15)",
43
+ "note": "卷级反派数,全书上限 15;卷数多时下界收敛到 15(否则区间为空,模型写不出合法值)",
44
+ "applies_to_field": "quota.character_counts.volume_antagonist"
45
+ },
46
+ "conflict_elements.phase_conflict_count": {
47
+ "formula": "min(ceil(V*1.5), 20) ~ min(V*2, 20)",
48
+ "expr_low": "Math.min(Math.ceil(V * 1.5), 20)",
49
+ "expr_high": "Math.min(V * 2, 20)",
50
+ "note": "阶段冲突数,全书上限 20;卷数多时下界收敛到 20(否则区间为空,模型写不出合法值)",
51
+ "applies_to_field": "quota.conflict_counts.phase"
52
+ },
53
+ "conflict_elements.branch_conflict_count": {
54
+ "formula": "min(BC*2, 30) ~ min(BC*3, 30)",
55
+ "expr_low": "Math.min(BC * 2, 30)",
56
+ "expr_high": "Math.min(BC * 3, 30)",
57
+ "note": "交织冲突数,全书上限 30;支线多时下界收敛到 30(否则区间为空,模型写不出合法值)",
58
+ "applies_to_field": "quota.conflict_counts.branch"
59
+ },
60
+ "faction_elements.faction_count": {
61
+ "formula": "min(max(2, ceil(V/2)), 12) ~ min(V*3, 12)",
62
+ "expr_low": "Math.min(Math.max(2, Math.ceil(V / 2)), 12)",
63
+ "expr_high": "Math.min(V * 3, 12)",
64
+ "note": "势力数,全书上限 12。改为公式驱动,不再由角色去重决定;卷数多时下界收敛到 12(否则区间为空)",
65
+ "applies_to_field": "quota.faction_count"
66
+ },
67
+ "faction_elements.faction_relation_count": {
68
+ "formula": "max(1, n-1) ~ n*(n-1)/2",
69
+ "expr_low": "Math.max(1, quota.faction_count - 1)",
70
+ "expr_high": "quota.faction_count * (quota.faction_count - 1) / 2",
71
+ "note": "势力关系数。下界 n-1 保证势力图基本连通(每个势力至少一条关系);上界为完全图数(理论上限)。实际值通常两者之间,少于完全图数不会报 warning(因为公式下界不是完全图数)。n = quota.faction_count",
72
+ "applies_to_field": "quota.faction_relation_count"
73
+ },
74
+ "location_elements.key_location_count": {
75
+ "formula": "min(max(3, V*3), 40) ~ min(V*8, 40)",
76
+ "expr_low": "Math.min(Math.max(3, V * 3), 40)",
77
+ "expr_high": "Math.min(V * 8, 40)",
78
+ "note": "关键地点数,全书上限 40;卷数多时下界收敛到 40(否则区间为空,模型写不出合法值)",
79
+ "applies_to_field": "quota.location_count"
80
+ },
81
+ "foreshadow_elements.small_foreshadow_count": {
82
+ "formula": "V*3 ~ V*8",
83
+ "expr_low": "V * 3",
84
+ "expr_high": "V * 8",
85
+ "note": "小伏笔数,每卷 3~8 个",
86
+ "applies_to_field": "quota.foreshadow_counts.small"
87
+ },
88
+ "foreshadow_elements.medium_foreshadow_count": {
89
+ "formula": "max(1, ceil(V/2)) ~ V*2",
90
+ "expr_low": "Math.max(1, Math.ceil(V / 2))",
91
+ "expr_high": "V * 2",
92
+ "note": "中伏笔数",
93
+ "applies_to_field": "quota.foreshadow_counts.medium"
94
+ },
95
+ "foreshadow_elements.large_foreshadow_count": {
96
+ "formula": "max(1, ceil(V/3)) ~ max(2, ceil(V/2))",
97
+ "expr_low": "Math.max(1, Math.ceil(V / 3))",
98
+ "expr_high": "Math.max(2, Math.ceil(V / 2))",
99
+ "note": "大伏笔数",
100
+ "applies_to_field": "quota.foreshadow_counts.large"
101
+ },
102
+ "climax_elements.small_climax_count": {
103
+ "formula": "V*5 ~ V*10",
104
+ "expr_low": "V * 5",
105
+ "expr_high": "V * 10",
106
+ "note": "小高潮数,每卷 5~10 个",
107
+ "applies_to_field": "quota.climax_counts.small"
108
+ },
109
+ "climax_elements.medium_climax_count": {
110
+ "formula": "V*1 ~ V*2",
111
+ "expr_low": "V * 1",
112
+ "expr_high": "V * 2",
113
+ "note": "中高潮数",
114
+ "applies_to_field": "quota.climax_counts.medium"
115
+ },
116
+ "climax_elements.large_climax_count": {
117
+ "formula": "V ~ V+1",
118
+ "expr_low": "V",
119
+ "expr_high": "V + 1",
120
+ "note": "大高潮数",
121
+ "applies_to_field": "quota.climax_counts.large"
122
+ },
123
+ "pleasure_elements.small_pleasure_count": {
124
+ "formula": "V*8 ~ V*15",
125
+ "expr_low": "V * 8",
126
+ "expr_high": "V * 15",
127
+ "note": "小爽点数,每卷 8~15 个",
128
+ "applies_to_field": "quota.pleasure_counts.small"
129
+ },
130
+ "pleasure_elements.medium_pleasure_count": {
131
+ "formula": "V*3 ~ V*5",
132
+ "expr_low": "V * 3",
133
+ "expr_high": "V * 5",
134
+ "note": "中爽点数",
135
+ "applies_to_field": "quota.pleasure_counts.medium"
136
+ },
137
+ "pleasure_elements.large_pleasure_count": {
138
+ "formula": "V ~ V+2",
139
+ "expr_low": "V",
140
+ "expr_high": "V + 2",
141
+ "note": "大爽点数",
142
+ "applies_to_field": "quota.pleasure_counts.large"
143
+ },
144
+ "item_elements.core_item_count": {
145
+ "formula": "max(2, CC*2) ~ CC*3",
146
+ "expr_low": "Math.max(2, CC * 2)",
147
+ "expr_high": "CC * 3",
148
+ "note": "核心道具数",
149
+ "applies_to_field": "quota.item_counts.core"
150
+ },
151
+ "item_elements.branch_item_count": {
152
+ "formula": "min(max(2, BC*2), 30) ~ min(BC*3, 30)",
153
+ "expr_low": "Math.min(Math.max(2, BC * 2), 30)",
154
+ "expr_high": "Math.min(BC * 3, 30)",
155
+ "note": "支线道具数,全书上限 30;支线多时下界收敛到 30(否则区间为空,模型写不出合法值)",
156
+ "applies_to_field": "quota.item_counts.branch"
157
+ },
158
+ "item_elements.symbolic_item_count": {
159
+ "formula": "ceil((P+CS+CA)/2) ~ min(P+CS+CA, 15)",
160
+ "expr_low": "Math.ceil((P + CS + CA) / 2)",
161
+ "expr_high": "Math.min(P + CS + CA, 15)",
162
+ "note": "象征道具数,绝对上限 15",
163
+ "applies_to_field": "quota.item_counts.symbolic"
164
+ },
165
+ "world_rule_counts.core": {
166
+ "formula": "min(max(1, V), 20) ~ min(V*3, 20)",
167
+ "expr_low": "Math.min(Math.max(1, V), 20)",
168
+ "expr_high": "Math.min(V * 3, 20)",
169
+ "note": "核心规则数(力量体系/物理规则),每卷 1-3 条,全书上限 20;卷数多时下界收敛到 20(否则区间为空)",
170
+ "applies_to_field": "quota.world_rule_counts.core"
171
+ },
172
+ "world_rule_counts.information": {
173
+ "formula": "min(max(1, V), 15) ~ min(V*2, 15)",
174
+ "expr_low": "Math.min(Math.max(1, V), 15)",
175
+ "expr_high": "Math.min(V * 2, 15)",
176
+ "note": "信息规则数(信息传播/隐藏/揭示),每卷 1-2 条,全书上限 15;卷数多时下界收敛到 15(否则区间为空)",
177
+ "applies_to_field": "quota.world_rule_counts.information"
178
+ },
179
+ "world_rule_counts.social": {
180
+ "formula": "min(max(1, V), 15) ~ min(V*2, 15)",
181
+ "expr_low": "Math.min(Math.max(1, V), 15)",
182
+ "expr_high": "Math.min(V * 2, 15)",
183
+ "note": "社会规则数(社会结构/文化/禁忌),每卷 1-2 条,全书上限 15;卷数多时下界收敛到 15(否则区间为空)",
184
+ "applies_to_field": "quota.world_rule_counts.social"
185
+ },
186
+ "ending_elements.ending_count": {
187
+ "formula": "V===1 ? 1 : V ~ V===1 ? 1 : V+1",
188
+ "expr_low": "V === 1 ? 1 : V",
189
+ "expr_high": "V === 1 ? 1 : V + 1",
190
+ "note": "结局总数。单卷作品:区间 [1,1],必须恰好 1 个全书级结局,无卷级结局。多卷作品:区间 [V, V+1],允许 V-1 或 V 个卷级结局。无论单卷多卷,level='全书级' 的结局必须恰好 1 个——这是结构语义,由 skeleton-validate.js 的 QUOTA_MISMATCH 检查(ending_book_level 字段),不在本公式中表达",
191
+ "applies_to_field": "quota.ending_count"
192
+ },
193
+ "fixed.structure.main_line_count": {
194
+ "formula": "1",
195
+ "expr_low": "1",
196
+ "expr_high": "1",
197
+ "note": "主线数固定为 1",
198
+ "applies_to_field": "quota.main_line_count"
199
+ },
200
+ "fixed.character_elements.protagonist_count": {
201
+ "formula": "1~2",
202
+ "expr_low": "1",
203
+ "expr_high": "2",
204
+ "note": "主角数 1~2 人",
205
+ "applies_to_field": "quota.character_counts.protagonist"
206
+ },
207
+ "fixed.character_elements.core_supporting_count": {
208
+ "formula": "2~4",
209
+ "expr_low": "2",
210
+ "expr_high": "4",
211
+ "note": "贯穿级核心配角数 2~4 人",
212
+ "applies_to_field": "quota.character_counts.core_supporting"
213
+ },
214
+ "fixed.character_elements.core_antagonist_count": {
215
+ "formula": "1~3",
216
+ "expr_low": "1",
217
+ "expr_high": "3",
218
+ "note": "贯穿级核心反派数 1~3 人",
219
+ "applies_to_field": "quota.character_counts.core_antagonist"
220
+ },
221
+ "fixed.conflict_elements.core_conflict_count": {
222
+ "formula": "1",
223
+ "expr_low": "1",
224
+ "expr_high": "1",
225
+ "note": "核心冲突数固定为 1",
226
+ "applies_to_field": "quota.conflict_counts.core"
227
+ }
228
+ }
229
+ }