fix(reader_panel): remove hardcoded novel-specific content from prompt#8
Open
amethystani wants to merge 1 commit intoNousResearch:masterfrom
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
reader_panel.pyhad several values hardcoded to a specific novel (the original demo novel) that break the pipeline for anyone using their own project:72,422baked into the prompt header24baked into the prompt header"Does Cass's choice in Ch 22 land?"— specific to the original author's story~7,000 wordsderived from the hardcoded word count"complete fantasy novel"in the prompt headerThis is the issue raised in #7.
Fix
_load_novel_stats()to compute word count and chapter count at runtime by readingchapters/*.mdfiles, with a fallback tostate.jsonwhen chapters haven't been generated yet_build_prompt()that injects the computed stats into the prompt template, omitting the stats line cleanly when no data is availableearned_endingquestion with a generic formulation that works for any novel"complete fantasy novel"to"complete novel"so the pipeline is genre-agnosticResult
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