Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ce86490
Start the US one-population contract library
MaxGhenis Nov 17, 2026
41046e1
Add staging's union-column form of the generated ACS tables
MaxGhenis Nov 17, 2026
7a363f8
Rewrite the one-population provenance and derive CPS unit ids
MaxGhenis Nov 17, 2026
b825f02
Test the household sort and the validator wrap in the provenance rewrite
MaxGhenis Nov 17, 2026
456c498
Add the one-population contract's refusals
MaxGhenis Nov 17, 2026
9c829ec
Add the one-population role record and absences file
MaxGhenis Nov 17, 2026
971bac0
List every kindless absence in one refusal
MaxGhenis Nov 17, 2026
9c24c5e
Add the one-population whole-frame reader differential
MaxGhenis Nov 18, 2026
77aa266
Keep a broken reader frame out of the expected failures
MaxGhenis Nov 18, 2026
9f0019e
Apply the lead's absence calls to the population contract
MaxGhenis Nov 18, 2026
1451e8f
Answer the implementation review on the population contract
MaxGhenis Nov 18, 2026
7d36dfc
Pin the stand-in's inputs to the installed engine's
MaxGhenis Nov 18, 2026
729f0d1
Record a declaration a receipt covers as needless
MaxGhenis Nov 18, 2026
b30abcd
Apply lead calls L1-L6 to the population contract
MaxGhenis Nov 18, 2026
c5186ef
Add the two clone-only verdict flips to the reader differential
MaxGhenis Nov 18, 2026
dc99e6b
Check that a clone defect's assembled gate fails for no other reason
MaxGhenis Nov 18, 2026
250fd6a
Merge main (bcb5cba9d) into the US one-population contract branch
MaxGhenis Nov 18, 2026
3f58101
Re-anchor the population contract's citations after merging main
MaxGhenis Nov 18, 2026
05aeb34
Answer the lead-call review on the population contract
MaxGhenis Nov 19, 2026
1cc4b14
Merge main (cfd5a2a5e) into the US one-population contract branch
MaxGhenis Nov 19, 2026
1161db1
Say why each moved input left the exempt list
MaxGhenis Nov 19, 2026
74ca478
Answer the independent review of the population contract
MaxGhenis Nov 20, 2026
26c519f
Answer the second independent review of the population contract
MaxGhenis Nov 20, 2026
989f396
Merge main 2f45706fc2 into us-one-population-gate-scopes
MaxGhenis Nov 20, 2026
f431315
Mark X5's expected failures per case and pin the ACS-label modules
MaxGhenis Nov 20, 2026
f4f275d
Compare PR 3's four gates with main's vendored code
MaxGhenis Nov 20, 2026
276d8c3
Add a reader frame that joins ACS rows to the CPS rows
MaxGhenis Nov 20, 2026
410fad2
Reconcile Medicare take-up on every CPS row of an assembled frame
MaxGhenis Nov 21, 2026
8f21661
Answer the third review of the population contract
MaxGhenis Nov 21, 2026
6e78d23
Correct the ACS-label census texts and a moved-reader docstring
MaxGhenis Nov 21, 2026
445b1f1
Pin the differential's gate pairs and the oracles' plain imports
MaxGhenis Nov 21, 2026
7b1a61d
Check the mixed-origin frame's ACS weights, seed and household count
MaxGhenis Nov 21, 2026
fa07eeb
Test the Medicare refusal of an assembled frame with no CPS row
MaxGhenis Nov 21, 2026
2b531cf
Merge PR 2's third review fixes into PR 3
MaxGhenis Nov 21, 2026
6f1ef3f
Test that a null SNAP subsidy anchors no ACS SPM unit
MaxGhenis Nov 21, 2026
38a387e
Add one_population_declares_acs_rows to the population contract
MaxGhenis Nov 21, 2026
6b040cd
Drop a history sentence and a passive from the SNAP null-rule tests
MaxGhenis Nov 21, 2026
b54ae24
Test the declared-ACS predicate's record refusals
MaxGhenis Nov 21, 2026
c131c12
Add a changelog line for one_population_declares_acs_rows
MaxGhenis Nov 21, 2026
a682ea7
Key the weeks UC rule on CPS origin and fail the ACS channel closed
MaxGhenis Nov 21, 2026
ab5d9ec
Validate distribution slots on every CPS row of an assembled frame
MaxGhenis Nov 21, 2026
1348434
Reconcile contributions on every CPS row of an assembled frame
MaxGhenis Nov 21, 2026
5e468ca
Retire the whole-frame differential's expected-failure machinery
MaxGhenis Nov 21, 2026
1d56521
Compare every statistic in the clone-only defect cases
MaxGhenis Nov 21, 2026
08f0666
Merge main f156478f7c into PR 3
MaxGhenis Nov 21, 2026
d1b047d
Re-pin the spec digests for PR 3's gate scopes (interim, main f156478…
MaxGhenis Nov 21, 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
1 change: 1 addition & 0 deletions changelog.d/us-one-population-contract.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `us_runtime/one_population_contract.py`, the population contract library for d2283's national one-population file. `to_assembled_provenance` rewrites the parent export's CPS rows (Route A's `asec` and `puf_tax_detail` labels kept, spine source id = source id, spine tag `asec_puf`) and staging's ACS rows (`acs_2024_1yr`, spine source id = staging's native id) into the assembled form with a clone-0, three-channel spine assembly record, taking each origin's household weights keyed (CPS by household id, ACS by the selection's unit key) and refusing weights given by position or held as complex or temporal values, incomplete support metadata, an id, clone index, lineage number or person-to-group link held as anything but integers, real numbers or strings (such as a complex value, a time or an Arrow dictionary of times), colliding ids, a repeated (source id, rank) pair, lost `SERIALNO`/`SPORDER` lineage (it compares each ACS person's pair with staging's lineage, keyed on native household and person ids), a group unit spanning two households, and an ACS household with more than one SPM unit. `require_one_population` refuses a joined frame that breaks any clause, each with its own message: provenance (including a spine assembly record count that is not a nonnegative integer), one native row per CPS key and one row per ACS household against the selection manifest (`one_population_selection`), location clones, a missing congressional district, `TYPEHUGQ` on ACS households, columns the engine computes at 2024, unregistered lower-case columns, a null ESI premium, an SPM unit without a classified adult, a null engine input outside the release-written list, or a null inside it other than None or a float NaN (`pd.NA`, `pd.NaT` and numpy's `NaT` refuse), null PUF tail columns, a tail donor set unlike the parent's, applied twice or applied on an ACS tax unit, and an undeclared register column ACS rows lack while CPS rows hold it. `combined_spm_role_record` builds the SPM role record from a CPS record and staging's ACS receipt, checked against a recount of the frame and, on ACS rows, against the role each person's `RELSHIPP` gives (a code held as anything but an integer, real number or string refuses); `absences` and `write_absences` list what each origin lacks, by support channel, as owner-declared, release-written, raw source column, reviewed default fill, zero written or origin-native (the six ACS-native `acs_*` amounts CPS rows lack); they record declarations a frame does not use instead of refusing them, and refuse a fill receipt that gives a spine a negative row count. `cps_unit_ids` derives the CPS selection keys, and `one_population_selection`'s key digest is now public as `keys_sha256`. The engine's variable classes come from an injected index, built from the installed engine only at call time. No build calls it yet.
1 change: 1 addition & 0 deletions changelog.d/us-one-population-gate-scopes.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `one_population_declares_acs_rows` to `us_runtime/one_population_contract.py`. It reports whether a frame holds d2283's ACS rows, from the spine assembly record's ACS person count and the person rows' support channel, and refuses a frame where the two disagree or the record is malformed. It returns False on Route A frames and stacked pools. No build calls it yet.
7 changes: 7 additions & 0 deletions changelog.d/us-one-population-gate-scopes.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The US Medicare take-up gate now reconciles `MCARE` on every CPS row of an assembled frame: the physical ASEC rows and their PUF tax-detail clones (stored channels `asec` and `puf_tax_detail`), the rows Route A reconciles. It leaves ACS rows out, so on d2283's one-population frame an ACS row's empty `MCARE` never reaches the reconciliation. The gate still takes every row of Route A's frames and the pre-clone base, which carry no spine source ids, and the stacked pool stores no `puf_tax_detail` channel, so none of their verdicts or statistics change.

The US weeks-unemployed gate now puts every CPS clone of an assembled frame in its unemployment-compensation rule, as Route A does, whether the frame stores the clone as `asec` (the stacked pool) or as `puf_tax_detail` (Route A's clone label, which d2283's one-population frame keeps). Natives of any other channel stay in the rule, and only native `asec` rows reconcile to `LKWEEKS`, so no ACS row reaches that check. ACS rows on d2283's frame carry the channel `acs_2024_1yr`, which has no reviewed rule yet. The gate fails that channel with one line, `acs_2024_1yr weeks_unemployed has no reviewed rule yet (d2283 spike).`, keeps its statistics and reports null bands for it. Route A's frames and the pre-clone base carry no spine source ids, and the stacked pool stores its ACS rows as `acs` and no row as `puf_tax_detail`, so none of their verdicts or statistics change.

The US retirement-distributions gate now validates the `DST_*` slots of every CPS row of an assembled frame: the physical ASEC rows and their PUF tax-detail clones (stored channels `asec` and `puf_tax_detail`), the rows Route A validates. It still reconciles the outputs on native CPS rows only, and it leaves ACS rows out of both checks, so on d2283's one-population frame an ACS row's empty slots never reach the source checks, which would raise. Route A's frames and the pre-clone base carry no spine source ids, and the stacked pool stores no `puf_tax_detail` channel, so none of their verdicts or statistics change.

The US retirement-contributions gate now reads `RETCB_VAL` on every CPS row of an assembled frame: the physical ASEC rows and their PUF tax-detail clones (stored channels `asec` and `puf_tax_detail`), the rows Route A reads. It reconciles the outputs on each of those rows whose stored channel matches its operator role, a native stored as `asec` or a clone stored as `puf_tax_detail`, so on d2283's one-population frame it reconciles every CPS row, as Route A does. It leaves ACS rows out of both, so an ACS row's empty `RETCB_VAL` never reaches the source read, which would raise. As on Route A, the clones' source values count toward `source_total` and their imputed outputs toward `allocation_mismatch_rows`, a count the gate reports and does not fail on. Route A's frames and the pre-clone base carry no spine source ids, and the stacked pool stores no `puf_tax_detail` channel, so none of their verdicts or statistics change.
16 changes: 8 additions & 8 deletions docs/evidence/spec-engine/us-f0-coverage.json
Original file line number Diff line number Diff line change
Expand Up @@ -1642,13 +1642,13 @@
"compiler_ir.node_slices"
],
"expected": {
"map_sha256": "afbe93ebeb8d48294581d860aed690c168eb4c2c92461353676a794cefd22584",
"protocol_sha256": "05fb40521ffef194cec9c2fe4dfedbbfd02e64ddddfd69f1a591961b61804176"
"map_sha256": "d79f736aea0042c6e93511d2f0159388b8a13f3ed62cadb376653d619f8e36fa",
"protocol_sha256": "24e52e423cc6b44009826e1fab1187fe986079ce95450191329f02edf1ac0538"
},
"failures": [],
"observed": {
"map_sha256": "afbe93ebeb8d48294581d860aed690c168eb4c2c92461353676a794cefd22584",
"protocol_sha256": "05fb40521ffef194cec9c2fe4dfedbbfd02e64ddddfd69f1a591961b61804176"
"map_sha256": "d79f736aea0042c6e93511d2f0159388b8a13f3ed62cadb376653d619f8e36fa",
"protocol_sha256": "24e52e423cc6b44009826e1fab1187fe986079ce95450191329f02edf1ac0538"
},
"status": "covered"
},
Expand All @@ -1663,7 +1663,7 @@
"compiler_ir.seed_stream_map"
],
"expected": {
"implementation_sha256": "05fb40521ffef194cec9c2fe4dfedbbfd02e64ddddfd69f1a591961b61804176",
"implementation_sha256": "24e52e423cc6b44009826e1fab1187fe986079ce95450191329f02edf1ac0538",
"protocol": "legacy-v1",
"streams": [
"build_model",
Expand All @@ -1684,7 +1684,7 @@
},
"failures": [],
"observed": {
"implementation_sha256": "05fb40521ffef194cec9c2fe4dfedbbfd02e64ddddfd69f1a591961b61804176",
"implementation_sha256": "24e52e423cc6b44009826e1fab1187fe986079ce95450191329f02edf1ac0538",
"protocol": "legacy-v1",
"streams": [
"build_model",
Expand Down Expand Up @@ -2585,7 +2585,7 @@
"country": "us",
"schema_id": "country_spec",
"schema_version": 1,
"spec_sha256": "f5eb16a0ff78a0b6622c7701f22a9f12a466e5f2729fd83c200ccc3b519c0292"
"spec_sha256": "8c3ab04a9c4a926f405b53d79d287188fdc6153d6399301377bd0e39e7b3078b"
}
},
"report_schema_version": 3,
Expand All @@ -2595,7 +2595,7 @@
"country": "us",
"schema_id": "country_spec",
"schema_version": 1,
"spec_sha256": "f5eb16a0ff78a0b6622c7701f22a9f12a466e5f2729fd83c200ccc3b519c0292"
"spec_sha256": "8c3ab04a9c4a926f405b53d79d287188fdc6153d6399301377bd0e39e7b3078b"
},
"status": "pass"
}
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,13 @@
# the builder's arms by flag; no draw, RNG rule, QRF target or solve changes.
# The in-place QRF leaf array in microcosm.fit.qrf moves both again: the
# forests' leaf arrays are byte-identical, and no draw changes.
"seed_map": "afbe93ebeb8d48294581d860aed690c168eb4c2c92461353676a794cefd22584",
"seed_protocol": "05fb40521ffef194cec9c2fe4dfedbbfd02e64ddddfd69f1a591961b61804176",
# microcosm#1702 moves both again: on an assembled frame the
# weeks-unemployed and both retirement gates check the CPS rows Route A
# checks, under either CPS label, and the weeks gate refuses the
# acs_2024_1yr channel until that channel has a reviewed rule. No draw,
# RNG rule or QRF target changes.
"seed_map": "d79f736aea0042c6e93511d2f0159388b8a13f3ed62cadb376653d619f8e36fa",
"seed_protocol": "24e52e423cc6b44009826e1fab1187fe986079ce95450191329f02edf1ac0538",
"source_manifest": "dc3879886d2a69f20fb982a675d7fb322c0e4017afef6471be54b0ee3cbd2af6",
"take_up": "9522ce40f7dea569312dd7a7beb474e5a5afadd2f1e10cb5876534c3ef623d35",
"tail": "565f0ceeadab69d3e96a886a00dd0305f7425fa3acde24d12ba48db2b37d5fc0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
)
from microcosm.build.us_runtime.support_provenance import (
BASE_ASEC_SUPPORT_CHANNEL,
PUF_TAX_DETAIL_SUPPORT_CHANNEL,
has_assembled_support_metadata,
has_support_role_metadata,
support_gate_source_channel_series,
Expand Down Expand Up @@ -132,12 +133,21 @@ def _source_codes(person: pd.DataFrame, source: str) -> np.ndarray:


def _asec_source_mask(person: pd.DataFrame) -> np.ndarray:
"""Select physical ASEC rows without changing legacy source semantics."""
"""Select CPS rows without changing legacy source semantics.

The mask takes every row of a frame without assembly metadata, such as
Route A's frames and the pre-clone frame. On an assembled frame it takes
the rows whose stored channel names a CPS origin, ``asec`` or
``puf_tax_detail``: physical ASEC rows and their PUF tax-detail clones,
which Route A reconciles in full. It leaves ACS rows out.
"""

if not has_assembled_support_metadata(person, entity="person"):
return np.ones(len(person), dtype=bool)
source_channels = support_gate_source_channel_series(person, entity="person")
mask = source_channels.eq(BASE_ASEC_SUPPORT_CHANNEL).to_numpy()
mask = source_channels.isin(
(BASE_ASEC_SUPPORT_CHANNEL, PUF_TAX_DETAIL_SUPPORT_CHANNEL)
).to_numpy()
if not mask.any():
raise SourceRuntimeError(
"US Medicare take-up support has no physical ASEC source rows."
Expand Down
Loading
Loading