Repository navigation
Conversation
The other_health_insurance_premiums stage's attribution operation set is_self_employed and copied the reported premium onto health_insurance_premiums only for people with positive Schedule C income. 26 USC 162(l)(2)(A) and the Form 7206 instructions also let the plan be established under a Schedule F farm or a partnership (Schedule K-1 box 14 code A), and PolicyEngine/policyengine-us#10120 computes the earned-income limit per business. The operation now opens wherever any one of Schedule C (both inputs summed), farm_operations_income or partnership_self_employment_net_earnings is strictly positive, so a loss in one business never cancels another's profit. The Medicare-proxy and measured-ESI exclusions are unchanged. The manifest parameter becomes plan_business_income_sources keyed by business; source_stages.json, sources.yaml, the sources schema and the frozen source-stage hash move with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stage module is a seed-protocol kernel module and source_stages.json is digested into the spec bundle, so the seed protocol, seed map, source manifest, resource semantics, full checkpoint, pointer inventory, field counts and US spec_sha256 move; us-f0-coverage.json is regenerated. Adds example tests for farm-only and partnership-only carriers, a loss beside another business's profit, the Medicare-proxy and ESI exclusions on the new paths, fail-closed sources and manifest drift, plus Hypothesis properties: a row-wise reference, no invented premium mass, the Schedule C-only configuration equals the old rule and widening only adds people, losses never cancel another business, and the signal gate's recomputed identity agrees with the attribution. The coverage-manifest column notes describe the widened rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan-business object adds two authored legacy-behavior fields, and the sources schema change moves the minimal-loader golden vector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- sources schema: plan-business column lists are unique, non-empty strings. - Stage notes and module comment: the Form 7206 instructions name five qualifying situations, two with no measured input; Schedule C as one business follows policyengine-us#10120's modelling choice; PUF-support premiums are imputed without farm or partnership predictors; the state and local formulas reading the bare premium input move under 2.2.1 already; the Medicare proxy withholds premiums Form 7206 would allow. - Property: an unprofitable Schedule C can be swapped for any other non-positive split without changing the attribution, so a Schedule C loss never cancels a farm or partnership profit. - Integration: a farm person and a partner carry positive attributed premiums through the stage and the signal gate. - Re-pin the seed protocol, seed map, source manifest, resource semantics, full checkpoint, spec_sha256, frozen source-stage hash and loader golden for the final module and schema bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Draft. Depends on PolicyEngine/policyengine-us#10120 (open draft, stacked on PolicyEngine/policyengine-us#10109). Hold the merge until #10120 merges. Microcosm pins PolicyEngine-US 2.2.1, which caps the deduction at Schedule C income, so the federal effect also needs the engine pin to move past #10120.
Problem
The
other_health_insurance_premiumsstage's attribution operation (#451 item 2) setsis_self_employedand copies the reported non-Part-B premium ontohealth_insurance_premiumsonly for people with strictly positive Schedule C income. The law allows more:total_self_employment_income, Schedule F =farm_operations_income, partnership =partnership_self_employment_net_earnings) and, with no named plan business, takes the largest.On the certified default (
populace_us_2024, sha6496cc43…), 2.01M people with nonzero farm income and 2.06M with nonzero partnership earnings are not flagged self-employed, so #10120 cannot reach them.Change
A person is self-employed for this stage when any one plan business has strictly positive net earnings, each on its own:
self_employment_income_before_lsr+sstb_self_employment_income_before_lsrfarm_operations_incomepartnership_self_employment_net_earningsself_employment_income_sources(list) becomesplan_business_income_sources(keyed by business).source_stages.json, the regeneratedsources.yamland the sources schema move with it.positive_plan_business_rowsper business.s_corp_shareholder_medicare_wageshas no data).Invariants
These hold for every input and are tested with Hypothesis in
tests/engine_free/us/test_us_se_health_attribution_properties.py(150 examples each):Tests
test_us_other_health_insurance.py: farm-only and partnership-only carriers; a Schedule C loss beside a farm profit and a farm loss beside partnership earnings; both exclusions on the new paths; missing and nonfinite farm and partnership sources fail closed; the retired Schedule C-only parameter and a narrowed mapping are refused; a farm person and a partner carry positive premiums through the stage and the gate; the gate fails when a farm person's flag or premium is tampered with or a source column is missing.5ae529281(macOS, Python 3.14,pytest -n 4): 234 passed across the stage tests, the properties, and the spec-engine loader, field-usage, inventory, schema, bundle and coverage-tool files (exit 0).tools/spec_engine_coverage.py --checkexit 0 (42,186/42,186 fields, 41/41 inventory checks).tools/generate_us_bundle_from_constants.py --checkexit 0.tools/ci_test_plan.py verifyexit 0.Measurement
Stored data, no engine (
data_only.pyon the certified default; weighted people):is_self_employedhealth_insurance_premiumsandis_self_employedcolumns exactly, so the candidate differs from the certified file only by this change.Engine runs: pending. Real microsimulations on the certified default and the widened candidate, under PolicyEngine-US 2.2.1 and the #10120 head (
47bba5e893, 2.38.24), are queued under the shared heavy lock. They report the deduction (returns and amount) against SOI Pub 1304 Table 1.4 (TY2023: 3,595,764 returns / $31.23B, PolicyEngine/chronicle#105), federal and state income tax, and the release gate's neutralization probe. The probe's reason text in the coverage manifest is rewritten when they land.What changes before #10120. Under 2.2.1 the federal deduction is
min(max(total_self_employment_income, 0), premiums), so a farm-only or partnership-only person's deduction stays $0. Five state and local formulas read the bare premium input (MO qualified-premium subtraction, MI household resources, OH medical expenses, Orange County general relief, MO child-care subsidy), so the added $1.38B of premiums moves those today.is_self_employedhas one reader in both engine versions: thedefined_forgate ofself_employed_health_insurance_premiums.Identities re-pinned
The stage module is a seed-protocol kernel module and
source_stages.jsonis digested into the spec bundle, so these moved and were recomputed: the frozen source-stage hash, USspec_sha256, seed protocol, seed map, source manifest, resource semantics, full checkpoint, the pointer inventory and field counts (+2 authored fields), the minimal-loader golden, anddocs/evidence/spec-engine/us-f0-coverage.json.Review
Round 1 (independent Opus 5.5 lane,
subfleet run --task review --tier hard; the Codex lanes were closed): APPROVE, no blocking defects. It confirmed the gate matches #10120's limit, that no later stage rewrites the farm or partnership columns before the export gate, and that no registry declares this stage's reads. Acted on:Its guess that the Medicare proxy bites hardest on farmers did not hold in the data (13.2% for farm, 43.5% for partnership). A second round runs on the final head.
Follow-ups (filed as separate tasks)
partnership_self_employment_net_earningsinpuf_support.pyadds two loss fields, unlike the archived derivation. The certified build reads the processed PUF column, not that fallback.No dataset release: Microcosm data releases are Max's call.
axiom: n/a: microdata attribution change; the engine-side provision is PolicyEngine/policyengine-us#10120, whose Axiom line is TheAxiomFoundation/rulespec-us#1676 queued
🤖 Generated with Claude Code