Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
bba667c
CE1: coverage-rule schema, loader and refusing lookup
MaxGhenis Oct 24, 2026
9de8458
CE1: pinned sources and the assembled registry (partial)
MaxGhenis Oct 24, 2026
49400d1
CE1: keep the birth-evidence seal
MaxGhenis Oct 24, 2026
1be4b75
CE1: finish the coverage-rule registry's sources and histories
MaxGhenis Oct 25, 2026
39b5220
CE1: keep only the cited pages of five whole-act PDFs
MaxGhenis Oct 25, 2026
08b898e
Merge origin/master d8302233 into CE1
MaxGhenis Oct 25, 2026
28becb8
CE1: answer review round 1 (two high, twelve medium, 28 low)
MaxGhenis Oct 25, 2026
94219ed
CE1: rank coverage cases, first match wins (review r2 MED-1)
MaxGhenis Oct 26, 2026
8476dcf
CE1: make every exclusion condition a case (review r2 HIGH-1)
MaxGhenis Oct 26, 2026
a6fa1f0
CE1: exclude pre-ruling cash-equivalent farm transfers (review r2 HIG…
MaxGhenis Oct 26, 2026
c0ea2b2
CE1: return verified rules and open only unsettled sub-questions (rev…
MaxGhenis Oct 26, 2026
5bac444
CE1: test every loader guard and separate data, caller and legal erro…
MaxGhenis Oct 26, 2026
01e1e85
CE1: name open readings once and settle vocational years (review r2 l…
MaxGhenis Oct 26, 2026
2dad26e
CE1: keep IRS page extracts and the OCR text of scanned pages (review…
MaxGhenis Oct 26, 2026
38cd196
CE1: state the capture-folder invariants in the conformance module
MaxGhenis Oct 26, 2026
df1dc16
CE1: test the open-reading and operative-reading checkers (review r2 …
MaxGhenis Oct 26, 2026
ea599b9
Merge origin/master 172f690f into CE1
MaxGhenis Oct 26, 2026
07c3436
Merge origin/master a747bafa into CE1
MaxGhenis Oct 31, 2026
a645009
CE1: exclude unlisted existing employees under a nonprofit waiver (re…
MaxGhenis Oct 31, 2026
3571314
CE1: condition the public-office exclusion on a public-office fact (r…
MaxGhenis Oct 31, 2026
819efef
CE1: put every statutory condition in a case's when, on rows with cas…
MaxGhenis Oct 31, 2026
f042289
CE1: give case-free conditions cases or a quoted basis (review r3 M2)
MaxGhenis Oct 31, 2026
598b246
CE1: put each family on the date axis its boundary clauses use (revie…
MaxGhenis Oct 31, 2026
9eb28f8
CE1: one CRP rule, a narrower vocational dispute, and 931 for clergy …
MaxGhenis Oct 31, 2026
46f3af7
CE1: lows 1-5 and 10 of review round 3
MaxGhenis Oct 31, 2026
45ef91d
CE1: drop the unused alternative mechanism; say what each residual ap…
MaxGhenis Oct 31, 2026
2472668
CE1: keep Pub 51 (2023) as a page extract; record one 97 Stat. 65 ret…
MaxGhenis Oct 31, 2026
fc1d7e0
CE1: the eleven narrow omissions of review r3 low 6
MaxGhenis Oct 31, 2026
16b208f
CE1: drop the repeated IRS cover from 28 extracts (review r3 note 1)
MaxGhenis Oct 31, 2026
195be7b
CE1: correct two low-6 descriptions
MaxGhenis Oct 31, 2026
f2409b2
CE1: split election_work_1995's lower-amount case by membership
MaxGhenis Oct 31, 2026
07cc9cf
CE1: locate the 1978 home-worker cash test in 409(j) until 1989
MaxGhenis Oct 31, 2026
45f2232
CE1: drop the posting fact from the 2018 tribal row
MaxGhenis Oct 31, 2026
c988555
CE1: add former 410(a)(1)(A), the title V contract-worker clause
MaxGhenis Oct 31, 2026
e51e708
CE1: apply POMS's 2024 student criteria to service from 2024-08-15
MaxGhenis Oct 31, 2026
6e33fae
CE1: quote Pub. L. 100-647 section 8015(c)(3) as enacted
MaxGhenis Oct 31, 2026
fd5b7b2
CE1: record why the title V clause stands from 1968
MaxGhenis Oct 31, 2026
00df716
CE1: hold nonprofit waivers to the certificate's period
MaxGhenis Nov 1, 2026
da09aab
CE1: give 3121(r)(3)(A)'s failed member a noncovered path
MaxGhenis Nov 1, 2026
64255e0
CE1: require federal recognition for the 2018 tribal exclusion
MaxGhenis Nov 1, 2026
8f4ab88
CE1: word the fishing crew and cash tests from the statute
MaxGhenis Nov 1, 2026
8ec7f15
CE1: put 411(b)'s nonresident-alien exclusion in a general family
MaxGhenis Nov 1, 2026
8bc0bab
CE1: pin every boundary whose clauses mix date axes
MaxGhenis Nov 1, 2026
a431176
CE1: refuse parameter records keyed "if" as hidden cases
MaxGhenis Nov 1, 2026
ff7ceef
CE1: test that failing each covered condition reaches its exclusion
MaxGhenis Nov 1, 2026
a9fccae
CE1: sweep fixes, government rows
MaxGhenis Nov 1, 2026
d8a44dc
CE1: sweep fixes, employment rows
MaxGhenis Nov 1, 2026
1b2f58b
CE1: sweep fixes, clergy rows
MaxGhenis Nov 1, 2026
92d2f40
CE1: sweep fixes, self-employment rows
MaxGhenis Nov 1, 2026
200f24d
CE1: tie every scope parameter to the case that decides it
MaxGhenis Nov 1, 2026
a0e2e23
CE1: take review r4 lows 2-7 and the small low-10 items
MaxGhenis Nov 1, 2026
8968b12
CE1: restate one sweep worker's partnership phrase after low 10
MaxGhenis Nov 1, 2026
94a9af8
CE1: hold State and local exclusions to State and local service
MaxGhenis Nov 1, 2026
7d6f7a7
CE1: hold the election cases to election officials and workers
MaxGhenis Nov 1, 2026
e54479d
CE1: keep 411(j)'s codification heading open before 1998
MaxGhenis Nov 1, 2026
210a5c8
CE1: state the State and local reach as a property
MaxGhenis Nov 1, 2026
ad40448
CE1: exclude every vowed member's order duties, not only active ones
MaxGhenis Nov 1, 2026
c85029d
CE1: hold nonprofit waivers to supplemental lists, joiners and 3121(k…
MaxGhenis Nov 1, 2026
623c7d5
CE1: keep guaranteed payments and 411(a)(5) income in the base defini…
MaxGhenis Nov 1, 2026
a01f60c
CE1: hold federal exclusions to service for the United States
MaxGhenis Nov 1, 2026
6787b32
CE1: carry the 2601(d)(3) delay past 1986 and route off-axis pins by …
MaxGhenis Nov 1, 2026
4435b80
CE1: test fact patterns by exact condition texts and stated paths
MaxGhenis Nov 1, 2026
6392e71
CE1: sweep every row both ways; guard unread facts and worded conditions
MaxGhenis Nov 1, 2026
486453f
CE1: name the guard's if key and state the round's invariants
MaxGhenis Nov 1, 2026
740138a
CE1: hold the section 306 certificate to its Canadian service
MaxGhenis Nov 1, 2026
ba1b4a1
CE1: count a statewide system that covers the position as membership
MaxGhenis Nov 1, 2026
16fb9b7
CE1: test the quarter before 1978 in the Communist-organization row
MaxGhenis Nov 1, 2026
15c09d9
CE1: let each open case reach only the workers its readings split
MaxGhenis Nov 1, 2026
56c40b2
CE1: test church service by the service, drop control abroad, record …
MaxGhenis Nov 1, 2026
0b3deb7
CE1: key the 1977 casual cash test on the payment date and check case…
MaxGhenis Nov 2, 2026
4a54543
CE1: make the oracle see broadened cases, pin deferrals, reasons and …
MaxGhenis Nov 2, 2026
80cc8e2
CE1: carry the government-chaplain limit and widen the worded-conditi…
MaxGhenis Nov 2, 2026
60200c1
CE1: open the silent nonprofit, agreement and farm-arrangement choices
MaxGhenis Nov 2, 2026
edef65d
CE1: cite no scratch notes, and tidy the conformance module
MaxGhenis Nov 2, 2026
a174270
CE1: let the newspaper reason name its pointer
MaxGhenis Nov 2, 2026
4a4f057
CE1: open the sect and 1973 gross-concept readings the rows had closed
MaxGhenis Nov 2, 2026
fbfc067
CE1: carry (G)'s definition of "subject to" in the legislative cases
MaxGhenis Nov 2, 2026
c3c0b4e
CE1: open the 401(a) trust's small remuneration in both nonprofit rows
MaxGhenis Nov 2, 2026
852da87
CE1: date the agreement exemption alike in the clergy and SE families
MaxGhenis Nov 2, 2026
132efce
CE1: open a minor newspaper vendor who is a 3508 direct seller after …
MaxGhenis Nov 2, 2026
f926fe3
CE1: let the State and local residual claim only what its family reads
MaxGhenis Nov 2, 2026
e83ac7c
CE1: decide membership entity by entity on the captured regulation
MaxGhenis Nov 3, 2026
fb0fd70
CE1: name 410(a)'s (A)(ii), (B)(ii) condition and (C) in the scope gap
MaxGhenis Nov 3, 2026
764b730
CE1: read section 306(a)(3) as who may file, not which service
MaxGhenis Nov 3, 2026
f07e2be
CE1: date the agreement exemption from 1401(c) and close the pre-1983…
MaxGhenis Nov 3, 2026
1f5d0ef
CE1: close the 1973-1987 church annuity contributions as noncovered
MaxGhenis Nov 3, 2026
239ef16
CE1: keep church pay below the $100 employer gate out of the 1984-85 …
MaxGhenis Nov 3, 2026
95cfe0a
CE1: state the casual rows' section 351(d) payment-date reading as ch…
MaxGhenis Nov 3, 2026
1986c1b
CE1: name what failing the three covered membership conditions reaches
MaxGhenis Nov 3, 2026
f57f380
CE1: limit the minor newspaper direct-seller case to 410(a)(14) work
MaxGhenis Nov 3, 2026
4774f45
CE1: limit four open cases to where their readings differ; open 521
MaxGhenis Nov 3, 2026
e5129c3
CE1: read the (k)(4)(C) window as unpaid quarters after the stop
MaxGhenis Nov 3, 2026
43deeb6
CE1: date the army-corps case from 10 U.S.C. 2360's enactment
MaxGhenis Nov 3, 2026
95fa4fa
fixup! CE1: date the army-corps case from 10 U.S.C. 2360's enactment
MaxGhenis Nov 3, 2026
0fe75bd
CE1: limit the FEPCA open case to 410(a)(5)(A) service
MaxGhenis Nov 3, 2026
dc674bc
CE1: label 410(a)(7)(C)-(E) as the captured editions do
MaxGhenis Nov 3, 2026
c55ebd9
CE1: quote (G)'s definition of "subject to"
MaxGhenis Nov 3, 2026
25b02a6
CE1: give the election agreement amount its period
MaxGhenis Nov 3, 2026
8fc6cf3
CE1: refresh stale nonprofit and sect texts; flag run-together sentences
MaxGhenis Nov 3, 2026
3b88411
CE1: refuse non-integer case-threshold years as registry errors
MaxGhenis Nov 3, 2026
0b93343
CE1: state the case-threshold year refusal in the module invariants
MaxGhenis Nov 3, 2026
c9b32a4
CE1: fix the fixture defects low 5 lists; name the 7873 activity
MaxGhenis Nov 3, 2026
6d7cf04
CE1: parse the registry once at import in the conformance module
MaxGhenis Nov 3, 2026
423b050
CE1: give the two units $400 church cases a just-miss worker
MaxGhenis Nov 3, 2026
a36f073
CE1: give eight just-miss workers an own text for the fact they miss
MaxGhenis Nov 3, 2026
22edbd3
CE1: give the gross concept's pension case a just-miss worker
MaxGhenis Nov 3, 2026
4b484f9
Merge master 97003ac2 into the CE1 branch
MaxGhenis Nov 3, 2026
a9aae68
Recount tiers for CE1 on master 97003ac2
MaxGhenis Nov 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions data/external/income_resources_ce1/assemble_registry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
"""Assemble CE1 research fragments; verify source hashes before writing JSON.

Run with the clone's virtual-environment Python from the repository root.
The fragments retain the research work split; coverage_rules.json is the
single runtime input. This script fetches nothing.
"""

import json
from pathlib import Path

from populace_dynamics.income_resources.coverage_rules import (
CAPTURE_DIRECTORY,
SCHEMA_VERSION,
CoverageRegistry,
)


def build(root: Path | None = None) -> str:
"""Validate fragments and return the complete canonical registry text."""
root = Path(root) if root is not None else Path(__file__).resolve().parent

def read(name):
return json.loads((root / name).read_text())

rules = []
for name in (
"government_rules.json",
"se_rules.json",
"other_rules.json",
"se_modifier_rules.json",
):
rules.extend(read(name))
thresholds = []
for name in (
"thresholds_government.json",
"thresholds_se.json",
"thresholds_other.json",
):
thresholds.extend(read(name))
ret = read("earnings_test_root.json")
ret["self_employment_guidance"] = read("earnings_test_se.json")
ret["historical_research"] = read("ret_history_government.json")
ret["definition_modifier_research"] = read("ret_history_modifiers.json")
raw = {
"schema_version": SCHEMA_VERSION,
"income_years": [1968, 2026],
"rules": rules,
"thresholds": thresholds,
"earnings_test": ret,
"table_definitions": read("table_definitions_root.json"),
"scope_status": "partial_statutory_registry_open_histories_refuse",
"design": "docs/design/covered_earnings_v2.md",
"rare_exclusion_ruling": "open_no_reading_selected",
# Statutory conditions no family reads, so no residual reaches
# them (review r6 M-5).
"scope_gaps": read("scope_gaps.json"),
"open_questions": [
{"rule_id": rule["rule_id"], "reason": rule["open_reason"]}
for rule in sorted(rules, key=lambda row: row["rule_id"])
if rule["open_reason"]
],
}
return CoverageRegistry.from_dict(
raw, capture_root=CAPTURE_DIRECTORY
).to_json()


def main():
root = Path(__file__).resolve().parent
(root / "coverage_rules.json").write_text(build(), encoding="utf-8")


if __name__ == "__main__":
main()
34,658 changes: 34,658 additions & 0 deletions data/external/income_resources_ce1/coverage_rules.json

Large diffs are not rendered by default.

153 changes: 153 additions & 0 deletions data/external/income_resources_ce1/earnings_test_root.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"status": "current_text_verified_historical_effective_dates_open",
"citations": [
{
"capture": "lii_42usc403.html",
"sha256": "089ec01fbef104c50892cc9097a12a5a259d3b58c0f335a16f6d67f0021df41a",
"authority": "42 U.S.C.403(f)(5), assignment-pinned current text and amendment notes",
"location": "(f)(5)(A)\u2013(E); amendment notes 1965, 1980, 1983, 1989, 1990"
},
{
"capture": "lii_42_409.html",
"sha256": "d37ce452924c0d10f48af5b2c8cbb96d6692c529dc633a927092af90db69107b",
"authority": "42 U.S.C. 409(a), text captured 2026-10-24",
"location": "(a)(1),(6)(B),(6)(C),(7)(B),(8)"
}
],
"income_year_support": [
1968,
2026
],
"historical_refusal": "Current concept is documented; historical \u00a7403(f)(5) effective-date reconstruction is incomplete. Do not apply current text to earlier income years by assumption.",
"earnings_equation": "wages_for_services_in_year + net_earnings_from_self_employment - net_loss_from_self_employment",
"self_employment": {
"reference": "42 U.S.C.411",
"disregarded_trade_or_business_exclusions": [
"411(c)(1)",
"411(c)(4)",
"411(c)(5)"
],
"thresholds_apply": false,
"reason": "411(b)(2) and(i)(2) define self-employment income;403(f)(5)(B) uses net earnings/net loss.",
"church_employee_income": "411(i)(1) includes gross church employee income with no deductions and excludes it and associated deductions from the other unit. \u00a7411(a)(11) remains applicable after that separation (\u00a7411(i)(3)); RET factor exceptions in POMS are recorded separately."
},
"disregarded_wage_limits": [
{
"paragraph": "409(a)(1)",
"concept": "annual contribution and benefit maximum",
"component_threshold": false,
"aggregation": "person_year"
},
{
"paragraph": "409(a)(6)(B)",
"concept": "domestic cash remuneration threshold",
"component_threshold": true,
"aggregation": "employer_employee_year"
},
{
"paragraph": "409(a)(6)(C)",
"concept": "casual nonbusiness cash remuneration threshold",
"component_threshold": true,
"aggregation": "employer_employee_year"
},
{
"paragraph": "409(a)(7)(B)",
"concept": "agricultural cash remuneration gates",
"component_threshold": true,
"aggregation": "employer_employee_year_or_employer_year"
},
{
"paragraph": "409(a)(8)",
"concept": "statutory homeworker cash remuneration threshold",
"component_threshold": true,
"aggregation": "employer_employee_year"
}
],
"deeming_rule": {
"required_conditions": [
{
"condition_id": "service_location_and_employee_status",
"fact_names": [
"employee_self_or_mixed",
"place_of_work",
"active_us_military_service"
],
"test": "Employee service within the United States, or service outside the United States in active United States military or naval service."
},
{
"condition_id": "no_self_employment_double_count",
"fact_names": [
"remuneration_in_self_employment"
],
"test": "Remuneration is not includible in net earnings or net loss from self-employment."
}
],
"connective": "both",
"citation": {
"capture": "lii_42usc403.html",
"sha256": "089ec01fbef104c50892cc9097a12a5a259d3b58c0f335a16f6d67f0021df41a",
"authority": "42 U.S.C.403(f)(5)(C)",
"location": "(f)(5)(C), first sentence",
"quote": "shall be deemed to be employment as so defined if the remuneration for such services is not includible"
}
},
"retirement_exclusions": [
"403(f)(5)(C)(i): payment on account of retirement, including employer insurance,annuity or fund payments to employee/dependents",
"403(f)(5)(C)(ii): employer payments on/after termination because of retirement after plan-specified age"
],
"gross_income_exclusions_D": [
{
"clause": "403(f)(5)(D)(i)",
"conditions": [
"attained statutory retirement age by last day of taxable year",
"royalties from copyright/patent obtained before taxable year of attaining that age",
"property created by own personal effort",
"facts shown to satisfaction of Commissioner"
],
"excluded": "such royalties"
},
{
"clause": "403(f)(5)(D)(ii)",
"conditions": [
"entitled to title II benefits other than disability insurance or disabled-child benefits",
"receipt in year after initial entitlement year",
"income not attributable to services after initial entitlement month",
"facts shown to satisfaction of Commissioner"
],
"excluded": "such other income"
}
],
"timing_E": "Corporate-director net earnings are deemed derived/received when services performed, regardless of later receipt; exception where paid and received before that service year.",
"history_locators": [
{
"year": 1965,
"act": "P.L.89-97\u00a7325(a)",
"change": "added(D) royalty exclusion"
},
{
"year": 1980,
"act": "P.L.96-473\u00a73(a)",
"change": "expanded(D) to other deferred income"
},
{
"year": 1983,
"act": "P.L.98-21\u00a7324(c)(4)",
"change": "added special retirement wage exclusions"
},
{
"year": 1989,
"act": "P.L.101-239\u00a710208(d)(2)",
"change": "renumbered 409 cross references"
},
{
"year": 1990,
"act": "P.L.101-508\u00a75123(a)",
"change": "moved director timing sentence from 411(a) to 403(f)(5)(E)"
}
],
"refusal_reasons": [
"RET_WAGE_ELIGIBILITY_UNRESOLVED",
"RET_REMUNERATION_TYPE_UNRESOLVED",
"RET_SE_FACTS_UNRESOLVED"
]
}
Loading
Loading