Data Model: Case Management

Overview

The case management service tracks the full lifecycle from hotline referral through case closure.

Closed cases are read-only below the case row (#1631). Every case-parented write — household add, contact create/update/delete, plan create/update/approve, task create/update/delete, court order create/update/delete, contact-attachment delete, both upload routes (refused before an attempt is born; an attempt that outlives the closure fails terminally as target_gone through the attempt machine), IV-E determination, and the record and close acts of the P-C case-route ledgers (the child-fact ledgers, ICWA, parental-rights actions, permanency plans and review events), and the legal-status acts that open, change or close a custody episode (an until record included) — passes ONE store choke point, require_case_open, inside its own transaction: the case row is locked FOR UPDATE and the write refuses with a typed 409 case-closed unless the case is open (closed and transferred both refuse). Holding the row lock for the rest of the write makes the gate race-free against a concurrent closure, and the refusal rolls the whole transaction back — the ADR-062 claim included, so a retried client_request_id is not burned. The case row’s OWN edits are not gated here (reopening is refused separately as INVALID_STATE_TRANSITION); inbox/worker writes and screening-review assignment stay allowed on closed cases. The one deliberate exception on a case-parented table: a P-C case-route ledger’s CORRECTION and RETRACTION are admitted on a closed or transferred case (they amend the record of what was true, not the case’s lifecycle — The child-fact ledgers and the sibling ledger (#1992, ADR-078)). The legal-status ledger widens it by two acts that open nothing: a history row (a not-in-custody status naming no episode) and the custody-episode retract also pass on a closed or transferred case (#2342, Custody episodes and the legal-status ledger (#2342, ADR-081, plan custody-episodes-doe-slds D2 + D3)). The reverse also holds: a case cannot become closed or transferred while one of its custody episodes is open (409 custody-open, a database trigger).

The placement-facts read (#2029). The placement-facts projection (GET /v1/cases/cases/{case_id}/children/{child_id}/placement-facts, ADR-073) refuses a closed or transferred case with the same typed 409 case-closed. It is decided after the acting worker’s case: read check (a refused caller still reads 403 and learns nothing of the status) and before the one-clock rule, membership, the date of birth and the ICWA consult. The check takes no lock (refuse_unless_open): the read has no write to lock, and craig-placement holds no case lock, so a case can close between the read and placement’s commit. craig-placement relays the 409 unchanged on every route that reads the projection.

Recorders name the acting worker (#2214). No craig-cases write records the request token’s own sub / preferred_username: under a BFF-lifted token that token is craig-web’s service principal, so a staff write names claims.acting_worker() (ADR-028, ADR-062), the lifted worker, or the token’s own subject when nothing is lifted. That covers the contact, case-plan (create and approval), referral (conversion), follow-up, safety-assessment and report-person-link recorder columns, and the case.plan_approved approved_by and the case.report_converted / report-person link user_id event payload keys (user_id since #2211; was converted_by / linked_by / unlinked_by). Each name column is the acting worker’s username. A caller-named subject (a case’s or an investigation’s assigned worker, a case supervisor) is named only when it IS the acting worker, else NULL (#1366; the investigation open since #2320). Writes that record a relayed or copied actor (craig-exchange’s body.requested_by, an upload attempt’s created_by) and the system auto-link (linked_by NULL) are unchanged. Since #2522 the Claims fields are private and crates/craig-test-lib/tests/acting_identity_census.rs pins it: the token’s own identity is read only through a bearer() accessor, each such read under services/craig-cases/src is pinned with its reason, and a recorded worker is claims.worker_subject(), which reads the claims.acting_worker() view, never the bare claims (after #2016, #2031 and #2231; #2740 removed parse_sub / parse_actor_sub).

Lock order: persons before cases (#1680). Two row-lock families meet in this schema — the person row (lock_person, FOR NO KEY UPDATE; every UPDATE persons takes the same strength, since the table has no unique index beyond its primary key) and the case row (require_case_open, lock_case_for_screening, and the two sorted ORDER BY id FOR UPDATE fan-outs). A writer that needs both takes the PERSON first: update_person, the SSN clear, the two link-time SSN promotions (report-person link, SSN promotion), and the SSA outcome transaction (person lock at its step 2, before the fact inserts and the review-item fan-out). Writers that hold a case row and then INSERT a person-referencing row (household add, IV-E child verdicts) take only an FK KEY SHARE on the person, which FOR NO KEY UPDATE does not exclude — they never wait on a person writer, so the person writer’s later case lock cannot close a cycle. SELECT … FROM persons … FOR UPDATE is therefore forbidden in service code (a KEY SHARE parks behind it and the fan-out deadlocks: 40P01, the victim a 500). Columns with REFERENCES persons(id): allegations.victim_id/perpetrator_id, case_household.person_id, report_persons.person_id, ssa_benefit_facts.person_id, ssa_screening_outcomes.person_id, ive_determination_children.person_id, screening_decision_evaluations.person_id, person_demographic_facts.person_id, the five child_*_facts.person_id, person_siblings.person_a / person_b, person_parentage_facts.person_id, child_parents.person_id / parent_person_id, parental_rights_actions.person_id / parent_person_id, permanency_plans.person_id, child_review_events.person_id, contact_revisions.visited_child_id, and contacts.visited_child_id.

Its 42 domain tables (source of truth: services/craig-cases/migrations/) organize around the intake-to-permanency workflow: persons, reports and screening, referrals, investigations, cases, plans, contacts, and court orders, plus the encryption-lineage anchors.

The fleet-standard platform tables also live in this schema and are documented centrally: event_outbox / event_inbox / event_inbox_collisions (ADR-022 and the ADR-062 §A attempt machine), request_claims (ADR-062 §B), and schema_compat_floor (ADR-063). A claim’s actor is the ADR-085 D3 column pair (#2740): request_claims.created_by_sub holds a worker’s UUID and created_by_sub_service a service’s service:<name> encoding, with a CHECK that exactly one is set.

Tables

Table Purpose

reports

The public-report lifecycle rows relocated from craig-intake (ADR-017 Step 3) — the stateless edge forwards here; screened via screening_decisions, converted into referrals. report_source (#648) is the NCANDS Child File #10 RptSrc report source captured at intake on every channel — REQUIRED, plaintext, one of the 15 codebook tokens (chk_reports_report_source: social_services_personnel … anonymous_reporter, other, unknown), distinct from reporter_type (the reporter’s STATUS); copied verbatim onto referrals.report_source at conversion. Since #1745 also the staff (phone) intake path: created_by (the acting worker’s sub when a human posted; NULL on the edge / partner path) and received_at_attested (TRUE when received_at is the caller’s attested actual receipt) — see § Response priority below. received_request_hash is the ADR-062 LIFETIME intent digest (v1:<64 hex>, kept for the row’s life; NULL on seeder rows): since #2375 its preimage carries the seven encrypted columns (reporter name and phone, narrative, children, adults, raw_submission) only as ONE keyed HMAC (ReportIntent, domain report_intent_pii), the plaintext they hold on a keyless dev stack. Migration 20261019120000_report_digest_keyed (-- devstack: wipe-before-apply) refuses to apply while any report carries a digest (a V3 digest is neither kept nor re-keyed; seeded rows carry none) and bumps schema_compat_floor LAST, so an N-1 craig-cases refuses to boot against it; rollback is N-1 images AND a database restore. Since #2209 also reporter_anonymous (the reporter chose to report anonymously): record views omit such a reporter’s contact details; only the audited reveal returns them — see the reports.reporter_anonymous paragraph below

screening_decisions

Report screening decisions (single-parent supersession chains; the effective leaf drives convert — #767 write-side prevention); since #1746 also attested_response_priority, the supervisor-attested response-priority token the roll-up arm may count

screening_decision_evaluations

One row per subject a screening decision’s rules consult evaluated (#1672): a child row per flagged victim child — or per listed child when none is flagged (child_is_victim = false) — or ONE report row for a report listing no children; the evidence sent, the rules-side evaluation_id and the neutral outputs (§ Screening decisions and their evaluations below)

disposition_follow_ups

Report disposition follow-ups (the ADR-017 Step 3 trio’s third table): caseworker actions attached to non-terminal dispositions (screened-out-and-referred, I&R)

report_persons

ADR-019 report-entry ↔ person links — evidence-grade rows recording each deliberate link (auto-link at convert or worker confirmation) between reports.children/adults JSONB entries and persons; rejections write no row

report_attachments

Supporting documents for reports (mirrors contact_attachments: soft-delete, uploader provenance, object-store keys; moved from craig-intake per ADR-018 Step 3). uploaded_by holds the upload attempt’s claimant in the ADR-085 D3 actor encoding (#2740): a worker’s UUID, or service:<name> for a service such as craig-intake

jws_seen_jti

Mandated-reporter JWS replay-defense ledger (Plan C F-005): seen jti values with TTL pruning — lives here, not in the stateless intake edge

crypto_key_lineage

ADR-048 §D3 key↔data lineage anchor (singleton: KCV + canary + envelope_version — 2 since #1007, the canary encrypted under the fixed CANARY_CONTEXT) — what the cases boot verify checks the mounted field key against (scheme → KCV → canary), and what verify-seed --expect keyed reads as the format fact; written only by the seeder — runtime INSERT / UPDATE / DELETE / TRUNCATE revoked from every non-owner grantee by the migrate gate on every successful verdict (#2337; #1961’s migration REVOKE names only the devstack role); SELECT kept: the boot verify reads it

crypto_field_lineage

#1025/#1395 per-field scheme lineage — the authoritative record of which at-rest scheme each allowlisted field’s data was written under; insert/equal-only, written by the migrate gate’s post_apply seam; since #1399 U1 a live crypto_field_rewrites row makes the serving boot, the gate’s pre_apply and every non-owner persons write refuse; the craig-cases rewrite-scheme mode (U2b) becomes its second, UPDATE-by-CAS writer

crypto_field_rewrites

#1399 U1 field-scheme rewrite ledger — the durable provenance of every rewrite-scheme run and the fence every phase refuses on: one live row per field (partial UNIQUE on (table_name, column_name) while status is running / verifying; terminal states completed / aborted, no failed), from_spec → to_spec, cursor, key_kcv, tool_version, db_user DEFAULT current_user, last_error, and rows_mutated the ONE monotonic counter of scheme-changing writes (aborted is legal only while it is 0); the scheme_rewrite_fence() BEFORE INSERT OR UPDATE … FOR EACH STATEMENT trigger on persons reads it and refuses every writer whose current_user is not the live row’s db_user (SQLSTATE 55000); runtime DML (INSERT / UPDATE / DELETE / TRUNCATE) revoked from every non-owner grantee by the migrate gate on every successful verdict (#2337), SELECT kept so the trigger reads it as the caller; a missing table reads as an empty history (42P01) — the gate that applies U1 itself must not refuse

persons

Shared person registry — children, parents, reporters, perpetrators. Read surface (#1847, ADR-076): the service-only batched display-name projection (POST /v1/cases/persons/display-names, ≤ 50 ids → first name + last initial only, craig-placement’s scoped display_name row; a worker bearer, direct or relayed through X-Craig-Actor, is refused 403 before the engine, #2339); names are plaintext (ADR-041), so the boot-verified walk decrypts nothing on this arm. Identity (P-C U1a, #1990): sex (male | female, CHECK chk_persons_sex; AFCARS element #8), dob_estimated_abandoned (BOOLEAN NOT NULL DEFAULT false — the date of birth is an estimate because the child was abandoned) and year_of_birth_declared (SMALLINT NULL, 1850–2100, CHECK: NULL whenever date_of_birth is set — the DB twin of the typed 400 YEAR_OF_BIRTH_WITH_DATE; an update that sets a date clears it). birth_year stays server-derived and off the wire (ADR-041 §2); a parent’s or a caregiver’s federal value is a year: birth_year, else year_of_birth_declared (an update that omits dob_estimated_abandoned keeps it; false lowers it). The bulk POST /v1/cases/persons/federal-export was removed in U1a. Three service-only reads emit a decrypted date_of_birth: the NCANDS collection (GET /v1/cases/ncands-export, each victim’s — the ChAge source), the craig-exchange outbound-principals projection (the …/outbound-principals routes, ADR-075) and, since #2121, the AFCARS persons export (POST /v1/cases/persons/afcars-export, craig-reporting only: the child’s on a child key whose person is a child member of the key’s case, an adoptive parent’s on an adoptive_parent key; a caregiver key answers birth_year, else year_of_birth_declared; every page that releases a person stages case.person_pii_exported with purpose = afcars-2020 federal reporting). Demographics (P-C U1b, #1991): race, ethnicity and tribal_affiliation are no longer persons columns — migration 20260922150000_person_demographic_facts drops them (DESTRUCTIVE, schema_compat_floor bumped, refuses to run over any populated value) and the facts live on the demographics ledger. The person create, get and PUT respond PersonResponse: the person columns plus the five demographic keys of the current ledger row (each null when there is no current row) for a human principal, and NO demographic key at all for a service principal. A create or PUT body carrying a non-null race, ethnicity or tribal_affiliation is the typed 400 demographics-via-ledger (field = the first such key; the detail names POST /v1/cases/persons/{id}/demographics). ICWA (P-C U3, #1993): icwa_eligible is dropped too (migration 20260923140000_child_icwa_facts, DESTRUCTIVE, refusing any true row) — the facts live on the ICWA ledger. Registration facts (#3192): middle_name, name_suffix, birth_city, birth_state (an upper-case USPS abbreviation, CHECK chk_persons_birth_state), primary_language and marital_status (the craig_reference Language and MaritalStatus tokens, each under a CHECK) are the facts a person index asks for when a person is registered. All are plaintext and nullable; PUT /v1/cases/persons/{id} keeps a fact the body does not name, clears one it names null, and sets one it gives a value. dob_verification (a DobVerification token) says how the date of birth on file was verified, with dob_verified_at and dob_verified_by recorded by the server when it is first said or changes; the three are NULL together (CHECK persons_dob_verification_audit_complete), never set without a date of birth (CHECK chk_persons_dob_verification_needs_dob; the route answers 409 dob-verification-without-date), and cleared in the same statement when the date of birth changes.

person_identifiers

A person’s external identifiers (#1806, plan custody-episodes-doe-slds D5) — one row per identifier under a StateBundle kind (GA: gtid, empi): value CGEF-encrypted beside its BlindIndex digest value_hmac, an effective window never after today, a provenance saying whether a worker typed the value or the jurisdiction’s person index returned it (#3192); at most one live row per person and kind and per kind and value — see § Person identifiers below

person_index_inquiries

One conversation with the jurisdiction’s person index per person (#3192), kept for fifteen minutes: the case and worker it was opened by, what the jurisdiction’s rules allowed for the index’s answer, and whether a registration or a selection was begun from it. No value a candidate carried is stored — see The person-index conversation (#3192)

person_index_inquiry_candidates

The candidates of one inquiry as a keyed digest of each id (the person_identifiers blind index of the value) and its score (#3192); the id itself, and everything else the index said of a candidate, is stored nowhere

person_demographic_facts

The demographics ledger (P-C U1b, #1991, ADR-078 D1) — one row per window of a person’s five demographic facts (the eight race answers, ethnicity, the two tribal-membership answers, tribal affiliation) with the correction model’s provenance columns; a row is never deleted, and its only admitted updates are a CLOSE (an open row gains effective_until + closed_at + closed_by) or a RETIRE (the retired_* columns, retired_by included, set once). Written only through the four acts under /v1/cases/persons/{id}/demographics; see The demographics ledger and the ledger correction model (#1991, ADR-078).

person_residences

Where a person lives (#3192): one row per window of the administrative unit (in Georgia, the county) a person lives in, under the same correction model and guards as the demographics ledger. A move is a CLOSE of the open row and a new statement. Written only through the four acts under /v1/cases/persons/{id}/residences; see The residence ledger (#3192).

person_siblings

The sibling ledger (P-C U2, #1992, ADR-078 D1) — one row per window of a sibling link between two persons, stored as the ordered pair (person_a, person_b) with person_a < person_b (the pair is the row’s identity; a wrong pair is retracted and re-recorded, never corrected); no domain columns beyond the link itself. The same never-deleted, CLOSE-or-RETIRE-only rows as the demographics ledger. Written only through the four acts under /v1/cases/persons/{id}/siblings, where the path person may be on either side; see The child-fact ledgers and the sibling ledger (#1992, ADR-078).

person_parentage_facts

The parentage ledger (P-C U4, #1994, ADR-078 D1) — one row per window of a child’s two (c)(1) / (c)(2) indicators: parents_abandoned (required — the parents' identity is unknown) and the assessed sole_legal_parent (null = not assessed). The same never-deleted, CLOSE-or-RETIRE-only rows as the demographics ledger. Written only through the four acts under /v1/cases/persons/{id}/parentage; see The parent ledgers and parental rights (#1994, ADR-078 D1, plan D5).

child_parents

The parent-link ledger (P-C U4, #1994, ADR-078 D1) — one row per window of a directed link from a child (person_id) to a parent (parent_person_id, never the child itself) with the parent’s role (mother | father | legal_guardian | putative_parent) and legal_responsibility (null = unanswered; never true for a putative parent); at most one open live link per (child, parent). The same never-deleted, CLOSE-or-RETIRE-only rows. The (c)(1)–(c)(5) parent set, written only through the four acts under /v1/cases/persons/{child_id}/parents; see The parent ledgers and parental rights (#1994, ADR-078 D1, plan D5).

referrals

Hotline intakes — born ONLY by converting a screened report (#1746); the DERIVED response_priority token with its all-or-none provenance, screened-in flag, county assignment. report_source (#648) is the NCANDS #10 RptSrc token copied verbatim from the originating report at conversion (the direct-create capture is gone with that route — #895 MR-D / #1746; chk_referrals_report_source, the same 15 tokens); the NCANDS export reads #10 from here

allegations

Specific abuse/neglect allegations linked to a referral, victim, and perpetrator. disposition is one of the seven NCANDS Child File outcome tokens (substantiated, indicated, alternative_response_victim, alternative_response_nonvictim, unsubstantiated, unsubstantiated_false_report, closed_no_finding — chk_allegations_disposition, #648) or NULL = not yet determined

investigations

Field investigations opened from screened-in referrals; response_due_at is DERIVED at open (#1747) with its window provenance, the audited-override columns (#1748) beside it, and every read served through v_investigations (the read-time response_timeliness band). admin_unit (#1901, ADR-077 D6) is the originating referral’s county, stamped at open and backfilled — the unit-scope stamp (see Administrative-unit stamp and the canonical-name belt (#1901, ADR-077)). disposition shares the allegation vocabulary (chk_investigations_disposition, #648) and is NOT NULL once the investigation is closed (investigations_closed_has_disposition, #1764). The NCANDS report disposition (#11 RptDisp) is derived REFERRAL-wide by craig-reporting over every recorded allegation + investigation disposition of the referral — no cases column holds it (Data Model: Reporting & Data Quality)

safety_assessments

Structured safety decisions produced by the rules engine during investigation. Each row holds the facts the worker attested (facts, one answer per fact the jurisdiction’s safety ruleset declares; never an empty map), the ruleset row and revision they were answered against and evaluated by (rule_set_id, rule_set_revision), craig-rules' evaluation id (evaluation_id), the engine’s safety_decision and any worker override with its required reason. Migration 20261116120000_safety_assessment_facts (#3104, schema_compat_floor bumped) deleted every earlier row and the request claims of the act: the two documents it dropped (threats, protective_capacities) held none of the declared facts, so no row could be carried over (Rule Set Patterns § metadata.safety)

cases

Ongoing case management records opened after substantiated investigation. idx_cases_created_at (#3170) serves the case list’s default sort (ORDER BY created_at DESC LIMIT n) in index order, so a page’s cost does not grow with the table. closure_reason says why a closed case closed, one token of craig-reference’s ClosureReason, held by the CHECK chk_cases_closure_reason: reunification, adoption, guardianship, emancipation, transfer, aging_out, death, each of which describes a child who was in care or a case that moved elsewhere; and services_completed (#3250), for a case that ends with the family’s services ended and no child removed. Nothing checks the reason against the case’s history, and a close that states no reason is accepted (craig-reporting then raises a data-quality issue for the event).

case_household

Household composition — persons linked to a case with role and caregiver flag. At most one ACTIVE row per (case_id, person_id) (#1831): the partial unique index case_household_one_active_membership (WHERE active) refuses a second active membership, and POST /v1/cases/cases/{id}/household answers it as the typed 409 household-member-exists naming the person and the case (the ADR-062 claim rolls back; a same-key replay still answers 200). An ended row (active = false) is outside the key and does not block a later add; the role is not in the key. GET /v1/cases/cases/{id}/household lists ACTIVE rows; ?include_inactive=true lists every row, an ended one with active = false, under the same case-Read authority (#2002). The case page reads it with the flag: its Federal facts tab lists each child-role person once, an ended membership with the Membership ended badge, and its Household tab shows an ended row as not active. The BLOCKING case_household_member_unique invariant reports any pair with more than one active row. Migration 20261010120000_case_household_one_active_membership (-- devstack: wipe-before-apply) refuses to apply while any (case_id, person_id) holds more than one active row — it never chooses which row is the membership — and otherwise builds the index under a SHARE lock; additive, no floor bump. Ending a membership (#2460). POST /v1/cases/cases/{case_id}/household/{member_id}/end records that a person left the household: it sets active = false and ended_on, the business date the worker states. The CHECK case_household_ended_iff_inactive holds the two columns together, so a row is active exactly when it has no end date. The act takes the authority of the add (Update on the case), an ADR-062 claim, and the closed-case gate: a closed or transferred case answers the typed 409 case-closed. ended_on lies between the day the member was added and today, both on the jurisdiction’s business calendar (400 ledger-window-invalid before the first, 400 ledger-date-after-today after the second), so a member added today can be ended today. An already-ended row answers the typed 409 household-member-ended, and a membership that is not a row of the case in the path is a not-found (404). The row is read under a lock, so of two concurrent ends one wins and the other gets that conflict. The row stays as history and the person can be added again. Migration 20261125120000_case_household_ended_on (-- devstack: wipe-before-apply) adds the column and the CHECK; it refuses to apply while any row is inactive, since it cannot know the day that membership ended, and chooses no date; additive, no floor bump. SSA-screening note (#1466 B5 + #1467 B6b, ADR-065 § Amendment #1479 D16): every runtime mutation that changes what a screening cohort would contain bumps cases.screening_cohort_revision through the ONE screening_revision seam — household add (P1), update_person digest transitions incl. the keyless fallback arm (P2), clear_ssn (P3), manual-link promotion (P4), §G4 auto-link promotion (P5) — and the seam stages the case.screening_cohort_changed event in the same tx (#1467 B6b), so a bump and its event can never disagree. The add also stages its own act record, case.household_member_added { id, case_id, user_id } (#2322), beside the P1 case.screening_cohort_changed: id is this row and user_id the acting worker, since the cohort signal names no actor. The end bumps through the same seam and stages case.household_member_ended { id, case_id, ended_on, user_id } beside it (#2460). P8 contract (pinned here, deliberately not as dead code): no surface merges persons today; whoever builds it MUST bump through the same seam — an unbumped merge would leave a stale screening run witnessing a cohort that no longer exists. Ending a household membership (P7) is built and bumps (#2460).

child_parenting_facts

A child-fact ledger (P-C U2, #1992, ADR-078 D1), keyed (person_id, case_id): one row per window of a child’s parenting facts in one case — pregnant, has fathered or borne a child, placed together with that child (AFCARS (b)(13)). Written only through the four acts under /v1/cases/cases/{case_id}/children/{child_id}/parenting-facts, for a person who is or was a child-role case_household member of that case; see The child-fact ledgers and the sibling ledger (#1992, ADR-078).

child_prior_permanency_facts

A child-fact ledger (P-C U2, #1992), keyed (person_id, case_id): the child’s prior finalized adoption and prior legal guardianship — each answer, its month, and whether the adoption was intercountry (AFCARS (b)(15), (b)(16)). Route segment prior-permanency-facts; see The child-fact ledgers and the sibling ledger (#1992, ADR-078).

child_assistance_facts

A child-fact ledger (P-C U2, #1992), keyed (person_id, case_id): whether the child has received financial and medical assistance and, when it has, each of the eight sources (AFCARS (b)(17)). Route segment assistance-facts; see The child-fact ledgers and the sibling ledger (#1992, ADR-078).

child_sibling_facts

A child-fact ledger (P-C U2, #1992), keyed (person_id, case_id): the child’s total number of siblings, 0–999 (AFCARS (b)(19)). Route segment sibling-facts; see The child-fact ledgers and the sibling ledger (#1992, ADR-078).

child_icwa_facts

A child-fact ledger (P-C U3, #1993, ADR-078 D3), keyed (person_id, case_id): the child’s ICWA facts in one case at the 2028 superset — the inquiries made and of whom, reason to know (and its discovery date), whether ICWA applies (and the notice date), the tribe and parent / Indian-custodian notices, the court’s ICWA determination (date, tribe) and active efforts, and the Tribe’s two orders of preference (foster care or pre-adoptive; adoptive) (AFCARS 2022 (b)(3), (b)(5), (b)(6); 2028 (b)(3)–(b)(6), (i)(9); 2028 (i)(5)(v), (i)(10)(iv)). Route segment icwa-facts; its CURRENT row decides placement-facts' icwa_person through the federal ruleset federal-icwa-status; see The ICWA ledger (#1993, ADR-078 D3, ADR-073 § Amendment).

parental_rights_actions

The parental-rights ledger (P-C U4, #1994, ADR-078 D1 / plan D5) — the first EVENT ledger, keyed (person_id, case_id, parent_person_id): one row per (c)(5) action on a parent’s rights to a child within one case (a voluntary / involuntary termination, or the assessed not_applicable) with its petition / termination / death dates, the termination court order and the six 2028 (i)(2) / (i)(3) ICWA findings. No window: a row is never deleted and its only admitted update is a RETIRE. Written only through the three event acts under /v1/cases/cases/{case_id}/children/{child_id}/parental-rights-actions; see The parent ledgers and parental rights (#1994, ADR-078 D1, plan D5).

permanency_plans

The permanency-plan ledger (P-C U5, #1995, ADR-078 D1 / plan D6) — an EVENT ledger keyed (person_id, case_id): one row per plan a child held in one case (plan over the seven PermanencyGoal tokens, established_on REQUIRED — AFCARS 2022 (f)(1) / (f)(2)). CURRENT is the latest by (established_on, recorded_at, id); an empty ledger means no plan is established. Written only through the three event acts under /v1/cases/cases/{case_id}/children/{child_id}/permanency-plans; every act publishes case.permanency_plan_established; craig-financial’s guardianship activation reads the plan in force through the one service read, …/permanency-plans/current (U6a, #1996); see The permanency ledgers (#1995, ADR-078 D1, plan D6).

child_review_events

The review-event ledger (P-C U5, #1995, ADR-078 D1 / plan D6) — an EVENT ledger keyed (person_id, case_id): one row per periodic review or permanency hearing a child had (kind, held_on REQUIRED — AFCARS 2022 (f)(3) / (f)(4)). A hearing court order writes one row per named child (court_order_id set — provenance, never on the wire); the administrative route /v1/cases/cases/{case_id}/children/{child_id}/review-events writes rows without one. See The permanency ledgers (#1995, ADR-078 D1, plan D6).

custody_episodes

A child’s custody episode (#2342, ADR-081 D2): one in-custody run, owned by one case for life, with custody_from / custody_until (DATE, inclusive) the CURRENT instants its live legal_status_facts rows derive (a deferred trigger holds them). Live windows of one child never overlap, in any case (excl_custody_episodes_child_window). Insert-only but for the instants of a live episode and a RETIRE; written only through the legal-status acts; see Custody episodes and the legal-status ledger (#2342, ADR-081, plan custody-episodes-doe-slds D2 + D3).

legal_status_facts

The legal-status ledger (#2342, ADR-081 D2, ADR-078 D1) — an EVENT ledger keyed (person_id, case_id): one row per legal status a child held in one case (status_token from the active StateBundle vocabulary, custody_class stamped at write, effective_on). An in-custody row and a closing row name their episode; a not-in-custody row naming none is history. Written only through the acts under /v1/cases/cases/{case_id}/children/{child_id}/legal-statuses; see Custody episodes and the legal-status ledger (#2342, ADR-081, plan custody-episodes-doe-slds D2 + D3).

case_plans

Case plans: strengths/needs assessment, approval tracking and tasks. The per-child permanency plan lives on permanency_plans (the per-case permanency_goal column was dropped by #1995)

case_plan_tasks

Action items within a case plan assigned to workers or families

contacts

Visitation and contact logs with narrative documentation. A home, office or school visit may name the child visited and where (visited_child_id + location, both or neither — AFCARS 2022 (f)(5) / (f)(6), #1995); see The permanency ledgers (#1995, ADR-078 D1, plan D6)

contact_revisions

A contact’s prior visit trio, one row per update that changed it, naming the acting worker whose update superseded it (superseded_by, #2231), insert-only (#2131 D5); see The AFCARS persons export (P-D1, #2121, #2122)

contact_attachments

Files attached to contacts — stored in object storage, metadata in DB

court_orders

Legal orders with findings, hearing dates, and uploaded documents. A review_hearing / permanency_hearing order carries a hearing block that writes one child_review_events row per named child in the order’s transaction; an update restating the hearing, or leaving the hearing types, and a delete retire those rows (#1995, The permanency ledgers (#1995, ADR-078 D1, plan D6))

ssa_benefit_facts

SSA benefit assertions (#1466 B5-U2, ADR-065 §D4 — provenance class, INSERT-only, indefinite-hold pending DFCS). The source token solq is a kept name (what it means now, #3176). Row-per-benefit pointer-forward supersession chain: exactly-one-current per (person × kind × source × beneficiary_role) is STRUCTURAL (one chain root + at most one successor per row — partial uniques, never a status column); corrections/terminations/re-grants are successor rows. Termination by absence (#3175): a screened answer lists the person’s whole set of active benefits for its screened_month (Gateway lists only active rows), so the outcome transaction gives every active head the answer leaves out a terminated successor dated that month, under the answering member. Keyed by SsnDigest provenance pointers, never by SSN. Read surface: the D4 (#1549) case-scoped DTOs only — the store row is deliberately not Serialize (ADR-065 §D3).

ssa_screening_outcomes

One row per screened member (#1466 B5-U2 — the D20 projection): outcome category (member_outcome: screened | no_gateway_record; #3175 renamed no_match, rows migrated, then retired unmappable, deleting its fact-less rows) + fact_ids (the entries' facts, then any terminations by absence; empty unless screened), the replay truth post-prune redeliveries re-derive from (claims store no response bodies). Insert-only, provenance class, no digests. Served via the D4 (#1549) household-scoped outcome list.

ive_determinations

#1557 (D3, ADR-066 §D7): the IV-E determination ACT of record — the fleet’s first persisted eligibility determination. Since hard-checks U6 (#1313) the act row carries NO verdict: the ruleset identity rule_set_id / rule_set_revision with its rule_set_name. Each act has one identity. Since #1719 the act is bound to the surface identity the worker was shown, and a promotion before or during the fan-out is a 409 ive-policy-moved that records nothing. rule_set_id is a nullable UUID, NULL on rows written before #1719. The worker-ATTESTED documents are split by each input’s declared scope (metadata.ive) into case_inputs (case-scoped inputs) and child_inputs (child-scoped inputs, keyed by person id; provenance-labeled). A blank answer is an absent key. The act also carries the witness block (run, as-of, cohort revision, the byte-verified cohort_hash, consulted fact_ids, the server-derived evidence token). Written only by the assembly endpoint’s claimed tx. #1313 U5: determination_revision — the case-scoped monotonic ordering key, allocated from cases.ive_determination_revision UNDER the case row lock in the act tx, the CAS comparand every event consumer applies verdicts with. Keep-forever-hot audit class. Pre-U6 dev rows were dropped by the U6 migration (pre-1.0: no backfill, no mixed-mode precedence — a single verdict cannot be honestly fanned out after the fact).

ive_determination_children

#1313 U6: the role-bearing WITNESSED SNAPSHOT — one row per child the act determined: person_id, role_at_act (child), child_age (whole years at the business date, SERVER-derived from the person’s DOB — never worker-typed), evaluation_id (this child’s rules-side audit row), and the denormalized verdict (eligible, determination, deprivation_basis, funding_source, ffp_rate — U-FMAP: bundle fraction when eligible, 0.00 when not). UNIQUE (determination_id, person_id); ON DELETE CASCADE from the act. The read path and the per-child eligibility.evaluated events fan out from THIS table only — never from a fresh household query (the cohort hash covers person + SSN digest, not roles).

screening_review_worklist

#1557 (UD5): notify-never-re-evaluate — ONE open item per case (partial unique WHERE not dismissed; the #1172 standing-alert ON CONFLICT bump), opened post-determination only, by same-tx writers serialized on the case row lock: the outcome fan-out (facts_recorded, and no_gateway_record when Gateway held no record for a household member), the cohort seam (cohort_changed), the run-invalidation consumer (run_invalidated), and the determination itself (no_gateway_record, when its witness run holds such a member; #3175). latest_reason is CHECKed to those four tokens. Dismissal records who/when/why in-row AND stages case.screening_review_dismissed.

screening_run_invalidations

#1557: the cases-local run-invalidation marker (per-run, first-write-wins), written by the widened inbox consumer’s claim tx; the determination tx’s in-tx witness re-check consults it — delivered invalidations refuse, undelivered ones surface via the worklist on eventual delivery.

upload_attempts

ADR-062 §U upload-attempt tombstones (SU2 #1248): one immutable row per client upload operation, id = the client-held request id; generation-fenced CAS state machine + replay decision table live in craig-store::attempts (shared crates); kinds here: contact_attachment / report_attachment / court_order_document (the replace kind — court_orders.current_attempt_id is its fenced pointer, ordered by its own (current_attempt_created_at, current_attempt_id), never by the prunable attempt row (#2173)). 31 d terminal retention (reconciler-pruned); no FK — target_id is polymorphic by design. The claimant is the ADR-085 D3 column pair (#2740): created_by holds a worker’s UUID and created_by_service a service’s service:<name> encoding, with a CHECK that exactly one is set.

Screening decisions and their evaluations (#1672)

screening_decisions carries, beside the eight legacy columns, seven NOT NULL provenance columns, written together by the act: rule_set_name / rule_set_revision / rule_set_version (the {j}-intake-screening revision the act consulted — pinned by the surface read, never by the evaluate response), attested_facts (the worker’s bounded fact map, verbatim), screening_context (the server-derived report-level facts as sent to rules: allegation_type + its source, is_initial_decision, the prior’s disposition and role, the proposed disposition, the derived actor_role — tokens and booleans only, never report text), disposition_admissible and admissibility_basis (the admissibility conjunction over the decision’s evaluations and the basis that decided it). #1672 added them nullable under the all-or-none CHECK screening_decision_provenance_all_or_none, so an N−1 replica’s eight-column INSERT kept working through the rollout. The contract migration 20261106120000_screening_decision_provenance_contract (#1695, schema_compat_floor bumped) made them NOT NULL and dropped the CHECK. The API’s ScreeningDecision and EffectiveDisposition bodies carry all seven as required, non-null fields (#2962). A database still holding a NULL-provenance row refuses that migration and names the column: no consult is invented and no decision is deleted (its id is held by referrals.authorizing_decision_id, disposition_follow_ups.decision_id and supersedes_id). Before 1.0 only dev and test databases hold such rows, and cargo xtask dev reseed is the remedy. The contract migration 20261104120000_screening_actor_role_contract (#1697, schema_compat_floor bumped) rewrote the legacy actor_role tokens those rows carried to the mapping tokens: cicc and caseworker → cicc_intake, county_supervisor → county_director.

screening_decision_evaluations snapshots one row per evaluated subject: a child row per flagged victim child, or per listed child when the report flags none (child_is_victim = false, so a binding row can hold on it) — jsonb_index = the slot in the report’s children array, never negative; the unique index keys the report row on the -1 sentinel — or ONE report row for a report listing no children. Each carries the evidence the document sent — person_id (the ONE linked person, NULL when none or when two persons link to the slot), child_age, age_source (linked_person_dob / report_dob / report_age / linked_ambiguous / absent / unparseable / future / implausible; a CHECK mirrors the enum), child_is_victim — the rules-side evaluation_id (a pointer into craig_rules.rule_evaluations, no FK across databases), the neutral outputs (screening_decision, referral_type, disposition_admissible) and jurisdiction_outputs (the ruleset’s REQUIRED non-neutral, non-basis outputs — tokens and booleans only; the bases, free text and numbers stay on the rules-side single copy, ADR-058 / #1130). person_id … ON DELETE SET NULL: the evidence outlives the pointer. v_effective_disposition selects the seven provenance columns after the legacy nine.

Two requests with the same client_request_id that both pass the unlocked ADR-062 precheck both consult rules; claim_first admits exactly one and the other replays the committed row. The loser’s evaluation set stays on the rules side as an orphan — joinable by context_type = 'screening-decision', context_id = report_id; a refused act (400 / 403 / 409 / 422 / 500 / 503) likewise leaves rules-side rows and NO cases-side row.

Response priority, deadline and timeliness (#895)

referrals (migration 20260910120000_referral_response_priority, DESTRUCTIVE — priority and chk_referrals_priority dropped, schema_compat_floor bumped): response_priority TEXT NOT NULL is the jurisdiction ruleset’s token, rolled up at conversion by {j}-response-priority over the effective decision’s per-child response_priority evaluation rows (Georgia IMMEDIATE | PRIORITY_24HR | STANDARD | NONE, Texas P1 | P2 | NONE — NONE is a VERDICT). Four provenance columns ride beside it under the referral_response_provenance_all_or_none CHECK: response_priority_basis (the roll-up row’s basis, verbatim), response_priority_rule_set_name, response_priority_rule_set_revision, response_priority_evaluation_id (the rules-side rule_evaluations row — cross-database, no FK). Rows that pre-date the cutover were backfilled with the sentinel UNDERIVED (never NONE) through a DEFAULT the same migration drops again, with NULL provenance: an UNDERIVED referral that has an authorizing_decision_id is rolled up lazily by the first investigation open (a compare-and-set WHERE response_priority = 'UNDERIVED'); one without a decision can never derive and stays UNDERIVED for good. screened_in / screen_out_reason were dropped by #1752: a referral’s existence is its screened-in outcome, and authorizing_decision_id names the decision.

screening_decisions.attested_response_priority (same migration, additive, nullable): the token the recording worker attested at the decision act — validated against the intake-screening surface’s output enum minus NONE (422 otherwise) and hashed into the decision’s ADR-062 intent (the decision request, hashed whole: ADR-062 § #2310). Whether it counts is the roll-up arm’s decision by the decision’s actor role (Georgia: cicc_supervisor | county_director | regional_fps on a screened-in decision; a cicc_intake attestation is recorded but rolls up to NONE).

reports.created_by / reports.received_at_attested (20260909120000_report_receipt_attribution, additive): created_by UUID is the acting worker’s Keycloak sub when a HUMAN posted the report (a worker JWT, or the BFF’s X-Craig-Actor worker) and NULL on the intake-edge / partner path — a security-realm identity, no FK; received_at_attested BOOLEAN NOT NULL DEFAULT false is TRUE when received_at is the caller’s attested actual receipt (the staff phone-intake path) and FALSE when the column default stamped the submission instant. The receipt is the anchor every response window derives from.

reports.reporter_anonymous (20261022120000_reports_reporter_anonymous, additive, #2209): reporter_anonymous BOOLEAN NOT NULL DEFAULT false is set from intake’s anonymous flag (valid only with concerned_citizen: craig-cases refuses any other reporter type with a 422 naming reporter_anonymous; the flag is part of the report’s intent digest when true). A concerned citizen who reports anonymously may still volunteer contact details so staff can follow up (the p28 team’s request); for a flagged report the redacted set is the typed reporter_first_name / reporter_last_name / reporter_phone plus, inside raw_submission, reporter_email, reporter_street, reporter_city, reporter_state, reporter_zip and reporter_county. GET /v1/cases/reports/{id} omits them and conversion does not copy them onto the referral. POST /v1/cases/reports/{id}/reporter-contact/reveal returns them: the handler checks read and then authz action reveal on the same report (a reveal is never wider than a read); reveal is allowed for supervisors and admins only (every other role, service callers included, is denied; in texas-authz-report a regional director is denied even when she also holds supervisor), and each reveal stages a case.report_contact_revealed audit event before the response. A report that is not anonymous answers a typed 409 (report-not-anonymous). Not covered: the SHINES reporterInfo payload (follow-up happens in SHINES) and the create-response echo to the submitting service. No backfill.

investigations (20260911120000_investigation_response_window, additive): response_due_at is no longer caller-typed — the open derives it from the referral’s token through {j}-response-window and craig_common::deadline. Five window-provenance columns are held as a SET by investigation_response_provenance_all_or_none ((response_priority IS NULL) = (<column> IS NULL) for each): response_priority (the token the window was consulted for), response_due_basis, response_rule_set_name, response_rule_set_revision, response_evaluation_id — all NULL on rows opened before the cutover (their deadline was typed; no ruleset stands behind it). Five override columns are written only by POST /v1/cases/investigations/{id}/response-deadline: response_due_original (the derived deadline before the FIRST override — constant across later ones), response_due_overridden_at, response_due_overridden_by (the acting worker’s sub, no FK), response_due_overridden_reason (nullable on its own — the jurisdiction’s arm decides whether a reason is required) and response_due_override_evaluation_id; the at / by / original / evaluation four are a SET under investigation_response_override_all_or_none.

v_investigations is every investigations column plus the read-time band response_timeliness (and, since 20260916140000, admin_unit appended LAST — the append-only rule below):

CASE
    WHEN first_contact_at IS NULL AND now() < response_due_at THEN 'on_track'
    WHEN first_contact_at IS NULL                              THEN 'overdue'
    WHEN first_contact_at <= response_due_at                   THEN 'met'
    ELSE                                                            'met_late'
END AS response_timeliness

Every investigation READ — get, list, the NCANDS extract, the re-select after create / update / override — selects from the view (RETURNING * on the base table cannot produce the band); the craig-cases-fields investigations registry table and the search entity are both bound to the view (the planner requires them equal), and RESPONSE_TIMELINESS is a plaintext Equality field behind the closed four-token set (?timeliness=). The band is never written back — a later first_contact_at or an override re-bands the next read.

MAINTENANCE RULE: SELECT i.* was expanded when the view was CREATED (20260911120000), and 20260916140000 re-created it with the EXPLICIT column list in that expansion order (the dropped-and-re-added assigned_worker of 20260508180000 sits after assigned_worker_name) plus admin_unit at the end. Any later ALTER TABLE investigations that adds, drops or retypes a column MUST CREATE OR REPLACE VIEW v_investigations in the SAME migration, reproducing that list and appending the new column AFTER admin_unit (append-only select list — CREATE OR REPLACE refuses a renamed or reordered existing column; the v_effective_disposition re-creation in 20260906120000_screening_decision_provenance.sql is the precedent) — otherwise the view silently serves the old column set and the row model fails to decode.

investigations_closed_has_disposition (20261015120000_investigation_closed_disposition, additive, no floor bump, #1764): CHECK (status <> 'closed' OR disposition IS NOT NULL), validated on add, the DB twin of the PUT handler’s 400 investigation-disposition-required. No column changes, so v_investigations is not re-created. A refuse-on-data guard runs first, under the table’s ACCESS EXCLUSIVE lock: a closed row with no disposition refuses the file with its count, an inspect query and the remedy (devstack: reseed; elsewhere record each determination), because closed_no_finding is a determination, never a default. An N-1 craig-cases still sends a disposition-less close, which the CHECK now refuses as a redacted 500.

Administrative-unit stamp and the canonical-name belt (#1901, ADR-077)

investigations.admin_unit (20260916140000_investigation_admin_unit, additive, nullable, no floor bump): the ORIGINATING REFERRAL’s admin_unit — its county (ruling R4 on the plan page; Texas' assignment_area is a region token and is never the stamp). The open copies it from the referral row the handler already loaded (never re-fetched, never the body’s assignment_area), and the same migration backfilled every earlier row FROM referrals — TOTAL, because referral_id is NOT NULL and referrals.admin_unit is plaintext NOT NULL. The column stays nullable at the schema: NULL means "outside every unit scope" (ADR-077 D5 fail-closed) and can only come from a raw writer that skipped the column, which the BLOCKING investigation_admin_unit_from_referral invariant reports. Partial index idx_investigations_admin_unit … WHERE admin_unit IS NOT NULL serves the D5 list bind U2 (#1903) adds. The wire: Investigation.admin_unit (create echo, get, list — omitted when NULL). This is the cases-side leg of the D6 stamp program; the placement / financial projections (case_assignments.admin_unit) and their resource stamps are on Data Model: Placement and Data Model: Financial & Claims.

The belt (ADR-077 D2): CreateCaseRequest.admin_unit and CreateReportRequest.admin_unit are validated against the deployment jurisdiction’s administrative-unit table when that jurisdiction resolves to a US state / territory (craig_reference::fips::State::from_jurisdiction_key), and the row stores the CANONICAL AdminUnit::name — the lookup is case-insensitive (harris → Harris), an unknown name is the typed 400 invalid-enum-value on admin_unit (craig-intake’s SAD-11 shape). The rewrite runs BEFORE the authz attrs, the ADR-062 intent digest and the case-number derivation, so a replay of the same non-canonical body digests identically and case_number derives from the canonical name; the referral conversion copies the STORED canonical value from the report row. A jurisdiction without a FIPS table (the testonia fixture) keeps the string as sent. Pre-1.0 Changed.

case.assignment_changed now carries admin_unit (a plain string read from the same CAS-locked cases row as the pair snapshot). It is NOT an identity key: consumers read it OPTIONALLY (a retained pre-upgrade six-key envelope is still applied; absent = NULL) and fill their projections unit-only — the #1084 hard-required posture stays on the identity keys alone.

The demographics ledger and the ledger correction model (#1991, ADR-078)

person_demographic_facts (migration 20260922150000_person_demographic_facts, DESTRUCTIVE — persons.race, persons.ethnicity and persons.tribal_affiliation dropped, schema_compat_floor bumped; -- devstack: wipe-before-apply): the first ledger of the ADR-078 D1 correction model and the shape every later P-C fact ledger reuses. The migration refuses to run while any persons row still holds one of the three values (the message names cargo xtask dev reseed); rollback is the N−1 images AND a database restore. It enables btree_gist and grants nothing (the cases posture).

The five facts — every key is on the wire and null means unanswered (missing stays missing):

Column(s) Values AFCARS

race_american_indian_or_alaska_native, race_asian, race_black_or_african_american, race_native_hawaiian_or_other_pacific_islander, race_white, race_unknown, race_abandoned, race_declined

BOOLEAN ×8, all-or-none. The wire is one race object (RaceResponses, the eight tokens as its keys) that always carries all eight answers, or null; a partial answer is unrepresentable on the wire and refused by the CHECK. A non-answer (unknown / abandoned / declined) may be true beside a named category.

(b)(7)

ethnicity

hispanic | non_hispanic | unknown | abandoned | declined

(b)(8)

tribal_member_or_eligible

yes | no | unknown

(b)(4)(i)

tribal_member

yes | no | unknown

(c)(3), (c)(4)

tribal_affiliation

text, ≤ 255 characters

(b)(4)(ii)

Provenance (D1): id; person_id (FK persons, ON DELETE RESTRICT); the window [effective_from, effective_until) (effective_until NULL = open); recorded_at (DEFAULT now()) and recorded_by (the acting worker); supersedes_id (FK to the corrected predecessor row, ON DELETE RESTRICT); retired_at, retired_reason (corrected / retracted / order_corrected / order_deleted — the closed D1 set), retired_note and retired_by (the acting worker whose act retired the row — a correction, a retraction or a court-order sweep; set with retired_at); closed_at + closed_by (when a closing act ended the window, and the acting worker who did — the close, or a CHANGE’s implicit close of the open row; set together by that closing UPDATE only, so a row born with effective_until, a BACKFILL, has neither). A correction inserts its successor, and an INSERT never carries closed_*: a closed row’s closer lives on the chain’s closed predecessor after a correction (follow supersedes_id). A row is live while retired_at is NULL. Every column is Plaintext in the field registry (a DEFAULT_REGISTRY table) and the table is never on the scheme ALLOWLIST — its scheme is frozen (the COMMENT ON says so).

The DB twins: named CHECKs chk_person_demographic_facts_* — the window is ordered; the eight race columns are all-or-none; ethnicity and the two membership columns are in their token sets; tribal_affiliation is at most 255 characters; retired_at and retired_reason are both set or both NULL; retired_reason is in the D1 set; retired_note only on a retired row; a row never supersedes itself. The actor pairs (#2016): chk_<table>_retired_by_paired — (retired_at IS NULL) = (retired_by IS NULL) — on all twelve ledgers, and chk_<table>_closed_paired — (closed_at IS NULL) = (closed_by IS NULL) — on the nine window ledgers. The INSERT-side rule that a row born with effective_until has no closed_* is app-enforced (no ledger INSERT lists those columns), not a CHECK. excl_person_demographic_facts_window (EXCLUDE USING gist (person_id WITH =, daterange(effective_from, effective_until, '[)') WITH &&) WHERE (retired_at IS NULL)) — no two live rows of one person overlap; uq_person_demographic_facts_one_open — at most one open live row per person; uq_person_demographic_facts_one_successor — a row is superseded at most once; idx_person_demographic_facts_person_window (person_id, effective_from) serves the reads.

Rows are never deleted, and never edited beyond a CLOSE or a RETIRE. The trigger person_demographic_facts_refuse_mutation (BEFORE UPDATE OR DELETE) runs refuse_fact_row_mutation(): a DELETE is always refused, and an UPDATE is admitted only as a CLOSE (an open row gains effective_until + closed_at + closed_by, and nothing else changes) or a RETIRE (a live row gains retired_at + retired_reason + retired_by, optionally retired_note, and nothing else changes). Each arm requires its actor: a CLOSE without closed_by or a RETIRE without retired_by is refused, and a closed row’s closed_* or a retired row’s retired_by is never rewritten. The same migration creates refuse_event_row_mutation() (RETIRE only) once, for the three event ledgers to attach — parental_rights_actions (The parent ledgers and parental rights (#1994, ADR-078 D1, plan D5)), permanency_plans and child_review_events (The permanency ledgers (#1995, ADR-078 D1, plan D6)). Both raise integrity_constraint_violation naming the table and ADR-078 D1. Migration 20260925120000_ledger_actors (#2016) re-creates both functions with the actor columns above (CREATE OR REPLACE keeps each OID, so all twelve triggers keep firing, and it re-issues both COMMENT ON FUNCTION texts); the event body is the text craig-placement copies byte-for-byte (P-B1 U3).

Migration 20260925120000_ledger_actors (P-B1 U1b, #2016; -- devstack: wipe-before-apply) is additive. Its statement order is fixed so that a refusal leaves nothing of it applied:

  1. The refuse-on-data guard, FIRST: the migration raises while ANY ledger row is retired or ANY window row has effective_until set — no recorded fact names who retired or closed it, and a row an act closed is indistinguishable from one born with an end, so nothing is invented; the message names cargo xtask dev reseed.

  2. retired_by UUID on all twelve ledgers and closed_at TIMESTAMPTZ + closed_by UUID on the nine window ledgers, with the two paired CHECKs above (no FK, the recorded_by posture). Each is Plaintext in the field registry.

  3. refuse_fact_row_mutation() and refuse_event_row_mutation() re-created, then their two COMMENT ON FUNCTION texts.

  4. The schema_compat_floor bump to 20260925120000, LAST. The file is additive, so the bump is voluntary, and it is required: the re-created guards refuse every N−1 close / CHANGE / correction / retraction / sweep UPDATE (23000). Rollback is N−1 images AND a database restore.

The acts (craig-cases; each write is an ADR-062 claimed transaction keyed by the body’s client_request_id, claim scope cases.person_demographics.<act>):

Route Effect

POST /v1/cases/persons/{id}/demographics

Record a COMPLETE statement of the five facts (a null fact is unanswered on the new row — nothing carries over from the prior row). Without effective_until it is a CHANGE: the open row is closed at the new effective_from and the new open row inserted — an effective_from on or before the open row’s is the 400 ledger-not-a-change (the detail names the corrections act). With effective_until it is a BACKFILL: one closed window inserted into a free gap.

POST …/demographics/{row_id}/corrections

Retire the named live row as corrected and insert its successor (supersedes_id = the predecessor); an omitted effective_from / effective_until is copied from the predecessor.

POST …/demographics/{row_id}/retract

Retire the named live row as retracted with the required note (1–1000 characters); nothing is inserted.

POST …/demographics/{row_id}/close

Set effective_until on the named row, which must be the open one.

GET /v1/cases/persons/{id}/demographics?as_of=

The live row whose window contains as_of (absent = today on the jurisdiction clock): 200 DemographicsRow, or 204 when there is none.

GET …/demographics/history?from=&to=

The history read (#1992): every live row in force at any point of [from, to] (both required, both inclusive — the D1 overlap read), newest first — the rows a history view lists and corrects or retracts: 200 array (empty when none). A to before from is the 400 ledger-window-invalid.

Every act, both GETs included, refuses a pure service principal first (403 — the history read denies services outright); authz is Action::Update on the person resource for the writes and Action::Read for the GETs. There is no case-open guard (these are person routes). The typed errors (the fleet ledger set every later P-C ledger reuses): a body date after today on the jurisdiction clock is the 400 ledger-date-after-today; an effective_until not after effective_from (a POST, a correction’s resolved bounds, a close date) is the 400 ledger-window-invalid; a {row_id} that is absent, retired, another person’s, or (close only) not open is the 404 ledger-row-not-found with nothing written; an unknown person is a typed 404 naming the person; a write that would overlap a live window or open a second row (SQLSTATE 23P01 on the exclusion, 23505 on the one-open index) is the 409 ledger-window-overlap. Each committed act publishes case.person_demographics_changed with person_id, row_id, act (recorded / corrected / retracted / closed) and user_id (the act’s acting worker, claims.acting_worker(); #2016) — no fact value rides the event.

One generic core (#1992). The store acts, the act plumbing and the authority prologue are written once for every P-C ledger: craig_ledger::store::window holds the five act compositions (record-change, record-backfill, correct, retract, close) and the reads (the row by id, the current row, the at-date and overlap reads — the window predicate defined once), every SQL string rendered from the ledger’s compile-time table, constraint and column names; api::ledgers holds the generic record / correct / retract / close / read / history handlers and the route prologues; a ledger declares only its table, its key, its facts and its route. The demographics ledger is the first ledger on the core (same routes, same behavior); every later window ledger — the child-fact and sibling ledgers, ICWA and the two parent ledgers — is on it too, and the three event ledgers are on its event twin, craig_ledger::store::event (The parent ledgers and parental rights (#1994, ADR-078 D1, plan D5)). One read-side difference: the core reports an off-vocabulary token or a partial race set in a stored row as a decode error where U1b read it as unanswered — both are unreachable behind the CHECKs.

Readers: the person create / get / PUT serve the current row (open and live) to human principals (see the persons row); the NCANDS collection (GET /v1/cases/ncands-export) reads each victim’s row in force at the referral’s received_at date on the jurisdiction clock, batched in one round trip — NcandsExportRow.victim_race is RaceResponses, victim_ethnicity the five-value Ethnicity. The AFCARS persons export reads this ledger as it stood at the request’s as_of (a row recorded after it is invisible, one retired after it reads live, one closed after it reads open), at period_end for a child key and at each anchor for an adult key, never tribal_affiliation for an adult (#2121).

AFCARS element → column map (craig_cases_fields::afcars::AFCARS_ELEMENT_COLUMNS at AFCARS_CAPTURE_STAGE = U5, the last capture unit; the test every_owned_leaf_maps_to_its_full_column_set holds its key set EQUAL to the owned keys whose unit is at or before the stage — at U5 the COMPLETE owned set — and checks each mapping against the dictionary’s atom and the field registry; the two Named entries are the plan’s cross-table named overrides, which the test’s NAMED_OVERRIDES pins to exactly the (c)(1) and (c)(2) keys and exactly their columns — #1994. Because no unit follows U5, the two stage-bound tests were retargeted by #1995: at_the_last_unit_every_owned_key_is_due (formerly a_key_after_the_stage_has_no_mapping) and the unit test ownership_is_by_unit assert every owned key’s unit is at or before the stage rather than probe a later key):

Element key Mapping Column(s)

oohc.b1.2022-10-01

DateWithIndicator

persons.date_of_birth + persons.dob_estimated_abandoned

oohc.b2.2022-10-01

Column

persons.sex

oohc.b3.2022-10-01

Column

child_icwa_facts.inquiries_made

oohc.b3i.2028-10-01

Column

child_icwa_facts.inquiry_mother

oohc.b3ii.2028-10-01

Column

child_icwa_facts.inquiry_father

oohc.b3iii.2028-10-01

Column

child_icwa_facts.inquiry_indian_custodian

oohc.b3iv.2028-10-01

Column

child_icwa_facts.inquiry_extended_family

oohc.b3v.2028-10-01

Column

child_icwa_facts.inquiry_child

oohc.b3vi.2028-10-01

Column

child_icwa_facts.inquiry_domicile_or_residence

oohc.b3vii.2028-10-01

Column

child_icwa_facts.inquiry_legal_guardian

oohc.b4i.2022-10-01, oohc.b4i.2028-10-01

Column

person_demographic_facts.tribal_member_or_eligible

oohc.b4ii.2022-10-01, oohc.b4ii.2028-10-01

Column

person_demographic_facts.tribal_affiliation

oohc.b4iii.2028-10-01

Column

child_icwa_facts.reason_to_know

oohc.b4iv.2028-10-01

Column

child_icwa_facts.reason_to_know_discovered_on

oohc.b5i.2022-10-01

Column

child_icwa_facts.icwa_applies

oohc.b5ii.2022-10-01

Column

child_icwa_facts.icwa_applies_notified_on

oohc.b6.2022-10-01

Column

child_icwa_facts.tribe_notified (2022 only since #2004)

oohc.b5i.2028-10-01

Column

child_icwa_facts.tribe_notified_before_first_proceeding (#2004: notice "prior to the first child custody proceeding"; never tribe_notified copied — a pre-#2004 row reads NULL)

oohc.b5ii.2028-10-01

Column

child_icwa_facts.tribes_notified

oohc.b5iii.2028-10-01

Column

child_icwa_facts.parent_or_indian_custodian_notified_before_first_proceeding (#2004; the unqualified parent_or_indian_custodian_notified stays stored, read by nothing)

oohc.b6i.2028-10-01

Column

child_icwa_facts.court_determination

oohc.b6ii.2028-10-01

Column

child_icwa_facts.determined_on

oohc.b6iii.2028-10-01

Column

child_icwa_facts.determination_tribe

oohc.b7.2022-10-01

Each

person_demographic_facts.race_<category> for each of the eight categories — the dictionary atom is each(…; yes|no), stored BOOLEAN

oohc.b8.2022-10-01

Column

person_demographic_facts.ethnicity (fleet tokens; the AFCARS crosswalk maps them)

oohc.b13i.2022-10-01

Column

child_parenting_facts.pregnant

oohc.b13ii.2022-10-01

Column

child_parenting_facts.has_fathered_or_bore_a_child

oohc.b13iii.2022-10-01

Column

child_parenting_facts.placed_together

oohc.b15.2022-10-01

Column

child_prior_permanency_facts.prior_adoption

oohc.b15i.2022-10-01

Column

child_prior_permanency_facts.prior_adoption_month (the dictionary’s month_year, stored as the first of the month)

oohc.b15ii.2022-10-01

Column

child_prior_permanency_facts.prior_adoption_intercountry

oohc.b16i.2022-10-01

Column

child_prior_permanency_facts.prior_guardianship

oohc.b16ii.2022-10-01

Column

child_prior_permanency_facts.prior_guardianship_month (first of the month)

oohc.b17.2022-10-01

Gated

child_assistance_facts.support_status (the gate) + child_assistance_facts.source_<category> for each of the eight categories — the dictionary atom is gated(…; child_has_received_support_assistance; each(…; applies|does_not_apply))

oohc.b19.2022-10-01

Column

child_sibling_facts.total_siblings

oohc.c1.2022-10-01

Named

persons.birth_year + persons.year_of_birth_declared (the first legally-responsible parent’s own row) + person_parentage_facts.parents_abandoned

oohc.c2.2022-10-01

Named

the (c)(1) columns (the second legally-responsible parent) + person_parentage_facts.sole_legal_parent

oohc.c3.2022-10-01, oohc.c4.2022-10-01

Column

person_demographic_facts.tribal_member (of the first mother / father child_parents row in force at the anchor — The parent ledgers and parental rights (#1994, ADR-078 D1, plan D5))

oohc.c5.2022-10-01

Column

parental_rights_actions.kind

oohc.c5i.2022-10-01

DateWithIndicator

parental_rights_actions.petition_filed_on + parental_rights_actions.parent_deceased

oohc.c5ii.2022-10-01

Column

parental_rights_actions.terminated_on (died_on substitutes when the parent is deceased — the projection’s rule, not a third override)

oohc.f1.2022-10-01

Column

permanency_plans.plan (per plan; fleet PermanencyGoal tokens — the {j}-afcars-crosswalk permanency_goal—​oohc_f1 table binds them — The permanency ledgers (#1995, ADR-078 D1, plan D6))

oohc.f2.2022-10-01

Column

permanency_plans.established_on

oohc.f3.2022-10-01, oohc.f4.2022-10-01

Column

child_review_events.held_on (one column for both repeating dates; the row’s kind — periodic_review / permanency_hearing — selects which)

oohc.f5.2022-10-01

Column

contacts.occurred_at (of a contact that recorded a visited child, on the jurisdiction clock; soft-deleted contacts excluded — P-D’s projection)

oohc.f6.2022-10-01

Column

contacts.location

oohc.i2i.2028-10-01

Column

parental_rights_actions.beyond_a_reasonable_doubt

oohc.i2ii.2028-10-01

Column

parental_rights_actions.qualified_expert_witnesses

oohc.i2iii.2028-10-01

Column

parental_rights_actions.active_efforts (the (i)(2)(iii) finding, not the ICWA ledger’s (i)(9))

oohc.i3i.2028-10-01

Column

parental_rights_actions.executed_in_writing

oohc.i3ii.2028-10-01

Column

parental_rights_actions.recorded_before_a_court

oohc.i3iii.2028-10-01

Column

parental_rights_actions.accompanied_with_a_certification

oohc.i9.2028-10-01

Column

child_icwa_facts.active_efforts

The (a)(1)–(a)(4) header facts (state agency, report period, local agency, record number) are not captured columns: P-D’s projection supplies them from jurisdiction config, the period, cases.admin_unit and the record-number scheme.

The residence ledger (#3192)

person_residences (migration 20261202090000_person_residences, additive): where a person lives, as a person-keyed window ledger of the correction model. A row states one fact, admin_unit: the administrative unit the person lives in from effective_from (in Georgia, the county). It is the county a person index is given when the person is registered with it. No street address is held.

The unit is stored as the jurisdiction’s canonical unit name, as a case’s and a report’s are (ADR-077). Where the deployment’s jurisdiction is a US state, the name is matched against its units without regard to case, and a name that is no unit of it is refused 400 invalid-enum-value on admin_unit; a jurisdiction with no table of units keeps the name as sent. The request’s idempotency intent is taken over the canonical name, so a retry that spells the same unit in another case replays the stored row.

The guards are the ledger family’s: live windows of one person never overlap (excl_person_residences_window), at most one row is open (uq_person_residences_one_open), a row has at most one successor, and refuse_fact_row_mutation() admits only the CLOSE and the RETIRE, each naming its worker. Six routes under /v1/cases/persons/{id}/residences are the family’s: record (POST), correct, retract and close a row, the at-date read (GET) and the period read (GET …/history). A person who moves has the open row closed on the day they left and a new statement recorded from that day. Each act is human-only (a pure service principal is refused 403), authorized as the person update is, and publishes case.person_residences_changed with ids and the act only.

The child-fact ledgers and the sibling ledger (#1992, ADR-078)

Five more window ledgers on the demographics ledger’s correction model — the same provenance columns, DB twins, never-deleted rows, acts, fleet typed errors and generic core; this section records only what differs. Migration 20260923120000_child_fact_ledgers is ADDITIVE (five new tables; no drop, no schema_compat_floor bump, no wipe line), creates no function (each table’s trigger attaches U1b’s refuse_fact_row_mutation()), and grants nothing. Every column is Plaintext in the field registry (DEFAULT_REGISTRY then carried eleven tables — eighteen since The permanency ledgers (#1995, ADR-078 D1, plan D6), twenty since Custody episodes and the legal-status ledger (#2342, ADR-081, plan custody-episodes-doe-slds D2 + D3)) and each table’s COMMENT ON records that its scheme is frozen. The parenting facts (child_parenting_facts) are Plaintext by decision, not deferral: ADR-049 § Amendment — #2000 (ruled 2026-10-06) keeps the sensitive non-identifier facts of cases and placement — parenting, health, the (d)(4) removal circumstances, trafficking and ICWA — Plaintext, and no ledger column moves to Opaque.

The four case ledgers are keyed (person_id, case_id) — case_id (FK cases, ON DELETE RESTRICT) sits beside person_id: one child’s facts in one case. Every key is on the wire and null means unanswered (missing stays missing):

Ledger (route segment) Column Values AFCARS

child_parenting_facts (parenting-facts)

pregnant

yes | no

(b)(13)(i)

has_fathered_or_bore_a_child

yes | no

(b)(13)(ii)

placed_together

yes | no | not_applicable — when both this and has_fathered_or_bore_a_child are answered, not_applicable exactly when the child has not fathered or borne a child (no)

(b)(13)(iii)

child_prior_permanency_facts (prior-permanency-facts)

prior_adoption

yes | no | abandoned

(b)(15)

prior_adoption_month

a date, the first of its month; present exactly when prior_adoption is yes

(b)(15)(i)

prior_adoption_intercountry

yes | no; present exactly when prior_adoption is yes

(b)(15)(ii)

prior_guardianship

yes | no | abandoned

(b)(16)(i)

prior_guardianship_month

a date, the first of its month; present exactly when prior_guardianship is yes

(b)(16)(ii)

child_assistance_facts (assistance-facts)

support_status

child_has_received_support_assistance | no_support_assistance_received

(b)(17)

source_state_tribal_adoption_assistance, source_state_tribal_foster_care, source_title_iv_e_adoption_subsidy, source_title_iv_e_guardianship_assistance, source_title_iv_a_tanf, source_title_iv_b, source_chafee_program, source_other

applies | does_not_apply each; all eight present exactly when support_status is child_has_received_support_assistance, all eight absent otherwise (an unanswered status included)

(b)(17)(i)–(viii)

child_sibling_facts (sibling-facts)

total_siblings

an integer, 0–999

(b)(19)

Each within-element gate above (the parenting pair, a dependent without its yes gate, a month that is not the first of its month, a partial or unwanted source set) is refused as a 422 on the body before anything is written; the DB CHECK is the belt. An unanswered prior_adoption, prior_guardianship or support_status admits no dependent; the parenting rule binds only when both of its answers are given.

person_siblings is keyed by the pair (person_a, person_b) (both FK persons, ON DELETE RESTRICT), stored ordered — CHECK (person_a < person_b) — whichever side the recording route named. It has no domain columns: a row is the link and its window. The pair is the row’s identity, so a correction moves only the window; a link recorded against the wrong person is RETRACTED and re-recorded, and a link that ended is CLOSED.

The DB twins (per table, as the demographics ledger’s): named CHECKs chk_<table>_* — the window is ordered, each vocabulary column is in its token set, the gates of the table above (NULL-safe, with the unanswered-gate and both-answered rules just stated), total_siblings in 0–999, the pair order, and the provenance CHECKs; excl_<table>_window — no two live rows of one identity ((person_id, case_id), or the pair) overlap; uq_<table>_one_open — at most one open live row per identity; uq_<table>_one_successor; a read index (case_id, person_id, effective_from) on the four case ledgers, and on person_siblings a second index (person_b, effective_from) beside the pair’s so the either-side read is indexed. The trigger <table>_refuse_mutation on each table admits only a CLOSE or a RETIRE.

The acts (each write an ADR-062 claimed transaction keyed by the body’s client_request_id, claim scope cases.<table>.<act> with <act> = record / correct / retract / close):

Route Effect

POST /v1/cases/cases/{case_id}/children/{child_id}/<segment>

Record a COMPLETE statement of the ledger’s facts — a CHANGE without effective_until, a BACKFILL with it — exactly as the demographics POST.

POST …/<segment>/{row_id}/corrections, …/retract, …/close

Correct, retract or close the named live row of this child in this case, as the demographics acts.

GET …/<segment>?as_of=

The live row in force at as_of (absent = today on the jurisdiction clock): 200 row (id, case_id, person_id, the window, the facts, the provenance), or 204.

GET …/<segment>/history?from=&to=

The history read: every live row in force at any point of [from, to], newest first — 200 array.

POST /v1/cases/persons/{id}/siblings

Record a link from the path person to sibling_person_id from effective_from (optional effective_until), stored as (min, max). A sibling_person_id equal to the path id is the typed 400 bad-request (field sibling_person_id) before any write; a missing path or sibling person is 404.

POST …/siblings/{row_id}/corrections, …/retract, …/close

The row acts on a link with the path person on EITHER side; a correction body carries only the bounds.

GET /v1/cases/persons/{id}/siblings?as_of=

The live links in force at as_of with the path person on either side: 200 array, empty when there is none (never 204).

GET /v1/cases/persons/{id}/siblings/history?from=&to=

Every live link with the path person on either side in force at any point of [from, to] (the D1 overlap read), newest first: 200 array, empty when none. A to before from is the 400 ledger-window-invalid.

Authority on the case routes. A pure service principal is refused first (403, the GETs included); then the body is validated (422); the case must exist (404) and authz is Action::Update on the CASE resource for the writes, Action::Read for the GETs; then the body dates (the fleet 400s). Inside the claimed transaction, a RECORD or a CLOSE passes require_case_open (409 case-closed on a closed or transferred case); a CORRECTION or a RETRACTION does not — the lifecycle of the case does not freeze the record of what was true, so a wrong fact on a closed case is still corrected or retracted. Every act, and both GETs, then requires {child_id} to be — or to have been — a child-role case_household member of the case (an inactive membership counts, so a late entry for an ended membership is admitted): otherwise the 400 child-not-in-case (field child_id) with nothing written. A {row_id} of another child or another case is the 404 ledger-row-not-found.

Authority on the sibling routes is the person routes' (as the demographics ledger): service refused first, Action::Update / Action::Read on the path person, no case-open guard.

Typed errors: the fleet ledger set (ledger-date-after-today, ledger-date-before-minimum (#2461), ledger-window-invalid, ledger-row-not-found, ledger-window-overlap, ledger-not-a-change) plus the reused 400 child-not-in-case, the 409 case-closed, and the sibling self-link 400 bad-request.

Events (ids and the act only — no fact value): each committed act on a case ledger publishes case.child_facts_changed with case_id, child_id, ledger (the table name), row_id, act (recorded / corrected / retracted / closed) and user_id (the acting worker; #2016) — one routing key for seven case ledgers: these four, child_icwa_facts (The ICWA ledger (#1993, ADR-078 D3, ADR-073 § Amendment)), parental_rights_actions (The parent ledgers and parental rights (#1994, ADR-078 D1, plan D5)) and child_review_events (The permanency ledgers (#1995, ADR-078 D1, plan D6)) — every case ledger but permanency_plans, whose acts publish case.permanency_plan_established; an event ledger has no closed, and a review row a court order’s update or delete retires publishes order_corrected / order_deleted. Each act on person_siblings publishes case.person_siblings_changed with person_a, person_b, row_id, act and user_id.

The ICWA ledger (#1993, ADR-078 D3, ADR-073 § Amendment)

One more case ledger on the child-fact ledgers' model — keyed (person_id, case_id), the same frame, provenance, DB-twin families, acts, authority, typed errors and event as the four case ledgers; this section records only what differs. The route segment is icwa-facts (/v1/cases/cases/{case_id}/children/{child_id}/icwa-facts), the claim scopes are cases.child_icwa_facts.<act>, and every column is NULL until answered:

Column Values Element Gate CHECK

inquiries_made

yes|no

2022 (b)(3)

—

inquiry_mother, inquiry_father

yes|no|the_biological_or_adoptive_{mother,father}_is_deceased

2028 (b)(3)(i)–(ii)

—

inquiry_indian_custodian

yes|no|child_does_not_have_an_indian_custodian

(b)(3)(iii)

—

inquiry_extended_family, inquiry_child, inquiry_domicile_or_residence

yes|no

(b)(3)(iv)–(vi)

—

inquiry_legal_guardian

yes|no|child_does_not_have_a_legal_guardian

(b)(3)(vii)

—

reason_to_know / reason_to_know_discovered_on DATE

yes|no / date

(b)(4)(iii)–(iv)

date ← reason_to_know = yes

icwa_applies / icwa_applies_notified_on DATE

yes|no|unknown / date

2022 (b)(5)(i)–(ii)

date ← icwa_applies = yes

tribe_notified / tribes_notified TEXT

yes|no / text

2022 (b)(6) / 2028 (b)(5)(ii)

NO gate on tribe_notified (the 2022 blank-unless-icwa_applies rule is P-D’s); text ← tribe_notified = yes

tribe_notified_before_first_proceeding

yes|no

2028 (b)(5)(i) — notice "prior to the first child custody proceeding" (#2004)

yes ← tribe_notified = yes (no stands alone)

parent_or_indian_custodian_notified_before_first_proceeding

yes|no

2028 (b)(5)(iii), the same qualifier (#2004)

—

parent_or_indian_custodian_notified

yes|no

none since #2004 — the unqualified (b)(5)(iii) answer: stored, read by nothing, NULL on every row written since

—

court_determination / determined_on DATE / determination_tribe TEXT

yes_icwa_applies|no_icwa_does_not_apply| no_court_determination / date / text

(b)(6)(i)–(iii)

date, text ← yes_icwa_applies

active_efforts

yes|no

(i)(9)

← court_determination = yes_icwa_applies

tribe_order_foster_care

yes|no

(i)(5)(v) — the Tribe’s order "for foster care or pre-adoptive placements"

← court_determination = yes_icwa_applies

tribe_order_adoptive

yes|no

(i)(10)(iv) — the Tribe’s order for adoptive placements

← court_determination = yes_icwa_applies

tribe_order_foster_care_on DATE

date

the date the Tribe established its (i)(5)(v) order (plan afcars-2028-series D9)

← tribe_order_foster_care = yes

tribe_order_adoptive_on DATE

date

the date the Tribe established its (i)(10)(iv) order

← tribe_order_adoptive = yes

The gates are one-way (the four case ledgers' dependents are "present exactly when"): a dependent may be present only when its gate holds the enabling token, and a gate stands without its dependent — a discovery date not yet known, active efforts not yet judged (the dictionary’s required arm is P-D’s missing-data count, never a capture refusal). An unanswered gate admits no dependent. The DB twin is NULL-safe, CHECK (<dependent> IS NULL OR <gate> IS NOT DISTINCT FROM '<token>') (a bare = '<token>' would pass on a NULL gate); the body twin (present_only_if) refuses the same statement as a 422 before anything is written. The one exception, on new writes only (#2004): an order of preference yes needs its date — present_iff, the 422 validation-failed bound to facts.tribe_order_<x>_on on every record and correction body, the documented exception to "never a capture refusal". Its DB twin stays one-way (CHECK (<date> IS NULL OR <order> IS NOT DISTINCT FROM 'yes')), so a yes stored before #2004 without a date stays valid: it reads, closes and retracts, and only a correction restating it must add the date. tribes_notified and determination_tribe are 1–255 characters (CHECK (<column> IS NULL OR char_length(<column>) BETWEEN 1 AND 255); an empty string is not an answer). The five dates (the discovery, notice and determination dates and the two Tribe-order dates) are fact dates: a date after today on the jurisdiction clock is the typed 400 ledger-date-after-today bound to that field; a fact date is not checked against the row’s window.

The Tribe’s order of preference (P-B3 U6, #2085; R-B33). Two columns, because 25 U.S.C. 1915(c) lets a Tribe’s resolution set either order alone. Both keys are REQUIRED on every icwa-facts record and correction body (craig_validation::required_nullable; present, null = unanswered): a body missing one is 422 validation-failed, never a NULL. The ruleset predicate tribe_established_order_of_preference holds iff craig-reporting’s stored tribe_order_in_force is yes — ICWA applying by the period-end court determination, the period-end tribe_order_foster_care (for (i)(5)) or tribe_order_adoptive (for (i)(10)) yes, established (tribe_order_*_on) on or before the arrangement’s (e)(1) or the exit date (#2273, #2274; Reporting); U6 maps no AFCARS key, so the element → column table gains no row. Migration 20260930150000_tribe_order_of_preference is ADDITIVE with a voluntary schema_compat_floor bump; both columns are Plaintext and SCHEME-FROZEN like the rest of the ledger.

The qualified notices (#2004, plan afcars-2028-series D4). 2028 (b)(5)(i) and (b)(5)(iii) ask whether notice went out prior to the first child custody proceeding; a notice sent after it is 2022 (b)(6) yes but 2028 (b)(5)(i) no. So each is its own attested yes | no column — tribe_notified_before_first_proceeding (its yes only beside tribe_notified = yes, garde yes_only_if; no stands alone) and parent_or_indian_custodian_notified_before_first_proceeding (no gate) — and tribe_notified answers 2022 (b)(6) alone. A date-derived answer was rejected: 25 U.S.C. 1912(a) asks for notice received and a waiting period, which a sent date and a hearing date cannot establish. Legacy answers are never reinterpreted: nothing copies tribe_notified or the unqualified parent_or_indian_custodian_notified into a qualified column, so a pre-#2004 row reports 2028 (b)(5)(i) and (b)(5)(iii) blank — counted missing — until re-answered; the unqualified column and its CHECK stay, unread, and every row written since stores it NULL. All four new keys (the two notices, the two order dates) are REQUIRED on every body (present, null = unanswered). Migration 20261011120000_icwa_qualified_notices_and_order_dates is ADDITIVE (no backfill, no wipe line) with a voluntary schema_compat_floor bump (an N−1 image would write the four answers NULL); every column Plaintext, SCHEME-FROZEN.

Migration 20260923140000_child_icwa_facts is DESTRUCTIVE — the contrast with U2’s additive one. It carries the -- devstack: wipe-before-apply line and, in one file: a guard that refuses to apply (tagged #1993 ICWA ledger, naming cargo xtask dev reseed) while any persons.icwa_eligible row is true — a synthesized ledger row would guess WHICH ICWA fact the flag meant; the table, with the U2 frame, the value CHECKs, the gate and text CHECKs, excl_child_icwa_facts_window, uq_child_icwa_facts_one_open, the one-successor index, the read index and a trigger attaching the existing refuse_fact_row_mutation() (no new function); ALTER TABLE persons DROP COLUMN icwa_eligible; and, last, the MANDATORY schema_compat_floor bump (an N−1 image writes the dropped column). Rollback is N−1 images AND a database restore. Every column is Plaintext in the field registry (DEFAULT_REGISTRY then carried twelve tables — eighteen since The permanency ledgers (#1995, ADR-078 D1, plan D6), twenty since Custody episodes and the legal-status ledger (#2342, ADR-081, plan custody-episodes-doe-slds D2 + D3)) and the table’s COMMENT ON records that its scheme is frozen. The ICWA facts, and the (i)(2)–(i)(3) findings on parental_rights_actions, are Plaintext by the same decision (The child-fact ledgers and the sibling ledger (#1992, ADR-078)).

The one reader: the ICWA-status consult. craig-cases' placement-facts projection (the ADR-073 read), after its membership gate, reads the case’s CURRENT row for the child — the open, live row; a closed or retracted ledger reads as no row, every input null — and ALWAYS evaluates the federal ruleset federal-icwa-status (the federal layer’s federal-icwa-status.json, cited to 25 CFR 23.107) through craig-rules: POST /v1/rules/evaluate, context_type = icwa-status, context_id = the case id, the acting worker relayed, budget ICWA_STATUS_BUDGET = 2 s, input court_determination, reason_to_know, icwa_applies (null when unanswered). Its answer is icwa_person: court_determination = yes_icwa_applies → true; no_icwa_does_not_apply → false; otherwise reason_to_know = yes OR icwa_applies = yes; no row → false. A rules 403 for the relayed worker is the typed 403 rules-consult-denied; a consult craig-rules never answers (unreachable, or the 2 s budget elapsing) is the fail-closed 503 service-unavailable naming the ruleset and, on an elapse, the budget (#1800); a rules 503 / 504 passes through; any other failure, or an output that does not decode, is a 500. icwa_case still reads cases.icwa_flag (the case-level triage flag carried from the referral), which a court determination does not override; the PlacementFacts wire is unchanged.

Events: case.child_facts_changed with ledger = "child_icwa_facts" — the family event, no new routing key.

The parent ledgers and parental rights (#1994, ADR-078 D1, plan D5)

Migration 20260923160000_parents_and_parental_rights is ADDITIVE (three new tables; no drop, no schema_compat_floor bump, no wipe line) and creates no function: the two person ledgers' triggers attach U1b’s refuse_fact_row_mutation(), and parental_rights_actions is the FIRST table to attach refuse_event_row_mutation(). It grants nothing. Every column is Plaintext in the field registry (DEFAULT_REGISTRY then carried fifteen tables — eighteen since The permanency ledgers (#1995, ADR-078 D1, plan D6), twenty since Custody episodes and the legal-status ledger (#2342, ADR-081, plan custody-episodes-doe-slds D2 + D3)) and each table’s COMMENT ON records that its scheme is frozen. On all three tables the subject child is person_id and the parent is parent_person_id (both FK persons, ON DELETE RESTRICT).

The two person ledgers

person_parentage_facts and child_parents are window ledgers on the demographics ledger’s model: the same frame, provenance, DB-twin families, four acts plus the two GETs, person-route authority (a pure service principal refused first, Action::Update / Action::Read on the path person, no case-open guard) and fleet typed errors. This part records only what differs. Each write is an ADR-062 claimed transaction under the ledger’s own claim scopes (services/craig-cases/src/api/intents/parents.rs).

Ledger (route) Column Values AFCARS

person_parentage_facts (/v1/cases/persons/{id}/parentage; keyed person_id, the child)

parents_abandoned

BOOLEAN NOT NULL, required on the wire: the parents' identity is unknown (independent of the date-of-birth indicator)

(c)(1), (c)(2)

sole_legal_parent

BOOLEAN NULL, ASSESSED: exactly one parent or legal guardian holds legal responsibility (null = not assessed)

(c)(2)

child_parents (/v1/cases/persons/{child_id}/parents; keyed (person_id, parent_person_id))

parent_person_id

the parent; never the child itself

(c)(1)–(c)(5)

role

mother | father | legal_guardian | putative_parent

(c)(1)–(c)(5)

legal_responsibility

BOOLEAN NULL (null = unanswered); never true for a putative_parent

(c)(1), (c)(2)

The child_parents twins. chk_child_parents_role holds the four tokens. chk_child_parents_putative_no_legal_responsibility is role <> 'putative_parent' OR legal_responsibility IS NOT TRUE; it is NULL-safe, so an unanswered flag passes, and the body’s garde twin refuses the same statement as a 422. chk_child_parents_not_self is parent_person_id <> person_id. excl_child_parents_window and uq_child_parents_one_open apply per (child, parent): a child may have several parents in force at once, but one parent never has two overlapping live links to the same child. idx_child_parents_child_parent_window serves the child-first reads and the parent-not-linked probe.

The child_parents acts. The record body carries client_request_id, parent_person_id, effective_from, optional effective_until, role and legal_responsibility. A parent_person_id equal to the path child is the typed 400 bad-request (field parent_person_id) before any write, and a missing child or parent is 404. The (child, parent) pair is the row’s identity. A correction body therefore CARRIES parent_person_id beside the statement, and it must be the named row’s parent: a row of another parent is the 404 ledger-row-not-found with nothing written. A link recorded against the wrong parent is retracted and re-recorded. Retract and close address the row by its id alone. GET …/parents?as_of= returns the live links in force at as_of sorted by the parent order (below): a 200 array, empty when there is none, never 204. GET …/parents/history?from=&to= is the overlap history, newest first. person_parentage_facts has no route-specific rule: its six routes behave like the demographics routes (the as_of GET is 200 row or 204).

Events (ids and the act only): each committed act on either person ledger publishes case.person_parents_changed with child_id, ledger (person_parentage_facts \| child_parents), row_id, act (recorded / corrected / retracted / closed) and user_id (the acting worker; #2016).

The parent order (plan D5; craig_cases::afcars_parents::parent_order) sorts by role rank (mother, father, legal_guardian, putative_parent), then effective_from, recorded_at, id. The order is total, so no tie depends on read order. It is a CRAIG convention: the CFR’s "first" and "second" carry no meaning.

parental_rights_actions: the first event ledger

The event frame. Rows are keyed (person_id, case_id, parent_person_id): the child’s actions within one case (FK cases, ON DELETE RESTRICT), per parent. An event has no window, so the table has no effective_from / effective_until, no overlap exclusion and no one-open index. An event’s identity is its row id, and a parent may carry several live rows (a petition, then the termination). The provenance columns are D1’s: id, recorded_at, recorded_by, supersedes_id, retired_at, retired_reason, retired_note, retired_by (#2016; no closed_* — an event has no window). A row is live while retired_at is NULL.

Column Values AFCARS

effective_on

DATE NOT NULL: the date the row is in force from (see the resolution rule below)

—

kind

voluntary | involuntary | not_applicable

(c)(5)

petition_filed_on

date; null = no petition

(c)(5)(i)

parent_deceased / died_on

BOOLEAN NOT NULL / date; died_on present exactly when the parent is deceased

(c)(5)(i) deceased / (c)(5)(ii)

terminated_on

date; null = pending

(c)(5)(ii)

court_order_id

FK court_orders (ON DELETE RESTRICT), nullable: the termination order

—

beyond_a_reasonable_doubt, qualified_expert_witnesses, active_efforts

yes | no each; involuntary rows only (active_efforts is the (i)(2)(iii) finding, not the ICWA ledger’s (i)(9))

2028 (i)(2)(i)–(iii)

executed_in_writing, recorded_before_a_court, accompanied_with_a_certification

yes | no each; voluntary rows only

2028 (i)(3)(i)–(iii)

not_applicable is the CFR’s own ASSESSED response (no termination or modification). It carries no petition, no termination date and no ICWA finding. A death IS admitted on it, because a death is a fact independent of any termination. NO row means MISSING (blank), never not_applicable.

effective_on resolution. On a not_applicable row, effective_on is the assessment date and the body must state it. On a voluntary / involuntary row it is the EARLIEST of petition_filed_on, terminated_on and died_on: the body omits it or states exactly that date (any other date is a 422). The store writes the resolved date, the row always reads it back, and it is a fact date: after today on the jurisdiction clock is the 400 ledger-date-after-today.

The DB twins (each NULL-safe; each with a garde twin on the body that refuses the same statement as a 422 before anything is written):

  • chk_parental_rights_actions_kind: kind is one of the three tokens.

  • …_died_on_iff_deceased: died_on is present exactly when parent_deceased.

  • …_termination_has_a_date: a voluntary / involuntary row carries at least one of its three dates, so effective_on is always defined.

  • …_effective_on_earliest: a termination row’s effective_on is the earliest of those dates.

  • …_not_applicable_no_termination: a not_applicable row has no petition and no termination date (a death and a court order are admitted).

  • …_involuntary_flags / …_voluntary_flags: the other kind’s three flags are NULL. Together they leave a not_applicable row with no flag at all.

  • One token CHECK per flag, plus the provenance CHECKs.

uq_parental_rights_actions_one_successor ensures a row is corrected at most once. idx_parental_rights_actions_case_child_parent serves the history and the at-anchor read. The trigger parental_rights_actions_refuse_mutation runs refuse_event_row_mutation(). A DELETE is always refused, and an UPDATE is admitted only as a RETIRE: an event has no window to close.

The acts (claim scope cases.parental_rights_actions.<act>, <act> = record / correct / retract; there is no close and no separate history route):

Route Effect

POST /v1/cases/cases/{case_id}/children/{child_id}/parental-rights-actions

Record one action. The body (ParentalRightsStatement) is client_request_id, parent_person_id and the complete facts. One row is inserted and nothing is closed.

POST …/parental-rights-actions/{row_id}/corrections

Retire the named live row as corrected and insert its successor under the predecessor’s key. The body is the record body, and its parent_person_id must be the row’s parent: a row of another parent, child or case is the 404 ledger-row-not-found with nothing written.

POST …/parental-rights-actions/{row_id}/retract

Retire the named live row as retracted with the required note; nothing is inserted.

GET …/parental-rights-actions

The event history: every live row, newest first by the order key (recorded_at, id). Returns a 200 array.

GET …/parental-rights-actions?as_of=

The at-anchor read: per parent, the row in force at as_of. That is the latest by (recorded_at, id) among the live rows with effective_on ⇐ as_of, one row per parent, picked in SQL (DISTINCT ON the stored key). Returns a 200 array.

Authority follows the case routes:

  1. A pure service principal is refused first (403, the GET included).

  2. The body is validated (422).

  3. The case must exist (404), and authz is Action::Update on the case for the writes, Action::Read for the GET.

  4. The body dates are checked, effective_on included.

  5. Inside the claimed transaction, a RECORD passes require_case_open (409 case-closed). A correction or a retraction does not: a wrong action on a closed case is still corrected or retracted.

  6. {child_id} must be, or have been, a child-role member of the case (400 child-not-in-case).

Then, on record AND correct, the ledger’s cross-table rules run in this order, each a typed 400 with nothing written:

  1. parent-not-linked (field parent_person_id): the parent must hold a live (retired_at IS NULL) child_parents row for the child, open OR closed, with no date bound. A link is routinely closed at or after the termination, and the action stays enterable and correctable.

  2. parental-rights-order-invalid (field court_order_id): a court_order_id, when given, must be an ACTIVE court order of THIS case with order_type = termination_of_parental_rights, read inside the transaction. It is admitted on a not_applicable row too, because an order denying termination is evidence of the assessment. A court order soft-deleted after the action was recorded leaves court_order_id in place: the court-order act writes no action rows.

  3. icwa-flags-without-determination (field terminated_on, or effective_on when no termination date is stated): if any of the six findings is answered, the case’s child_icwa_facts row in force at terminated_on must carry court_determination = yes_icwa_applies; with no termination date (a pending termination) the row in force at the resolved effective_on is read instead. The findings belong to the termination itself (89 FR 96589, §1355.44(i)(2)(ii)-(iii); #2006), so a petition filed before the determination is admitted when the termination comes after it. This is an at-date read, so a historical action keeps its findings after the determination changes, and stays correctable while the date the gate reads stays inside a yes_icwa_applies row. A correction that dates the termination after the determination stopped applying is refused, even though ICWA applied at the petition.

Events: case.child_facts_changed with ledger = "parental_rights_actions", act recorded / corrected / retracted and user_id (the acting worker; #2016). This is the case ledgers' family event; there is no new routing key.

The event core (#1994; U5’s event ledgers reuse it, with one generalization):

  • craig_ledger::store::event holds the event acts. record inserts alone. correct locks the live row, retires it as corrected and inserts under the predecessor’s stored key, with the facts EventLedger::inherit derives from the predecessor (#1995; it replaced with_event_on). The default inherits nothing: the rights facts always resolve their date. The plan facts keep an omitted established_on; the review facts keep an omitted held_on and always the predecessor’s court_order_id.

  • It also holds the two reads: history and at_anchor (DISTINCT ON the stored key, the event date on or before the anchor, the ledger’s order). Every SQL string is rendered from compile-time identifiers.

  • api::ledgers::events holds the generic record_event / correct_event / retract_event / list_event handlers in the D1 authority order. A ledger declares its table, event-date column, order key, key, facts, route and its cross-table check.

  • The row acts both ledger classes share (lock a live row, retire it, read it, retract it) are one generic copy over craig_ledger::store::LedgerTable.

The (c) projection

P-D reads the projection. U4 ships it as the pure, DB-free module craig_cases::afcars_parents, which returns typed cells, never dictionary tokens. It is tier 3 (the order’s totality, the at-anchor reconstruction) plus the plan’s D1 code map; the federal arms stay in federal-afcars-2020.

  • (c)(1) / (c)(2) read the child_parents rows in force at the anchor whose legal_responsibility is true, in the parent order. An unanswered flag is not counted (fail-closed), so a seeded link, whose flag is unanswered, projects blank. A parent’s year is D2’s rule on the parent’s own persons row: birth_year, else year_of_birth_declared.

    • (c)(1) is the first row’s year, else abandoned when parents_abandoned, else blank.

    • (c)(2) is the second row’s year, else not_applicable when sole_legal_parent is true, else abandoned when parents_abandoned, else blank.

    • The abandoned and not_applicable arms fire only when the ROW is absent: a present row whose parent has no year projects blank.

    • No parentage row in force at the anchor reads as parents_abandoned = false and sole_legal_parent not assessed.

  • (c)(3) / (c)(4) are tribal_member, in force at the anchor on the demographics ledger, of the first mother (resp. father) row in force at the anchor in the same order, REGARDLESS of legal_responsibility. No such row projects blank.

  • (c)(5) covers every parent with a live child_parents row whose effective_from is on or before the anchor, of any role (the CFR asks "biological, legal and/or putative"). The link may be in force at the anchor or have ended before it: a terminated parent’s closed link stays in the file. Parents are ordered by the parent order over each parent’s latest such row. Per parent, the row in force is the at-anchor read’s.

    • No row projects blank.

    • A not_applicable row projects not_applicable with (i) and (ii) blank. This includes a parent who died with no termination.

    • On a voluntary / involuntary row, the parent is deceased at the anchor only when parent_deceased and died_on is on or before the anchor. (c)(5)(i) is deceased when the parent is deceased at the anchor, else petition_filed_on. (c)(5)(ii) is died_on when the parent is deceased at the anchor, else terminated_on.

    • A component date after the anchor projects blank. For example, a petition on file with the termination still pending at the anchor answers (c)(5)(i) and leaves (c)(5)(ii) blank.

The permanency ledgers (#1995, ADR-078 D1, plan D6)

Migration 20260923180000_permanency_ledgers is DESTRUCTIVE (-- devstack: wipe-before-apply). Its statement order is fixed so that a refusal rolls back ALL of U5 in one transaction:

  1. The refuse-on-data guard, FIRST: the migration raises while ANY case_plans row exists (a per-case goal cannot be honestly split into per-child plans); the message names cargo xtask dev reseed.

  2. permanency_plans, then child_review_events (columns in the field-registry order). Each table attaches U4’s refuse_event_row_mutation() (the file creates no function) and carries a COMMENT ON naming its CURRENT order and that its scheme is frozen.

  3. The contacts visit columns and their three CHECKs (below).

  4. ALTER TABLE case_plans DROP COLUMN permanency_goal; its CHECK chk_case_plans_permanency_goal drops with the column.

  5. The MANDATORY schema_compat_floor bump to 20260923180000, LAST: an N−1 image writes the dropped column. Rollback is N−1 images AND a database restore.

Every column of the two ledgers and of contacts is Plaintext in the field registry. DEFAULT_REGISTRY then carried EIGHTEEN tables (twenty since Custody episodes and the legal-status ledger (#2342, ADR-081, plan custody-episodes-doe-slds D2 + D3)): contacts joined with the two ledgers, because every new column takes a FieldSpec (plan D8).

Both ledgers are event ledgers on the U4 event core with the rights ledger’s frame (the provenance columns, retired_reason over corrected / retracted / order_corrected / order_deleted, the four frame CHECKs, a …_one_successor unique index, and the trigger admitting only a RETIRE). They are keyed (person_id, case_id): the child (FK persons) within one case (FK cases), both ON DELETE RESTRICT. This part records only what differs.

Ledger (route segment) Column Values AFCARS

permanency_plans (permanency-plans)

plan

the seven fleet PermanencyGoal tokens, not_yet_established among them (chk_permanency_plans_plan); the {j}-afcars-crosswalk binds them to the federal value set

(f)(1)

established_on

DATE NOT NULL, the event date

(f)(2)

child_review_events (review-events)

kind

periodic_review | permanency_hearing (chk_child_review_events_kind)

(f)(3) / (f)(4)

held_on

DATE NOT NULL, the event date; kind selects which element it answers

(f)(3) / (f)(4)

court_order_id

FK court_orders (ON DELETE RESTRICT), nullable: the hearing order that wrote the row (provenance, below); null on an administrative review

—

Orders. The CURRENT plan is the live row with the latest (established_on, recorded_at, id). The history (GET …) returns every live row in that order, newest first: established_on DESC, recorded_at DESC, id DESC for plans and held_on DESC, recorded_at DESC, id DESC for reviews. The at-anchor read (GET …?as_of=) returns the row in force at as_of: the first, in the same order, among the live rows dated on or before it. An empty plan ledger means no plan is established. idx_permanency_plans_case_child (case_id, person_id, established_on) and idx_child_review_events_case_child (case_id, person_id, held_on) serve the reads. idx_child_review_events_live_order (court_order_id, partial on court_order_id IS NOT NULL AND retired_at IS NULL) serves the order sweep.

The acts (claim scopes cases.permanency_plans.<act> and cases.child_review_events.<act>, <act> = record / correct / retract) are the rights ledger’s routes under /v1/cases/cases/{case_id}/children/{child_id}/permanency-plans and …/review-events: POST records, POST …/{row_id}/corrections supersedes, POST …/{row_id}/retract retires with a note, and GET lists the history or reads at as_of. Authority is the case-child order of the rights ledger: a pure service principal refused first (403, the ledger GET included — the ONE service read is craig-financial’s …/permanency-plans/current, below), 422 for the body, the case (404) and its authz, the body dates (after today is the 400 ledger-date-after-today; a NEW event without its event date is the typed 400 bad-request naming established_on / held_on), require_case_open on a RECORD only (409 case-closed; a correction or retraction is admitted on a closed case), and the child a child-role member of the case, now or before (400 child-not-in-case). A row of another child or case is the 404 ledger-row-not-found with nothing written. Neither ledger has a cross-table rule.

The service read (P-C U6a, #1996, ADR-078 D4 / plan D7). GET /v1/cases/cases/{case_id}/children/{child_id}/permanency-plans/current?as_of= is the ONE service read of P-C data: the plan in force for craig-financial’s guardianship activation, which passes the derived transfer date. Authority is require_service_caller() then service_id() == "craig-financial" (the handler’s allowlist of one, not a ruleset row), before any read: a human (the assigned caseworker and an admin included) or any other service is 403; a financial token carrying a lifted actor is admitted (the outer token is the identity). as_of is REQUIRED and not capped at today (a transfer date may lie ahead); a missing as_of or an unknown query parameter is refused. Past the guard and the query, the read answers ONLY 200 or 204: the at-anchor read above takes the one row in force at as_of and serves CurrentPermanencyPlan (event_id, plan, established_on; craig-cases-contracts, lenient on decode), or 204 when none. There is no case-existence 404 and no membership 400: an unknown case or a non-member child holds no live row (every write requires membership) and answers 204. Both answers carry Cache-Control: no-store. The act and history routes above still refuse craig-financial like every service principal.

Corrections inherit (EventLedger::inherit). A correction that omits the event date keeps the predecessor’s (established_on, held_on). A review correction ALWAYS keeps the predecessor’s court_order_id, so the order’s later update or delete still retires the successor.

The plan event. Every committed plan act publishes case.permanency_plan_established in its claimed transaction, with action established (a record), corrected or retracted. The payload (deny_unknown_fields) carries:

  • event_id: the acted row — the new row, the correction’s successor, or the retracted row.

  • person_id, case_id, and the acted row’s plan and established_on.

  • supersedes_id: a correction’s predecessor, else null.

  • act_id: a fresh UUIDv7. act_at: the act’s clock.

  • current: the child’s CURRENT plan after the act (event_id, plan, established_on), or null when no live row remains.

  • user_id: the act’s acting worker (claims.acting_worker()), the LAST key (#2016).

The consumer rule: per (person_id, case_id), apply the LATEST message by (act_at, act_id) and hold its current. A retraction’s message therefore outranks the established message of the row it retracts. The rule holds because of the per-case plan lock: the publish locks the case row FOR NO KEY UPDATE (held to commit), THEN reads current and clock_timestamp() as act_at, and only then mints act_id. Acts on one case’s plans serialize, and each act’s clock follows the one before it. FOR NO KEY UPDATE leaves other writers' foreign-key checks (FOR KEY SHARE) unblocked. A record already holds the case row FOR UPDATE from the case-open gate.

The review events publish the family event case.child_facts_changed with ledger = "child_review_events" and act recorded / corrected / retracted — or, for an order-driven retirement, order_corrected / order_deleted, one message per retired row. Those two acts widen the family event’s act vocabulary. Every message carries user_id (#2016): the acting worker of the review act, or, for a sweep, of the court-order act. The review share lock: inside the claimed transaction, after the claim and the route’s guard and before anything is written, the review ledger’s record and correct take the case row FOR KEY SHARE (a record already holds it FOR UPDATE from the case-open gate). A direct correction therefore serializes against an order update or delete, both of which hold the case row FOR UPDATE through the case-open guard, and the order sweep sees the committed successor.

court_order_id is provenance, never stated by a request. Only the court-order act writes it. A record or correction body carrying one is a 422 (the field is read-only on the wire), so no request attaches a row to an order’s sweep. Every response carries it.

The court-order hearing act. CourtOrderType::hearing_kind is the one type-to-kind map: review_hearing → periodic_review, permanency_hearing → permanency_hearing, every other type none. A court-order create or update states the hearing as hearing: { held_on, children } (1–25 children, each once).

  • Create. A hearing type without hearing is the typed 400 court-order-hearing-required; any other type with one is the typed 400 court-order-hearing-not-admitted (both field = hearing). hearing.held_on after today is the 400 ledger-date-after-today. Inside the order’s claimed transaction, after the order row, the act writes ONE review row per named child through the event core’s record (kind = hearing_kind, held_on, court_order_id = the order), each publishing recorded. A child that is not, and never was, a child-role member of the order’s case is the 400 child-not-in-case (field hearing.children) and NOTHING is written — no order either.

  • Update (If-Match). Inside the transaction the order row is locked at the expected version, and the resolved type is the body’s or the stored one. A resolved non-hearing type with hearing is refused as court-order-hearing-not-admitted. A resolved hearing type that differs from the stored type and comes without hearing is refused as court-order-hearing-required (a change between the two hearing types needs one too). A stated hearing retires the order’s rows (order_corrected) and then writes the new set. Leaving a hearing type for a non-hearing type retires them (order_corrected). Any other update sweeps nothing: a court-name edit never supersedes a direct correction.

  • Delete retires the order’s rows (order_deleted).

  • The sweep retires EVERY live row carrying the order’s id, naming the order act’s acting worker (claims.acting_worker()) as each row’s retired_by (#2016) — UPDATE … SET retired_at = now(), retired_reason = $2, retired_by = $3 WHERE court_order_id = $1 AND retired_at IS NULL RETURNING *, which the trigger admits row by row — corrected successors included. An update that sweeps, or a delete, therefore supersedes a direct correction of its rows.

The court-order act is case-parented, so a closed case refuses it (409 case-closed) while a row’s direct correction stays admitted. No rule relates held_on to the order’s order_date (plan D6 names none). The court-order create / update / delete and the contact create / update refuse a pure service principal first (403): every route that writes P-C data does (ADR-078 D1).

The order’s recorder (#2031). court_orders.recorded_by / recorded_by_name (both on the CourtOrder wire) are the acting worker’s sub and preferred_username (claims.acting_worker(), ADR-062). For a BFF-lifted token that is the worker, never the service principal — the same subject as the order’s claim and its hearing’s review rows. The actor token carries no full name, so recorded_by_name is the username, as on a direct token. Rows written before #2031 keep theirs. The order’s update writes no recorder column, its document upload names the acting worker as the attempt’s created_by, and its delete names the acting worker as the swept review rows' retired_by.

The contacts visit. Two nullable columns: visited_child_id (FK persons, ON DELETE RESTRICT) and location (childs_residence / other_location) — AFCARS (f)(5) (the contact’s occurred_at) and (f)(6). The DB twins:

  • chk_contacts_location_domain: location is NULL or one of the two tokens.

  • chk_contacts_visit_pair: both columns are set or neither is.

  • chk_contacts_visit_type: a visited child only on a home_visit / office_visit / school_visit contact (ContactType::admits_visit, the one truth-table predicate).

The wire is the pair object visit: { visited_child_id, location }, so a half pair is unrepresentable. On create, visit is optional. On update, an omitted visit leaves the stored pair, null clears it, and a value sets it. The truth table is checked on the RESULTING row before the claim: the resolved type (the body’s or the stored one) with a resolved live visit it does not admit is the typed 400 bad-request (field = visit). The update never clears implicitly, so a change to a non-visit type must send visit: null. Inside the transaction, after require_case_open, a set visit’s child must be a child-role member of the contact’s case, active or not (400 child-not-in-case, field visit.visited_child_id). A CHECK violation on the three constraints maps to the same typed 400, as the race backstop. Responses carry both columns (null when unset).

case_plans without the goal. The per-case permanency_goal column is gone. The per-child plan is the permanency_plans ledger, and case.plan_created carries case_plan_id and case_id only.

Custody episodes and the legal-status ledger (#2342, ADR-081, plan custody-episodes-doe-slds D2 + D3)

Migration 20261013120000_custody_episodes is ADDITIVE (no wipe marker, no schema_compat_floor bump, ADR-063 D3; plan Rollout 1). It creates the two tables, the episode row guard, the deferred instants trigger and the cases closure trigger, and attaches U4’s existing refuse_event_row_mutation() to the ledger. Every column of both tables is Plaintext in the field registry (DEFAULT_REGISTRY now carries TWENTY tables), and both are scheme-frozen: each row trigger refuses the crypto rewrite tool’s in-place UPDATE, so no column may join the rewrite ALLOWLIST. Every reference is ON DELETE RESTRICT.

Migration 20261106140000_legal_status_chain_seq bumps schema_compat_floor (#2353): it adds chain_seq, back-fills it, re-states the deferred instants trigger’s order arm on it, and bumps the floor last, because an N−1 replica inserts no chain_seq (refused by its NOT NULL) and orders a day by chain_root_id. The back-fill keeps every existing row’s order: within each child, chains are numbered from 1 in chain_root_id order, and every row of a chain takes its root’s number. Stop every N−1 craig-cases replica before applying it; rollback past it is roll-forward.

custody_episodes — one in-custody run of a child, owned by one case for life (the ADR-079 removal-episode shape):

Column / constraint Meaning

id

UUIDv7, the episode’s stable identity (an outbound bind’s stage id)

child_id, case_id

FK persons, FK cases; the owning case never changes

custody_from / custody_until

DATE, inclusive; the CURRENT instants its live rows derive (below); custody_until NULL while open. chk_custody_episodes_until_on_or_after_from: a one-day episode (until = from) is representable

recorded_at, recorded_by

the opening act’s clock and acting worker

retired_at, retired_by, retired_reason, retired_note

the RETIRE: retired_reason is only retracted; the worker’s note lives here. chk_custody_episodes_retired_paired, …_retired_by_paired, …_retired_reason, …_retired_note hold the frame

uq_custody_episodes_identity

UNIQUE (id, child_id, case_id): the target of the ledger’s composite FK, so a row’s episode is always its own child’s in its own case

excl_custody_episodes_child_window

EXCLUDE USING gist (child_id WITH =, daterange(custody_from, custody_until, '[]') WITH &&) WHERE retired_at IS NULL: live windows of one child never overlap in ANY case; inclusive, so a re-entry opens the day after an exit at the earliest (SQLSTATE 23P01 maps to 409 custody-episode-overlap)

idx_custody_episodes_case (case_id, child_id) serves the case read and idx_custody_episodes_child_live (child_id, partial on live) the act’s lock. There is no updated_at column: a touch would break the guard’s shape comparison. The row guard (trg_custody_episodes_row_guard, function refuse_custody_episode_row_mutation()) refuses a DELETE and admits an UPDATE only as (1) the instants of a LIVE episode (every other column unchanged) or (2) a RETIRE naming retired_by; anything else raises integrity_constraint_violation. A retired episode is inert.

legal_status_facts — an event ledger on the U4 event core with the rights ledger’s frame (the provenance columns, the four frame CHECKs, uq_legal_status_facts_one_successor, legal_status_facts_refuse_mutation admitting only a RETIRE), keyed (person_id, case_id) (the shared CaseChildKey). What differs:

Column / constraint Meaning

status_token

a token of the active StateBundle’s legal-status vocabulary, checked at write; chk_legal_status_facts_status_token is only the boot format (^[A-Z0-9]{1,16}$), never the list

custody_class

in_custody | not_in_custody, stamped at write from the token’s class, so a reclassification never rewrites history; chk_legal_status_facts_in_custody_episode: an in-custody row always names an episode

effective_on

DATE NOT NULL, the event date (on or before today, the jurisdiction clock)

chain_root_id

the original’s own id, kept by every correction (chk_legal_status_facts_chain_root): names the chain

chain_seq

BIGINT NOT NULL, orders a day’s rows (#2353). An original takes one past the highest number of the child’s rows in every case, read under the child’s advisory lock that every custody act takes, so the order follows the acts, never a replica’s clock; a correction keeps its root’s. chk_legal_status_facts_chain_seq (>= 1); uq_legal_status_facts_chain_seq (person_id, chain_seq, partial on originals) makes a writer that skipped the lock fail 23505 rather than mis-order, and serves the next-number read

episode_id

NULL = a history row; else the episode an in-custody or closing row belongs to, through fk_legal_status_facts_episode (episode_id, person_id, case_id) → custody_episodes (id, child_id, case_id)

court_order_id

FK court_orders, nullable provenance: the court order whose custody wrote the row (#1804), inherited by a correction; NULL on a worker act

retired_reason

corrected / retracted / order_corrected / order_deleted / episode_retracted (chk_legal_status_facts_retired_reason); an episode_retracted row carries retired_note NULL

uq_legal_status_facts_one_live_close allows at most one live closing row per episode. idx_legal_status_facts_case_child (case_id, person_id, effective_on) serves the history and at-anchor reads, idx_legal_status_facts_live_episode (episode_id, partial on live rows that name one) an episode’s rows, and idx_legal_status_facts_live_history (person_id, effective_on, partial on live rows that name NO episode) the containment check, which reads a child’s history rows across cases. idx_legal_status_facts_live_order (court_order_id, partial on live rows that name one; migration 20261014120000_legal_status_order_rows, additive) serves the court-order restatement and sweep. A correction inherits the predecessor’s chain_root_id, chain_seq, episode_id and court_order_id (EventLedger::inherit); its token, date and note are its own.

The deferred instants trigger ck_custody_episode_current_instants (two CONSTRAINT TRIGGER`s, `DEFERRABLE INITIALLY DEFERRED: on custody_episodes after insert or an update of the instants or retired_at, and on legal_status_facts after insert or update). At commit, or at SET CONSTRAINTS … IMMEDIATE, a LIVE episode must agree with its live rows: custody_from is the earliest live in-custody effective_on (none fails), custody_until the live closing row’s (NULL when none), and no live in-custody row orders after the closing row by (effective_on, chain_seq). A retired episode and a history row are skipped. It raises check_violation naming the constraint; every act runs it IMMEDIATE before it returns, so it is an internal invariant no request can trip (a disagreement is a redacted 500), and a direct instant UPDATE fails at commit.

The cases closure trigger trg_cases_refuse_close_with_open_custody (BEFORE UPDATE OF status, function refuse_case_close_with_open_custody(), VOLATILE so a read-committed retry sees an open committed while it waited on the row lock) refuses closed / transferred while a live episode of the case is open, raising check_violation with constraint ck_case_custody_open. The case update maps it to the typed 409 custody-open (CaseUpdateError); any other writer, an older replica included, gets it as a 500, never a closed case with open custody. The case row lock serializes a close with a racing open.

Order and reads. Rows order by (effective_on, chain_seq); the status in force on a day is the last live row on or before it. GET /v1/cases/cases/{case_id}/children/{child_id}/legal-statuses returns every live row newest first (effective_on DESC, chain_seq DESC, id DESC), or with ?as_of= the row in force on that day. Each row’s facts carry chain_seq. GET /v1/cases/cases/{case_id}/custody-episodes[?child_id=] returns the case’s episodes, live AND retired, by child_id, then custody_from DESC, id DESC (a child_id that is not a child-role member of the case is the 400 child-not-in-case).

The acts (claim scopes cases.legal_status_facts.record / correct / retract and cases.custody_episodes.retract, ADR-062 idempotent; a replay answers the original):

  • POST …/children/{child_id}/legal-statuses records and answers 201 { row, episode } (a replay answers 201 too). It states its intent: an in-custody status naming no episode_id OPENS an episode (409 custody-episode-overlap on any live episode of the child, this case or another); naming one, it is a CHANGE in that open episode; a not-in-custody status naming one CLOSES it; naming none, it is a HISTORY row, refused while the child has an open episode in this case (409 custody-episode-open, naming it). until: { status_token, effective_on } on an in-custody status naming no episode records a closed historical episode in one act (two rows; a one-day episode passes; a malformed until is a 422). A named episode that is closed, retired or another case’s is the 409 custody-not-open.

  • POST …/legal-statuses/{row_id}/corrections restates a live row within its class (a class flip is the 422 custody-class-flip) and keeps its episode and place; the instants follow.

  • POST …/legal-statuses/{row_id}/retract (a note) retires one row: (i) another live in-custody row remains, so the instants follow; (ii) it was the last live in-custody row, so the whole episode retires as below, this row included; (iii) it is the closing row: 409 custody-close-not-retirable (correct the close, or retract the episode; a closed episode never reopens).

  • POST …/children/{child_id}/custody-episodes/{episode_id}/retract (a note) retires the episode (retracted, the note on the episode) and, in the same transaction, every live row of it as episode_retracted; those rows are the snapshot an outbound removal reports, and the court-order sweep retires live rows only, so it never touches them. Another case’s or a retired episode is the plain 404.

Court-order writes (#1804, plan D4). CreateCourtOrderRequest and UpdateCourtOrderRequest carry an optional custody: { children, status_token, effective_on } (CourtOrderCustody; 1-25 children each named once, else the 422 validation failure; each a child-role member of the order’s case, now or before, else the 400 child-not-in-case on custody.children). It is admitted like a worker act’s status (the vocabulary 422s on custody.status_token, the 400 ledger-date-after-today on custody.effective_on) and then:

  • the order writes one row per child, court_order_id set, in the order’s own transaction (after its hearing rows);

  • each row takes the intent the child’s custody in the case implies: an open episode in this case makes it a change (an in-custody status) or a close (a not-in-custody one); with none, it opens an episode or is a history row;

  • an update with custody restates per child: a child named again has its live order row corrected within its class (422 custody-class-flip; a row already stating the same token and date is left as is, no event), a child no longer named has its row retired as order_corrected, a newly named child gets a new row; an update without custody touches no row;

  • a delete retires every live row the order wrote as order_deleted;

  • every retirement follows rules (i)–(iii) above: the instants follow, an episode left without an in-custody row is retracted (its retired_note names the order and the reason, ids only), and a closing row refuses the WHOLE order act with 409 custody-close-not-retirable, nothing written;

  • one lock call covers every child the act touches, in child-id order, after the order’s case row, so two orders naming the same children in opposite orders never deadlock; each child’s rules read only its own episodes;

  • the events reuse the five keys and the act tokens (recorded / corrected / retracted), and every event of one order act shares one act_id / act_at.

After every act the episode rule holds: an episode’s live rows are its in-custody rows, then at most one closing row ordered after each of them, and no live history row lies inside a live episode’s span, in either direction (a history row dated inside one, or an open, until or date move that would wrap an existing one); else 409 custody-row-out-of-order.

Authority is the case-child order: a pure service principal 403, 422 for the body, the case (404) and case: update (403), then the vocabulary — an empty one (a stub bundle) is the 422 legal-status-vocabulary-missing on all four acts, an unknown token the 422 legal-status-unknown — then a date after today (400 ledger-date-after-today), the claim, and inside it require_case_open (409 case-closed) on an open, a change, a close or an until record only; a history row, a correction and both retracts pass on a closed or transferred case. The child must be a child-role member of the case, now or before (400 child-not-in-case). The reads take case: read.

The lock order (plan D2 and its erratum, ADR-081 D3): the claim, the case row (FOR UPDATE from require_case_open on a lifecycle act, else FOR KEY SHARE), then a transaction-scoped advisory lock per named child in child-id order, then the named children’s live episodes in every case in one FOR UPDATE statement ordered by id. A child with no live episode has no row to lock, so the advisory lock is what serializes two cases' acts on one child; the loser of two racing opens then meets the winner’s episode and answers the typed 409, never a deadlock 500.

Events. Every committed act stages its transitions in the claimed transaction: case.custody_opened / _closed / _retracted / _close_corrected and case.legal_status_changed, ids-only (CustodyEventPayload; ADR-003 is the catalogue row, implementation-guide.adoc the payloads). A replay stages none.

The AFCARS persons export (P-D1, #2121, #2122)

P-D1 built POST /v1/cases/persons/afcars-export (#2121; #2122 added the ledger kinds) for the bare craig-reporting service principal alone; any other caller is 403.

  • Keys. A child key is (person_id, case_id), an adult key (person_id, role) with role caregiver or adoptive_parent. A call takes at most 500 keys and 10 000 anchors, and limit (1..=1000) bounds rows. The cursor carries a SHA-256 digest of the body bar after and limit, so another body’s cursor is refused.

  • Rows. not_found, person and demographic_window, then, for a child key only, parent_cells, parenting_window, prior_permanency_window, assistance_window, sibling_count_window, icwa_window, permanency_plan, review_event, sibling_link and visit, under the kind tag. An unknown person, or a child key whose person is not a child-role member of its case at as_of (added_at ⇐ as_of, #2189), is one not_found row that releases nothing. Only a child or adoptive_parent key’s person row carries a date of birth, through a DOB-only decrypt (the persons row above).

  • Parent action dates and the ICWA keys (#2004). Each parent_set entry also carries terminated_on and petition_filed_on — the rights row’s own dates, each null unless the row in force is voluntary / involuntary and the date is on or before the period end; never a date of death (c5ii substitutes that, terminated_on does not). The icwa_window row carries the two notices before the first proceeding and the two order dates, never the unqualified parent notice.

  • As of. Every ledger row is normalized to how it stood at as_of before use, including the rows behind parent_cells. A child membership counts when its added_at is at or before as_of (#2131 D2), a case’s admin_unit is fixed at the case’s creation (D1), and a contact exists by its created_at / deleted_at and reads its visit trio as it stood at as_of (below). Only persons reads current: a correction landing mid-walk answers on the pages read after it (D6, ⁂ on #1073). Within a page every statement reads one REPEATABLE READ READ ONLY snapshot (#2422), so a commit landing mid-page is wholly seen or wholly unseen by that page.

  • Contact revisions (#2131 D5). contact_revisions holds a contact’s prior occurred_at, visited_child_id (FK persons) and location, the version that held them (UNIQUE (contact_id, version)) and superseded_at; contact_id is ON DELETE RESTRICT, indexed (contact_id, superseded_at, id). The contact update writes one row in its own statement when the trio changed (a narrative-only edit or a CAS miss writes none), stamped clock_timestamp() after the row lock. The export reads a contact’s earliest revision superseded after as_of, else the row. refuse_revision_mutation() refuses every UPDATE, DELETE and TRUNCATE (every column plaintext and scheme-frozen). The history starts with migration 20261005140000: an edit made before it kept no prior value. Since #2231 a revision also names its worker: superseded_by UUID NOT NULL is the acting worker (claims.acting_worker(); the handler refuses a pure service principal) whose update superseded the trio, bound into the same revision INSERT, no FK (the recorded_by posture). Migration 20261008140000_contact_revision_actor.sql (-- devstack: wipe-before-apply) refuses to apply while any revision exists (nothing recorded names the worker behind one; the contact PUT stages no event), adds the column NOT NULL with no default, and bumps schema_compat_floor to 20261008140000 LAST (required: an N−1 contact edit omits the column). Rollback is N−1 images AND a database restore. The export never reads superseded_by.

  • Audit. A page that releases a person stages one case.person_pii_exported naming each row’s key person, the parents behind each parent_cells row and, in date_of_birth_person_ids, those whose date it released. Cache-Control: no-store.

Person identifiers (#1806, plan custody-episodes-doe-slds D5)

person_identifiers holds a person’s external identifiers, one row per identifier under a kind the active StateBundle declares (StateBundle::identifier_kinds(); Georgia: gtid, ten ASCII digits, and empi (#2428, the EMPI client identifier IES names dhr_client_number), nine, both ⁂ #1073; the Texas stub declares none, so every act there is 422 identifier-kind-unknown). Migration 20261014130000_person_identifiers.sql, additive, no schema_compat_floor bump.

  • Columns. person_id (FK persons, ON DELETE RESTRICT), kind (a bundle token, ^[a-z][a-z0-9_]{0,15}$), value (CGEF ciphertext of the format-checked value, never trimmed) beside value_hmac, its BlindIndex digest under the "person_identifier" field domain (NULL only keyless), effective_from / effective_until (DATE, inclusive; the write boundary refuses a date after today on the jurisdiction clock, 422 identifier-dates-invalid, and the CHECK refuses an end before the start), provenance, recorded_at / recorded_by, ended_at / ended_by (paired with effective_until), and the retire quartet retired_at / retired_by / retired_reason (retracted) / retired_note.

  • Provenance (#3192, migration 20261202110000_person_identifier_provenance.sql). How the value was established: worker_attested (a worker typed and attested it through the record route), partner_matched (the jurisdiction’s person index returned it and a worker selected that candidate) or partner_assigned (the index assigned it at a registration). The record route takes no provenance and always writes worker_attested (a body carrying one is refused 422, the request denying unknown members); the other two are written only by the person-index conversation. The identifiers panel shows it as "Source".

  • Live and the uniques. Live = neither retired nor ended. Two partial UNIQUEs over live rows: uq_person_identifiers_person_kind_live (person_id, kind) and uq_person_identifiers_kind_value_live (kind, value_hmac). Either answers 409 person-identifier-duplicate, whose detail names neither the value nor a person. Keyless Optional leaves value_hmac NULL, so the per-value unique does not bite there (no key, no index; production and both harnesses are keyed). An ended value may be recorded again, on any person.

  • Row guard. refuse_person_identifier_row_mutation() refuses every DELETE and admits an UPDATE only as the END of a live row (effective_until with its ender) or a RETIRE naming retired_by. There is no updated_at. The table is scheme-frozen: the trigger refuses the crypto rewrite tool’s in-place UPDATE, so value joins its allowlist only with a trigger arm.

  • Demographics guard and its twin. A record needs a person with a date of birth and non-blank first and last names, checked under the person row lock (422 person-demographics-incomplete, field person_id). A person PUT that would blank either name of a person holding a live identifier is 409 person-identifier-live (the detail names first_name or last_name), judged under the same lock (api/persons_locked.rs).

  • Lock order. The record claims, then takes lock_person (FOR NO KEY UPDATE), then inserts; end and retract claim, then lock the identifier row FOR UPDATE (neither locks the person; the claim’s guard only reads that it exists); the person update takes lock_person, then reads person_holds_live. No act takes a case lock, so the persons-before-cases order gains no edge.

  • Routes and authority. Five routes under /v1/cases/persons/{id}/identifiers, each refusing a pure service caller (deny_pure_service) and inheriting the person’s authority exactly: GET (Person Read; every row, masked to its last four), POST (record, Person Update), …/{identifier_id}/end and …/retract (Person Update) and …/reveal (Person Approve; GA admin and supervisor). The three acts are ADR-062 idempotent under the claim scopes cases.person_identifiers.record, .end and .retract (entity kind person_identifier); the record’s intent hashes the keyed digest through blind_digest, never the value.

  • Events. Ids only, the strict PersonIdentifierEventPayload (identifier_id, person_id, kind, act, a v7 act_id, user_id): case.person_identifier_recorded on a record, case.person_identifier_ended on an end or a retract (act says which). A reveal stages and commits a case.person_pii_exported wrapper (purpose = person_identifier_reveal, the identifier_id, the kind, the revealing worker as user_id) before the value is decrypted, and answers Cache-Control: no-store. See ADR-003.

  • Outbound (#2343). craig-exchange reads a GTID only on the custody arms of the outbound projection (the ADR-075 amendment); each read stages the outbound_principals release wrapper first, and the wrapper never carries the GTID. The Medicaid-application arms (#3193) release the live identifier of the kind the bundle names for an application, under the same wrapper (see Partner reports on a Medicaid application (#3193)). The DOE-SLDS identifier legs admit kind = gtid only, so recording or ending an EMPI is no DOE occurrence (#2428).

  • Seed. The seeder derives one live identifier per declared kind (Georgia: a GTID and an EMPI) per distinct seeded child with a date of birth (no new draw); xtask verify-seed and the key lineage’s lineage-absent scan cover the table.

The person-index conversation (#3192)

A worker on a case asks the jurisdiction’s person index (in Georgia, the EMPI) who a member of the household is, selects a candidate it answered, or has it register the person as new. craig-cases holds the conversation, since it holds the case and the person; craig-exchange makes each call of the index (Asking a person index). Migration 20261202120000_person_index_inquiries.sql, additive, no schema_compat_floor bump.

  • Routes and authority. POST /v1/cases/cases/{id}/persons/{person_id}/index-inquiries (the ask), …/{inquiry_id}/select and …/{inquiry_id}/register. Each refuses a pure service caller, needs Case Update on the case, and answers 404 unless the person is an active member of that case’s household: a person has no owner to check, so the case is the authority. A deployment whose bundle names no person_index_identifier_kind, or that has no field key, refuses every act 409 person-index-unconfigured.

  • The ask. Refused 409 when the person already holds a live identifier of the index’s kind (person-index-person-identified), when the sex is not recorded (person-index-facts-missing), or within a minute of a registration begun for the person (person-index-registration-in-flight). It sends the first name, the last name, the sex and the date of birth, and no SSN. It then consults the jurisdiction’s ruleset <jurisdiction>-person-index-choice on count and top_score, under the acting worker’s relayed authority. The ruleset answers selection_open, selectable_from (the lowest selectable score; present exactly when selection is open) and registration_open; an answer in any other shape is a redacted 500 (the log names the ruleset) and keeps nothing. The response carries the candidates as the index described them, each marked selectable or not, whether registration is open, and which of the four facts a registration sends are missing. An ask is not replayed: a repeated ask is a new inquiry.

  • What is kept. One person_index_inquiries row per person (uq_person_index_inquiries_person), replacing the earlier one: case_id, asked_by, selectable_from (NULL = no candidate may be selected), registration_open, expires_at (fifteen minutes after the ask, on the database’s clock), registering_at and selecting_at. Beside it, one person_index_inquiry_candidates row per candidate: id_digest (the person_identifiers blind index of the candidate’s id) and score. A candidate the index answered twice is kept once, at its lower score. No name, date, residence, SSN digit or plain id of a candidate is written to any table.

  • Select. Body client_request_id, index_id. The inquiry must be the person’s, opened from this case, unexpired and not registering; the id’s digest must be one the row holds, at or above selectable_from (else 409 person-index-choice-refused); the id must fit the kind (422 identifier-format-invalid). craig-cases tells the index first (the participation) and then, in one transaction, records the identifier as partner_matched and deletes the inquiry. An index that was not told records nothing: craig-exchange’s refusal is relayed, its failure is a 503, and the inquiry stays to select from again.

  • Register. Body client_request_id. Open only when the row says so and the person’s record holds the sex, the date of birth, how it was verified and a residence in force today (else 409 person-index-facts-missing, the detail naming the facts by token). The row is marked registering_at before craig-exchange is called, and the mark is never cleared: an id that comes back is recorded as partner_assigned and the inquiry deleted; any failure records nothing and leaves the row registering, so the worker asks again and a registration that landed is then found and selected. The index holds the person from the registration, so no participation follows.

  • One kind of act per inquiry. A select marks the row selecting_at before the index is told, and a row a selection was begun from sends no registration (409 person-index-choice-refused); a row a registration was begun from admits no selection. So a select and a register made from one answer at the same moment send only one of them (chk_person_index_inquiries_one_kind_of_act). Every act also checks, inside its own transaction, that the person still holds no live identifier of the kind.

  • Lock order. The ask’s check-and-replace and the register’s check-and-mark each take a transaction-scoped advisory lock keyed on the person (person-index-inquiry:<person id>), so an ask never replaces a row a registration was just begun from. A select and a register lock the inquiry row FOR UPDATE; none takes a person or a case lock until the record, which is the identifier record’s own (claim, then lock_person). No transaction is open while the index is called.

  • Idempotency. Select and register claim under the scopes cases.person_index.select and .register (entity kind person_identifier); the select’s intent hashes the id’s keyed digest, never the id. A replay answers the recorded identifier before the index is called, so a retried act tells the index nothing twice.

  • Events. Each release of the person’s facts stages and commits a case.person_pii_exported wrapper before craig-exchange is called (purpose = person_index_match, person_index_registration or person_index_participation; the person, the case and the acting worker; no fact that was sent and nothing the index answered), so a release whose outcome is never learnt is on the trail. The recorded identifier stages case.person_identifier_recorded as any record does.

  • Sweep. The person-index-sweep worker deletes expired rows every five minutes. An act refuses an expired row whether or not the sweep has reached it.

  • The worker’s page. On a case’s Household tab, where the jurisdiction names a person index, a writer on an open case has "Ask the person index" on each member who is in the household now. The answer swaps into that member’s row (POST /cases/{id}/household/{person_id}/person-index in craig-web): each candidate’s name, date of birth, last four of the SSN, residence and score, with a choice wherever one may be selected (already made when there is exactly one), and "Register as new" where registration is open; a fact a registration still lacks is named with a link to the page it is recorded on (the residence page for where the person lives, the person edit page for the other three; that page gained its Sex select for this, since the index is asked with the sex). The answer is rendered in that response and nowhere else: a fragment under Cache-Control: no-store, with no flash, cookie, redirect or log line carrying any of it. Select and register are plain forms that return to the Household tab (#household) with the outcome, a refusal’s reason shown as craig-cases gave it. The page is English, like the rest of craig-web; every string is in the catalog (cases-person-index-*), for the Spanish worker catalog (#3181) to translate with the rest.

Initial Medicaid applications (#1807, plan partner-auth-medicaid-application D6 + D7)

medicaid_applications holds the Initial Medicaid Application a worker submits for a child in custody: one row per submitted application on the child’s custody episode in a case, at most one live per episode. Migration 20261017120000_medicaid_applications.sql, additive, no schema_compat_floor bump.

  • Columns. case_id (FK cases) and child_id (FK persons), both ON DELETE RESTRICT; episode_id (the child’s open custody episode in the case at submit); citizenship_status (CGEF ciphertext, field class Opaque, no blind-index sibling: nothing looks it up; its four tokens are the write boundary’s check, so the CHECK asks presence only); prior_medical_assistance (yes / no / unknown); legal_admin_unit (the canonical admin-unit name validate_admin_unit accepted); submitted_on (DATE, the jurisdiction’s business date of submitted_at, derived from the same instant — a client never sends it); submitted_at / submitted_by; and the retire quartet retired_at / retired_by / retired_reason (retracted) / retired_note. There is no updated_at. Cases otherwise encrypts identifiers only; citizenship_status identifies no one but is an immigration status, so it is sealed at rest all the same and never leaves in an error, an event or a log.

  • Live and the unique. Live = not retired. The partial UNIQUE uq_medicaid_applications_episode_live (episode_id) WHERE retired_at IS NULL answers 409 medicaid-application-exists; a retract frees the episode for a new submit. There is no liveness trigger: an episode later closed or retracted keeps its application (D6), and TP-3’s assembly checks the episode.

  • Composite FK. fk_medicaid_applications_episode (episode_id, child_id, case_id) onto the custody episode’s uq_custody_episodes_identity (id, child_id, case_id) — the target legal_status_facts already references — so the episode is the child’s, in that case.

  • Row guard. refuse_medicaid_application_row_mutation() refuses every DELETE and admits an UPDATE only as the RETIRE of a live row naming retired_reason and retired_by. The table is scheme-frozen like person_identifiers: the trigger refuses the crypto rewrite tool’s in-place UPDATE, so citizenship_status joins its allowlist only with a trigger arm.

  • The EMPI gate. StateBundle::medicaid_application_identifier_kind() (default None) names the identifier kind a submit requires: Georgia empi; the Texas stub none, so a Texas submit is ungated. Boot refuses a gate kind the bundle’s identifier_kinds() does not declare. A child without a live identifier of the gate kind is 422 medicaid-application-identifier-missing, field child_id.

  • Lock order. A retract claims, then locks the live row FOR UPDATE, then retires it; a submit’s insert may wait on it through the partial UNIQUE, never the reverse. The identifier END / RETRACT locks only the identifier row FOR UPDATE and takes no case, advisory or episode lock, so a submit that takes the identifier FOR SHARE last closes no cycle with it. A submit, inside its claim and after a membership-only guard read, takes:

    1. the case FOR KEY SHARE;

    2. the child’s advisory lock (two submits for one child serialize here, so the second meets the first’s committed row at the UNIQUE — no pre-check read);

    3. the child’s open episode in this case FOR SHARE;

    4. the child’s live identifier of the gate kind FOR SHARE (none when ungated);

    5. the insert.

  • Routes and authority. The two acts live under /v1/cases/cases/{case_id}/children/{child_id}/medicaid-applications: POST (submit, 201) and …/{application_id}/retract (POST, 200), each under case update. The two reads are case-level (B-E2): GET /v1/cases/cases/{case_id}/medicaid-applications (an optional child_id filter) and …/{application_id}, each under case read. Each of the four refuses a pure service caller (deny_pure_service); craig-exchange reads an application through the outbound projection and writes what the partner said through one service-only route (see Partner reports on a Medicaid application (#3193)). The acts are ADR-062 idempotent under the claim scopes cases.medicaid_applications.submit and .retract (entity kind medicaid_application); the submit’s intent hashes the citizenship token’s keyed digest (keyed_token_digest), never the token.

  • Refusals (a submit, in the order a request meets them; a retract answers 404 ledger-row-not-found for no live application of that id for the child in the case, beside the shared rows 2, 3, 4, 6 and 7):

    # Where Status / problem type Field

    1

    the JSON body (deny_unknown_fields, e.g. submitted_on)

    422 validation-failed

    the unknown field

    2

    deny_pure_service

    403

    —

    3

    the body’s length validation

    422 validation-failed

    the field

    4

    the case: missing / not authorized

    404 not-found / 403

    —

    5

    a token outside its vocabulary, or a county not of the deployment’s state (the detail never echoes the input)

    422 validation-failed

    citizenship_status / prior_medical_assistance / legal_admin_unit

    6

    the claim

    409 idempotency-conflict (another body) / the replay

    —

    7

    the child is not a child-role household member of the case

    400 child-not-in-case

    child_id

    8

    no open custody episode in the case

    409 custody-not-open

    —

    9

    no live identifier of the gate kind

    422 medicaid-application-identifier-missing

    child_id

    10

    the partial UNIQUE

    409 medicaid-application-exists

    —

  • Events. Ids only, the strict (deny_unknown_fields) eight-key MedicaidApplicationEventPayload (application_id, child_id, case_id, episode_id, act, a v7 act_id, act_at, user_id): case.medicaid_application_submitted on a submit (act_at = submitted_at), case.medicaid_application_retracted on a retract (act_at = retired_at); a replay stages none, and no event carries the citizenship status. No consumer in craig-exchange (no trigger-matrix row names the keys; the IES bind, #1822 in TP-3, owes an idempotent backfill of every earlier submit); reporting’s case.* queue receives both as no-ops; craig-security audits them as a create / update of medicaid_application. See ADR-003.

  • Seed. None: the seed writes no custody episode, so no application. xtask verify-seed leaves the table off SEEDED_TABLES on purpose while the encryption registry covers the column; the at-rest proof is the devstack test citizenship_status_rests_encrypted_and_stays_out.

Partner reports on a Medicaid application (#3193)

An application is referred to the medical-assistance agency that decides it. The agency answers the referral with its own reference for the application (a receipt) and later reports where the application stands (an outcome). craig-exchange keeps neither: it posts each to craig-cases, and medicaid_application_reports is where they rest. Migration 20261203190000_medicaid_application_reports.sql, additive, no schema_compat_floor bump. ADR-091 records why the partner calls in.

  • Columns. application_id (FK medicaid_applications, ON DELETE RESTRICT); interface (the partner interface that reported it, as its adapter-kind token); kind (receipt / outcome); partner_reference (the partner’s reference for the application, plaintext: an outcome is matched to its receipt on it); partner_case_reference, program_id, status (pending / approved / denied / closed) and reported_on, each present only when an outcome states it; received_at (the database’s clock); exchange_transaction_id (the craig-exchange transaction that carried the report; no foreign key, the row is in another service’s database). program_id, the id the partner’s program gave the child, is CGEF ciphertext (field class Opaque, no blind-index sibling: nothing looks a report up by it). It is stored nowhere else.

  • One receipt. The partial UNIQUE uq_medicaid_application_reports_receipt (application_id) WHERE kind = 'receipt' holds one receipt per application. A CHECK keeps a receipt to its reference alone.

  • Row guard. refuse_medicaid_application_report_mutation() refuses every UPDATE and DELETE: a newer outcome is a new row, and an application’s latest outcome from an interface is the one with the greatest id. The table is scheme-frozen as medicaid_applications is: the guard refuses the crypto rewrite tool’s in-place UPDATE.

  • The write. POST /v1/cases/medicaid-applications/partner-reports admits the service caller craig-exchange alone (a service principal, that identity, no delegated channel), and answers that before it judges the body. A receipt names its application by id. An outcome names a person by an identifier kind and value and the application by the receipt’s reference: the route finds the one person holding that identifier live (by the blind index of person_identifiers.value), then that person’s application whose receipt came from the same interface with the same reference. It then locks the application’s row FOR UPDATE, as a retraction does, and compares and stores under that lock.

    Answer (outcome) Status When

    applied

    201

    the report is stored

    replayed

    200

    it equals the application’s latest report of its kind from that interface (a receipt: the application’s one receipt); nothing is stored

    unknown

    200

    a receipt names no application; or an outcome’s identifier is held live by no one person, or its reference matches no receipt from that interface; nothing is stored

    withdrawn

    200

    the application has been retracted; nothing is stored

    —

    409 medicaid-referral-receipt-conflict

    a receipt for an application that holds one under another reference or from another interface; nothing is stored, and the detail names neither reference

  • The read. MedicaidApplication.reports carries an application’s reports in stored order on both application reads and on every act’s answer, under the application’s own authorization (case read), the program id decrypted. No other route reads them.

  • Outbound. craig-exchange reads an application as a stage of the outbound projection: GET /v1/cases/medicaid-applications/{id}/outbound-principals and …/{person_id}, admitted as every outbound arm is (the craig-exchange service identity alone) and audited by the outbound_principals release wrapper (stage_kind = medicaid_application). The stage is the application (status submitted or retracted; a retracted one is served) with the custody facts of the episode it was submitted on and its own facts (the day it was submitted, the citizenship status decrypted for that response only, prior medical assistance, the legal administrative unit). Its one principal is the child, with the live identifier of the kind StateBundle::medicaid_application_identifier_kind() names, decrypted for that response only; none when the bundle names no kind or the child holds no live identifier of it. The open-stages walk answers, for kind = medicaid_application, the submitted applications that hold no receipt.

  • Events. Each stored report stages case.medicaid_application_report_received in the write’s transaction: the strict MedicaidApplicationReportReceivedPayload (report_id, application_id, child_id, case_id, kind, interface, exchange_transaction_id, received_at), with nothing the partner stated. craig-security audits it as an update of medicaid_application by the posting service. A replay, an unknown and a withdrawn stage none. See ADR-003.

  • Seed. None, as for applications; the at-rest proof of program_id is the devstack test the_program_id_is_sealed_at_rest.

ER Diagram

personsuuididPKtextfirst_nametextlast_nametextdate_of_birthtextdob_hmacintegerbirth_yearbooleandob_estimated_abandonedsmallintyear_of_birth_declaredtextsextextssn_last_fourtextssn_hmactextssntextssn_full_hmacbooleanssn_verifiedtimestamptzssn_verified_attextssn_verified_bytextssn_verification_methodtextmiddle_nametextname_suffixtextbirth_citytextbirth_statechk: USPS abbreviationtextprimary_languagetextmarital_statustextdob_verificationNULL without a date_of_birthtimestamptzdob_verified_attextdob_verified_bytimestamptzcreated_attimestamptzupdated_atperson_residencesuuididPKuuidperson_idFKdateeffective_fromdateeffective_untilNULL = open; chk: after effective_fromtextadmin_unitcanonical unit nametimestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe row this one correctstimestamptzretired_attextretired_reasontextretired_noteuuidretired_bytimestamptzclosed_atuuidclosed_byperson_demographic_factsuuididPKuuidperson_idFKdateeffective_fromdateeffective_untilNULL = open; chk: after effective_frombooleanrace_american_indian_or_alaska_nativethe eight race_* columns: all-or-nonebooleanrace_asianbooleanrace_black_or_african_americanbooleanrace_native_hawaiian_or_other_pacific_islanderbooleanrace_whitebooleanrace_unknownbooleanrace_abandonedbooleanrace_declinedtextethnicityhispanic / non_hispanic / unknown / abandoned / declinedtexttribal_member_or_eligibleyes / no / unknowntexttribal_memberyes / no / unknowntexttribal_affiliationat most 255 characterstimestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; excl_person_demographic_facts_window over live rowstextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_attimestamptzclosed_atset only by a closing UPDATE; NULL on a row born with its enduuidclosed_bythe closing worker; chk: set with closed_atperson_siblingsuuididPKuuidperson_aFKchk: person_a < person_buuidperson_bFKdateeffective_fromdateeffective_untilNULL = open; chk: after effective_fromtimestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; excl_person_siblings_window over live rowstextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_attimestamptzclosed_atset only by a closing UPDATE; NULL on a row born with its enduuidclosed_bythe closing worker; chk: set with closed_atperson_parentage_factsuuididPKuuidperson_idFKthe childdateeffective_fromdateeffective_untilNULL = open; chk: after effective_frombooleanparents_abandonedNOT NULL; (c)(1)/(c)(2) indicatorbooleansole_legal_parentNULL = not assessedtimestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; excl_person_parentage_facts_window over live rowstextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_attimestamptzclosed_atset only by a closing UPDATE; NULL on a row born with its enduuidclosed_bythe closing worker; chk: set with closed_atchild_parentsuuididPKuuidperson_idFKthe childuuidparent_person_idFKchk: never the childdateeffective_fromdateeffective_untilNULL = open; chk: after effective_fromtextrolemother / father / legal_guardian / putative_parentbooleanlegal_responsibilityNULL = unanswered; chk: never TRUE for putative_parenttimestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; excl_child_parents_window per (child, parent) over live rowstextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_attimestamptzclosed_atset only by a closing UPDATE; NULL on a row born with its enduuidclosed_bythe closing worker; chk: set with closed_atreferralsuuididPKtimestamptzreceived_attextreporter_typetextreport_sourcechk_referrals_report_source: the 15 NCANDS RptSrc tokens (#648); copied from the report at conversiontextreporter_first_nametextreporter_last_nametextreporter_phonetextreporter_relationtextcountytextresponse_priorityruleset roll-up token; UNDERIVED = pre-cutover backfill (#1746)textresponse_priority_basisnullable, all-or-none provenance settextresponse_priority_rule_set_namenullablebigintresponse_priority_rule_set_revisionnullableuuidresponse_priority_evaluation_idnullable, rules-side, no FKbooleanicwa_flagtextcreated_bytimestamptzcreated_attextupdated_bytimestamptzupdated_atallegationsuuididPKuuidreferral_idFKuuidvictim_idFKuuidperpetrator_idFKnullabletextabuse_typetextdescriptiontextdispositionchk_allegations_disposition: the 7 NCANDS outcomes (#648); NCANDS Mal*Lev sourcebooleanchild_fatalityNCANDS #34 Maltreatment Death sourcebigintversionADR-062 §G1 optimistic-concurrency CAS (#1266)investigationsuuididPKuuidreferral_idFKtextassigned_workertextassignment_areatextstatusopen|pending_review|closedtimestamptzresponse_due_atDERIVED at open (#1747)textresponse_prioritynullable, window-provenance settextresponse_due_basisnullabletextresponse_rule_set_namenullablebigintresponse_rule_set_revisionnullableuuidresponse_evaluation_idnullable, rules-side, no FKtimestamptzresponse_due_originalnullable, override set (#1748)timestamptzresponse_due_overridden_atnullableuuidresponse_due_overridden_bynullabletextresponse_due_overridden_reasonnullable, on its ownuuidresponse_due_override_evaluation_idnullabletimestamptzfirst_contact_attimestamptzclosed_attextdispositionchk_investigations_disposition: the 7 NCANDS outcomes (#648); NOT NULL when closed (#1764)textadmin_unitthe referral's county — stamped at open, backfilled (#1901)timestamptzcreated_attimestamptzupdated_atsafety_assessmentsuuididPKuuidinvestigation_idFKjsonbfactstextrule_set_nametextrule_set_versionuuidrule_set_idbigintrule_set_revisionuuidevaluation_idtextengine_decisiontextworker_overridetextworker_override_reasontextassessed_bytimestamptzassessed_atcasesuuididPKtextcase_numberUKuuidreferral_idFKnullableuuidinvestigation_idFKnullabletextstatusopen|closed|transferredtextstagetextcountytextassigned_workertextsupervisortimestamptzopened_attimestamptzclosed_attextclosure_reasonbooleanicwa_flagtimestamptzcreated_attimestamptzupdated_atcase_householduuididPKuuidcase_idFKuuidperson_idFKone ACTIVE row per (case_id, person_id), #1831textrolebooleanprimary_caregiverbooleanactivetimestamptzadded_atchild_parenting_factsuuididPKuuidperson_idFKa child-role case_household member, active or notuuidcase_idFKdateeffective_fromdateeffective_untilNULL = open; chk: after effective_fromtextpregnantyes / notexthas_fathered_or_bore_a_childyes / notextplaced_togetheryes / no / not_applicable; chk: not_applicable iff has_fathered_or_bore_a_child = no (both answered)timestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; excl_child_parenting_facts_window over live rowstextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_attimestamptzclosed_atset only by a closing UPDATE; NULL on a row born with its enduuidclosed_bythe closing worker; chk: set with closed_atchild_prior_permanency_factsuuididPKuuidperson_idFKa child-role case_household member, active or notuuidcase_idFKdateeffective_fromdateeffective_untilNULL = open; chk: after effective_fromtextprior_adoptionyes / no / abandoneddateprior_adoption_monthfirst of month; chk: present iff prior_adoption = yestextprior_adoption_intercountryyes / no; chk: present iff prior_adoption = yestextprior_guardianshipyes / no / abandoneddateprior_guardianship_monthfirst of month; chk: present iff prior_guardianship = yestimestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; excl_child_prior_permanency_facts_window over live rowstextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_attimestamptzclosed_atset only by a closing UPDATE; NULL on a row born with its enduuidclosed_bythe closing worker; chk: set with closed_atchild_assistance_factsuuididPKuuidperson_idFKa child-role case_household member, active or notuuidcase_idFKdateeffective_fromdateeffective_untilNULL = open; chk: after effective_fromtextsupport_statuschild_has_received_support_assistance / no_support_assistance_receivedtextsource_state_tribal_adoption_assistancethe eight source_* columns: applies / does_not_apply; all iff received, else nonetextsource_state_tribal_foster_caretextsource_title_iv_e_adoption_subsidytextsource_title_iv_e_guardianship_assistancetextsource_title_iv_a_tanftextsource_title_iv_btextsource_chafee_programtextsource_othertimestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; excl_child_assistance_facts_window over live rowstextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_attimestamptzclosed_atset only by a closing UPDATE; NULL on a row born with its enduuidclosed_bythe closing worker; chk: set with closed_atchild_sibling_factsuuididPKuuidperson_idFKa child-role case_household member, active or notuuidcase_idFKdateeffective_fromdateeffective_untilNULL = open; chk: after effective_frominttotal_siblings0-999timestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; excl_child_sibling_facts_window over live rowstextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_attimestamptzclosed_atset only by a closing UPDATE; NULL on a row born with its enduuidclosed_bythe closing worker; chk: set with closed_atchild_icwa_factsuuididPKuuidperson_idFKa child-role case_household member, active or notuuidcase_idFKdateeffective_fromdateeffective_untilNULL = open; chk: after effective_fromtextinquiries_madeyes / notextinquiry_motheryes / no / the_biological_or_adoptive_mother_is_deceasedtextinquiry_fatheryes / no / the_biological_or_adoptive_father_is_deceasedtextinquiry_indian_custodianyes / no / child_does_not_have_an_indian_custodiantextinquiry_extended_familyyes / notextinquiry_childyes / notextinquiry_domicile_or_residenceyes / notextinquiry_legal_guardianyes / no / child_does_not_have_a_legal_guardiantextreason_to_knowyes / nodatereason_to_know_discovered_onchk: only when reason_to_know = yestexticwa_appliesyes / no / unknowndateicwa_applies_notified_onchk: only when icwa_applies = yestexttribe_notifiedyes / no; no gatetexttribes_notified1-255 chars; chk: only when tribe_notified = yestextparent_or_indian_custodian_notifiedyes / no; unqualified, read by nothing, NULL on rows written since #2004textcourt_determinationyes_icwa_applies / no_icwa_does_not_apply / no_court_determinationdatedetermined_onchk: only when court_determination = yes_icwa_appliestextdetermination_tribe1-255 chars; chk: only when court_determination = yes_icwa_appliestextactive_effortsyes / no; chk: only when court_determination = yes_icwa_appliestexttribe_order_foster_careyes / no; chk: only when court_determination = yes_icwa_appliestexttribe_order_adoptiveyes / no; chk: only when court_determination = yes_icwa_appliestexttribe_notified_before_first_proceedingyes / no; chk: yes only when tribe_notified = yestextparent_or_indian_custodian_notified_before_first_proceedingyes / nodatetribe_order_foster_care_onchk: only when tribe_order_foster_care = yesdatetribe_order_adoptive_onchk: only when tribe_order_adoptive = yestimestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; excl_child_icwa_facts_window over live rowstextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_attimestamptzclosed_atset only by a closing UPDATE; NULL on a row born with its enduuidclosed_bythe closing worker; chk: set with closed_atparental_rights_actionsuuididPKuuidperson_idFKthe child; a child-role case_household member, active or notuuidcase_idFKuuidparent_person_idFKa live child_parents link (parent-not-linked)dateeffective_onNOT NULL; the assessment date, or the earliest component datetextkindvoluntary / involuntary / not_applicabledatepetition_filed_onNULL = no petition; chk: none on not_applicablebooleanparent_deceasedNOT NULLdatedied_onchk: exactly when parent_deceaseddateterminated_onNULL = pending; chk: none on not_applicableuuidcourt_order_idFKnullable; an active termination_of_parental_rights order of this casetextbeyond_a_reasonable_doubtyes / no; involuntary onlytextqualified_expert_witnessesyes / no; involuntary onlytextactive_effortsyes / no; involuntary onlytextexecuted_in_writingyes / no; voluntary onlytextrecorded_before_a_courtyes / no; voluntary onlytextaccompanied_with_a_certificationyes / no; voluntary onlytimestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; RETIRE is the only admitted updatetextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_atpermanency_plansuuididPKuuidperson_idFKthe child; a child-role case_household member, active or notuuidcase_idFKtextplanthe seven PermanencyGoal tokensdateestablished_onNOT NULL; CURRENT = latest (established_on, recorded_at, id)timestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; RETIRE is the only admitted updatetextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_atchild_review_eventsuuididPKuuidperson_idFKthe child; a child-role case_household member, active or notuuidcase_idFKtextkindperiodic_review / permanency_hearingdateheld_onNOT NULLuuidcourt_order_idFKnullable; the hearing order that wrote the row (never on the wire)timestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; RETIRE is the only admitted updatetextretired_reasoncorrected / retracted / order_corrected / order_deletedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_atperson_identifiersuuididPKv7uuidperson_idFKtextkinda StateBundle identifier kind (GA: gtid, empi)textvalueCGEF ciphertexttextvalue_hmacBlindIndex digest; NULL only keylessdateeffective_fromdateeffective_untilNULL while live; never after todaytextprovenanceworker_attestedtimestamptzrecorded_atuuidrecorded_bytimestamptzended_atuuidended_bytimestamptzretired_atlive while neither retired nor endeduuidretired_bytextretired_reasonretractedtextretired_notecustody_episodesuuididPKv7; the stable episode identityuuidchild_idFKuuidcase_idFKthe owning case, for lifedatecustody_fromthe earliest live in-custody row (deferred trigger)datecustody_untilthe live closing row; NULL while opentimestamptzrecorded_atuuidrecorded_bytimestamptzretired_atlive while NULL; EXCLUDE over live windows per childuuidretired_bytextretired_reasonretractedtextretired_notethe episode retract's notelegal_status_factsuuididPKuuidperson_idFKthe child; a child-role case_household member, active or notuuidcase_idFKtextstatus_tokena StateBundle vocabulary tokentextcustody_classin_custody / not_in_custody, stamped at writedateeffective_onNOT NULLuuidchain_root_idthe original's id, kept by correctionsbigintchain_seqorders a day's rows; per child, kept by correctionsuuidepisode_idFKnullable; NULL = a history rowuuidcourt_order_idFKnullable provenancetextnotetimestamptzrecorded_atuuidrecorded_byuuidsupersedes_idFKthe corrected predecessortimestamptzretired_atlive while NULL; RETIRE is the only admitted updatetextretired_reasoncorrected / retracted / order_corrected / order_deleted / episode_retractedtextretired_noteuuidretired_bythe retiring worker; chk: set with retired_atmedicaid_applicationsuuididPKv7uuidcase_idFKuuidchild_idFKthe child; a child-role case_household memberuuidepisode_idFKthe child's open episode in the case at submit; composite FKtextcitizenship_statusCGEF ciphertext (Opaque)textprior_medical_assistanceyes / no / unknowntextlegal_admin_unitthe canonical admin-unit namedatesubmitted_onthe jurisdiction's business datetimestamptzsubmitted_atuuidsubmitted_bytimestamptzretired_atlive while NULL; one live per episodeuuidretired_bytextretired_reasonretractedtextretired_notemedicaid_application_reportsuuididPKv7; stored orderuuidapplication_idFKtextinterfacethe partner interface that reported ittextkindreceipt / outcome; one receipt per applicationtextpartner_referencethe partner's reference for the applicationtextpartner_case_referencean outcome may state ittextprogram_idCGEF ciphertext (Opaque); an outcome may state ittextstatuspending / approved / denied / closed; an outcome may state itdatereported_onan outcome may state ittimestamptzreceived_atuuidexchange_transaction_idthe craig-exchange transaction; no FKcase_plansuuididPKuuidcase_idFKtextstrengthstextneedstextstatusdraft|active|completed|supersededtextapproved_bytimestamptzapproved_attimestamptzreview_due_attextcreated_bytimestamptzcreated_attimestamptzupdated_atcase_plan_tasksuuididPKuuidcase_plan_idFKtextdescriptiontextresponsibletimestamptzdue_attimestamptzcompleted_attextstatuspending|in_progress|completedcontactsuuididPKuuidcase_idFKtextcontact_typetextcontact_withtimestamptzoccurred_atintegerduration_minutestextnarrativetextrecorded_bytimestamptzcreated_atbigintversionADR-062 §G1 If-Match CAS (#1266)uuidvisited_child_idFKnullable; home / office / school visits only; a child member of the casetextlocationchilds_residence / other_location; set exactly when visited_child_id iscontact_revisionsuuididPKuuidcontact_idFKbigintversionthe superseded version; UNIQUE (contact_id, version)timestamptzoccurred_atuuidvisited_child_idFKnullabletextlocationnullabletimestamptzsuperseded_atclock_timestamp() after the row lockuuidsuperseded_byNOT NULL (#2231): the acting worker whose update superseded the triocontact_attachmentsuuididPKuuidcontact_idFKtextattachment_typetextfile_nametextcontent_typebigintfile_sizetextobject_keytimestamptzuploaded_attextuploaded_bycourt_ordersuuididPKuuidcase_idFKtextorder_typetextcourt_nametextjudgedateorder_datedateeffective_datejsonbfindingsdatenext_hearing_datetextobject_keyuuidcurrent_attempt_idnullable, ADR-062 §U replace pointer (SU2)timestamptzcurrent_attempt_created_atnullable, the current attempt's claim instant: the fence's order key (#2173)textrecorded_bythe acting worker's sub (#2031)textrecorded_by_namethe acting worker's username (#2031)timestamptzcreated_atbigintversionADR-062 §G1 If-Match CAS (#1266)containsvictimperpetratorinvestigated byassessed inoriginated fromsubstantiated bymembersis memberdemographicssupersedessibling (a)sibling (b)supersedesparentage (child)supersedeschildparentsupersedeschild factschildsupersedeschild factschildsupersedeschild factschildsupersedeschild factschildsupersedeschild factschildsupersedesrights actionschildparentTPR ordersupersedesplanschildsupersedesreviewschildhearingsupersedesownsidentifierschildlegal statuseschildepisode rowsordersupersedesapplicationscasechildpartner reportsvisited childplanned undertasksdocumented inattached tosuperseded triovisited child (as was)ordered under
Edit this page · latest