Просмотр исходного кода

feat(v13): reviewer hook-debt escalation dimension [phase 7/8 part 5]

Dimension 6 (伏笔检查 / Hook Check) in ContinuityAuditor now carries an
explicit Phase 7 prose note that teaches the reviewer to escalate based
on the stale / blocked / core_hook / depends_on columns of pending_hooks.md,
not just on "is this hook undelivered":

  - core_hook=true stale over 10 chapters → critical
  - blocked run of 6+ chapters → warning, name the upstream id
  - volume-end core hook still open without carry-over planning → critical
  - non-core stale → info only

Prose lives inline in the dimension note (zh + en). No new JSON fields on
reviewer output — Phase 6 shape preserved.
Ma 6 месяцев назад
Родитель
Сommit
75c595c8db
1 измененных файлов с 23 добавлено и 0 удалено
  1. 23 0
      packages/core/src/agents/continuity.ts

+ 23 - 0
packages/core/src/agents/continuity.ts

@@ -189,6 +189,29 @@ function buildDimensionNote(
   }
 
   switch (id) {
+    case 6:
+      // Phase 7 — hook-debt escalation. Reviewer now reads pending_hooks.md
+      // not just for "is this hook undelivered" but for causal/temporal
+      // debt escalation. The ledger's status column carries "过期 (距=…/半衰=…)"
+      // and "受阻于 …" markers emitted by the stale/blocked detector; this
+      // dimension tells the reviewer how to escalate them.
+      return language === "en"
+        ? `Hook-debt escalation (Phase 7). Read the pending_hooks.md ledger and escalate based on the stale / blocked / core_hook / depends_on columns, NOT only on "undelivered hook present":
+
+• A core_hook=true hook that has been stale for over 10 chapters → escalate from warning to critical. The book has only 3-7 core hooks; letting one drift that long is the lead symptom of narrative rot (cf. new.txt L1569).
+• A blocked hook (depends_on references upstream still unplanted or unresolved) that has been blocked for a run of 6+ chapters → warning. Call out the specific upstream hook id so the planner can route the resolution.
+• At volume end (final chapter of any volume per volume_map) a core_hook that is still open or stale without explicit "carried over to volume N+1" planning → critical.
+• A non-core stale hook → info-level log; do not fail the chapter on it, but note it so the planner can schedule cleanup.
+
+Quote the exact hook_id in description and include the stale / blocked marker text verbatim. Structure check only — do not judge hook prose quality.`
+        : `Phase 7 hook-debt 升级规则。阅读 pending_hooks.md 伏笔池时不要只看"有没有悬而未决的伏笔",要读状态列中的 stale / blocked 标记、core_hook 列和 depends_on 列:
+
+• 主线伏笔(core_hook=是)过期超过 10 章未回收 → warning 升级为 critical。全书只有 3-7 条核心伏笔,任何一条漂移这么久都是烂尾前兆(对应 new.txt L1569"严禁烂尾逻辑")。
+• 受阻伏笔(depends_on 指向的上游仍未种下或未解决)已被阻塞超过 5 章 → warning。在描述中写出具体的上游 hook_id,让 planner 能安排落地路径。
+• 卷尾(volume_map 中任一卷的末章)仍有主线伏笔处于 open 或 stale 且没有显式"延至下一卷"规划 → critical。
+• 次要伏笔 stale → info 级记录,不判本章失败,但保留以便 planner 安排清理。
+
+description 中要明确引用 hook_id,并把状态列中 stale / blocked 的原文标记字面抄进去。本维度只审结构,不评价伏笔文笔。`;
     case 19:
       return language === "en"
         ? "Check whether POV shifts are signaled clearly and stay consistent with the configured viewpoint."