Sprint 56h: evolving character sheets + reliable injection

- Split project.rag.md into 6 focused RAG files (voice-signatures, magic-system,
  story-premise, factions, character-state, world-state)
- book_chapter.yml: PASS 0 STEP 5 replaced with live RAG character/world state check +
  location continuity validation; PASS 3 added for character+world state extraction after
  each chapter (rag_write -> character-state RAG + deliverable snapshot)
- chapter_polish.yml: PASS state extraction after final document (full-mode canonical state)
- book_outline.yml: added Factions section template with NPC memory model
- NEW character_update.yml: permanent arc change template (updates static char profile)
- chapter_review.yml: Sprint 56g voice authenticity fixes (fire/ice -> Body/Mind duality)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Baity
2026-03-23 01:06:15 -04:00
parent d54fc87b5d
commit 63f60559b0
12 changed files with 386 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
name: book_chapter
name: book_chapter
description: "Write one chapter — continuity check, draft, self-check, then spawn editorial review."
debug: true
system: agent_prompt
@@ -94,20 +94,38 @@ steps:
- 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
- CHARACTER VOICE PROFILES: Copy the "## Voice Signatures" section from the
Character Bible here verbatim. PASS 1 must write every character to their profile.
If no Voice Signatures section exists, omit this block.
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.
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
model: power
max_tokens: 32000
hint: |
PASS 1 — WRITE THE DRAFT
@@ -141,6 +159,28 @@ steps:
- Prefer scene motion over thesis delivery — action and dialogue carry meaning
- Write ONE complete draft now. Do NOT self-polish. Reviewers will give feedback downstream.
VOICE ANTI-PATTERNS — THESE ARE FORBIDDEN ON EVERY PAGE:
- Do NOT open any chapter with the "didn't just X; it Y" sentence construction.
Every chapter must have a structurally distinct opener. Vary: in medias res,
quiet beat, dialogue cold open, environmental sweep, interiority.
No two consecutive chapters may use the same opener structure.
- The book's thematic contrast (whatever it is — body/mind, memory/possibility, etc.)
may appear ONCE per scene as a metaphor. Not in every paragraph. Trust the reader.
If you have used the contrast in the last two paragraphs, you may not use it again
for at least three more paragraphs.
- Do NOT label an emotion that you have already shown through action or dialogue.
If the character's hands are shaking, do not also write "she was afraid."
If the dialogue already conveys anger, do not add "his voice was furious."
- Do NOT count or reference chapter numbers in the prose.
"Five chapters of..." is an AI fingerprint. Never.
- Each character must have at least ONE verbal imperfection per scene they appear in:
a sentence they don't finish, a word they use wrong, a line that doesn't land,
a moment of fumbling before the right words come. Perfect dialogue is dead dialogue.
- Check the CHARACTER VOICE PROFILE in the outline/bible (if present) — if each
speaking character's dialogue cannot be identified as THEIRS without a speaker tag,
rewrite until it can. Verbal tics, pet phrases, and characteristic patterns are
non-negotiable signatures.
Output ONLY the draft chapter text.
Start directly with the chapter title (e.g., "Chapter N: [Title]") and opening line.
No commentary, no plan headers, no "Pass 1" label.
@@ -209,10 +249,59 @@ steps:
verbatim everywhere else). Start the chapter directly with the chapter title
and first line. No preamble or commentary within the chapter text.
- type: think
hint: |
PASS 3 -- CHARACTER + WORLD STATE EXTRACTION
You have just completed the chapter. Extract structured state for continuity tracking.
Write in compact format -- this content will be stored as a RAG asset read by the
NEXT chapter's PASS 0. Every character who appeared must have an entry.
OUTPUT FORMAT -- write this EXACTLY, filling in real values:
# Character State: {chapter_ref}
## [Character Name]
Location: [specific location -- building, floor, city, planet -- no vague "nearby"]
Physical: [injuries, fatigue, notable physical state, or "no injuries"]
Emotional: [dominant emotion at chapter end; what they are CARRYING into next chapter]
Active obligations: [debts/promises owed, format: "owes [person] [what] (Ch[N]) -- UNPAID/PAID"]
Open loops: [unresolved conflicts, unanswered questions, format: "[parties] [issue] (Ch[N]) -- UNRESOLVED/RESOLVED"]
Known secrets: [information this character has that others don't -- format: "knows [what] -- [who does NOT know]"]
Arc: [XX%] -- [one sentence: what permanently changed in this character this chapter, or "no change"]
Permanent: [YES if something permanently changed (power gained/lost, relationship status changed, secret revealed); NO otherwise]
(Repeat for EVERY named character who appeared in this chapter)
# World State: {chapter_ref}
## NPC Memory
- [NPC Name] ([faction/location]): [ATTITUDE] -- [what happened] -- [behavioral consequence]
(List every NPC who interacted with a protagonist and now has a changed attitude)
## Faction Attitudes
- [Faction name]: [current attitude toward protagonists] -- [reason]
(List any faction whose attitude changed this chapter)
## Active World Events
- [Event]: [status and expected timeline]
(List any ongoing world events that will affect future chapters)
CRITICAL: Keep the total output under 3500 characters. Be precise and specific.
Do NOT write prose -- only the structured data above.
- type: rag_write
asset_id: "character-state"
max_chars: 4000
- type: document
filename: "character-state-{chapter_ref}"
- type: document
filename: "Chapter_{chapter_number}_draft"
- type: package
max_tokens: 12000
hint: |
The draft chapter has been written, self-checked, and committed.

View File

@@ -1,4 +1,4 @@
name: book_outline
name: book_outline
description: "Boardroom debate to lock the book concept, produce a character bible (for fiction) + full chapter outline, then spawn chapter writing tasks."
debug: true
system: agent_prompt
@@ -116,10 +116,48 @@ steps:
- [Powers, systems, constraints — be precise]
- [What limits them? What are the costs?]
## Voice Signatures
(REQUIRED for fiction — this section is injected into every chapter to enforce consistent character voice.
Think carefully: these are NON-NEGOTIABLE identifiers the polisher will enforce.)
### [Protagonist name] — Voice Signature
- Curse/stress expression scale: "[mild phrase]" = minor irritation | "[mid phrase]" = upset | "[strong phrase]" = furious
- Verbal tic or sarcasm tell: [e.g., "says 'obviously' when meaning the opposite"]
- Speech pattern when excited: [e.g., "interrupts own sentences mid-thought"]
- What they REACH FOR in descriptions: [e.g., "tactile/kinesthetic — touches things to understand them"]
- What they NEVER say or do in dialogue: [e.g., "never apologizes directly — fixes things instead"]
- Sentence pattern: [e.g., "short declaratives when focused; long run-ons when arguing"]
### [Love interest name] — Voice Signature
- Formality scale (INVERSELY maps to severity): "[mild formal phrase]" = small problem | "[very formal/archaic phrase]" = disaster
- What they NEVER say: [e.g., "never says 'I think' — says 'the evidence suggests' or 'it is probable that'"]
- Superlative rule: [e.g., "never uses superlatives except for things that matter deeply — when they do, it stops the room"]
- Sentence completeness tell: [e.g., "always grammatically complete — EXCEPT when flustered by protagonist, then fragments"]
- Speech pattern: [e.g., "precise, no wasted words; anger shows through subject choice and word order, not volume"]
═══════════════════════════════════════════════
PART 2: CHAPTER OUTLINE (all projects)
═══════════════════════════════════════════════
## Factions
(REQUIRED for fantasy/speculative — define named factions so NPCs have memory chapter-to-chapter.
These entries are compiled into factions.rag.md and injected into each chapter's world state.)
### [Faction Name]
- Home location: [specific -- city, building, region, planet -- not vague]
- Leader: [name and title]
- Key NPCs: [name (role/function at this location), name (role), ...]
- Initial attitude toward protagonist: [ALLIED / NEUTRAL / WATCHFUL / HOSTILE] -- [one sentence reason]
- Initial attitude toward love interest: [same]
- What they want: [one sentence faction goal]
- What would make them hostile: [threshold / trigger]
- What would make them allied: [threshold / trigger]
(Repeat for every faction in the story -- at minimum: protagonist's school/home,
antagonist's faction, any neutral third party with named NPCs)
---
# [Book Title]
## Concept Summary
- Hook: one sentence that sells the book

View File

@@ -1,4 +1,4 @@
name: chapter_polish
name: chapter_polish
description: >
Iris applies the editorial consensus changes to the chapter. This is a bounded
correction pass, not a rewrite. Only the listed changes are applied; everything
@@ -60,6 +60,21 @@ steps:
- The authorial and character voice — do NOT normalize it
- Intentional stylistic choices, even unusual ones
- Passages the roundtable marked as STRENGTHS TO PRESERVE
- ALL verbal tics, speech patterns, and idiosyncratic constructions for every character
- Interrupted or incomplete sentences that are character voice, not errors
- "Wrong" word choices that feel authentic to a character's way of thinking
VOICE DEFENDER PASS (do this BEFORE applying any changes):
If a Character Bible or Voice Signatures section exists in the project context:
1. For each named character: read one page of their dialogue with speaker tags removed.
Can you identify the character from voice alone? If NO — note it.
2. Is there at least ONE moment per scene where a character's voice is imperfect?
(A sentence that trails off. A wrong word. Something that doesn't quite land.)
If EVERY dialogue line is quotable and polished — that is a problem. Flag it.
3. If a character's voice signature is MISSING from a scene, you may add ONE instance
of an established signature item (from the Character Bible). Do NOT invent new ones.
Do NOT add signatures that are not already established.
This voice check is SECONDARY to MUST APPLY items, but it is never skipped.
EXPLICITLY FORBIDDEN:
- Do not improve any sentence for rhythm, lyricism, or polish unless a specific MUST APPLY
@@ -68,6 +83,10 @@ steps:
- Do not expand any description or add sensory detail globally
- Do not deepen emotional beats beyond what the text already carries
- Do not add new metaphors, aphorisms, or quotable lines
- Do not make dialogue more elegant, more quotable, or more "writerly"
- Do not smooth sentence length variation — short choppy sentences and long rambling ones
are often character voice, not mistakes
- Do not remove verbal tics, repeated expressions, or idiosyncratic speech patterns
- Do not reorder scenes or restructure the chapter
- When both deletion and expansion would solve the same problem, prefer deletion
@@ -78,6 +97,25 @@ steps:
- type: document
filename: "Chapter_{chapter_number}_final"
- type: think
hint: |
PASS -- FULL MODE CHARACTER STATE EXTRACTION
The chapter has been polished and finalized. Extract the definitive character and world
state. This FULL MODE extraction overwrites any draft-mode state written earlier.
Use the same format as the draft-mode PASS 3 extraction (# Character State, # World State).
This is the CANONICAL state for this chapter -- it reflects the POLISHED final chapter.
CRITICAL: Keep total output under 3500 characters. Compact and precise.
- type: rag_write
asset_id: "character-state"
max_chars: 4000
- type: document
filename: "character-state-{chapter_ref}-final"
- type: close
rag_update: true
@@ -87,17 +125,20 @@ adjudication:
deliverable_type: consumer
criteria:
changes_applied:
weight: 35
weight: 30
description: "All MUST APPLY items from the consensus are addressed; no required changes were skipped"
preservation:
weight: 30
weight: 25
description: "Unaffected passages are preserved verbatim; voice and structure are intact"
word_count:
voice_authenticity:
weight: 20
description: "Each character can be identified by voice alone without speaker tags; verbal tics and imperfect speech are preserved, not smoothed out; no character speaks in perfect polished bon mots throughout"
word_count:
weight: 15
description: "Chapter meets the {chapter_target_words}-word minimum without artificial padding"
clarity:
weight: 10
weight: 7
description: "Corrected passages are clear and unambiguous"
formatting:
weight: 5
weight: 3
description: "Proper formatting, no artifacts"

View File

@@ -30,12 +30,16 @@ steps:
Write a detailed editorial review from your perspective.
Be specific — cite line numbers or quote passages where relevant.
Structure your review using EXACTLY these five labeled sections:
Structure your review using EXACTLY these six labeled sections:
1. STRENGTHS TO PRESERVE
List elements that are working well and must survive the editorial process unchanged.
Be specific: quote or paraphrase the passage. Vague praise ("the writing is good")
is not useful here.
ALSO CHECK: If a Character Bible or Voice Signatures section exists in the project
context, verify each named character's voice signature is present and distinct.
Can you identify each character's dialogue without speaker tags? Note whether
YES or NO for each main character.
2. MUST-FIX — CONTINUITY
List factual errors, POV breaks, timeline inconsistencies, or world-rule violations.
@@ -53,11 +57,15 @@ steps:
Craft improvements that would strengthen the chapter but are NOT required for it to
pass. Label each suggestion clearly as optional. Do not inflate this section — only
include suggestions with a clear upside and low risk of voice damage.
⚠️ Do NOT suggest adding thematic contrast metaphors, making dialogue more elegant,
or smoothing sentence variation — these are voice PRESERVATION issues, not fixes.
5. FORBIDDEN CHANGES / NON-GOALS
List things that might appear to be problems but should NOT be changed — intentional
voice choices, genre conventions, structural decisions that are working. This section
protects the draft from over-editing.
ALWAYS list here: verbal tics, repeated phrases, and "imperfect" speech that is
clearly a character signature, not an error.
6. VERDICT
One of: PASS / REVISE

View File

@@ -0,0 +1,53 @@
name: character_update
description: Update a character's static profile when permanent arc changes occur.
Triggered when PASS 3 flags Permanent=YES for a character.
Reads current character deliverable, appends arc log entry, updates changed fields,
and updates relevant RAG files if voice or magic changed.
context:
- character_name: "" # Full character name
- character_slug: "" # Slug used in deliverable filenames (e.g. mira-vasquez)
- chapter_ref: "" # Chapter that triggered this (e.g. ch-05)
- permanent_change: "" # What permanently changed, from PASS 3 output
- project_id: ""
- project_slug: ""
steps:
- type: think
hint: |
CHARACTER ARC UPDATE
A permanent change occurred for {character_name} in chapter {chapter_ref}.
Permanent change: {permanent_change}
Your tasks:
1. Read the RAG context for this character:
- Look for [character-{character_slug}] -- the static profile
- Look for [character-state] -- the current live state
- Look for [voice-signatures] -- the voice profile (if relevant)
2. Determine what needs updating:
- Append to the character's ## Arc Log: "Ch {chapter_ref}: {permanent_change}"
- If a POWER was gained or lost, update the ## Abilities section
- If a RELATIONSHIP status changed (e.g. enemies-to-allies, death),
update the ## Relationships section
- If VOICE changed (new speech patterns, trauma affecting language),
update the ## Voice Signature section AND flag voice-signatures.rag.md for update
- If MAGIC SYSTEM affinity changed, flag magic-system.rag.md for update
3. Write the updated full character profile:
- Keep all existing sections
- Only change the specific fields that changed
- Add the arc log entry
- Mark clearly at top: "Updated: Ch {chapter_ref} -- {permanent_change}"
Write the COMPLETE updated character profile now.
- type: document
filename: "character-{character_slug}"
- type: close
rag_update: true
adjudication:
enabled: false