Repository navigation
Replace SSA Table 7.B1 values with SSA's own workbook - #294
Conversation
The ssa/ssi_table_7b1_2024 package emitted 416 facts from a hand-typed CSV that matched the published Annual Statistical Supplement 2025 Table 7.B1 in 1 of 416 cells. The Codex session that built it (2026-05-29) got HTTP 403 from every programmatic fetch of ssa.gov and then wrote the 52 area rows into the build script as literal numbers. The package now parses SSA's section 7.B workbook (7b.xlsx, sha256 6363d2ef..., byte-identical to the file ssa.gov serves today and to every Wayback capture since 2026-01-01) with xlsx_used_range, sheet 7.B1. Record-set ids, value ids, measure ids and concepts are unchanged, so source_record_id, semantic_fact_key and observed_measure_key do not move; 415 values change. A Wayback capture of the 7.B web page is vendored as source_capture so a new test can check every fact against an independent rendering of the table. Recipient and payment record sets gain non-identity period_coverage (December 2024; calendar year 2024). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
publish-raw uploaded both manifest entries to ledger-raw (verified by downloading each object and matching its sha256) and rewrote the manifest in its canonical line-wrapped form. No field values changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chronicle judge record for head
|
Brings the Table 7.B1 fix up to main 8f409d6. The one conflict was .gitattributes: keep main's list and add the vendored 7.B web page capture as `-diff -text`, the form main now uses for pinned HTML, so a checkout can't renormalize the bytes its sha256 pins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The workbook parser reads cells, not source rows, so no row text labels the aged, blind and disabled values any more, and build_bundle reported three missing_dimension_value_label errors: the one failure in this PR's first CI run (test_build_bundle_writes_merged_consumer_contract). Declare the labels in the package, in the workbook's own column headings, which the package's guards already check (Aged, Blind, Disabled). Only this package emits ssi_category, so a package declaration, not a register entry, is the remedy chronicle#376 names. The new package test checks the consumer rows the way the bundle does, so a missing label fails in this module instead of only in the bundle build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The label test compared the declared labels with literal strings. It now reads SSA's row-4 headings from the workbook's source cells, in both the recipient and payment column groups, so a label that drifts from the publisher's heading fails. Also add the changelog fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chronicle judge record for head
|
Summary
ssa/ssi_table_7b1_2024emits 208 SSI recipient and 208 SSI payment facts (cy2024) citing SSA Annual Statistical Supplement 2025, Table 7.B1. Its CSV matched the published table in 1 of 416 cells, the national payment total of 63,079,493 thousand dollars. For example:The old state payment rows summed to $63.92B and exceeded the old All-areas row of $63.08B.
This PR repoints the package at SSA's own workbook and makes all 416 facts equal the published table. It also declares SSA's column headings as the labels of the three eligibility categories.
Cause
The package came from #48 (2026-05-29). The Codex session that built it (
019de035…, archived rollout JSONL, lines ~170939–171480) tried to reach ssa.gov and got 403 / Access Denied from curl,urlliband the Jina reader.pandas.read_htmlalso failed because the environment lackedlxml.Its web tool then opened
7b.htmlfive times, and the transcript does not record what those calls returned. At 04:38:48 UTC the session wrote the 52 area rows into the build script as a literal tab-separated block, which matches the committed CSV in 416/416 cells.The block matches none of these SSA tables:
393 of the 416 cells need three or more digit edits to reach the published value, more than a few transcription slips would explain. The same command wrote the package metadata's "manual table extraction", and the tests #48 added pinned the invented California values.
What changes
7.B1of SSA's section 7.B workbook,7b.xlsx, through thexlsx_used_rangeparser:6363d2ef…, 52,436 bytes.id_captures from 2026-01-01 on match it too.files.source_capture. No fact comes from it; the tests parse it as an independent rendering of the same table..gitattributesmarks it-diff -text, so git keeps its CRLF line endings byte for byte, as the file's header comment asks of pinned source artifacts.ssi_table_7b1_2024.csv.chronicle publish-rawuploaded both files toledger-rawat their canonical content-addressed keys, and a download of each matched its sha256.row_number/column, a row-header guard, a category-heading guard (row 4) and a column-group guard (row 3). The All-areas rows also guard the table title.ssi_categoryvalues. The package declares SSA's row-4 headings (Aged, Blind, Disabled) as their labels indimension_value_labels. Without the declaration,build_bundlereports threemissing_dimension_value_labelerrors.value_ids,measure_ids, concepts andsource_column_ids, sosource_record_id,semantic_fact_key,observed_measure_key,concept_alignment_key,dimension_set_keyandsource_series_keystay the same for all 416 facts. No key builder reads the labels.source_release_keychanges, andaggregate_fact_keywith it, because the release key includes the artifact sha; any byte-level fix would change it.legacy_fact_keychanges because it includes the filename, andsource_cell_keysandlayout.record_set_spec_hash(the selector spec hash) change too.source_row_keysbecome empty, as for every xlsx package.period_coverage: "December 2024" for recipients and "calendar year 2024" for payments. Period identity stayscalendar_year2024.Invariants
tests/test_source_ssa_ssi_table_7b1.pychecks these properties in 75 tests:html.parser.source_record_idrepeats, and no fact covers Northern Mariana Islands.total == aged + blind + disabledin every row, and All areas equals the sum of the 52 areas plus NMI with no residual.(source_record_id, semantic_fact_key)pairs equals its pre-fix value.build_r2_keyover the bytes.build_factsraise.ssi_categorylabels equal the workbook's row-4 headings, which agree across the recipient (E:G) and payment (I:K) columns.The old CSV satisfied recipient additivity row by row, so arithmetic checks alone could not catch its invented values; invariant 2 catches them.
Chronicle governance
ledger-source-ingestor.db/data/ssa/ssi_table_7b1_2024/*(manifest and artifacts), the.gitattributesline for the vendored HTML capture, andchangelog.d/294.fixed.md.PYTHONPATH:af85c59:chronicle validate-package packages/ssa/ssi_table_7b1_2024 --year 2024: valid.chronicle build-suite … --year 2024: 715 source cells and 416 facts, each with cell lineage.agent_acceptance.jsonreports the build valid, with every check true, includingfull_source_document_parsed,raw_artifacts_have_r2andselected_row_only_parser_not_used.fbd9d5b, on the same artifact bytes:pytest tests/test_source_ssa_ssi_table_7b1.py tests/test_chronicle_source_package.py tests/test_chronicle_governance.py tests/test_chronicle_boundaries.py tests/test_chronicle_facts_only.py tests/test_chronicle_consumer_contract.py tests/test_chronicle_artifacts.py: 310 passed, andruff check(0.14.10, as locked) found nothing.chronicle publish-raw --root db/data/ssa/ssi_table_7b1_2024: both uploads succeeded, and the downloads match by sha256.af85c59(record: Replace SSA Table 7.B1 values with SSA's own workbook #294 (comment); the record forfbd9d5b: Replace SSA Table 7.B1 values with SSA's own workbook #294 (comment)):ledger-source-fidelity: PASS. 416/416 facts equal their publisher cells, and the merge with main leaves every value and both byte pins unchanged.ledger-contract: n/a. The PR changes no schema, identity construction or contract code.ledger-boundary: PASS.Downstream in Microcosm
Microcosm main pins Chronicle's consumer feed at
41b2fb2, so nothing in Microcosm moves until a Microcosm PR re-pins it.Microcosm's compile path binds the 51 state and DC
totalrows of each measure as calibration targets. It skips the national rows: the PolicyEngine/microcosm#508 adjudication made national recipients a non-binding reference, and national payments come from another SSA table. It never compiles the 312 category rows.The published values move those 102 targets by these amounts:
No target's inclusion or binding status flips. Microcosm calibrated US builds I, J, M, N, O and P (
logbook/us.jsonl) on feeds that carry these 416 values.Tests
This PR changes three existing tests:
source_capturelabel key, since this PR removes theextracted_targetskey.The new module tests the invariants above. CI runs the full suite. On
fbd9d5b(2026-09-27), CI failedtest_build_bundle_writes_merged_consumer_contractonmissing_dimension_value_labelerrors for these values, which the label declaration in0e60b71removes.🤖 Generated with Claude Code