Problem
Multi-year budget-window runs now expect each child year to validate as the gateway-owned SingleYearMacroOutput, but the simulation worker had been returning only the newer row-oriented PolicyEngine 4.4.x subset (budget, decile_impacts, program_statistics, etc.). That caused budget-window parent jobs to fail once live child simulations returned truncated outputs.
This also risked regular /jobs/{job_id} callers receiving a reduced macro result instead of the legacy full single-year report shape expected by existing app/client code.
Desired behavior
- Single-year macro simulations should return the full legacy macro output shape again.
- Budget-window
outputsByYear should contain the full single-year macro outputs for each year.
- The newer row-oriented worker fields can remain as additional passthrough fields.
- Null-valued legacy sections such as
wealth_decile, intra_wealth_decile, cliff_impact, and regional impact fields should remain present as JSON null, not be omitted by response serialization.
- Tests should assert the full annual shape across worker mapping, budget-window validation/orchestration, response serialization, and staging integration expectations.
Notes
The regression appears to have come from the PolicyEngine 4.4 worker migration, which replaced the old Simulation.calculate_economy_comparison().model_dump(mode="json") path with a hand-built result based on economic_impact_analysis. That hand-built result did not reconstruct the full legacy macro report shape.
Problem
Multi-year budget-window runs now expect each child year to validate as the gateway-owned
SingleYearMacroOutput, but the simulation worker had been returning only the newer row-oriented PolicyEngine 4.4.x subset (budget,decile_impacts,program_statistics, etc.). That caused budget-window parent jobs to fail once live child simulations returned truncated outputs.This also risked regular
/jobs/{job_id}callers receiving a reduced macro result instead of the legacy full single-year report shape expected by existing app/client code.Desired behavior
outputsByYearshould contain the full single-year macro outputs for each year.wealth_decile,intra_wealth_decile,cliff_impact, and regional impact fields should remain present as JSONnull, not be omitted by response serialization.Notes
The regression appears to have come from the PolicyEngine 4.4 worker migration, which replaced the old
Simulation.calculate_economy_comparison().model_dump(mode="json")path with a hand-built result based oneconomic_impact_analysis. That hand-built result did not reconstruct the full legacy macro report shape.