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 firstStructs§
- Planner
- Proposal scorer and ranker.
- Planner
Config - Configuration for proposal scoring.
- Scored
Proposal - A proposal with its computed score and verification result.
- Tool
Feedback - 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.