Skip to content

Remove the Simulation Entrypoint's unused create functions without keys, run-reuse search and output-bucket setting #1081

Closed

Description

@anth-volk

After #1074, the Simulation Entrypoint finds or creates every simulation, report and run by its definition key, and the Public API's partial unique indexes decide when identical requests share a row. The service no longer calls the code that created those rows without keys, or the search for an earlier succeeded simulation run to reuse. That code is still in the repository, and only tests call it.

Remove it, with no change in behaviour:

  • Create functions that use no keys in policyengine-simulation-persistence: insert_economy_report, insert_economy_simulation, insert_household_report and insert_budget_window_report, their input types (NewEconomyReport, NewEconomySimulation, ReportSimulation, NewHouseholdReport, HouseholdReportSimulation, NewBudgetWindowReport, BudgetWindowYear) and the store methods that wrap them (EconomyRunStore.create_report, create_simulation and create_budget_window_report, HouseholdReportStore.create_report). Tests that store records created before keys insert those rows directly instead.
  • The run-reuse search: find_reusable_run, find_reusable_run_of, ReusableRun, RunReuse, search_by_definition, search_own_runs, the reuse parameters of the store's input reads, which the service always passes as None, and the reusable_run and reusable_runs fields they fill.
  • RerunSide.reused, which every re-run refuses when true.
  • The Simulation Entrypoint's V2_SIMULATION_OUTPUT_BUCKET setting: ServiceSettings.output_bucket, Settings.v2_simulation_output_bucket, the deploy script's format check and runtime variable, and the workflow's passing of it to the Cloud Run deploy step. The Stage 12 steps, scripts and Modal workers that write simulation output files to that bucket keep it.

The docs (the persistence and entry READMEs, DEPLOYMENT.md, the Stage 12 migration doc and docstrings) then describe only what remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions