Add opt-in annual population stock-flow accounting - #439
Draft
MaxGhenis wants to merge 1 commit into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Annual projections need an explicit account of people who enter or leave, including entrants who disappear before the next saved slice. Add an opt-in
reconcile_periodinterface that checks declared arrivals/exits against opening and closing person sets and reports weight flows, separate weight changes, and arithmetic residuals. It rejects inconsistent declarations, lossy identifier coercion, malformed weights, and unrepresentable weight summaries; serialized provenance cannot mutate the account.The historical engine remains unchanged. A path-exact source exclusion and import-reachability check keep the accountant outside the sealed projection; the guard now includes implicit parent-package initializers. This is accounting coherence only: event-log completeness and true causes are caller responsibilities, and no scientific gate or numerical benchmark is changed.
Validation: 107 focused checks pass locally, with four extended-precision cases skipped on this Mac and included for Linux CI. Coverage includes synthetic adapters in the real projection loop, entry and exit within one period, malformed declarations, integer boundaries, numeric edge cases, immutable provenance, and source identity. Black79/Ruff pass; the documented example executes and the standalone Quarto page renders. New test inventory: 93 unit cases (including four platform-conditional cases) and four source-guard cases in the existing artifact-tier module. No native population or benchmark evaluation was run.
Independent source review is clean after fixes and re-review. The draft is for review; no merge, data publication, or manual deployment is included.