Skip to content

Generalize the ACA-branded labels in the shared binary assignment ops#338

Open
daphnehanse11 wants to merge 1 commit into
mainfrom
claude/nostalgic-hertz-e26657
Open

Generalize the ACA-branded labels in the shared binary assignment ops#338
daphnehanse11 wants to merge 1 commit into
mainfrom
claude/nostalgic-hertz-e26657

Conversation

@daphnehanse11

Copy link
Copy Markdown
Collaborator

Summary

The generic assign_binary_from_rate / calibrate_binary_assignment / calibrate_binary_assignment_joint_targets handlers in us_runtime/source_runtime.py hard-coded "ACA binary assignment" / "ACA binary calibration" into every error message, even though they are shared manifest primitives. A failure in any non-ACA stage driving them — empirically verified with #334's person-grain medicaid_take_up stage, where dropping person_weight yielded "ACA binary calibration frame is missing required column(s)" — reported itself as an ACA failure. Closes the follow-up from the #334 review.

  • Labels are now keyed to the operation kind: "US binary assignment", "US binary calibration", "US joint binary calibration", matching the file's existing "US ratio computation" / "US support clip" naming. The shared helpers (_binary_calibration_value_state, _preserved_true_mask, _first_available_target_table, _group_columns, _domain_mask) take a label keyword so each handler reports its own name. The _ACA_ prefix is dropped from the corresponding parameter-key frozensets. aggregate_person_to_tax_unit keeps its ACA labels — it is genuinely ACA-specific (Marketplace coverage aggregation) and only the ACA stage uses it.
  • Draw salts are deliberately unchanged. aca:{output}, calibrate:{variable}, and joint-calibrate:{variable} are byte-identical, and the aca: prefix is now commented as frozen: existing ACA releases are bit-reproducible against it. The exact-seeded-outcome assertions in the existing ACA tests pass unchanged, which locks this in.
  • The calibrate handlers' silent stable_tax_unit_draw default is removed: draw is now a required parameter (the assign handler already required it), and the ACA manifest's three calibrate ops state the previous default explicitly — bit-identical behavior. A future person-grain stage that omits the param now fails loudly instead of silently minting positionally-keyed (not identity-stable) draws under a tax-unit column name. _stable_draws gained a docstring stating its tax_unit_id-vs-positional-index keying and that stages at other grains should mint their own identity-keyed draw column.

Interaction with open PR #334 (medicaid_take_up)

Tests

  • New: a person-grain reproduction of the mislabeled error (asserts the message names "US binary calibration" and contains no "ACA"), required-draw errors for both calibrate handlers, and a person-grain calibration happy path with a declared draw column.
  • Full packages/populace-build suite passes (884 tests); ruff check/format clean on the changed files.

🤖 Generated with Claude Code

The generic assign_binary_from_rate / calibrate_binary_assignment /
calibrate_binary_assignment_joint_targets handlers hard-coded "ACA binary
assignment" / "ACA binary calibration" in every error message, so a failure
in any non-ACA stage driving them (e.g. PR #334's person-grain
medicaid_take_up stage) reported itself as an ACA failure. Labels are now
keyed to the operation kind ("US binary assignment" / "US binary
calibration" / "US joint binary calibration", matching the file's existing
"US ratio computation" style) and threaded through the shared helpers so
the joint handler reports its own name.

The "aca:{output}" draw salt is deliberately unchanged (now commented as
frozen): existing ACA releases are bit-reproducible against it, and
label-only changes leave every seeded outcome byte-identical.

The calibrate handlers' silent 'stable_tax_unit_draw' draw-column default
is removed: 'draw' is now a required parameter (the assign handler already
required it), and the ACA manifest states the previous default explicitly,
so behavior is unchanged while a future person-grain stage that omits the
param fails loudly instead of minting positionally-keyed draws under a
tax-unit column name. _stable_draws documents its tax_unit_id-vs-positional
keying fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@daphnehanse11 daphnehanse11 requested a review from MaxGhenis July 7, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant