Repository navigation
Conversation
… national loss budget The #195 concept budget never engaged on the full surface: since efa6052 (2026-09-05) the ledger compiler stamps per-row labels (ledger_fact_label, ledger_layout_groupby_value_label, diagnostic_target_label) that the district key read, so all 24,340 district rows were singleton groups. - Exclude the three labels from the national concept key (LEDGER_PER_ROW_LABEL_METADATA); the ACS local key inherits them. - Guard the national mapping (us_fiscal_ledger_metadata.v2) with validate_district_concept_groups, shared with the ACS local guard, so a per-row key that splits a district concept fails loudly. - Regenerate the US spec bundle's concept-budget exclusion list and move the spec-engine field counts (+3 authored fields). - Tests: differential against the frozen pre-move helpers with labels stripped, key invariance to place/record/label metadata, partition equals district concept identity, guard refusals, a real-row fixture from the pinned feed, and a feed-gated count of all 3,125 groups. On the pinned feed the district rows' loss share falls from 45.6% to 11.0%; national_state (Route A) weights are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…usions
The regenerated calibration.yaml lists three more metadata_exclusions, so
three more authored configuration fields. Every new value below was
observed from the code (tools/spec_engine_coverage.py, load_bundle("us")):
- EXPECTED_AUTHORED/CONFIGURATION_FIELD_COUNT 32_404/42_184 -> 32_407/42_187
- calibration pointer claim 312 -> 315 pointers (digest 1d499082...)
- EXPECTED_POINTER_INVENTORY_SHA256 -> bc18b1e1...
- legacy_behavior mode / generation-0 counts +3 (14_013, 38_501)
- US spec_sha256 fbf25dba... -> fe6d751d... (multispine pool tool test)
- docs/evidence/spec-engine/us-f0-coverage.json regenerated (42187/42187
fields, 41/41 inventory checks)
Also note in the 10-04 ACS experiment README that its national finding is
fixed and that its state_cd national_as_is column would now be refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acs_local_unchanged.py loads the pre-change target_loss_weights.py (at 51a2637) beside the current one and compares the ACS local weights on the 09-23 release registry (digest still ba36f887...) and on the state, totals, full and state_cd surfaces of the pinned feed: identical on all five. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
On the national full surface, the #195 per-concept loss budget never pooled a congressional-district (CD) row. This PR makes it pool them again and adds a guard so a new per-row key cannot silently disable it a second time.
_ledger_concept_budget_keyinus_runtime/target_loss_weights.py) reads every metadata key outsideUS_FISCAL_TARGET_CONCEPT_METADATA_EXCLUSIONS.ledger_fact_labelledger_layout_groupby_value_labeldiagnostic_target_labelexperiments/us-acs-local-target-loss-weights-20261004/("A finding for the national release (not changed here)"). Lane C of the Congressional-district capital-gains, SALT and PTC targets on the full surface cross IRS concepts #1038 code map found it again on 2026-09-27.Changes
LEDGER_PER_ROW_LABEL_METADATAnames the three labels, and the national exclusions now include them.state_cd_cd_file_value.diagnostic_target_label.validate_district_concept_groupsnow guards the national mapping, renamedus_fiscal_ledger_metadata.v2. The ACS local guard calls it too. It refuses:district_concept_identity) that land in more than one group; the error names the differing keys;state_fips.A future per-row key now fails the weights loudly.
Spec bundle:
us/spec/calibration.yamlis regenerated withtools/generate_us_bundle_from_constants.py. Its exclusion list gains the three labels. The spec-engine pins move with it:spec_sha256(fbf25dba…→fe6d751d…);docs/evidence/spec-engine/us-f0-coverage.json.Every new value was observed from the code, not transcribed.
The formula id
US_FISCAL_TARGET_LOSS_WEIGHTINGis unchanged. On the full surface the loss-vector digest intarget_loss_basismoves, so the exact-k incumbent gate refuses to compare old-weighted runs with new ones.Effect on loss weights (pinned feed
965a29ac…,--target-surface full, 33,249 targets)These figures come from
experiments/us-national-cd-concept-budget-20261012/(script,results.json, README).After the fix, each group is exactly one concept identity. The 665 singletons are the seven single-district states (AK, DE, DC, ND, SD, VT, WY), 95 concepts each.
Non-district targets: every weight is multiplied by one factor per basis, ×1.6373 for amounts and ×1.6332 for counts.
District targets: the median weight is 0.157× what it was. The minimum, 0.033×, is in California's 52-district groups. Single-district states change by the basis factor only.
By family:
irs_soigoes from 90.5% to 84.5%. Every other family rises by about 1.63×.Unchanged:
national_staterun. They have no district rows, and the recorded weights and loss-basis hash206ada09…still reproduce bit for bit.acs_local_unchanged.pychecks this against the pre-change module, bit for bit, on two kinds of surface:ba36f887…;state,totals,fullandstate_cdsurfaces of the pinned feed.Only future
--target-surface fullcalibrations change. Certified releases usenational_state(d122).Invariants (each tested)
Differential. For every registry Hypothesis draws, the shared module returns, bit for bit, what the frozen pre-move helpers (
test_support/.../us_target_loss_weights_reference.py) return for the same registry with the per-row labels removed. On label-free registries that is the pre-move result itself. Route A's 5,694 recorded weights still reproduce.Key invariance. A district row's national key does not change when any metadata naming its place, record or label is dropped or rewritten. These are all exclusions except
state_fipsandledger_geography_level, which the key reads on purpose.Partition = identity. District rows share a national key if and only if they are one concept in one state (
district_concept_identity). This is tested on random registries, on 31 real compiled rows from the pinned feed (new fixture, written by the experiment script), and on the whole pinned compile.Guard. The national weights refuse:
Non-district rows are never checked.
The labels are real. The compiler's own
_ledger_metadataand_diagnostic_target_label_metadatastamp exactlyLEDGER_PER_ROW_LABEL_METADATAon a district fact. The diagnostic label appears only when the periods match. The pre-change key split two such districts, and the new key pools them.Feed-gated count (skips on CI). The pinned compile gives:
Merge rationale
This restores the behaviour that #195 documented and #1104 already applied to ACS local. It does not move target values or any release surface. Under the "obvious bug fix" rule it needs no ruling, so it merges on the usual gates: green CI, mergeable, and an independent review in agreement.
axiom: n/a: calibration loss-weighting infrastructure, no policy rule.
Review
Pending: independent GPT-6.1 Sol review (Subfleet
review/hard, job20261012-111905-cd-budget-review-r1) at 89c9c28; the later commits add only experiment evidence. Local runs: the 57 loss-weight tests pass, including the feed-gated one, andtools/spec_engine_coverage.py --checkpasses (42,187/42,187 fields, 41/41 inventory checks). A broader targeted run over the US release-tool and spec-engine test files is paused by a host hold.🤖 Generated with Claude Code