Repository navigation
Conversation
A new package of pure functions for the starting stock. pia.py holds the forward rule from a PIA at eligibility to a monthly benefit (COLA factor, dime floor after each adjustment, claim factor, dollar floor), its unrounded inverse, and the bound on the gap statutory rounding opens between them. claim_age.py draws a whole claim age from award shares by a counter-based SHA-256 uniform keyed by seed and person id, and a single year of age behind a top-coded age. limits.py names four limits reported beside each inferred PIA. Tests use invented numbers only: worked examples and error paths in test_pia.py, the eight package invariants as Hypothesis tests in test_pia_properties.py, and a differential test against the bridge's carry_pia_forward. tests/starting_stock/conftest.py installs an import guard that refuses two modules no starting-stock test may load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/starting_stock/test_pia.py (91) and test_pia_properties.py (11), collected by name: 26,654 + 102 = 26,756. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The finder stays in sys.meta_path for the rest of a pytest session, so in a full-suite run it would refuse the two modules to test modules collected after tests/starting_stock. It now refuses an import only while code of populace_dynamics.starting_stock or tests.starting_stock is on the stack. The guard test skips, with its reason, in a session where another module loaded one of the two first, since a cached module bypasses every finder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
This pull request adds
populace_dynamics.starting_stock, pure functions for the Microcosm start's task T7, which infers the PIA behind a Social Security benefit in payment.pia.pycarries a PIA at eligibility forward to a monthly benefit. It applies each year's COLA, floors the amount to the dime after each adjustment, applies the claim factor, then floors to the dollar. It also inverts that rule without rounding and bounds the gap that statutory rounding opens between the two.claim_age.pydraws a whole claim age from award shares. It also draws a single year of age for an age stored as a top code (80 or 85). Each draw takes a SHA-256 uniform keyed by seed and person id.limits.pynames four limits that we report beside each inferred PIA.The tests use invented numbers only, and the unit tier gains 102 of them:
test_pia.py(91) holds worked examples and error paths.test_pia_properties.py(11) runs the package's eight invariants as Hypothesis property tests. It also checksbenefit_from_piaagainstcarry_pia_forwardinpopulace_dynamics.bridge.policyengine_uson the domain both functions share.tests/starting_stock/conftest.pyinstalls an import guard. While starting-stock code is on the stack, it refuses two modules that no starting-stock test may load.tests/tier_counts.jsonadds the 102 tests to the unit tier. Another branch of this work changes the same line, and we'll reconcile the two before merge.Open
single_year_agedraws a single year of age for a person whose age the file stores as 80 or 85, from shares the caller passes and with a key of its own. Candidate H-D in the registration draft (#607) also needs a single age for these people. In a later change, we plan one shared draw for both, with one function and one key, so each person gets one age. Once we pin SSA's area population by single age and sex, that table will supply the draw's shares. That change would also settle five points:person_id;sexargument;How we built this
Claude Opus 5.5 wrote these commits in a separate job, under a brief that names the files it may read and the commands it may run. It reported six departures from that brief, and none reached a file the brief closed:
pytest --collect-only -m uniton its two modules, against the brief's rule that test runs name their modules and use no marker.tests/, the repository root andsrc/populace_dynamics/ss/, and opened no file it found that way.[tool.black],[tool.ruff]and[tool.pytest.ini_options]sections ofpyproject.toml, which the brief didn't name.CLAUDE.mdinto its context.🤖 Generated with Claude Code