Turn Summaries
Done2026-10-30Jean Mertz
Tracking ticket for RFD 126.
Implementation plan
- Add TurnStart summary field and stream accessors: Turns
TurnStartinto a struct with an optionalsummarythat is omitted from JSON whenNone. AddsTurn::id(),Turn::summary()andConversationStream::set_turn_summary, with tests for serde round-trips, legacy JSON and setter lookup byEventId. Independent, can merge on its own. - Add turn summary configuration: Adds
TurnSummaryConfigandTurnSummaryGenerateConfig(auto,batch_size,model) underConversationConfiginjp_config, with the config traits implemented and tests for loading,--cfgassignment and deltas. Independent, can merge in parallel with Phase 1. - Build the turn summarizer in jp_llm: Adds
jp_llm::turn_summarywith the model fallback chain, the stripped standalone transcript builder, turn fingerprints, turn-granular packing, the structured output schema and prompt with ID filtering, andmechanical_turn_summary. Covers these with unit tests, including compacted candidates, oversized turns and unrequested IDs. Depends on Phases 1 and 2. - Add TurnSummaryTask and wire into jp query: Implements
TurnSummaryTask:rungenerates summaries under a cancellationselect!, andsynclocks the conversation, drops results whose fingerprint changed, writes the rest withset_turn_summaryand flushes. Spawns it fromjp querywhenauto && persist, updates the--eventslong help, and adds integration tests for lagged summarization and for edits between spawn and sync. Depends on Phase 3.