Repository navigation
Add a supplied-record Social Security calculator and shared PIA paths - #10401
Merged
Merged
Conversation
MaxGhenis
marked this pull request as ready for review
October 23, 2026 09:19
This was referenced Oct 23, 2026
7 tasks done
Contributor
Author
|
US + core hub merge audit, us#10401 at
|
MaxGhenis
added a commit
that referenced
this pull request
Oct 27, 2026
Main's #10401 (ee6c1c5) added the ss-calculator-engine and ss-calculator-differential Rest groups beside this branch's social-security-inputs group. The Makefile keeps all three groups, their file lists and recipes, and lists all three files in REST_LISTED_TESTS so the core and remaining groups don't run them twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds an opt-in household calculator for supplied monthly AIME, unreformed eligibility PIA, and one identified supplied-ratio survivor. It produces an actual monthly entitlement/check ledger and annual gross totals. Existing public benefit inputs keep their current behavior.
Implemented: design v3 D0, 4a-1, shared 4d, C1's inverse convention, and applicable v3.1 amendments M1–M4, M6 and M8.
e82050412bexception). Every survivor must now explicitly supplyss_calculator_prior_disability_eligibility: 1 asserts initial disability eligibility before death, 0 asserts no prior eligibility; default -1 or any other value raises before calculation. Prior eligibility requires an authoritative computation basis, while no prior eligibility permits derivation. S.770 §2(c)(2)(B) covers workers who “initially became eligible for old-age or disability insurance benefits before January 1, 2026”.cc165d4d85) withholds whole months by default. A partial month’s remainder waits for closed-year reporting, posts inss_calculator_earnings_test_settlement_monthwhen supplied for the earnings year, and stays pending otherwise.ss_calculator_immediate_earnings_test_paymentdefaults to false; setting it requests immediate partial payment. For January 2026 commencement, $800 monthly benefits and $33,400 earnings, annual deductions are $4,460 and entitlement is $5,140: default 2026 checks are $4,000 with $340 deferred, or $4,340 with the immediate option. A March 2027 settlement posts the $340 then. This follows SSA Handbook §1806.2 and POMS RS 02501.110. Result fields include rowdeferred_earnings_test_paymentandpayment_amount; annualdeferred_earnings_test_paymentandsettlements(each settlement identifiesearnings_year,payment_month, andamount); and API outputss_calculated_deferred_earnings_test_payment. Existing monthly and annual payment outputs include dated settlements.fa7ddfad8fcdc50b289a8bc786cef2fa49e620ed) and exposesss_calculated_retirement/ss_calculated_survivors, with the subsequent public-selector wiring documented. It adds no_reportedlayer. Historical bends use a separate table because importing that branch's legacy-scale backfill would change existing pre-2015ss_piaoutputs with the calculator disabled.SSA sources: 2023 Supplement Appendix D, COLA computation, earnings-test examples, early/delayed retirement, bend points, COLA history, POMS benchmark, PIA rounding, benefit rounding, 1999 correction, and WINDEX. The contributed preset cites introduced S.770 section 2; indexing structure cites SSA Policy Brief 2010-03 and the OACT memorandum.
Validation at
04c2b04848e93abff41c113b11433358924cd86c: 331/331 unique cases passed in run 40431122991, comprising 323 Python cases and eight native SSA YAML cases. JUnit/resource receipts confirm complete successful processes, no failures or errors, and no duplicate case IDs. No local microsimulations were run.test_ss_pia_service.pytest_ss_cola_schedule.pytest_ss_calculator_parameters.pytest_ss_household_calculator.pytest_ss_calculator_engine.pytest_ss_calculator_differential.pytest_rest_python_groups.pyss_calculated_benefit.yamltest_pr_runner_budget.pytest_make_test_matches_ci.pyLocal test files ran alone in the foreground, with all five numeric thread caps at 4,
OMP_WAIT_POLICY=PASSIVE, and the prescribed 4 GiB/1,800-second wrapper; country-importing files started only at load <=100. Complete local runs include 114 household, eight differential, 73 PIA, 19 COLA and 17 parameter cases, both CI alignment guards (13 and two cases), plus both new prior-eligibility API cases run separately. Three local attempts were incomplete: the full engine reached 13 cases before its time cap; the routing guard reached all 57 cases but timed out during teardown; the unmodified native YAML CLI completed six of eight cases before its RSS cap (4.01 GiB peak, exit 137, no assertion failure). These partial receipts are not counted as full-file passes. The final-head CI receipts above cover every case.The retained 53-file SSA receipt is 363 passed at
88bfa1bd1df4082ac8f597b185942fb96009d9aa. Its 59.3-minute runtime exceeds the 45-minute rerun threshold, so it is not rerun or included in the current-head total. That historical run used Core's unchanged parsing/assertions with a source-reviewed isolated-child adapter. Evidence and adapters remain untracked.The differential compares exact legacy SSA outputs, taxes/benefits and every intermediate reached by the reference across five representative household situations; two override cases and a historical-input/IRMAA case cover ingress neutrality. Source comparison confirms all pre-existing authored variables, constructors, data code and parameter values are unchanged. The sole old helper edit excludes only new calculator source/output names from IRMAA's tax-year-history discovery. This is household/source evidence; population validation stays with the hub.
The calculator Simulation API files exercise parameter-system isolation, mixed string/money vectors, exact-period history, cache/output adapters and the differential dependency closure. Each now runs in its own Rest group,
ss-calculator-engineorss-calculator-differential, with separate JUnit and resource reports. Neither runs intest-other-python-spm. Main's existing Rest planner places both groups while preserving one pytest process per file; the files inherit main's existing Rest thread caps. The workflow files match main:git diff eab22cd3a8fd8bac3128f429fb0fef74eb5656ae -- .githubis empty. No workflow jobs, steps or timeouts are introduced.Local macOS/Python 3.13.9 measurements under the prescribed cap recorded engine peak RSS 2.98 GiB before its full-file timeout (incomplete measurement) and differential peak RSS 2.45 GiB over its successful 733.08-second run, including startup/teardown. The two new engine assertion cases passed separately in 1,091.47 seconds at 1.71 GiB peak RSS. Complete final-head Linux Rest measurements confirm that both dedicated groups remain within the Makefile's approximately 10 GB per-process target:
ss-calculator-engine/test_ss_calculator_engine.pyss-calculator-differential/test_ss_calculator_differential.pyFinal-head CI run 40431122991 completed successfully. Its Microsimulation job total is 38:07, against main's observed 38–42 minutes. Its completed SPM step took 20:23; full per-step times from the jobs API: Set up job: 0:02; Checkout repo: 0:06; Update system certificate authorities: 0:19; Set up Python: 0:01; Install uv: 0:05; Resolve latest compatible PolicyEngine Core: 0:01; Install dependencies: 0:03; Turn off default branching: 0:00; Run SPM Python tests: 20:23; Run microsimulation tests: 17:01; Upload simulation timing and memory reports: 0:02; Post Install uv: 0:00; Post Set up Python: 0:00; Post Checkout repo: 0:00; Complete job: 0:00. All 33 jobs completed successfully; no CI checks remain pending.
Hypothesis invariants cover nondecreasing PIA for every path, baseline equality at eligibility, zero before entitlement, earnings-test reductions bounded by benefits, and survivor interval recovery that reproduces the supplied payment. A new 80-example authoritative-survivor property requires the explicit prior-eligibility answer, checks equality outside the pre-62/pre-2026/flag-false exception, and independently verifies that both paths retain the 95% first factor, differ only through the first bend, and satisfy prior ≥ no-prior. Named examples cover PIA segments, rounding/COLA sequencing, claiming ages, FRA-year earnings, older-cohort recomputation and every M1 boundary.
Scope limits: historical earnings tests before 2000 require a no-trigger assertion; positive sub-dollar entitlements before December 2006 (source checks before January 2007) fail because their manual year-end payment timing is not implemented. Special monthly/service tests and prior-withholding actuarial adjustments also require no-trigger assertions. These restrictions avoid applying modern rules to unsupported histories. E2/E3 policy computation and 4a-2 histories belong to their separate modules; this route accepts resolved E3 decisions and frozen indexing paths. Medicare deductions, full family/disability/WINDEX/minimum computations and later earnings recomputation are outside this route.
impact: none under current law (opt-in route). Verified by the hub at
04c2b04848: every model change is a new file (the calculator variables, thetools/social_securitypackage and new parameters), and no existing formula reads them;ss_piaand the uprating extension read onlypia.formula_factors, not the newpia.bend_points. The one shared change, intools/general.py, skips the newss_calculator_/ss_calculated_names in the IRMAA lookback, and no main variable has those prefixes.axiom: TheAxiomFoundation/rulespec-us#1887, TheAxiomFoundation/rulespec-us#1888 and TheAxiomFoundation/rulespec-us#1889 queued (missing current-law modules; corpus release/re-pin, payment-guidance ingestion and signed-encoder approval); TheAxiomFoundation/rulespec-us#1707 queued, extended with a comment (delayed-credit timing), with validation dependencies tracked in TheAxiomFoundation/rulespec-us#782. Contributed reform paths are n/a: proposals.