Skip to content

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

Draft
DTrim99 wants to merge 3 commits into
masterfrom
us-2036-economy-year
Draft

DTrim99 wants to merge 3 commits 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 #3926: it lets US users pick 2036.

Rebased onto master on 2026-11-10, after #4212 moved each country's years into policyengine_api/economy_years.py. The earlier edits to country.py and the v2 catalog extraction are gone, because both now read that module.

  • policyengine_api/economy_years.py: US_ECONOMY_YEARS runs from 2036 down to 2024. /us/metadata's economy_options.time_period, the v2 catalog's metadata_time_periods and the years the economy routes accept all follow it. A society-wide request for another year still gets the 400 with DATASET_YEAR_UNAVAILABLE, whose message now reads "US results are available for 2024 to 2036". The UK is unchanged (2024–2032).

  • Docs: docs/canonical-spm.md gives the artifact horizon as 2022–2036 and the US years as 2024 to 2036; docs/migration/stage-9-v2-metadata.md gives the same US years.

  • Tests: tests that used 2036 as a year after the US years now use 2037:

    • test_economy_unavailable_years.py;
    • test_spm_year_worker_polling.py, whose last accepted year is now 2036 and whose budget window runs 2036–2037;
    • test_economy_service_budget_window_requests.py's docstring and job id;
    • test_economy_years.py and test_country.py.

    test_country_spm.py's year-after-forecast case runs against the installed forecast, so it moves from 2036 to 2037. The tests on mocked forecasts with years=(2022, 2035) don't depend on the installed artifact and are unchanged.

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

Testing

These ran on Modal, as CI sets up: Python 3.12, uv 0.13.4, uv sync --frozen --extra dev --group telemetry-error-issues.

  • Affected tests: 131 passed and 2 skipped. These were test_economy_years, test_economy_unavailable_years, test_spm_year_worker_polling, test_economy_service_budget_window_requests, test_country, test_country_spm and the v2 catalog time-period publication test.
  • Full tests/unit: 4,809 passed. All 177 failures are deploy and CI-script tests that call jq or need a .git checkout, which the container lacked. None touch the year lists.

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.
  • A society-wide request for 2037 returns DATASET_YEAR_UNAVAILABLE.

🤖 Generated with Claude Code

@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.64%. Comparing base (8819e66) to head (feac42e).
⚠️ Report is 97 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3928      +/-   ##
==========================================
- Coverage   92.30%   87.64%   -4.67%     
==========================================
  Files         300      306       +6     
  Lines       17116    18743    +1627     
  Branches     2851     3240     +389     
==========================================
+ Hits        15799    16427     +628     
- Misses        791     1741     +950     
- Partials      526      575      +49     
Flag Coverage Δ
integration 52.87% <100.00%> (-0.63%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

DTrim99 and others added 3 commits November 9, 2026 15:49
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
The year-after-forecast missing-input case runs against the certified
bundle's installed forecast. Once the bundle carries spm-calculator 1.1.0,
2036 is inside the forecast, so the case moves to 2037, which is outside
both the current and the 2036 forecast.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
US_ECONOMY_YEARS now runs from 2036 down to 2024, the last year of the
canonical SPM forecast in the bundle (spm-calculator 1.1.0 covers 2022 to
2036). /us/metadata and the v2 catalog offer 2036, and the economy routes
accept it. Tests that used 2036 as a year after the US years use 2037.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch had an error being deployed

1 failed 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