Commit History
-
[NOTICKET] fix(tools): accept `avg` wherever `mean` works (A23 Bug 2)
Rifqi Hafizuddin +1: Claude Opus 5The planner and the tools disagreed about what "average" is called, and the planner lost. It fills in a QueryIR and a tool call from ONE prompt: QueryIR AggFn count, count_distinct, sum, avg, min, max tools SUPPORTED_AGGS sum, mean, count, min, max, median (+ nunique) planner.md teaches `avg` three times because the IR requires it -- line 331 even says "utilization, scores -> avg", which is exactly the PA case. So the planner wrote agg="avg" into analyze_forecast and the tool raised UnsupportedAggregationError. The dry-run lost its forecast turn that way. The planner was not wrong; it obeyed its own prompt. Blast radius was five tools, not one. analyze_trend, analyze_forecast, analyze_ab_test, analyze_pareto and analyze_segmentation all take an `agg` and all five rejected `avg` -- only forecast happened to be exercised. analyze_aggregate failed differently and more quietly: validator check 8c rejected the plan, burning a retry before execution. Aliasing rath…0f0af11 -
[NOTICKET] tools: quality blocks for forecast + ab_test, forecast backtest, CK7 fix
Rifqi Hafizuddin +1: Claude Opus 5Extends the reserved `quality` convention to the tools where it means something, and fixes a CK7 message that was wrong for half its inputs. analyze_forecast -- the substantial one. It reported NO accuracy at all, so "how accurate is it?" had no answer. Now backtests: hold out the last h periods (bounded by a quarter of the series and by the fitting floor), refit, and score with MASE -- mean absolute error over the naive "next = last" error on the training span. MASE is scale-free (Hyndman & Koehler 2006) and, unlike MAPE, neither explodes near zero nor punishes over-prediction asymmetrically. Both fits run in ONE run_fit call, so a forecast still costs one thread hop and one timeout. A series too short to hold anything out, or one that never moves, ships UNVALIDATED -- also weak, with the two causes reported as distinct reasons rather than one wrong one. analyze_ab_test -- free and exact: the statistical verdict IS the quality verdict. A gap the test cannot separate from noise is we…2082eba
-
[NOTICKET] feat(tools): analyze_forecast (ETS) — first ML tool, DEFERRED
analyze_forecast: statsmodels ETS (Holt-Winters, additive trend, no AutoML), reusing analyze_trend's date parsing + resampling. Auto-chart (actual-vs-forecast line) via the reserved 'charts' key; deterministic output. Registered in _DISPATCH + registry (spec derived from ForecastInput via spec_builder) as DEFERRED — activation (ACTIVE + examples.py few-shot) follows once A0 scoping locks P1. Wires the ML executor for the first time: the fit is offloaded via run_fit, and the invoker now awaits coroutine compute fns (inspect.isawaitable — opt-in; sync tools unchanged). This resolves the conventions §4/§6 contradiction toward 'sync unless it fits a model'; doc §6 wording needs a follow-up tweak. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>dae102f