- /turn_text and /turn_images endpoints expose the two-phase turn to the client;
/turn kept for the composed path.
- /session_info: cheap peek for the 'Continue' button (no GPU, no model validation).
- /resume: restores the persisted session with painter + TTS.
- /start and /start_text accept player_name and pass it to SetupForm.
- ModalLLM.warmup() called at server start to pre-heat the GPU container.
- TRANSFORMERS_VERBOSITY=error set before any transformers import to silence
advisory messages that bypass stdlib logging.
- Frontend: sendTurn() calls /turn_text then /turn_images so dialogue appears first.
- renderText() handles the fast phase (dialogue + music + notifications only).
- 'Continue last story' button shown when session_info reports an unfinished session.
- Player name field on the setup screen.
- 'Back to main menu' button in the settings overlay resets all UI state.
- _vae_kwargs(): loads madebyollin/sdxl-vae-fp16-fix instead of upcast_vae() to
avoid the per-render fp32 upcast and its associated FutureWarning.
- PainterBase._remove_bg(): reuses one rembg ONNX session per process; previously
remove() without a session reloaded the ~170MB u2net model on every sprite call.
- Remove _quiet_stderr / _safe_print duplicates now living in utils.py.
- modal_app.py: same VAE and rembg session fixes applied to the Modal backend;
scaledown_window raised to 600s to avoid mid-session GGUF reload.
feat(engine): split play_turn into text+image phases, add resume and session_info
- play_turn_text(): STT + LLM + state mutation, returns text-only ViewState so
dialogue appears before the slower painter/TTS phase.
- play_turn_images(): painter + TTS; recovers pending turn from disk so ZeroGPU
can dispatch the two phases to different GPU workers.
- play_turn() kept as a composed single-call path (smoke tests / MVP UI).
- _text_view() extracted from start_text() and reused across all three paths.
- resume(): restores the session persisted on disk and rebuilds the history list
with display names so the frontend journal can be replayed.
- session_info(): cheap file-read peek (no GPU needed) for the 'Continue' button.
- _save_state() and _load_state() extended to carry pending notifications across
worker restarts.
- Anti-repetition guard: if the generated line is a near-verbatim copy of a recent
turn (SequenceMatcher >= 0.95), one hotter retry is issued with the forbidden line
quoted. A failed retry keeps the first output rather than crashing.
- Error fallback: any exception in the main LLM call returns a bland in-fiction line
instead of propagating to the frontend.
- scout action routes to scout_schema() (new_character required by grammar); when
the stage is full it downgrades to 'scout_full' with the normal schema.
- _repair() now normalises a newcomer's speaker id and fills default traits/appearance
for under-specified new characters; clips runaway generated fields via clip_words.
- compact_memory() uses the player name in the blob, raises max_tokens to 320, and
defends against <think> text polluting the rolling summary via strip_think().
- new_character processing moved to the top of apply_directives so a newly arriving
character can be this turn's speaker (mood/relationship update otherwise skipped).
- Milestone-50 one-shot: arms a 'pending' flag so memory.py can inject the hint
exactly once, then retires it to 'done'.
- remember_fact: appends the director's learned fact to the speaker's known_facts
list (capped at 8, oldest dropped).
- Beat guard: advance_beat ignored when the current beat started fewer than 4 turns
ago, preventing the model from sprinting opening -> resolution in a handful of turns.
- beat_started_turn stored in flags to feed the pacing nudge in memory.py.
- _fit_to_budget() replaces _trim_to_budget(): drops oldest RECENT EXCHANGE lines
first rather than slicing the whole context from the tail.
- assemble_context() accepts action_note and injects it outside the player's quoted
line to keep the model from reading directives as player speech.
- Milestone-50 special-moment hint: fires once per character when affection >= 50.
- Pacing nudge: injected after 7+ turns in the same beat to prompt advance_beat.
- _INTERNAL_FLAGS / _INTERNAL_PREFIXES: scrub engine flags from the FACTS line so
the model never sees implementation details like current_music or milestone50_.
- should_compact() now triggers at 2*RECENT_TURNS_K (meaningful chunk per call).
feat(prompts): force grammar fields, scout_schema, action_note, lru_cache
- directive_schema() now marks emotion and relationship_delta as required so small
models cannot omit them (they default to neutral/0 otherwise).
- scout_schema(): variant where new_character is required and non-nullable, enforcing
an introduction via the grammar rather than relying on prompt instructions alone.
- action_note() replaces format_player_turn() - the director note is now injected
outside the player's quoted line so the model reads it as an instruction.
- scout_full action note for the stage-full fallback path.
- lru_cache on directive_schema / scout_schema / init_schema (immutable, regenerating
them every turn was wasted work).
- Expanded director rules: per-turn relationship_delta guidance, emotion variety,
beat-advance guidance, remember_fact instruction.
- Directives.remember_fact: lets the director store a short third-person note
about something the player revealed this turn.
- ViewState.history: populated by Engine.resume() so the frontend can rebuild
the journal after reconnecting.
- config.IMAGE_VAE: env-var for the fp16-safe SDXL VAE (default madebyollin/sdxl-vae-fp16-fix)
to avoid the per-render fp32 upcast overhead.
- Remove COMPACT_EVERY (replaced by the 2*RECENT_TURNS_K trigger in memory.py).
- Add _hf_gen_kwargs to map complete() kwargs to transformers generate() correctly
(greedy vs sampled) so temperature/top_p actually apply.
- Repair max_tokens-truncated JSON in LlamaCppLLM.complete_json via close_truncated_json.
- Add ModalLLM.warmup() to pre-heat the GPU container before the first player turn.
- Gate complete/complete_json trace logs behind config.DEBUG to reduce noise.
- Remove duplicated helpers now living in utils.py.
refactor(utils): extract shared helpers into visualnovel/utils.py
Move _quiet_stderr, _safe_print, strip_think, clip_words, and close_truncated_json
out of llm.py and painter.py into a new utils.py module so every backend can share
them without circular imports.
commit 4f1ad091911892a6bdd7a75c58d9233e72b9af15
Author: SupPepper <99681586+LorenzoLepoivre@users.noreply.github.com>
Date: Sun Jun 7 20:22:40 2026 +0200
Update index.html
commit 7a4b04691d4364fd8de0d82ab15d2e81a3374815
Author: SupPepper <99681586+LorenzoLepoivre@users.noreply.github.com>
Date: Sun Jun 7 19:30:33 2026 +0200
save to test