Skip to main content

Crate car_planner

Crate car_planner 

Source
Expand description

Proposal scoring and search for Common Agent Runtime.

Sits between the model and car-engine: scores N candidate proposals using static verification + cost estimation, picks the best, and provides fallback ordering for replan scenarios.

Inspired by MARS (budget-aware MCTS) — uses verify() + simulate() as the evaluation function, not LLM calls. Pure Rust, zero inference cost.

§Usage

use car_planner::{Planner, PlannerConfig, ScoredProposal};

let planner = Planner::new(PlannerConfig::default());
let candidates = vec![proposal_a, proposal_b, proposal_c];
let ranked = planner.rank(&candidates, Some(&state), Some(&tools));
let best = &ranked[0]; // highest score first

Structs§

Planner
Proposal scorer and ranker.
PlannerConfig
Configuration for proposal scoring.
ScoredProposal
A proposal with its computed score and verification result.
ToolFeedback
Historical tool success rates computed from the trajectory store. Pass to rank_with_feedback() to bias scoring based on past outcomes.

Functions§

estimate_proposal_tokens
Rough token estimate for a proposal: serialized JSON length ÷ 4. Matches the heuristic used elsewhere in the codebase (see MemNode::token_estimate). Accurate enough for ranking; an embedding-tokenizer-backed estimate could replace this later.