Skip to main content

apply_compaction

Function apply_compaction 

Source
pub async fn apply_compaction(
    runtime: &Runtime,
    current: &Session,
    api_messages: &[SharedMessage],
    outcome: &CompactionOutcome,
    transition: CompactionTransition,
) -> Result<AppliedCompaction>
Expand description

Task 30 (spec §9.2): the ONE engine operation applying a successful compaction for every frontend. Handles successor-vs-in-place policy, session id and chain advancement, accounting, typed provenance, pending events and queued messages, hooks, save ordering, and rollback: nothing is returned (and no caller state changes) unless the new state was persisted, so a failed save leaves the prior session intact.