car-ffi-common 0.25.0

Shared logic for FFI bindings (NAPI, PyO3) — JSON wrappers for verify, multi-agent, scheduler
1
2
3
4
5
6
7
8
9
10
11
12
13
//! JSON wrapper for harness-level evaluation metrics (survey §5.2.1).
//!
//! Computes the six operational-substrate dimensions (trajectory
//! efficiency, verification strength, recovery, state consistency, safety,
//! replayability) from a JSONL tail of a session's event log.

/// Compute harness-level metrics from a JSONL string of events (one event
/// per line, as written to the runtime's event journal). Returns the
/// `HarnessMetrics` JSON.
pub fn compute(events_jsonl: &str) -> Result<String, String> {
    let metrics = car_eventlog::harness_metrics::compute_from_jsonl(events_jsonl);
    serde_json::to_string(&metrics).map_err(|e| e.to_string())
}