Răsfoiți Sursa

fix(core): reset pending_hooks.md during import replay to prevent future state leak

resetImportReplayTruthFiles intentionally skipped pending_hooks.md,
but the architect's foundation output includes hooks from the full
imported text (e.g. chapter 60 hooks). When replay starts from
chapter 1, these future hooks leak into the context.

Reset pending_hooks.md to an empty table using the existing
buildImportReplayHooksSeed helper. The replay will incrementally
rebuild hooks from each chapter's analysis.

Fixes the pre-existing CI failure: "does not leak imported future
state into early replay chapters".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fanghanjun 7 luni în urmă
părinte
comite
491e620530
1 a modificat fișierele cu 5 adăugiri și 4 ștergeri
  1. 5 4
      packages/core/src/pipeline/runner.ts

+ 5 - 4
packages/core/src/pipeline/runner.ts

@@ -2253,10 +2253,11 @@ ${matrix}`,
         this.buildImportReplayStateSeed(language),
         "utf-8",
       ),
-      // NOTE: pending_hooks.md intentionally NOT reset here — hooks are
-      // chapter-content-specific and user may have invested significant
-      // effort in tuning them. The replay will incrementally add new hooks
-      // detected from the imported chapters without destroying existing ones.
+      writeFile(
+        join(storyDir, "pending_hooks.md"),
+        this.buildImportReplayHooksSeed(language),
+        "utf-8",
+      ),
       rm(join(storyDir, "chapter_summaries.md"), { force: true }),
       rm(join(storyDir, "subplot_board.md"), { force: true }),
       rm(join(storyDir, "emotional_arcs.md"), { force: true }),