Skip to content

Selection-mass protection targets: the refit must preserve swapped-in mass (#445)#446

Merged
MaxGhenis merged 1 commit into
mainfrom
selection-mass-protection
Jul 17, 2026
Merged

Selection-mass protection targets: the refit must preserve swapped-in mass (#445)#446
MaxGhenis merged 1 commit into
mainfrom
selection-mass-protection

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

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.

  • Rides existing machinery: the spec declares the standard policyengine_variable materializer (measure_mode: sum), so the fresh-materialize and checkpoint-reload paths both compile it — zero new materialization code.
  • Sequencing: injected after the target-parity contract runs on the compiled feed registry (run-scoped builder target, not a feed family; provenance in spec metadata: target_role, protected_column, base_pool_carriers, issue).
  • Checkpoint safety: the identity carries the protection list only when configured — unprotected runs keep bit-identical legacy digests (dense arm's warm checkpoints stay valid; asserted by test), while a protected run misses a column-less legacy checkpoint instead of loading it (a load would silently drop the spec — _compile_materialized_target_registry keeps only specs whose measures exist on the materialized household table; the miss is asserted by test against a real written checkpoint).
  • Fail-closed: absent column / zero carriers / signed net-zero are configuration errors.

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

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

Refit crushes keogh carrier weights to $6.1M of $148.97M — smoke floor unreachable on the sparse arm (attempt 15)

1 participant