Cleanup after #1257: remove audio_service.generate_name_options, and keep only names runs that were used #1345

Closed
opened 2026-11-06 01:34:08 +00:00 by claude-bot · 1 comment
Collaborator

Two leftovers from the built-in name generator (#1257, 4.7.0). Neither is visible to users.

  1. audio_service.generate_name_options was the AI path behind Prep's old Names drawer. Since #1257, Prep draws from the built-in engine (app/names/), and "Describe" is the only AI path left. Find the remaining callers and tests, remove the function and anything that only it used, and make sure no route or task still reaches it.
  2. Names runs: keep only the runs that were used, meaning a name was saved to the wiki or copied. Today every draw is kept. Prune unused runs after a short window, and leave name_offers alone: it's the campaign's "never offer the same name twice" memory and must outlive the runs. Check first whether that table alone gives "never twice", or whether a run is needed for it, and write down what was found.

Tests for both. A migration only if (2) needs one.

Two leftovers from the built-in name generator (#1257, 4.7.0). Neither is visible to users. 1. **`audio_service.generate_name_options`** was the AI path behind Prep's old Names drawer. Since #1257, Prep draws from the built-in engine (`app/names/`), and "Describe" is the only AI path left. Find the remaining callers and tests, remove the function and anything that only it used, and make sure no route or task still reaches it. 2. **Names runs:** keep only the runs that were used, meaning a name was saved to the wiki or copied. Today every draw is kept. Prune unused runs after a short window, and leave `name_offers` alone: it's the campaign's "never offer the same name twice" memory and must outlive the runs. Check first whether that table alone gives "never twice", or whether a run is needed for it, and write down what was found. Tests for both. A migration only if (2) needs one.
Author
Collaborator

Findings for #1345.

1. Old AI names code. audio_service.generate_name_options had no caller outside tests: the session route POST /sessions/{id}/name-options/generate (its handler shares the name) runs the names Workbench tool, which draws from app/names/ through name_service.draw. Prep's Names drawer uses that, and Describe uses name_service.describe, which does not touch what was removed. Removed: the function, _NAME_CATEGORY_DESCRIPTION_HINTS, _NAME_CATEGORY_DESCRIPTION_HINTS_BY_SYSTEM, _NAME_GENERATOR_SYSTEM_PROMPT, the three pf2e/free-form/dnd5e hint tests, and the generate_name_options half of test_names_sends_its_schema. Kept: NAME_OPTIONS_SCHEMA (the names tool's output schema, used by generation_service).

2. Names runs. A "names run" is a generation_results row with tool_id='names'. Every draw is persisted (sheet route and Planning both go through run_and_record), plus one name_offers row per name. The old retention kept an unused run for 30 days. A draw reads name_offers and the wiki titles and aliases (name_service.excluded_keys), never generation_results, so name_offers alone gives "never twice" and is untouched.

Signals for "used": a run in a prep sheet or For later (kept_clause, "Keep it") was already recorded. Saving to the wiki records no link to the run (Planning calls createLoreEntry, a sheet calls canonical-names), and "copied" is client-only, recorded nowhere. So a run counts as used when kept_clause holds it, or one of its names (compared by name_key) is now a live wiki page title or alias in the same campaign. Copying does not count.

Done: generation_result_service.delete_unused_names_runs (24 h), called from the existing daily prune_generation_results task. No migration.

Findings for #1345. **1. Old AI names code.** `audio_service.generate_name_options` had no caller outside tests: the session route `POST /sessions/{id}/name-options/generate` (its handler shares the name) runs the `names` Workbench tool, which draws from `app/names/` through `name_service.draw`. Prep's Names drawer uses that, and Describe uses `name_service.describe`, which does not touch what was removed. Removed: the function, `_NAME_CATEGORY_DESCRIPTION_HINTS`, `_NAME_CATEGORY_DESCRIPTION_HINTS_BY_SYSTEM`, `_NAME_GENERATOR_SYSTEM_PROMPT`, the three pf2e/free-form/dnd5e hint tests, and the `generate_name_options` half of `test_names_sends_its_schema`. Kept: `NAME_OPTIONS_SCHEMA` (the `names` tool's output schema, used by `generation_service`). **2. Names runs.** A "names run" is a `generation_results` row with `tool_id='names'`. Every draw is persisted (sheet route and Planning both go through `run_and_record`), plus one `name_offers` row per name. The old retention kept an unused run for 30 days. A draw reads `name_offers` and the wiki titles and aliases (`name_service.excluded_keys`), never `generation_results`, so `name_offers` alone gives "never twice" and is untouched. Signals for "used": a run in a prep sheet or For later (`kept_clause`, "Keep it") was already recorded. Saving to the wiki records no link to the run (Planning calls `createLoreEntry`, a sheet calls `canonical-names`), and "copied" is client-only, recorded nowhere. So a run counts as used when `kept_clause` holds it, or one of its names (compared by `name_key`) is now a live wiki page title or alias in the same campaign. Copying does not count. Done: `generation_result_service.delete_unused_names_runs` (24 h), called from the existing daily `prune_generation_results` task. No migration.
rbrooks referenced this issue from a commit 2026-11-06 10:16:43 +00:00
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#1345
No description provided.