Plan: AFCARS Validation — the §1355.46 Classifier Without the Bulletin Rows (#2126, P-D3 of #1965)

Archive record

Merge requests: !1788 (U0 plan page + the A8 errata + the unit and follow-up issues, Relates #2126) + !1789 (U1, Closes #2158) + !1790 (the dictionary corrections, Closes #2157) + !1791 (the complement arms, Closes #2167) + !1792 (U3, Closes #2160) + !1793 (the reporting docs drift, Closes #2166) + !1794 (U2, Closes #2159) + !1795 (U4, Closes #2161) + !1796 (U5, Closes #2162) + !1797 (U6, Closes #2163) + !1798 (U7, Closes #2164) + !1799 (U8, Closes #2165 and #2126); the tardy rows landed first as a P-A2 follow-up (!1787, #2128)

2026-10-04 — approved in plan mode 2026-10-03 (rulings R-D12–R-D24 as recommended) after a contextless round 1 (no-ship, 3 blockers fixed, 17 findings folded), the maintainer’s round 2 (no-ship, 10 findings folded) and a three-pass fold check. What landed: the read path and the exemption (U1: the sealed rows opened in place under their AAD, grouped per child; turned_18_prior_period from the decrypted (b)(1), strictly before the half’s from, its effects read from the exemption row, fail closed); the dictionary corrections (#2157: a qualifier atom for (b)(1)'s estimated_abandoned, the (e)(15) / (h)(9) arms on e7_not_a_couple / h1_not_a_couple, a seventh table min_rows of 27 rows; #2167: every blank-gate complement arm in the 2022 oohc rows re-transcribed, 29 tokens over 159 arms); the evaluator (U2: DictionaryView::arms, event-kind ownership, 29 of 48 predicates bound from the stored cells, each cell read through its own decision, a memoized walk with the self-edge read raw; predicate_unbound, arms_exhausted, applicability_cycle); admission (U3: Admitted \| Incomplete \| Invalid, Incomplete outranking Invalid); the classes (U4: NotApplicable \| Exempt \| Missing \| Invalid \| Tardy \| Ok in D4’s order; tardy from #2128’s rows, strictly more than more_than_days on the same row, no period limit; tardy_rows_missing); the fold and finalize (U5: per element the records by worst class, the min_rows zero-row rule, CleanClass standards, the two A8 steps written unevaluated and failing; three immutable tables; the CAS out of draft inside the generate’s one transaction to validated or validated_with_errors, the graph’s new draft → validated_with_errors edge; cited_aggregation, finalize_conflict; the invariant’s five AFCARS legs; measured at 20 000 children: +14.4 s inside the commit, 805 000 error rows, peak RSS 417 MiB, on #2154); the findings (U6: runaway_exit_mismatch on a real exit only, sibling_counts_out_of_order, plan_outside_every_episode, written after finalize to the immutable afcars_findings, never changing the status); review-afcars (U7: the bounded GET …/validation report and keyset pages of errors and findings, closed wire token enums, craig reporting review-afcars, the craig-web detail page linked from the list). Every submission is validated_with_errors until P-D5 evaluates the two steps. Follow-ups: #2168 (the 2028 (i)(2) / (i)(3) arms, with #2148), #2169 (the fold delays the job heartbeat; before P-D5), #2154 (the generate’s memory); P-D5’s inputs are on #1965, P-D4’s on #2127.

Status

Done (2026-10-04) — !1799

Anchor What binds here

#2126; AFCARS 2020 Program (#949)

A8 (validation in that order; the invariant rewritten in the SAME MR as finalize), R4, ADR-040 (leave-unpopulated; consistency rows are federal-ruleset data)

P-D1 (#1965) D1 and R-D6

the fixed scope; federal rules are dictionary data, never classifier constants; `review-afcars’s surfaces are this page’s fork

P-D2 (#2125) as built and its inputs on #2126

the immutable record tables, coverage, gaps, the retained policy; the one-transaction commit; raw history; the test-only read path

#2128 (the tardy transcription)

the tardy table and DictionaryView::tardy(); merges before U4

The P-D-owned findings on #1965 (P-B2 D3, D11; P-B3; P-C; #1999)

the findings this page implements or routes

⁂ = a reading DFCS may rule otherwise, logged on #1073. "Local" is the jurisdiction clock (craig_common::clock::BusinessClock).

Context (census 2026-10-02, on main after P-D2)

  • No AFCARS submission leaves draft. insert_generated writes draft with a literal 0 errors (services/craig-reporting/src/store/afcars.rs:111-129); the graph has no draft → validated_with_errors edge and validated_with_errors is terminal (src/transitions.rs:39-58). NCANDS finalizes inside its generate transaction from SQL counts, without a CAS (src/store/ncands.rs:153-191, src/jobs.rs:248-260).

  • The records are immutable and carry no results (migrations/20261002120100_afcars_record_tables.sql:189-220). Their read path is test-only: Cell::from_stored / blank, two CellError`s, `RecordRow::restore / cell, SealedRow::into_row, row::open, store::read_records (records/cell.rs:83-148, records/row.rs:208-435, records/store.rs:371-438).

  • The generate holds one snapshot to its commit (afcars/job/mod.rs:197-232); the commit order is head lock, lineage, submission, records / coverage / gaps / policy, complete_in_tx (afcars/job/commit.rs:104-179). Validation there reads the retained policy by construction.

  • No evaluator. The contracts parse and never evaluate (afcars_dictionary/mod.rs:3-11); DictionaryView::applicability answers one (key, predicate) pair and has no production caller; there is no ordered-arm accessor (view.rs:72-84). The 2022 oohc rows carry 174 arms (101 required, 73 blank) over 92 keys, each key ending in always, no category rows, and use 36 predicate tokens; state_agency has no fact source. (b)(20) requires b19_positive, (b)(21) b20_positive. (e)(15) and (h)(9) alone among the second-parent rows use complement arms that fall through to state_agency → required.

  • No admission check. value_set.rs parses only; writes check slot count and kind (records/row.rs:297-346). Assembly emits an enabling gate without its list and an each without its unanswered categories (assembly/encode.rs:58-100).

  • Repeating elements. (f)(1)–(f)(6) live on afcars_record_events; (f)(3), (f)(4), (f)(5) share RepeatingDates (records/schema.rs:232-237); each kind leaves the others' columns blank. (f)(1)'s value set carries permanency_plan_not_established; (f)(3)–(f)(5) are bare dates.

  • Thresholds. Each element carries clean_class (CleanClass: 11 hundred_percent, 131 ten_percent, afcars_dictionary/mod.rs:315-323) and aggregation (all per_record). No recurrence or consistency node exists.

  • The invariant has two legs, validated ⇒ validation_errors = 0 ∧ record_count > 0, NCANDS and AFCARS (crates/craig-test-lib/sql/invariants/craig-reporting/validated_with_errors.sql), blocking; refuse_untransmittable refuses any nonzero validation_errors (src/api/mod.rs:79-100).

  • review-afcars is the missing CLI verb beside approve-afcars / transmit-afcars (services/craig-cli/src/cmd/reporting.rs:26-54); the web list shows the count and a Review button on validated (services/craig-web/templates/reporting/afcars.html:76-100).

Scope

In: D1–D8. Out (P-D5, after #1987): inconsistent and the recurrence step (their dictionary nodes; until then the steps are recorded unevaluable, D5), aggregation overrides, the record number, (e)(6)'s rendering, the seeded cohort test. Out elsewhere: the 2028 series (#2148), readiness and the transmit gate’s count arm (P-D4 #2127), the assistance file and its exemption (P-E #1966), the class-3 history (#2131).

Design

D1 — The read path and the exemption (U1)

  • Un-gated: Cell::from_stored, Cell::blank, CellError::{SlotCount, NonCanonicalBlank}, RecordRow::cell, SealedRow::into_row, row::open. After the records are inserted, the commit consumes its Vec<SealedRow> with into_row and opens each row in place under the same AAD (R-D12): no read-back, no copy. RecordRow::restore and store::read_records stay test-only.

  • validate::observe groups the opened rows per child (ChildObservations: the child row, parents, removals, arrangements, events).

  • validate::exempt: turned_18_prior_period holds iff the decrypted (b)(1) date plus 216 months (chrono month arithmetic, so a 29 February birth turns 18 on 28 February ⁂) falls before the period’s from (local date); a blank or invalid (b)(1) never exempts. Its effects are read from DictionaryView::exemption: compliance exempt leaves every denominator, membership retained keeps the record in record_count and the records. A missing row, a membership of excluded (the record is already sealed and inserted) and an assist record (P-E) are refused (R-D20).

  • Erratum (2026-10-03): records carry no file and the generate builds only out-of-home care records, so assist_record refuses the File the commit passes Turned18::from_view; U1 asserts it there, and U5 asserts it at that seam rather than through the generate.

D2 — The applicability evaluator (U2, after U1 and the dictionary corrections #2157)

  • Contracts. DictionaryView::arms(&ElementKey) returns a key’s element-level applicability rows in document order. Category rows exist only on 2028 keys (#2148), which assembly already refuses.

  • Ownership. RecordColumn gains the owning EventKind of each events element: (f)(1), (f)(2) plan; (f)(3) periodic_review; (f)(4) permanency_hearing; (f)(5), (f)(6) visit. An element is evaluated only on rows of its table and, on events, of its kind.

  • Bindings (services/craig-reporting/src/afcars/validate/applicability.rs). Every token on the committed 2022 oohc rows (29 after the corrections below) binds to the fact its doc states (Predicate in crates/craig-reporting-contracts/src/afcars_dictionary/mod.rs), read from the STORED cells (R-D16). A row reads itself, then the rows it belongs to: an arrangement reads its removal row, then the child row; a removal row (its exit cells included) and a parent row read the child row. Each binding declares the elements it reads. A token reads a cell only through that cell’s own decision: a cell whose arm says blank reads as blank to every token (R-D17). Decisions are memoized per (row, element) and evaluated prerequisites first, with an in-progress set. A token that reads the element being decided reads its raw cell, since that self-edge is not a dependency, so only a cycle through other elements is refused. Self-gating, accepted because the producer’s projection is the authority (R-D16):

    • c5i_petition_filed_or_parent_deceased holds iff (c)(5) ≠ not_applicable and (c)(5)(i) is filled; c5_terminated_or_parent_deceased iff (c)(5) ≠ not_applicable and (c)(5)(ii) is filled (cases leaves (ii) blank while a termination is pending, services/craig-cases/src/afcars_parents.rs:242-268, R-C11); neither is ever missing (#1999).

    • exit_recorded holds iff (g)(1) is filled, so (g)(1) is never missing.

    • state_agency is a constant true: every CRAIG jurisdiction is a State title IV-E agency, and (a)(1) is its FIPS (P-D2 D5).

  • The walk. The first arm whose token holds decides required or blank. Refused by name, never defaulted, value-free: an unbound token, a list with no true arm, a dependency cycle (D5 lists the wire tokens).

  • The evaluator never patches an arm. The dictionary corrects (e)(15) and (h)(9) first (R-D24): their complement arms (e7_separated, e7_single_adult; h1_separated, h1_single_adult, h1_married_but_individually_…) become one blank-first arm on a new token that holds when the marital status is NOT married_couple or unmarried_couple (blank included): e7_not_a_couple, h1_not_a_couple. (e)(15) is e2_no → blank, e7_not_a_couple → blank, state_agency → required, always → blank; (h)(9) is g3_not_adoption_or_guardianship → blank, h1_not_a_couple → blank, state_agency → required, always → blank (#2167, which also folds (e)(10)'s e2_no and (h)(4)'s seven g3_* arms into e2_not_yes / g3_not_adoption_or_guardianship). Thirty-six tokens become 29.

  • Erratum (2026-10-03, #2167): D2’s (h)(9) arms and token count, and the U2 (h)(4) test row, corrected to as-built (R-D24).

D3 — Value-set admission (U3, after the dictionary corrections #2157)

  • validate::value_set::admits(&ValueSet, &Cell) → Admission, with Admission = Admitted | Incomplete | Invalid, judges a FILLED cell against its element’s committed value set.

    • Invalid: an enum or indicator outside its set (crosswalked enums arrive as ACF codes, P-D2 D5); an integer out of range; text past its maximum; a decimal past its scale; two alternatives of one union filled; an each category or response outside the set; a gated list under a non-enabling parent (afcars_dictionary/mod.rs:1035-1039).

    • Incomplete: an each that does not answer every category; an enabling gated parent whose list is absent or does not answer every category; a gated list with its parent blank; a qualifier atom without the value it qualifies.

  • A cell both Incomplete and Invalid is Incomplete (it mirrors missing > invalid).

  • Qualifiers come from the dictionary (R-D24): after the follow-up, (b)(1)'s estimated_abandoned is a qualifier of its date; the other unions on the 2022 oohc rows — (c)(1), (c)(2), (c)(5)(i), (h)(15) — are alternatives.

  • Erratum (2026-10-03, #2160): as built, a blank cell (or one whose every answer is an empty string, list or map) is Incomplete, so U4 may call admits on any required cell; CellValue::Gated.parent is a mandatory token, so "a gated list with its parent blank" is the empty parent with a list; "past its scale" means more fractional digits than the scale once trailing zeros drop; a year outside 0..=9999 (the atom’s four digits) and a slot of another count or kind are Invalid.

D4 — The classes (U4, after #2128)

  • Per (row, element) observation: NotApplicable | Exempt | Missing | Invalid | Tardy | Ok, one class each, decided in that order: not applicable first, then exempt (an exempt record’s observations are all Exempt: no error row, in no summary count), then missing > invalid > tardy, and Ok when none holds. A refusal is structural and fails the generate even on an exempt record.

  • An arm that says blank makes the observation not applicable and ok, regardless of sourcing (A8 (3)); a FILLED cell there is not applicable too, and reads as blank to dependents (R-D17).

  • A required blank is missing, unsourced and gapped included (A8 (4)); an Incomplete cell is missing; an Invalid cell is invalid.

  • Tardy (§1355.46(b)(5), R-D6): through DictionaryView::tardy() — per row a transaction element d)(2), (g)(2, its event element d)(1), (g)(1 and more_than_days (30): tardy iff the transaction’s local date is MORE than more_than_days after the event date. Observed on every removal and exit row of the submission (the text has no period limit; which rows the file carries is P-D5’s, R-D19). A blank or invalid event or transaction date yields no tardy observation; that cell’s own class reports it. A view without tardy rows is refused (fail closed).

D5 — Aggregation, results, finalize, the invariant (U5, one MR per A8)

  • Fold (per_record, R-D18). Per element, a record is applicable iff at least one of its rows is (or it carries a zero-row observation, below); its class is its worst applicable row’s. The counts are RECORDS by worst class: missing + invalid
    tardy
    = the element’s errors, never more than applicable. Zero rows: each repeating element carries a dictionary min_rows (0 or 1) and the record level it counts under (child or removal), added by the dictionary-corrections follow-up #2157 from the pinned text (R-D24). Fewer rows than min_rows is one missing observation for that child or removal; otherwise zero rows is no observation. The transcriptions as built (#2157; corrected to as-built, see the erratum at the end of D5): (f)(1), (f)(2) min_rows 1 per child (§1355.44(f)(1) answers "plan not established"); (e)(1), (e)(2), (e)(5) 1 per removal; (e)(3), (e)(4), (e)(6)–(e)(18) 0 (each conditioned on another paragraph of its own arrangement) ⁂; (c)(5)–(c)(5)(ii) 0 (a child without a parent row answers through (c)(1) / (c)(2)) ⁂; (f)(3)–(f)(6) 0 per child. A Cited aggregation is refused until P-D5.

  • Standards (R-D15). An element meets its standard from CleanClass, checked arithmetic: hundred_percent iff zero errors, ten_percent iff errors × 10 ≤ applicable. The two A8 steps P-D3 cannot evaluate — consistency (inconsistent) and recurrence — are written unconditionally as evaluated = false, meets_standard = false; P-D5 evaluates them.

  • Results (R-D14), migration …_afcars_validation_results.sql, all immutable (the records' trigger shape), each submission_id a FK ON DELETE RESTRICT:

    • afcars_element_results(submission_id, element_key, clean_class, applicable, missing, invalid, tardy, meets_standard; PRIMARY KEY (submission_id, element_key)), one row per oohc element of the view (the coverage keys);

    • afcars_validation_steps(submission_id, step CHECK IN ('consistency', 'recurrence'), evaluated, meets_standard; PRIMARY KEY (submission_id, step));

    • afcars_observation_errors(id UUID v7 PK, submission_id, child_id, source_id NULL, element_key, class CHECK IN ('missing', 'invalid', 'tardy')), non-ok observations only, no cell value, indexed on (submission_id, id) for D7’s keyset pages. source_id: the parent row’s parent_person_id, the removal row’s episode_id, the arrangement row’s arrangement_id, the event row’s source_id; a removal-level zero-row observation carries its removal’s episode_id; NULL on a child-row or child-level zero-row observation.

  • Refusals are closed engine_failed tokens (the job’s Refusal), each listed in deployment-guide.adoc by the unit that adds it: predicate_unbound, arms_exhausted, applicability_cycle (U2); exemption_row_missing, exemption_excluded, assist_record (U1); tardy_rows_missing (U4); cited_aggregation, finalize_conflict (the CAS miss) (U5).

  • Finalize (R-D12, R-D13): store::afcars::finalize_afcars_submission, inside the generate transaction after the records and before complete_in_tx, writes the results, then CASes WHERE id = $1 AND status = 'draft': validation_errors = the failing element rows plus the failing step rows, validated_at = now(), status validated iff record_count > 0 and validation_errors = 0, else validated_with_errors, through validate_transition. The shared graph gains (Draft, ValidatedWithErrors). The job’s result is the finalized row. Until P-D5 every submission is validated_with_errors (the two steps), an all-exempt one included.

  • The invariant (R-D23) keeps its stem and name and the NCANDS leg. "A submission with records" has at least one afcars_child_records row. AFCARS legs: (1) as today; (2) a submission with records has one element-results row per oohc.% coverage row and both step rows; (3) its validation_errors = its failing element and step rows; (4) meets_standard agrees with the counts and the class, and a step meets only when evaluated; (5) no submission with records is draft; (6) a submission with records is validated_with_errors iff validation_errors > 0, and validated, reviewed, approved, transmitted require validation_errors = 0 (a record-less submission is checked only by leg 1).

  • The two tests pinning draft after a generate (afcars/job/mod.rs:1368, api/afcars_regenerate_tests.rs:82) move to the finalized status; the comments that a generate writes draft or that P-D3 is pending go (tests/api/afcars.rs:124, :172, :191, :193, :270; tests/api/afcars_plant.rs:3-9, :33-34; tests/api/afcars_export.rs:14; tests/api/upload_attempts_reporting.rs:33; tools/craig-seed/src/datagen.rs:3076-3078); the commit says why.

  • Docs in U5: data-model-reporting.adoc (three tables), state-machines.adoc (the edge), the generate route’s utoipa text and the regenerated API page ("`result` is the finalized submission"), cli.adoc, the CHANGELOG.

  • Erratum (2026-10-03, #2157): the zero-row expectations are corrected as transcribed — a missing group row is owed only the elements the text requires on every row of its group: (e)(1), (e)(2), (e)(5) min_rows 1 per removal and (f)(1), (f)(2) 1 per child; (e)(3), (e)(4), (e)(6)–(e)(18) (each conditioned on another paragraph of its own arrangement), (c)(5)–(c)(5)(ii) and (f)(3)–(f)(6) 0 ⁂; (f)(3)–(f)(6) count under child (an undated event has no removal); D3’s qualifier is the atom qualifier(token).

  • Erratum (2026-10-03, #2162): a repeating element no min_rows row governs, or whose level its table cannot count, is refused assembly when the fold is built from the view (fail closed). oohc.i5–i8 from 2028-10-01 have no row yet (follow-up #2148). The e2e comment at tests/e2e/specs/reporting-actions.spec.ts:140-142 moves with the D5 list.

D6 — The findings (U6)

  • Migration …_afcars_findings.sql, immutable: afcars_findings(id UUID v7 PK, submission_id FK ON DELETE RESTRICT, child_id, source_id NULL, kind), closed kind CHECK, indexed on (submission_id, id), written in the same transaction, review-only — never changing finalize (inconsistent is P-D5’s, R-D21); data-model-reporting.adoc gains it in U6:

    • runaway_exit_mismatch — (g)(3) is runaway_or_whereabouts_unknown while the episode’s latest arrangement by (e)(1) is neither runaway nor whereabouts_unknown, or the reverse (P-B2 D3);

    • sibling_counts_out_of_order — (b)(21) > (b)(20) or (b)(20) > (b)(19), only when all three are applicable and filled;

    • plan_outside_every_episode — a dated plan with no episode link (an undated plan already has its gap).

  • Routed: the (b)(20) sibling gap is the existing gap pair; (e)(8) vs (e)(3) is a P-D5 consistency candidate (noted on #2129); the (i) blanks on b6i_yes_icwa_applies are 2028 rows (#2148); (e)(6)'s rendering is P-D5’s; (d)(6)(ii), (b)(6), (b)(4)(ii) and (c)(5) are applicability; a reported episode under 24 h is correct by P-D2 D6.

  • Erratum (2026-10-03, #2163): runaway_exit_mismatch needs a real exit, as P-B2 D3 says: a (g)(3) of not_applicable (an open episode) is no finding either way; (e)(4) is the arrangement’s signal, read through its decision (blank when (e)(2) is yes, and a blank or not-applicable (e)(4) is no run).

D7 — review-afcars (U7, R-D22)

  • GET /v1/reporting/afcars/{id}/validation (authz Read) answers a bounded AfcarsValidationReport (craig-reporting-contracts::afcars): elements (per element clean_class, applicable, missing, invalid, tardy, meets_standard), steps, gaps (count per reason), error_rows (total) and findings_by_kind (count per kind). Its size is bounded by the view’s elements, never the children.

  • GET …/validation/errors?element_key=&class=&cursor=&limit= and GET …/validation/findings?kind=&cursor=&limit= page by keyset on id ascending (UUID v7, time-ordered), the cursor / next_cursor shape of services/craig-cases/src/api/outbound_stages.rs; limit defaults to 100, and outside 1..=500 is 422 naming limit; filters are predicates over the (submission_id, id) index. 404 for an unknown submission; a submission without results answers empty lists. utoipa, the route-to-client map, ReportingClient methods, the regenerated API page.

  • craig-cli reporting review-afcars <id> prints the summary; --errors [--element KEY] [--class CLASS] pages the errors; --mark-reviewed performs the existing PUT …/review (the server still refuses unless validated).

  • craig-web /reporting/afcars/{id}: the summary and a paginated error list, linked from the list, under the list’s own authz (AFCARS submission Read) with en locale keys for every label; the list row and Review button are unchanged. Docs: cli.adoc, the API page, the supervisor guide.

D8 — Code layout

  • services/craig-reporting/src/afcars/validate/: observe.rs, exempt.rs, applicability.rs, value_set.rs, classify.rs, aggregate.rs, findings.rs; store/afcars.rs gains finalize_afcars_submission; job/commit.rs calls validation between write_rows and complete_in_tx.

  • Code landed before its production caller carries cfg_attr(not(test), expect(dead_code, reason = …)) naming U5 (the P-A precedent); U5 removes every one.

Units

Each MR Relates to #2126, #1965 and #949 and closes its own unit issue; U8 closes #2126.

MR Scope W

U0

this page (Active nav); the unit issues under &99 (U1 #2158 … U8 #2165); program A8 errata (R-D13, R-D15); the dictionary-corrections P-A2 follow-up #2157 (R-D24: the (b)(1) qualifier atom, the (e)(15) and (h)(9) arms, min_rows per repeating element); the state-machine and supervisor-guide drift #2166; the (e)(8) note on #2129; ⁂ entries on #1073

1

U1

READ PATH AND EXEMPTION: the un-gating, observe, exempt (D1)

3

U2

EVALUATOR: the arm accessor, event-kind ownership, the bindings, dependency-ordered reads, the walk (D2)

5

U3

ADMISSION with completeness (D3)

2

U4

CLASSES incl. tardy (D4)

3

U5

AGGREGATION, STEPS, RESULTS, FINALIZE, THE INVARIANT, with their docs (D5)

5

U6

FINDINGS, with their data-model row (D6)

3

U7

REVIEW-AFCARS: the bounded summary, the paginated errors and findings, the CLI verb, the web page, with their docs (D7)

5

U8

CLOSE-OUT: plan-lint --done, the archive row, a reconciliation of the pages U5–U7 updated, P-D5’s inputs on #1965

1

Weight 28. U0 first; U1; the dictionary corrections #2157; then U2 (after U1) and U3 in parallel; U4 after U2, U3 and #2128; then U5, U6 (both touch commit.rs), U7, U8. Every MR is green alone with its CHANGELOG entry; every new test carries // @axis:. Tests are hermetic: the in-src job runtime over the reporting scratch base with VerifiedGeorgiaSurface; a deployed generate answers 503 until #1987.

Test matrix (by risk)

Test Axis Unit Asserts

observe_opens_the_sealed_rows_and_groups_them_per_child

happy

U1

into_row + open, R11 cells decrypted, no copy

an_18th_birthday_before_from_exempts_and_on_from_does_not

sad

U1

the boundary day, local

a_blank_date_of_birth_never_exempts_and_a_missing_exemption_row_is_refused

evil

U1

in the universe; exemption_row_missing; an excluded membership is exemption_excluded; a 29 February birth turns 18 on 28 February

first_hit_takes_the_first_true_arm_in_document_order

happy

U2

(b)(3)'s state_agency; (h)(4)'s blank-first g3_not_adoption_or_guardianship arm

every_2022_oohc_token_has_a_binding

happy

U2

every token on the committed 2022 oohc rows is bound

a_self_gating_element_decides_without_a_cycle

sad

U2

a filled (g)(1), (c)(5)(i) and (c)(5)(ii) each decide required, no cycle refusal; (g)(2) reads (g)(1)'s decision

an_unbound_token_no_true_arm_or_a_cycle_is_refused

evil

U2

predicate_unbound, arms_exhausted, applicability_cycle

a_dependent_reads_its_prerequisite_only_when_applicable

evil

U2

(b)(19) = 0 with (b)(20) = 2: (b)(20) and (b)(21) not applicable

each_event_element_is_observed_only_on_its_own_kind

sad

U2

a plan, two reviews, a hearing and visits: no structural blank is an observation

a_blank_marital_status_never_requires_a_second_parent_cell

sad

U2

(e)(15) on a blank (e)(7); (h)(9) on a blank (h)(1)

c5_tokens_never_require_a_cell_on_a_not_applicable_parent

sad

U2

deceased with no termination; a pending termination

the_evaluator_never_panics_on_generated_records

evil

U2

proptest: a decision or a typed refusal

every_value_drawn_from_a_committed_set_is_admitted

happy

U3

proptest over each committed value set

a_value_outside_its_set_is_invalid

evil

U3

proptest: a mutated token, an out-of-range integer, an over-length text

two_alternatives_or_a_list_under_a_closed_gate_are_invalid

evil

U3

c5i date + deceased; (b)(10) list, parent non-enabling

an_unanswered_category_or_a_qualifier_without_its_value_is_incomplete

evil

U3

race with 7 of 8 categories; (b)(17) enabling with no list; (b)(1) indicator, no date; (b)(1) date + indicator admitted

blank_by_rule_is_ok_even_when_unsourced (#1965 AC2)

happy

U4

(h)(14) without an adoption or guardianship exit is not applicable; with one, the same blank is missing

class_precedence_is_missing_then_invalid_then_tardy

happy

U4

one class per observation; Incomplete → missing

a_transaction_past_the_dictionary_threshold_is_tardy

happy

U4

threshold → ok; + 1 day → tardy; (d) and (g)

a_late_transaction_is_tardy_whatever_period_its_event_fell_in

sad

U4

Sep 15 removal first recorded Oct 31 is tardy in the Oct–Mar submission

the_tardy_threshold_is_read_from_the_dictionary

evil

U4

a synthetic row with another day count moves the outcome

a_view_without_tardy_rows_is_refused

fault

U4

fail closed (tardy_rows_missing)

a_blank_or_invalid_event_date_yields_no_tardy_observation

sad

U4

the date’s own class reports it

a_value_where_the_arm_says_blank_is_not_applicable

sad

U4

(b)(6) filled with ICWA ≠ yes (R-D17)

denominators_count_applicable_observations_per_element (#1965 AC2)

happy

U5

applicable, non-exempt records; (b)(4)(ii) only on b4i_yes

exempt_records_leave_the_compliance_universe_but_stay_in_the_file_where_the_text_says (program)

happy

U5

in record_count and the records, in no denominator

an_all_exempt_submission_is_validated_with_errors_while_a_step_is_unevaluable

evil

U5

every element meets; both steps fail; validated_with_errors

a_missing_required_group_is_one_missing_observation

sad

U5

no plan row → (f)(1) missing; a removal with no arrangement → (e)(1) missing; no review row → no (f)(3) observation; a child with no parent row → no (c)(5) observation

a_clean_result_set_with_evaluated_steps_finalizes_validated

happy

U5

synthetic results and steps → validated, 0 errors, validated_at set

the_standard_is_errors_times_ten_at_most_applicable

evil

U5

proptest over arbitrary counts, no overflow; 1 / 10 meets, 2 / 19 fails

a_repeating_element_folds_to_one_observation_per_record

happy

U5

two arrangements, one invalid → one error, denominator 1

a_failure_after_finalize_commits_nothing

fault

U5

no submission, results or job success

finalize_refuses_a_submission_not_in_draft

conc

U5

a CAS miss is a typed refusal, nothing written

the_job_result_is_the_finalized_row

replay

U5

the stored result’s status equals the row’s

a_regenerate_supersedes_a_validated_with_errors_head

replay

U5

the head is retained whole, results included

validation_results_are_immutable

evil

U5

UPDATE, DELETE, TRUNCATE refused on the three tables

the_invariant_flags_status_and_results_that_disagree

evil

U5

on the scratch base: planted violations of legs 2–6 (incl. a clean validated_with_errors and an errored reviewed) are returned; copies of the seed’s three record-less rows pass

a_cited_aggregation_or_an_assist_record_is_refused

evil

U5

cited_aggregation through the generate, nothing committed; assist_record at Turned18::from_view (D1 erratum)

runaway_exit_mismatches_are_findings_both_ways

happy

U6

(g)(3) runaway beside a family arrangement, and the reverse

sibling_counts_out_of_order_are_a_finding

sad

U6

(b)(21) > (b)(20); an inapplicable or blank count → none

a_dated_plan_outside_every_episode_is_a_finding

sad

U6

an undated plan → none

findings_never_change_the_finalized_status

happy

U6

same status and count with or without findings

a_finding_row_carries_no_cell_value

evil

U6

schema and log capture

findings_are_immutable

evil

U6

UPDATE, DELETE, TRUNCATE refused

the_summary_is_bounded_and_the_errors_page

happy

U7

20 000 errors: the summary’s size is independent of them; pages of at most limit; the cursor walk returns each once; filters apply; the same for findings; limit 0 or 501 is 422

the_report_of_an_unknown_submission_is_404

sad

U7

typed 404 on all three routes

the_validation_routes_are_refused_without_read

evil

U7

out-of-scope 403 / 404; a service principal denied

review_afcars_marks_reviewed_only_on_the_flag

happy

U7

prints; --mark-reviewed PUTs; refused on validated_with_errors with the server’s problem

the_detail_page_renders_a_seeded_row_without_results

sad

U7

"no validation results"; the list Review button unchanged

Verification

  • Per MR: the gate list (fmt, clippy, the budgets at their locks, validate-authz-coverage, api-docs --check, check-docs, plan-lint), the hermetic scratch-DB legs locally, then the battery (bare git push).

  • Close-out: cargo xtask plan-lint --done docs/modules/ROOT/pages/plans/archive/afcars-validation.adoc --allow-open 949,1073,1965,1966,1987,2126,2127,2129,2131,2148,2154,2165 (plus #2166 while open).

Rollout and risks

  • U5 is pre-1.0 Changed: a generate yields validated or validated_with_errors, never draft; one additive migration (three tables). U6: one migration. U7: three routes, one CLI verb, one page. No floor bump; no seed data change (one seed comment).

  • Risks: a mis-bound token mis-scores (the golden binding test and the refusals bound it); a large half’s validation cost inside the one transaction (measured at U5 against the volume measure on #2125, follow-up #2154); every submission is validated_with_errors until P-D5 evaluates the two steps (intended, pinned by tests).

# Recommendation Alternative

R-D12

Validate and finalize INSIDE the generate transaction over the sealed rows as inserted; add (Draft, ValidatedWithErrors); CAS from draft

a separate validate act from a visible draft

R-D13

validation_errors = the standards not met: failing elements plus A8 steps that fail or cannot be evaluated; validated iff 0 and record_count > 0, so refuse_untransmittable stays correct until P-D4

records or observations in error

R-D14

afcars_element_results, afcars_validation_steps, afcars_observation_errors, immutable

per-element counts only; or JSONB on the submission

R-D15

Element standards from CleanClass (100 % ⇒ 0 errors; 10 % ⇒ errors × 10 ≤ applicable); an A8 step the view cannot evaluate fails its standard, so no submission is validated while the classifier is incomplete

validate without the steps (an all-exempt half would pass)

R-D16

Bind tokens from the stored cells only, through each cell’s own decision; the self-gating of (c)(5)(i), (c)(5)(ii) and (g)(1) accepted; state_agency true for every CRAIG jurisdiction

bind from producer facts during the walk

R-D17

A value where the arm says blank is not applicable, ok, and blank to its dependents; P-D5’s emitter blanks it

invalid; or ok plus a finding

R-D18

Zero rows: the dictionary’s min_rows per repeating element and record level decides (fewer is one missing observation, else none); otherwise the worst row decides

zero rows always none; or always missing

R-D19

Validate every stored row; tardy on every removal and exit row, no period limit

tardy only for events in the period

R-D20

turned_18_prior_period from the decrypted (b)(1); fail closed on a blank; its effects read from the exemption row

the effects as Rust constants

R-D21

Three review-only finding kinds (D6); (e)(8) vs (e)(3) to P-D5; findings never change finalize

findings as errors

R-D22

review-afcars = a bounded summary plus paginated errors and findings over the API, a CLI verb, a web detail page

API and CLI only (web a follow-up)

R-D23

Keep the invariant’s stem and name and the NCANDS leg; add the AFCARS legs, the reverse leg included

a new invariant file

R-D24

Federal text is dictionary data: a P-A2 follow-up (#2157, filed at U0) adds a qualifier atom for (b)(1) (with its knock-on: every exhaustive Atom match — afcars_surface/contract.rs ValueKind::of, the contracts' parse.rs, value_set.rs, afcars_crosswalk/verify.rs, the assembly test helper — and (b)(1)'s column kinds and encoding, keeping slot 0 the date so U1’s exempt read is unchanged), re-transcribes the (e)(15) and (h)(9) arms on the new tokens e7_not_a_couple / h1_not_a_couple, and adds min_rows and its record level per repeating element; U2, U3 and U5 merge after it

U2 / U3 / U5 patch these in Rust

Review log

Round Vendor Resolved model Verdict

1

Anthropic — one fresh contextless reviewer (the page, the rules incl. coding-conventions / test-authoring, the four questions; 23 tree citations checked on main)

Claude Opus 5.5

no-ship — 3 blockers fixed (a union’s qualifier atom; the in-place read path needs SealedRow::into_row; each unit updates its own docs); 17 non-blocking findings folded

2

OpenAI — maintainer-run (2026-10-03)

GPT Astra

no-ship — 10 findings folded: an all-exempt submission (unevaluable A8 steps fail their standard); compound-cell completeness (Incomplete is missing); dependency-ordered applicable reads; a dictionary min_rows for required repeating groups; event-kind ownership; the (e)(15) / (h)(9) arms corrected in the dictionary; no period limit on tardy; the invariant’s reverse leg; U1 / U2 reordered; a bounded, paginated report

fold check

Anthropic — three contextless read-only passes over the folded round-2 text

Claude Opus 5.5

(1) a per-finding auditor: 8 addressed, 2 partial (the self-gating cycle; no data marker for required groups) — fixed; (2) an adversarial gap hunt: 6 blockers and 15 minor (incl. the fold’s count arithmetic, the arm language for the (e)(15) / (h)(9) correction, a leftover close-out phrase, refusal tokens, report fields, tests) — all fixed; (3) a residue verifier: every item fixed, 7 residues (the (b)(1) knock-on order, R-D13’s record-count clause, wording, class order, zero-row source ids) — fixed

Edit this page · latest