feat: GM Workbench read-aloud description generator (#141) #219

Merged
claude-bot merged 1 commit from feat/141-description-generator into feat/v3.10-gm-workbench 2026-07-19 16:04:35 +00:00
Contributor

First generic-path GM Workbench tool, and the reusable result-landing action bar the next five generators reuse.

What

  • description generator — read-aloud one-liner + paragraph, tone-aware, optionally grounded in a picked lore entry. Runs through the generic POST …/workbench/{tool_id}/generate engine (#136), persisting a GenerationResult (#138).
  • WorkbenchResultActions (reusable) — the result-landing bar every later tool reuses:
    • Save as lore entry → reuses the existing lore-create endpoint with a tool's {entry_type, title, body} output.
    • Append to entryPOST /lore/{entry_id}/append-draft creates a READY review draft (no LLM call) seeded with existing body + text, reviewable/editable/approvable in WikiDraftReview. GM-only, one draft per entry (409 otherwise).
    • Copy to clipboard.
  • Params threading — context builders now receive params, so entry-scoped tools can fold the picked lore entry into the prompt.

Verification (Docker)

  • Backend: 694 passed (incl. new test_workbench_description.py)
  • Frontend: 353 passed / 35 files; production build OK
  • ruff check + ruff format --check clean; eslint 0 errors

Notes

  • Two test-only bugs fixed during verification: the GM-only test hit the shared get_current_user override collision (requesting both gm_client+player_client in one test) — reseeded the entry via db and dropped gm_client; and the clipboard spy is now installed after userEvent.setup() (which attaches its own clipboard stub) via defineProperty (jsdom's navigator.clipboard is getter-only).
  • No bot API surface touched — no BOT_CONTRACT_VERSION bump.

Closes #141.

First generic-path GM Workbench tool, and the reusable result-landing action bar the next five generators reuse. ## What - **`description` generator** — read-aloud one-liner + paragraph, tone-aware, optionally grounded in a picked lore entry. Runs through the generic `POST …/workbench/{tool_id}/generate` engine (#136), persisting a `GenerationResult` (#138). - **`WorkbenchResultActions`** (reusable) — the result-landing bar every later tool reuses: - **Save as lore entry** → reuses the existing lore-create endpoint with a tool's `{entry_type, title, body}` output. - **Append to entry** → `POST /lore/{entry_id}/append-draft` creates a **READY** review draft (no LLM call) seeded with `existing body + text`, reviewable/editable/approvable in `WikiDraftReview`. **GM-only**, one draft per entry (409 otherwise). - **Copy to clipboard.** - **Params threading** — context builders now receive `params`, so entry-scoped tools can fold the picked lore entry into the prompt. ## Verification (Docker) - Backend: **694 passed** (incl. new `test_workbench_description.py`) - Frontend: **353 passed** / 35 files; production build OK - `ruff check` + `ruff format --check` clean; eslint 0 errors ## Notes - Two test-only bugs fixed during verification: the GM-only test hit the shared `get_current_user` override collision (requesting both `gm_client`+`player_client` in one test) — reseeded the entry via `db` and dropped `gm_client`; and the clipboard spy is now installed after `userEvent.setup()` (which attaches its own clipboard stub) via `defineProperty` (jsdom's `navigator.clipboard` is getter-only). - No bot API surface touched — no `BOT_CONTRACT_VERSION` bump. Closes #141.
First generic-path GM Workbench tool. Adds the `description` generator
(read-aloud one-liner + paragraph, tone-aware, optionally grounded in a
lore entry) plus the reusable result-landing actions every later generator
reuses:

- Save as lore entry (reuses the lore-create endpoint)
- Append to entry — POST /lore/{entry_id}/append-draft creates a READY
  review draft (no LLM call) reviewable/approvable in the wiki draft rail;
  GM-only, one draft per entry
- Copy to clipboard

Threads generation params into the context builders so entry-scoped tools
can fold the picked lore entry into the prompt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
claude-bot merged commit 3c7c30079f into feat/v3.10-gm-workbench 2026-07-19 16:04:35 +00:00
claude-bot deleted branch feat/141-description-generator 2026-07-19 16:04:35 +00:00
Sign in to join this conversation.
No description provided.