Skip to content

Add stock-flow accounting to annual mortality trajectories - #440

Draft
MaxGhenis wants to merge 2 commits into
dynamics-mortality-trajectory-20260909from
dynamics-accounted-trajectory-20260909
Draft

Add stock-flow accounting to annual mortality trajectories#440
MaxGhenis wants to merge 2 commits into
dynamics-mortality-trajectory-20260909from
dynamics-accounted-trajectory-20260909

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Adds optional annual accounting to the synthetic mortality trajectory. Each new graph node reconciles frozen opening/closing populations against deaths explicitly declared by the mortality transition, with separate count, weight, and revaluation summaries. Failed or blocked transitions retain their diagnostics and do not turn stale snapshots into inferred deaths.

The existing mortality nodes, population results, cache keys, scientific evaluations, and historical projection engine remain unchanged. Accounting failures remain separate from mortality outcomes. Raw snapshot types and IDs are validated before pandas conversion, and malformed diagnostics produce inspectable refusals.

This draft stacks on #436 and includes the unchanged stock-flow accountant from #439. It adds no native population inputs or scientific acceptance claim. Household location and membership transport remains a separate documented contract extension; unsupported fields are rejected.

Validation: 221 focused tests pass, with four platform-conditional long-double cases skipped on this Mac; 40 new integration cases cover cache reuse, holdout isolation, extinction, failed/blocked transitions, malformed inputs, and accounting refusals. Independent source review is clean. Black79, Ruff, historical source-identity checks, an executed synthetic documentation example, and standalone Quarto rendering pass. The two Python-version graph CI jobs include the new exact test file.

@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
social-security-model Ready Ready Preview Sep 9, 2026 10:51pm UTC

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant