Skip to content

etl_receipts

ETL receipts

A receipt records how the pipeline processed a row, including what it read, which version of the code read it, and any fields it kept outside the table. ETL stands for extract, transform, and load.

Receipts are useful for three things:

  • Finding something that is no longer a column. A table in the newer layout keeps the columns people query. A few things people do sometimes want, such as the link to a filing's page on the publisher's site, are kept in the receipt instead, until the table's group stops writing receipts and makes them columns. Where that is so, the table's own notes say it in one sentence.
  • Checking where a row came from. A receipt names what was read to make the row.
  • Seeing what did not become a row. When a pipeline records a record it could not convert, it does so as a receipt with no row.

All installed per-row receipt policies are retired. A family may still select a generation published before its cutover. While that generation is selected, describe_table('etl_receipts') lists its receipt datasets under publication. The datasets list under metadata describes installed policies that still write receipts.

The two retired shared logs, congress_acquisition and legislative_document_file_states, are stored in each family's receipt member. Use shared_log_archives in docs/pins/receipt-archive.json to find the generation and member for a family, then filter its rows by dataset.

All eight rulemaking snapshot tables retire per-row ETL receipts (ss-vse3, ss-ijt2). The archive pin in docs/pins/receipt-archive.json preserves the last receipted snapshot and its internal file. New snapshots keep the existing public columns. Three receipt-only fields were dropped.

  • regulatory_agenda_items.scope_basis repeats what scope_status and linked_proceeding_count already show. For unresolved items, the count distinguishes zero linked proceedings from several.
  • rulemaking_lifecycles.withdrawal_source repeats the source on the withdrawal anchor in lifecycle_events. Join by proceeding_id and withdrawal_document_id to document_id.
  • rulemaking_lifecycles.anchored_by_specific_rin summarizes the proposal and final anchors in lifecycle_events. The event's joined_by value records whether it joined by specific_rin.

The cutover also drops the per-row bookkeeping fields method, actor_id, run_id, asserted_at, supersedes_id, raw_conversion_inputs, input_metadata, and raw_source_record. The manifest still records the run ID, assertion time, source snapshot inputs, and previous snapshot ID. Those run-level records replace repeated row bookkeeping. The public tables retain the proceeding IDs and evidence used for joins.

The word has two other uses in this dictionary, and neither is this table. fec_receipts and other campaign-finance wording mean money a committee received. A note that cites a "receipt" followed by a folder name points at the maintainers' own evidence files, which are not public.

How to find the receipt for a row

In a table that has receipts, every row has exactly one receipt whose outcome is accepted. You find it with a query, by the table's name and the row's key.

  1. Ask for the table's key columns. describe_table('crs_reports') lists them as identity_columns; for crs_reports those are report_id and update_date.
  2. Write the row's key the way a receipt stores it in identity_json: each key column as a name and a value, in the order identity_columns gives.
  3. Select the receipt with that table name and that key.

For the CRS report R48641 updated at 2026-07-17T22:38:55+00:00:

SELECT *
FROM etl_receipts
WHERE dataset = 'crs_reports'
  AND outcome = 'accepted'
  AND identity_json = '["list",[["list",[["str","report_id"],["str","R48641"]]],["list",[["str","update_date"],["datetime","2026-07-17T22:38:55+00:00"]]]]]'

A table with two key columns names both. fec_committee_history is keyed by committee_id and cycle, and its key for committee C00097238 in 2012 is:

["list",[["list",[["str","committee_id"],["str","C00097238"]]],["list",[["str","cycle"],["int",2012]]]]]

Text is written ["str","…"], a whole number ["int",2012] with no quotes around the number, and a key column that is empty for the row ["null",null]. A timestamp is written ["datetime","2026-07-17T22:38:55+00:00"]. Spelling and capital letters must match the table's value exactly.

To fetch the receipts of several rows, join on the same expression and build the key from the table's own column:

SELECT t.report_id, t.update_date, t.title, r.witnesses
FROM crs_reports t
JOIN etl_receipts r
  ON r.dataset = 'crs_reports'
 AND r.outcome = 'accepted'
 AND r.identity_json = '["list",[["list",[["str","report_id"],["str","' || t.report_id
     || '"]]],["list",[["str","update_date"],["datetime","'
     || replace(strftime(t.update_date AT TIME ZONE 'UTC', '%Y-%m-%dT%H:%M:%S.%f')
                || '+00:00', '.000000+', '+') || '"]]]]]'
WHERE t.report_id IN ('R48641', 'IN12713')

Three things to know before relying on this:

  • The query reads through all of that table's receipts, so it is slower on the largest tables.
  • A shorter form you may see, contains(identity_json, '"R48641"'), works for a table with one key column. Do not use it on a table with several key columns: matching one part of the key returns other rows' receipts.
  • A key value that contains a double quote or a backslash is stored with a backslash in front of each, so the plain joining of text above will not match it.

How to read a value out of a receipt

The three columns ending in _json hold text in a form of JSON where every value is written as a pair: its type, then the value. The text R48641 is stored as ["str","R48641"], the number 5 as ["int",5], a missing value as ["null",null], a record as ["dict",[[name, pair], …]] and a list as ["list",[pair, …]]. This keeps the number 5 apart from the text "5", and a missing value apart from an empty text. The cost is that the usual JSON functions cannot fetch a field by its name, so today the working way to read one is a text pattern:

