canopy-tanf Data Model
For a contributor or maintainer reading the TANF schema: the tables below are the schema in effect after the migrations listed at the end, applied in order — tanf_household_snapshots no longer exists. Only the constraints named CHECK, UNIQUE or EXCLUDE are enforced by the database; the other value sets quoted (status, payment_type, …) are the service’s or the canopy-overpayments crate’s own vocabulary. Endpoint detail is on the canopy-tanf API page; the shared event_outbox / event_inbox pair is described once on the data-models index. Source: migrations/.
Tables
| Table | Purpose |
|---|---|
|
One row per application received from canopy-eligibility: the orchestrator’s |
|
Income records feeding the determination, self-reported or verified: |
|
Federal Tax Information (IRS Pub 1075 / IRC §6103(l)(7)); every read is wrapped in FTI audit logging. Only items (l)(7) discloses to a TANF agency (#2236): |
|
SSA SOLQ/BINDEX matches under the TANF CMA: |
|
One clock per person ( |
|
The ledger of counted months (ADR-055): |
|
Months a worker recorded as not counting for a person: |
|
One row: |
|
The daily-window fence the counting job runs under ( |
|
Per-person work-requirement state: |
|
Weekly activity log behind the ACF-199 work-participation rate: |
|
The dated work-standard basis (#2193): the custody facts behind a person’s 45 CFR 261.34(c) week — |
|
One signed determination per application evaluation: |
|
The determination’s assistance unit as the pack's decisions composed it, one row per member the determine request named: PK |
|
The parent–child relations among a determination’s unit members, every kind: PK |
|
The immutable ADR-028 input snapshot, one per determination (each income, asset and expense leaf carries the fact's provenance when the caller sent one, #884): |
|
Per-determination DEK store for crypto-shred (ADR-036): |
|
Lump-sum ineligibility windows (PAMMS 1650): |
|
Payments made beside the grant (#3508; named |
|
Personal Responsibility tracking (PAMMS 1345–1370): |
|
Verification discrepancies ( |
|
The Pub 1075 §4 access log, kept apart from the application audit log: |
|
|
|
The canonical claim table shared by the three program services that stamp it (canopy-snap, canopy-tanf, canopy-medicaid) ( |
|
Repayment schedules per claim: FK |
|
Append-only recoupment events: FK |
|
Append-only principal corrections: FK |
|
canopy-eligibility’s verdict on each of this service’s determinations, one row per |
|
The shared MQ pair; columns, indexes, parking and retention are on the data-models index. |
chain-v2 substrate (withdrawn and dormant, ADR-014 Amendment 6)
Installed by 20260910000000_chain_v2_substrate.sql (#1246) — the fti-family copy: canopy-tanf is a chain SOURCE; the anchor store and verification state live only in canopy_security (canopy-security Data Model). Dormant: chain-v2 is withdrawn (ADR-041; ADR-014 Amendment 12), the #1279 cutover with it, and #1304 retires the substrate.
| Table | Purpose |
|---|---|
|
The shared registry substrate (identical DDL to the canopy-security copy): instance history, active pointer, fenced epochs ( |
|
The FTI family’s strict-from-row-one event store. |
Views: chain_status_v, fti_hashed_preimage_v, fti_hashed_preimage_archive_v (the preimage views expose id since 20261010000000; SELECT granted to canopy_chain_verify). Functions: chain_head_lock, chain_append_rows_fti (SECURITY DEFINER — the only append path for the canopy_tanf_app runtime role), chain_epoch_activate, chain_archive_prefix_fti, chain_purge_prefix_fti. Every object is owned by the NOLOGIN role canopy_chain_owner_tanf. Contract: ADR-014 Amendment 6.
Cross-service identifiers (ADR-001 boundary)
Every REFERENCES in the database is drawn above; nothing crosses to another service. Application-level only: household_id / person_id / applicant_person_id / payee_person_id / on_behalf_of_person_id → canopy-persons; application_id on tanf_applications → canopy-applications; overpayment_claims.determination_id → usually this service’s tanf_determinations, unconstrained for back-rebill flows; redaction_keys.subject_id → tanf_determinations.id by convention.
Retention
canopy-tanf holds FTI (IRC §6103(l)(7); IRS Publication 1075) in fti_tax_data. FTI audit access is logged to fti_audit_log per Pub 1075 §4; minimum 7-year retention applies to the audit log per Pub 1075 AU-11 (ADR-004 Amendment 2; rows aged out of fti_audit_log migrate to fti_audit_log_archive with the ADR-014 hash chain extending across the boundary). SSA SOLQ/BINDEX data in ssa_match_results is retained per the TANF Computer Matching Agreement terms. TANF case records overall follow the HHS uniform-administrative-requirements retention floor — 3 years from submission of the final financial report (2 CFR 200.334, adopted for HHS awards by 2 CFR 300.1; 45 CFR part 75 was removed effective 2025-10-01, 89 FR 80055), TANF having no dedicated retention CFR analogous to SNAP’s 7 CFR 272.1(f) — and the Georgia state series: Georgia Archives, DHS retention schedule (agency 144), series 1973-0476 "Public Assistance Authorization Files", 3 years or until resolution of audit, whichever is longer — https://www.georgiaarchives.org/records/agencyprint/144 (checked 2026-09-18). The longest applicable floor governs: the state series matches the federal 3-year length and additionally runs until audit resolution, so the later-ending of the two windows governs the case records, and the 7-year AU-11 floor governs fti_audit_log. Archive moves and FTI-expiry purges are operator-driven (ADR-016 forward-only — no destructive migrations).
Indexes
-
idx_tanf_applications_application,idx_tanf_applications_household -
idx_tanf_income_application -
idx_fti_tax_data_application,idx_fti_tax_data_person -
idx_ssa_match_results_application -
tanf_time_limits_person_uq— the UNIQUE constraint’s index (the redundantidx_tanf_time_limits_personwas dropped in20261208000007) -
idx_tanf_work_requirements_person;idx_tanf_work_req_sanctioned—(sanction_level, sanction_expires_at) WHERE sanction_level >= 1, the supervisor sanctions roll-up (#1233) -
idx_tanf_work_activities_work_req—(work_requirement_id)(#1337) -
idx_tanf_work_standard_bases_person_effective—(person_id, effective_date DESC, created_at DESC), the in-force order (#2193) -
idx_tanf_determinations_application;idx_tanf_determinations_determined_at_id—(determined_at DESC, id DESC), the keyset list (#1195);idx_tanf_determinations_household_det_id—(household_id, determined_at DESC, id DESC)(#1244);tanf_determinations_operation_uq— unique(operation_id) WHERE operation_id IS NOT NULL, one determination per claimed operation (#3116) -
idx_determination_snapshots_as_of—(as_of) -
idx_redaction_keys_subject—(subject_kind, subject_id);uq_redaction_keys_live_subject— unique(subject_kind, subject_id) WHERE shredded_at IS NULL -
idx_tanf_lump_sum_person;idx_tanf_supplemental_payments_payee,idx_tanf_supplemental_payments_on_behalf_of;idx_tanf_pr_application,idx_tanf_pr_person -
idx_tanf_discrepancies_household;idx_tanf_discrepancies_status—(resolution_status) WHERE resolution_status = 'pending' -
idx_fti_audit_accessed_at,idx_fti_audit_accessed_by,idx_fti_audit_purpose_code;idx_fti_audit_created_at— the ADR-014 §9 in-lock predecessor lookup and verify walk (#1197);idx_fti_audit_event_hash,idx_fti_audit_archive_event_hash -
overpayment_claims_status;overpayment_claims_keyset—(created_at DESC, id DESC);overpayment_claims_assessment_once— unique(assessment_id) WHERE assessment_id IS NOT NULL;overpayment_claims_source_event_once— unique(source_event_id) WHERE source_event_id IS NOT NULL;overpayment_claims_by_appeal—(appeal_id) WHERE appeal_id IS NOT NULL -
repayment_plans_by_claim,recoupment_ledger_by_claim,claim_adjustments_by_claim -
chain-v2:
chain_epochs_one_open_v2— unique(chain_instance_id) WHERE state IN ('installing','active');fti_audit_log_v2_shard_seq_idx—(chain_instance_id, chain_epoch, shard_id, chain_seq);fti_audit_log_v2_accessed_at_idx;fti_audit_log_archive_v2_id_uq -
event_outbox_*,event_inbox_unprocessed_idx,idx_event_inbox_parked— the generated partial indexes, described on the data-models index
Migration files
-
20260325000000_create_tanf_tables.sql—tanf_applications,tanf_income,fti_tax_data,ssa_match_results,tanf_time_limits,tanf_work_requirements,tanf_work_activities,tanf_determinations, andtanf_household_snapshots(since dropped) -
20260325000001_create_fti_audit_log.sql—fti_audit_log+fti_audit_log_archive -
20260407000000_add_lump_sum_grg_personal_resp.sql—tanf_lump_sum_periods,tanf_grg_payments,tanf_personal_responsibilities -
20260422000000_add_denial_reason_code.sql—tanf_determinations.denial_reason_code -
20260425000000_add_fti_audit_hash_chain.sql—previous_hash/event_hashon the audit log and archive (ADR-014) -
20260508000000_create_event_outbox.sql— generated (index page) -
20260510000000_drop_federal_time_limit_default.sql— drops theDEFAULT 60ontanf_time_limits.federal_limit_months(#441) -
20260510000001_create_overpayments.sql—overpayment_claims,repayment_plans,recoupment_ledger -
20260511000000_add_sanction_lifecycle.sql—sanction_imposed_at/sanction_expires_at/sanction_reason(#416) -
20260512000000_create_tanf_discrepancies.sql—tanf_discrepancies -
20260516000000_create_event_inbox.sql— generated (index page) -
20260518004851_event_outbox_lease_columns.sql— generated (index page) -
20260603120000_fti_audit_append_only_guard.sql— the statement-level append-only guard on the audit log and archive (#624) -
20260623000000_create_determination_snapshots.sql—tanf_determinations.snapshot_hash,determination_snapshots, its append-only trigger (#685, ADR-028) -
20260624140000_create_redaction_keys.sql—redaction_keysand its one-way guard triggers (ADR-036) -
20260630000000_drop_tanf_household_snapshots.sql— dropstanf_household_snapshots(#883) -
20260713000000_event_outbox_hold.sql— generated (index page) -
20260720000000_event_inbox_parking.sql— generated (index page) -
20260727000000_claim_provenance_adjustments.sql— claim provenance columns, the void path,claim_adjustments(#1104; canonical copy incrates/canopy-overpayments/migrations/) -
20260803000000_event_outbox_v7_pk_default.sql— generated (index page) -
20260807000000_overpayments_v7_pk_defaults.sql— drops the id defaults on the four overpayment tables (#1173) -
20260810000000_snapshot_hash_not_null.sql— setssnapshot_hash NOT NULL(#911) -
20260811000000_fti_audit_created_at_idx.sql—idx_fti_audit_created_at(#1197) -
20260815000000_event_outbox_claim_order_idx.sql— generated (index page) -
20260816000000_sanctions_rollup_idx.sql—idx_tanf_work_req_sanctioned(#1233) -
20260817000000_tanf_determinations_list_keyset_idx.sql—idx_tanf_determinations_determined_at_id(#1195) -
20260902000000_overpayment_claims_keyset_idx.sql—overpayment_claims_keyset(#1222) -
20260904000000_event_outbox_parking.sql— generated (index page) -
20260910000000_chain_v2_substrate.sql— the dormant chain-v2ftisubstrate: roles, seven tables, three views, five functions (#1246) -
20261010000000_fti_preimage_id.sql— the preimage views gainid;fti_audit_log_archive_v2_id_uq; SELECT grant tocanopy_chain_verify(#1205, #1206) -
20261130000000_tanf_determinations_household_idx.sql—idx_tanf_determinations_household_det_id(#1244) -
20261208000001_redaction_keys_live_subject_uq.sql— tombstones superseded live DEKs, thenuq_redaction_keys_live_subject(#1458) -
20261208000005_work_activities_work_req_idx.sql—idx_tanf_work_activities_work_req(#1337) -
20261208000006_tanf_time_limits_person_uq.sql—tanf_time_limits_person_uq(#1330) -
20261208000007_drop_redundant_time_limits_person_idx.sql— dropsidx_tanf_time_limits_person(#1330) -
20261224000000_redaction_keys_rewrap_guard.sql—canopy_redaction_keys_one_way_guard()admits the KEK rewrap (wrapped_dekreplaced +kek_versionstrictly increased on a live row) beside the shred (#2113) -
20261225000000_tanf_work_activities_checks.sql— the validatedtanf_work_activities_hours_per_week_rangeandtanf_work_activities_span_orderCHECKs (#2193) -
20261225000001_tanf_work_standard_bases.sql—tanf_work_standard_bases, its CHECK andidx_tanf_work_standard_bases_person_effective(#2193) -
20270111000001_determination_status_check.sql— deletes any determination outsideapproved / denied / sanctionedwith its snapshot, inside thecanopy.snapshot_maintenancewindow, then addstanf_determinations_status_verdict(#628) -
20270113000001_overpayment_discovered_by_actor.sql— the canonical stamp (crates/canopy-overpayments/migrations/canonical_discovered_by_actor.sql):overpayment_claims.discovered_bybecomesTEXT+discovered_by_service; a guard aborts namingcargo xtask dev restarton any existing claim (none states a provable actor of a known class: NULL, nil, or a body-supplied subject); thenoverpayment_claims_discovered_by_one_actor(= 1, VALID) (#1008) -
20270117000000_redaction_keys_created_at_no_default.sql— drops theredaction_keys.created_atdefault: the shared canopy-db store bindscreated_at(the determination’s decision instant) andshredded_at(the redaction’s) from its caller, so an insert that names nocreated_atnow fails instead of taking the database clock (#2475) -
20270118000000_overpayment_stamps_no_default.sql— the canonical stamp (crates/canopy-overpayments/migrations/canonical_stamps_no_default.sql): drops thenow()defaults ofoverpayment_claims.created_at/updated_at,repayment_plans.created_at/updated_at,recoupment_ledger.occurred_atandclaim_adjustments.created_at— the shared store binds every stamp from the writing request’s decision clock, so an insert that names no stamp now fails instead of taking the database clock (#2576) -
20270411000000_overpayment_claim_period.sql— the canonical stamp (crates/canopy-overpayments/migrations/canonical_claim_period.sql):overpayment_claims.period_first_month/period_last_month, nullable, withoverpayment_claims_period_whole_months(#3567) -
20270204000000_fti_tax_data_l7_items.sql— #2236:fti_tax_datadropsfiling_statusandadjusted_gross_income, which no IRC 6103(l)(7) clause discloses to a TANF agency -
20270209000000_decision_stamps_no_default.sql— drops the defaults of every stamp the service’s production INSERTs bind themselves:tanf_applications.received_at/created_at/updated_at,tanf_income.created_at,tanf_work_requirements.created_at/updated_at,tanf_work_activities.created_at,tanf_determinations.determined_at/created_at,determination_snapshots.created_atandtanf_work_standard_bases.created_at. An insert that names no stamp now fails instead of taking the database clock, andcargo xtask migrations-lintrefuses a new clock default (#2589) -
20270215000000_determination_verdicts.sql— thedetermination_verdictstable and itsverdictCHECK (#2322) -
20270218000000_tanf_determination_au_members.sql—tanf_determination_au_membersandtanf_determination_au_parents, their CHECKs and keys (#3048) -
20270220000000_tanf_determinations_operation.sql—tanf_determinations.operation_idandsigned_payload,tanf_determinations_operation_signed_ckandtanf_determinations_operation_uq(#3116) -
20270324000000_determination_status_withheld.sql— ADR-052: replacestanf_determinations_status_verdictso the list also admitswithheld; no row is rewritten. -
20270325000000_supplemental_payments.sql— renamestanf_grg_paymentstotanf_supplemental_payments, its columnsgrandparent_person_id,grandchild_person_idandau_sizetopayee_person_id,on_behalf_of_person_idandunit_size, and its two indexes (#3508); no row is rewritten. -
20260905000000_create_scheduler_runs.sql—scheduler_runs, a byte-identical copy ofcrates/canopy-db/scheduler-migrations/(#3518) -
20270326000000_counted_months.sql— renamestanf_time_limits.months_usedtoopening_monthsand dropslast_counted_month; createstanf_counted_months,tanf_count_exclusions(withidx_tanf_count_exclusions_person) andtanf_accrual_months; addstanf_determinations.federally_funded(#3518) -
20270327000000_au_member_counted_toward.sql—tanf_determination_au_members.counted_toward(#3519) -
20270328000000_drop_state_limit_months.sql— dropstanf_time_limits.state_limit_months(#3520)
The eight generated files are byte-identical copies of crates/canopy-mq/outbox-migrations/ (the data-models index). All migrations are forward-only per ADR-016.