Selection-mass protection targets: the refit must preserve swapped-in mass (#445)#446
Merged
Conversation
…d-in mass Fixes populace#445. Build M attempt 15: the #434 protect-swap carried all 13 keogh carriers into the frozen selection, but keogh_distributions is untargeted (zero facts in the feed), so the refit crushed their weights - $148.97M of locked ASEC source mass exported as $6.108M (-96%) and the smoke probe scored +$145,380 against its >=$1M floor. Membership protection without mass protection is not protection. New --selection-mass-protection COLUMN (repeatable): each protected column becomes an ordinary national calibration target whose value is the base pool's own locked-source mass at base weights - measured at build time, never hardcoded - so the solve must preserve the mass the swap put in-selection. Design points: - The spec rides the standard policyengine_variable materializer (measure_mode sum, base_variable = the column), so BOTH the fresh materialization path and the checkpoint-reload path compile it; no new materialization machinery. - Injected after the target-parity contract runs on the compiled feed registry: these are run-scoped builder targets with build-manifest provenance (metadata carries target_role/protected_column/carriers/ issue), not feed families. - The checkpoint identity carries the protection list ONLY when configured: unprotected runs (the dense arm, every prior sparse run) keep bit-identical legacy digests and warm checkpoints, while a protected run MISSES a column-less legacy checkpoint - a load would silently drop the spec, because _compile_materialized_target_registry keeps only specs whose measures exist on the materialized household table. - Fail-closed spec construction: absent column, zero carriers, and signed net-zero mass are configuration errors. The protection lifts when the concept gains a real Ledger fact (populace#445 remedy 2, the SOI-identification path #432 prescribes for every unpinned column). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 17, 2026
MaxGhenis
added a commit
that referenced
this pull request
Jul 20, 2026
#465) populace#451 items 3-4, release-builder side. Anchor receipts and the support measurements are on the issue. - The W-2 Box 7 dollar aggregate now binds as a sum-mode tip_income target: form_w2_item facts carry the generic "amount" measure id, so the layout override must run before the unmapped early-return (the return-count branch only ever worked because "return_count" happens to sit in the returns map). On certified Build M support this is a ~3x pull: 549 carriers / $9.886B weighted vs the $26.79B TY2020 anchor - pair the N launch with a tip_income selection-mass protection (#446 pattern). - The stale return-count exclusion reason claimed no positive tip support exists; the SIPP tip stage has since landed. The corrected reason states the real bar: 549 carriers are under 1% of the 6.04M return class, so the count target waits for support widening rather than demanding ~600x weight concentration. - Two reform-coverage probes (generated manifest, 37 -> 39): tips and FLSA overtime premium neutralization at 2026 law. Both columns are attribution-only (W-2 wages already contain the dollars); their sole federal tax channel is the OBBBA deductions, so 2024-law probes measure exactly $0 and the guarded sign is negative. Measured on certified Build M: tips -$413.4M (floor $100M), overtime -$16.88B (floor $4B). Deliberately NOT wired, with support oracles on the issue: the SE health ALD target (engine computes 0 carriers / $0 until the premium attribution stage lands) and the keogh ALD target (1,643 carriers / $0.92B modeled vs $30.13B SOI - a 34x stretch in the same class as the excluded tips count). Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes #445
Why
Attempt 15 proved the last defect standing: the #434 protect-swap put all 13 keogh carriers in the frozen selection, but nothing protects their mass — keogh is untargeted, so the refit crushed the carriers' weights and $148.97M of locked ASEC source mass exported as $6.108M (smoke: +$145,380 vs the ≥$1M floor). Full adjudication in #445; Max picked option A.
What
--selection-mass-protection COLUMN(repeatable): the column's locked-source mass — measured on the base pool at base weights at build time, never hardcoded — is injected as a synthetic national calibration target, so the refit has a loss term holding the mass the swap put in-selection.policyengine_variablematerializer (measure_mode: sum), so the fresh-materialize and checkpoint-reload paths both compile it — zero new materialization code.target_role,protected_column,base_pool_carriers, issue)._compile_materialized_target_registrykeeps only specs whose measures exist on the materialized household table; the miss is asserted by test against a real written checkpoint).Tests
test_selection_mass_protection_specs_measure_locked_source_mass— measured value ($700k on the fixture), materializer contract, provenance fields.test_selection_mass_protection_specs_fail_closed— absent column and zero-carrier raises.test_checkpoint_identity_protection_key_and_stale_checkpoint_miss— legacy digest bit-identical without protections; protected identity misses a legacy checkpoint (returns None, no silent spec drop).Full builder suite green locally. Attempt 16 runs with
--selection-mass-protection keogh_distributions; expected smoke score ≈ +$24.47M. The protection lifts when keogh gains a real Ledger fact (#445 remedy 2).🤖 Generated with Claude Code