You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Start each side's cliff calculation when a report asks for cliffs #1098
include_cliffs: true is refused today: POST /reports answers 422 cliffs_not_available, and so does a re-run of a report stored before keys whose inputs hold include_cliffs: true. That was C1 · 24's interim answer, while identical requests started sharing reports and simulation runs by key, so a cliff request could no longer change what a shared run calculates.
Cliffs are now a calculation of each simulation run of its own (C1 · 24's answer 4b). A run has one cliff result, its cliff gap and cliff share, in the Public API's new cliff_impacts table (PolicyEngine/policyengine-api#4327). The v2 simulation worker calculates it when its call's context names the row (#1096).
What's needed in the Simulation Entrypoint:
POST /reports (economy) and POST /reports/{report_id}/runs with include_cliffs: true start a cliff calculation for each side's simulation run that has none. They join one being calculated or already calculated, whether the report run was created or joined. Two identical requests start one calculation per run.
include_cliffs is never stored, never in a key, and never passed to the coordinator.
A report stored before keys that asked for cliffs is re-run with its runs' cliffs instead of a 422.
A budget window's or household report's re-run asking for cliffs is refused, since neither calculates them.
The create and re-run answers name each side's cliff calculation and its status.
Activity