feat: GM Workbench session prep sheet — first async/polling tool (#158) #221
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/158-session-prep"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The highest-differentiation Workbench tool (per the planning report): it reads this campaign's state — the upcoming session's beat notes, recent session summaries, open plot threads, and the wiki — to draft a structured prep sheet no generic generator can replicate. Prose-heavy + multi-source, so it's the first tool to run async via the #136 Celery path, with the frontend polling for the result.
Backend
session_prepToolDef (sync_allowed=False):SessionPrepParams(session_id)(str/UUID-validated so it round-trips throughrow.paramsto the Celery worker); context builders forbeat_notes+recent_sessions_context+threads_context+lore_context; tolerant parser →{strong_start, scenes[], secrets_and_clues[], npcs[{name,note}], loose_ends[]}.GET /workbench/history/{result_id}— the single-result polling primitive for async tools (reuses the existing owned-result guard; GM-only).Frontend
SessionPrepGeneratorpanel: pick an upcoming session → generate (returnspending) → pollfetchWorkbenchResultuntilready/failed→ render the sheet, linking any NPC whose name matches a wiki entry. Save via append-or-replace intobeat_notes(existing PATCH) after explicit GM review — never auto-writes (meets the "never overwrite GM notes" criterion).fetchWorkbenchResultusescache: false— the shared client's 15s GET dedup cache would otherwise serve the stalependingbody to every poll and the transition would never be observed.Notes
beat_notes.run_workbench_generation_core) already existed (#136/#138); this is the first tool to exercise it end to end.Verification (Docker)
test_workbench_session_prep.py— async core + beat-notes grounding, pending dispatch/enqueue, 422, GM-only, single-result GET 200/404, parser tolerance)ruff check+ruff format --checkclean; eslint 0 errorsCloses #158.