You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
recommend_model: needs_distribution drops every macro model, and horizon is ignored #210
recommend_model (integration/src/policyengine_macro/capabilities.py, recommend) routes on question_type and country only. Two of its inputs do less than a caller expects:
needs_distribution=True drops every macro model. The filter keeps only pe-microsim and og+microsim. So recommend("economic_shock", "us", needs_distribution=True) returns no model, with the "no registered model supports this request" warning. But the suite does answer that question: frbus_shock_incidence, hank_shock_incidence (and hank_shock(include_distribution=True)), svar_inflation_incidence and define_scenario_incidence all produce household distributions. The same is true for forecast/economic_diagnosis (UK, via svar_inflation_incidence) and climate_policy_scenario (via define_scenario_incidence).
horizon is ignored. It is echoed back but never used, so "long run" and "next four quarters" route the same way. (The MCP docstring now says so, on branch vahid/r5-api-scenarios.)
Evidence
Matrix run on 6 Nov 2026 (all 10 question types × uk/us/fr × needs_distribution):
economic_shock uk/us, forecast uk, economic_diagnosis uk, climate_policy_scenario uk, structural_change uk, translated_policy_scenario uk: a candidate with needs_distribution=False, none with True.
Options
Register the incidence pairs as capability entries (frb-us+microsim, us-hank+microsim, boe-svar+microsim, define-uk+microsim). Each needs its own quality block, so this is the honest route, but it is more work.
Keep the registry and add an incidence_tools hint to the response when needs_distribution filters out a macro candidate: "frb-us has no distribution itself; frbus_shock_incidence overlays its labour-market path on the US microsim".
Leave it as it is and document that needs_distribution means "the model itself is distributional".
For horizon: either drop the argument, or define a small vocabulary (short_run, medium_term, long_run) and match it against each model's horizon field.
Recommendation
Option 2 now (small, no new quality claims). Drop horizon from the tool until there is a vocabulary, so no caller thinks it is doing something.
Triage (6 Nov): draft PR #216 (ef763b7) covers only input validation in recommend_model: unknown question types raise, input is case-normalised. The routing question here (needs_distribution, horizon) is not addressed yet and still needs a decision. Recommendation stands: option 2 and drop horizon.
needs_distribution: option 2 is in (a809995d, 16 Nov). When the filter removes every candidate, the warning now names the experimental incidence tools for that question and country, for example frbus_shock_incidence and hank_shock_incidence for a US economic_shock. They are named as experimental and are not returned as candidates. tests/test_capabilities.py covers it.
horizon is still accepted and ignored. It is echoed back, and the MCP docstring says it does not route. The recommendation from the issue stands: drop the argument until there is a vocabulary to match against each model's horizon field. Dropping it changes the published tool schema (tests/tool_surface.py), so I have left it for a decision.
horizon: #289 deprecates it instead of dropping it or adding a vocabulary.
The argument stays in the tool schema and is echoed back, so no caller breaks.
When it is passed, the result carries horizon_note (Python callers also get a DeprecationWarning) saying it was ignored and pointing at each candidate's own horizon under details.
A short_run / medium_term / long_run vocabulary would need a new suitability classification for each of the eight models, because the registry's horizon fields are free text. That is left as a decision; removing the argument can follow in a later release.
With #289 merged, both halves of this issue are answered, and it can be closed unless the vocabulary is wanted.
Activity
vahid-ahmadi commentedon Nov 6, 2026
Triage (6 Nov): draft PR #216 (ef763b7) covers only input validation in
recommend_model: unknown question types raise, input is case-normalised. The routing question here (needs_distribution,horizon) is not addressed yet and still needs a decision. Recommendation stands: option 2 and drophorizon.vahid-ahmadi commentedon Nov 25, 2026
Status on main
7cce161d(24 Nov): half done.needs_distribution: option 2 is in (a809995d, 16 Nov). When the filter removes every candidate, the warning now names the experimental incidence tools for that question and country, for examplefrbus_shock_incidenceandhank_shock_incidencefor a USeconomic_shock. They are named as experimental and are not returned as candidates.tests/test_capabilities.pycovers it.horizonis still accepted and ignored. It is echoed back, and the MCP docstring says it does not route. The recommendation from the issue stands: drop the argument until there is a vocabulary to match against each model'shorizonfield. Dropping it changes the published tool schema (tests/tool_surface.py), so I have left it for a decision.🤖 Generated with Claude Code
vahid-ahmadi commentedon Nov 26, 2026
horizon: #289 deprecates it instead of dropping it or adding a vocabulary.horizon_note(Python callers also get aDeprecationWarning) saying it was ignored and pointing at each candidate's ownhorizonunderdetails.short_run/medium_term/long_runvocabulary would need a new suitability classification for each of the eight models, because the registry'shorizonfields are free text. That is left as a decision; removing the argument can follow in a later release.With #289 merged, both halves of this issue are answered, and it can be closed unless the vocabulary is wanted.
🤖 Generated with Claude Code