Răsfoiți Sursa

fix(core): architect must emit all 5 SECTION blocks even when expanded

Round 3 bench8 显示架构师被规则 7 (OKR 递归大纲) + 规则 8 (前台/后台故事分层)
撑胖后, 模型把 story_frame 和 volume_map 写很长, 写到大约 2400 汉字就停
了——没进 roles / book_rules / pending_hooks. parseSections 拿不到后三段
直接判 "Architect output missing required sections".

maxTokens 已经是 20480, 停早不是撞上限, 是模型自觉 "讲够了".

修复: 在中英两个 foundation prompt 末尾都追加 "硬性完结检查" 段, 直接写明
必须依次输出 5 个 SECTION 块, 哪怕 roles 只列 3 个角色、book_rules 是小
YAML、pending_hooks 只有 3 行也要写完. 不压缩规则 7/8 本身的内容量, 只是
把 "交付标准" 再打一次钉子.

顺手修一个 Edit 回合里错删的英文方法闭合大括号.
Ma 6 luni în urmă
părinte
comite
3f15129275
1 a modificat fișierele cu 8 adăugiri și 2 ștergeri
  1. 8 2
      packages/core/src/agents/architect.ts

+ 8 - 2
packages/core/src/agents/architect.ts

@@ -390,7 +390,10 @@ enableFullCastTracking: false
 - **story_frame / volume_map / roles 必须是散文密度,不要退化成 bullet**
 - **book_rules 只留 YAML,不要写散文**
 - **不要输出 rhythm_principles 或 current_state 独立 section**——节奏原则合并进 volume_map 尾段;角色初始状态写在 roles.当前现状,初始钩子写在 pending_hooks(startChapter=0 行),环境/时代锚(仅历史/年代/都市重生等需要年份的题材)织进 story_frame.世界观底色,不要硬凑
-- **pending_hooks 表必须包含 Phase 7 扩展列——depends_on 标出因果链、pays_off_in_arc 锁定回收大致位置、core_hook 标记主线承重伏笔(3-7 条)、half_life 仅给重点伏笔设置**`;
+- **pending_hooks 表必须包含 Phase 7 扩展列——depends_on 标出因果链、pays_off_in_arc 锁定回收大致位置、core_hook 标记主线承重伏笔(3-7 条)、half_life 仅给重点伏笔设置**
+
+## 硬性完结检查(生成前读一遍)
+必须依次输出全部 **5 个 SECTION 块**:story_frame → volume_map → roles → book_rules → pending_hooks,不允许因为 story_frame 或 volume_map 写长了就不写后 3 段。哪怕 roles 只列 3 个角色、book_rules 只有 YAML 小块、pending_hooks 只有 3 行,也要完整输出。只有写完 pending_hooks 最后一行才算交付。`;
   }
 
   private buildEnglishFoundationPrompt(
@@ -581,7 +584,10 @@ Rules:
 - **story_frame / volume_map / roles must be prose density — no bullet-list degradation**
 - **book_rules is YAML only — no prose body**
 - **Do NOT emit rhythm_principles or current_state as separate sections** — rhythm principles live in the last paragraph of volume_map; character initial status goes in roles.Current_State; initial hooks go in pending_hooks (start_chapter=0 rows); environment / era anchors (only when the genre has a real year) are woven into story_frame's world-tonal-ground paragraph
-- **pending_hooks table MUST carry Phase 7 extended columns — depends_on spells out the causal chain, pays_off_in_arc locks the approximate payoff location, core_hook marks main-line load-bearing hooks (3-7 per book), half_life only on priority hooks**`;
+- **pending_hooks table MUST carry Phase 7 extended columns — depends_on spells out the causal chain, pays_off_in_arc locks the approximate payoff location, core_hook marks main-line load-bearing hooks (3-7 per book), half_life only on priority hooks**
+
+## Hard completeness check (read before generating)
+You MUST emit all **5 SECTION blocks in order**: story_frame → volume_map → roles → book_rules → pending_hooks. Do NOT stop after story_frame or volume_map just because they ran long. Even if roles lists only 3 characters, book_rules is a tiny YAML block, and pending_hooks has only 3 rows, all five must appear. The output is only considered delivered after the last row of pending_hooks is written.`;
   }
 
   // -------------------------------------------------------------------------