From ee336dadbf69413e09a4b2f2deed59efdc87c8c5 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Wed, 29 Jul 2026 10:46:00 -0400 Subject: [PATCH 1/5] Dense arm fences its SSI adult bands with the #566/#567 oscillation adjudication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dense full-pool frame's SSI threshold-to-equilibrium map has no one-retry fixed point: the populace#508 recompute moves each adult band past the other, proven on two independent frames (P2: 18-64 +5.8%/65+ +24.8% -> +8.2%/+20.0%; P3: 65+ +34.6% with 18-64 in-band -> +8.3%/ +19.8%). A second retry would be the deleted populace#463-class loop. The delivery gate therefore gains per-run enforcement fences — the under-18 pattern extended: a fenced band's miss ships in the scorecard with its adjudication text, never as an enforced contract and never as saturation-as-success. The dense diagnostic arm fences 18_64 and 65_plus; the sparse certified default passes no fences and keeps hard enforcement (AST-guarded arm conditionality). Fences are validated — only normally-enforced bands, never without adjudication text — and the gate details report the run's EFFECTIVE enforced set plus the fenced keys. The delivery gate result now rides the manifest gates block so a fenced release is distinguishable from an enforced one in the release record itself. Re-adjudicates when populace#566's damped fixed-point protocol lands. Fixes the dense leg of populace#567. Co-Authored-By: Claude Fable 5 --- .../dense-takeup-enforcement.changed.md | 1 + .../populace/build/us_runtime/ssi_take_up.py | 54 +++++++++-- .../tests/test_us_fiscal_refresh_builder.py | 95 ++++++++++++++++++- .../tests/test_us_ssi_take_up.py | 86 +++++++++++++++++ tools/build_us_fiscal_refresh_release.py | 82 ++++++++++++++-- 5 files changed, 304 insertions(+), 14 deletions(-) create mode 100644 changelog.d/dense-takeup-enforcement.changed.md diff --git a/changelog.d/dense-takeup-enforcement.changed.md b/changelog.d/dense-takeup-enforcement.changed.md new file mode 100644 index 00000000..ae0e2c60 --- /dev/null +++ b/changelog.d/dense-takeup-enforcement.changed.md @@ -0,0 +1 @@ +Dense diagnostic arm fences its SSI adult bands (populace#566/#567): the dense frame's threshold-to-equilibrium map has no one-retry fixed point, so fenced misses ship in the scorecard with their adjudication instead of failing the release; the manifest gates block records the run's effective enforced set and fenced rows. The sparse certified default keeps hard enforcement. diff --git a/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py b/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py index 952e0e58..dea9bab9 100644 --- a/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py +++ b/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py @@ -1609,6 +1609,7 @@ def us_ssi_take_up_delivery_gate( diagnostics: Mapping[str, object], *, targets: Mapping[str, float], + enforcement_fences: Mapping[str, str] | None = None, ) -> GateResult: """Hard-fail enforced band misses measured on the release weights. @@ -1622,11 +1623,36 @@ def us_ssi_take_up_delivery_gate( the delivered weights. There is no in-build reconcile loop and no per-target knob (populace#492). The under-18 band stays fenced pending populace#453/#509 and is reported in the details, never enforced. + + ``enforcement_fences`` fences normally-enforced bands for a specific + ARM with a documented adjudication (the under-18 pattern extended): + the dense full-pool arm's threshold-to-equilibrium map oscillates + with no one-retry fixed point (populace#566/#567, two frames), so its + adult bands ship in the scorecard as known boundaries rather than + enforced contracts. The fence text rides each fenced row; the sparse + certified default passes no fences and keeps hard enforcement. """ expected_targets = _normalize_targets(targets) tolerance = US_SSI_TAKE_UP_BAND_DELIVERY_RELATIVE_TOLERANCE failures: list[str] = [] + unknown_fences = sorted( + set(enforcement_fences or {}) - set(US_SSI_TAKE_UP_ENFORCED_BAND_KEYS) + ) + if unknown_fences: + raise ValueError( + "SSI take-up delivery fences may only name normally-enforced " + f"bands {sorted(US_SSI_TAKE_UP_ENFORCED_BAND_KEYS)}; got " + f"{unknown_fences}. A fence on a never-enforced band is a " + "configuration error, not a no-op." + ) + for key, fence_text in sorted((enforcement_fences or {}).items()): + if not str(fence_text).strip(): + raise ValueError( + f"SSI take-up delivery fence for band {key!r} carries no " + "adjudication text; a fence without its documented reason " + "is forbidden." + ) enforced_rows: list[dict[str, object]] = [] fenced_rows: list[dict[str, object]] = [] rows: Mapping[str, Mapping[str, object]] = {} @@ -1670,7 +1696,8 @@ def us_ssi_take_up_delivery_gate( "selected_recipient_weight": selected, "signed_relative_error": signed_relative, } - if key in US_SSI_TAKE_UP_ENFORCED_BAND_KEYS: + fence_text = (enforcement_fences or {}).get(key) + if key in US_SSI_TAKE_UP_ENFORCED_BAND_KEYS and fence_text is None: enforced_rows.append(summary) if abs(selected - target) > tolerance * target + 1e-6: failures.append( @@ -1689,11 +1716,16 @@ def us_ssi_take_up_delivery_gate( { **summary, "fence": ( - "Fenced pending the SIPP child qualifying-disability " - "stage (populace#453 / PR #509): certified support " - "cannot truthfully carry the child band yet, so its " - "miss ships in the scorecard — never as " - "saturation-as-success." + fence_text + if fence_text is not None + else ( + "Fenced pending the SIPP child " + "qualifying-disability stage (populace#453 / PR " + "#509): certified support cannot truthfully " + "carry the child band yet, so its miss ships in " + "the scorecard — never as " + "saturation-as-success." + ) ), } ) @@ -1703,7 +1735,15 @@ def us_ssi_take_up_delivery_gate( failures=tuple(failures), details={ "relative_tolerance": tolerance, - "enforced_band_keys": list(US_SSI_TAKE_UP_ENFORCED_BAND_KEYS), + # Effective enforcement for THIS run: the constant minus any + # adjudication-fenced bands — reporting the constant here would + # misdocument a fenced band as an enforced contract. + "enforced_band_keys": [ + key + for key in US_SSI_TAKE_UP_ENFORCED_BAND_KEYS + if key not in (enforcement_fences or {}) + ], + "adjudication_fenced_band_keys": sorted(enforcement_fences or {}), "enforced_bands": enforced_rows, "fenced_bands": fenced_rows, }, diff --git a/packages/populace-build/tests/test_us_fiscal_refresh_builder.py b/packages/populace-build/tests/test_us_fiscal_refresh_builder.py index 5a30685c..340cbc4e 100644 --- a/packages/populace-build/tests/test_us_fiscal_refresh_builder.py +++ b/packages/populace-build/tests/test_us_fiscal_refresh_builder.py @@ -179,6 +179,94 @@ def test_certified_release_dir_reuse_is_refused(tmp_path) -> None: builder._refuse_certified_release_dir_reuse(release_dir) +def test_dense_ssi_fences_cover_the_enforced_bands_and_cite_the_adjudication() -> None: + """populace#566/#567: the dense-arm fence table must cover exactly the + normally-enforced bands, and every fence must carry the oscillation + adjudication, its re-adjudication trigger, and the sparse contrast — + a fence without its documented reason is forbidden.""" + from populace.build.us_runtime.ssi_take_up import ( + US_SSI_TAKE_UP_ENFORCED_BAND_KEYS, + ) + + builder = _load_builder_module() + fences = builder.US_DENSE_SSI_TAKE_UP_ENFORCEMENT_FENCES + assert set(fences) == set(US_SSI_TAKE_UP_ENFORCED_BAND_KEYS) + for band, text in fences.items(): + assert "populace#566/#567" in text, band + assert "Re-adjudicates" in text, band + assert "sparse certified" in text, band + assert "oscillates" in text, band + + +def test_ssi_delivery_fences_are_passed_on_the_dense_arm_only() -> None: + """The sparse certified arm must keep hard enforcement: structurally, + main()'s single _enforce_ssi_take_up_delivery call may pass the fence + table only under args.dense_default_dataset, with None otherwise (the + #443 AST-guard pattern).""" + import ast + + builder = _load_builder_module() + tree = ast.parse(Path(builder.__file__).read_text()) + main_fn = next( + n for n in ast.walk(tree) if isinstance(n, ast.FunctionDef) and n.name == "main" + ) + calls = [ + n + for n in ast.walk(main_fn) + if isinstance(n, ast.Call) + and getattr(n.func, "id", "") == "_enforce_ssi_take_up_delivery" + ] + assert len(calls) == 1, "exactly one delivery-enforcement call site" + fence_kwargs = [kw for kw in calls[0].keywords if kw.arg == "enforcement_fences"] + assert len(fence_kwargs) == 1, "the call site must pass enforcement_fences" + value = fence_kwargs[0].value + assert isinstance(value, ast.IfExp), "fences must be arm-conditional" + assert isinstance(value.test, ast.Attribute) + assert getattr(value.test.value, "id", "") == "args" + assert value.test.attr == "dense_default_dataset" + assert getattr(value.body, "id", "") == "US_DENSE_SSI_TAKE_UP_ENFORCEMENT_FENCES" + assert isinstance(value.orelse, ast.Constant) and value.orelse.value is None + + +def test_delivery_gate_result_reaches_the_manifest_gates_block() -> None: + """A release built with fences must be distinguishable from one whose + bands passed enforcement: the delivery gate result (effective enforced + set + fenced rows with adjudication text) must ride the manifest gates + block, and main() must thread it into _build_manifests.""" + import ast + + builder = _load_builder_module() + tree = ast.parse(Path(builder.__file__).read_text()) + main_fn = next( + n for n in ast.walk(tree) if isinstance(n, ast.FunctionDef) and n.name == "main" + ) + manifest_calls = [ + n + for n in ast.walk(main_fn) + if isinstance(n, ast.Call) and getattr(n.func, "id", "") == "_build_manifests" + ] + assert manifest_calls, "main() must call _build_manifests" + assert all( + any(kw.arg == "ssi_take_up_delivery_gate_result" for kw in call.keywords) + for call in manifest_calls + ), "every _build_manifests call must thread the delivery gate result" + build_fn = next( + n + for n in ast.walk(tree) + if isinstance(n, ast.FunctionDef) and n.name == "_build_manifests" + ) + gate_keys = { + key.value + for node in ast.walk(build_fn) + if isinstance(node, ast.Dict) + for key in node.keys + if isinstance(key, ast.Constant) and isinstance(key.value, str) + } + assert "ssi_take_up_delivery" in gate_keys, ( + "_build_manifests must record the ssi_take_up_delivery gate" + ) + + def test_final_household_weight_evidence_writes_only_on_gate_failure_path() -> None: """populace#568 review blocker 2: the evidence pair must be written on the batched gate-failure path ONLY — green runs carry weights in the @@ -4656,9 +4744,11 @@ def fake_final_medicaid_diagnostics( fake_final_ssi_diagnostics, ) - def fake_ssi_delivery_gate(diagnostics, *, targets): + def fake_ssi_delivery_gate(diagnostics, *, targets, enforcement_fences=None): captured["ssi_delivery_gate_called"] = True captured["ssi_delivery_gate_targets"] = dict(targets) + # The sparse e2e paths must never see dense fences (populace#566/#567). + captured["ssi_delivery_gate_enforcement_fences"] = enforcement_fences # The integrity and retirement cases pass delivery to isolate their # own early failure. Other modes retain the populace#547 delivery # cofailure and its written retry basis. @@ -5096,6 +5186,9 @@ def fake_release_gate_failures(*args, **kwargs): assert final_basis.kind == "current_frame" assert final_basis.band("65_plus").candidate_capacity == pytest.approx(1_000.0) assert captured["ssi_delivery_gate_called"] is True + # This e2e harness runs the sparse arm: the dense-only enforcement + # fences must never reach the gate here (populace#566/#567). + assert captured["ssi_delivery_gate_enforcement_fences"] is None assert captured["ssi_delivery_gate_targets"] == fake_band_targets # The frozen-assignment digest invalidates the materialization cache on # any retry whose flags differ (populace#507/#508 split-brain fix). diff --git a/packages/populace-build/tests/test_us_ssi_take_up.py b/packages/populace-build/tests/test_us_ssi_take_up.py index df161f6a..b369e644 100644 --- a/packages/populace-build/tests/test_us_ssi_take_up.py +++ b/packages/populace-build/tests/test_us_ssi_take_up.py @@ -1102,6 +1102,92 @@ def test_delivery_gate_rejects_malformed_diagnostics() -> None: assert any("non-numeric" in failure for failure in corrupt_gate.failures) +def test_delivery_gate_fences_override_enforcement_with_their_adjudication() -> None: + """populace#566/#567: the dense arm fences its adult bands. + + A fenced band's miss must ship in the fenced rows with the supplied + adjudication text — never fail the release — and the details must + report the run's EFFECTIVE enforcement (empty here), not the constant. + """ + + _, _, _, diagnostics = _assigned() + delivered = _delivered( + diagnostics, + **{"18_64": 80.0, "65_plus": 90.0}, # both far outside the envelope + ) + fences = { + "18_64": "Fenced for the dense diagnostic arm (populace#566/#567).", + "65_plus": "Fenced for the dense diagnostic arm (populace#566/#567).", + } + gate = us_ssi_take_up_delivery_gate( + delivered, targets=_TARGETS, enforcement_fences=fences + ) + assert gate.passed + assert gate.details["enforced_band_keys"] == [] + assert gate.details["adjudication_fenced_band_keys"] == ["18_64", "65_plus"] + assert gate.details["enforced_bands"] == [] + fenced = {row["age_band"]: row for row in gate.details["fenced_bands"]} + assert set(fenced) == {"under_18", "18_64", "65_plus"} + # The adult fences carry the supplied adjudication; the under-18 band + # keeps its own populace#453/#509 fence untouched. + assert fenced["18_64"]["fence"] == fences["18_64"] + assert fenced["65_plus"]["fence"] == fences["65_plus"] + assert "#453" in fenced["under_18"]["fence"] + # The measurement still ships: the fenced rows carry the miss. + assert fenced["18_64"]["selected_recipient_weight"] == pytest.approx(80.0) + assert fenced["65_plus"]["selected_recipient_weight"] == pytest.approx(90.0) + + +def test_delivery_gate_partial_fence_keeps_the_other_band_enforced() -> None: + _, _, _, diagnostics = _assigned() + fences = {"65_plus": "Fenced for the dense diagnostic arm (populace#566)."} + # The un-fenced band still hard-fails on a miss... + missed = _delivered(diagnostics, **{"18_64": 80.0, "65_plus": 90.0}) + gate = us_ssi_take_up_delivery_gate( + missed, targets=_TARGETS, enforcement_fences=fences + ) + assert not gate.passed + assert any("18_64" in failure for failure in gate.failures) + assert not any("65_plus" in failure for failure in gate.failures) + assert gate.details["enforced_band_keys"] == ["18_64"] + assert gate.details["adjudication_fenced_band_keys"] == ["65_plus"] + # ...and passes in-band, with the fenced band's miss shipping as a row. + inside = _delivered(diagnostics, **{"18_64": 52.0, "65_plus": 90.0}) + gate = us_ssi_take_up_delivery_gate( + inside, targets=_TARGETS, enforcement_fences=fences + ) + assert gate.passed + fenced_keys = [row["age_band"] for row in gate.details["fenced_bands"]] + assert "65_plus" in fenced_keys and "under_18" in fenced_keys + + +def test_delivery_gate_refuses_fences_on_never_enforced_or_unknown_bands() -> None: + """A fence names an enforcement being suspended; fencing a band that is + never enforced (or does not exist) is a configuration error, not a + no-op.""" + + _, _, _, diagnostics = _assigned() + delivered = _delivered(diagnostics, **{"18_64": 52.4, "65_plus": 47.6}) + for bogus in ("under_18", "not_a_band"): + with pytest.raises(ValueError, match="normally-enforced"): + us_ssi_take_up_delivery_gate( + delivered, + targets=_TARGETS, + enforcement_fences={bogus: "text"}, + ) + + +def test_delivery_gate_refuses_a_fence_without_adjudication_text() -> None: + _, _, _, diagnostics = _assigned() + delivered = _delivered(diagnostics, **{"18_64": 52.4, "65_plus": 47.6}) + with pytest.raises(ValueError, match="no.*adjudication text|carries no"): + us_ssi_take_up_delivery_gate( + delivered, + targets=_TARGETS, + enforcement_fences={"65_plus": " "}, + ) + + def test_gate_rejects_basis_arithmetic_drift() -> None: """The prior/basis link is weight-free, so the gate can audit it exactly.""" diff --git a/tools/build_us_fiscal_refresh_release.py b/tools/build_us_fiscal_refresh_release.py index d54f72ce..25f5d287 100644 --- a/tools/build_us_fiscal_refresh_release.py +++ b/tools/build_us_fiscal_refresh_release.py @@ -242,6 +242,7 @@ ) from populace.build.us_runtime.ssi_take_up import ( US_SSI_TAKE_UP_AGE_TARGETS, + US_SSI_TAKE_UP_ENFORCED_BAND_KEYS, US_SSI_TAKE_UP_OUTPUT_COLUMNS, SSITakeUpPriorBasis, ) @@ -284,6 +285,40 @@ FINAL_HOUSEHOLD_WEIGHTS_SCHEMA_VERSION = 1 POST_EXPORT_ABSOLUTE_TOLERANCE = 1_000_000.0 POST_EXPORT_RELATIVE_TOLERANCE = 5e-4 +# populace#566/#567 dense-arm adjudication: the dense full-pool frame's +# threshold-to-equilibrium map OSCILLATES — the #508 one-retry recompute +# moves each adult band past the other with no fixed point, proven on two +# independent frames (P2: 18-64 +5.8%/65+ +24.8% -> +8.2%/+20.0% after the +# retry; P3: 65+ +34.6% with 18-64 in-band -> +8.3%/+19.8% after the +# retry). A second retry would be the deleted populace#463-class loop. +# The dense diagnostic arm therefore FENCES its adult bands — the under-18 +# pattern extended: the miss ships in the scorecard as a known boundary, +# never as an enforced contract and never as saturation-as-success. The +# sparse certified default passes no fences and keeps hard enforcement. +# RE-ADJUDICATES when populace#566's damped fixed-point protocol lands. +_US_DENSE_SSI_FENCE_ADJUDICATION = ( + "Fenced for the dense diagnostic arm (populace#566/#567): the dense " + "frame's SSI threshold-to-equilibrium map oscillates across the " + "populace#508 one-retry recompute with no fixed point (two frames: " + "P2 and P3), so this band's miss ships in the scorecard as a known " + "boundary — never as an enforced contract. Re-adjudicates when the " + "populace#566 damped fixed-point protocol lands. The sparse certified " + "default keeps hard enforcement." +) +US_DENSE_SSI_TAKE_UP_ENFORCEMENT_FENCES: dict[str, str] = { + "18_64": _US_DENSE_SSI_FENCE_ADJUDICATION, + "65_plus": _US_DENSE_SSI_FENCE_ADJUDICATION, +} +assert set(US_DENSE_SSI_TAKE_UP_ENFORCEMENT_FENCES) == set( + US_SSI_TAKE_UP_ENFORCED_BAND_KEYS +), ( + "The dense-arm fence adjudication must cover exactly the " + "normally-enforced SSI bands. A new enforced band needs a dense-arm " + "adjudication first: fence it here with its documented reason, or " + "amend this assertion as the record of the decision to enforce it " + "on the dense arm too." +) + US_FISCAL_TARGET_LOSS_WEIGHTING = ( "sqrt_value_concept_budget_weighted_mape_50_50_amount_count_target_scale_cap_100pct" ) @@ -5675,11 +5710,16 @@ def _enforce_ssi_take_up_delivery( targets: Mapping[str, float], release_dir: Path, telemetry: StagingTelemetry | None, -) -> list[str]: + enforcement_fences: Mapping[str, str] | None = None, +) -> tuple[list[str], GateResult]: """Fail the release on an enforced-band delivery miss, via the batch. populace#507/#508: a miss beyond tolerance on release weights fails the - build instead of shipping in the scorecard. The delivered-weight + build instead of shipping in the scorecard. ``enforcement_fences`` + (populace#566/#567) fences normally-enforced bands for the dense + diagnostic arm, whose threshold-to-equilibrium map has no one-retry + fixed point — fenced misses ship in the scorecard with their + adjudication text instead of failing the release. The delivered-weight diagnostics are written before returning failures — that artifact IS the remedy: the retry passes it via ``--ssi-take-up-prior-weight-basis`` so the thresholds are recomputed exactly once from measured delivery, never @@ -5693,9 +5733,11 @@ def _enforce_ssi_take_up_delivery( written. """ - delivery_gate = us_ssi_take_up_delivery_gate(diagnostics, targets=targets) + delivery_gate = us_ssi_take_up_delivery_gate( + diagnostics, targets=targets, enforcement_fences=enforcement_fences + ) if delivery_gate.passed: - return [] + return [], delivery_gate # The gate failures are secured FIRST: the retry-artifact write and the # telemetry are reporting conveniences for an already-failed gate, and # neither may destroy the evidence chain by raising. Concretely: a @@ -5741,7 +5783,7 @@ def _enforce_ssi_take_up_delivery( "SSI delivery-gate failure telemetry crashed; recorded instead " f"of masking the failure: {error}" ) - return failures + return failures, delivery_gate def _ssi_assignment_priors_from_diagnostics( @@ -6697,6 +6739,7 @@ def _build_manifests( registry: TargetRegistry, dropped: Mapping[str, object], target_profile_gate: GateResult, + ssi_take_up_delivery_gate_result: GateResult | None = None, health_input_gate: GateResult | None = None, base_population_gate: GateResult | None = None, incumbent_diagnostics: Mapping[str, Mapping[str, object]] | None = None, @@ -6816,6 +6859,23 @@ def _build_manifests( "failures": list(target_profile_gate.failures), "details": dict(target_profile_gate.details), }, + **( + { + # The delivery gate result is the release's enforcement + # receipt: under the populace#566/#567 dense-arm fences a + # green release no longer implies every adult band was + # ENFORCED, so the manifest must say which bands were + # (enforced_band_keys) and which were fenced with their + # adjudication text (fenced_bands). + "ssi_take_up_delivery": { + "passed": ssi_take_up_delivery_gate_result.passed, + "failures": list(ssi_take_up_delivery_gate_result.failures), + "details": dict(ssi_take_up_delivery_gate_result.details), + } + } + if ssi_take_up_delivery_gate_result is not None + else {} + ), **( { "base_population_scale": { @@ -9351,14 +9411,23 @@ def main() -> None: "SSI final-gate failure telemetry crashed; recorded instead " f"of masking the failure: {error}" ) - early_terminal_gate_failures.extend( + ssi_delivery_failures, ssi_take_up_delivery_gate_result = ( _enforce_ssi_take_up_delivery( ssi_take_up_diagnostics, targets=ssi_band_targets, release_dir=release_dir, telemetry=telemetry, + # The dense diagnostic arm fences its adult bands per the + # populace#566/#567 oscillation adjudication; the sparse + # certified arm passes no fences and keeps hard enforcement. + enforcement_fences=( + US_DENSE_SSI_TAKE_UP_ENFORCEMENT_FENCES + if args.dense_default_dataset + else None + ), ) ) + early_terminal_gate_failures.extend(ssi_delivery_failures) medicaid_take_up_diagnostics, medicaid_guard_failures = ( _final_medicaid_diagnostics_or_quarantine( ssi_law_degraded=ssi_law_degraded, @@ -10118,6 +10187,7 @@ def main() -> None: registry=registry, dropped=compilation, target_profile_gate=target_profile_gate, + ssi_take_up_delivery_gate_result=ssi_take_up_delivery_gate_result, health_input_gate=health_input_gate, base_population_gate=base_population_gate, incumbent_diagnostics=incumbent_diagnostics, From 0fc1b2c30eebe9b9a8b27753cada04b0d0acc438 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Wed, 29 Jul 2026 12:24:33 -0400 Subject: [PATCH 2/5] Unpack the _enforce_ssi_take_up_delivery tuple in its three direct tests The enforcement wrapper now returns (failures, gate_result) so the delivery gate receipt can ride the manifest; the three tests that call it directly consume the tuple and additionally bind the receipt: failed paths return a failed gate result, the pass path documents full enforcement (no adjudication-fenced keys) alongside its empty failure list. Co-Authored-By: Claude Fable 5 --- .../tests/test_us_fiscal_refresh_builder.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/populace-build/tests/test_us_fiscal_refresh_builder.py b/packages/populace-build/tests/test_us_fiscal_refresh_builder.py index 340cbc4e..a80fd0b7 100644 --- a/packages/populace-build/tests/test_us_fiscal_refresh_builder.py +++ b/packages/populace-build/tests/test_us_fiscal_refresh_builder.py @@ -9533,7 +9533,7 @@ def test_enforce_ssi_delivery_returns_batch_failures_and_writes_the_basis( release_dir = tmp_path / "release" release_dir.mkdir() - failures = builder._enforce_ssi_take_up_delivery( + failures, gate_result = builder._enforce_ssi_take_up_delivery( diagnostics, targets=_SSI_BAND_TARGETS, release_dir=release_dir, @@ -9541,6 +9541,8 @@ def test_enforce_ssi_delivery_returns_batch_failures_and_writes_the_basis( ) assert failures + # The returned gate result is the manifest receipt for this run. + assert not gate_result.passed assert all(failure.startswith("SSI take-up deliver") for failure in failures) assert any("--ssi-take-up-prior-weight-basis" in failure for failure in failures) written_path = release_dir / "us_ssi_take_up.json" @@ -9569,7 +9571,7 @@ def test_enforce_ssi_delivery_passes_in_tolerance_and_writes_nothing( release_dir = tmp_path / "release" release_dir.mkdir() - failures = builder._enforce_ssi_take_up_delivery( + failures, gate_result = builder._enforce_ssi_take_up_delivery( diagnostics, targets=_SSI_BAND_TARGETS, release_dir=release_dir, @@ -9577,6 +9579,9 @@ def test_enforce_ssi_delivery_passes_in_tolerance_and_writes_nothing( ) assert failures == [] + assert gate_result.passed + # No fences on this sparse-shaped call: full enforcement documented. + assert gate_result.details["adjudication_fenced_band_keys"] == [] assert not (release_dir / "us_ssi_take_up.json").exists() @@ -9598,7 +9603,7 @@ def test_enforce_ssi_delivery_survives_unwritable_retry_artifact( release_dir = tmp_path / "release" release_dir.mkdir() - failures = builder._enforce_ssi_take_up_delivery( + failures, gate_result = builder._enforce_ssi_take_up_delivery( diagnostics, targets=_SSI_BAND_TARGETS, release_dir=release_dir, @@ -9606,6 +9611,7 @@ def test_enforce_ssi_delivery_survives_unwritable_retry_artifact( ) assert failures + assert not gate_result.passed assert failures[0].startswith("SSI take-up delivery failed:") assert any("could NOT be written" in failure for failure in failures) # json.dumps runs before write_text, so no partial artifact exists. From ad214624d474bf8ce7070031302459dcad71a491 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Wed, 29 Jul 2026 13:02:35 -0400 Subject: [PATCH 3/5] Round 2: dual-manifest fence receipt, fail-closed fences, chain guard, truthful adjudication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sol round-1 blockers, all four: 1. release_manifest.json now carries the ssi_take_up_delivery receipt (effective enforced set + fenced rows) alongside build_manifest.json's gates block — the release manifest alone must distinguish fenced from enforced delivery. The AST test now requires BOTH carrier dicts. 2. Fence validation is fail-closed: keys must be band-name strings (ValueError, not TypeError, on mixed types) and values must be nonblank strings — a None/zero/list value can no longer suppress enforcement while emitting a non-text adjudication or a half-fenced details block. The gate branch and details read only the validated dict. 3. The adjudication text claims only what the artifacts support: the single permitted populace#508 recompute left the adult pair out of band on both observed frames (P2 +5.8/+24.8 -> +8.2/+20.0; P3 in-band/+34.6 -> +8.3/+19.8). Three of four band chains are monotone, so "the map oscillates" is withdrawn everywhere; a test now refuses the word. 4. The "second retry is the deleted loop" prose is now enforced: ssi_take_up_prior_basis_from_artifact refuses artifacts whose own prior_weight_basis kind is release_artifact (retry-of-retry), with a loader test. Co-Authored-By: Claude Fable 5 --- .../dense-takeup-enforcement.changed.md | 2 +- .../populace/build/us_runtime/ssi_take_up.py | 56 ++++++++++++------ .../tests/test_us_fiscal_refresh_builder.py | 26 +++++--- .../tests/test_us_ssi_take_up.py | 35 +++++++++-- tools/build_us_fiscal_refresh_release.py | 59 ++++++++++++------- 5 files changed, 126 insertions(+), 52 deletions(-) diff --git a/changelog.d/dense-takeup-enforcement.changed.md b/changelog.d/dense-takeup-enforcement.changed.md index ae0e2c60..3c9035cb 100644 --- a/changelog.d/dense-takeup-enforcement.changed.md +++ b/changelog.d/dense-takeup-enforcement.changed.md @@ -1 +1 @@ -Dense diagnostic arm fences its SSI adult bands (populace#566/#567): the dense frame's threshold-to-equilibrium map has no one-retry fixed point, so fenced misses ship in the scorecard with their adjudication instead of failing the release; the manifest gates block records the run's effective enforced set and fenced rows. The sparse certified default keeps hard enforcement. +Dense diagnostic arm fences its SSI adult bands (populace#566/#567): the single permitted populace#508 delivered-weight recompute left the adult pair out of band on both observed frames, and a second recompute is refused by a new chain-depth guard as the deleted populace#463-class loop. Fenced misses ship in the scorecard with their adjudication; both build_manifest.json and release_manifest.json record the run's effective enforced set and fenced rows. The sparse certified default keeps hard enforcement. \ No newline at end of file diff --git a/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py b/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py index dea9bab9..432a0586 100644 --- a/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py +++ b/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py @@ -935,6 +935,24 @@ def ssi_take_up_prior_basis_from_artifact( "final measurement; got measurement phase " f"{measurement_phase!r}." ) + if schema_version == _DIAGNOSTICS_SCHEMA_VERSION: + artifact_prior = payload.get("prior_weight_basis") + artifact_prior_kind = ( + artifact_prior.get("kind") if isinstance(artifact_prior, Mapping) else None + ) + if artifact_prior_kind == US_SSI_TAKE_UP_PRIOR_BASIS_RELEASE_ARTIFACT: + # Chain-depth guard: populace#508 permits exactly ONE + # delivered-weight recompute. An artifact that was itself + # measured on a retry basis would seed retry-of-retry — the + # deleted populace#463-class loop reassembled by hand. + raise ValueError( + "US SSI take-up prior basis artifact was itself measured " + "on a delivered-weight retry (prior basis kind " + "'release_artifact'); chaining a second recompute is the " + "deleted populace#463-class loop — populace#508 permits " + "exactly one. Investigate the frame instead of retrying " + "again." + ) if schema_version == 3 and measurement_phase not in ( None, US_SSI_TAKE_UP_PHASE_RELEASE_FINAL, @@ -1626,19 +1644,25 @@ def us_ssi_take_up_delivery_gate( ``enforcement_fences`` fences normally-enforced bands for a specific ARM with a documented adjudication (the under-18 pattern extended): - the dense full-pool arm's threshold-to-equilibrium map oscillates - with no one-retry fixed point (populace#566/#567, two frames), so its - adult bands ship in the scorecard as known boundaries rather than - enforced contracts. The fence text rides each fenced row; the sparse - certified default passes no fences and keeps hard enforcement. + on the dense full-pool arm the single permitted populace#508 + delivered-weight recompute left the adult pair out of band on both + observed frames (populace#566/#567), so its adult bands ship in the + scorecard as known boundaries rather than enforced contracts. The + fence text rides each fenced row; the sparse certified default + passes no fences and keeps hard enforcement. """ expected_targets = _normalize_targets(targets) tolerance = US_SSI_TAKE_UP_BAND_DELIVERY_RELATIVE_TOLERANCE failures: list[str] = [] - unknown_fences = sorted( - set(enforcement_fences or {}) - set(US_SSI_TAKE_UP_ENFORCED_BAND_KEYS) - ) + fences = dict(enforcement_fences or {}) + non_string_keys = [repr(key) for key in fences if not isinstance(key, str)] + if non_string_keys: + raise ValueError( + "SSI take-up delivery fence keys must be band-name strings; got " + f"{sorted(non_string_keys)}." + ) + unknown_fences = sorted(set(fences) - set(US_SSI_TAKE_UP_ENFORCED_BAND_KEYS)) if unknown_fences: raise ValueError( "SSI take-up delivery fences may only name normally-enforced " @@ -1646,12 +1670,12 @@ def us_ssi_take_up_delivery_gate( f"{unknown_fences}. A fence on a never-enforced band is a " "configuration error, not a no-op." ) - for key, fence_text in sorted((enforcement_fences or {}).items()): - if not str(fence_text).strip(): + for key, fence_text in sorted(fences.items()): + if not isinstance(fence_text, str) or not fence_text.strip(): raise ValueError( f"SSI take-up delivery fence for band {key!r} carries no " - "adjudication text; a fence without its documented reason " - "is forbidden." + "adjudication text (fence values must be nonblank strings); " + "a fence without its documented reason is forbidden." ) enforced_rows: list[dict[str, object]] = [] fenced_rows: list[dict[str, object]] = [] @@ -1696,7 +1720,7 @@ def us_ssi_take_up_delivery_gate( "selected_recipient_weight": selected, "signed_relative_error": signed_relative, } - fence_text = (enforcement_fences or {}).get(key) + fence_text = fences.get(key) if key in US_SSI_TAKE_UP_ENFORCED_BAND_KEYS and fence_text is None: enforced_rows.append(summary) if abs(selected - target) > tolerance * target + 1e-6: @@ -1739,11 +1763,9 @@ def us_ssi_take_up_delivery_gate( # adjudication-fenced bands — reporting the constant here would # misdocument a fenced band as an enforced contract. "enforced_band_keys": [ - key - for key in US_SSI_TAKE_UP_ENFORCED_BAND_KEYS - if key not in (enforcement_fences or {}) + key for key in US_SSI_TAKE_UP_ENFORCED_BAND_KEYS if key not in fences ], - "adjudication_fenced_band_keys": sorted(enforcement_fences or {}), + "adjudication_fenced_band_keys": sorted(fences), "enforced_bands": enforced_rows, "fenced_bands": fenced_rows, }, diff --git a/packages/populace-build/tests/test_us_fiscal_refresh_builder.py b/packages/populace-build/tests/test_us_fiscal_refresh_builder.py index a80fd0b7..918aad8a 100644 --- a/packages/populace-build/tests/test_us_fiscal_refresh_builder.py +++ b/packages/populace-build/tests/test_us_fiscal_refresh_builder.py @@ -193,9 +193,13 @@ def test_dense_ssi_fences_cover_the_enforced_bands_and_cite_the_adjudication() - assert set(fences) == set(US_SSI_TAKE_UP_ENFORCED_BAND_KEYS) for band, text in fences.items(): assert "populace#566/#567" in text, band + assert "populace#508" in text, band assert "Re-adjudicates" in text, band assert "sparse certified" in text, band - assert "oscillates" in text, band + # The adjudication must claim only what the artifacts support: + # the one permitted recompute left the pair out of band — NOT a + # proven oscillating map (sol round-1 blocker 3). + assert "oscillat" not in text.lower(), band def test_ssi_delivery_fences_are_passed_on_the_dense_arm_only() -> None: @@ -255,15 +259,21 @@ def test_delivery_gate_result_reaches_the_manifest_gates_block() -> None: for n in ast.walk(tree) if isinstance(n, ast.FunctionDef) and n.name == "_build_manifests" ) - gate_keys = { - key.value + carrier_dicts = [ + node for node in ast.walk(build_fn) if isinstance(node, ast.Dict) - for key in node.keys - if isinstance(key, ast.Constant) and isinstance(key.value, str) - } - assert "ssi_take_up_delivery" in gate_keys, ( - "_build_manifests must record the ssi_take_up_delivery gate" + and any( + isinstance(key, ast.Constant) and key.value == "ssi_take_up_delivery" + for key in node.keys + ) + ] + assert len(carrier_dicts) >= 2, ( + "BOTH manifest writers (build_manifest.json gates block AND " + "release_manifest.json build section) must record the " + "ssi_take_up_delivery receipt — release_manifest.json alone has " + f"to distinguish fenced from enforced delivery; found " + f"{len(carrier_dicts)} carrier dict(s)" ) diff --git a/packages/populace-build/tests/test_us_ssi_take_up.py b/packages/populace-build/tests/test_us_ssi_take_up.py index b369e644..bfbedeaa 100644 --- a/packages/populace-build/tests/test_us_ssi_take_up.py +++ b/packages/populace-build/tests/test_us_ssi_take_up.py @@ -962,6 +962,7 @@ def test_prior_basis_loader_accepts_current_and_legacy_artifacts() -> None: ("floor_above_capacity", "reporter floor"), ("nonfinite_capacity", "candidate capacity"), ("integrity_failed_attempt", "diagnostics gate"), + ("chained_retry_artifact", "exactly one"), ("blank_sha", "sha256"), ], ) @@ -1010,6 +1011,15 @@ def test_prior_basis_loader_rejects_invalid_artifacts( # A Bernoulli-law-violating attempt's measurements are grounds for # investigation, never a basis to chain from. payload["bernoulli_law_violation_count"] = 1 + elif mutation == "chained_retry_artifact": + # The artifact was itself measured on a delivered-weight retry: + # seeding another recompute from it is retry-of-retry — the deleted + # populace#463-class loop (populace#508 permits exactly one). + payload["prior_weight_basis"] = { + "kind": "release_artifact", + "source_sha256": "f" * 64, + "source_schema_version": 4, + } else: sha = " " with pytest.raises(ValueError, match=message): @@ -1178,14 +1188,27 @@ def test_delivery_gate_refuses_fences_on_never_enforced_or_unknown_bands() -> No def test_delivery_gate_refuses_a_fence_without_adjudication_text() -> None: + """Fail-closed: only nonblank STRING adjudications are fences — a + None/zero/list value must never half-fence a band (suppressing + enforcement in the details while the row stays enforced, or vice + versa), and non-string keys must raise ValueError, not TypeError.""" + _, _, _, diagnostics = _assigned() delivered = _delivered(diagnostics, **{"18_64": 52.4, "65_plus": 47.6}) - with pytest.raises(ValueError, match="no.*adjudication text|carries no"): - us_ssi_take_up_delivery_gate( - delivered, - targets=_TARGETS, - enforcement_fences={"65_plus": " "}, - ) + for bad_value in (" ", "", None, 0, False, [], {"text": "x"}): + with pytest.raises(ValueError, match="carries no"): + us_ssi_take_up_delivery_gate( + delivered, + targets=_TARGETS, + enforcement_fences={"65_plus": bad_value}, + ) + for bad_key in (0, None, ("65_plus",)): + with pytest.raises(ValueError, match="band-name strings"): + us_ssi_take_up_delivery_gate( + delivered, + targets=_TARGETS, + enforcement_fences={bad_key: "documented adjudication"}, + ) def test_gate_rejects_basis_arithmetic_drift() -> None: diff --git a/tools/build_us_fiscal_refresh_release.py b/tools/build_us_fiscal_refresh_release.py index 25f5d287..f3f6c0f7 100644 --- a/tools/build_us_fiscal_refresh_release.py +++ b/tools/build_us_fiscal_refresh_release.py @@ -285,25 +285,28 @@ FINAL_HOUSEHOLD_WEIGHTS_SCHEMA_VERSION = 1 POST_EXPORT_ABSOLUTE_TOLERANCE = 1_000_000.0 POST_EXPORT_RELATIVE_TOLERANCE = 5e-4 -# populace#566/#567 dense-arm adjudication: the dense full-pool frame's -# threshold-to-equilibrium map OSCILLATES — the #508 one-retry recompute -# moves each adult band past the other with no fixed point, proven on two -# independent frames (P2: 18-64 +5.8%/65+ +24.8% -> +8.2%/+20.0% after the -# retry; P3: 65+ +34.6% with 18-64 in-band -> +8.3%/+19.8% after the -# retry). A second retry would be the deleted populace#463-class loop. -# The dense diagnostic arm therefore FENCES its adult bands — the under-18 -# pattern extended: the miss ships in the scorecard as a known boundary, -# never as an enforced contract and never as saturation-as-success. The -# sparse certified default passes no fences and keeps hard enforcement. +# populace#566/#567 dense-arm adjudication: on the dense full-pool frame +# the single permitted populace#508 delivered-weight recompute left the +# adult band pair out of band on both observed frames (P2: 18-64 +# +5.8%/65+ +24.8% -> +8.2%/+20.0%; P3: 65+ +34.6% with 18-64 in-band -> +# +8.3%/+19.8% — the retry moved 18-64 OUT of band while improving 65+). +# A second recompute is refused as the deleted populace#463-class loop +# (chain-depth guard in ssi_take_up_prior_basis_from_artifact). The dense +# diagnostic arm therefore FENCES its adult bands — the under-18 pattern +# extended: the miss ships in the scorecard as a known boundary, never as +# an enforced contract and never as saturation-as-success. The sparse +# certified default passes no fences and keeps hard enforcement. # RE-ADJUDICATES when populace#566's damped fixed-point protocol lands. _US_DENSE_SSI_FENCE_ADJUDICATION = ( - "Fenced for the dense diagnostic arm (populace#566/#567): the dense " - "frame's SSI threshold-to-equilibrium map oscillates across the " - "populace#508 one-retry recompute with no fixed point (two frames: " - "P2 and P3), so this band's miss ships in the scorecard as a known " - "boundary — never as an enforced contract. Re-adjudicates when the " - "populace#566 damped fixed-point protocol lands. The sparse certified " - "default keeps hard enforcement." + "Fenced for the dense diagnostic arm (populace#566/#567): the single " + "permitted populace#508 delivered-weight recompute left the adult " + "band pair out of band on both observed frames (P2: +5.8%/+24.8% -> " + "+8.2%/+20.0%; P3: in-band/+34.6% -> +8.3%/+19.8%), and a second " + "recompute is refused as the deleted populace#463-class loop. This " + "band's miss ships in the scorecard as a known boundary — never as " + "an enforced contract. Re-adjudicates when the populace#566 damped " + "fixed-point protocol lands. The sparse certified default keeps " + "hard enforcement." ) US_DENSE_SSI_TAKE_UP_ENFORCEMENT_FENCES: dict[str, str] = { "18_64": _US_DENSE_SSI_FENCE_ADJUDICATION, @@ -5717,9 +5720,10 @@ def _enforce_ssi_take_up_delivery( populace#507/#508: a miss beyond tolerance on release weights fails the build instead of shipping in the scorecard. ``enforcement_fences`` (populace#566/#567) fences normally-enforced bands for the dense - diagnostic arm, whose threshold-to-equilibrium map has no one-retry - fixed point — fenced misses ship in the scorecard with their - adjudication text instead of failing the release. The delivered-weight + diagnostic arm, where the single permitted delivered-weight recompute + left the adult pair out of band on both observed frames — fenced + misses ship in the scorecard with their adjudication text instead of + failing the release. The delivered-weight diagnostics are written before returning failures — that artifact IS the remedy: the retry passes it via ``--ssi-take-up-prior-weight-basis`` so the thresholds are recomputed exactly once from measured delivery, never @@ -7016,6 +7020,21 @@ def _build_manifests( "warm_start_calibration": warm_start_payload, "selection_source": selection_source_payload, "default_dataset": default_dataset_payload, + **( + { + # populace#566/#567: release_manifest.json alone must + # distinguish fenced from enforced SSI delivery — the + # effective enforced set and the fenced rows (with + # their adjudication text) ride here as well as in + # build_manifest.json's gates block. + "ssi_take_up_delivery": { + "passed": ssi_take_up_delivery_gate_result.passed, + "details": dict(ssi_take_up_delivery_gate_result.details), + } + } + if ssi_take_up_delivery_gate_result is not None + else {} + ), **( { "base_population_scale": { From a63f45109fc071add62d454327324058046815ba Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Wed, 29 Jul 2026 13:25:34 -0400 Subject: [PATCH 4/5] Round 3: withdraw the last oscillation phrasing; P3 chain provenance told straight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sol round-2 residue on blocker 3: the call-site comment still said "oscillation adjudication" and the refusal test scanned only the fence constants. The refusal now scans the WHOLE of both production sources, and the adjudication text separates the two frames honestly — P2 is the clean one-retry record; P3's attempts were already anchored on delivered bases (its before-artifact records prior basis kind release_artifact), a chain shape the new loader guard refuses outright. Consequence recorded for populace#567: the certified sparse artifact itself carries prior basis kind release_artifact, so anchoring the dense arm on it would be a refused chain — dense attempt 3 runs from current-frame weights, with both adult bands fenced and reported. Co-Authored-By: Claude Fable 5 --- .../dense-takeup-enforcement.changed.md | 2 +- .../tests/test_us_fiscal_refresh_builder.py | 12 ++++-- tools/build_us_fiscal_refresh_release.py | 40 ++++++++++--------- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/changelog.d/dense-takeup-enforcement.changed.md b/changelog.d/dense-takeup-enforcement.changed.md index 3c9035cb..88e960a4 100644 --- a/changelog.d/dense-takeup-enforcement.changed.md +++ b/changelog.d/dense-takeup-enforcement.changed.md @@ -1 +1 @@ -Dense diagnostic arm fences its SSI adult bands (populace#566/#567): the single permitted populace#508 delivered-weight recompute left the adult pair out of band on both observed frames, and a second recompute is refused by a new chain-depth guard as the deleted populace#463-class loop. Fenced misses ship in the scorecard with their adjudication; both build_manifest.json and release_manifest.json record the run's effective enforced set and fenced rows. The sparse certified default keeps hard enforcement. \ No newline at end of file +Dense diagnostic arm fences its SSI adult bands (populace#566/#567): delivered-weight recomputes have not landed the adult pair in band on either observed frame, and a new chain-depth guard refuses retry-of-retry bases as the deleted populace#463-class loop. Fenced misses ship in the scorecard with their adjudication; both build_manifest.json and release_manifest.json record the run's effective enforced set and fenced rows. The sparse certified default keeps hard enforcement. \ No newline at end of file diff --git a/packages/populace-build/tests/test_us_fiscal_refresh_builder.py b/packages/populace-build/tests/test_us_fiscal_refresh_builder.py index 918aad8a..e7301b09 100644 --- a/packages/populace-build/tests/test_us_fiscal_refresh_builder.py +++ b/packages/populace-build/tests/test_us_fiscal_refresh_builder.py @@ -181,7 +181,7 @@ def test_certified_release_dir_reuse_is_refused(tmp_path) -> None: def test_dense_ssi_fences_cover_the_enforced_bands_and_cite_the_adjudication() -> None: """populace#566/#567: the dense-arm fence table must cover exactly the - normally-enforced bands, and every fence must carry the oscillation + normally-enforced bands, and every fence must carry the recompute adjudication, its re-adjudication trigger, and the sparse contrast — a fence without its documented reason is forbidden.""" from populace.build.us_runtime.ssi_take_up import ( @@ -197,9 +197,15 @@ def test_dense_ssi_fences_cover_the_enforced_bands_and_cite_the_adjudication() - assert "Re-adjudicates" in text, band assert "sparse certified" in text, band # The adjudication must claim only what the artifacts support: - # the one permitted recompute left the pair out of band — NOT a - # proven oscillating map (sol round-1 blocker 3). + # recomputes failed to land the pair in band — NOT a proven + # periodic map (sol round-1 blocker 3). The refusal scans the + # WHOLE production sources, not just the constant, so a stray + # comment cannot reintroduce the overclaim (sol round 2). assert "oscillat" not in text.lower(), band + import populace.build.us_runtime.ssi_take_up as ssi_module + + for source_path in (Path(builder.__file__), Path(ssi_module.__file__)): + assert "oscillat" not in source_path.read_text().lower(), source_path def test_ssi_delivery_fences_are_passed_on_the_dense_arm_only() -> None: diff --git a/tools/build_us_fiscal_refresh_release.py b/tools/build_us_fiscal_refresh_release.py index f3f6c0f7..b5555f38 100644 --- a/tools/build_us_fiscal_refresh_release.py +++ b/tools/build_us_fiscal_refresh_release.py @@ -285,28 +285,32 @@ FINAL_HOUSEHOLD_WEIGHTS_SCHEMA_VERSION = 1 POST_EXPORT_ABSOLUTE_TOLERANCE = 1_000_000.0 POST_EXPORT_RELATIVE_TOLERANCE = 5e-4 -# populace#566/#567 dense-arm adjudication: on the dense full-pool frame -# the single permitted populace#508 delivered-weight recompute left the -# adult band pair out of band on both observed frames (P2: 18-64 -# +5.8%/65+ +24.8% -> +8.2%/+20.0%; P3: 65+ +34.6% with 18-64 in-band -> -# +8.3%/+19.8% — the retry moved 18-64 OUT of band while improving 65+). -# A second recompute is refused as the deleted populace#463-class loop -# (chain-depth guard in ssi_take_up_prior_basis_from_artifact). The dense +# populace#566/#567 dense-arm adjudication: populace#508 delivered-weight +# recomputes have not landed the dense frame's adult band pair in the +# envelope on either observed frame. P2 is the clean one-retry record +# (current-frame attempt then its one permitted recompute: 18-64 +# +5.8%/65+ +24.8% -> +8.2%/+20.0%). P3's attempts were already anchored +# on delivered bases (65+ +34.6% with 18-64 in-band, then +8.3%/+19.8% +# after recomputing again — the recompute moved 18-64 OUT of band while +# improving 65+); that chain shape is now refused outright by the +# chain-depth guard in ssi_take_up_prior_basis_from_artifact. The dense # diagnostic arm therefore FENCES its adult bands — the under-18 pattern # extended: the miss ships in the scorecard as a known boundary, never as # an enforced contract and never as saturation-as-success. The sparse # certified default passes no fences and keeps hard enforcement. # RE-ADJUDICATES when populace#566's damped fixed-point protocol lands. _US_DENSE_SSI_FENCE_ADJUDICATION = ( - "Fenced for the dense diagnostic arm (populace#566/#567): the single " - "permitted populace#508 delivered-weight recompute left the adult " - "band pair out of band on both observed frames (P2: +5.8%/+24.8% -> " - "+8.2%/+20.0%; P3: in-band/+34.6% -> +8.3%/+19.8%), and a second " - "recompute is refused as the deleted populace#463-class loop. This " - "band's miss ships in the scorecard as a known boundary — never as " - "an enforced contract. Re-adjudicates when the populace#566 damped " - "fixed-point protocol lands. The sparse certified default keeps " - "hard enforcement." + "Fenced for the dense diagnostic arm (populace#566/#567): " + "populace#508 delivered-weight recomputes have not landed the adult " + "band pair in the envelope on either observed frame (P2, current-" + "frame attempt then its one permitted recompute: +5.8%/+24.8% -> " + "+8.2%/+20.0%; P3, attempts already anchored on delivered bases: " + "65+ +34.6%, then +8.3%/+19.8% after recomputing again — a chain " + "the populace#508 loader now refuses). Further recomputes are the " + "deleted populace#463-class loop. This band's miss ships in the " + "scorecard as a known boundary — never as an enforced contract. " + "Re-adjudicates when the populace#566 damped fixed-point protocol " + "lands. The sparse certified default keeps hard enforcement." ) US_DENSE_SSI_TAKE_UP_ENFORCEMENT_FENCES: dict[str, str] = { "18_64": _US_DENSE_SSI_FENCE_ADJUDICATION, @@ -9437,8 +9441,8 @@ def main() -> None: release_dir=release_dir, telemetry=telemetry, # The dense diagnostic arm fences its adult bands per the - # populace#566/#567 oscillation adjudication; the sparse - # certified arm passes no fences and keeps hard enforcement. + # populace#566/#567 fence adjudication; the sparse certified + # arm passes no fences and keeps hard enforcement. enforcement_fences=( US_DENSE_SSI_TAKE_UP_ENFORCEMENT_FENCES if args.dense_default_dataset From ea3a5b246a3a308739c657aebde623607cbc00a3 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Wed, 29 Jul 2026 13:37:49 -0400 Subject: [PATCH 5/5] Round 4: the two remaining docstrings tell the P3 chain straight Sol round-3 residue: the _enforce and gate docstrings still claimed a "single permitted" recompute explained both frames; P3's record is a refused delivered-basis chain. Both now match the adjudication constant. Co-Authored-By: Claude Fable 5 --- .../src/populace/build/us_runtime/ssi_take_up.py | 14 ++++++++------ tools/build_us_fiscal_refresh_release.py | 9 +++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py b/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py index 432a0586..d2f119fc 100644 --- a/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py +++ b/packages/populace-build/src/populace/build/us_runtime/ssi_take_up.py @@ -1644,12 +1644,14 @@ def us_ssi_take_up_delivery_gate( ``enforcement_fences`` fences normally-enforced bands for a specific ARM with a documented adjudication (the under-18 pattern extended): - on the dense full-pool arm the single permitted populace#508 - delivered-weight recompute left the adult pair out of band on both - observed frames (populace#566/#567), so its adult bands ship in the - scorecard as known boundaries rather than enforced contracts. The - fence text rides each fenced row; the sparse certified default - passes no fences and keeps hard enforcement. + on the dense full-pool arm, populace#508 delivered-weight recomputes + have not landed the adult pair in band on either observed frame — + P2's clean one-retry record, and P3's delivered-basis chain that + ``ssi_take_up_prior_basis_from_artifact`` now refuses outright + (populace#566/#567) — so its adult bands ship in the scorecard as + known boundaries rather than enforced contracts. The fence text + rides each fenced row; the sparse certified default passes no + fences and keeps hard enforcement. """ expected_targets = _normalize_targets(targets) diff --git a/tools/build_us_fiscal_refresh_release.py b/tools/build_us_fiscal_refresh_release.py index b5555f38..1aca1064 100644 --- a/tools/build_us_fiscal_refresh_release.py +++ b/tools/build_us_fiscal_refresh_release.py @@ -5724,10 +5724,11 @@ def _enforce_ssi_take_up_delivery( populace#507/#508: a miss beyond tolerance on release weights fails the build instead of shipping in the scorecard. ``enforcement_fences`` (populace#566/#567) fences normally-enforced bands for the dense - diagnostic arm, where the single permitted delivered-weight recompute - left the adult pair out of band on both observed frames — fenced - misses ship in the scorecard with their adjudication text instead of - failing the release. The delivered-weight + diagnostic arm, where delivered-weight recomputes have not landed + the adult pair in band on either observed frame (P2's clean + one-retry record; P3's refused delivered-basis chain) — fenced + misses ship in the scorecard with their adjudication text instead + of failing the release. The delivered-weight diagnostics are written before returning failures — that artifact IS the remedy: the retry passes it via ``--ssi-take-up-prior-weight-basis`` so the thresholds are recomputed exactly once from measured delivery, never