You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 14, 2026. It is now read-only.
Adopt microunit for tax-unit reconstruction (scoped, behavior-preserving; part of #113) (#114)
* Delegate PE tax-unit reconstruction to microunit (part of #113)
Add microunit as a dependency and route the reconstruction-from-scratch
tax-unit path through microunit.construct_tax_units when the person frame
carries microunit's raw CPS input columns (PH_SEQ, A_LINENO, A_MARITL,
A_SPOUSE, PEPAR1, PEPAR2, A_EXPRRP). When those columns are absent -- the
current production case, since microplex's reconstruction frame collapses
relationship_to_head and drops the spouse/parent pointers -- the new
USPipeline._build_policyengine_tax_units_via_microunit returns None and the
legacy role-flag reconstruction runs unchanged. The authoritative-ID path
(#112) is never routed here.
Net effect is behavior-preserving on today's data: the delegation stays
inert until an upstream change threads CPS columns through to entity
construction. microunit IS eCPS's tax-unit engine, so activating the
delegation converges microplex's tax units toward eCPS's; any resulting
loss movement is an entity-convergence effect and must be interpreted as
such, not as a quality win (see #113).
Adds tests/pipelines/test_us_microunit_delegation.py (4 passing); ruff clean.
Implementation produced by the parallel wire-microunit agent; verified
(ruff + delegation tests) and committed here.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Depend on microunit from PyPI (>=0.1.0) instead of the git pin
microunit 0.1.0 is now published to PyPI, so drop the pre-PyPI
git+https commit pin in favor of a standard version constraint.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Harden microunit delegation: defensive filing-status normalize + order test
- Route microunit's filing_status through _normalize_policyengine_filing_status
so the delegated path cannot diverge from the legacy paths if microunit ever
changes its spelling/casing (today the vocabularies already match).
- Add a regression test feeding rows out of PH_SEQ/A_LINENO order, asserting
correct unit/role/filing assignment — locks in microunit's input-row-order
contract that the positional TAX_ID mapping relies on.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments