From 181a761d52e4ce7e5175e4c817b5860689a7b84f Mon Sep 17 00:00:00 2001 From: David Baity <158404677+MazakTheDwarf@users.noreply.github.com> Date: Wed, 15 Apr 2026 19:16:08 -0400 Subject: [PATCH] fix: add chapter_ref/chapter_number to package schema; drop requires block - Package step schema now includes chapter_ref and chapter_number so the LLM extracts them from the task name even when context vars are missing. - Previously removed requires: block was the only guard; now the package step itself self-heals by asking the LLM to derive these values. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- templates/book_chapter.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/templates/book_chapter.yml b/templates/book_chapter.yml index 77dc5e99..456c543e 100644 --- a/templates/book_chapter.yml +++ b/templates/book_chapter.yml @@ -429,10 +429,16 @@ steps: The draft chapter has been written, self-checked, and committed. The character-state from PASS 3 is provided above. - Summarize the character state changes for {chapter_ref} in the `chapter_state` field + Summarize the character state changes in the `chapter_state` field (2-3 sentences max). This is used for bookkeeping -- the chapter text itself is passed to reviewers directly. + CHAPTER IDENTIFICATION (required fields): + Extract the chapter reference from the task name or task context: + - chapter_number: the plain chapter number as a string (e.g. "8" from "Write Chapter 8: ...") + - chapter_ref: zero-padded two-digit reference (e.g. "ch-08" for chapter 8) + If not available in context, derive it from the chapter number in the task name. + NEW CHARACTER DETECTION: For each NEW character introduced this chapter (not previously known), emit one create_task action using task_type: character_sheet. @@ -444,6 +450,8 @@ steps: Now confirm the chapter is ready for review. schema: chapter_state: string + chapter_ref: string + chapter_number: string spawn: - task_type: chapter_review task_name: "Review (Devon): {chapter_ref}"