Reader Knows Rule: truncate outline at chapter N, character state from prev chapter

- book_chapter.yml PASS 0: Reader Knows Rule box, outline truncated at chapter_number_next,
  character state priority chain (RAG first, then prev-chapter traits, not final-book state)
- drafting.yml PASS 0: same rule applied, voice-only character profiles
- chapter_pass0_bible.yml (included by scifi/ya/romance/cozy genre templates): same fix
  All three reference {chapter_number_prev}, {chapter_number_next}, {chapter_ref_prev}
  which are now injected by OutlineSyncService.CreateChapterTaskAsync

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Baity
2026-03-31 17:34:10 -04:00
parent c2b0d6c366
commit 15d8ac44d2
3 changed files with 180 additions and 109 deletions

View File

@@ -5,44 +5,88 @@ hint: |
GENRE: {genre_name} | AUDIENCE: {genre_audience}
PROSE STYLE GUIDE: {prose_style}
TARGET CHAPTER LENGTH: ~{chapter_target_words} words
THIS CHAPTER: {chapter_number} ({chapter_ref})
GENRE GUIDE: Your skills section contains exactly the guide for {genre_name}. Apply it fully.
CONTINUITY GUARDRAILS:
- Use ONLY the outline / character bible and the immediately previous chapter for continuity.
- Ignore future chapters, editorial reviews, roundtables, polish drafts, and any non-chapter artifacts.
- Never pull facts from a deliverable whose filename indicates a later chapter than {chapter_ref}.
╔══════════════════════════════════════════════════════════════════╗
THE READER KNOWS RULE — CRITICAL, NON-NEGOTIABLE ║
You are the Scribe entering chapter {chapter_number}. ║
You may only use information the READER already knows — ║
║ i.e. what was established in chapters 1 through ║
║ {chapter_number} (inclusive for setting; exclusive for ║
║ character arc — characters enter this chapter as they left ║
║ the PREVIOUS chapter, not as they end up at book's end). ║
║ ║
║ FORBIDDEN sources (will ruin earlier chapters if used): ║
║ - Character sheet state written AFTER this chapter ║
║ - Outline entries for chapters AFTER {chapter_number} ║
║ - Any deliverable whose filename contains a chapter ref ║
║ later than {chapter_ref} (e.g. chapter-ch-08 when ║
║ writing ch-03) ║
║ - Editorial reviews, polish drafts, roundtable summaries ║
║ from ANY chapter (they reflect post-writing analysis) ║
╚══════════════════════════════════════════════════════════════════╝
⚠️ CRITICAL: Your task name tells you EXACTLY which chapter to write.
Look at the CURRENT MESSAGE — write THAT chapter and ONLY that chapter.
Do NOT write Chapter 1 unless the message explicitly says "Chapter 1".
STEP 1 — READ THE OUTLINE (chapters 1 through {chapter_number} ONLY):
Look at PROJECT DELIVERABLES for the outline file.
⚠️ READ ONLY the outline entries for chapters 1 through {chapter_number}.
STOP READING when you reach "Chapter {chapter_number_next}:" or any heading
that indicates a chapter number greater than {chapter_number}.
Do NOT read, record, or reason from any future chapter entry.
STEP 1 — READ THE OUTLINE / CHARACTER BIBLE:
Look at PROJECT DELIVERABLES for the outline file (it contains the Character Bible
if this is a fiction project, and the Chapter Outline for all projects).
Extract and record:
From the portion you are allowed to read, extract and record:
- Protagonist: exact name, voice description, age (if fiction)
- Love interest and supporting characters: exact names and roles (if fiction)
- World rules / constraints (if paranormal or speculative)
- This chapter's summary, emotional beat, and closing hook from the outline
- World rules / constraints established so far (if paranormal or speculative)
- THIS chapter's summary, emotional beat, and closing hook ONLY
If no outline/bible is available, use the character names and project details
from the task description above — be CONSISTENT throughout the book.
STEP 2 — FIND THE PREVIOUS CHAPTER:
Look at PROJECT DELIVERABLES for the chapter that comes BEFORE this one.
If no previous chapter exists (this IS Chapter 1), skip to STEP 4.
STEP 2 — CHARACTER STATE (enter chapter {chapter_number} as they LEFT chapter {chapter_number_prev}):
Character sheets show the FINAL state of each character (end of book).
You must NOT use that final state for early chapters.
STEP 3 — QUOTE THE ENDING:
Instead, use the following sources IN THIS PRIORITY ORDER:
1. A RAG asset called [character-state] (set at the end of the previous chapter)
— this is the most accurate record of where each character is RIGHT NOW.
Record as "LIVE CHARACTER STATE:" and use it to override any outline prediction.
2. The "PREVIOUS CHAPTER CHARACTER STATE:" block if injected into this prompt.
3. The character's entry in the outline up to chapter {chapter_number_prev}.
Use only their established traits, history, and emotional state AS OF that point.
Ignore any arc resolution or growth that happens in later chapters.
LOCATION CONTINUITY CHECK (if [character-state] is present):
Does this chapter's outline place any character at a location inconsistent
with their Location field in [character-state]?
Example conflict: character-state says "Earth hospital" but outline opens on Mars.
If conflict found — FLAG before drafting:
"LOCATION CONFLICT: [char] is at [state-location] per last chapter but outline
places them at [outline-location]. Resolve: (a) open chapter in transit,
(b) adjust scene to actual location, or (c) write a time-skip bridge paragraph.
Do NOT silently teleport the character."
Also check RAG for [world-state] — current NPC attitudes and faction memory.
If present, record as "LIVE WORLD STATE:". Any NPC listed there who appears in
this chapter should behave according to their recorded attitude.
STEP 3 — FIND THE PREVIOUS CHAPTER:
Look at PROJECT DELIVERABLES for the chapter that comes BEFORE this one
(filename: chapter-{chapter_ref_prev} or similar).
If no previous chapter exists (this IS Chapter 1), skip to STEP 5.
STEP 4 — QUOTE THE ENDING:
Copy the LAST 23 sentences of the previous chapter here, word for word.
Label them: "PREVIOUS CHAPTER ENDED WITH: ..."
Your new chapter MUST pick up from this exact moment.
STEP 4 — BUILD THE DRAFT PROMPT:
STEP 5 — BUILD THE DRAFT PROMPT:
Write the exact drafting prompt for the next pass. That prompt must include:
- CHAPTER: Exact chapter number and title (from the task message)
- POV CHARACTER: Whose perspective are we in?
- FIRST LINE: The exact opening sentence, continuing from the previous ending
- EMOTIONAL ARC: What does the protagonist feel at start vs end?
- EMOTIONAL ARC: What does the protagonist feel at start vs end OF THIS CHAPTER?
(Not the end of the book — only what changes in these pages.)
- CHAPTER GOAL: What plot event MUST happen here?
- KEY BEATS: 35 numbered scene beats that will form the chapter
- CLOSING HOOK: Exact last image or line that makes readers continue
@@ -50,16 +94,17 @@ hint: |
- CHARACTER VOICE PROFILES (pre-extracted):
{character_profiles}
If this block is empty, fall back to searching PROJECT DELIVERABLES for a file
containing "## Voice Signatures" and copy it here. PASS 1 must write every
character to their profile.
containing "## Voice Signatures" and copy it here. Use ONLY the voice/speech
patterns — do NOT copy character arc outcomes or end-state descriptions.
PASS 1 must write every character to their profile.
STEP 5 — PREVIOUS CHAPTER CHARACTER STATE (if available):
If context contains a block starting with "PREVIOUS CHAPTER CHARACTER STATE:",
include it verbatim in the prompt under the heading:
"CHARACTER CONTINUITY: The previous chapter ended with these character states:
{prev_character_state}"
These states override any outline prediction that conflicts with them — the character
is ALREADY in this emotional/physical state at the start of this chapter.
If no character state was provided, skip this block entirely.
EDITORIAL OVERRIDES — apply these BEFORE writing any KEY BEATS:
{author_intent}
^ If this line is not blank, it is a BINDING creative directive from the editor.
Include it verbatim in the draft prompt as: "AUTHOR'S INTENT: [text]"
PASS 1 must satisfy this intent completely.
{closing_hook}
^ If this line is not blank, use it as the CLOSING HOOK instead of any outline hook.
Include it verbatim in the draft prompt as: "LOCKED CLOSING HOOK: [text]"
Stop here. Output ONLY the draft prompt. Do NOT write chapter prose yet.

View File

@@ -53,44 +53,86 @@ steps:
GENRE: {genre_name} | AUDIENCE: {genre_audience}
PROSE STYLE GUIDE: {prose_style}
TARGET CHAPTER LENGTH: ~{chapter_target_words} words
THIS CHAPTER: {chapter_number} ({chapter_ref})
GENRE GUIDE: Your skills section contains exactly the guide for {genre_name}. Apply it fully.
CONTINUITY GUARDRAILS:
- Use ONLY the outline / character bible and the immediately previous chapter for continuity.
- Ignore future chapters, editorial reviews, roundtables, polish drafts, and any non-chapter artifacts.
- Never pull facts from a deliverable whose filename indicates a later chapter than {chapter_ref}.
╔══════════════════════════════════════════════════════════════════╗
THE READER KNOWS RULE — CRITICAL, NON-NEGOTIABLE ║
You are the Scribe entering chapter {chapter_number}. ║
You may only use information the READER already knows — ║
║ what was established in chapters 1 through {chapter_number}. ║
║ Characters enter this chapter as they left chapter ║
║ {chapter_number_prev}, not as they end up at book's end. ║
║ ║
║ FORBIDDEN sources: ║
║ - Outline entries for chapters after {chapter_number} ║
║ - Character sheet state written after this chapter ║
║ - Any deliverable whose filename contains a chapter ref ║
║ later than {chapter_ref} (e.g. chapter-ch-08 when ║
║ writing ch-03) ║
║ - Editorial reviews, polish drafts, roundtable summaries ║
║ (they reflect post-writing analysis) ║
╚══════════════════════════════════════════════════════════════════╝
⚠️ CRITICAL: Your task name tells you EXACTLY which chapter to write.
Look at the CURRENT MESSAGE — write THAT chapter and ONLY that chapter.
Do NOT write Chapter 1 unless the message explicitly says "Chapter 1".
STEP 1 — READ THE OUTLINE (chapters 1 through {chapter_number} ONLY):
Look at PROJECT DELIVERABLES for the outline file.
⚠️ READ ONLY the outline entries for chapters 1 through {chapter_number}.
STOP READING when you reach "Chapter {chapter_number_next}:" or any heading
indicating a chapter number greater than {chapter_number}.
Do NOT read, record, or reason from any future chapter entry.
STEP 1 — READ THE OUTLINE / CHARACTER BIBLE:
Look at PROJECT DELIVERABLES for the outline file (it contains the Character Bible
if this is a fiction project, and the Chapter Outline for all projects).
Extract and record:
From the permitted portion, extract and record:
- Protagonist: exact name, voice description, age (if fiction)
- Love interest and supporting characters: exact names and roles (if fiction)
- World rules / constraints (if paranormal or speculative)
- This chapter's summary, emotional beat, and closing hook from the outline
- World rules / constraints established so far (if paranormal or speculative)
- THIS chapter's summary, emotional beat, and closing hook ONLY
If no outline/bible is available, use the character names and project details
from the task description above — be CONSISTENT throughout the book.
STEP 2 — FIND THE PREVIOUS CHAPTER:
Look at PROJECT DELIVERABLES for the chapter that comes BEFORE this one.
If no previous chapter exists (this IS Chapter 1), skip to STEP 4.
STEP 2 — CHARACTER STATE (enter chapter {chapter_number} as they LEFT chapter {chapter_number_prev}):
Character sheets show the FINAL state of each character (end of book).
Do NOT use that final state for early chapters.
STEP 3 — QUOTE THE ENDING:
Use sources in this priority order:
1. RAG asset [character-state] — the most accurate record of right now.
Record as "LIVE CHARACTER STATE:" and use it to override outline predictions.
2. "PREVIOUS CHAPTER CHARACTER STATE:" block if present in this prompt.
3. The character's established traits from outline up to chapter {chapter_number_prev}.
Ignore arc resolution or growth that happens in later chapters.
LOCATION CONTINUITY CHECK (if [character-state] is present):
Does this chapter's outline place any character at a location inconsistent
with their Location field in [character-state]?
If conflict found — FLAG before drafting:
"LOCATION CONFLICT: [char] is at [state-location] per last chapter but outline
places them at [outline-location]. Resolve: (a) open chapter in transit,
(b) adjust scene to actual location, or (c) write a time-skip bridge paragraph.
Do NOT silently teleport the character."
Also note Active obligations, Open loops, or Known secrets from [character-state]
that should be honored or advanced in this chapter.
Also check RAG for [world-state] — current NPC attitudes and faction memory.
If present, record as "LIVE WORLD STATE:". NPCs listed there should behave
according to their recorded attitude.
STEP 3 — FIND THE PREVIOUS CHAPTER:
Look at PROJECT DELIVERABLES for the chapter before this one
(filename: chapter-{chapter_ref_prev} or similar).
If no previous chapter exists (this IS Chapter 1), skip to STEP 5.
STEP 4 — QUOTE THE ENDING:
Copy the LAST 23 sentences of the previous chapter here, word for word.
Label them: "PREVIOUS CHAPTER ENDED WITH: ..."
Your new chapter MUST pick up from this exact moment.
STEP 4 — BUILD THE DRAFT PROMPT:
STEP 5 — BUILD THE DRAFT PROMPT:
Write the exact drafting prompt for the next pass. That prompt must include:
- CHAPTER: Exact chapter number and title (from the task message)
- POV CHARACTER: Whose perspective are we in?
- FIRST LINE: The exact opening sentence, continuing from the previous ending
- EMOTIONAL ARC: What does the protagonist feel at start vs end?
- EMOTIONAL ARC: What does the protagonist feel at start vs end OF THIS CHAPTER?
- CHAPTER GOAL: What plot event MUST happen here?
- KEY BEATS: 35 numbered scene beats that will form the chapter
- CLOSING HOOK: Exact last image or line that makes readers continue
@@ -98,41 +140,19 @@ steps:
- CHARACTER VOICE PROFILES (pre-extracted):
{character_profiles}
If this block is empty, fall back to searching PROJECT DELIVERABLES for a file
containing "## Voice Signatures" and copy it here. PASS 1 must write every
character to their profile.
containing "## Voice Signatures" and copy it here. Use ONLY the voice/speech
patterns — do NOT copy arc outcomes or end-state descriptions.
PASS 1 must write every character to their profile.
EDITORIAL OVERRIDES — apply these BEFORE writing any KEY BEATS:
{author_intent}
If this line is not blank, it is a BINDING creative directive from the editor.
^ If this line is not blank, it is a BINDING creative directive from the editor.
Include it verbatim in the draft prompt as: "AUTHOR'S INTENT: [text]"
PASS 1 must satisfy this intent completely.
{closing_hook}
If this line is not blank, use it as the CLOSING HOOK instead of any outline hook.
^ If this line is not blank, use it as the CLOSING HOOK instead of any outline hook.
Include it verbatim in the draft prompt as: "LOCKED CLOSING HOOK: [text]"
STEP 5 — CHECK LIVE CHARACTER STATE (if available):
Look in your RAG context for an asset called [character-state].
If it exists — this is WHERE and WHO each character is RIGHT NOW.
It OVERRIDES any outline predictions about character state.
Record as "LIVE CHARACTER STATE:" for use in PASS 1.
LOCATION CONTINUITY CHECK (perform this if [character-state] is present):
Does this chapter's outline place any character at a location inconsistent
with their Location field in [character-state]?
Example conflict: character-state says "Earth hospital" but outline opens on Mars.
If conflict found — FLAG before drafting:
"LOCATION CONFLICT: [char] is at [state-location] per last chapter but outline
places them at [outline-location]. Resolve: (a) open chapter in transit,
(b) adjust scene to actual location, or (c) write a time-skip bridge paragraph.
Do NOT silently teleport the character."
Also note any Active obligations, Open loops, or Known secrets from [character-state]
that should be honored or advanced in this chapter.
Also check RAG for [world-state] — current NPC attitudes and faction memory.
If present, record as "LIVE WORLD STATE:". Any NPC listed there who appears in
this chapter should behave according to their recorded attitude.
Stop here. Output ONLY the draft prompt. Do NOT write chapter prose yet.
- type: think

View File

@@ -49,65 +49,71 @@ steps:
GENRE: {genre_name} | AUDIENCE: {genre_audience}
PROSE STYLE GUIDE: {prose_style}
TARGET CHAPTER LENGTH: ~{chapter_target_words} words
THIS CHAPTER: {chapter_number} ({chapter_ref})
CONTINUITY GUARDRAILS:
- Use ONLY the outline / character bible and the immediately previous chapter for continuity.
- Ignore future chapters, editorial reviews, roundtables, polish drafts, and any non-chapter artifacts.
- Never pull facts from a deliverable whose filename indicates a later chapter than {chapter_ref}.
⚠️ CRITICAL: Your task name tells you EXACTLY which chapter to write.
Look at the CURRENT MESSAGE — write THAT chapter and ONLY that chapter.
Do NOT write Chapter 1 unless the message explicitly says "Chapter 1".
╔══════════════════════════════════════════════════════════════════╗
║ THE READER KNOWS RULE ║
║ You may only use information established in chapters 1 through ║
║ {chapter_number}. Stop reading the outline at Chapter ║
║ {chapter_number_next}. Characters enter this chapter as they ║
║ left chapter {chapter_number_prev} -- not as they end at book ║
║ end. ║
╚══════════════════════════════════════════════════════════════════╝
STEP 1 — READ THE OUTLINE / CHARACTER BIBLE:
STEP 1 — READ THE OUTLINE (chapters 1 through {chapter_number} ONLY):
Look at PROJECT DELIVERABLES for the outline file.
STOP at "Chapter {chapter_number_next}:" -- do NOT read beyond.
Extract and record:
- protagonist and supporting cast names
- world rules / constraints
- world rules / constraints established SO FAR
- this chapter's summary, emotional beat, and closing hook from the outline
If no outline/bible is available, use the character names and project details
from the task description above — be CONSISTENT throughout the book.
CHARACTER VOICE PROFILES (pre-extracted):
{character_profiles}
If this block is empty, search PROJECT DELIVERABLES for the outline file containing
"## Voice Signatures" and copy those profiles here. PASS 1 must write every character
"## Voice Signatures" and copy ONLY the voice/speech patterns here. Do NOT copy
arc resolution or end-state descriptions. PASS 1 must write every character
to their voice profile without exception.
STEP 2 — FIND THE PREVIOUS CHAPTER:
Look at PROJECT DELIVERABLES for the chapter that comes BEFORE this one.
If no previous chapter exists (this IS Chapter 1), skip to STEP 4.
STEP 2 — CHARACTER STATE (as of chapter {chapter_number_prev}):
Priority order:
1. RAG asset [character-state] — overrides everything. Record as "LIVE CHARACTER STATE:".
2. Established traits from the outline up to chapter {chapter_number_prev} only.
Ignore outcomes that happen in later chapters.
STEP 3 — QUOTE THE ENDING:
Copy the LAST 23 sentences of the previous chapter here, word for word.
Label them: "PREVIOUS CHAPTER ENDED WITH: ..."
Your new chapter MUST pick up from this exact moment.
STEP 4 — BUILD THE DRAFT PROMPT:
Write the exact drafting prompt for the next pass. That prompt must include:
- CHAPTER: Exact chapter number and title
- POV CHARACTER: Whose perspective are we in?
- FIRST LINE: The exact opening sentence, continuing from the previous ending
- EMOTIONAL ARC: What does the protagonist feel at start vs end?
- CHAPTER GOAL: What plot event MUST happen here?
- KEY BEATS: 35 numbered scene beats that will form the chapter
- CLOSING HOOK: Exact last image or line that makes readers continue
- Reminders about continuity, prose style, and target length
STEP 5 — CHECK LIVE CHARACTER STATE (if available):
Look in your RAG context for an asset called [character-state].
If it exists — this is WHERE and WHO each character is RIGHT NOW.
It OVERRIDES any outline predictions about character state.
Record as "LIVE CHARACTER STATE:" for use in PASS 1.
LOCATION CONTINUITY CHECK (perform this if [character-state] is present):
LOCATION CONTINUITY CHECK (if [character-state] is present):
Does this chapter's outline place any character at a location inconsistent
with their Location field in [character-state]?
If conflict found — FLAG before drafting:
"LOCATION CONFLICT: [char] is at [state-location] per last chapter but outline
places them at [outline-location]. Resolve by opening in transit or adjusting."
STEP 3 — FIND THE PREVIOUS CHAPTER:
Look at PROJECT DELIVERABLES for the chapter that comes BEFORE this one.
If no previous chapter exists (this IS Chapter 1), skip to STEP 5.
STEP 4 — QUOTE THE ENDING:
Copy the LAST 23 sentences of the previous chapter here, word for word.
Label them: "PREVIOUS CHAPTER ENDED WITH: ..."
Your new chapter MUST pick up from this exact moment.
STEP 5 — BUILD THE DRAFT PROMPT:
Write the exact drafting prompt for the next pass. That prompt must include:
- CHAPTER: Exact chapter number and title
- POV CHARACTER: Whose perspective are we in?
- FIRST LINE: The exact opening sentence, continuing from the previous ending
- EMOTIONAL ARC: What does the protagonist feel at start vs end OF THIS CHAPTER?
- CHAPTER GOAL: What plot event MUST happen here?
- KEY BEATS: 35 numbered scene beats that will form the chapter
- CLOSING HOOK: Exact last image or line that makes readers continue
- Reminders about continuity, prose style, and target length
Also note any Active obligations, Open loops, or Known secrets from [character-state]
that should be honored or advanced in this chapter.
Check RAG for [world-state] — current NPC attitudes and faction memory.