v1.3.0: Improve all AI prompts, refinement loops, and cover generation accuracy

story.py — write_chapter():
- Added POSITION context ("Chapter N of Total") so the AI calibrates narrative
  tension correctly (setup vs escalation vs climax/payoff)
- Moved PACING_GUIDE to sit directly after PACING metadata instead of being
  buried after 13 quality criteria items where the AI rarely reads it
- Removed duplicate pacing descriptions that appeared after QUALITY_CRITERIA

story.py — refinement loop:
- Capped critique history to last 2 entries (was accumulating all previous
  attempts, wasting tokens and confusing the model on attempt 4-5)
- Added TARGET_WORDS and BEATS constraints to the refinement prompt to prevent
  chapters from shrinking or losing plot beats during editing passes
- Restructured refinement prompt with explicit HARD_CONSTRAINTS section

story.py — check_and_propagate():
- Increased chapter context from 5000 to 12000 chars for continuity rewrites
  (was asking for a full chapter rewrite but only providing a fragment)
- Added explicit word count target to rewrite so chapters are not truncated
- Added conservative decision bias: only rewrite on genuine contradictions

story.py — plan_structure():
- Now passes TARGET_CHAPTERS, TARGET_WORDS, GENRE, and CHARACTERS to the
  structure AI — it was planning blindly without knowing the book's scale

marketing.py — generate_blurb():
- Rewrote prompt with 4-part structure: Hook → Stakes → Tension → Close
- Formats plot beats as a readable list instead of raw JSON array
- Extracts protagonist automatically for personalised blurb copy
- Added genre-tone matching, present-tense voice, and no-spoiler rule

marketing.py — generate_cover():
- Added genre-to-visual-style mapping (thriller → cinematic, fantasy → epic
  digital painting, romance → painterly, etc.)
- Art prompt instructions now enforce: no text/letters/watermarks, rule-of-thirds
  composition, explicit focal point, lighting description, colour palette
- Replaced generic image evaluation with a 5-criteria book-cover rubric:
  visual impact, genre fit, composition, quality, and clean image (no text)
- Score penalties: -3 for visible text/watermarks, -2 for blur/deformed anatomy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-20 10:38:36 -05:00
parent 2a9a605800
commit 1964c9c2a5
3 changed files with 179 additions and 89 deletions

View File

@@ -65,4 +65,4 @@ LENGTH_DEFINITIONS = {
}
# --- SYSTEM ---
VERSION = "1.2.0"
VERSION = "1.3.0"