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
Refuse /v2/reports and /v2/simulations submissions whose policies set parameters the running catalog lacks #4285
A saved policy keeps the catalog version it was made with, and nothing updates it when PolicyEngine.py changes. The Public API already reports each policy's missing_parameters (the parameters it sets that the running catalog version no longer has) on policy reads, and POST /v2/household-calculations refuses such a policy with 422 missing_parameters before it calls the simulation service.
POST /v2/reports and POST /v2/simulations (#4281) check nothing of the kind. A report or simulation whose policy sets a removed parameter is sent to the simulation service, and its run fails inside the calculation, when core's reform builder cannot find the parameter, instead of being refused with a reason the caller can act on.
Wanted:
POST /v2/reports and POST /v2/simulations refuse a policy that sets parameters the running catalog version lacks, answering 422 with code missing_parameters and those parameters, in the same shape as POST /v2/household-calculations, and do not call the simulation service.
A report checks both its baseline's and its reform's policies.
A submission whose policies set only parameters that exist starts as before.
The check is reusable, since re-running a report or simulation will need it too.
Not covered: a parameter that keeps its name but changes its structure, unit or meaning passes a check by name.
Activity