#validation #precondition #run-time #checking #action #gt

car-validator

Precondition checking and action validation for Common Agent Runtime

9 releases (breaking)

new 0.14.0 May 15, 2026
0.13.0 May 15, 2026
0.12.0 May 14, 2026
0.9.0 May 12, 2026
0.1.1 Mar 22, 2026

#3 in #gt

Download history 27/week @ 2026-03-21 14/week @ 2026-05-02 211/week @ 2026-05-09

225 downloads per month
Used in 17 crates (via car-engine)

Apache-2.0

135KB
3K SLoC

Action validation — precondition checking and invariant enforcement.


car-validator

Precondition checking and action validation for the Common Agent Runtime.

What it does

Validates actions against runtime state and registered tool schemas before execution. Checks preconditions (eq, neq, gt, lt, gte, lte, exists, not_exists, contains), verifies required tool parameters, and confirms state dependencies are present. Returns structured ValidationResult with all errors.

Usage

use car_validator::{validate_action, check_precondition};
use car_state::StateStore;

let state = StateStore::new();
let result = validate_action(&action, &state, &registered_tools);
if !result.valid() {
    for err in &result.errors {
        eprintln!("{}: {}", err.action_id, err.reason);
    }
}

Part of CAR -- see the main repo for full documentation.

Dependencies

~14–20MB
~293K SLoC