From 4ab09d1c16711a10485dab4a8d157b65b57a90be Mon Sep 17 00:00:00 2001 From: David Baity <158404677+MazakTheDwarf@users.noreply.github.com> Date: Tue, 24 Mar 2026 00:51:32 -0400 Subject: [PATCH] Fix book_chapter.yml: write chapter draft before char-state extraction Chapter_N_draft doc step was placed after PASS 3 think, so last_text() returned char state (3151 chars) instead of the actual chapter from SELF-CHECK. Moved doc step to immediately after step 2 (SELF-CHECK). New step order: 0-think, 1-think, 2-think(selfcheck), 3-doc(draft), 4-think(charstate), 5-rag_write, 6-doc(charstate), 7-package, 8-close Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- templates/book_chapter.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/book_chapter.yml b/templates/book_chapter.yml index 172bd79..a6ff5d0 100644 --- a/templates/book_chapter.yml +++ b/templates/book_chapter.yml @@ -251,6 +251,10 @@ steps: verbatim everywhere else). Start the chapter directly with the chapter title and first line. No preamble or commentary within the chapter text. + # Commit chapter draft now — last_text() = self-check output (step 2). Must come before + # PASS 3 think so the character-state extraction does not overwrite last_text(). + - type: document + filename: "Chapter_{chapter_number}_draft" - type: think hint: | @@ -299,8 +303,6 @@ steps: - type: document filename: "character-state-{chapter_ref}" - - type: document - filename: "Chapter_{chapter_number}_draft" - type: package max_tokens: 12000