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
Add OG-USA as a separate US overlapping-generations member, following the integration pattern already established for OG-UK while preserving the differences in policy vocabulary, calibration data, units, runtime, and validation.
This is not a fork or reimplementation. The model stays upstream at PSLmodels/OG-USA; PolicyEngine Macro supplies a thin, tested adapter, common result metadata, CLI/MCP discovery, and documentation.
Public packaged calibration assets include default parameter JSON, CPS, SCF and PSID files.
Optional/restricted profiles include PUF/TMD inputs; some calibration paths require a FRED API key.
Upstream states that a full baseline/reform transition-path run can exceed two hours. Hosted synchronous execution must not be promised before measurement.
Let score_reform(country="us", model="og") route explicitly to OG-USA and country="uk" to OG-UK, or expose unambiguous og-us / og-uk selectors. Test whichever public contract is chosen.
Never label OG-UK as UK + US or treat the two calibrations as interchangeable.
Record ogusa, ogcore, adapter, tax-calculator and calibration-data versions separately in provenance.
2. Start with a public-data profile
Establish a clean installation using pip install ogusa==0.4.0 (or a reviewed commit pin).
Run the baseline from packaged/public CPS calibration without PUF, TMD or private credentials.
State exactly which CPS, SCF, PSID, demographic, FRED and Tax-Calculator inputs are read, including dates and hashes where feasible.
Keep PUF/TMD profiles optional and local; tests requiring restricted data must be separated from the public acceptance gate.
Fail with actionable errors when an optional API key or restricted dataset is requested.
3. Build the adapter beside the OG-UK adapter
Use the existing OG-UK section in integration/src/policyengine_macro/core.py and integration/tests/test_og.py as the structural reference, not as code to generalize prematurely.
Add lazy _import_ogusa() loading with an exact installation error.
Add a cached US baseline keyed by every result-changing input: start year, dataset profile, model dimensions, solver configuration, policy baseline and source revision.
Implement an initial steady-state-only adapter; expose transition paths only after runtime, storage and schema review.
Return baseline and reform solver residuals/convergence status. A non-converged solve must fail, not serialize a plausible-looking result.
Map OG-USA/OG-Core outputs into the common ScoreResult without dropping native output.
Declare USD units, price basis, annual/steady-state time basis, geography, baseline definition, uncertainty and comparability on every quantity.
Preserve GDP, consumption, investment, wages, interest rates, government debt and tax-revenue outputs where supported; do not invent a quantity merely to match OG-UK.
4. Use a reviewed reform bridge
OG-USA currently calibrates federal taxes through Tax-Calculator, while PolicyEngine Macro accepts PolicyEngine reform objects. Similar names do not establish equivalent definitions.
Create a small, versioned catalogue of reviewed PolicyEngine-US → OG-USA/Tax-Calculator mappings.
For each mapping, declare source path, destination parameter, units, effective date, federal/state scope, transformation and tests.
Initially support only reforms whose semantics can be shown equivalent. Reject every unsupported path with an explanation and list of supported examples.
Do not use an LLM or fuzzy name matching to invent mappings or unit conversions.
Provide a separate expert escape hatch for direct OG-Core specification overrides; label these structural scenarios rather than PolicyEngine reform scores.
Do not pass state or local tax reforms into a federal OG-USA calibration unless an explicit model channel exists.
5. Access and runtime policy
Benchmark cold import, calibration, baseline steady state, reform steady state and full TPI separately on representative hardware.
Launch as local/experimental unless a steady-state pair fits hosted limits with safe memory, timeout and cost headroom.
If custom hosted runs exceed synchronous limits, use asynchronous jobs or precomputed reviewed scenarios; do not raise Modal timeout indefinitely.
Cache only immutable, provenance-keyed baselines. Never share a baseline across vintages or calibration profiles.
Verification and acceptance gates
Fast contract tests
Mocked baseline/reform calls verify routing, caching, schema, units and provenance.
Objective
Add OG-USA as a separate US overlapping-generations member, following the integration pattern already established for OG-UK while preserving the differences in policy vocabulary, calibration data, units, runtime, and validation.
This is not a fork or reimplementation. The model stays upstream at PSLmodels/OG-USA; PolicyEngine Macro supplies a thin, tested adapter, common result metadata, CLI/MCP discovery, and documentation.
Upstream feasibility baseline
ogusa0.4.0, Python 3.12–3.13.Integration design
1. Keep the UK and US models distinct
og-us; retainog-uk.score_reform(country="us", model="og")route explicitly to OG-USA andcountry="uk"to OG-UK, or expose unambiguousog-us/og-ukselectors. Test whichever public contract is chosen.ogusa,ogcore, adapter, tax-calculator and calibration-data versions separately in provenance.2. Start with a public-data profile
pip install ogusa==0.4.0(or a reviewed commit pin).3. Build the adapter beside the OG-UK adapter
Use the existing OG-UK section in
integration/src/policyengine_macro/core.pyandintegration/tests/test_og.pyas the structural reference, not as code to generalize prematurely._import_ogusa()loading with an exact installation error.ScoreResultwithout dropping native output.4. Use a reviewed reform bridge
OG-USA currently calibrates federal taxes through Tax-Calculator, while PolicyEngine Macro accepts PolicyEngine reform objects. Similar names do not establish equivalent definitions.
5. Access and runtime policy
Verification and acceptance gates
Fast contract tests
og-ukbehavior remains unchanged.Real public-data benchmark
Economic validation
Product and documentation
Definition of done
Related: #69, #71. This implements the OG-USA direction originally suggested during the PolicyEngine Macro architecture review.