car-validator 0.1.1

Precondition checking and action validation for Common Agent Runtime
Documentation
  • Coverage
  • 50%
    5 out of 10 items documented0 out of 5 items with examples
  • Size
  • Source code size: 33.27 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.14 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 55s Average build duration of successful builds.
  • all releases: 1m 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mliotta

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.