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
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