Skip to content

fix(reader_panel): remove hardcoded novel-specific content from prompt#8

Open
amethystani wants to merge 1 commit intoNousResearch:masterfrom
amethystani:fix/reader-panel-hardcoded-novel-content
Open

fix(reader_panel): remove hardcoded novel-specific content from prompt#8
amethystani wants to merge 1 commit intoNousResearch:masterfrom
amethystani:fix/reader-panel-hardcoded-novel-content

Conversation

@amethystani
Copy link
Copy Markdown

Problem

reader_panel.py had several values hardcoded to a specific novel (the original demo novel) that break the pipeline for anyone using their own project:

  • Word count: 72,422 baked into the prompt header
  • Chapter count: 24 baked into the prompt header
  • Character name: "Does Cass's choice in Ch 22 land?" — specific to the original author's story
  • Cut word target: ~7,000 words derived from the hardcoded word count
  • Genre assumption: "complete fantasy novel" in the prompt header

This is the issue raised in #7.

Fix

  • Add _load_novel_stats() to compute word count and chapter count at runtime by reading chapters/*.md files, with a fallback to state.json when chapters haven't been generated yet
  • Add _build_prompt() that injects the computed stats into the prompt template, omitting the stats line cleanly when no data is available
  • Replace the character-specific earned_ending question with a generic formulation that works for any novel
  • Derive the 10% cut hint from actual word count instead of a hardcoded number
  • Change "complete fantasy novel" to "complete novel" so the pipeline is genre-agnostic

Result

When chapter files exist, the prompt reads actual word and chapter counts from disk. When running before drafting (e.g. evaluating an outline-stage arc summary), the stats line is omitted cleanly. No novel-specific names or numbers leak into other users' projects.

Closes #7

reader_panel.py had the word count (72,422), chapter count (24), and a
specific character name ("Cass's choice in Ch 22") baked into the
READER_PROMPT string. This broke the pipeline for any novel other than
the original demo novel.

Changes:
- Replace hardcoded word/chapter counts with values computed at runtime
  from the chapters/ directory (*.md files) and state.json fallback
- Remove the character-specific earned_ending question; replace with a
  generic formulation that works for any novel
- Remove hardcoded "~7,000 words" cut hint; derive it from actual word
  count instead
- Drop "fantasy" from the prompt header so the pipeline works for all
  genres

Closes NousResearch#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Master has a lot of the bells novel "baked in"

1 participant