recommend_model: needs_distribution drops every macro model, and horizon is ignored

オープン
#210 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
api, backend

調査の方向性

Start in integration/src/policyengine_macro/capabilities.py at recommend, then trace the registered model capabilities and the MCP tool definition that exposes horizon. Check how incidence tools are registered and tested before choosing an approach. Done means distribution requests return useful guidance for macro candidates and the unused horizon argument is removed or given defined routing behavior, with tests covering both.

索引モデルが issue の本文から書いたものです。

説明

question

Problem

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:

  1. 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).
  2. 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

  1. 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.
  2. 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".
  3. 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.

🤖 Generated with Claude Code

主要言語
HTML
スター
3
フォーク
1
平均マージ
1日 20時間
マージ済み PR(30日)
53

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PolicyEngine/macro のほかの issue

PolicyEngine/macro の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。