SELECT regexp_extract(processing_json, '\["url",\["str","([^"]*)"', 1) AS url
FROM etl_receipts
WHERE dataset = 'crs_reports'
  AND outcome = 'accepted'
  AND identity_json = '["list",[["list",[["str","report_id"],["str","R48641"]]],["list",[["str","update_date"],["datetime","2026-07-17T22:38:55+00:00"]]]]]'

Put the field's name where url is. The pattern has limits:

  • It reads text values only. For a field that is absent, missing or not text it returns an empty text, not NULL.
  • It returns the first field of that name anywhere in the receipt.
  • It stops at the first double quote, so a value that contains one (a title, or a list kept as text) comes back cut short. For such a value use the longer form, which reads it whole:
SELECT ('"' || regexp_extract(processing_json, '\["title",\["str","((?:[^"\\]|\\.)*)"', 1) || '"')::JSON ->> '$' AS title
FROM etl_receipts
WHERE dataset = 'crs_reports'
  AND outcome = 'accepted'
  AND identity_json = '["list",[["list",[["str","report_id"],["str","R48641"]]],["list",[["str","update_date"],["datetime","2026-07-17T22:38:55+00:00"]]]]]'

To see which fields a table's receipts hold, look at one: SELECT processing_json FROM etl_receipts WHERE dataset = 'crs_reports' AND outcome = 'accepted' LIMIT 1.

What a receipt contains

One row per receipt. The first columns say which row the receipt belongs to; the rest say what was read and what happened. On the server, etl_receipts is one table holding the receipts of every table that has them. In the published files, each group of tables has its own etl_receipts.parquet beside its tables, and the publication index names it.

Column Type Description
receipt_id VARCHAR This receipt's own fingerprint: a SHA-256 digest of all its other columns, so a receipt that was changed or damaged no longer matches its id.
dataset VARCHAR The table this receipt belongs to, by name (crs_reports). A few datasets have no table of their own and exist only as receipts.
policy_version VARCHAR Version of the rule that says which of the table's fields are published as columns and which are kept in the receipt.
generation_id VARCHAR The build that published this receipt. A table and its receipts are always published together as one build, and this names it.
record_id VARCHAR A SHA-256 fingerprint of the table's name and the row's key. Empty on a receipt that states no key.
subject_version VARCHAR A SHA-256 fingerprint of the row's published values. It changes when any of them changes, which ties a receipt to one exact version of its row. Empty on a receipt that has no row.
identity_json VARCHAR The row's key: each key column's name and its value, in the typed form shown under "How to find the receipt for a row". Empty on a receipt that states no key.
attempt_id VARCHAR Which processing attempt produced the receipt. A failed attempt, and one that produced no row, have one too.
outcome VARCHAR accepted: the record became the row this receipt goes with. observed: something was read and recorded, and no row goes with it (a dataset that has no table, a read that produced no row, or a row since removed). rejected, refused or error: the record did not become a row, and none was made up for it; each table's pipeline chooses among the three words. All five describe our processing, never the publisher's own status for the record.
processor VARCHAR Name and version of the program, or reading rule, that produced the receipt.
witnesses STRUCT(source_id VARCHAR, source_uri VARCHAR, sha256 VARCHAR, locator VARCHAR, body_version VARCHAR)[] What was read to produce the receipt, in order, a source read twice listed twice. For each: its identifier (source_id), its address (source_uri), a SHA-256 fingerprint of its content (sha256), the place within it (locator) and, for a stored copy, which copy (body_version). Every receipt names at least one source, with a fingerprint or a stored-copy version.
processing_json VARCHAR The fields this table keeps out of its columns, by name, in the typed form shown under "How to read a value out of a receipt". For many tables that is the whole record as the pipeline held it before conversion (raw_record); for others, named fields such as a source link. On a receipt for a record that did not become a row, it holds the fields that were read.
diagnostic_json VARCHAR Notes about the processing itself, in the same typed form, such as which earlier build's receipt for this row was carried forward and what that receipt held.

What a receipt does not tell you

  • Whether the publisher's record is right, current or approved. outcome describes our processing only. accepted means the pipeline turned the record into a row; it says nothing about what an agency decided. Where a publisher states a status of its own, that is a column of the table.
  • What the row said before. The server holds one build of each table, the one published now, with that build's receipts. A receipt for a row carried over from an earlier build notes the earlier receipts in diagnostic_json; the earlier builds themselves cannot be queried here. Tables that retain source revisions, such as crs_reports, expose those revisions as separate rows in the current build.
  • Where to open the publisher's page. witnesses names what the pipeline read, and that is not always a page you can visit. For some tables it is one of the pipeline's own working files, named by a path on the machine that ran the build. A link to the publisher, where we hold one, is a column of the table or a field in processing_json.
  • That nothing was missed. A table whose receipts are all accepted shows that no failure was recorded, not that every record the publisher holds was read. What a table covers is stated in its own coverage note.
  • Anything about a table without receipts. Read its public columns, table notes, and publication details for its available evidence.