Phase 1: Simulation/Report V2 Migration Foundation#84
Merged
anth-volk merged 8 commits intoapp-v2-migrationfrom Feb 19, 2026
Merged
Phase 1: Simulation/Report V2 Migration Foundation#84anth-volk merged 8 commits intoapp-v2-migrationfrom
anth-volk merged 8 commits intoapp-v2-migrationfrom
Conversation
Two migrations (0002_user_policies and f419b5f4acba) both descended from the initial schema, creating two Alembic heads. This empty merge migration reconciles them into a single linear chain so future migrations can be added. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Simulation model already uses these fields for regional economy simulations (e.g., filtering a dataset to a specific state), but no Alembic migration created the columns. This aligns the DB schema with the existing Python model. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The self-referential parent_report_id FK on reports was never read or written by any code. Removing it keeps the schema clean before we build further on the Report model in later migration tasks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enables users to save simulations to their list across sessions, following the same pattern as user_policies and user_household_associations. Includes model, autogenerated Alembic migration, API endpoints with ownership verification on update/delete, and 15 tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enables users to save reports to their list across sessions, following the same pattern as user_simulations and user_policies. Includes a last_run_at field for tracking when a report was last calculated. Model, autogenerated Alembic migration, API endpoints with ownership verification, and 16 tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…imulations/economy) Non-blocking POST endpoints that create simulation records and return immediately with pending status. GET endpoints for polling status and retrieving results. Region validation for economy sims, deterministic UUID deduplication, and 19 tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These report-based Modal functions are called by _trigger_household_impact() when agent_use_modal=True. They load the Report and its Simulations from the database, run household calculations (reusing _calculate_household_uk/us from household.py), store results in simulation.household_result, and mark the report as completed. Follows the economy_comparison_uk/us error handling pattern with raw SQL fallback for failure marking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements the US counterpart to _run_local_economy_comparison_uk so that US economy comparisons work when agent_use_modal=False (local dev, testing, CI). Uses us_latest model, PolicyEngineUSDataset, and US-specific programs (income_tax, employee_payroll_tax, snap, tanf, ssi, social_security). Updates _trigger_economy_comparison to call it instead of falling back to Modal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #83
Summary
filter_field/filter_valuecolumns to simulations tableparent_report_idfrom Report modeluser_simulation_associationstable + CRUD endpoints (15 tests)user_report_associationstable + CRUD endpoints (16 tests)/simulations/householdand/simulations/economyendpoints (19 tests)household_impact_ukandhousehold_impact_usModal functions_run_local_economy_comparison_uslocal fallbackTest plan
alembic upgrade head)agent_use_modal=False🤖 Generated with Claude Code