Blueprint v2.4-2.6: Style Rules UI, Lore RAG, Thread Tracking, Redo Book
v2.4 — Item 7: Refresh Style Guidelines - web/routes/admin.py: Added /admin/refresh-style-guidelines route (AJAX-aware) - templates/system_status.html: Added 'Refresh Style Rules' button with spinner v2.5 — Item 8: Lore & Location RAG-Lite - story/bible_tracker.py: Added update_lore_index() — extracts location/item descriptions from chapters into tracking_lore.json - story/writer.py: Reads chapter locations/key_items, builds LORE_CONTEXT block injected into the prompt (graceful degradation if no tags) - cli/engine.py: Loads tracking_lore.json on resume, calls update_lore_index after each chapter, saves tracking_lore.json v2.5 — Item 9: Structured Story State (Thread Tracking) - story/state.py (new): load_story_state, update_story_state (extracts active_threads, immediate_handoff, resolved_threads via model_logic), format_for_prompt (structured context replacing the prev_sum blob) - cli/engine.py: Loads story_state.json on resume, uses format_for_prompt as summary_ctx for write_chapter, updates state after each chapter accepted v2.6 — Item 10: Redo Book - templates/consistency_report.html: Added 'Redo Book' form with instruction input and confirmation dialog - web/routes/run.py: Added revise_book route — creates new Run, queues generate_book_task with user instruction as feedback Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -213,6 +213,27 @@ def optimize_models():
|
||||
return redirect(request.referrer or url_for('project.index'))
|
||||
|
||||
|
||||
@admin_bp.route('/admin/refresh-style-guidelines', methods=['POST'])
|
||||
@login_required
|
||||
@admin_required
|
||||
def refresh_style_guidelines_route():
|
||||
is_ajax = request.headers.get('X-Requested-With') == 'XMLHttpRequest'
|
||||
try:
|
||||
if not ai_models.model_logic:
|
||||
raise Exception("No AI model available. Run 'Refresh & Optimize' first.")
|
||||
new_data = style_persona.refresh_style_guidelines(ai_models.model_logic)
|
||||
msg = f"Style Guidelines updated — {len(new_data.get('ai_isms', []))} AI-isms, {len(new_data.get('filter_words', []))} filter words."
|
||||
utils.log("SYSTEM", msg)
|
||||
if is_ajax:
|
||||
return jsonify({'status': 'ok', 'message': msg})
|
||||
flash(msg)
|
||||
except Exception as e:
|
||||
if is_ajax:
|
||||
return jsonify({'status': 'error', 'message': str(e)}), 500
|
||||
flash(f"Error refreshing style guidelines: {e}")
|
||||
return redirect(request.referrer or url_for('admin.system_status'))
|
||||
|
||||
|
||||
@admin_bp.route('/system/status')
|
||||
@login_required
|
||||
def system_status():
|
||||
|
||||
Reference in New Issue
Block a user