Plan: AFCARS Pipeline I — The Sources: Three Service-Only Projections (#1965, P-D1 of #949)

Archive record

Merge requests: !1764 (U0 plan page + D7’s errata + the unit, page and follow-up issues, Relates #1965) + !1765 (U1, Closes #2118) + !1766 (U2, Closes #2119) + !1767 (U3, Closes #2120) + !1768 (U4, Closes #2121) + !1769 (U5, Closes #2122) + !1773 (U6, Closes #2123) + !1775 (U7, Closes #2124)

2026-10-01 — approved in plan mode 2026-09-30 (rulings R-D1–R-D7 as recommended) after a contextless round 1 (no-ship, 3 blockers fixed, 10 findings folded), the maintainer’s round 2 (no-ship, 12 findings and the mixed-time limitation folded) and a fold check (every finding fixed); what landed — settings (U1: placement_base_url onto ServiceSettings; craig-reporting reads settings.cases_base_url, its env renamed CRAIG_REPORTING__CASES_BASE_URL, no alias); the placement export (U2: GET /v1/placement/afcars-export, the craig-reporting-only caller gate, D3’s window through the new shared craig_common::export_window, craig_validation::bounded_page_limit, the cohort closed at from, the kind-tagged row stream and keyset cursor, the episode and arrangement rows, one placement.afcars_released per non-empty page — the event’s first producer); the placement facts (U3: the caregiver slots, the trafficking_statement and law_enforcement_report rows, the health and education windows, the (b)(9) health_assessment_visit rows); the cases export (U4: POST /v1/cases/persons/afcars-export, child keys (person, case) and adult keys (person, role), at most 500 keys and 10 000 anchors per call, the key-digest cursor, the narrow types, membership not_found, the DOB-only decrypt, the person and demographic_window rows, case.person_pii_exported through publish_person_pii_released_for_afcars, the release requestor and purpose types moved to craig_reporting_contracts::afcars_release, ADR-041, ADR-051 and ADR-078 amended (R-D5) plus an ADR-003 wrapper row, the ledger-lift golden re-blessed); the cases ledgers (U5: parent_cells over ledger rows normalized to as_of, the child window ledgers with ICWA also at each anchor, permanency plans, reviews, sibling links and visits); financial (U6: GET /v1/financial/afcars-facts, the R-D4 predicate, child-id keyset pages, no-store, no audit and no transaction; OWNED_ELSEWHERE’s `oohc.b18 row moved to #1965). No unit adds a migration; nothing consumes the routes until P-D2. Full-page timings on #1965, each at limit = 1000 against 4 s (half the 8 s S2S_HOP_BUDGET): placement 75.5 ms median (U3), cases 58.95 ms median (U5); the 1 000-row ceiling stands. Errata (2026-10-01): U4’s store reads sit in services/craig-cases/src/store/afcars_export.rs and services/craig-cases/src/store/person_demographics.rs, and D3’s window check is the one shared craig_common::export_window; U5’s ledger reads sit in services/craig-cases/src/store/afcars_ledgers.rs, its visit row answers occurred_at, and its icwa_window carries the two tribe orders. Follow-ups: the later P-D pages #2125 (P-D2), #2126 (P-D3), #2127 (P-D4) and #2129 (P-D5, after #1987); #2128 (the tardy transcription, before P-D3’s classes unit); #2130 (NCANDS’s marking-only transmit route); #2131 (the history of D3’s class-3 edits). P-D2’s inputs — the routes and contracts, the bounds, the refusal split, the audit keys, the timings, financial_base_url with its client, (a)(3)'s case selection and the #2027 population node — go to #2125. #1965 stays open: P-D5’s close-out resolves it.

Status

Done (2026-10-01) — !1775

Anchor What binds here

#1965; AFCARS 2020 Program (#949)

A6 (resolved instants; facts at each element’s anchor; the three projections) with its 2026-09-26 and 2026-09-28 errata, R11 (PII posture), R12 (no delivery) — errata requested (D7); A7–A10 belong to P-D2–P-D5 (D1)

The P-D inputs on #1965 (P-C, P-B1, P-B2 D3 / D6 / D11, P-B3 D2–D4, P-B3 U3)

binding: the release-audit key, the caregiver slot rule, the adoptive-parent ids, the trafficking anchor, the Tribe’s order at arrangement and exit dates, the parent year rule, the (c)(5) arms

P-C (#1964) D5 and its (a)(1)–(a)(4) erratum (:168)

afcars_parents.rs: the (c) cells at one anchor, pure and typed; (a)(3) is the case’s admin_unit

rulesets/federal/federal-afcars-2020.json 1.1.0 + the pinned CFR (§1355.43–.46 in the federal ruleset’s gitignored .policy-cache, .gitignore:32; §1355.42 pins with #2027)

every anchor, value set and clean class cited here

ADR-041 § Amendment #1990 and its persons table row, ADR-051 § Amendments #1990, ADR-078 (P-C’s DOB line)

amended (R-D5): the child’s and the adoptive parents' date of birth

ADR-003 (the multi-wrapper rule), ADR-022 (the outbox), ADR-068 D1a (the ceilings)

a new case.person_pii_exported wrapper row; audits staged in the handler’s transaction; no ceiling row

services/craig-cases/src/api/ncands.rs:40-90

the precedent: a service-only export to craig-reporting, its allowlist of one, its // authz: skip line, its 400s, its DOB-only decrypt

⁂ = a reading DFCS (Georgia’s Division of Family and Children Services) may rule otherwise, logged on #1073. ACF: the Administration for Children and Families. "Local" is craig_common::clock::BusinessClock on the service’s jurisdiction clock (date_of, instant_of_local).

Context (census 2026-09-30, on main)

  • No projection exists. No afcars-export route in any service; financial has no service-only route at all. The cases persons/federal-export (cap 5 000) was deleted as over-disclosing (#1990); A6’s 5 000 is its cap.

  • The audits are half built. placement.afcars_released is catalogued with a strict payload and a craig-security arm (crates/craig-placement-contracts/src/events.rs:120-165, services/craig-security/src/event_parsing.rs:518) but has no producer. Cases audits a purpose-tagged release through case.person_pii_exported wrappers (services/craig-cases/src/events.rs:413-431, :706-731); craig-security audits the key on its generic order.

  • The rows are captured and complete. The placement map is at LAST_UNIT (67 keys), the cases map at its last unit (57); the partition is 57 + 67 + 18 OWNED_ELSEWHERE = 142 (xtask/src/cmd/afcars_partition.rs). Every cases-owned child element is anchored at period_end; placement’s at removal_date, arrangement_date, exit_date, period_end or, for (b)(11), period_end_or_exit (dictionary o_temporal_anchor). §1355.44(f) bounds no event history to the period ("each permanency plan", "each periodic review", "each date").

  • Two approved texts disagree. OWNED_ELSEWHERE gives (b)(18) to #1966 (crates/craig-reporting-contracts/src/afcars_capture.rs:139), A6 and #1965 to P-D (R-D3). (b)(1) is date + indicator, clean class hundred_percent, and (h)(3) / (h)(8) are dates, yet ADR-041, ADR-051 and ADR-078 say the file reports a year (R-D5).

  • The bulletins gate the surface. The dictionary has no metadata pins, so a deployed surface stops at layout-unpinned (services/craig-reporting/src/afcars_surface/verify.rs:164-182) until #1987; §1355.46(b)(5)'s tardy rule ("more than 30 days after the event") is pinned federal text that no dictionary table carries.

Scope

In: D2’s settings; the three routes with their contracts, audits, test-lib clients and API pages (D3–D6); P-D’s decomposition and the errata, issues and ⁂ entries it implies (D1, D7).

Out: reporting’s clients and everything that consumes the answers — element derivation, applicability, the population rule (#2027), records, validation, the artifact, readiness (P-D2–P-D5, D1); the assistance cohort (P-E extends afcars-facts); any NCANDS change.

Design

D1 — P-D in five gated pages (R-D1, R-D2)

Page Scope W Starts

P-D1

this page

25

now

P-D2

records and generate: the reporting field key, craig-reporting-fields and its KCV row (R11); the A7 tables, the supersede chain, the snapshots; the three clients and financial_base_url; element assembly, incl. the population table, (a)(3)'s case selection and the (b)(20) / (b)(21) and same-day plan derivations; the generate job, the 202 flip on every consumer, replay vs regenerate

≈ 30

after P-D1; its population unit after #2027

P-D3

validation (A8) without the bulletin rows: the predicate evaluator, exemptions, applicability, ok | missing | invalid | tardy, aggregation, finalize and the rewritten validated_with_errors.sql; the P-D-owned findings; review-afcars

≈ 25

after P-D2; its classes unit after the tardy transcription (R-D6)

P-D4

readiness (A9 without the bulletins): the encrypted artifact, readiness in the export finalizer, ready_for_transmission replacing the marking-only transmit route

≈ 19

after P-D3

P-D5

the bulletin half: consistency, recurrence, aggregation overrides; the XML replacing the TSV; the record number and its key custody; the A10 reservation and the lifecycle e2e; the seed test; Closes #1965

≈ 30

after #1987

  • Each page runs census → design → round 1 → the maintainer’s gate, and gets a plan issue at U0 (P-D2 … P-D5, Plan::NEEDED).

  • Until #1987 no deployed surface verifies, so from P-D2’s generate unit a real AFCARS generate answers the typed 503 afcars-surface-not-ready. Nothing working is lost: today’s generate returns a zero-record draft that can never advance (services/craig-reporting/src/api/afcars.rs:63-145).

  • Forks their own pages decide: the seed test’s reachable outcome ((h)(14) is P-E’s; (a)(4) waits on #1987); the lifecycle e2e under R14 (an API-created far-past removal is honestly tardy); the reservable pool (2023A is the only seed-free half); `review-afcars’s surfaces.

D2 — Settings (A6)

  • placement_base_url MOVES from FinancialSettings to ServiceSettings, beside cases_base_url, with its default. craig-financial reads settings.placement_base_url (services/craig-financial/src/main.rs:249); its env name is unchanged (CRAIG_FINANCIAL__PLACEMENT_BASE_URL). Never a twin: flatten hands a leaf two structs declare to the first (settings.rs:297-304).

  • Reporting reads settings.cases_base_url, not the raw env: CRAIG_REPORTINGCASES_URL becomes CRAIG_REPORTINGCASES_BASE_URL in docker-compose.yml, .env.example (:177), configuration-reference.adoc and deployment-guide.adoc, and shared-crates.adoc’s settings list names the moved leaf. Pre-1.0 there is no alias; the CHANGELOG `Changed entry carries the Ops line.

  • financial_base_url lands with its first reader, P-D2’s client (erratum on A6’s "in P-D’s first unit"): no unread leaf ships.

  • Pins, on the settings.rs:2490-2500 precedent: a non-default value under the financial and the reporting prefixes reaches the one placement_base_url / cases_base_url leaf through the production loader.

D3 — The contract the three routes share

  • Caller. claims.require_service_caller()?, then claims.service_id() == Some(AFCARS_EXPORT_CONSUMER) ("craig-reporting") and claims.channel().is_none() (no honoured X-Craig-Actor relay, crates/craig-auth/src/claims.rs:243; the middleware honours one on any service caller), else 403 before any read. The // authz: skip — … line sits directly above the utoipa attribute (services/craig-cases/src/api/ncands.rs:46-55): a consumer identity is not jurisdiction policy.

  • Window. from, to (exclusive) and as_of: RFC 3339 instants, all required. from and to must each be a local midnight (instant_of_local(d at 00:00`)` equals the instant) with from < to, so the date and instant views agree: an instant t is in the period iff from ⇐ t < to, a date d iff from_d ⇐ d < to_d (from_d = date_of(from), to_d = date_of(to)), and period_end = to_d − 1 day. as_of lies at least EXTENDED_REQUEST_CEILING (5 min, the longest request ceiling, crates/craig-common/src/ceiling.rs:58) in the past, so every request transaction that stamped a row at or before it has ended before page 1 is read. No period string and no local date on the wire; every request struct is deny_unknown_fields.

  • Refusals. GET (D4, D6): an unknown or malformed parameter is the Query extractor’s 400; a window, as_of, limit or cursor check is 400 bad-request naming the parameter (the NCANDS 400s, ncands.rs:60-63). POST (D5): a JSON data error (unknown field, wrong type, missing key) is the extractor’s 422 (crates/craig-common/src/extract.rs:3-18); a window, as_of, cap, key or cursor check is 422 validation-failed naming the field.

  • As of — three classes. (1) A ledger row (recorded_at and retired_at) is read as it stood at as_of: visible iff recorded_at ⇐ as_of and (retired_at IS NULL OR retired_at > as_of), and normalized to that snapshot before any use — a retirement after as_of reads as live; a close after as_of reads open (effective_until and closed_at NULL; one statement sets both, crates/craig-ledger/src/store/window.rs:124). (2) A stamped table is fenced on its stamps: an arrangement is effective iff activated_at ⇐ as_of AND (status <> 'retracted' OR retracted_at > as_of) (both now(), store/placements.rs:381, :494); a contact or health record exists iff created_at ⇐ as_of AND (deleted_at IS NULL OR deleted_at > as_of) (soft deletes stamp deleted_at, store/contacts.rs:209, store/health.rs:278); a caregiver binding iff created_at ⇐ as_of; a payment iff issued_at ⇐ as_of. (3) In-place edits keep no history and read as they stand when the page is read: placements.ended_at and fact columns, caregiver_bindings.ended_on, health_records values, contacts.occurred_at, visited_child_id and location (store/contacts.rs:178-185), persons, cases, case_household, payments.status and net_amount. Only class (3) makes the export mixed-time; the OpenAPI text says so; the history issue owns it (D7).

  • Anchors. A window ledger answers only the rows in force at the anchors its elements name (A6: "facts effective at the anchors"), each distinct row once however many anchors it covers — reporting matches each anchor to the window holding it; an event ledger answers its rows dated on or before period_end, since §1355.44 asks for "each".

  • Answer. 200, Cache-Control: no-store, a typed body from the producer’s contracts crate. Every row is a narrow export struct naming its fields: element columns, ids and dates only. Its only free text is a text column AFCARS_ELEMENT_COLUMNS maps ((b)(4)(ii) tribal_affiliation, (b)(5)(ii) tribes_notified, (b)(6)(iii) determination_tribe, (e)(6) arrangement_jurisdiction) and the case’s admin_unit — never a note, a narrative, an actor id or name. An audit (D4, D5) is staged in the handler’s own transaction through execute_within_tx (crates/craig-api/src/lib.rs:258) before the body is built, so a failed stage releases nothing (persons_ssn_release.rs:213-231).

  • Pages bound rows, not children. An answer is a flat stream of typed rows (a kind-tagged enum), each naming its child or key, ordered by (child id or key index, kind, row id). A page holds at most limit rows (1..=1000), so one history-heavy child spans pages; next is an opaque cursor over the last row (the cases cursor also carries a digest of the key list, a mismatch refused), null at the end. U3 and U5, once every row kind exists, time a full page on the devstack and record it on #1965; the ceiling on limit keeps a page under half the 8 s S2S_HOP_BUDGET (ceiling.rs:112; a lower ceiling is an erratum). A6’s "≤ 5 000 ids per call" becomes 500 keys per cases call (erratum).

  • Rows, not elements. A route answers rows and typed cells, never a dictionary token or an applicability outcome; reporting derives every element (P-D2). The only producer-side rules are those this program gave a producer: the caregiver slots (P-B2 D6), the (c) cells (P-C D5) and (b)(18)'s payment predicate (R-D4). "The (x) columns" means the columns AFCARS_ELEMENT_COLUMNS maps for those keys (crates/craig-placement-contracts/src/afcars.rs:613, crates/craig-cases-fields/src/afcars.rs:171).

  • Surfaces per route, in its own MR. A test-lib TypedClient (crates/craig-test-lib/src/harness.rs:353-362 precedent), an xtask/route-to-client-method.toml row, the regenerated API page (cargo xtask api-docs), a services.adoc row.

D4 — Placement: GET /v1/placement/afcars-export

  • Query. D3’s window, after and limit.

  • Cohort. The children with an episode live at as_of whose removal is before to and whose exit is absent or at or after from — closed at from: an exit at the period’s first instant ends responsibility inside this period, which the population rule retains (§1355.42(a)(2), pinned with #2027) — the instants taken from the removal and exit responses live at as_of (the episode row’s current instants follow later corrections). Every page evaluates the same cohort. It is the cohort BEFORE the population rule (reporting’s, #2027): a sibling in care at an anchor has an episode in the window, so (b)(20) / (b)(21) need no second mode.

  • Rows per cohort child, in kind order.

    • episode: every episode live at as_of with removal before to — its id and case_id; its live removal response (removal_at, first_recorded_at, the (d)(3), (d)(4), (i)(1), (i)(4) columns); its live exit response only when exit_at < to (exit_at, exit_reason, transfer_agency_type, first_recorded_at, the (h) and (i)(10)–(i)(13) columns with both adoptive parent ids).

    • arrangement: each arrangement of those episodes effective at as_of (D3 class 2) with started_at < to — started_at, ended_at, placement_type, the setting identity, the (e) and (i)(5)–(i)(8) columns. A family arrangement (placement_type = 'foster_family_home'; a congregate row’s foster_home_id is not a family) carries its first and second caregiver person ids at its (e)(1) date d, by P-B2 D6: covering is effective_from ⇐ d AND (ended_on IS NULL OR ended_on > d) AND ended_on IS DISTINCT FROM effective_from, each person’s first covering binding by role (primary, co), effective_from, created_at, id. The store’s closed COVERING_SQL (src/store/caregivers.rs:142-144) is not reused.

    • trafficking_statement: per episode, the latest live statement with stated_on < to_d (the statement in force at the anchor, P-B3 D2); law_enforcement_report: every live report with reported_on < to_d. Raw: the (d)(6)(i) gate is reporting’s.

    • health_window (child_health_facts): the live window in force at period_end; education_window (child_education_facts): the live window in force at period_end and, for (b)(11)'s period_end_or_exit, at the local date of each answered exit with exit_at >= from.

    • health_assessment_visit: the visit_date of every health_records row existing at as_of (D3 class 2) and flagged health_assessment, inside an answered episode’s window and before to_d.

  • Audit. One placement.afcars_released per non-empty page — requestor, purpose, the distinct children with rows on the page as child_ids and child_count, from, to, as_of — through a new domain_event! wrapper in services/craig-placement/src/events.rs.

  • Files. crates/craig-placement-contracts/src/afcars_export.rs; services/craig-placement/src/api/afcars_export.rs with its store reads in src/store/afcars_export.rs; services/craig-placement/tests/api/afcars_export.rs.

D5 — Cases: POST /v1/cases/persons/afcars-export (R-D5)

  • Body. D3’s window, children: [{person_id, case_id, anchors}], adults: [{person_id, role, anchors}] (role caregiver or adoptive_parent), after and limit. A child key is its (person_id, case_id) and an adult key its (person_id, role): one person may be a child key and hold both adult roles (a foster parent who adopts); a repeated key is refused. At most 500 keys and 10 000 anchors in all (reporting splits keys across requests; pages bound the rows); anchors are distinct local dates on or before period_end — a child’s are its arrangement (e)(1) dates and its exit dates in the period ((i)(5)(v) / (i)(10)(iv), P-B3 D4), a caregiver’s the (e)(1) dates of the arrangements it fills a slot in, an adoptive parent’s the exit date. case_id is an episode’s: reporting sends one child key per distinct (child, case).

  • Rows per key, in kind order. A child key whose person is not a child member of the case (case_household, store/cases.rs:303) and an unknown person answer one not_found row and nothing else; a not_found row releases nothing (it is in no audit’s person_ids, and a page of only not_found rows stages no audit).

    • person: sex. A child adds the key’s case admin_unit ((a)(3); the record takes the unit of the case of the child’s latest episode with removal before to, P-D2), the (b)(1) date of birth and dob_estimated_abandoned, decrypted through a DOB-only registry slice (ncands.rs:81-90; the SSN family never decrypts here). An adult adds birth_year, else year_of_birth_declared, and, for adoptive_parent only, the full date of birth ((h)(3) / (h)(8); a declared year alone answers none).

    • demographic_window (person_demographic_facts): the live window in force at period_end (child) or at the key’s anchors (adult: race, ethnicity and tribal_member only, never tribal_affiliation).

    • parent_cells (child keys): the (c) cells at period_end from afcars_parents over rows normalized per D3 (the helpers drop any row with retired_at or a passed effective_until, afcars_parents.rs:139-145) — c1_c2 (the parent YEAR, never a date), c3_c4, parent_set and c5, each parent carrying its rights row’s (c)(5) and (i)(2) / (i)(3) columns.

    • One kind per child window ledger — child_parenting_facts, child_prior_permanency_facts, child_assistance_facts, child_sibling_facts, child_icwa_facts — the live row in force at period_end, and for child_icwa_facts also at each anchor; one kind per event ledger — permanency_plans, child_review_events — every live row dated on or before period_end.

    • sibling_link: the person_siblings links in force at period_end.

    • visit: each contacts row existing at as_of (D3 class 2) with the key’s case_id, visited_child_id = the child and a local occurred_at date < to_d — its date and location only.

  • Never answered. Names, the SSN family, every hmac, ssn_verified*, and D3’s excluded free text: a test walks the persons registry (crates/craig-cases-fields/src/persons.rs:108-280) and plants name and SSN sentinels in every other free-text column read.

  • Audit. One case.person_pii_exported per non-empty page through a new wrapper, publish_person_pii_released_for_afcars: requestor craig-reporting, purpose afcars-2020 federal reporting, person_ids (every person with a row on the page, each parent behind a parent_cells row included) with person_count, date_of_birth_person_ids (every child and adoptive parent whose date the page released), include_full_ssn: false, from, to, as_of; an ADR-003 wrapper row and the implementation-guide.adoc catalog row. The requestor and purpose types move from placement’s contracts to crates/craig-reporting-contracts/src/afcars_release.rs, wire bytes unchanged, and both producers use them (craig-cases takes a direct craig-reporting-contracts dependency; no cycle).

  • The ADRs are amended (R-D5): ADR-041 (the #1990 amendment and the persons table row), ADR-051 (its #1990 amendment) and ADR-078 (P-C’s DOB line) say this route releases the child’s and the adoptive parents' dates, DOB-narrowed and audited, and that parents and caregivers stay year-only; the adoptive_parent role is caller-asserted, bounded by the allowlist and the audit.

  • Files. crates/craig-cases-contracts/src/afcars_export.rs; services/craig-cases/src/api/afcars_export.rs (store reads beside it); services/craig-cases/tests/api/afcars_export.rs.

D6 — Financial: GET /v1/financial/afcars-facts (R-D3, R-D4)

  • Query. D3’s window, after and limit (1..=1000 child ids), paged by child id.

  • Answer. The children for whom a title IV-E foster care maintenance payment was paid in the window with Federal reimbursement claimed or intended (§1355.44(b)(18)): a payments row with agreement_id IS NULL AND status IN ('issued', 'cleared') AND ffp_amount > 0 AND issued_at >= from AND issued_at < to AND issued_at ⇐ as_of. ffp_amount is the generated IV-E federal share — net_amount × ffp_rate when ive_eligible, else 0 (migrations/20260703130000_financial_domain_constraints.sql:30-35). A zero payment never counts; disbursed money is corrected by an adjustment, never a void (src/store/payments.rs:269-282), and net never goes below zero (payments_net_non_negative), so an approved recovery that takes net_amount to zero un-pays it and a partial one does not ⁂ (class 3: current). A child reporting holds that is absent answers (b)(18) no; a failed call fails the generate (P-D2), never a default. No audit key: ids only.

  • (b)(18) moves to P-D. The oohc.b18 row in OWNED_ELSEWHERE names #1965, not #1966 (afcars_capture.rs:139); the partition count is unchanged.

  • Files. crates/craig-financial-contracts/src/afcars.rs; services/craig-financial/src/api/afcars_facts.rs; services/craig-financial/tests/api/afcars_facts.rs — financial’s first service-only route.

D7 — Errata, issues and docs

  • U0 records: the program errata — the P-D row (five pages, weight ≈ 129) and its Order line (P-D1–P-D4 before the bulletins, P-D5 after #1987); on A6, the cases keys with anchors and the 500 cap, the row-bounded pages, the pre-population cohort closed at from, rows not elements, the three as_of classes, financial_base_url with its reader, (b)(18) in P-D. On #1965: AC1 read as R-D2; AC3’s transmit grep scoped to services/craig-reporting/src/api/afcars.rs (R-D7). Issues: the units U1 #2118 … U7 #2124; P-D2 #2125, P-D3 #2126, P-D4 #2127, P-D5 #2129; the tardy transcription #2128 (R-D6); NCANDS’s marking-only transmit route #2130 (services/craig-reporting/src/api/ncands.rs:278); the history of D3’s class-3 edits #2131. ⁂ R-D4 on #1073.

  • U7 records: the three data-model pages, the P-D2 inputs on its issue, the archive row.

Units

Each MR Relates to #1965 and #949 and closes its own unit issue; no MR closes #1965 (P-D5 does).

MR Scope W

U0

this page (Active nav); the unit issues under epic &99 (Plan::AFCARS, type and priority labels, these weights); D7’s errata, issues and ⁂

1

U1

SETTINGS (D2)

2

U2

PLACEMENT EXPORT: the route, cohort, row stream and cursor; the episode and arrangement rows; the release-audit wrapper; the contract (D3, D4)

5

U3

PLACEMENT FACTS: the caregiver slots, the trafficking, window and visit rows; the full-page timing (D4)

3

U4

CASES EXPORT: the route, keys, anchors, cap, row stream and digest cursor; the narrow types; membership; the DOB-only decrypt; the person and demographic_window rows; the audit wrapper and the shared release types; the three ADR amendments and the ADR-003 row (D3, D5)

5

U5

CASES LEDGERS: the normalized parent_cells, the ledger, sibling and visit rows; the full-page timing (D5)

5

U6

FINANCIAL: afcars-facts and the OWNED_ELSEWHERE move (D6)

3

U7

CLOSE-OUT (D7)

1

Weight 25. U0 first; then U1, U2 → U3, U4 → U5 and U6 in any order; U7 last. Every MR is green alone and carries its CHANGELOG entry; every new test carries // @axis:.

Erratum (2026-10-01): U4’s store reads sit in src/store/afcars_export.rs and src/store/person_demographics.rs (the B1 route-file cap), and D3’s window check is one shared craig_common::export_window (B8).

Erratum (2026-10-01): U5’s ledger reads sit in src/store/afcars_ledgers.rs (as U4’s, the B1 cap); its visit row answers occurred_at, the mapped column (the jurisdiction-clock date is P-D’s projection), and its icwa_window carries P-B3 D4’s tribe_order_foster_care / tribe_order_adoptive.

Test matrix (by risk)

Test Axis Asserts

a_worker_a_relayed_actor_and_another_service_are_refused (each route)

evil

403 and no audit staged, for a caseworker, a relayed craig-reporting token and craig-financial’s principal

a_malformed_window_or_parameter_is_refused_by_method (each)

sad

GET: an unknown parameter, from >= to, a recent as_of or a bad cursor is 400; POST: an unknown field 422, the same checks 422 validation-failed; nothing staged

a_boundary_that_is_not_a_local_midnight_is_refused (each)

sad

a noon to is refused; midnight on both DST change days passes

a_row_dated_the_first_day_after_the_period_is_outside (placement, cases)

sad

a statement, report, visit or event dated to_d, an arrangement starting at to and an exit at to are not answered; the same dated to_d − 1 / just before to are

rows_recorded_retired_or_closed_after_as_of_read_as_at_as_of (placement, cases)

replay

a correction after as_of is invisible and its predecessor answered live; a window closed after as_of answers open; an arrangement retracted or a contact deleted after as_of is answered

a_parent_link_corrected_or_closed_after_as_of_answers_the_pre_change_cells

replay

the exported (c) cells, not the helper alone

the_cohort_is_every_child_with_an_episode_in_the_window

happy

before, straddling, inside, open and retracted episodes

an_exit_at_the_first_instant_of_the_period_is_in_the_cohort

evil

exit_at == from answered; removal_at == to not

a_history_heavy_child_spans_pages_without_loss (placement, cases)

happy

> 2 × limit rows: every page ≤ limit, the concatenation equals one read whose limit covers every row, no row twice

pages_partition_the_cohort_by_child_id (financial)

happy

limit 2 over 5 children: 3 pages, next null at the end

one_release_audit_per_page_names_exactly_its_children

happy

the outbox row exists when the 200 arrives; an empty page stages none

every_answer_is_no_store (each route)

happy

Cache-Control: no-store on every 200 page

a_window_ledger_answers_only_the_rows_in_force_at_its_anchors (placement, cases)

evil

earlier and later windows are absent; the ICWA row at each anchor and the (b)(11) row at an in-period exit are present; a row covering three anchors appears once

a_binding_ended_or_cancelled_on_the_arrangement_date_fills_no_slot

evil

the half-open rule, not COVERING_SQL

a_congregate_arrangement_has_no_caregiver_slots

sad

a group home with a foster_home_id answers none

the_first_slot_is_the_primary_then_the_earliest_binding

happy

P-B2 D6’s tie order

no_name_ssn_note_or_narrative_reaches_any_row (placement, cases)

evil

sentinels in every free-text column read outside the mapped element text and admin_unit (contacts.contact_with / narrative / recorded_by_name, every retired_note) and every persons registry field outside the allowlist are absent from every page

a_caregiver_answers_a_year_and_an_adoptive_parent_a_date

happy

a declared-year-only adoptive parent answers no date

one_person_may_be_a_child_key_and_both_adult_roles

happy

a foster parent who adopts answers under each role and as a child key; a repeated key is refused

a_child_key_outside_its_case_answers_not_found

evil

no person row, DOB or admin_unit for a non-member child; it is in no audit’s person_ids, and a page of only not_found rows stages none

case_keyed_reads_and_visits_follow_the_requested_case

evil

a child with ledger rows and contacts in two cases answers the requested case’s only, once

more_than_500_keys_or_a_foreign_cursor_is_refused

sad

422 validation-failed, nothing staged

one_pii_audit_per_page_names_every_person_and_released_date

happy

person_ids, person_count, date_of_birth_person_ids

only_an_issued_federally_claimed_per_diem_in_the_window_counts

sad

a zero net, an approved recovery to zero, not IV-E eligible, a subsidy, issued before from, at to or after as_of: absent; a partial recovery: present

each_prefix_delivers_one_shared_base_url_leaf

happy

D2’s pins

Verification

  • Per MR: the gate list (fmt, clippy, the budgets at their locks, validate-authz-coverage, coverage-matrix-mapping, the evil-corpus and route-role gates as the NCANDS export meets them, api-docs --check, check-docs, plan-lint), then the battery (bare git push), where each producer’s devstack API tests first run; U3 and U5 record the full-page timing on #1965.

  • Close-out: cargo xtask plan-lint --done docs/modules/ROOT/pages/plans/archive/afcars-pipeline-sources.adoc --allow-open 949,1073,1965,1966,1973,1987,2125,2126,2127,2128,2129,2130,2131 (the program, the later pages and D7’s follow-ups).

Rollout + risks

Unit Roll first → then

U0, U7

docs only

U1

set CRAIG_REPORTINGCASES_BASE_URL before rolling craig-reporting and keep CRAIG_REPORTINGCASES_URL until the roll completes (the old binary reads it). A roll before the new variable is set still accepts NCANDS generate (202), and each background attempt fails against http://localhost:8002. Financial’s variable is unchanged

U2–U6

additive routes in any order: no consumer until P-D2, no migration, no floor bump; craig-security already parses both audit keys

Risks: PII on three new paths (cases names are plaintext at rest, so the narrow structs are the only guard; the DOB decrypt widens to AFCARS; the adoptive_parent role is caller-asserted); class-3 edits read current until the history issue lands (D3); the page ceiling is measured, not yet proven at scale (U3 / U5); the bulletins stay the program’s long pole (D1).

Rulings requested (recommendation first; U0 records each and D1–D7 are then binding)

# Recommendation Alternative

R-D1

P-D as five gated pages (D1, ≈ 129); P-D1–P-D4 proceed before the ACF bulletins, P-D5 waits on #1987

P-D1 only, then hold; hold all of P-D until the bulletins

R-D2

#1965 AC1 ("P-A merged first") is met by P-A1 plus #2027 before P-D2’s population unit; #1987, which closes P-A2 (#1973), gates P-D5 only

the literal reading: P-D waits for P-A2 Done

R-D3

(b)(18) is P-D’s (A6, #1965): financial afcars-facts here; OWNED_ELSEWHERE moves to #1965; P-E extends the route

leave it to P-E: every P-D record missing a required element

R-D4

(b)(18) = an issued or cleared per-diem payment issued in the window whose generated federal share ffp_amount is positive: zero payments never count, an approved recovery to zero un-pays ⁂

gross paid regardless of recoveries; the payment’s service period overlaps the window

R-D5

ADR-041, ADR-051 and ADR-078 amended: the AFCARS export releases the child’s date b)(1), clean class 100 %) and the adoptive parents' ((h)(3) / (h)(8, DOB-only decrypt, audited; parents and caregivers year-only

none that files (b)(1)

R-D6

§1355.46(b)(5)'s 30-day tardy rule is transcribed as cited dictionary data by a P-A2 follow-up (the #2027 shape) before P-D3’s classes unit

fold it into #2027; a classifier constant (federal text in Rust)

R-D7

AC3’s transmit grep is scoped to api/afcars.rs; NCANDS’s identical marking-only route gets its own issue

P-D retires NCANDS’s route too (beyond R12)

Review log

Round Vendor Resolved model Verdict

1

Anthropic — one fresh contextless reviewer (the page, the rules, the four questions; 25 tree spot-checks)

Claude Opus 5.5

no-ship — 3 blockers fixed (the trafficking date bound, the relayed-token refusal through channel(), the cluster compose file); 10 non-blocking findings folded

2

maintainer-run (2026-09-30)

as reported

no-ship — 12 findings and the mixed-time limitation folded: (a)(3)'s admin_unit and case selection; rows normalized to as_of before the parent helpers; the cohort closed at from; narrow export types with sentinel tests; visits under the key’s case; (b)(18) on ffp_amount; local-midnight boundaries; refusals split by method; .env.example; row-bounded pages with a keyset cursor and a history-volume test; the NCANDS 202; the --allow-open values

fold check

Anthropic — a per-finding checklist auditor, then an adversarial gap hunt (≈ 45 tree citations)

Claude Opus 5.5

13 findings: 11 addressed, 2 partial (the close normalization, the rollout wording) and 4 fold defects, fixed; gap hunt: 1 P1 (adult key identity), 8 P2 (the element text exemption, non-member keys, timing units, D3’s producer rules, upper bounds on arrangements and exits, the stamped-table fences, ADR-051 / ADR-078, anchors instead of history) and 5 P3, fixed; a final residue verifier over the combined list: 3 partial (contacts' in-place columns, no-store on every route, the demographic table name) and 6 fold defects (each row once across anchors, a request-wide anchor bound, not_found releases nothing, in-period exits for (b)(11), this row, the placement ordering term), fixed

Edit this page · latest