Skip to content

Refuse /v2/reports and /v2/simulations submissions whose policies set parameters the running catalog lacks #4285

Closed

Description

@anth-volk

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

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