Skip to content

Version economy and report output caches against runtime#3384

Merged
MaxGhenis merged 3 commits intomasterfrom
codex/runtime-versioned-report-cache
Apr 9, 2026
Merged

Version economy and report output caches against runtime#3384
MaxGhenis merged 3 commits intomasterfrom
codex/runtime-versioned-report-cache

Conversation

@MaxGhenis
Copy link
Copy Markdown
Collaborator

@MaxGhenis MaxGhenis commented Apr 8, 2026

Closes #3386

Summary

  • version economy-impact cache keys and report-output reuse against the active runtime instead of only the country package version
  • make report output creation idempotent and ignore stale report rows when looking for reusable outputs
  • resolve stale report IDs onto current-runtime rows instead of promoting stale rows in place

Testing

  • FLASK_DEBUG=1 /Users/maxghenis/PolicyEngine/policyengine-api/.venv/bin/pytest tests/unit/services/test_economy_service.py tests/unit/services/test_report_output_service.py tests/unit/test_constants.py
  • uvx ruff format --check policyengine_api/constants.py policyengine_api/services/economy_service.py policyengine_api/services/report_output_service.py tests/unit/services/test_report_output_service.py tests/unit/test_constants.py

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 83.82353% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.58%. Comparing base (2f4cf80) to head (68bb08d).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
policyengine_api/constants.py 78.57% 3 Missing and 3 partials ⚠️
policyengine_api/services/report_output_service.py 91.89% 2 Missing and 1 partial ⚠️
policyengine_api/routes/report_output_routes.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3384      +/-   ##
==========================================
+ Coverage   72.20%   72.58%   +0.38%     
==========================================
  Files          56       56              
  Lines        2425     2477      +52     
  Branches      423      431       +8     
==========================================
+ Hits         1751     1798      +47     
- Misses        595      598       +3     
- Partials       79       81       +2     

☔ View full report in Codecov by Sentry.
📢 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.

@MaxGhenis MaxGhenis marked this pull request as ready for review April 9, 2026 01:11
@MaxGhenis MaxGhenis merged commit 7507d29 into master Apr 9, 2026
5 checks passed
@MaxGhenis MaxGhenis deleted the codex/runtime-versioned-report-cache branch April 9, 2026 01:11
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.

Version runtime-sensitive report caches and avoid stale report reuse

1 participant