[GM Workbench] Plot hook & rumor generator (B1) #144

Closed
opened 2026-07-15 22:02:35 +00:00 by claude-bot · 2 comments
Contributor

Motivation / Context

The report ranks lore-grounded rumors (B1) among the highest-differentiation Workbench tools, second only to the session prep sheet: "not any single generator... the moat is campaign-grounded generation inside the workflow" (§6). A rumor mill that only knows generic fantasy tropes is a commodity (donjon/Perchance already do that); one that reads this campaign's lore and open plot threads and produces true/false/distorted hooks that dovetail into the plot-thread tracker is the differentiator. It's also, alongside the description generator (issue 4, #141), one of the two highest value-to-effort tools with zero overlap risk against existing issues.

Tagged TT in the report — it can ride v3.7.0 Table Tools alongside the rest of the recording→recap→wiki→table pipeline instead of waiting on the full GM Workbench milestone, since its only hard dependency is the Phase 0 foundation.

Approach

  • Register a rumor/plot_hook tool in the GENERATOR_TOOLS registry (generation_service.py, #136).
  • Inputs: N (count), selected lore entries (optional), game_system. Context assembled via lore_context(db, campaign_id, entry_ids=..., limit=...) and threads_context(db, campaign_id) (both from #136's context-builder set, §5.3) — pulling in open PlotThreads and arc statuses so hooks are grounded in what's actually unresolved in the campaign, not generic filler.
  • Output: N rumors/hooks, each tagged true / false / distorted, via generate_structured_text in JSON mode. Small output → runs inline (sync_allowed=True).
  • Output landing: written to GenerationResult (scratch, #138) by default. One-click "add as PlotThread" creates a PlotThread row (GM-private by default, matching how PlotThread CRUD already works, campaigns.py:3322-3390). This is deliberately generic — it does not target the player-visible quest concept.

Dependencies

  • #134 (LLM core extraction), #136 (workbench endpoint + tool registry + context builders), #138 (scratchpad) — the Phase 0 foundation this tool is built on, per the report's 1→2→3 chain.
  • Dovetails with #115 (player-visible quest log): #115 adds status and player_visible fields to PlotThread. This tool's "add as PlotThread" always creates a GM-private thread (player_visible=false if #115 has landed, or simply the pre-#115 shape otherwise); once #115 ships, a GM can promote a rumor-generated thread to player-visible from the existing thread UI. No coupling required in either direction — this issue does not need #115 to ship first, and does not modify #115's schema.

Out of scope

  • Any change to PlotThread's schema (status/visibility fields) — owned entirely by #115.
  • Automatic promotion of generated hooks to player-visible quests — always requires an explicit GM action via the existing thread UI.
  • Shop/tavern rumors (A5) — a separate, later Workbench tool that happens to also produce rumor-shaped text but is scoped to a specific establishment; not built here.

Acceptance criteria

  • rumor tool registered and reachable via POST /api/campaigns/{campaign_id}/workbench/rumor/generate, GM-only.
  • Given a count and optional lore-entry selection, returns that many hooks, each tagged true/false/distorted.
  • Generated hooks visibly reference selected lore entries and/or open plot threads (not generic fantasy filler) when context is provided.
  • Result appears in GenerationResult history.
  • "Add as PlotThread" creates a new PlotThread row correctly linked to the campaign, GM-private by default.
## Motivation / Context The report ranks lore-grounded rumors (B1) among the highest-differentiation Workbench tools, second only to the session prep sheet: "not any single generator... the moat is campaign-grounded generation inside the workflow" (§6). A rumor mill that only knows generic fantasy tropes is a commodity (donjon/Perchance already do that); one that reads *this campaign's* lore and open plot threads and produces true/false/distorted hooks that dovetail into the plot-thread tracker is the differentiator. It's also, alongside the description generator (issue 4, #141), one of the two highest value-to-effort tools with zero overlap risk against existing issues. Tagged **TT** in the report — it can ride v3.7.0 Table Tools alongside the rest of the recording→recap→wiki→table pipeline instead of waiting on the full GM Workbench milestone, since its only hard dependency is the Phase 0 foundation. ## Approach - Register a `rumor`/`plot_hook` tool in the `GENERATOR_TOOLS` registry (`generation_service.py`, #136). - **Inputs**: N (count), selected lore entries (optional), `game_system`. Context assembled via `lore_context(db, campaign_id, entry_ids=..., limit=...)` and `threads_context(db, campaign_id)` (both from #136's context-builder set, §5.3) — pulling in open `PlotThread`s and arc statuses so hooks are grounded in what's actually unresolved in the campaign, not generic filler. - **Output**: N rumors/hooks, each tagged `true` / `false` / `distorted`, via `generate_structured_text` in JSON mode. Small output → runs inline (`sync_allowed=True`). - **Output landing**: written to `GenerationResult` (scratch, #138) by default. One-click **"add as PlotThread"** creates a `PlotThread` row (GM-private by default, matching how `PlotThread` CRUD already works, `campaigns.py:3322-3390`). This is deliberately generic — it does not target the player-visible quest concept. ## Dependencies - **#134** (LLM core extraction), **#136** (workbench endpoint + tool registry + context builders), **#138** (scratchpad) — the Phase 0 foundation this tool is built on, per the report's 1→2→3 chain. - **Dovetails with #115** (player-visible quest log): #115 adds `status` and `player_visible` fields to `PlotThread`. This tool's "add as PlotThread" always creates a GM-private thread (`player_visible=false` if #115 has landed, or simply the pre-#115 shape otherwise); once #115 ships, a GM can promote a rumor-generated thread to player-visible from the existing thread UI. No coupling required in either direction — this issue does not need #115 to ship first, and does not modify #115's schema. ## Out of scope - Any change to `PlotThread`'s schema (status/visibility fields) — owned entirely by #115. - Automatic promotion of generated hooks to player-visible quests — always requires an explicit GM action via the existing thread UI. - Shop/tavern rumors (A5) — a separate, later Workbench tool that happens to also produce rumor-shaped text but is scoped to a specific establishment; not built here. ## Acceptance criteria - `rumor` tool registered and reachable via `POST /api/campaigns/{campaign_id}/workbench/rumor/generate`, GM-only. - Given a count and optional lore-entry selection, returns that many hooks, each tagged true/false/distorted. - Generated hooks visibly reference selected lore entries and/or open plot threads (not generic fantasy filler) when context is provided. - Result appears in `GenerationResult` history. - "Add as PlotThread" creates a new `PlotThread` row correctly linked to the campaign, GM-private by default.
Author
Contributor

Moved from v3.7.0 Table Toolsv3.10.0 GM Workbench (2026-07-18).

Rationale: although tagged TT (rideable on v3.7.0), this issue's hard dependency is the Phase 0 Workbench foundation — #134 (LLM-core extraction), #136 (workbench endpoint + GENERATOR_TOOLS registry + context builders lore_context/threads_context), #138 (GenerationResult scratchpad) — none of which exist in the code yet, and all of which live in v3.10.0. Rather than build this as a throwaway standalone generator and re-home it into the registry later (rework), it will ride with the Workbench foundation as originally designed. Decision made while completing the rest of v3.7.0 (loot #112, quest log #115, quote board #116, attendance #114, title suggestions #23 all shipped; #130 + #110 remain and are being built now).

Moved from **v3.7.0 Table Tools** → **v3.10.0 GM Workbench** (2026-07-18). Rationale: although tagged TT (rideable on v3.7.0), this issue's hard dependency is the **Phase 0 Workbench foundation — #134 (LLM-core extraction), #136 (workbench endpoint + `GENERATOR_TOOLS` registry + context builders `lore_context`/`threads_context`), #138 (`GenerationResult` scratchpad)** — none of which exist in the code yet, and all of which live in v3.10.0. Rather than build this as a throwaway standalone generator and re-home it into the registry later (rework), it will ride with the Workbench foundation as originally designed. Decision made while completing the rest of v3.7.0 (loot #112, quest log #115, quote board #116, attendance #114, title suggestions #23 all shipped; #130 + #110 remain and are being built now).
Author
Contributor

Done — merged to feat/v3.10-gm-workbench via PR #220 (batched with #147 + #149, which share generation_service.py).

rumor tool registered on the #136 engine: a batch of hooks each tagged true/false/distorted, grounded in the campaign's open plot threads (threads_context) + any picked wiki lore, persisting a GenerationResult (#138). Frontend RumorGenerator panel on the GM-gated planning page; "Add as plot thread" creates a rumored, player_visible=false PlotThread via the existing createThread endpoint (#115 shipped, so the GM can later promote it). Tolerant parser (never raises). No new API/models/migrations.

Verified: backend 712 passed (incl. new test_workbench_rumor.py — happy path, 422, GM-only 403, parser tolerance), frontend 372 passed, ruff + eslint clean.

Done — merged to `feat/v3.10-gm-workbench` via PR #220 (batched with #147 + #149, which share `generation_service.py`). `rumor` tool registered on the #136 engine: a batch of hooks each tagged **true/false/distorted**, grounded in the campaign's open plot threads (`threads_context`) + any picked wiki lore, persisting a `GenerationResult` (#138). Frontend `RumorGenerator` panel on the GM-gated planning page; **"Add as plot thread"** creates a `rumored`, `player_visible=false` `PlotThread` via the existing `createThread` endpoint (#115 shipped, so the GM can later promote it). Tolerant parser (never raises). No new API/models/migrations. Verified: backend 712 passed (incl. new `test_workbench_rumor.py` — happy path, 422, GM-only 403, parser tolerance), frontend 372 passed, ruff + eslint clean.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Quest-Board#144
No description provided.