Skip to main content

turn_completed_data

Function turn_completed_data 

Source
pub fn turn_completed_data(
    decision: &str,
    stop_reason: Option<&str>,
    was_truncated: bool,
    turns: u32,
    model: &str,
) -> HashMap<String, Value>
Expand description

Build the durable TurnCompleted event-data map.

Shared by the assistant loop’s Runtime::record_turn_completed and the coder loop’s terminal (EventSink::record_turn_completed in car-server-core), so the two paths never drift on the keys the harness miners parse (harness_adapt::diagnose, failed_trace_events): decision, stop_reason, was_truncated, turns, and the P0c provenance model_id (authoritative) / model_tier (derived local|cloud grouping).

The coder loop stamps one further key on top of these — models_served, every model that served a turn in that iteration (car#1333) — which no miner parses and which the assistant path has no answer to, since nothing there consumes authorship. Non-drift is a promise about the keys above, not about the whole record.