feat: shelf end-of-session sweep — promote / carry / discard (#247) #257
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/shelf-sweep"
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 end-of-session sweep for the Session Reference Shelf (#247): at session end, one-tap triage of every card on tonight's shelf — Promote to wiki, Carry forward, or Discard — turning improv into canon in one pass.
Promote to wiki (the new work)
A new
promotelore-draft mode + an LLM pass (promote_lore_entry_body) that cleans a card's live-play scratch content into a polished, merged wiki-entry body, reviewed through the existing per-entry draft-review rail. The target is decided bypromote_card:POST /api/sessions/{id}/shelf/{card_id}/promote → {entry_id, draft_id}hands off to/lore/{entry_id}/draft. Carry forward = the pin (built in #254); Discard = delete.Why the stub approach
The draft rail is entirely per-entry (
approve_draft → update_lore_entry; review URL is/lore/{entry_id}/draft). A null-entry "new-entry draft" would need a parallel review UI. Creating the entry up front from the card's real content (then AI-polishing) reuses the whole rail — one enum value, no review-UI changes.Frontend
The "End-of-session sweep" panel (from the shelf header) lists every card with the three actions; promote links to its draft in a new tab so the sweep stays put.
Notes
c8d9e0f1a2b3—ALTER TYPE loredraftmode ADD VALUE 'promote'(autocommit block, mirrors the convert_stats migration). No bot-contract change.Closes #247. Part of #235.
🤖 Generated with Claude Code
The "promote to wiki" arm of the end-of-session sweep. Adds a `promote` lore draft mode (migration c8d9e0f1a2b3, ADD VALUE on the loredraftmode enum) + an `promote_lore_entry_body` LLM pass that turns a card's live-play scratch content into a clean, merged wiki-entry body. `promote_card` decides the target through the existing per-entry draft rail (stub approach — no new review UI): - lore card → clean-up draft on its own entry; - generation/note card matching an approved entry (by inferred type + title) → merge draft into that entry; - otherwise → create the entry immediately from the card's derived text (a stub), then a clean-up draft on it. POST /api/sessions/{id}/shelf/{card_id}/promote → {entry_id, draft_id}, handing off to the /lore/{entry_id}/draft review page. 6 new tests (32 with the shelf suite), no regressions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>