Skip to content

Stage 6: make explicit report definitions and run metadata canonical #3499

@anth-volk

Description

@anth-volk

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

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