Skip to main content

evaluate_edit_plan

Function evaluate_edit_plan 

Source
pub fn evaluate_edit_plan(plan: &StelPlan) -> StelDecision
Expand description

Evaluate L2 admission for a structural edit plan (no NL P-FF bypass path).

A structural edit always serves. Unlike a READ — where a non-positive net means “host-read the file directly, it is cheaper” — an EDIT has no host-side substitute: only running the tool performs the mutation. So the read ladder’s bypass (“just host_read this path”) and degrade (cap the response budget) are incoherent for a mutation, and the prior code never reached them anyway while the flat 520/900 floor pinned net at a permanent ~255. Now that the edit’s economics are grounded in the new-body byte length (grounded_edit_tokens), a tiny edit’s net legitimately goes non-positive; we surface that grounded net honestly in decision_reason but still serve, because the agent must run the tool to apply the change. The grounded EconomicsBreakdown still flows into the envelope (predicted_tokens / est_net_vs_manual) via metrics_for_decision.