feat: opt-in stat conversion wizard (backend + frontend) (#145) #211
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/145-conversion-wizard"
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 final issue of the v3.9.0 Game-Aware Systems pillar. Targets the integration branch. Builds on #139 + #140 (+ #135, #142). Backend + frontend in two commits.
Closes #145.
What
A GM-driven, fully reversible wizard that backfills structured
statsonto existing NPC/creature entries by LLM-mapping their existing free-form data — append-only, reviewed through the existing draft rail.Backend
convert_statsdraft mode (migratione9f0a1b2c3d4: enum value via Alembicautocommit_block+lore_entry_drafts.current_stats_notes).audio_service.convert_lore_entry_statsmapsbody+ loosesidebar_fields→ schema-validatedvalues(map, not invent; per-field confidence/source), validated via #139, retry-once then fail (no free-form fallback). Reuses #142'scurrent_statsstaging + approval path — approval writes onlyentry.stats; the original prose and sidebar rows are never rewritten (verified append-only).GET .../wiki/convert-stats/queue(GM-only) lists eligible entries (linked schema-bearing system, covers type, no stats yet).LoreEntry/LoreEntryVersion.statsnow usenone_as_null=Trueso PythonNone→ SQLNULL(not JSON'null'), which the queue'sstats IS NULLfilter exposed; also fixes #140's "delete stat block" round-trip.Frontend
convert_statsdraft per entry, navigates to review.convert_statsbranch showing the prose read-only (unchanged) + the proposed mapped stat block with schema labels and per-fieldconfidence · source; approve writes stats append-only. Other draft modes untouched.Verification (Docker)
test_convert_stats.py) — no regressions. Migratione9f0a1b2c3d4up/down/up clean (enum value + notes column present).node:20-alpine).Notes / small follow-ups
patch_draftdoesn't yet accept inlinecurrent_stats/value edits during review (same as #142) — a candidate follow-up. No bot API change;BOT_CONTRACT_VERSIONstays 1.🤖 Generated with Claude Code