Skip to content

[codex] Honor explicit economy dataset selection#3380

Draft
MaxGhenis wants to merge 3 commits intomasterfrom
codex/fix-economy-dataset-selection
Draft

[codex] Honor explicit economy dataset selection#3380
MaxGhenis wants to merge 3 commits intomasterfrom
codex/fix-economy-dataset-selection

Conversation

@MaxGhenis
Copy link
Copy Markdown
Collaborator

@MaxGhenis MaxGhenis commented Apr 8, 2026

What changed

  • Economy scoring now resolves explicit dataset aliases like enhanced_cps, cps, and enhanced_frs before falling back to the regional default dataset.
  • Added regression tests for explicit dataset aliases in _setup_data() and at the SimulationOptions layer.
  • Added repo-native make targets for fresh worktrees and PR preflight (bootstrap-dev, lint, check-changelog, pre-pr, ci).
  • Updated the PR workflow to call those shared commands instead of duplicating shell logic.
  • Documented the expected local workflow in README.md and CLAUDE.md so fresh sessions default to uv/make rather than ad hoc .venv/bin/... commands.

Why

The economy API accepted a dataset query param from the web app, but _setup_data() ignored most named datasets and silently used get_default_dataset(...) instead. That meant the UI could present a non-default dataset selection while the backend still scored the default dataset.

Separately, the initial PR follow-up hit avoidable worktree drift because local commands depended on implicit tool paths instead of repo-native commands. This PR now encodes the intended workflow directly in the repo and CI.

Impact

  • Explicit dataset selections in society-wide calculations now reach the simulation API correctly.
  • Existing default behavior and the special national-with-breakdowns passthrough datasets are unchanged.
  • Fresh worktrees can use make bootstrap-dev and make pre-pr without assuming a specific shell-local tool path layout.

Validation

  • make pre-pr
  • make test-env-vars in a configured environment

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.24%. Comparing base (2f4cf80) to head (1e62bb1).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3380      +/-   ##
==========================================
+ Coverage   72.20%   72.24%   +0.03%     
==========================================
  Files          56       56              
  Lines        2425     2428       +3     
  Branches      423      424       +1     
==========================================
+ Hits         1751     1754       +3     
  Misses        595      595              
  Partials       79       79              

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

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.

1 participant