Skip to content

Require provenance_class (measurement basis) on every record set and fact#96

Open
MaxGhenis wants to merge 1 commit into
mainfrom
provenance-class
Open

Require provenance_class (measurement basis) on every record set and fact#96
MaxGhenis wants to merge 1 commit into
mainfrom
provenance-class

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Adds the required, closed-vocabulary provenance_class field (administrative | census | survey_aggregate | model_output; survey_aggregate additionally requires survey_instrument) with no defaults, validated at build and load, flowing end to end through specs, facts, consumer contract, artifact load, and SQLite. All 67 existing packages / 1,514 record sets are backfilled with per-package justifications (see commit message; full table in the implementation handoff). Fact identities are unchanged; record-set spec hashes change (the field joins the spec hash).

Purpose: populace's calibration gate will default to administrative+census targets only, with survey aggregates requiring reviewed opt-in and model outputs never fitted (evaluation/oracle use only) — so nothing populace is built to correct becomes a fitting target.

Sequencing note: overlaps with #87 on policyengine_ledger/consumer.py (and #87 packages its own consumer schema copy that predates this field). Recommended order: merge #87 first (green + mergeable since 7/10), then I rebase this and reconcile the packaged schema; merging this first forces #87 to rebase instead. Either works — flagging so neither lands blind.

🤖 Generated with Claude Code

Populace calibrates against these facts, and the standing design rule is:
never calibrate against statistics that are functions of the latent
quantities populace corrects; admin data first, survey aggregates only for
items surveys measure well. The ledger stays epistemically neutral and
ingests everything — the measurement-basis classification becomes a
required schema field so consumers can gate on it fail-closed.

Every record set and every emitted fact now carries provenance_class,
closed to exactly administrative, census, survey_aggregate, and
model_output, with no default; survey_aggregate requires a non-empty
survey_instrument sibling that is forbidden for the other classes.
Validation runs at build and at load, the field flows through record-set
specs, source records, aggregate facts, fact and consumer-contract JSONL,
consumer artifact loading and resolution, and the SQLite artifact, and a
completeness test prevents any future record set from omitting it. The
field joins the record-set spec hash but is deliberately excluded from
stable fact identities, so fact keys are unchanged.

All 67 existing packages (1,514 record sets) are backfilled with per-
package justifications recorded in the implementation handoff: tax and
benefit program records (SOI, SNAP, Medicaid/Medicare, TANF, LIHEAP, ACA,
CBO historical actuals, HMRC VAT, state tax collections) are
administrative; census-controlled PEP counts are census; ACS tabulations
are survey_aggregate/ACS 1-year and the ICI fact-book table is
survey_aggregate/ICI Monthly Long-Term Survey; BEA NIPA and Regional
accounts, Census population projections, CBO baseline projections, JCT
tax-expenditure estimates, and Federal Reserve Z.1 net worth are
model_output — assembled statistical estimates, not source records.

Implemented by GPT-5.6 Sol with a per-classification justification table;
reviewed line by line, with one reclassification at integration (Z.1
administrative → model_output for consistency with the NIPA principle).
95 tests pass including the malformed build/load matrix.

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.

1 participant