Stage 6 of the report-output migration on policyengine-api.
Scope:
- accept and persist explicit
report_spec payloads for new reports
- key report creation/reuse by canonical report identity instead of the old thin
(country, simulation_1, simulation_2, year, api_version) rule
- resolve report reads through canonical parents plus display-run selection
- preserve explicit report definitions across later PATCH/sync traffic
- preserve execution metadata from existing runs instead of rebuilding it from mutable parent rows
- validate explicit aliases by canonical report identity
Acceptance criteria:
- distinct explicit economy report specs create distinct report rows
- aliased reads resolve through canonical parents without recreating current-version parent rows
- later PATCH/sync does not silently downgrade explicit report specs
- later PATCH/sync does not drift stored run metadata unless explicitly overridden
- old malformed legacy rows remain readable in compatibility mode
Non-goals:
- historical backfill of
report_identity_* fields and rebuilt alias rows (handled separately in the updated stage 4 script)
- frontend UI changes to view older runs
- pinned run behavior
Stage 6 of the report-output migration on
policyengine-api.Scope:
report_specpayloads for new reports(country, simulation_1, simulation_2, year, api_version)ruleAcceptance criteria:
Non-goals:
report_identity_*fields and rebuilt alias rows (handled separately in the updated stage 4 script)