Summary
Implement ahc cost-estimate <plan-file> — estimate total cost for a declared plan using CostProfileStore percentiles when available, falling back to static pricing.
Depends on: #122 (cost-profile CLI + runtime wiring)
Scope
- Parse a plan file (YAML or JSON) specifying steps with model, action, and token bounds
- Use
CostProfileStore percentiles (p50/p90/p99) when trace profiles exist for the (action_name, model_name) pair
- Fall back to static pricing from
PricingRegistry when no profiles exist
- Output: three-point estimate (optimistic / expected / worst-case) per step and total
- Machine-readable output option (
--json)
Key Files
src/agent_hypervisor/compiler/cli.py — add cost-estimate command
src/agent_hypervisor/economic/cost_estimator.py — estimate_plan_cost()
src/agent_hypervisor/economic/cost_profile_store.py — CostProfileStore.percentile()
tests/compiler/test_cost_estimate.py — new test file
Acceptance Criteria
Milestone
v0.3
Summary
Implement
ahc cost-estimate <plan-file>— estimate total cost for a declared plan usingCostProfileStorepercentiles when available, falling back to static pricing.Depends on: #122 (cost-profile CLI + runtime wiring)
Scope
CostProfileStorepercentiles (p50/p90/p99) when trace profiles exist for the(action_name, model_name)pairPricingRegistrywhen no profiles exist--json)Key Files
src/agent_hypervisor/compiler/cli.py— addcost-estimatecommandsrc/agent_hypervisor/economic/cost_estimator.py—estimate_plan_cost()src/agent_hypervisor/economic/cost_profile_store.py—CostProfileStore.percentile()tests/compiler/test_cost_estimate.py— new test fileAcceptance Criteria
ahc cost-estimate <plan>prints per-step and total estimates--jsonflag outputs machine-readable estimatespytest tests/compiler/test_cost_estimate.py -vpassesMilestone
v0.3