[GM Workbench] Random table generator (B3) #147
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Motivation / Context
GMs frequently want a quick dN table for an arbitrary prompt — "complications in the sewers," "what's in the noble's pocket" — the kind of improv aid classic GM toolkits (donjon, random-table books) provide but nothing in Quest Board does today. Per the report's catalog (§3, Group B), this is a commodity generator (table-stakes, not a hosted-service differentiator by itself) but cheap to ship once the tool registry exists, and its output — a reusable
document-type lore entry — plugs directly into the existing wiki so tables survive across sessions instead of living in a GM's notes app.Approach
random_tabletool inGENERATOR_TOOLS(generation_service.py, #136).lore_contextfrom #136's context builders when the GM wants the table to reference specific entries — e.g. "rumors heard at the Salt Griffin," grounded in that tavern's lore entry).generate_structured_textin JSON mode — structured as{die_size, entries: [{roll, text}]}. Small/fast output → runs inline (sync_allowed=True), same pattern as names.GenerationResult(scratch, #138) by default; "Save as lore entry" creates aLoreEntrywithLoreType.document(per §3's "Output lands" column) so tables are browsable and reusable at the table via the wiki, rendered as a markdown table inbody.Dependencies
Out of scope
Acceptance criteria
random_tabletool registered and reachable viaPOST /api/campaigns/{campaign_id}/workbench/random_table/generate, GM-only.GenerationResulthistory.LoreEntrywithentry_type=documentcontaining the table.Done — merged to
feat/v3.10-gm-workbenchvia PR #220 (batched with #144 + #149).random_tabletool registered on the #136 engine: a d6/d12/d20 roll table for any prompt (die size restricted to 6/12/20), optionally lore-grounded, persisting aGenerationResult(#138). FrontendRandomTableGeneratorrenders the table and reuses the sharedWorkbenchResultActionsbar — "Save as lore entry" withentry_type=documentand a rendered markdown table as the body. Tolerant parser renumbers rolls 1..n and truncates to die size. No new API/models/migrations.Verified: backend 712 passed (incl.
test_workbench_random_table.py), frontend 372 passed, ruff + eslint clean.