Files
IdeaSDK/crates/application/src/conversation/mod.rs
Blomios 40ca3e522f feat(domain,infra,app): rotation/rétention log.jsonl + lecture paginée (LS6)
Backend uniquement (UI React repoussée à LS7) :
- domain : port ConversationArchive + structs SegmentStats/PageCursor/PageDirection/
  TurnSlice/RotationDecision/RotationThresholds, fn pures rotation_plan/clamp_page_limit
  + consts ; re-exports lib.
- infrastructure : impl ConversationArchive pour FsConversationLog (stats/rotate/page
  + helpers), archive segmentée hors chemin chaud.
- application : ReadConversationPage + DTO + ConversationArchiveProvider (conversation/paginate),
  RotateConversationLog (conversation/rotate), exports mod/lib.
- app-tauri : AppConversationArchiveProvider + wiring (state), rotation détachée dans
  launch_agent + commande read_conversation_page (commands), DTOs (dto),
  commande enregistrée (generate_handler!).
- tests (QA, verts) : conversation_log, conversation_rotate_paginate (nouveau),
  dto (module test). Pivots INV-LS6 et cohérence fold-après-rotation verts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 12:58:40 +02:00

26 lines
1.1 KiB
Rust

//! Conversation persistence use cases (cadrage « persistance conversationnelle »,
//! ARCHITECTURE §19, lot P6).
//!
//! Where [`crate::agent::lifecycle`] owns the *runtime* of an agent (spawn, PTY,
//! sessions), this module owns the **durable conversational memory** of a
//! conversation (paire) : the canonical append-only log and its incremental
//! handoff. The single use case here, [`RecordTurn`], materialises the
//! **end-of-turn checkpoint** (D19-5) by talking **only** to the three driven/driving
//! ports of §19 ([`domain::ConversationLog`], [`domain::HandoffStore`],
//! [`domain::HandoffSummarizer`]) — never to a concrete adapter.
//!
//! This is the **isolated logic** of P6 (lot P6a) : no wiring to the orchestrator,
//! the PTY or `app-tauri` (that is P6b). It is fully testable with in-memory fakes
//! of the three ports.
mod paginate;
mod record;
mod rotate;
pub use paginate::{
ConversationArchiveProvider, ReadConversationPage, ReadConversationPageInput, TurnPage,
TurnSource, TurnView,
};
pub use record::RecordTurn;
pub use rotate::{RotateConversationLog, RotateConversationLogInput};