Repository navigation
Conversation
Preserve the mortgage splitter and conserve the residual with nested complements. Propagate all three Person leaves through source, QRF, transfer, export and typed-spec contracts, with regenerated identities and coverage. Co-Authored-By: GPT-6.1 Sol (subfleet lane) <noreply@openai.com>
Keep strict publication and live authority comparisons current with the expanded E19200 QRF order and transfer target families. Pool fixture bytes and agreement remain unchanged. Co-Authored-By: GPT-6.1 Sol (subfleet lane) <noreply@openai.com>
This branch has not been 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.
PUF E19200 currently assigns deductible points and qualified mortgage-insurance premiums to
investment_interest_expense. This makes the section 163(d) cap disallow those mortgage deductions for the wrong reason. Max's decision d1054 calls for separate leaf facts before revisiting PolicyEngine-US #9977.This change preserves
split_us_puf_e19200_by_agi_band(total, agi)and addssplit_us_puf_e19200_residual_by_agi_band(residual, agi). Keeping the existing two-output API lets existing callers retain their mortgage calculation and makes its bit identity directly testable. The new API returns points, premiums and investment; each uses the same 22 TY2015 SOI AGI bands.home_mortgage_pointsmortgage_insurance_premiumsinvestment_interest_expenseConservation uses three nested binary splits: the existing total/mortgage split, residual/investment versus points-and-premiums, then points-and-premiums/points versus premiums. Each uses
x = parent * share; y = parent - x; x = parent - y. At least one subtraction is exact by Sterbenz's lemma, as the existing proof establishes; the two children therefore sum to their parent in exact real arithmetic. Consequently the four leaves sum exactly to E19200, andmath.fsumreconstructs every positive finite input bit-for-bit. Donor construction stores the mortgage splitter's array directly, avoiding an extra divide/multiply round trip. The loader fails closed on zero CN + CP, and the splitter explicitly handles an absent points-and-premiums denominator.Two precision qualifications are tested explicitly:
math.fsumcanonicalizes accepted negative zero to positive zero, as it already did for the original split; published-share comparisons need total-scale ULP bounds and a subnormal quantization allowance, since complement subtraction cannot guarantee a few relative ULPs for arbitrarily tiny leaves.Surfaces extended:
Surfaces deliberately left alone:
investment_interest_expense.Validation includes Hypothesis random finite totals and seeded/adversarial examples across all 22 bands, exact
Fractionandmath.fsumconservation, nested residual grouping, finite nonnegative leaves, differential mortgage bit checks, source shares, top-band investment dominance, CP=0 exact premiums, invalid inputs and denominator rejection. Focused donor, quarantine, QRF, export, DAG, transfer, release-coverage, battery, H5-loader and Build-J tests exercise propagation. Detailed commands and results are recorded in the work report.fsumreconstruction, nested residual sum, nonnegative finite leaves, unchanged mortgage bits, share tolerancetest_three_leaf_split_exact_conservation_property,test_three_leaf_split_adversarial_totals_in_every_bandintest_us_puf_e19200_decomposition.pytest_three_leaf_split_recovers_all_published_band_proportionstest_three_leaf_split_identity_binds_all_consumed_shares,test_three_leaf_source_loader_rejects_zero_points_and_premiumstest_puf_e19200_donor_preserves_splitter_mortgage_bits_and_exact_leaf_sumintest_us_puf_support.pytest_required_us_release_source_columns_enforces_e19200_residual_leaf_signaltest_e19200_new_leaves_are_required_without_reference_sharesintest_release_input_coverage.pyThe SOI asset bytes are unchanged (
c3356ae216487f365cb0e0a7ab1ba46843a6c52950b75eae1bfab9b0b80a735a). Runtime SOI identity changes to82dcaf96e7ef78efa67a88bc556d08a1756551327e0e5b7984bcb0b97d016ca9. QRF now has 67 targets, late transfer 72 and terminal comparison 136.Pending engine bump: the locked PolicyEngine-US 2.2.1 does not expose the two new names.
uv.lock, the engine ABI lock and the engine pin are unchanged. The follow-up release bump must runtools/repin_us_pool_engine_contracts.pyand regenerate the live concept surface. The current live concept-coverage check and pool ownership/consumer checks are expected to fail for those missing inputs; the work report enumerates the exact observed checks. No dataset was built, calibrated, published or promoted, and no restricted microdata was downloaded.The expected registered
engine-usfailure, on both Python matrix versions, is frameengine_contract/us/test_concept_mapping_policyengine_us.py::test_committed_coverage_report_matches_the_engine(928 pending inputs versus 926 locked inputs). Its full local file has nine passes and this one expected failure.Auxiliary checks fail when explicitly run with the US extra; their normal
engine-freeCI environment has no country engine:engine_free/us/test_us_multispine_pool.py::test_every_pool_transfer_target_is_an_installed_engine_input_leafnames both missing inputs.engine_free/us/test_us_pool_input_consumers.py::test_pool_input_has_engine_or_reviewed_non_engine_consumer[home_mortgage_points]and[mortgage_insurance_premiums]reject the unknown names. The full file has 170 passes and five expected failures, includingtest_receives_wic_guard_rejects_unreviewed_consumer_mutationandtest_guard_rejects_reinjected_consumerless_variable[has_marketplace_health_coverage]/[medicare_part_b_premiums_reported], which encounter a missing leaf before the intended mutation.engine_free/shared/test_release_input_coverage.py::TestShippedManifest::test_manifest_is_currentand::TestParityKnownGapRenameProjection::test_anti_rot_accepts_the_shipped_registerreject missing engine inputs in the expanded manifest. The normal engine-free full file passes all 87 tests.Focused passing checks: decomposition 39; donor/quarantine 4; QRF 2; export 5; late DAG 30; transfer 7; stacked spine 5; H5 loader 2; scorer 1; Build-J 2; release coverage 87; US spec bundle 7; calibration semantics 16; imputation semantics 4; engine-free concept mapping 146; synthetic workflow terminal-state/schema identity 4; exact legacy publication 1; full live authority projections 4; locked-US catalog contracts 4. The selected live manifest checks failed only on the two pending names. Across completed targeted runs, 549 tests passed and nine failed solely because the locked engine lacks the new inputs. Generated bundle/coverage bytechecks, all 41 inventory checks, all 49 field claims, full Ruff check and formatting of all 55 touched Python files also pass. The real-PUF storage-dependent artifact test was not run locally.
Initial remote CI exposed stale test-only legacy manifest and nested authority receipt pins; the follow-up commit refreshes those pins while preserving strict byte/live comparisons. The legacy fixture's pool and agreement bytes remain identical. Replacement CI 37667937492 remains queued for the current head as of 2026-10-07 18:56 UTC after more than 21 minutes waiting for runners. Final remote verification is pending.
🤖 Generated with Claude Code