diff --git a/docs/design/track_b_r3_arf_recompute.md b/docs/design/track_b_r3_arf_recompute.md index 41a386c13..2510d0048 100644 --- a/docs/design/track_b_r3_arf_recompute.md +++ b/docs/design/track_b_r3_arf_recompute.md @@ -397,11 +397,11 @@ case or removed from a denominator. | Deceased RIB number holder | Hypothetical adjustment at would-have-been FRA, final RIB deductions before death month; RS 00615.598. The result is a survivor-limit component, never payment to the deceased | | Ordinary AIME RIB recomputation | Supported eligibility from 1983, complete original basis and histories, continuous declared entitlement; 415(f)(2), CFR 404.284 | | Death-year recomputation at or after FRA | Supported, effective death month, COLAs cut off at that month; 415(f)(2)(D)(ii) | -| Earlier reentitled spouse adjustment | `arf_spouse_reentitlement_before_fra`; RS 00615.201A.1 conflicts with RS 00615.491A on whether nonentitlement months are removed at FRA or on earlier reentitlement. Both readings are quoted below. A known prior terminating month automatically triggers this refusal before FRA; neither reading is silently admitted | +| Spouse reentitled before FRA | Supported: the original reduction months apply until FRA, and the ARF at FRA removes the terminated months; 402(q)(1)(B), (q)(7)(C); RS 00615.201A.1 (reading below; RS 00615.491A's earlier removal is not followed) | | Own entitlement after spouse but before ARF | `arf_spouse_own_after_spouse_before_arf`; sequence not settled by the captured .500 procedures | | Disabled widow and widow dual DIB or RIB | `arf_disabled_widow`, `arf_widow_dual_dib`, `arf_widow_dual_rib`; .590/.595 conversion and earlier reduction histories require additional state | | RIB-LIM widow | `arf_widow_rib_limit`; .585 requires its separate cap and sometimes no increase despite ARF | -| Nonbinding widow child-in-care floor | `arf_widow_child_care_without_rate_increase`; conflicting readings below | +| Nonbinding widow child-in-care floor | `arf_widow_child_care_without_rate_increase`; refused pending Max (below) | | Historical widow FRA | `arf_widow_fra_before_1911` or `arf_historical_widow_fra_conflict`; old FRA 62 lies outside G's survivor surface; disputed 1911 cohort below | | Historical ARF rounding or other suspensions | `arf_initial_entitlement_before_1978`, `arf_payment_before_1983`, `arf_other_suspension`; historical reduction-ratio/rounding rules and nonwork suspensions require separate procedures | | Historical recomputation eligibility | `recompute_eligibility_before_1983`; CFR .284's historical upward rounding differs from the shared modern helpers | @@ -633,13 +633,16 @@ need correction. Tests also assert the derived whole-dollar amounts: 429 initially, 448/512/569 for the candidate and 471/539/599 for the original after COLAs. -## Findings and readings requiring judgment +## Readings taken and refusals kept -**Ruling d1418 (Max, 2026-10-12): keep the current defaults, and reopen any -one when a population target needs it.** The three readings below that -change money (survivor FRA for births 1911-01-02 to 1912-01-01, nonbinding -widow(er) child-in-care credits, and the timing of a reentitled spouse's -termination credits) stay refused by name and counted in denominators. +Ruling d1418 (Max, 2026-10-12) kept the three money-changing readings below +as named refusals until a population target needed them. Max's 2026-10-20 +delegation makes each single reading the session's call under his +principles (P1 statute first; P2 regulations are law; P3 the agency breaks +true ties), logged in the source-conflict rulings; patterns and collisions +between principles go to him. This section records that pass (October 23, +2026). Each reading below names its basis; every remaining refusal keeps its +row and weight in the denominators. RS 00615.015 says "In 2/1998 Demi has 37 RF." Its table and the same example's payment text say "Demi - $1122 starting 2/2000". Tests pin both; @@ -654,55 +657,107 @@ cent-valued example summing $24 was found. This intended oracle divergence is named `test_minimized_cent_earnings_float_aime_boundary_is_intended_correction`. Python's ties-to-even bend-point rounding also differs from the statute at an exact half dollar; the named tie test pins the statutory upward result. -These are arithmetic diagnostics, not competing statutory interpretations. - -Three source readings change money and require Max's judgment: - -1. **Historical widow cohort.** Source conflict - `us:oasdi-survivor-fra-1911-births`. RS 00615.003 says "People Born Before - 1/2/1911" and "FRA for widow(er)'s benefits was age 62", then "People - Born from 1/2/1911 Through 1/1/40" at age 65. CFR 404.409 says "Before - 1/2/1912 62 years." and "1/2/1912—1/1/1940 65 years." Births - January 2, 1911 through January 1, 1912 are refused, including the - public FRA helper. An invented January 2, 1911 birth claiming January - 1973 with PIA $1,000 gives $829 under FRA 65 (36/60 of 28.5 percent) - versus $1,000 under FRA 62: $171 per month. Neither reading is silently - admitted. -2. **Nonbinding widow child-in-care floor.** Source conflict - `us:oasdi-arf-widow-child-in-care-credits`. CFR 404.412(a)(4) credits - "any month in which she or he had in her or his care a child of the - deceased insured individual and for which the child was entitled to - child's benefits". RS 00615.482 instead specifies "widow(er)'s - benefits were increased to the mother or father's rate." The Act - 402(q)(7)(D) refers to "any month in which the reduction in the amount - of such benefit was determined under paragraph (5)(D)". The supported - input certifies actual mother/father-rate months. Nonbinding caregiving - histories require the named refusal flag. At age 64, FRA 67, PIA $1,000, - 36/84 of 28.5 percent gives $877.80. Crediting six nonbinding caregiving - months under the broader CFR reading gives $898.20: $20.40 per month. - Both counterfactual amounts and the explicit refusal are tested. -3. **Spouse reentitlement before FRA.** Source conflict - `us:oasdi-arf-spouse-reentitlement-credits`. RS 00615.201A.1 says "After - 12/72 a spouse reentitled prior to FRA as a spouse on the same earnings - is reduced the same number of months as the earlier entitlement. An - ARF at FRA will remove all months of nonentitlement." RS 00615.491A - says "Beginning in 1/78, if a reduced spouse is terminated and then - reentitled, (months in which the spouse's benefits were terminated will - be eliminated from the reduction factor when the spouse is reentitled." - The unmatched parenthesis is present in the captured .491 text. The - first reading keeps the original reduction months until FRA; the second - removes terminated months on reentitlement. For an invented birth on - January 2, 1960, first reduced entitlement in January 2022, termination - in February 2022 and reentitlement in March 2022, unreduced benefit - $650 and FRA in January 2027 give 60 original reduction months. - Keeping all 60 under .201 gives $422.50 and whole-dollar $422. - Removing February under .491 leaves 59 months and gives $425.20 and - whole-dollar $425, a $2.70 monthly benefit difference and $3 difference - after whole-dollar rounding. The named refusal - `arf_spouse_reentitlement_before_fra` remains in force for the March - 2022 claim. Both counterfactual amounts and the refusal are pinned by - `test_spouse_reentitlement_counterfactual_readings_keep_named_refusal`; - the source and documentation quote test keeps both readings visible. +These are arithmetic diagnostics, not competing statutory interpretations: +the Act's own rounding rules decide both. + +### Reading taken: spouse reentitlement before FRA + +Source conflict `us:oasdi-arf-spouse-reentitlement-credits` (P1, statute +first). RS 00615.201A.1 says "After 12/72 a spouse reentitled prior to FRA +as a spouse on the same earnings is reduced the same number of months as +the earlier entitlement. An ARF at FRA will remove all months of +nonentitlement." RS 00615.491A says "Beginning in 1/78, if a reduced spouse +is terminated and then reentitled, (months in which the spouse's benefits +were terminated will be eliminated from the reduction factor when the +spouse is reentitled." The unmatched parenthesis is present in the captured +.491 text. + +The Act settles the timing. Section 402(q)(1)(B)(i) reduces each month +before retirement age by "the number of months in the reduction period for +such benefit (determined under paragraph (6)), if such benefit is for a +month before the month in which such individual attains retirement age". +Clause (ii) substitutes the adjusted reduction period, which (q)(7)(C) +shortens by "any month for which such individual was not entitled to such +benefits because of the occurrence of an event that terminated her or his +entitlement to such benefits", only "if such benefit is (I) for the month +in which such individual attains age 62, or (II) for the month in which +such individual attains retirement age". A spouse's reduction period begins +with the first month of the original certificate ((q)(6)(A)(ii)), which +remains effective "for the month in which it is filed and for any month +thereafter" ((q)(5)(B)(i)). RS 00615.201A.1 states this timing; .491A's +removal at reentitlement departs from it and is not followed. + +For an invented birth on January 2, 1960, first reduced entitlement in +January 2022, termination in February 2022, reentitlement in March 2022, +unreduced benefit $650 and FRA in January 2027, the reduction period has 60 +months. March 2022 through December 2026 pay $422.50 ($422). The January +2027 ARF removes February 2022, leaving 59 months and $425.20 ($425). The +.491A reading would pay $425.20 from March 2022, $2.70 a month more. The +former refusal `arf_spouse_reentitlement_before_fra` is withdrawn, with its +reason value. `test_spouse_reentitlement_takes_the_statutory_timing` pins +the statutory quotes and both amounts; +`test_spouse_reentitled_before_fra_keeps_original_months_until_fra` pins the +public API; the Hypothesis property +`test_reentitled_spouse_keeps_original_months_until_fra` checks, for any +terminated history and any pre-FRA month, that the payment equals the +never-terminated claim and G's 60-month spouse reduction with zero +tolerance, and that the FRA adjustment credits exactly the terminated +months, so the benefit cannot fall at FRA. + +### Refused: widow(er) FRA for births January 2, 1911 through January 1, 1912 + +Source conflict `us:oasdi-survivor-fra-1911-births` (refusal kept; it cannot +change a computed amount). RS 00615.003 says "People Born Before 1/2/1911" +and "FRA for widow(er)'s benefits was age 62", then "People Born from +1/2/1911 Through 1/1/40" at age 65. CFR 404.409 says "Before 1/2/1912 62 +years." and "1/2/1912—1/1/1940 65 years." + +A widow(er) of this cohort has a reduced benefit only if first entitled +before full retirement age, which the cohort attains during 1973 under FRA +62 and during 1976 under FRA 65. Both precede January 1978, which +`arf_initial_entitlement_before_1978` refuses independently; entitlement +from 1978 falls after both ages and has no reduction months. The FRA helper +must return one month, so it still refuses the cohort by name, and +`apply_arf` keeps the same reason. Should a pre-1978 path ever be built, the +Act points to POMS's boundary: Pub. L. 92-603 §102(i) applies the 1972 +widow amendments "with respect to monthly benefits ... for months after +December 1972", and a birth on January 2, 1911 attains 62 on January 1, +1973. (The provision is excerpted from the statutory notes of the same +LII 42 U.S.C. 402 body pinned in this module's manifest, in +`lii_usc_402q_415f_excerpts.txt`.) The regulation's January 2, 1912 boundary would then be a regulation +at odds with its statute, which P2 returns to Max. An invented January 2, +1911 birth claiming January 1973 with PIA $1,000 gives $829 under FRA 65 +(36/60 of 28.5 percent) versus $1,000 under FRA 62; that claim is outside +the supported window under either reading. + +### Refused pending Max: nonbinding widow(er) child-in-care months + +Source conflict `us:oasdi-arf-widow-child-in-care-credits`. CFR +404.412(a)(4) credits "any month in which she or he had in her or his care +a child of the deceased insured individual and for which the child was +entitled to child's benefits". RS 00615.482 instead specifies "widow(er)'s +benefits were increased to the mother or father's rate." The Act +402(q)(7)(D) refers to "any month in which the reduction in the amount of +such benefit was determined under paragraph (5)(D)", the mother/father +floor, while (q)(7)(B) gives wife's and husband's benefits the plainer test +"any month in which such individual had in his or her care ... a child of +such person entitled to child's insurance benefits". Congress used +different words for widows. On the better reading the Act and SSA's +manual credit only months in which the floor set the benefit, while the +regulation copies the wife's wording and credits every caregiving month. +A broader reading of "determined under paragraph (5)(D)" is arguable: +(5)(D) is applied in every caregiving month, even when it does not bind, +and on that reading the three sources could be harmonized. + +So the regulation may reach past its statute. P2 returns such a case to +Max, and whether P2 covers SSA's 20 CFR at all (it names Treasury +regulations) is itself unruled, so both are queued together as decision +d1920, recommending the narrower statutory reading. Until he rules, the supported input +certifies actual mother/father-rate months and a nonbinding caregiving +history keeps the named refusal. At age 64, FRA 67, PIA $1,000, 36/84 of +28.5 percent gives $877.80; crediting six nonbinding caregiving months +under the regulation gives $898.20, $20.40 a month more. Both +counterfactual amounts and the explicit refusal are tested. The $1-after-COLAs rule is settled expressly by RS 00605.501. Historical upward rounding is different law, not a source erratum. No choice between diff --git a/src/populace_dynamics/track_b/arf.py b/src/populace_dynamics/track_b/arf.py index 0e855f410..2aa0e3230 100644 --- a/src/populace_dynamics/track_b/arf.py +++ b/src/populace_dynamics/track_b/arf.py @@ -25,8 +25,9 @@ money, dates and canonical enum members are checked immediately. Repeated original-claim evaluation preserves both dollar amounts and coverage refusals. Contents are validated before coverage is decided, without consuming caller state. -Pre-FRA spouse reentitlement is refused because RS 00615.201A.1 and -.491A conflict on when termination months leave the reduction factor. +A spouse reentitled before FRA keeps the original reduction months until +FRA, when the ARF removes the terminated months (402(q)(1)(B), (q)(7)(C); +RS 00615.201A.1). RS 00615.491A's earlier removal is not followed. Unsupported configurations raise ARFConfigurationUnsupported, in the shared FamilyConfigurationUnsupported family, with exactly ARFUnsupportedReason. @@ -110,7 +111,6 @@ class ARFBenefitKind(Enum): class ARFUnsupportedReason(Enum): INITIAL_ENTITLEMENT_BEFORE_1978 = "arf_initial_entitlement_before_1978" PAYMENT_BEFORE_1983 = "arf_payment_before_1983" - SPOUSE_REENTITLEMENT_BEFORE_FRA = "arf_spouse_reentitlement_before_fra" DISABLED_WIDOW = "arf_disabled_widow" WIDOW_DUAL_DIB = "arf_widow_dual_dib" WIDOW_DUAL_RIB = "arf_widow_dual_rib" @@ -421,14 +421,6 @@ def __post_init__(self): own is not None and own.sequence is SpouseOwnSequence.AFTER_SPOUSE_BEFORE_ARF ) - or ( - claim.kind is ARFBenefitKind.SPOUSE - and payment < fra - and any( - first <= month < payment - for month in claim.nonentitlement_months - ) - ) ): raise InvalidFamilyInput( "ARF result cannot contain a refused original claim" @@ -790,19 +782,6 @@ def apply_arf( _refuse( reason, "this exceptional ARF history requires a separate rule" ) - if ( - claim.kind is ARFBenefitKind.SPOUSE - and payment < fra - and any( - first <= month < payment for month in claim.nonentitlement_months - ) - ): - # Source conflict us:oasdi-arf-spouse-reentitlement-credits - _refuse( - ARFUnsupportedReason.SPOUSE_REENTITLEMENT_BEFORE_FRA, - "RS 00615.201A.1 and .491A conflict on pre-FRA reentitlement timing; " - "this module supports the final FRA adjustment only", - ) if ( own is not None and own.sequence is SpouseOwnSequence.AFTER_SPOUSE_BEFORE_ARF @@ -812,6 +791,9 @@ def apply_arf( "RS 00615.500 does not supply this entitlement sequence's procedure", ) age62 = _age_attainment_month_validated(claim.birth_date, 744) + # Source conflict us:oasdi-arf-spouse-reentitlement-credits + # 402(q)(1)(B) adjusts only at 62 or FRA, so a reentitled spouse keeps + # the original reduction months until FRA (RS 00615.201A.1, not .491A). effective = fra if payment >= fra else None if claim.kind is ARFBenefitKind.WIDOW and first <= age62 <= payment < fra: effective = age62 diff --git a/tests/data/track_b/arf_recompute_sources/lii_usc_402q_415f_excerpts.txt b/tests/data/track_b/arf_recompute_sources/lii_usc_402q_415f_excerpts.txt index f944dcb62..2f63cfbe0 100644 --- a/tests/data/track_b/arf_recompute_sources/lii_usc_402q_415f_excerpts.txt +++ b/tests/data/track_b/arf_recompute_sources/lii_usc_402q_415f_excerpts.txt @@ -9,3 +9,9 @@ ## 42 U.S.C. 415(f) (https://www.law.cornell.edu/uscode/text/42/415) (f) Recomputation of benefits (1) After an individual's primary insurance amount has been determined under this section, there shall be no recomputation of such individual's primary insurance amount except as provided in this subsection or, in the case of a World War II veteran who died prior to July 27, 1954 , as provided in section 417(b) of this title . (2) (A) If an individual has wages or self-employment income for a year after 1978 for any part of which he is entitled to old-age or disability insurance benefits, the Commissioner of Social Security shall, at such time or times and within such period as the Commissioner may by regulation prescribe, recompute the individual's primary insurance amount for that year. (B) For the purpose of applying subparagraph (A) of subsection (a)(1) to the average indexed monthly earnings of an individual to whom that subsection applies and who receives a recomputation under this paragraph, there shall be used, in lieu of the amounts established by subsection (a)(1)(B) for purposes of clauses (i) and (ii) of subsection (a)(1)(A), the amounts so established that were (or, in the case of an individual described in subsection (a)(4)(B), would have been) used in the computation of such individual's primary insurance amount prior to the application of this subsection. (C) A recomputation of any individual's primary insurance amount under this paragraph shall be made as provided in subsection (a)(1) as though the year with respect to which it is made is the last year of the period specified in subsection (b)(2)(B)(ii); and subsection (b)(3)(A) shall apply with respect to any such recomputation as it applied in the computation of such individual's primary insurance amount prior to the application of this subsection. (D) A recomputation under this paragraph with respect to any year shall be effective— (i) in the case of an individual who did not die in that year, for monthly benefits beginning with benefits for January of the following year; or (ii) in the case of an individual who died in that year, for monthly benefits beginning with benefits for the month in which he died. (3) Repealed. Pub. L. 95–216, title II, § 201(f)(2) , Dec. 20, 1977 , 91 Stat. 1521 . (4) A recomputation shall be effective under this subsection only if it increases the primary insurance amount by at least $1. (5) In the case of a man who became entitled to old-age insurance benefits and died before the month in which he attained retirement age (as defined in section 416(l) of this title ), the Commissioner of Social Security shall recompute his primary insurance amount as provided in subsection (a) as though he became entitled to old-age insurance benefits in the month in which he died; except that (i) his computation base years referred to in subsection (b)(2) shall include the year in which he died, and (ii) his elapsed years referred to in subsection (b)(3) shall not include the year in which he died or any year thereafter. Such recomputation of such primary insurance amount shall be effective for and after the month in which he died. (6) Upon the death after 1967 of an individual entitled to benefits under section 402(a) or section 423 of this title , if any person is entitled to monthly benefits or a lump-sum death payment, on the wages and self-employment income of such individual, the Commissioner of Social Security shall recompute the decedent's primary insurance amount, but only if the decedent during his lifetime was paid compensation which was treated under section 405(o) of this title as remuneration for employment. (7) This subsection as in effect in December 1978 shall continue to apply to the recomputation of a primary insurance amount computed under subsection (a) or (d) as in effect (without regard to the table in subsection (a)) in that month, and, where appropriate, under subsection (d) as in effect in December 1977, including a primary insurance amount computed under any such subsection whose operation is modified as a result of the amendments made by section 5117 of the Omnibus Budget Reconciliation Act of 1990 . For purposes of recomputing a primary insurance amount determined under subsection (a) or (d) (as so in effect) in the case of an individual to whom those subsections apply by reason of subsection (a)(4)(B) as in effect after December 1978, no remuneration shall be taken into account for the year in which the individual initially became eligible for an old-age or disability insurance benefit or died, or for any year thereafter, and (effective January 1982) the recomputation shall be modified by the application of subsection (a)(6) where applicable. (8) The Commissioner of Social Security shall recompute the primary insurance amounts applicable to beneficiaries whose benefits are based on a primary insurance amount which was computed under subsection (a)(3) effective prior to January 1979, or would have been so computed if the dollar amount specified therein were $11.50. Such recomputation shall be effective January 1979, and shall include the effect of the increase in the dollar amount provided by subsection (a)(1)(C)(i). Such primary insurance amount shall be deemed to be provided under such section for purposes of subsection (i). + +## Pub. L. 92-603 §102(i) and §102(g), statutory notes printed with 42 U.S.C. 402 (https://www.law.cornell.edu/uscode/text/42/402) + +Pub. L. 92–603, title I, § 102(i) , Oct. 30, 1972 , 86 Stat. 1339 , provided that: “The amendments made by this section [amending this section and section 403 of this title and enacting provisions set out as notes under this section] shall apply with respect to monthly benefits under title II of the Social Security Act [ 42 U.S.C. 401 et seq.] for months after December 1972.” + +Pub. L. 92–603, title I, § 102(g) , Oct. 30, 1972 , 86 Stat. 1338 , provided that: “(1) In the case of an individual who is entitled to widow 's or widower 's insurance benefits for the month of December 1972 the Secretary shall, if it would increase such benefits, redetermine the amount of such benefits for months after December 1972 under title II of the Social Security Act [ 42 U.S.C. 401 et seq.] as if the amendments made by this section [amending this section and section 403 of this title ] had been in effect for the first month of such individual's entitlement to such benefits. diff --git a/tests/data/track_b/arf_recompute_sources/manifest.json b/tests/data/track_b/arf_recompute_sources/manifest.json index 33c493044..e58d65d67 100644 --- a/tests/data/track_b/arf_recompute_sources/manifest.json +++ b/tests/data/track_b/arf_recompute_sources/manifest.json @@ -460,8 +460,9 @@ "https://www.law.cornell.edu/uscode/text/42/415" ], "retrieved_at_utc": "2026-10-11T11:37:16Z", - "bytes": 20306, - "sha256": "f63cf9e32dc15729810857525f2f0f1070f9bba6b02653e1efa57c6d0195c28c" + "bytes": 21424, + "sha256": "6e35d38fcf7a31e13338acd8a0ae3bc5a1acd82a980e424d61344b6634b01966", + "note": "The Pub. L. 92-603 \u00a7102(i) and \u00a7102(g) note excerpts were added from a re-fetch at 2026-10-23T15:21:00Z whose 402 body matched the pinned SHA-256 byte for byte." }, { "id": "ssa_pub_05_10069_arf_recompute_excerpts", diff --git a/tests/test_track_b_arf.py b/tests/test_track_b_arf.py index 6eea9ac25..058037f57 100644 --- a/tests/test_track_b_arf.py +++ b/tests/test_track_b_arf.py @@ -14,6 +14,7 @@ from populace_dynamics.track_b import arf as a from populace_dynamics.track_b import gross_benefits as g +from tests.track_b_arf_recompute_support import source_text from tests.track_b_gross_benefit_support import ssa_params PARAMS = ssa_params() @@ -536,24 +537,15 @@ def test_explicit_exceptional_history_is_refused_by_name(reason): assert caught.value.reason is reason -def test_spouse_reentitlement_before_fra_is_explicitly_refused(): - claim = a.ARFClaim( - a.ARFBenefitKind.SPOUSE, - date(1960, 1, 2), - (2022, 1), - F(650), - nonentitlement_months={(2022, 2)}, - conditions={a.ARFUnsupportedReason.SPOUSE_REENTITLEMENT_BEFORE_FRA}, - ) - with pytest.raises(g.FamilyConfigurationUnsupported) as caught: - a.apply_arf(claim, payment_month=(2024, 1), params=PARAMS) - assert ( - caught.value.reason - is a.ARFUnsupportedReason.SPOUSE_REENTITLEMENT_BEFORE_FRA - ) - +def test_spouse_reentitled_before_fra_keeps_original_months_until_fra(): + """402(q)(1)(B): only the 62 and FRA months use the adjusted period. -def test_spouse_reentitlement_before_fra_is_detected_from_termination_history(): + Source conflict us:oasdi-arf-spouse-reentitlement-credits. Invented + 1960-01-02 spouse, $650 unreduced, first reduced 2022-01, terminated + 2022-02 and reentitled 2022-03. Every month before FRA keeps the 60 + original months (35 percent, $422.50); the January 2027 ARF removes + the terminated month (59 months, reduction $224.80, $425.20). + """ claim = a.ARFClaim( a.ARFBenefitKind.SPOUSE, date(1960, 1, 2), @@ -561,15 +553,28 @@ def test_spouse_reentitlement_before_fra_is_detected_from_termination_history(): F(650), nonentitlement_months={(2022, 2)}, ) - with pytest.raises(g.FamilyConfigurationUnsupported) as caught: - a.apply_arf(claim, payment_month=(2024, 1), params=PARAMS) - assert ( - caught.value.reason - is a.ARFUnsupportedReason.SPOUSE_REENTITLEMENT_BEFORE_FRA - ) - # The same known history has a settled final adjustment at FRA. + plain = replace(claim, nonentitlement_months=frozenset()) + for payment in ((2022, 3), (2024, 1), (2026, 12)): + result = a.apply_arf(claim, payment_month=payment, params=PARAMS) + assert result.crediting_months == frozenset() + assert result.effective_adjustment_month is None + assert result.original_reduction_months == 60 + assert result.adjusted_reduction_months == 60 + assert result.benefit == F("422.50") + assert ( + result.benefit + == a.apply_arf(plain, payment_month=payment, params=PARAMS).benefit + ) result = a.apply_arf(claim, payment_month=FRA, params=PARAMS) assert result.adjusted_reduction_months == 59 + assert result.crediting_months == frozenset({g.YearMonth(2022, 2)}) + assert result.benefit == F("425.20") + + +def test_spouse_reentitlement_is_no_longer_a_coverage_reason(): + """The settled timing leaves no named refusal to declare.""" + values = {reason.value for reason in a.ARFUnsupportedReason} + assert "arf_spouse_reentitlement_before_fra" not in values def test_dual_spouse_after_spouse_before_arf_is_refused(): @@ -612,6 +617,17 @@ def test_historic_survivor_fra_conflict_is_refused(): # POMS FRA65; CFR FRA62 gives1000. Neither reading is paid by R3. assert g.survivor_age_reduced(F(1000), 36, 60, PARAMS) == F(829) assert F(1000) - F(829) == F(171) + # The conflict cannot change a supported amount: under either FRA every + # reduced entitlement of the cohort is first entitled before 1978, which + # arf_initial_entitlement_before_1978 refuses independently. + for birth in (date(1911, 1, 2), date(1912, 1, 1)): + for fra_years in (62, 65): + assert a.age_attainment_month(birth, fra_years * 12) < g.YearMonth( + 1978, 1 + ) + assert "for months after December 1972." in " ".join( + source_text("lii_usc_402q_415f_excerpts").split() + ) def test_widow_nonbinding_child_care_readings_are_explicit(): diff --git a/tests/test_track_b_arf_properties.py b/tests/test_track_b_arf_properties.py index 794d2ec87..c5dddbd97 100644 --- a/tests/test_track_b_arf_properties.py +++ b/tests/test_track_b_arf_properties.py @@ -554,3 +554,52 @@ def evaluate(): assert label in errors[0] assert errors[0] == errors[1] == errors[2] assert calls == ["compute"] * 3 + + +@settings(deadline=None) +@example(F(650), [1], 2) +@given( + amounts, + st.lists(st.integers(0, 59), unique=True, max_size=12), + st.integers(0, 59), +) +def test_reentitled_spouse_keeps_original_months_until_fra( + amount, terminated, offset +): + """402(q)(1)(B): terminated months leave the factor only at FRA. + + Source conflict us:oasdi-arf-spouse-reentitlement-credits. Before + FRA every reentitled history pays exactly the never-terminated claim + and G's 60-month spouse reduction (zero-tolerance differential); at + FRA each terminated month before FRA is one credit, so the benefit + cannot fall from any pre-FRA month to the FRA month. + """ + base = 2022 * 12 + history = { + g.YearMonth((base + i) // 12, (base + i) % 12 + 1) for i in terminated + } + claim = a.ARFClaim( + a.ARFBenefitKind.SPOUSE, + date(1960, 1, 2), + (2022, 1), + amount, + nonentitlement_months=history, + ) + plain = replace(claim, nonentitlement_months=frozenset()) + payment = g.YearMonth((base + offset) // 12, (base + offset) % 12 + 1) + before = a.apply_arf(claim, payment_month=payment, params=PARAMS) + expected = g.floor_dime( + amount - g.ceil_dime(amount * g.spouse_reduction_fraction(60, PARAMS)) + ) + assert before.adjusted_reduction_months == 60 + assert before.crediting_months == frozenset() + assert before.benefit == expected + assert before == a.apply_arf(claim, payment_month=payment, params=PARAMS) + assert ( + before.benefit + == a.apply_arf(plain, payment_month=payment, params=PARAMS).benefit + ) + final = at_fra(claim) + assert final.crediting_months == frozenset(history) + assert final.adjusted_reduction_months == 60 - len(history) + assert final.benefit >= before.benefit diff --git a/tests/test_track_b_r3_sources.py b/tests/test_track_b_r3_sources.py index 84a8b7db8..6d855f0e6 100644 --- a/tests/test_track_b_r3_sources.py +++ b/tests/test_track_b_r3_sources.py @@ -58,9 +58,9 @@ ), pytest.param( "apply_arf", - "ARFUnsupportedReason.SPOUSE_REENTITLEMENT_BEFORE_FRA,", + "effective = fra if payment >= fra else None", "us:oasdi-arf-spouse-reentitlement-credits", - id="spouse-reentitlement-refusal", + id="spouse-reentitlement-timing", ), ], ) @@ -425,8 +425,8 @@ def test_alternative_readings_are_quoted_from_captures(source_id, quote): } -def test_spouse_reentitlement_conflict_quotes_and_refusal_are_documented(): - """Both already captured POMS readings must remain visible to review.""" +def test_spouse_reentitlement_quotes_and_reading_are_documented(): + """Both captured POMS readings and the reading taken stay visible.""" # The .201 source is listed in G's manifest rather than R3's. Check # those referenced bytes here as well as the verbatim quoted text. entry = next( @@ -445,35 +445,54 @@ def test_spouse_reentitlement_conflict_quotes_and_refusal_are_documented(): Path(__file__).parents[1] / "docs/design/track_b_r3_arf_recompute.md" ).read_text() judgment = " ".join( - note.split("## Findings and readings requiring judgment", 1)[1] + note.split("## Readings taken and refusals kept", 1)[1] .split("## Monthly assembly inputs", 1)[0] .split() ) - refusal_row = next( + support_row = next( line for line in note.splitlines() - if line.startswith("| Earlier reentitled spouse adjustment |") + if line.startswith("| Spouse reentitled before FRA |") ) for authority, quote in SPOUSE_REENTITLEMENT_QUOTES.items(): assert quote in texts[authority] assert quote in judgment - assert authority in refusal_row - assert "conflict" in refusal_row - assert "arf_spouse_reentitlement_before_fra" in refusal_row + assert authority in support_row + assert "Supported" in support_row + assert "not followed" in support_row + assert "us:oasdi-arf-spouse-reentitlement-credits" in judgment + assert "arf_spouse_reentitlement_before_fra" not in support_row for amount in ("$422.50", "$425.20", "$2.70"): assert amount in judgment -def test_spouse_reentitlement_counterfactual_readings_keep_named_refusal(): - """Invented 1960-01-02 spouse: $650, 60 RF versus 59 RF. +def test_spouse_reentitlement_takes_the_statutory_timing(): + """Invented 1960-01-02 spouse: $650, 60 RF before FRA, 59 at FRA. First entitlement 2022-01, termination 2022-02, reentitlement - 2022-03. The .201 reading preserves 60 RF: 35% reduction gives - $422.50/$422. The .491 reading removes the terminated month: 59 RF - has reduction 83/240, rounded upward from $224.7916... to $224.80, - giving $425.20/$425. These are counterfactual arithmetic diagnostics; - neither reading is admitted by the refused pre-FRA claim. + 2022-03. 402(q)(1)(B)(i) applies the reduction period's 60 months + to every month before FRA; (ii) applies the adjusted period, which + (q)(7)(C) shortens by the terminated month, only in the month of + attaining 62 or retirement age. RS 00615.201A.1 states that timing. + The .491A alternative (59 months from reentitlement) would pay + $425.20/$425 instead of $422.50/$422 for March 2022 through December + 2026; it is kept as a counterfactual and not admitted. """ + statute = " ".join(source_text("lii_usc_402q_415f_excerpts").split()) + for quote in ( + "the number of months in the reduction period for such benefit " + "(determined under paragraph (6)), if such benefit is for a month " + "before the month in which such individual attains retirement age", + "if less, the number of such months in the adjusted reduction " + "period for such benefit (determined under paragraph (7)), if such " + "benefit is (I) for the month in which such individual attains age " + "62, or (II) for the month in which such individual attains " + "retirement age", + "any month for which such individual was not entitled to such " + "benefits because of the occurrence of an event that terminated " + "her or his entitlement to such benefits", + ): + assert quote in statute params = ssa_params() unreduced = Fraction(650) amounts = tuple( @@ -496,11 +515,10 @@ def test_spouse_reentitlement_counterfactual_readings_keep_named_refusal(): unreduced_benefit=unreduced, nonentitlement_months=frozenset({(2022, 2)}), ) - with pytest.raises( - gross_benefits.FamilyConfigurationUnsupported - ) as caught: - arf.apply_arf(claim, payment_month=(2022, 3), params=params) - assert ( - caught.value.reason - is arf.ARFUnsupportedReason.SPOUSE_REENTITLEMENT_BEFORE_FRA - ) + reentitled = arf.apply_arf(claim, payment_month=(2022, 3), params=params) + assert reentitled.adjusted_reduction_months == 60 + assert reentitled.benefit == amounts[0] + assert gross_benefits.whole_dollars(reentitled.benefit) == 422 + at_fra = arf.apply_arf(claim, payment_month=(2027, 1), params=params) + assert at_fra.adjusted_reduction_months == 59 + assert at_fra.benefit == amounts[1]