Plan: AFCARS Pipeline II — Records and Generate (#2125, P-D2 of #1965)
- Archive record
- Status
- Context (census 2026-10-01, on
main) - Scope
- Design
- D1 — The reporting field key (R11, R-D9)
- D2 — The submission and the supersede chain (A7)
- D3 — The record tables (A7, R3, R11; R-D8, R-D10)
- D4 — The window and the three clients (A6, P-D1 D2)
- D5 — Element assembly (pure,
src/afcars/assembly/) - D6 — Derivations (pure,
src/afcars/derive/; #2027 merged) - D7 — The generate job and the 202 (A4, R13)
- D8 — Replay vs regenerate (A4)
- D9 — Code layout
- Units
- Test matrix (by risk)
- Verification
- Rollout and risks
- Rulings (approved 2026-10-01 as recommended; D1–D9 are binding)
- Review log
Archive record
Merge requests: !1776 (U0 plan page + the A4 / A7 and ADR-048 errata + the unit and follow-up issues, Relates #2125) + !1777 (U1, Closes #2138) + !1778 (U2, Closes #2139) + !1779 (U3, Closes #2140) + !1780 (U4, Closes #2141) + !1781 (U5, Closes #2142) + !1782 (U6, Closes #2143) + !1784 (U7, Closes #2144) + !1785 (U8, Closes #2145) + !1786 (U9, Closes #2146 and #2125)
2026-10-02 — approved in plan mode 2026-10-02 (rulings R-D8–R-D11 as recommended) after a contextless round 1 (no-ship, 2
blockers fixed, 9 findings folded) and the maintainer’s round 2 (no-ship, 9 findings folded). What landed:
the reporting field key (U1: CRAIG_REPORTING_FIELD_ENCRYPTION_KEY from ADR-064 store v2, delivered to craig-reporting only;
encryption_mode lifted onto ServiceSettings; the shared boot verifier in craig_search::lineage with the value-free
KeyLoadReason; a crypto_key_lineage migration; crates/craig-reporting-fields);
the record model (U2: the submission chain, file and supersedes_id; five record tables by CFR cardinality, a cell one
slot per value-set atom as JSONB, the R11 columns TEXT envelopes; coverage, gaps and the policy stored once by hash;
AFCARS_RECORD_CONTRACT with files; long tokens cut to 63 bytes);
the window and clients (U3: label to window, local midnights, as_of = enqueue minus the extended ceiling;
financial_base_url; three paged clients and the cases batcher of 500 keys and 10 000 anchors);
assembly (U4: Crosswalk::lookup, seven rule tables, raw values only; a 2028-series view refused until #2148);
the derivations (U5: the §1355.42(a) population, strictly more than the threshold over the whole episode; the reported
episode; plan links per R-B8; (b)(9); the cohort index and (b)(20) / (b)(21));
the generate job (U6: afcars_generate in child-boundary batches of 250, the population rule before any cases ask, ONE
commit of head lock, establish_lineage, submission, records, coverage, gaps, policy and complete_in_tx; recovery
first; 17 closed engine_failed tokens; every AFCARS dead-code expect retired; the volume measure on #2125, follow-up
#2154);
the 202 flip (U7: the strict PeriodLabel request and the extractor’s 422 before authz; claim first, a replay answered
before the surface checks, the typed 503 AFCARS_SURFACE_NOT_READY, the generability 422, background_job claims; the
web poll shell, CLI --client-request-id / --no-wait, suites planting by SQL, seed half labels; the program close-out
grep empty);
replay vs regenerate (U8: the export renders under the submission’s retained policy, read_policy re-verifying both
document hashes, never the live surface; the TSV names the retained identities; no policy row is the typed 409
afcars-policy-missing, a tampered document a logged 500; seed policy rows; #1965 AC2 proven by a same-name crosswalk
promotion). Pre-existing races met on the way were fixed on their own branches (!1783, #2156) or filed (#2155).
Follow-ups: #2147 (the (a)(1)(ii) capture), #2148 (the 2028 series), #2149 (column-key rotation), #2150, #2151, #2152,
#2153, #2154, #2155; P-D3 #2126 carries the inputs.
Status
Done (2026-10-02) — !1786
| Anchor | What binds here |
|---|---|
#2125; AFCARS 2020 Program (#949) |
A4 (the surface, the two verbs), A6 with its errata, A7 (the record model) — erratum requested (R-D10), A10 (hermetic legs), R3, R11, R13, R14 |
P-D1 (#1965) D1–D7 as built and the P-D2 inputs on #2125 |
binding: rows not
elements, the cohort before the population rule, the cases keys and caps, the three as-of classes, "a failed call fails the
generate, never a default", (a)(3)'s case, |
The P-D inputs on #1965 (P-B1, P-B2 D6 / D11, P-B3 D2–D4, P-C D5) |
binding: the same-day plan rule, the caregiver slots, the
adoptive-parent ids, (b)(20) / (b)(21), the (c) cells, (g)(3) |
ADR-048 D3 and § Amendment — #949 |
the dedicated reporting key, its named channel, the KCV lineage — wording erratum (R-D9) |
ADR-064 |
the store schema is exact; a second entry is an amendment |
ADR-062 and the NCANDS job (#1936, |
the claim, the 202 shape, one commit per job |
ADR-040 |
per-row materialization; leave-unpopulated (no faithful value is a blank, never a guess) |
⁂ = a reading DFCS may rule otherwise, logged on #1073. "Local" is craig_common::clock::BusinessClock on the jurisdiction clock.
Context (census 2026-10-01, on main)
-
Generate is a stub: a synchronous 200 with a zero-record
draftunder the claim entityafcars_submission(services/craig-reporting/src/api/afcars.rs:63-145,src/api/intents/creates.rs:19).afcars_submissionshas no status CHECK, no chain and a free-text period; the seed plantsYYYY-Qnlabels and no records (tools/craig-seed/src/datagen.rs:3064). -
The surface is built, unconsumed:
snapshot,view_forandpolicy_snapshotwait for P-D underexpect(dead_code)(src/afcars_surface/mod.rs:186-216,:359-364); there is no 503 mapping;parse_pairdrops the documents' content (afcars_surface/verify.rs:129-160); the production contract is empty (contract.rs:104-109) whilecoverswalks every element,assistand the 2028 series included. Until #1987 a deployed surface stops atlayout-unpinned. -
No reporting key, one client: no fields crate, crypto dependency or key mount; the ADR-064 store holds one entry (
xtask/src/secrets_store.rs:12-21); the verifier is craig-cases' (boot_verify.rs:169); reporting readscases_base_urlonly. -
The dictionary is data: 142 elements and the
populationtable (#2027), no evaluator, no crosswalk value-to-code lookup;PeriodLabel,period_end_of(afcars_crosswalk/verify.rs:236) and the metadata route’splacealready resolve a half. -
NCANDS is the 202 precedent (#1936): one job per period, one commit, submission id = job id; web, CLI and test-lib already poll reporting jobs. A claim stored under another entity answers
idempotency-conflict(crates/craig-api/src/request_claims.rs:465), not thereplay-entity-gonethe #1936 CHANGELOG entry says.
Scope
In: D1–D9. Out: applicability, the classes, findings and finalize (P-D3); the encrypted artifact and readiness (P-D4); the XML, (a)(4) and its pseudonym key, the period reservation, the lifecycle e2e (P-D5); the assistance file (P-E); the class-3 history (#2131); the column key’s rotation (#2149); any NCANDS change.
Design
D1 — The reporting field key (R11, R-D9)
-
A column key.
CRAIG_REPORTING_FIELD_ENCRYPTION_KEY, loaded byFieldEncryptor::from_env, encrypts D3’s R11 columns (and P-D4’s artifact) and never derives the record number: P-D5’s pseudonym key is separate. Rotation is not built here: it needs an old-key-to-new-key re-encryption of immutableOpaquecells and a lineage transition, which the #1399 tool does not do (it moves one column between schemes under one key,crates/craig-search/src/rewrite.rs:97-99); #2149 owns it. -
Delivery. The ADR-064 store becomes v2 —
shared.field_encryption_keyplusshared.reporting_field_encryption_key(an ADR-064 amendment) — andcargo xtask secretsmints the new entry fresh, non-interactively, never typed. The devstack writesdevstack/reporting-field-key.envbesidefield-key.env(xtask/src/field_key.rs,field_key_reconcile.rs), with its own KCV marker in the wipe guard (devstack_guard.rs:762), gitignored likefield-key.env(.gitignore:27), mounted into craig-reporting only.devstack/ci/write-field-key.shand the integration job’s own key step (.gitlab-ci.yml:497) write both files, each key 32 independent random bytes..env.example,configuration-reference.adocanddeployment-guide.adoc(production: the orchestrator store) name it. -
Mode.
encryption_modemoves fromCasesSettingstoServiceSettings(the flatten rule,settings.rs:296-306): cases readsCRAIG_CASESENCRYPTION_MODEunchanged, reportingCRAIG_REPORTINGENCRYPTION_MODE; defaultrequired. -
Lineage. A
crypto_key_lineagemigration in craig_reporting (the cases DDL). The boot matrix moves intocraig-searchbehind itssqlxfeature, parameterised by (registry, key env name); craig-cases calls it with unchanged behaviour and reporting calls it at boot, verify-only. The writer is the generate commit (D7):INSERT … ON CONFLICT DO NOTHINGof the KCV row (or the keyless sentinel), then a verify of KCV and canary against the row that won — ADR-048 D3’s deferred production first-write, atomic with the first ciphertext. No seeder writes reporting lineage.
Erratum (2026-10-04): P-D4 U2 (#2177) — a keyed AFCARS export also establishes or verifies the row before its claim
(establish_lineage, plan afcars-readiness D2); the generate is no longer the sole writer.
-
crates/craig-reporting-fields, thecraig-cases-fieldsshape: U1 lands it with an emptyDEFAULT_REGISTRYand proves the shared verifier over a fixture registry; U2 registers D3’s R11 columns (Opaque) and owns reporting’s ciphertext leg.
D2 — The submission and the supersede chain (A7)
-
afcars_submissionsgainsfile(NOT NULL DEFAULT 'oohc', CHECKoohcorassist) andsupersedes_id(nullable, UNIQUE, FK to itselfON DELETE RESTRICT). A new submission’sreporting_periodis its canonicalPeriodLabel. -
The head of
(reporting_period, file)is the row with a policy row (D3) that no row supersedes. The generate commit reads itFOR UPDATEand links to it; the job’s dedup key serialises generates per half and the UNIQUE backstops a fork. -
Prior rows keep their records, snapshots and export pointers;
validated_with_errorsstays terminal per row (transitions.rs:16); the transition graph is P-D3’s.
D3 — The record tables (A7, R3, R11; R-D8, R-D10)
| Table | Cells (by dictionary cardinality) | One row per |
|---|---|---|
|
|
child |
|
|
|
|
|
episode |
|
|
arrangement |
|
|
event |
-
Keys. Each row (and each gap row) carries an
idUUID v7 primary key (the AAD’s row id),submission_id(FKON DELETE RESTRICT),child_idand its source id (episode, arrangement, parent, plan, review or contact). An arrangement row and a plan event also carryremoval_record_id, a FK to its episode’safcars_record_removalsrow — a plan’s from D6, null when undated — so a same-day exit and re-entry keeps ownership after instants become dates. -
Cells. One column per element token in dictionary document order (a token in both series is one column). A cell holds one optional slot per atom of its element’s value set, in value-set order, each a typed
CellValue(one variant perAtomkind,afcars_dictionary/mod.rs:973, plus a date list for arepeating_datescell held on one row, (d)(6)(ii)): (b)(1) keeps its date AND itsestimated_abandonedindicator. Stored as JSONB; all slots empty is NULL, the blank. A trigger refusesUPDATEandDELETE. -
R11 columns (R-D8). (b)(1), (h)(3), (h)(8); (d)(5)–(d)(6)(ii); (e)(11), (e)(16), (h)(5), (h)(10): TEXT holding the envelope of the same JSON,
Opaqueincraig-reporting-fields, written byencrypt_rowand read bydecrypt_row(crates/craig-search/src/row.rs:237,:408). The AAD binds table, column and row id, so a regenerate re-derives every cell. -
Coverage.
afcars_submission_coverage(submission_id, key, sourcing), one row peroohcelement of the period’s view (key= itsElementKey) and one per population situation (key=population.<situation>);sourcingiscaptured,derivedorunsourced((a)(4), P-E’s (h)(14) andpopulation.ive_payments_under_agreementareunsourced). -
Gaps.
afcars_record_gaps(submission_id, child_id, element_key, reason)says why a sourced cell is blank:person_not_found,admin_unit_unresolved,sibling_without_arrangement,plan_undated,crosswalk_unmapped. P-D3’s findings read it. -
Policy (R-D10).
afcars_policy_documents(content_sha256 PRIMARY KEY, content JSONB), inserted if absent, the hash recomputed on every write and read;afcars_submission_policy(submission_id PRIMARY KEY, the dictionary’s and crosswalk’s rule_set_id, revision and content_sha256), each hash a FK to the documents. Plaintext, outside the registry.VerifiedSnapshotkeeps the read content. -
Compatibility (R13).
src/afcars/records/schema.rsis the one element → (table, column) map, in column order: it drives the INSERTs and isAFCARS_RECORD_CONTRACT— everyoohcelement of both series with its own cardinality and the kinds of its committed atoms;layoutsstays empty until P-D5’s renderer. The contract gainsfiles, the data files this build generates (oohc), andcoverschecks only their elements (contract.rs:166walks every element today), so theassistrows wait for P-E without holding theoohcfile not ready after P-D5 (R-D10).
Erratum (2026-10-02): 23 oohc tokens exceed Postgres’s 63-byte identifier limit; each column is the token cut to
63 − 1 − len(paragraph) bytes, trailing _ trimmed, then _<paragraph> (U2, #2139); the R11 registry uses the
same names.
D4 — The window and the three clients (A6, P-D1 D2)
-
Window. A label resolves to
from= local midnight of the half’s first day (place),to= local midnight of the day afterperiod_end_of, andas_of= the enqueue instant minusEXTENDED_REQUEST_CEILING, minted once, then checked bycheck_export_window. A half is generable iff it has ended (to ⇐ as_of), is on or after the crosswalk’ssupported_from, and has a dictionary period row; otherwise 422validation-failednamingreporting_period. -
Settings.
financial_base_urljoinsServiceSettingsbesideplacement_base_url; reporting reads all three leaves; compose setsCRAIG_REPORTINGPLACEMENT_BASE_URLandCRAIG_REPORTINGFINANCIAL_BASE_URL;.env.exampleandconfiguration-reference.adoclist them. -
Clients (
src/afcars/clients/, thecases_client.rsshape: service token, per-page 8 s budget, 503 fail-closed without a token, no retry), typed by the producers' contracts crates (new dependencies oncraig-placement-contractsandcraig-financial-contracts). Each walks its cursor tonext = nullwithfrom,toandas_offixed. -
The cases batcher. At most 500 keys and 10 000 anchors per call; one child key per distinct (child, case); each caregiver and adoptive parent once per role with the union of its anchors; the same body bar
afterandlimiton every page. -
Any non-200 page fails the walk: never a default.
D5 — Element assembly (pure, src/afcars/assembly/)
-
Instants project to local dates; (d)(2) and (g)(2) take
first_recorded_at(R14). -
A cell is read at its element’s
temporal_anchor: the window row in force at that date; (b)(11) at the earlier of period end and an in-period exit; slot caregivers at the arrangement’s (e)(1) date; adoptive parents at the exit date. -
(c) is copied from
parent_cellsas cases resolves it (crates/craig-cases-contracts/src/afcars_export_ledgers.rs:40-75): the (c)(1)–(c)(4) cells, and per parent its (c)(5)–(c)(5)(ii) with death dates and the deceased indicator already applied. -
Crosswalked elements map the fleet token to the ACF code through a lookup added to
afcars_crosswalk; the citedunmappedarm is a blank with gapcrosswalk_unmapped(A3 erratum). -
(f)(3) / (f)(4) split
held_onby review kind; (g)(3) isnot_applicablewithout an answered exit; (b)(18) isyesiff the child is in financial’s id set; agatedcell carries its list only when the parent response isenabling. -
A
not_foundchild key leaves its cases-sourced cells blank with gapperson_not_found; placement’s cohort decides membership. -
Header. (a)(1) is the jurisdiction’s state FIPS; (a)(3) the county FIPS of the selected case’s
admin_unit(services/craig-reporting/src/ncands_mapping.rs:170-200), an unresolved unit a blank with gapadmin_unit_unresolved, never the raw name ⁂ — P-D5 checks both against the bulletin’s format; (a)(2) is the month and year of period end; (a)(4) is blank. -
Raw only. No applicability row is evaluated: (e)(4) under (e)(2) = yes, the (d)(6)(i) gate and every blank-by-rule are P-D3’s.
-
The 2022 series. U4 assembles every element a half ending before 2028-10-01 serves. The 2028 series — incl. folding the per-parent (i)(2) / (i)(3) answers into their
most_recentcells — is #2148, due before 2029A; until it lands its cells are blank andunsourced.
Erratum (2026-10-02): U4 (#2141) rulings — period-end cells and the (c)(5) rows read the reported episode’s child key,
events the union of the child’s keys; (e)(4) is blank on a foster_family_home arrangement; an adult’s abandoned race
is blank; a not-found adult, and (a)(3) under a not-found key, are person_not_found; a dated plan outside every
episode has a NULL link and no gap.
Erratum (2026-10-02): U4 refuses a view ending on or after 2028-10-01 (AssemblyError::ElementNotInForce, the first
2022-only token absent) instead of assembling it with blank 2028 cells: a loud refusal, never a silent blank. #2148
replaces the refusal; no such half is generable before 2029-04-01.
D6 — Derivations (pure, src/afcars/derive/; #2027 merged)
-
Population (§1355.42(a), read through
DictionaryView::population). A cohort child is in it iff an episode in the period (exit absent or at or afterfrom) lasted MORE than its row’smore_than_hoursin total (exactly 24 h is out; an open episode runs toto) — situationrunaway_or_whereabouts_unknownwhen the arrangement in force at removal isrunawayorwhereabouts_unknown, elsefoster_care; the whole episode counts, not its overlap with the period (retained_through).ive_payments_under_agreement(§1355.42(a)(1)(ii)) has no capture: coverage records itunsourced; the capture is #2147 (R-D11). A child outside the population gets no record. -
The reported episode — for (a)(3), (b)(9) and every
period_endcell — is the child’s latest episode with removal beforeto, ties broken by episode id. -
Plans to episodes. A plan goes to the episode whose closed date interval holds its
established_on, a date in two going to the later (R-B8 ⁂); noestablished_onis gapplan_undated. -
(b)(9) is
yesiff ahealth_assessment_visitfalls inside the reported episode, on or before period end. -
(b)(20) / (b)(21) (P-B2 D11, P-B3 D4), over the
sibling_linkrows in force at period end and a cohort-wide index (child → in care at period end, setting identity, placement type): (b)(20) counts siblings with a live episode and an effective arrangement at period end,placed_at_homeexcluded ⁂; (b)(21) counts those at the child’s setting identity. A sibling in care without an arrangement blanks both, gapsibling_without_arrangement.
D7 — The generate job and the 202 (A4, R13)
-
Handler, in order. Authz;
reporting_periodparsed as aPeriodLabel(deny_unknown_fields), else 422. Then oneexecute_claimed_txcomposingclaim_firstandenqueue_in_claim(theclaim_enqueueshape,crates/craig-api/src/jobs/claim_enqueue.rs:91-121; claim entitybackground_job, scopereporting.generate_afcars, intentreporting_period): a replayed claim answers its existing job, 202, whatever the surface now says; a fresh claim first needssnapshot()verified — else a typed 503problem_types::AFCARS_SURFACE_NOT_READY(a new URL besideSCREENING_SURFACE_NOT_READY,crates/craig-common/src/error.rs:618) naming the reason token — and D4’s generability checks against the verified documents, else 422; either refusal rolls the claim back. Then the enqueue, 202 withLocation. Another generate for an active half is 409job-already-active. -
Kind
afcars_generate, registered beside NCANDS: dedupafcars_generate:<label>,lease_key = None,CONSENT = false, three attempts; input = label andas_of. -
Attempt.
snapshot()again (not verified is terminalEngine("surface_not_ready"));view_forthe period end; financial’s id set first; then placement’s walk in child-id order, closed into batches at a child boundary (at most 250 children). Per batch: the population rule on placement’s rows, so cases is asked only for in-population children and their adults; the cases calls; assembly and the per-child derivations. Raw rows are dropped and only records and the cohort index accumulate; (b)(20) / (b)(21) fill after the walk. -
One commit. The head
FOR UPDATE, the lineage establish-or-verify (D1), the submission (id = job id,draft,record_count), records, coverage, gaps, policy,supersedes_idandcomplete_in_tx. A re-queued attempt re-walks under the sameas_of; recovery short-circuits on an existing submission with the job’s id. -
Failure. A non-200 page, a lineage mismatch or an encrypt error ends the job
failedwith a reason that carries no cell value. -
The flip, in one MR with the handler. The test-lib
generate_afcarsreturnsApiResponse<JobView>; craig-web redirects to?job=with the poll shell, flashes "AFCARS generation started." and names the 503 reason; craig-cli gains--client-request-id, the poll and--no-wait(run_generate_ncands,services/craig-cli/src/cmd/reporting.rs:297); the devstack suites plant submissions by direct SQL with their policy rows and assert the 503 where they generate; the e2e generate leg (tests/e2e/specs/reporting-actions.spec.ts:46) becomes the 503 leg; the seed and spec labels becomePeriodLabel`s, which claims the program’s close-out grep `2025-Q|2026-export-Q; the generate route’s skipped String categories intests/api/evil_corpus.rsrun; the ceilings comment, ADR-068’s row, the API page andcli.adoc.
Erratum (2026-10-02): reporting_period is a typed PeriodLabel in GenerateAfcarsRequest, so a malformed label and an
unknown field are the fleet extractor’s 422, before authz (the NCANDS order); a well-formed caseworker request is 403 before any
claim (U7, #2144).
D8 — Replay vs regenerate (A4)
-
Request replay (ADR-062): the same
client_request_idreturns the same job. -
Regenerate: a fresh id for a half with a head creates a new submission on the current surface that supersedes it (D2).
-
Replay (A4): an export renders under the submission’s retained policy, read from
afcars_submission_policywith every hash re-verified, never fromsnapshot(). The TSV metadata row gains the retained dictionary and crosswalk identities (pre-1.0Changed), so a promotion under the same name changes no re-export. A submission without a policy row is refused 409afcars-policy-missing; the seed plants policy rows for its submissions. P-D5 re-points the test at the XML. -
A regenerate may differ from its predecessor (new captures, class-3 edits read current, #2131); a replay never does.
D9 — Code layout
-
services/craig-reporting/src/afcars/:window.rs,clients/,assembly/,derive/,records/(schema.rs, the store),job.rs.api/afcars.rs(804 lines) changes only its generate handler and the export’s policy read. -
Code landed before its production caller carries
cfg_attr(not(test), expect(dead_code, reason = …))naming U6 (the P-A precedent,afcars_surface/mod.rs:186-192); U6 removes every one, the surface’s included, and deletes a surface method still without a caller; U7 deletesNOT_READY_TYPE.
Erratum (2026-10-02): U6 (2143) keeps one expect — window::as_of_for, whose only production caller is U7’s generate
handler minting the job’s as_of, names U7 (#2144), and U7 removes it. job.rs landed as job/ (mod.rs, batch.rs,
walk.rs, commit.rs); records::Cell::{blank, from_stored} and the two errors only they build are [cfg(test)]
until P-D3 / P-D5 call them.
Units
Each MR Relates to #2125, #1965 and #949 and closes its own unit issue; U9 closes #2125.
| MR | Scope | W |
|---|---|---|
U0 |
this page (Active nav); the unit issues under &99 (U1 #2138 … U9 #2146); the A7 / A4 and ADR-048 errata (R-D9, R-D10);
issues: the §1355.42(a)(1)(ii) capture #2147 (R-D11), the 2028-series assembly #2148 (D5), the column key’s rotation #2149 (D1),
the #1936 CHANGELOG wording #2150, |
1 |
U1 |
FIELD KEY: the store v2 and its ADR-064 amendment, delivery incl. the CI key step, the mode lift, the shared verifier, the lineage table, the fields crate (D1) |
5 |
U2 |
RECORD MODEL: the chain columns, the record, coverage, gap and policy tables, the R11 registry, the store, the contract and
its |
5 |
U3 |
WINDOW AND CLIENTS: label to window, |
3 |
U4 |
ASSEMBLY (D5) |
5 |
U5 |
DERIVATIONS (D6) |
3 |
U6 |
GENERATE JOB: the kind, the batched walk, the one commit, the lineage writer, recovery; enqueued by tests only (D7) |
5 |
U7 |
THE 202 FLIP: the handler, the typed 503, the claim, every consumer, the labels (D7) |
3 |
U8 |
REPLAY VS REGENERATE (D8) |
2 |
U9 |
CLOSE-OUT: |
1 |
Weight 33. U0 first; U1 → U2; U3 after U0; U4 after U2 and U3; U5 after U4; U6 after U1–U5; U7 after U6; U8 after U7; U9
last. Every MR is green alone with its CHANGELOG entry; every new test carries // @axis:. Hermetic legs run the in-src job
runtime over the reporting scratch base with wiremock producers and VerifiedGeorgiaSurface
(tests/support/afcars_surface.rs:104); devstack legs see the 503 until #1987.
Test matrix (by risk)
| Test | Axis | Unit | Asserts |
|---|---|---|---|
|
fault |
U1 |
the shared matrix over a fixture registry; the remedy
names |
|
evil |
U2 |
a raw read of every R11 column is an envelope; a cell copied to another row fails to decrypt; reporting ciphertext without lineage refuses boot |
|
evil |
U2 |
every |
|
evil |
U2 |
(b)(1) with a date and |
|
evil |
U2 |
|
|
evil |
U3 |
every wiremocked placement and
financial query and every cases body carries local-midnight |
|
happy |
U3 |
|
|
sad |
U3 |
501 keys → two calls; a shared caregiver once with its
anchor union; one body bar |
|
fault |
U3 |
a 500, 503 or timeout on any page of any route is an error, never a default |
|
happy |
U4 |
period end, exit, removal, arrangement and (b)(11)'s earlier-of |
|
evil |
U4 |
(d)(1), (e)(1), (g)(1) at 23:30 local on both DST days |
|
happy |
U4 |
a corrected removal keeps (d)(2) = its first |
|
evil |
U4 |
blank cell plus |
|
sad |
U4 |
the record exists; the cells are blank; |
|
evil |
U5 |
24 h out; 24 h + 1 s in; an open episode counts to |
|
happy |
U5 |
two cases, a re-entry, a tie broken by episode id |
|
evil |
U5 |
R-B8 |
|
evil |
U5 |
P-B3 D4 |
|
evil |
U5 |
never defaulted; the gap is recorded |
|
happy |
U6 |
siblings in different batches count in (b)(20) / (b)(21) |
|
evil |
U6 |
three |
|
evil |
U6 |
a 20-hour episode’s child and its caregivers reach no cases body |
|
fault |
U6 |
same |
|
happy |
U6 |
one coverage row per view element and situation; the policy hashes equal the snapshot’s |
|
fault |
U6 |
terminal |
|
evil |
U6 |
sentinel DOB and trafficking values absent from |
|
sad |
U7 |
typed URL and reason; no claim, no job; the same id later is a fresh claim (devstack and hermetic); craig-web and craig-cli show the reason |
|
evil |
U7 |
the order; an unended half is 422 only once verified (hermetic) |
|
replay |
U7 |
hermetic; submission id = job id; one job, one attempt |
|
replay |
U7 |
the retry answers its job, not the 503 or a 422 |
|
replay |
U7 |
a stored |
|
conc |
U7 |
|
|
conc |
U8 |
one head per |
|
replay |
U8 |
the prior keeps records, snapshots and its pointer |
|
replay |
U8 |
a promotion under the
same name: the re-export (same |
|
evil |
U8 |
a content edit fails the hash; a missing row is 409
|
Erratum (2026-10-04): #2174 makes the retained policy immutable, so the tamper leg’s content edit is now refused by the trigger; the leg plants damage by inserting a document whose content does not hash to its key.
Verification
-
Per MR: the gate list (fmt, clippy, the budgets at their locks,
validate-authz-coverage,api-docs --check,check-docs,plan-lint), then the battery (baregit push); U6 records a full-state walk’s time and peak records on #2125. -
Close-out:
cargo xtask plan-lint --done docs/modules/ROOT/pages/plans/archive/afcars-records-and-generate.adoc --allow-open 949,1073,1965,1987,2000,2125,2126,2131,2146,2147,2148,2149 --allow-missing devstack/reporting-field-key.env(plus #2150 / #2151 while open).
Rollout and risks
-
U1: set
CRAIG_REPORTING_FIELD_ENCRYPTION_KEYandCRAIG_REPORTING__ENCRYPTION_MODEbefore the roll (requiredrefuses boot without a key). U3: set both base URLs before the roll. U2: additive (a defaultedfile, a nullablesupersedes_id, new tables), no floor bump. -
U7: one roll of craig-reporting, craig-web and the CLI release; Ops line: a stored pre-flip AFCARS claim answers 409
idempotency-conflictuntil it expires. The other units need no order. -
Risks: a full-state walk’s time and memory (batched; measured at U6); PII in a long-retained copy (R-D8 bounds it); class-3 edits read current (#2131); the column key cannot rotate until #2149 lands (D1).
Rulings (approved 2026-10-01 as recommended; D1–D9 are binding)
| # | Recommendation | Alternative |
|---|---|---|
R-D8 |
The R11 columns are the cells approved text calls PII: the dates of birth (b)(1), (h)(3), (h)(8) (R-D5); the trafficking cells (d)(5)–(d)(6)(ii) and the caregiver and adoptive-parent race (e)(11), (e)(16), (h)(5), (h)(10) (A6) |
the dates of birth only; every sensitive fact, ahead of #2000 |
R-D9 |
Two reporting keys: P-D2’s column key (records and P-D4’s artifact; no derived value pins it, its rotation is #2149) and P-D5’s never-rotated pseudonym key; ADR-048 § #949 reworded at U0 |
one root key with HKDF domains, which makes the column key unrotatable |
R-D10 |
A7 / A4 erratum: tables by cardinality ( |
A7 literally: one (i) table of mixed cardinality, about 350 KB of policy text per submission; |
R-D11 |
§1355.42(a)(1)(ii) (IV-E payments under another agency’s agreement) has no capture: the population evaluates the
other two situations, coverage records it |
hold U5 until a capture exists |
Review log
| Round | Vendor | Resolved model | Verdict |
|---|---|---|---|
1 |
Anthropic — one fresh contextless reviewer (the page, the rules incl. |
Claude Opus 5.5 |
no-ship — 2 blockers fixed (the generability 422 needs the verified
documents; the ciphertext leg moves to U2 with the registry); 9 non-blocking findings folded (coverage keys, the element’s
cardinality and a date-list cell, |
2 |
maintainer-run (2026-10-01) |
as reported |
no-ship — 9 findings folded: every |