Skip to content

Offer 2036 as a US year in economy options and the v2 catalog - #3928

Draft
DTrim99 wants to merge 1 commit into
masterfrom
us-2036-economy-year
Draft

DTrim99 wants to merge 1 commit into
masterfrom
us-2036-economy-year

Conversation

@DTrim99

@DTrim99 DTrim99 commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Fixes #3927

Summary

  • This is the policyengine-api part of Allow US calculations in 2036 #3926: it lets US users pick 2036.
  • policyengine_api/country.py: adds dict(name=2036, label="2036") to the US time_period options. The app's year picker, date ranges and budget-window starts all read this list. The UK is unchanged (2024–2030).
  • policyengine_api/data/v2/catalog/extraction.py: METADATA_TIME_PERIODS["us"] becomes range(2036, 2021, -1).
  • docs/canonical-spm.md: the artifact horizon becomes 2022–2036.

Draft until the bundle with a 2036 SPM forecast is ready.

  • The canonical SPM forecast in the current bundle covers 2022–2035. A 2036 request fails with SPM_YEAR_UNAVAILABLE.
  • Merge this in the same release as the PolicyEngine bundle update that carries spm-calculator 1.1.0 and its 2022–2036 forecast. Merging earlier would show 2036 in the app while every 2036 run fails.
  • The v2 catalog stores the year list per published model version, and publication reconciliation compares staged and stored lists. So the new list should go out with a new bundle version.

Budget windows already allow end years through 2099 (BUDGET_WINDOW_MAX_END_YEAR). The worker reads its year boundary from the installed SPM provider. Neither needs a change here.

The SPM tests that use 2036 as an unavailable year (test_spm_settings.py, test_spm_year_worker_polling.py, test_budget_window_cache.py) run on mocked forecasts with years=(2022, 2035). They don't depend on the installed artifact, so they're unchanged.

Testing

  • ruff format and ruff check are clean on the changed files.
  • No unit test pins the US year list. I didn't run the suite locally; CI covers it.
  • After the bundle bump, on staging:
    • GET /us/metadata lists 2036.
    • A national 2036 economy run completes, with "2036" in its SPM receipt.
    • budget_window:2027:10 completes.
    • 2037 still returns SPM_YEAR_UNAVAILABLE.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH

Add 2036 to the US time_period options and to the v2 catalog's
METADATA_TIME_PERIODS, and update the canonical SPM contract doc's
horizon. This must ship with the PolicyEngine bundle whose SPM forecast
covers 2036; until then a 2036 request fails with SPM_YEAR_UNAVAILABLE.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.58%. Comparing base (5c448d7) to head (b242eb4).

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #3928       +/-   ##
===========================================
+ Coverage   45.25%   87.58%   +42.33%     
===========================================
  Files         183      198       +15     
  Lines       11085    12223     +1138     
  Branches     1907     2161      +254     
===========================================
+ Hits         5016    10706     +5690     
+ Misses       5647      921     -4726     
- Partials      422      596      +174     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch was successfully deployed

1 active deployment
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.

Offer 2036 in the US economy options and v2 catalog

1 participant