Skip to content

One reform vocabulary: score_reform takes a PolicyEngine reform; obr_shock is the escape hatch - #15

Merged
MaxGhenis merged 2 commits into
mainfrom
unified-score-reform
Jul 16, 2026
Merged

One reform vocabulary: score_reform takes a PolicyEngine reform; obr_shock is the escape hatch#15
MaxGhenis merged 2 commits into
mainfrom
unified-score-reform

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Summary

Closes #8 — one reform vocabulary across the suite.

  • score_reform(country, reform, model) now takes the shared PolicyEngine reform shape (the same flat {parameter_path: value} dict as population_reform_impact / household_reform_impact) and dispatches by declared contract:
  • obr_shock (MCP) / macromod obr-shock (CLI): the former raw interface, explicitly named — never the generic verb.
  • og_score_reform_steady_state tool removed (unified into score_reform); macromod og-score stays as a CLI alias, now taking --reform JSON.
  • Docs made truthful: README tool/command lists (the "nine tools" list was already stale — population_reform_impact was missing), connect page snippets and tool roster, OLG page og-score example, modal_app.py comments.
  • The post-deploy remote smoke (test_remote_mcp.py) moves to obr_shock and gains a check that score_reform model="obr" errors with the pointer — so the Modal redeploy on merge stays green and the new contract is exercised live.

Verification

  • Fast suite (CI profile, OBR + SVAR installed): 41 passed, 22 skipped (7 new tests: dispatcher routing/validation, CLI requires/pending/escape-hatch paths).
  • Real OBR solve through the renamed path: core.obr_shock(var="CGG", shock=1250, periods=4) → first-quarter ΔGDP £1.25bn, cumulative £5.0bn (multiplier ≈ 1, matching the remote test's expected band).
  • Repo-wide sweep: zero remaining obr_score_reform / og_score_reform_steady_state references outside the venv.

Note for review: the hosted server's generic score_reform intentionally has no working arm until #9 (OG is excluded from the image by design; OBR pending) — both arms return actionable instructions, and obr_shock keeps hosted scoring functional.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
macromod Building Building Preview Jul 16, 2026 7:16pm

Request Review

MaxGhenis and others added 2 commits July 16, 2026 18:37
…OBR shocks become obr_shock

Closes #8. The generic verb now takes the suite's shared reform shape —
the same {parameter_path: value} dict as the microsimulation tools —
and dispatches by declared contract: model='og' routes through
PolicyEngine-estimated tax functions (multi-parameter reforms now
supported); model='obr' raises an actionable pointer until the
static-costing bridge (#9) lands. Raw OBR variable shocks survive as
the explicitly named escape hatch: obr_shock (MCP) / macromod obr-shock
(CLI). og_score_reform_steady_state is folded into score_reform;
og-score keeps a CLI alias with the reform-dict shape.

Docs updated to match (README tool/command lists, connect + OLG pages,
modal_app comments), including the stale nine-tool list.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ss, shaped-JSON errors, fast multi-param guard

Sol review findings on #15: (1) the obr_shock MCP/CLI wrappers no longer
force investment_closure=False — omitted means core's safe per-variable
default (a TCPRO shock without the closure solves to misleading zeros);
(2) integration/README.md rewritten — it still taught the removed
`macromod score --var` syntax, listed a stale tool inventory, claimed
population scoring was unwired (hosted since 7/14), and carried personal
dev paths; (3) list_reform_variables metadata points at obr_shock, not
score_reform; (4) valid-but-wrong-shaped reform JSON ('[]', '{}') is a
Click error, not a traceback, in both score and og-score; (5) a fast
test asserts the full multi-parameter dict reaches policy construction;
(6) root README + connect page state the OBR-pending exception and stop
calling hosted population scoring local-only; (7) modal_app docstring
inventory updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis force-pushed the unified-score-reform branch from d1f029f to 0fd6021 Compare July 16, 2026 22:38
@MaxGhenis
MaxGhenis merged commit 8486cfa into main Jul 16, 2026
1 check passed
@MaxGhenis
MaxGhenis deleted the unified-score-reform branch July 16, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

One reform vocabulary: score_reform takes a PolicyEngine reform; raw OBR shocks become obr_shock

1 participant