Skip to content

Common ScoreResult schema across all scoring adapters #10

Description

@MaxGhenis

Every scoring adapter currently returns a different dict shape (delta_gdp_bn rows vs changes_bn/changes_pct vs decile rows). Comparability across model classes is asserted in prose ("every model reports the same quantities") but not enforced by schema — so the site's central promise, the same reform through different model classes, side by side, has no programmatic object.

Contract — one ScoreResult (pydantic) for every scoring entry point:

  • model (id + class: microsim / semi-structural / OLG-GE), country, reform (PolicyEngine parameter dict), horizon (steady-state | quarterly window | annual window)
  • quantities: GDP, consumption, investment, government, revenue, debt — levels and deltas, currency-bn, with units and basis per quantity
  • assumptions: list[str] (e.g. "pooled-age tax functions, single sector, steady state"), caveats: list[str] (e.g. the corp-tax boundary), uncertainty: optional bands where the model produces them (SVAR)
  • Distributional block optional (microsim fills deciles/winners/losers; macro members leave it empty — until the Macro→micro feedback: economic-assumptions overlay for dynamic distributional impacts #11 feedback loop fills it)

Payoff: macromod compare --reform reform.json --models og,obr renders one table from N ScoreResults; the MCP returns them as a list. That table is the product moment.

Touches integration/src/macromod/core.py (adapters return the schema), cli.py (compare command), mcp_server.py, docs page. Pairs with #8/#9.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions