Strengthened writing.

This commit is contained in:
2026-02-05 22:26:55 -05:00
parent e6110a6a54
commit 7e5dbe6f00
7 changed files with 577 additions and 350 deletions

View File

@@ -350,9 +350,10 @@ def rewrite_chapter_task(run_id, project_path, book_folder, chap_num, instructio
ai.init_models()
new_text = story.rewrite_chapter_content(bp, ms, chap_num, instruction, book_path)
result = story.rewrite_chapter_content(bp, ms, chap_num, instruction, book_path)
if new_text:
if result and result[0]:
new_text, summary = result
for ch in ms:
if ch.get('num') == chap_num:
ch['content'] = new_text
@@ -361,7 +362,7 @@ def rewrite_chapter_task(run_id, project_path, book_folder, chap_num, instructio
# Save the primary rewrite immediately
with open(ms_path, 'w') as f: json.dump(ms, f, indent=2)
updated_ms = story.check_and_propagate(bp, ms, chap_num, book_path)
updated_ms = story.check_and_propagate(bp, ms, chap_num, book_path, change_summary=summary)
if updated_ms:
ms = updated_ms