Rule Set Patterns and Domain Knowledge

Contents

Where rule sets live

Since #2955 (ADR-087, plan config-git-source U4) the rule sets and the jurisdiction data beside them are not in CRAIG’s repository. Each layer is its own repository, pinned by config-sources.lock at the checkout root:

cargo xtask config fetch publishes each locked layer, verified against ci/config-trust/<name>.openpgp, under target/config/<name>/current, and builds target/config/layers/<name>, the tree xtask’s ruleset checks walk; the devstack’s craig-config-fetch one-shot does the same into the craig-config volume. The synthetic fixture jurisdiction testonia stays in source, at fixtures/config/testonia/. This page names a file by its layer ("the georgia layer’s citations.toml`"); a reference written `rulesets/<j>/<file> inside the config data itself (a source_ref, a policy_refs path) names <file> in layer <j>. Until U4 those layers were CRAIG’s rulesets/<j>/ directories.

Changing a rule set is two merge requests: one in the layer’s repository, one in CRAIG bumping that layer’s sha in config-sources.lock to the new commit, so the battery runs against it. That MR also runs cargo xtask config env and commits the regenerated devstack/config-sources/*.env, the lists compose hands the services: the car’s config env --check refuses a lock and files that disagree, and the devstack verbs refuse to bring the stack up on them. To try a change against CRAIG’s checks before it merges, publish the working copy as the layer: cargo xtask config fetch --layer-path georgia=../craig-config-georgia (unverified; no service loads it). The writing commands (policy sync-cache, rules afcars-manifest, rules afcars-attest) refuse a fetched layer and write only into a working copy published that way.

A config repository merges fast-forward only, never squashed: main’s head must stay the author’s signed commit, because GitLab-made merge, squash and rebase commits are unsigned and the fetcher refuses them (ADR-087 erratum).

JDM Format (zen-engine)

  • Each ruleset is a JSON file with nodes (inputNode, decisionTableNode, outputNode) and edges

  • Decision tables use hitPolicy: "first" — first matching rule wins, ORDER MATTERS

  • Rule values: "< 18", "== true", "\"string_value\"" (strings double-quoted inside)

  • String literals are RAW: zen copies the bytes between the quotes and processes no escapes, so a \u2014 inside a cell is emitted as those six characters, never an em dash. Write the character itself (—); cargo xtask rules check refuses a \u inside any decision-table output cell (#1720).

  • Empty string "" = wildcard/any value

  • Cross-field references work in some contexts (e.g. "> deadline_days" in timeliness)

  • Outputs from upstream nodes flow as inputs to downstream nodes via edges

Rule Ordering Gotcha (hitPolicy: first)

  • More specific rules MUST come before less specific catch-all rules

  • Age ranges: >= 21 must precede >= 18 rules (learned from TX age eligibility bug)

Service-caller rows in the authz fixtures (#1062 sandwich)

The {jurisdiction}-authz-<resource> fixtures gate bare machine callers (i_service, matched only when NO X-Craig-Actor was lifted — BFF calls evaluate as the worker) with the sandwich: scoped allow rows for the audited consumers only, then a service DENY row AHEAD of every worker row — so a machine token carrying stray human roles can never fall through (hitPolicy: first). Resources with no bare-service consumer carry the DENY row alone. Adding a service capability = adding an explicit scoped row and bumping the fixture version (authoring convention — versions stay human-meaningful). Since #1556 the convergent seeder ALSO compares canonical content (jq -cS both sides), so a same-version content edit converges instead of being silently skipped; the version bump is no longer the convergence mechanism. Posture + audit record: the ADR-024 §#1062 amendment.

#1060 assessed whether the rule_evaluation service create row could narrow or disappear once the cases→rules evaluate relays forward X-Craig-Actor: it STAYS. The craig-web-mediated flows (safety assessment, person-match suggestions) now evaluate as the acting worker, but the conversion auto-link consumer relays on a minted cases service bearer with no actor by construction (there is no inbound request to lift one from), so the create-only service row remains its gate. No fixture change; the row’s _description already names the relay flows.

Service-identity scoping (#1107)

The placement fixtures' one scoped service READ row (craig-financial’s subsidy-eligibility S2S read, #1069 M2) is the first row to discriminate WHICH service is calling. Two inputs make it possible, both already part of the engine’s evaluation contract (no claims change was needed):

  • i_service_id — claims.service_id, the service:<id> role suffix (azp fallback) the engine has emitted since ADR-028. Conditioning on it binds a row to one authenticated principal (i_service_id: "'craig-financial'").

  • claims.channel (ADR-076, #1844) — the OUTER service’s role id when a relayed identity was honoured (craig-portal for a portal subject, craig-web for an actor lift), null for a direct caller. The portal rulesets (plan portals U6+) gate on i_channel == 'craig-portal' alongside the portal role; existing rulesets do not read it.

  • i_projection — resource.attrs.projection, a handler-layered endpoint-shape discriminator (the subsidy-eligibility handler inserts projection = 'subsidy_eligibility' into its check ref; no other placement handler sets it). Conditioning on it makes the grant ENDPOINT-shaped: the same principal’s bare bearer on the full placement GET falls to the DENY row — the data-minimized projection is the only placement surface a service can read.

  • The second consumer of the shape (#1847, plan portals U6a): the person fixtures' display-name row, i_service_id: "'craig-placement'"
    i_projection: "'display_name'". It also introduced the guard the first row did not need — the #1062 any-service person read row now carries i_projection: "== null", so a projection-shaped read from any OTHER service falls through to the DENY instead of the wider row (hitPolicy first alone would not have refused it).

  • The third consumer (#1850, plan portals U8a): the worker_identity fixtures' display-name row (1.2.0), i_service_id: "'craig-placement'"
    i_projection: "'display_name'" ahead of the family’s service DENY. No == null guard was needed — worker_identity never had an any-service read row to narrow. Retired by #2525 with its route (georgia 1.5.0, texas 1.6.0): no worker_identity row keys on 'display_name' any more; the #1857 contact row is the live read.

  • The fourth consumer (#1851, plan portals U8 / ADR-076 D5): the foster_home_caregiver fixtures' caregiver_bindings row (1.1.0), i_service_id: "'craig-financial'" + i_projection: "'caregiver_bindings'" — the authority behind GET /v1/placement/internal/caregiver-bindings?sub= (craig-financial’s per-request read), inserted between the family’s portal-channel DENY and its service DENY. i_projection pre-existed on the family from #1848; only i_service_id was added, wildcarded on every other row.

  • The fifth consumer (#1900, plan admin-unit-scoping U1b / ADR-077 D4): the worker_identity fixtures' admin-units snapshot row (1.3.0), i_service: "== true" + i_projection: "'admin_units'" with i_service_id left WILDCARDED — the first projection row that admits ANY service. Every engine-bearing service fetches the worker→admin-unit snapshot on its own principal, so a per-service allowlist would need editing on every new service (the same reasoning that keeps the rule_set read rows unnarrowed, below). The row sits beside the #1850 row, ahead of the family’s service DENY; the #1850 allowlist-of-one is untouched, and a human bearer does not match the row (it keys on claims.is_service).

  • The sixth consumer (#1857): the worker_identity contact projection, two rows. A service READ row (i_service: "== true" + i_service_id: "'craig-placement'" + i_projection: "'contact'"), an allowlist-of-one like #1850’s, lets the portal-serving service show a child’s caseworker by name and work line. A non-admin update DENY on the same projection, placed right after the admin row, stops every other role from writing the admin-only work line; a plain worker_identity update carries no projection and is untouched.

  • Two families born on the portal inputs (#1848, plan portals U6 / ADR-076 D4–D5): {j}-authz-foster_home_caregiver (the caregiver ledger — a STAFF surface under the home’s own update authority; the portal channel is denied ahead of every worker row) and {j}-authz-foster_portal (every row gates on i_channel == 'craig-portal' AND i_foster_parent AND i_projection; no staff row exists). Its units LIST row is the first shipped {"custom": {"binding": "caregiver"}} scope — decoded ONLY by the portal handlers (craig_authz::PortalScope, #1851 — STRICT: exactly that one-key payload decodes the LIST row’s scope; every near-miss falls to the fleet’s Custom refusal), fail-closed everywhere else — so claims.channel now rides the scope input as well as the check input. Since P-B2 U5 (#2058) a binding keys a foster home or a kinship household, and a household ref is home-shaped (its admin_unit, no assignment pair), so the caregiver family’s assigned-scope rows (Texas’s regional-director copy among them) apply to no caregiving unit; both files changed only their descriptions (Georgia 1.2.0, Texas 1.3.0); Texas 1.4.0 (#1928, ADR-077 D7) deletes that copy for a unit CHECK row, so the Texas file now consults the worker-units source.

  • A view-only family keyed on the staff of one child’s case (#3188, plan lifecycle-journeys D4): {j}-authz-education_partner_report — the read of what an education agency reported about a child (GET /v1/placement/education/partner-reports). The service DENY comes first; then admin reads; then a supervisor who supervises the child’s case (i_supervises: claims.sub == resource.supervisor_sub) and a caseworker assigned to it (i_assigned) read; everything else is denied, and no row admits any action but read. The handler carries the worker and supervisor of the case of the child’s latest live removal episode, so a child with no live episode is readable by admin alone. It is Georgia’s one file keyed on the case’s supervisor, where its other files give every supervisor the realm: the partner’s specification names the child’s assigned supervisor. The type is not unit-bearing, and the one writer of the rows is a service-only route the engine never sees.

  • A read-only family with the creator row ABOVE the DENY (#1933, plan background-jobs D5 / ruling R-U1-15): {j}-authz-background_job — the poll GET /v1/<svc>/jobs/{id} on a service’s durable background_jobs row. Its ONE allow shape is i_assigned (claims.sub == resource.assigned_worker_sub, the handler carrying the row’s created_by as the assigned worker) on 'read', placed ahead of the service DENY so the worker who enqueued the job can poll it (since ITI U3, #2740, a service principal’s claims.sub is its ADR-085 D3 encoding service:<name>, which never equals a worker’s created_by, and no service enqueues a job); the DENY then stops every other machine identity before the realm-flat admin read row; no list / create / update / delete / approve row exists (the job is created by its enqueuing route under that route’s own family). No i_service_id: the enqueuer is identified by sub, not by service.

Design choice recorded: the ruleset-input approach won over a code-level endpoint allowlist because the restriction stays in the same auditable, jurisdiction-swappable policy layer as every other authz decision, and claims.service_id was already in the JDM input. The curated bundles hardcode this deployment’s craig-financial client id — production bundles replace it alongside the rest of the fixture content. Worker and admin rows ignore both inputs (empty-string wildcards), so human access is untouched.

Authoring gotcha (bit #786 in Texas): every rule row must carry the table’s FULL input-id set — zen-engine treats a MISSING key as no-match, not as a wildcard (an empty string "" is the wildcard). A row authored without a jurisdiction’s extra columns (Texas adds i_supervises on every authz file that carries a supervisor row — its admin / service-only files declare none of the three — and, where a row uses them, i_regional_director / i_unit_match — #1904) silently never fires.

cargo xtask rules check refuses such a row since #1929 (xtask/src/cmd/rules_graph.rs, run on zen’s parsed model): a rule with no cell under ANY declared input or output id fails the gate, naming the node, the rule index and the column — zen reads output cells by key too. The same lint holds the role vocabulary: every '<role>' in claims.roles test (not in and " quotes included — in an input field, a cell, an expression node or a switch node) must name a worker (craig_auth::REALM_ROLES) or portal (PORTAL_REALM_ROLES) realm role; a token outside both is a dead input, like the 'regional_supervisor' input #1904 deleted. A claims.roles read in any other shape (some(claims.roles, …), an index, a template) is refused as one the lint cannot judge. A row’s _id / _description is prose and is never read.

Second application (#1329, fixtures 1.2.0): the rule_evaluation fixtures' bare-service create row is narrowed to i_service_id: "'craig-cases'" — the cases→rules evaluate relay’s SYSTEM leg (the conversion auto-link inbox consumer, RelayAuth::service) is the only legitimate bare-service evaluator; BFF-mediated evaluations carry a verified X-Craig-Actor and ride the worker rows instead (the ADR-028 §Amendments relay-attribution contract). Deliberately NOT narrowed: the rule_set read/list service rows — they serve the fleet-wide authz cache-warm every service performs with its own bare token, so a principal IN-list there would need editing on every new service, a maintenance hazard with no attribution stake (ruleset reads write no rule_evaluations row).

Third application (#1748, the investigation fixtures 1.2.0) — the sanctioned "attr ABSENT" cell is "== null". A handler that layers an operation discriminator onto an existing action (resource.attrs.operation = 'override_response_deadline' on Update) needs the pre-existing wildcard rows NOT to absorb it, so those rows carry i_operation: "== null": craig-authz always emits resource.attrs as an object, zen-expression evaluates a missing member as null, and a unary cell starting with a comparison operator compiles to $ == null — the row fires only when no operation rides the ref. "== ''" is WRONG (an absent attr is null, not the empty string) and "" is the wildcard (it would keep admitting every operation). The #1095 subsidy fixture introduced the i_operation INPUT but never narrowed an existing row (it replaced the wildcard rows with action-scoped ones); #1748 is the first narrowing.

Fourth application (#1904, the Texas authz fixtures — ADR-077 D5 / D7): the admin-unit pair. On each of the twelve listed unit-bearing Texas files (case, referral, report, investigation, placement, kinship_option, foster_home, payment, payment_adjustment, subsidy_agreement, and since #1909 (b) education_record / health_record, whose two rows carry (#1909) in place of (#1904)) the regional_director rows are exactly two shapes — a Regional director: unit CHECK (#1904) row keyed by the input {"id": "i_unit_match", "name": "UnitMatch", "field": "resource.attrs.admin_unit in claims.admin_units"} (== true; the supervisor row’s action shape: 'read' on the #1367 split files, the wildcard on the fused ones, i_operation == null on investigation) and a Regional director: unit LIST (#1904) row whose o_scope cell is the literal {"custom": {"scope": "admin_units"}}, placed ABOVE the supervisor LIST / fused row (one scope per evaluation — a supervisor + regional_director dual holder lists assigned units and keeps the supervised check). The two child-record files (1.4.0) take the foster_home shape — the action-wildcard CHECK row (Regional director: unit CHECK (#1909)), the LIST row (Regional director: unit LIST (#1909)) above the case-scoped supervisor row and the CHECK row’s two field twins — with their supervisor rows untouched (#1912). A check reads only allow, so a LIST row admits a check(List) on the role alone; no handler sends either child-record type one, and every child-record list resolves its scope through auto_scope_list (pinned: child_record_lists_resolve_scope_only_through_auto_scope_list, xtask/src/cmd/validate_authz_coverage.rs). The two CHECK-only unit files, foster_home_caregiver (#1928) and home_document (#1909), carry the CHECK row alone (Regional director: unit CHECK (#1928) / (#1909), the action-wildcard supervisor shape) and no LIST row: neither type is listed through the list scope. craig-authz flags a file as unit-consulting by that input token OR by that cell parsed as JSON (a near-miss flags nothing), and consults the worker-units source on every human evaluation of a consulting file — NotReady is a typed 503 ADMIN_UNITS_UNAVAILABLE, never a widened row. zen semantics make the CHECK row fail-closed: claims.admin_units is always an array, so an absent attrs.admin_unit (a NULL stamp) or an unbound worker (x in []) makes the row skip and fall through to the default deny. The "unit-scoped" wording lives ONLY on rows that carry i_unit_match == true; the LIST row’s o_reason says "list scoped to assigned units" (what the marker resolves to). Every other former regional row is gone: i_regional (a role token no realm role ever carried) is deleted from every Texas authz file, the R2 supervisor-copy rows on contact_attachment / icpc_request key i_regional_director with NO unit token, and the remaining files declare neither. Pinned: no_texas_authz_file_declares_i_regional, former_i_regional_set_equals_the_changed_set and the twin-parity walk texas_authz_inputs_are_the_georgia_twins_plus_the_declared_extras (computed walks — crates/craig-authz/tests/default_rulesets.rs), plus the positive census twin exactly_the_fourteen_texas_unit_files_consult_units beside the engine’s non-consulter pin (crates/craig-authz/src/engine.rs).

8 Ruleset Domains per Jurisdiction

Each jurisdiction carries these 8 domains with naming {jurisdiction}-{function} (Texas defers person-match — see Ruleset Files below):

  1. ive-eligibility: Title IV-E foster care eligibility (AFDC relatedness, judicial requirements); it declares the inputs a worker answers in metadata.ive (metadata.ive — the IV-E determination inputs (#1719, ADR-072 § Amendment — #1719), #1719)

  2. safety-assessment: Child safety decision (present danger, impending danger, vulnerability, protective capacity)

  3. timeliness: Milestone deadline tracking with warn/critical/overdue status

  4. intake-screening: Screen-in/screen-out + priority + investigation track assignment

  5. placement-matching: Level of care + placement type preference + sibling + proximity (evaluated on demand via POST /v1/rules/evaluate — no event trigger; #971 retired the producer-less placement.requested binding)

  6. person-match (ADR-019): Per-(report-entry, candidate-person) verdict — AUTO/SUGGEST/REJECT from a feature vector (name_exact, name_similarity_score, dob_exact, dob_within_30, sex_match, phone_match). Drives the report-detail "Suggest matches" UX + the auto-link branch in convert_report.

  7. placement-eligibility (#1641 / ADR-072): the license_gate first-hit table (v1.0) — from the server-derived license_status_effective + days_past_license_expiry (and placement_type, which carries the federal setting token since #2056; no rule reads it) answers license_admits_matching, license_admits_activation and a CLOSED license_refusal_reason (none \| license_expired \| license_not_active; zen omits a null output, hence the none sentinel). Consulted on demand by craig-placement at both activation sites (for a caregiving setting only: a non-caregiving activation runs no consult, #2057) and per distinct facts tuple at matching (relayed as the acting worker; no event trigger); the consult validates the output contract fail-closed (a missing key, an unknown token or a contradictory row is a named 500, never a defaulted verdict). v1.1 (#1642) adds the training_gate first-hit table over training.<type>.state (field-less expression cells; placement_type alongside) answering training_admits_matching / training_admits_activation / training_refusal_reason (none \| training_expired \| training_unverifiable; cross-field: a training_* reason requires some type in the facts to read expired / undated) — Georgia [0] expired cpr_first_aid, [1] undated cpr_first_aid (PAMMS 14.9; Texas the same arms cited to 26 TAC §749.831(e) and its neighbours), [2] the catch-all ADMIT (deliberate: every other type’s lapse or missing date, and a type never recorded, admit — the missing-training arm is #1723). A congregate provider records no training (#2055), so every type is never-recorded and the gate admits it on training. ONE consult decides both gates; the refusal order is license, training, then the untyped capacity 400. v1.2 (#1721) adds matching-scope, an input-less first-hit table whose one row answers matching_scope_statuses — the STORED license statuses craig-placement may present (Georgia and Texas: ["active"]; an array-literal output cell — zen evaluates every output cell as an expression); matching consults it once per search before the candidate scan (with a facts-free {} document until #1776; since then the same single consult carries the child facts — v1.3 below) and binds the list in SQL, so a license_gate row’s license_admits_matching decides wherever a jurisdiction’s scope names that status. v1.3 (#1775, plan identity-based-matching decision 6) adds the four per-REQUEST child_criteria tables — child-age-band (child.age_years → age_band), child-icwa (child.icwa_person, child.icwa_case → icwa), child-sibling (child.sibling_group_size → sibling), child-matchability (the four facts → child_refusal_reason) — one first-hit table per independent output (a single table would need a cross-product row set; collect is unused corpus-wide), merged at the output node with the gates and the scope and answered by the SAME consult; the facts are what craig-cases projects for the focus child (age in years, the two ICWA booleans — the person carrier DERIVED by craig-cases through the federal federal-icwa-status ruleset over the case’s current child_icwa_facts row, the case carrier cases.icwa_flag raw (#1993, ADR-073 § Amendment) — the count of active child-role case members), never client-supplied. The criterion vocabulary is CLOSED — require \| prefer \| ignore on all three keys (craig-placement binds require as a WHERE arm, prefer as a rank prefix ahead of the kinship / free-bed order, ignore as neither — #1776) — and child_refusal_reason answers the none sentinel unless a jurisdiction adds a refusing row above it (a ruleset promotion, never a code change). Georgia and Texas: age band require (PAMMS 10.4 / CPS Handbook 4114.3 — the home’s approved age range bounds what it may accept, ⁂ #1073); ICWA require when EITHER carrier is set (25 USC §1915(b); the person-OR-case derivation ruled 2026-09-10, ⁂ #1073); siblings prefer at a group of two or more (42 USC §671(a)(31)(A) is a reasonable-efforts duty — the #1660 reading; a hard bar is a one-token flip with its own citation, ⁂ #1073); no refusing arm. Consumed since #1776 (the #972 cutover) by craig-placement’s ONE merged per-request consult — context_type placement-matching-criteria, context_id = the child; the #1721 placement-matching-scope token is retired — over { child: {..} } at matching and at a home-less activation, and over the home facts flattened beside child (placement-eligibility / the home) at a with-home activation, where the require arms are re-applied to the home in memory (409 child-criteria-violated, after license and training, before capacity); a document without child.* still answers require / ignore / ignore / none, and v1.3 changed no gate verdict and no scope answer. The #1666 RTC-vs-ICWA precedence is NOT a v1.3 row — it needs care-needs facts PlacementFacts does not carry (#1780). The expiry SWEEP consults nothing — lead_days is WHEN to warn.

  8. investigation response (#895 / #1743, plan investigation-response-deadlines §A; ADR-072 tier 1): THREE files per jurisdiction, ONE decision table each, so every file satisfies its own required output schema (an unmatched operation-gated table would emit nothing). {j}-response-priority v1.0 — the per-child → intake roll-up consulted at conversion: one present.<TOKEN> boolean input column per token (nested zen paths; Rust sets present.{tok}: true for each DISTINCT response_priority on the effective decision’s evaluation rows), plus subject_count, disposition_kind, decision_actor_role, attested_priority; rows most-urgent-first (first-hit order IS the most-urgent-wins policy), then the supervisory attested arm (a screened-in decision whose actor sits at or above the jurisdiction’s floor — the attested token is copied through by a field-less expression output cell), then the NONE catch-all; outputs response_priority + response_priority_basis. {j}-response-window v1.0 — consulted at investigation open: response_priority → window_count, window_unit (HOURS \| WEEKDAYS \| CALENDAR_DAYS \| NONE), receipt_day_is_day_one, skip_weekends, skip_holidays, end_of_day, window_basis; the catch-all is 0 / NONE / false ×4. {j}-response-deadline-override v1.0 — actor_role, investigation_status, first_contact_recorded, is_extension, requested_extension_hours, reason_provided → override_permitted, override_reason_required, override_extend_only, override_max_extension_hours, override_basis; Georgia and Texas ship ONE catch-all refuse row (CLOSED ⁂ #1073 — opening an arm is a ruleset promotion, never a code change). Vocabularies are CLOSED: the tokens are the intake-screening OUTPUT schema’s response_priority enum (GA v1.4 / TX v1.3) and the actor roles its metadata.screening.actor_roles tokens — cargo xtask rules check refuses a drift (#1754, xtask/src/cmd/rules_response.rs): in every ruleset dir carrying any of the four files ({j}-intake-screening and the three above; a dir carrying none of them, such as the federal layer, is not linted) it compares the roll-up’s present.<TOKEN> columns, its attested_priority and decision_actor_role input enums and its response_priority output enum (plus NONE), the window’s response_priority input enum (plus NONE) and the override’s actor_role input enum against that vocabulary, naming each drifting file and key; such a dir missing one of the three response files, or a non-fixture one missing its surface, is refused, and testonia, which has no surface, is held to its roll-up’s own sets. The rules test ga_and_tx_response_rulesets_agree_with_their_intake_screening_surfaces pins the same sets on the committed bytes, so Rust never carries a jurisdiction token. The consumers arrive with the plan’s later MRs: craig-cases parses every verdict FAIL-CLOSED (a closed unit set; NONE ⇒ count 0 and every flag false; HOURS ⇒ no day flags; an unknown token or a missing key is a named 500, never a defaulted deadline) and skip_holidays reads the StateBundle holiday calendar (an uncovered calendar refuses). Testonia (the #1621 fixture — free tokens T_FAST \| T_SLOW, roles testonia_worker \| testonia_supervisor, never seeded) carries the tree’s only holiday-skipping arm (T_SLOW → 10 WEEKDAYS, skip_holidays: true) and its only OPEN override arm (testonia_supervisor ∧ extension ∧ reason → extend-only, max 240 h), so both seams have a live evaluation while every real arm is closed or holiday-inclusive.

metadata block extension (ADR-019, generalizable pattern)

Person-match rulesets carry a top-level metadata object at the JDM document root that the cases-side orchestrator reads to dispatch behavior:

"metadata": {
  "seed_sources": ["allegations", "case_household"],
  "name_similarity_algorithm": "trigram_jaccard"
}
  • seed_sources: [String] — bounded enum of candidate-assembly sources the orchestrator should run before evaluating the JDM. Current allowlist: allegations (persons named on the report’s converted referral), case_household (household members of a caller-supplied seed_case_id). Always implicitly augmented by a pg_trgm name pre-filter capped at 25 candidates.

  • name_similarity_algorithm: String — registry key for the craig_matching::NameSimilarity impl to inject into Layer 1’s signal compute. Current allowlist: trigram_jaccard.

Both keys are validated at pre-push time by cargo xtask validate (see xtask/src/cmd/rules.rs::validate_metadata) and re-validated at runtime by the orchestrator’s similarity registry (services/craig-cases/src/matching/similarity.rs::select) — defense in depth against a deployed ruleset out of sync with the binary.

This metadata extension is intended to generalize. Future per-jurisdiction-pluggable behaviors (e.g., screening-allowlists in #212/#213) should add their own bounded keys + xtask validators following this template.

metadata.ive — the IV-E determination inputs (#1719, ADR-072 § Amendment — #1719)

Each {j}-ive-eligibility ruleset declares the facts a worker answers for a Title IV-E determination. The IV-E tab renders exactly what is declared, and craig-cases refuses anything else. Georgia v3.6 declares 14 inputs and Texas v1.8 declares 25; the files are the source, so these counts drift. The block sits at the document root, beside the inputNode’s content.schema, which is a JSON string (the screening shape, § The intake-screening rulesets own the screening act). Abridged shape:

"metadata": {
  "ive": {
    "inputs": [
      { "key": "monthly_income", "scope": "case", "title": "…", "description": "…" },
      { "key": "removal_basis", "scope": "child", "title": "…", "description": "…",
        "options": [ { "token": "court_order", "label": "…" } ] }
    ]
  }
}
  • An entry is {key, scope, title, description, options?}:

    • key matches ^[a-z][a-z0-9_]{0,63}$ and is unique. A dotted key is not allowed because it would read a nested member. No entry may name a server key or an ssa_-prefixed key.

    • title and each option label are at most 100 characters, description at most 2000, and none may be blank.

    • An enum input lists options: [{token, label}], one per schema token and no others.

    • The title, description and labels are the ruleset’s own English (the screening precedent); no bundle message carries an input’s words.

    • The description carries the policy source and the field instructions. A citable metadata.ive is a follow-up.

  • Scope is the policy meaning, never the key’s spelling.

    • child means a sibling’s value can lawfully differ. Examples: citizenship; Georgia’s countable resources; the specified-relative removal; the deprivation; Texas’s certified-group parent count, its physical-removal pair and its extended-foster-care age-check keys; and both jurisdictions' removal and judicial findings (each child’s own order).

    • case is a household total. Examples: Georgia’s monthly income; Texas’s certified-group size, income and resources ⁂ #1073.

    • The web renders a child input once per included child. craig-cases refuses a child key sent case-wide, and a case key sent in a child’s document.

  • The schema is a strict Draft-7 subset.

    • The schema object has exactly these keys: $schema (optional; if present, exactly http://json-schema.org/draft-07/schema#), "type":"object", "additionalProperties":false, "required":[] (optional, empty) and "properties".

    • Each property is exactly one of: {"type":"boolean"}; {"type":"string","enum":[…]}; {"type":"string","format":"date"}; or {"type":"integer"|"number","minimum":m} with an optional "maximum".

    • Every numeric property states a non-negative minimum, because every IV-E numeric domain is non-negative. A maximum needs a cited policy or operational limit, and none exists.

    • zen enforces the schema at evaluate (format included), so it refuses a key the schema does not list there too.

  • Server keys are schema properties that no entry declares, drawn from the closed registry craig_cases_contracts::ive_surface::IVE_SERVER_KEYS (at #1719: child_age, ssa_deprivation_evidence).

    • craig-cases injects a registry key only where the schema lists it. Georgia lists both. Texas lists child_age only, so it no longer receives the SSA evidence token.

    • A worker can never supply a server key.

  • A blank answer is an absent key, never false. Booleans are tri-state: blank, yes or no.

    • What an unanswered fact means is decided by the ruleset’s rows.

    • Georgia’s shift at v3.6: a blank vpa_best_interest_order past day 180 pends instead of failing, and a blank ctw_in_first_order no longer takes its == false row.

  • The gate. cargo xtask rules check runs xtask/src/cmd/rules_ive.rs::validate_ive_file on every ruleset whose file stem or name ends -ive-eligibility (one without metadata.ive fails) and on any other ruleset that carries the block.

    • It projects the surface with project_ive_surface, the same parser craig-cases runs.

    • It compiles the schema.

    • It runs a census over the graph’s explicit edges, read through zen’s own model and lexer:

      • a decision table fed by the inputNode must effectively read every schema property, meaning each declared input and each listed server key (a blank column reads nothing);

      • no table output may reuse an input key;

      • every other read must come from a direct parent’s output (a grandparent’s output is invisible, because no node sets passThrough).

    • The census refuses a graph it cannot model: a node other than an input, output or decision table node, a collect table, or a table transform attribute.

  • At runtime craig-cases reads the configured ruleset by name, projects it the same way and serves it as GET /v1/cases/ive-surface, with the row’s full (rule_set_id, revision) identity (Case Management API).

    • The act names the identity the worker was shown.

    • craig-cases validates each answer against its declared property with the Draft-7 validator zen uses.

    • It consults craig-rules with expect set to that identity. A promotion between render and consult is therefore a 409 ive-policy-moved, never an evaluation under a policy the worker did not see.

    • Until a ruleset carrying the block is active, the surface read and the act answer 503 ive-surface-not-ready, and the tab shows a notice with submit disabled. Operator steps: Deployment Guide § IV-E determination inputs cutover.

  • Changing an input (adding it, re-scoping it, relabelling it or changing its bounds) is a ruleset promotion, never a code change. A new server derivation is a code change (a registry entry and its writer in craig-cases) plus a ruleset that lists it.

metadata.safety — the safety assessment facts (#3104)

Each {j}-safety-assessment ruleset declares the facts a worker attests in a safety assessment. The safety form renders exactly what is declared, and craig-cases refuses an answer set that names anything else or leaves a declared fact out. Georgia v3.1 declares eleven facts and Texas v1.4 declares ten; the files are the source, so these counts drift. The block sits at the document root, beside the inputNode’s content.schema, which is a JSON string. Abridged shape:

"metadata": {
  "safety": {
    "attestable_facts": [
      { "key": "present_danger_identified", "title": "…", "description": "…" },
      { "key": "impending_danger_threats_count", "title": "…", "description": "…" }
    ]
  }
}
  • The block is a closed object with one member, attestable_facts: a non-empty array, in the order the form renders. A ruleset that declares no fact is refused, because a worker would attest nothing and the tables would decide from no input.

  • An entry is {key, title, description} and nothing else:

    • key matches ^[a-z][a-z0-9_]{0,63}$ and is unique. No entry may name a server key.

    • title is at most 100 characters, description at most 2000, and neither may be blank.

    • The description says whose fact it is and how to answer it, because every fact must be answered and the form asks no conditional question. A threshold criterion says to answer No when no threat is identified; a child fact says it is the most vulnerable alleged victim’s. Only non-blank text is checked mechanically: the wording is reviewed in the config repository’s merge request and at the pin.

  • The schema is closed and requires every property.

    • The schema object has exactly these keys: $schema (optional; if present, exactly http://json-schema.org/draft-07/schema#), "type":"object", "additionalProperties":false, "properties" and "required", which lists every property once.

    • Each property is exactly {"type":"boolean"} or {"type":"integer","minimum":m} with an optional "maximum"; m is never negative.

    • Every property is a declared fact or a server key, and every declared fact is a property.

    • Because required is the whole property set, the rules service itself refuses an input that leaves a fact out. A table’s last row is therefore never reached by a missing answer, which is how an incomplete input used to be decided SAFE.

  • Server keys are schema properties no entry declares, drawn from craig_cases_contracts::safety_surface::SAFETY_SERVER_KEYS. The list is empty: no safety input is server-derived, so a ruleset’s inputs are exactly its declared facts.

  • The output. Some decision table emits safety_decision. craig-cases stores its value as the engine decision and refuses an evaluation that carries none (a 500; nothing is recorded, and UNKNOWN is never substituted).

  • One assessment covers the investigation. The child facts are attested for one child, so they must not decide for all of them: in both shipped rulesets no safety_decision depends on a child fact.

  • The gate. cargo xtask rules check runs xtask/src/cmd/rules_safety.rs on every ruleset whose file stem or name ends -safety-assessment (one without metadata.safety fails) and on any other ruleset that carries the block.

    • It projects the surface with project_safety_surface, the same parser craig-cases runs, and compiles the schema.

    • It runs the IV-E graph census (metadata.ive — the IV-E determination inputs (#1719, ADR-072 § Amendment — #1719)): a table read that is neither a schema property read over an edge from the inputNode nor a direct parent’s output is refused, as are a declared fact no table reads and a table output that reuses an input key.

    • It refuses a graph with no safety_decision output.

  • At runtime craig-cases reads the configured ruleset by name, projects it the same way and serves it as GET /v1/cases/safety-surface, with the row’s full (rule_set_id, revision) identity (Case Management API).

    • The act (POST /v1/cases/investigations/{id}/safety-assessment) names that identity as surface and carries one answer per fact in facts: true / false, or a non-negative integer.

    • An answer for a key the surface does not declare, or a value its property refuses, is a 400 safety-fact-not-declared naming the key and the expected kind, never the value. A declared fact with no answer is a 422 safety-fact-unanswered listing the missing keys. Nothing is consulted or recorded on either.

    • craig-cases consults craig-rules with expect set to the identity. A promotion between render and consult is a 409 safety-policy-moved, never an evaluation under a policy the worker did not see.

    • A worker override must carry a reason (422 validation-failed naming worker_override_reason).

    • Until a ruleset carrying the block is active, the surface read and the act answer 503 safety-surface-not-ready with one closed reason token (metadata-absent for a ruleset without the block), and the form page is the upstream-failure page. /readyz is untouched.

  • Changing a fact (adding it, rewording it or changing its bounds) is a ruleset promotion, never a code change. A new server derivation is a code change (a registry entry and its writer in craig-cases) plus a ruleset that lists it.

metadata.authority — the administrative-authority hierarchy (ADR-074, #1786)

{j}-administrative-authority.json (never -authz- in the name — that substring buckets a file to file-level citations and is craig-authz’s boot-load prefix) declares a jurisdiction’s office hierarchy AND every per-action approval floor as ONE first-hit table, the single source ADR-072 § Administrative authority demands (StateBundles never double-declare it). The block is REQUIRED on a file of that name and REFUSED on any other:

"metadata": {
  "authority": {
    "offices": [
      { "token": "county_director",   "realm_roles": ["county_director"],   "rank": 1 },
      { "token": "regional_director", "realm_roles": ["regional_director"], "rank": 2 },
      { "token": "state_office",      "realm_roles": ["state_office"],      "rank": 3 }
    ]
  }
}
  • offices[].token — the office; a realm-role NAME by construction (the persisted approval_level keeps ADR-054’s one vocabulary), unique, [a-z0-9_].

  • offices[].realm_roles — the realm roles that confer it: non-empty, token among them, each a member of craig_auth::OFFICE_REALM_ROLES (the fleet triad county_director / regional_director / state_office — a fourth tier is a fleet contract change, #1791), each owned by AT MOST one office (an unowned role holds no office in that jurisdiction). The office a session HOLDS is the highest-ranked entry whose realm_roles intersects the session’s roles; none → the existing no-office refusal.

  • offices[].rank — an integer ≥ 1, unique; higher outranks lower. A two-tier jurisdiction declares two entries (the Texas twin: regional_director 1, state_office 2 — a county_director session holds no office there).

The table: inputs operation, from_status, to_status, reason_code, head_reason in that order (an absent component is the literal "none" — the resolver never omits a key, so == null never arises); ONE output office whose enum is the declared tokens ∪ unconfigured; every cell a wildcard "" or a quoted literal (no expressions in this family — one row, one citation); the operation enum and every operation cell equal craig_financial_contracts::subsidy_authority::AuthorityOperation::ALL; the status enums equal SubsidyAgreementStatus ∪ none; the LAST row is total ("" ×5) and answers unconfigured — the ADR-072 fail-closed sentinel (a shape no row declares is refused 403, never a defaulted floor). Validated by cargo xtask rules check (xtask/src/cmd/rules_authority.rs, name-keyed) through the ONE parser AuthorityDeclaration::parse that craig-financial’s verifier will run at boot (#1787) — the lint and the service cannot disagree on structure (the Draft-7 compile is the lint’s alone; zen re-validates the schemas at every evaluation); the parser’s closed refusal tokens (metadata-absent | metadata-invalid | schema-invalid | output-enum-mismatch | operation-vocabulary-drift) become the structural members of the service’s 503 detail.

Evidence, not a canary (ADR-074 decision 13): in-process resolutions never populate rule_evaluations, so this family’s promotion canary is thin forever. The jurisdiction layer’s evidence/administrative-authority.toml carries every key’s expected office () and the full declared-token × key allow | refuse table (), read by AuthorityEvidence::parse; cargo xtask authority-evidence <ruleset.json> <evidence.toml> replays every key through zen (validate runs it over both twins) and prints the pair digest authority-evidence:<sha256> that a craig rules promote --acknowledged-thin-corpus of this family must quote in its --reason. The rules-side golden (services/craig-rules/tests/administrative_authority_ruleset.rs) pins the Georgia file to the legacy required_level matrix arm-for-arm.

JDM emits classification, Rust does scoring (ADR-019 Open questions)

zen-engine v0.54 truncates fractional decision-table number outputs to int. Person-match rulesets therefore emit confidence: "AUTO" | "SUGGEST" | "REJECT" + reasons: String only — the numeric score is computed in Rust by the orchestrator (services/craig-cases/src/matching/mod.rs::derive_score).

The federal ruleset class (the federal layer, plan afcars-federal-ruleset)

The federal layer (craig-config-federal; rulesets/federal/ until U4) is a ruleset DIRECTORY, not a jurisdiction (1969, plan afcars-federal-ruleset D1 / D2 / D3 / D7 / D8): it has no StateBundle (so no business timezone) and no scenario pack, but it is walked like every layer — xtask/src/cmd/rules.rs::ruleset_dirs() lists the layer view’s directories (so rules check walks it) — and registered in xtask/src/cmd/policy.rs::BLOCKING_JURISDICTIONS (so a citation finding there fails validate, never advises) — and the seed’s /config//current/ glob (/seed/rulesets// until U4) loads it into craig-rules on the devstack by name. Its first document, federal-afcars-2020.json (version IS the dictionary_version), is the jurisdiction-INVARIANT AFCARS 2020 data dictionary of 45 CFR 1355.41–1355.47 as amended by 85 FR 28410 (every row anchored on 2022-10-01, the first day of the first report period the amended rule governs — see Row identity below); each jurisdiction’s {j}-afcars-crosswalk (U3, #1971) maps its own vocabularies onto these element keys, never the other way round. Transcription state: COMPLETE (plan afcars-dictionary-transcription, #1973 — #1983 transcription I, #1984 transcription II): 142 element rows with 328 applicability arms (293 element-level: #2157 folded the (e)(15) / (h)(9) per-status arms into one *_not_a_couple arm each, #2167 the (e)(10) e2_no, the (h)(4) / (h)(9) per-answer g3_* and the 2028 (i)(10) / (i)(11) per-answer g3_* / exit_to_guardianship arms into one e2_not_yes / g3_not_adoption_or_guardianship / g3_not_adoption arm each, and #2168 the 2028 (i)(2) / (i)(3) per-answer c5_* pairs into one c5_not_involuntary / c5_not_voluntary arm each, plus one R-S4 arm on (i)(5) and (i)(6); 35 in the dictionary’s first <category>-narrowed tables — (i)(5)(i)–(iv) and (i)(10)(i)–(iii) blank-first under the fact-shaped tribe_established_order_of_preference, the state_agency-precedent token RU-10 admitted for "If the Indian child’s Tribe established a different order of preference by resolution", 89 FR 96589–96590, (i)(5)(i)–(iv) also under not_placed_in_a_foster_care_or_pre_adoptive_placement) — the 92 §1355.44 (a)–(h) rows (4 · 28 · 7 · 10 · 18 · 6 · 4 · 15) and the 12 §1355.45 rows anchored on 2022-10-01, plus the 38-row 2028 series (effective_from = 2028-10-01: §1355.44 (b)(3)–(6) as revised and the new (i), FR Doc 2024-28072, 89 FR 96569, cited federal_register on the pinned PDF granule) whose six 2022 ICWA predecessors b)(3), (b)(4)(i)–(ii), (b)(5)(i)–(ii), (b)(6 close at 2028-10-01 with their arms; every cell re-read from the hash-pinned govinfo XML / FR text and attested in sources.toml.

Its second document — the ICWA-status decision ruleset (#1993). federal-icwa-status.json (version v1.0) is a DECISION ruleset, not a dictionary: the dir admits, beside the dictionary, any federal-<x>.json whose name equals its stem and which carries no metadata.afcars, compiled and linted as every decision ruleset is. ONE first-hit table icwa-status over three flat inputs (court_determination, reason_to_know, icwa_applies — tokens or null) answers icwa_person (boolean) and icwa_basis (court_determined_indian_child \| court_determined_not_indian_child \| reason_to_know \| icwa_applies \| no_reason_to_know) in five rows, in precedence order: the court’s yes_icwa_applies → true and no_icwa_does_not_apply → false, then reason_to_know = yes → true (25 CFR 23.107(b)(2)), then icwa_applies = yes → true (23.107(c): an ICWA-applies notice from a Tribe or court is a (c)(1) reason to know), then the catch-all → false (23.107(b): the treat-as rule attaches only where there is reason to know). It is the federal treat-as rule binding every jurisdiction alike (ADR-072 § Amendment — #949), so it lives here and not in a jurisdiction’s tables: craig-cases' placement-facts projection consults it for icwa_person over the case’s current child_icwa_facts row (data-model-cases.adoc#icwa-ledger; ADR-073 § Amendment). Its provenance takes the dictionary’s sources.toml → generated citations.toml path: a [source] + [review] pair per row keyed by its manifest key (federal-icwa-status.json#description, federal-icwa-status.json#nodes[id=icwa-status].content.rules[<i>]), authority cfr, pinned to the govinfo 25 CFR 23.107 XML; a decision-document row REQUIRES effective_date (2016-12-12, 81 FR 38778), which a dictionary or pin row refuses; cargo xtask rules afcars-manifest plans its header row and one row per table rule.

The eight tables and the sentinel rule

Eight first-hit decision tables, every one fed by the input node and merged at the output node, so one evaluation answers all eight:

  • elements — key → token, name, file, group, cardinality, requiredness, clean_class, temporal_anchor, aggregation, effective_from, effective_until, value_set (in that order; value_set LAST).

  • periods — half (A \| B) → start_mmdd, end_mmdd, due_mmdd, weekend_roll, effective_from, effective_until (§1355.43(a): A = October 1 – March 31, due May 15; B = April 1 – September 30, due November 14; a weekend deadline rolls to the following Monday).

  • applicability — key, predicate → applies, effective_from, effective_until (always → required for a required element; a conditional element carries one <predicate> → required arm per enabling clause FOLLOWED by its always → blank arm, first-hit — the "if … otherwise blank" of the CFR, #1983; the one ruled exception is (c)(5)(i) / (c)(5)(ii), whose petition-or-deceased / terminated-or-deceased clauses fold into ONE disjunctive token each, c5i_petition_filed_or_parent_deceased / c5_terminated_or_parent_deceased — P-C ruling R-C11, #1999). The (e)(15) / (h)(9) second-parent rows carry ONE blank-first complement arm on the (e)(7) / (h)(1) status, e7_not_a_couple / h1_not_a_couple — the otherwise-clause, a blank status included — above state_agency → required (#2157). The (e)(10) / (h)(4) / (h)(9) tribal-membership rows carry ONE blank-first complement arm on (e)(2) / (g)(3), e2_not_yes / g3_not_adoption_or_guardianship (the paragraph’s otherwise-clause, a blank gate included), above state_agency → required; (h)(9)'s sits above h1_not_a_couple. The 2028 (i)(10), its (i)(10)(i)–(iii) categories and (i)(11) carry ONE on g3_not_adoption, after the straddle arm (and the categories' tribe arm), above b6i_yes_icwa_applies → required (#2167). A complement token is named <gating paragraph>_not_<enabling answer(s)> (answers joined by _or_; _not_a_couple names the two couple answers) and holds whenever the gate is not that answer, a blank gate included. The 2028 (i)(2)(i)–(iii) carry ONE on c5_not_involuntary and (i)(3)(i)–(iii) ONE on c5_not_voluntary, after the straddle arm, above b6i_yes_icwa_applies → required (#2168): (c)(5) is answered for each parent and (i)(2) / (i)(3) once per child, so each holds when NO parent’s (c)(5) is the enabling answer, a blank (c)(5) and a parentless child included (plan afcars-2028-series R-S1). (i)(5), its (i)(5)(i)–(iv) categories and (i)(6) carry ONE on the fact-shaped not_placed_in_a_foster_care_or_pre_adoptive_placement — (e)(2) no and (e)(4) runaway, whereabouts_unknown, placed_at_home or blank — after the straddle arm (and the categories' tribe arm), above b6i_yes_icwa_applies (R-S4: every 25 CFR 23.2 placement, institutions included, stays owed); (i)(7) / (i)(8) follow through their (i)(6) / (i)(7) gates.

  • exemptions — class → file, compliance, file_membership, cfr, effective_from, effective_until (§1355.46(a): turned_18_prior_period in either file and assistance_ive_guardianship in the assist file are exempt from the COMPLIANCE determination with membership retained — the records stay in the file).

  • population — situation (foster_care \| ive_payments_under_agreement \| runaway_or_whereabouts_unknown) → reporting_population, more_than_hours, retained_through, effective_from, effective_until (§1355.42(a): more than 24 hours in out-of-home care; retained through the end of the report period in which responsibility, or for (ii) the agreement payment, ends). craig-reporting evaluates the table in src/afcars/derive/population.rs (P-D2 U5, #2142): strictly more than more_than_hours over the whole episode, an open episode measured to the window’s to; retained_through is not evaluated separately, because counting the whole episode already covers it; (a)(1)(ii) has no capture (#2147).

  • tardy — transaction (oohc.d2.2022-10-01 \| oohc.g2.2022-10-01) → event, more_than_days, effective_from, effective_until (§1355.46(b)(5): the removal transaction date (d)(2) against the removal date (d)(1), the exit transaction date (g)(2) against the exit date (g)(1); tardy when entered MORE than 30 days after the event, exactly 30 is not; read by craig-reporting’s classifier, validate::classify, P-D3 U4 #2161).

  • min_rows — element → min_rows (0 \| 1), level (child \| removal), effective_from, effective_until (#2157). It covers the 27 repeating 2022 out-of-home care elements, (c)(5)–(c)(5)(ii), (e)(1)–(e)(18) and (f)(1)–(f)(6), and, from 2028-10-01, the four repeating 2028 elements (i)(5)–(i)(8), each 0 per removal (each conditioned on another paragraph of its own arrangement; #2168) — 31 rows, each cited to its §1355.44 sentence: a missing group row is owed only the elements the text requires on every row of that group, so (e)(1), (e)(2), (e)(5) are 1 per removal and (f)(1), (f)(2) 1 per child; (c)(5)–(c)(5)(ii), (f)(3)–(f)(6) and the conditional (e)(3), (e)(4), (e)(6)–(e)(18) are 0. Fewer stored rows than min_rows at that level is one missing observation (P-D3 U5).

  • cohorts — predicate → element, boundary, effective_from, effective_until (#2168). One row per cohort predicate: icwa_straddle_cohort → element oohc.d1.2022-10-01 (the removal date), boundary 2028-10-01, from 2028-10-01, cited to §1355.43(b)(3) (89 FR 96588). The boundary is data — never an arm’s effective_from (a re-cut arm shares its series) nor a constant: an episode is in the cohort iff its element date is BEFORE the boundary (Cohort::contains; plan afcars-2028-series R-S3). The node is required: since U5 (#2274) a document without it is table-missing, so dictionary 1.5.0, which predates the table, no longer parses (the #2168 binary read both during the two-step rollout, plan D7); craig-reporting’s evaluator compares the boundary with the (d)(1) of the row’s episode — a removal row’s own, an arrangement’s removal’s, the child row’s latest removal (validate::applicability). An evaluation carrying a predicate also lands on this table: its sentinel, unless the predicate names a cohort.

Every table is TOTAL: its LAST row has every input "", names exactly ONE output "unconfigured" (token, start_mmdd, applies, compliance, reporting_population, event, min_rows, boundary) and leaves every other output empty — the ADR-072 fail-closed sentinel a consumer refuses by name, never a defaulted element. The eight sentinel rows are [plumbing] on the dir’s citation-exceptions.toml, and their KEYS are generator-owned (#1982): after rendering, cargo xtask rules afcars-manifest re-indexes every [plumbing] entry keyed federal-afcars-2020.json#nodes[id=<table>].content.rules[<i>] to that table’s last row (rules.len() - 1 of the raw document), touching only the index — reason, owner, review_by and every comment survive — and --check compares the ledger byte for byte too (a stale index names the first differing line). Inserting a row above a sentinel therefore never means editing the ledger by hand; a non-plumbing entry is never moved. A NEW table’s [plumbing] entry is the one exception: it is hand-added once, and the generator keeps its index from then on. Every other row carries a source. Cells follow the tree’s convention — an input "" (any) or a quoted zen literal; an output a quoted literal; the OPEN effective_until is the empty LITERAL "\"\"" (a bare "" output is "no output" to zen and would drop the key). The rules-side golden (services/craig-rules/tests/afcars_dictionary.rs) pins the table ids, the field lists, the row counts and the sentinels, the per-group §1355.44 census (rows, containers, leaves, each / gated category counts beside their paragraphs), and evaluates the discovery smoke’s {}, the (b)(2) key and a conditional (d) row through zen in-process.

Row identity, intervals and the value-set language

  • Row identity — an element key is <file>.<paragraph>.<effective_from>: the file oohc (§1355.44, out-of-home care) or assist (§1355.45, adoption and guardianship assistance), the CFR paragraph, and the ISO date the row takes effect — oohc.b2.2022-10-01. The paragraph grammar is [a-z][ivx]: one lowercase letter, optional digits, and an optional roman run that MUST be a canonical numeral 1–39 (b2 = (b)(2), c5i = (c)(5)(i), d6ii = (d)(6)(ii); assist.d / assist.e / assist.f key the unnumbered paragraphs; iiii, vx, ic are refused, the detail naming the numeral rule). The anchor date: every 2020-rule row’s effective_from is 2022-10-01 — the first day of the first report period 85 FR 28410 governs, never the rule’s publication or in-force date — so view_for resolves a period ending 2022-09-30 to NO row. The key’s file MUST equal the row’s file output and its date the row’s effective_from; a re-cut of the same paragraph is a NEW key with a later date (oohc.b3.2028-10-01), never an edit in place. Series: <file>.<paragraph> (ElementKey::series) is the identity the overlap check and the view group on — the date leaves the key — so successive keys of one series are VERSIONS whose intervals must abut: an unclosed 2022 row beside its 2028 re-cut is overlapping-rows, and ViewUnavailable names the series. Two-input tables join their inputs with / (oohc.b2.2022-10-01/always); their overlap / group key is <series>/<predicate>, and an applicability arm targeting ONE category of an each / gated element keys <file>.<paragraph>.<date>#<category> (group key <series>#<category>/<predicate>). The referential lint (#1982): once every table’s rows exist (after the overlap pass, before the pins) an applicability row whose target names no element SERIES in force over the row’s whole interval — no rows, a gap between versions, an early end — or a category that a version in force under the row does not list in its each / gated atom (an enum token is a response, never a category) is applicability-unbound, the key and the category named; an element with requiredness = conditional that no applicability row targets (bare or narrowed) is conditional-without-arm; a tardy row whose transaction or event is not an out-of-home care element row in force over the row’s whole interval is tardy-unbound, the column and the key named (#2128); a min_rows row whose element is not a repeating out-of-home care element row in force over the row’s whole interval is min-rows-unbound, the key named (#2157); a cohorts row whose element is not a dated out-of-home care element row in force over the row’s whole interval is key-mismatch, the element named (#2168 — no new reason). Series, not version: an open arm targeting the 2022 key binds across a 2028 re-cut of the same paragraph.

  • Effective intervals — every table’s effective_from / effective_until is HALF-OPEN [from, until): effective_until is the FIRST day the row no longer applies, empty = open. Adjacent rows of one identity satisfy until == next.from; an overlap is a covering conflict refused at parse; a gap makes the view REFUSE a date no row covers, and a row retired before the asked date is ABSENT, not unavailable. A view is selected by the report period’s END date.

  • Value sets — a typed language, canonical on display: enum(a|b|…) (tokens [a-z0-9_]+, no duplicates), date, year, month_year, integer(min..max), text(max), indicator(token), and four atoms the transcription needs:

    • qualifier(<token>) — the qualifier of the value atom right before it, so a value and its qualifier are ONE answer (#2157): (b)(1) is date + qualifier(estimated_abandoned). It follows an enum, date, year, month_year, integer, text or decimal atom; alone or first, after an indicator, a qualifier, an each or a gated, or a set’s second qualifier is refused by name. It admits no crosswalk code.

    • decimal(<scale>) — a money amount, scale 0..=6, canonical decimal(2) (§1355.45(c)(2)); a sign or a leading + is refused like text.

    • each(<cat>|<cat>…; <resp>|<resp>…) — ONE row for a per-category list: at least two categories and two responses, every token [a-z0-9_]+ and distinct within its list, canonical form exactly each(a|b; x|y) (one space after the ;, none around |) — the shape of (b)(7) race, e.g. each(asian|white; yes|no).

    • gated(enum(<p>|<p>…); <enabling>; each(…)) — a PRODUCT: the value is the parent response and, iff it equals the enabling token (which MUST be one of the parent’s tokens), one response per category of the inner each; otherwise the list is blank by construction — the shape of (b)(17), e.g. gated(enum(received|none); received; each(ssi|tanf; applies|does_not_apply)).

  • Unions and the cell — atoms join into unions with ` + ` (enum(male|female), date + indicator(not_applicable)); ` + ` joins ALTERNATIVES (two filled is invalid, P-D3 U3) — a qualifier rides its value instead; the split is depth-counting, so a + inside a parenthesised atom stays inside it. An each / gated / decimal atom admits NO crosswalk code (the crosswalk finding names the atom kind). The value_set CELL holds the canonical form unescaped; the parser in craig-reporting-contracts::afcars_dictionary (no zen dependency) is the ONE reader every consumer and rules check share.

  • Admission (P-D3 U3, craig-reporting validate::value_set::admits) — a stored cell is Admitted, Incomplete or Invalid against its value set, Incomplete winning. Incomplete: nothing answered (an empty string, list or map is the blank); an each, or a gated list under its enabling parent, short of a category; an enabling parent with no list; a list with its parent blank; a qualifier without its value. Invalid: two alternatives answered; a token, category or response outside its atom; a list under any other parent; an integer outside its bounds; text over max characters (Unicode scalar values); a decimal(s) needing more than s fractional digits once trailing zeros drop (12.5 is 12.50); a year outside 0–9999.

The tether — _description as the row’s identity

Every sourced row’s _description is a machine-checked TETHER between the JDM cell values and the generated citation: afcars:<table>:<row-key>|<field>|…. The elements tether is POSITIONAL over the twelve outputs in table order with the interval as <from>..<until-or-empty> and value_set last, its | escaped as \|:

afcars:elements:oohc.b2.2022-10-01|sex|Child's sex|oohc|b|most_recent|required|hundred_percent|period_end|per_record|2022-10-01..|enum(male\|female)

The other tables tether as name=value pairs (afcars:periods:A|start_mmdd=10-01|…|effective_until=). The tether is injective over the row’s fields (aggregation and value-set unions included) and round-trips escaped names — a cell edit without the matching _description edit is a rules check failure naming the expected tether.

Provenance: sources.toml → citations.toml

The federal layer’s sources.toml is the dir’s ONE store of provenance, pins and review: a [source."<key>"] per sourced row (authority, source_ref — a govinfo URL fetched into the gitignored .policy-cache/, or a bulletin’s COMMITTED path — federal_citation, source_sha256, fetched_at, optional notes) beside its [review."<key>"] (verified_by, verified_date, attested_sha256). Keys are description (the header), elements:<element-key>, and <table>:<inputs joined '/'>@<effective_from> for the other tables (periods:A@2022-10-01). The pin rule (#1982): every ROW [source] carries source_sha256 WHATEVER its authority — a federal_register or manual row is pinned to the bytes it was transcribed from exactly like a cfr row (federal_sources::validate issue RowPinMissing, which fails afcars-manifest and rules check); the ONE pin-free source is the description header, whose source is the document itself. The fleet doctrine Authority::requires_pin() (PinMissing) is unchanged — the row rule is keyed on the source KEY, not the authority. The two authorities this class introduces to craig-policy are cfr and acf_technical_bulletin (a bulletin row also carries bulletin + bulletin_version); policy-source.toml declares the url source kind. citations.toml is GENERATED — never hand-edited:

  • cargo xtask rules afcars-manifest — regenerates citations.toml from the document + sources.toml, byte-stable across runs, then syncs the ledger’s generator-owned sentinel keys (above); --check (run by cargo xtask rules check) fails on a stale manifest, a stale sentinel key, a tether mismatch, an unsourced row, an unpinned row or a source_sha256 that no longer equals the row’s attested_sha256 (a moved source blocks regeneration until a human re-attests it).

  • The AFCARS ownership partition (#2054, xtask/src/cmd/afcars_partition.rs; run by cargo xtask rules check after the manifest check) — every elements key is listed by EXACTLY one of craig-cases' OWNED_ELEMENTS (craig_cases_fields::afcars), craig-placement’s (craig_placement_contracts::afcars) and OWNED_ELSEWHERE (craig_reporting_contracts::afcars_capture, a key a later plan owns); every listed key is a dictionary key; a map whose stage is its LAST_UNIT maps every key it owns; and every craig-cases column a Person / Derived entry names is in the cases field registry. Each failure is listed (P1 orphan / P1 double owner / P2 unknown key / P3 incomplete / P4 unregistered).

  • cargo xtask rules afcars-manifest --fix-tethers (#1982) — FIRST rewrites every dictionary row’s _description to its computed tether (a format-preserving edit of federal-afcars-2020.json: indentation, key order and every other byte kept; the count is reported; the parser is the oracle, so the fixed text passes the bijection lint by construction), then regenerates. The lint is unchanged — --check still refuses a mismatch; the generator owns the derived text, as it already does for citations.toml’s `value. A document refused for any other reason (a key grammar, an overlap) is left untouched. --check and --fix-tethers are mutually exclusive.

  • cargo xtask rules afcars-attest <key>… --by <who> — records the human review of one OR MORE rows in one act (#1982): EVERY key is validated before any write (an unknown key aborts the whole call with nothing written); then ONE format-preserving write of sources.toml with one [review."<key>"] per key (verified_by, verified_date = today UTC, attested_sha256 = THAT key’s current source_sha256 — never a shared value), then ONE regeneration. A key already attested at its current pin is a reported no-op (the row is not rewritten, whatever --by says) — a re-attestation follows a moved pin, never a whim.

Drift and pins in a url dir (#1970). cargo xtask policy drift reads [source.*] — never the generated manifest — and dispatches per AUTHORITY. A cfr / federal_register row’s source_ref is fetched through PolicyFetcher (10 s connect / 30 s total, fixed) into the gitignored .policy-cache/<sha256 of the URL string>.<ext> and hashed. An acf_technical_bulletin row NEVER fetches: its source_ref is a COMMITTED public document at rulesets/federal/sources/acf/<bulletin>-<bulletin_version>.<ext> (a config reference: sources/acf/… in the federal layer — CI-visible, unlike the cache; a path outside the layer’s sources/ is the federal_sources::validate issue BulletinSourceOutsideTree), hashed in place. Every other authority (manual, pamms, state_statute, acf_program_instruction, federal_statute) is skipped — no pin doctrine. One observed file per distinct source_ref; more than one distinct source_sha256 across its rows is the inconsistency finding. A non-2xx, timeout or transport failure is MISSING-UPSTREAM (pinned) / UNPINNED (not) with the status after the class token — never CHANGED, and the bytes are cached ONLY on a 2xx; changed bytes are CHANGED unless drift-acks.toml (georgia’s shape) acks the CURRENT hash.

  • cargo xtask policy drift --jurisdiction federal — the comparison above; --jurisdiction is repeatable and every dir renders its own section into ONE policy-drift-report.txt (the scheduled policy-drift job runs --jurisdiction georgia --jurisdiction federal --jurisdiction texas; a raise in one dir never skips the others).

  • cargo xtask policy sync-cache --jurisdiction federal --pin — for every pin-requiring source, fetch (or hash the committed bulletin) and write source_sha256 + fetched_at (today UTC) into sources.toml format-preservingly: a moved pin is OVERWRITTEN (it can never launder a review — [review.].attested_sha256 stays behind and the generator refuses), an unchanged pin is left alone (a green --pin is a no-diff no-op; fetched_at moves only with the hash), [review.] is never touched; then regenerate the manifest. When regeneration refuses (an unattested or stale key) the pins STAY written and the command exits 1 naming cargo xtask rules afcars-attest <key> --by <who> — pinned-but-unattested is the honest state. --repin <who> is REFUSED in a url dir with that same sentence: attestation is the human act here, and --pin already overwrites.

  • Limit — drift detects change to the PINNED artefact at the pinned URL / path only. A new annual CFR edition (a new govinfo volume URL each October), a Federal Register amendment published elsewhere, or a new bulletin version is NOT discovered: the October annual-edition check and the FR amendment watch are a maintainer task (automation is #1975).

Url-class rows outside the url dir (#1974). The url-class rows (cfr / federal_register) of a pamms-git or manual dir’s citations.toml take the same fetch: drift fetches each distinct URL through PolicyFetcher into THAT dir’s .policy-cache/ and renders it in that dir’s own section. In a pamms-git dir it sits beside the pamms files; in a manual dir it stands alone, and the manual no-op line prints only when there is no such row. These rows are georgia’s four FMAP federal_register rows and its crosswalk cfr rows, texas’s four FMAP federal_register rows (#2328) and its thirteen 45 CFR 1356.21 rows, and testonia’s crosswalk cfr rows. Their pin store is that citations.toml, never sources.toml, under the pamms #1619 doctrine:

  • policy sync-cache --pin writes initial pins only, leaving verified_date alone.

  • A differing pin is refused, naming --repin <who>, the reviewed overwrite that also stamps verified_by and verified_date.

  • One failed fetch refuses EVERY write in the dir, pamms pins included.

  • Without a pin flag, sync-cache refreshes those rows' cache.

A dir with no url-class row never builds an HTTP client. The xtask test every_url_row_of_a_non_url_dir_is_pinned keeps every such committed row pinned and on a govinfo URL. Decision record: ADR-070 § Amendment — #1974.

Adding an element

  1. Edit federal-afcars-2020.json: the new elements row ABOVE the sentinel (and its applicability row), key <file>.<paragraph>.<effective_from> — the anchor date 2022-10-01 for a 2020-rule paragraph, a roman leaf keyed by its canonical numeral (oohc.c5i.2022-10-01) — the cells in the grammar above. The wire token is the CFR heading with a leading "Child’s" / "Child" and its punctuation dropped, snake_cased (sex, date_of_birth); a roman leaf’s token is its parent’s token + _ + the leaf heading (a HEADINGLESS leaf takes a descriptor from its first noun phrase instead). Uniqueness is per SERIES: a re-cut of the same paragraph KEEPS its token; two distinct series in one file sharing one are refused (token, both keys named).

  2. Run cargo xtask rules afcars-manifest --fix-tethers — every new or re-cut row’s _description is written for you (the tether mismatch still prints the EXPECTED text under --check, for a reviewer). The run then STOPS, exit 1, on the first new row without a [source], naming the record to add — expected at this step: the tethers are written, but citations.toml and the sentinel keys on citation-exceptions.toml are not (the generator syncs the ledger only after a render succeeds).

  3. Add the row’s [source."elements:<key>"] (authority, source_ref, federal_citation) to sources.toml, and beside it one [source."applicability:<key>/<predicate>@<effective_from>"] with the same fields for each applicability row step 1 added (its predicate and effective_from cells, as in applicability:oohc.b2.2022-10-01/always@2022-10-01; #2390). Then cargo xtask policy sync-cache --jurisdiction federal --pin fetches the section (or hashes a bulletin’s committed file) and writes the pins — it exits 1 naming the next step until the rows are attested.

  4. cargo xtask rules afcars-attest elements:<key> applicability:<key>/<predicate>@<effective_from> […] --by "<who / how verified>" — one call per batch, naming the element and each of its applicability rows; each key gets its [review], and an unknown key aborts the batch with nothing written. Its closing regeneration is the first whose render succeeds (once every row step 1 added, element and applicability alike, has its [source] and [review]), so it writes citations.toml AND moves the sentinel key of each table that grew to that table’s new last row on citation-exceptions.toml.

  5. List the key with its owner: craig-cases' or craig-placement’s OWNED_ELEMENTS (with the capture unit that lands it) or OWNED_ELSEWHERE (with the owning plan’s issue) — cargo xtask rules check refuses an element no list owns (P1 orphan).

  6. cargo xtask rules afcars-manifest, then cargo xtask rules check; commit the JSON, sources.toml, the regenerated citations.toml and citation-exceptions.toml (step 4 moved its sentinel keys) together.

The record-layout pins — pins:* citation rows and the upgrade path (#1986)

P-A2 (plan afcars-dictionary-transcription D6) pins the dictionary’s record layout to TWO ACF technical bulletins under metadata.afcars: file_layout { kind, bulletin, bulletin_version, schema_path, schema_sha256 } and record_number { bulletin, bulletin_version, standard_sha256 }. The pins are DOCUMENT assertions (the layout the dictionary claims to describe); the bulletins are their PROVENANCE, and the citation doctrine reaches them the way it reaches every row — through sources.toml and the generated manifest:

  • Two leaf paths, exactly. ADR-070’s reference grammar (ADR-070: Policy Citation Manifest & Provenance Model § Amendment — #1973) gains federal-afcars-2020.json#metadata.afcars.file_layout.schema_sha256 and federal-afcars-2020.json#metadata.afcars.record_number.standard_sha256 — the resolver walks metadata → afcars → <pin> → <leaf> and yields the hash SCALAR, so the audit’s scalar comparison is unchanged. Any other #metadata… path (a non-leaf #metadata.afcars.file_layout, an unknown leaf) is refused with the remedy naming the two. #description was not reused because it carries ONE source and the layout has two bulletins.

  • One citation row per pin. When the document carries pins, cargo xtask rules afcars-manifest emits the rows pins:file_layout and pins:record_number into citations.toml: value = the pin’s hash leaf, authority = "acf_technical_bulletin" with bulletin / bulletin_version copied from the pin, source_ref = the bulletin’s COMMITTED path under the federal layer’s sources/acf/ from the matching [source."pins:<pin>"] block, verified_* from its [review."pins:<pin>"] like every row. The generator REFUSES a pinned document whose sources.toml lacks either pins:* block, and (as today, refuse_unreferenced) an unpinned document whose sources.toml carries one.

  • Today’s committed document is UNPINNED — no pins:* rows, citations.toml byte-identical to U4, and the reporting surface reports layout-unpinned by design (Deployment Guide § AFCARS federal ruleset bootstrap). The pins are exercised with synthetic hashes in tests only until a bulletin is committed (U5b).

  • The bulletins never enter an image. Since U4 (#2955) no image carries configuration: cargo xtask config fetch publishes the federal layer under target/config/, which .dockerignore excludes, and the battery’s .dockerignore canary (every validate that runs the devstack phase, ahead of the refresh; Docker required, #2648) plants target/config/canary-probe.txt for the build’s duration to prove the rule by real .dockerignore semantics. Until U4, .dockerignore excluded rulesets/federal/sources/ (the placement / composition / seed stages copied rulesets/ wholesale) and the canary planted rulesets/federal/sources/acf/probe.pdf. The image COPY of the manifest-checked subset is U5b’s explicit instruction, never the wholesale tree.

Pinning the layout (the upgrade path). A pin is a document change and rides the "Adding an element" shape:

  1. Commit the bulletin to the federal layer at sources/acf/<bulletin>-<bulletin_version>.<ext> and write the two pins into the document’s metadata.afcars (schema_sha256 / standard_sha256 = the sha256 of the committed file’s bytes; schema_path names the layout inside the bulletin).

  2. Add [source."pins:file_layout"] and [source."pins:record_number"] (authority = "acf_technical_bulletin", bulletin, bulletin_version, source_ref = the committed path) to sources.toml; cargo xtask policy sync-cache --jurisdiction federal --pin hashes the committed file in place and writes source_sha256.

  3. cargo xtask rules afcars-attest pins:file_layout pins:record_number --by "<who / how verified>", then cargo xtask rules afcars-manifest and cargo xtask rules check; commit the JSON, the bulletin, sources.toml and the regenerated citations.toml together.

  4. Per environment: promote the dictionary, then each crosswalk, then roll the reporting image, verifying each act’s content_sha256 through GET /v1/reporting/afcars/metadata — the exact commands are the deployment guide’s "First install vs upgrade of the two documents".

Crosswalks ({j}-afcars-crosswalk) — a jurisdiction’s vocabularies onto the dictionary (#1971)

The dictionary names the FEDERAL value set of every element; a jurisdiction never edits it. Instead each jurisdiction dir carries ONE {j}-afcars-crosswalk.json mapping the fleet’s OWN vocabularies onto element codes — one table per (vocabulary, element series) pair. Georgia’s set is the three vocabularies plan afcars-dictionary-transcription § D4 derived per element: craig_reference::Sex onto six sex series (identity), Ethnicity onto six Hispanic-or-Latino series, PermanencyGoal onto (f)(1) — 13 tables, supported_from = "2026A" (#1985). Every other element is capture-sourced (the readings below); Texas registers nothing. Since the five-value Ethnicity re-cut (#1991) the six ethnicity tables follow Ethnicity::VARIANTS row order: ethnicity—​oohc_b8 and ethnicity—​assist_b4 carry five rows and no collapse (hispanic → yes, non_hispanic → no, unknown / abandoned / declined identity); ethnicity—​oohc_e12 / _e17 / _h6 / _h11 (value set yes|no|unknown|declined) carry four identity-or-yes/no rows plus ONE collapse row, abandoned → unmapped. The shared reader is craig_reporting_contracts::afcars_crosswalk (parse, verify and Crosswalk::lookup, the value-to-code read P-D2’s assembly uses (#2141); no zen and no craig-reference dependency — the vocabulary registry is DATA the caller builds), consulted by rules check and by the reporting surface (#1972).

Shape. name = "<j>-afcars-crosswalk" (<j> = [a-z][a-z0-9_]*; rules check also requires the file stem to equal name), version, description, and — because zen nodes carry no metadata — the binding at the TOP level, admitted on the dictionary and crosswalk stems ONLY:

"metadata": { "afcars": {
  "crosswalked_elements": ["oohc.b2", "assist.b2", "oohc.f1"],
  "supported_from": "2026A",
  "tables": {
    "sex--oohc_b2":             { "element": "oohc.b2" },
    "sex--assist_b2":           { "element": "assist.b2" },
    "permanency_goal--oohc_f1": { "element": "oohc.f1" }
  }
} }

The table id and the series binding. A table node id is <vocabulary>--<file>_<paragraph> — both halves [a-z][a-z0-9_]*, the separator exactly -- (sex—​oohc_b2, ethnicity—​assist_b4, permanency_goal—​oohc_f1). EVERY id carries the series suffix: one vocabulary may feed several series, so the series is part of the table’s identity and a bare vocabulary id (sex), a single hyphen or an empty half is refused at parse. The vocabulary is DERIVED from the prefix — the binding is tables.<id> = { element = "<file>.<paragraph>" } and nothing else; a stray vocabulary key is refused. The binding names a SERIES, never a dated version: the verifier resolves it, through the dictionary view, to the element version in force at the END of supported_from’s period, and checks the table against THAT version’s value set. A series with no version in force there — a 2028-series table under `2026A — is the lint finding not-in-force and the surface’s crosswalk-incomplete; a series the dictionary has never heard of is unknown-element. crosswalked_elements lists series (oohc.b2), one per bound table, and supported_from is the first report period (<end-year>A|B) the crosswalk answers for.

Rows. The graph is input → one first-hit decisionTableNode PER table → output; every table node has exactly one tables entry and vice versa (table-unbound / binding-without-table), and no series is bound by two entries (series-bound-twice, #2153: a first-hit lookup could only ever answer from one). Each table takes [i_value/value] and answers [o_code/code, o_collapse/collapse, o_citation/citation]: one row per enum VARIANT (i_value "\"male\"", o_code "\"male\"", o_collapse "\"false\"", o_citation "\"\""; value and code are [a-z0-9_]+ tokens, collapse the literal "true" / "false"), then the trailing sentinel (i_value "", o_code "\"unconfigured\"", every other output ""). A collapse = "true" row is a many-to-one mapping and MUST carry a non-empty citation — the federal sentence it rests on — which the manifest cross-checks below. parse returns the FIRST error in its documented walk order, each a closed reason token: document-shape, metadata-shape, table-unbound, binding-without-table, series-bound-twice, table-hit-policy, table-columns, cell-shape, sentinel, key-grammar, duplicate-value, tether-mismatch.

The unmapped arm. A fleet variant the element cannot receive does not break totality: a collapse = "true" row may output the closed token unmapped, with the citation the collapse rule already requires (the CFR sentence whose option list has no place for the variant); the manifest mirror runs on it unchanged. unmapped is never a member of any value set — the verifier admits it ONLY on a collapse row (an unmapped output on a collapse = "false" row is unmapped-row). Downstream, P-D treats unmapped as a data gap on the RECORD — a §1355.46 error the validator names — never as a value; the table stays TOTAL by equality. Georgia carries two kinds: Ethnicity::abandoned → unmapped on the four provider / caregiver ethnicity tables only (oohc_e12 / _e17 / _h6 / _h11 — their option list is yes / no / unknown / declined and has no place for "abandoned"; the citation is the element’s own unknown / declined sentence), while oohc_b8 and assist_b4 receive all five values and carry no collapse row; and PermanencyGoal::emancipation → unmapped (no (f)(1) option exists; the citation is (f)(1)'s option list). Rejected alternatives, recorded in D5: refusing such vocabularies, and re-cutting fleet enums here.

The tether. Every mapping row’s _description (mirrored by the jurisdiction manifest row’s value) is

afcars-crosswalk:<name>:<table-id>:<value>|code=<code>|collapse=<true|false>|citation=<citation>

with | and \ escaped exactly as the dictionary’s tether escapes them. <name> is the DOCUMENT’s name and <table-id> the node id (sex—​oohc_b2, never the bare vocabulary — the six sex tables carry six distinct tethers), so a georgia row pasted into testonia-afcars-crosswalk.json is a tether-mismatch — the fixture’s leak tripwire (crates/craig-policy/tests/testonia_fixture.rs) — and a cell edit without the matching _description edit fails rules check printing the EXPECTED string. The sentinel’s _description is free prose, as in the dictionary.

The verifier’s checks. verify(&Crosswalk, &Dictionary, &VocabularyRegistry) collects EVERY finding (a lint wants the whole picture; the surface reports the first token), each with a closed reason():

  1. support-unservable — supported_from names a period the dictionary view cannot resolve to an in-force layout, so no table can be checked against a version.

  2. unknown-vocabulary / totality — the registry has no entry for the id’s vocabulary prefix, or the row value set ≠ the enum’s variant set by EQUALITY (order-free; missing = a variant with no row, extra = a row value no variant names), checked PER TABLE — six sex tables are six totality checks. This is the ONE place totality is by equality — the generic check_token_enums stays SUBSET.

  3. unknown-element / not-in-force / code-outside-value-set — the dictionary has no such series; the series has no version in force at supported_from’s period end; or a row’s `code is not ADMITTED by that version’s value_set: a member of some enum(…) atom, or the token of an indicator(…) atom. date, year, month_year, integer and text atoms admit no crosswalk code — a crosswalk maps vocabularies, never free values. unmapped is admitted by no value set; it lives under the next two checks.

  4. collapse-citation / unmapped-row — collapse = true without a citation, a citation on a collapse = false row, or unmapped output by a row that is not collapse = true.

  5. element-list — a bound series absent from crosswalked_elements, or a listed series with no table. This is the document’s OWN consistency; completeness against the DICTIONARY (every element the period requires has a table whose series is in force) is the surface’s crosswalk-incomplete.

The registry is VocabularyRegistry::insert(token, &'static [&'static str]) fed by strum::VariantNames — xtask builds it in ONE place, rules_afcars::fleet_vocabularies(), registering exactly sex, ethnicity and permanency_goal (craig_reference::{Sex, Ethnicity, PermanencyGoal}::VARIANTS; the parity test pins the three and their members), and reporting builds the same registry for the surface.

rules check and the provenance cross-check. The *-afcars-crosswalk stem parses + verifies against the COMMITTED the federal layer’s federal-afcars-2020.json (loaded per crosswalk file — the gate’s per-file seam carries no run scope; a failure is prefixed with its reason token), and a metadata.afcars block on any OTHER stem is refused — the block means the family. Unlike federal’s GENERATED manifest, a jurisdiction’s citations.toml is hand-maintained, so the crosswalk rows are CROSS-CHECKED rather than regenerated: for every mapping row the manifest row keyed <file>#nodes[id=<table-id>].content.rules[<i>] must exist with authority = "cfr", its federal_citation equal to the federal source of the version the binding resolves to (45 CFR 1355.44(b)(2); 45 CFR 1355.45(b)(2) for assist.b2), its source_sha256 EQUAL to the federal sources.toml pin [source."elements:<key>"].source_sha256 (a COPIED pin — a georgia row can never silently cite a stale section), and for a collapse row — unmapped rows included — the embedded citation cell appearing verbatim in the manifest row’s notes. The sentinel is [plumbing] on the dir’s citation-exceptions.toml. Fixture dirs (testonia) are cross-checked the same way — their manifest is advisory but complete; rules drift classifies testonia-afcars-crosswalk.json as fixture (never looked up) and the seed’s existing FIXTURE skip covers it.

Adding a vocabulary, or a table for one. A new vocabulary is steps 1–5; a further series for an existing vocabulary (a sex element the dictionary gains) is steps 2–5 under the same prefix.

  1. Derive strum::VariantNames on the craig_reference enum (beside its snake_case serialize_all) and add ONE registry entry to fleet_vocabularies(); extend the parity test’s pinned list.

  2. Read the target element’s TRANSCRIBED value set from the committed dictionary — the output codes are its tokens, never retyped from the CFR — and decide each variant: identity, a collapse onto a broader token, or unmapped where the option list has no place for it. Every collapse row’s citation is the CFR sentence it rests on.

  3. Add ONE table node per series, id <vocabulary>--<file>_<paragraph>: one row per variant + the sentinel, its tables.<id> = { element = "<file>.<paragraph>" } binding, the series in crosswalked_elements.

  4. Run cargo xtask rules check — the tether mismatch prints the EXPECTED _description; paste it. not-in-force here means the series has no version at supported_from — bind a series the period can answer for, never a 2028 row under 2026A.

  5. Write the manifest rows by hand in the jurisdiction layer’s citations.toml (cfr, the section URL, the resolved version’s federal_citation, the federal pin as source_sha256, verified_by / verified_date, a collapse row’s citation mirrored in notes) plus the sentinel’s [plumbing] exception; re-run rules check and cargo xtask policy audit. Mirror the table into fixtures/config/testonia/testonia-afcars-crosswalk.json under ITS name (a different supported_from keeps the mirror honest).

What is NOT a crosswalk — the D4 readings. The census tested every craig_reference vocabulary against every §1355.44 / §1355.45 value set (law.cornell.edu text, govinfo headings). A vocabulary maps only where its semantics coincide with the element’s AT THE ELEMENT’S LEVEL; each reading below is the input the capture (P-B episodes / arrangements / providers, P-C child facts) and sourcing (P-D validation, P-E assistance) programs start from, with the CFR sentence it rests on. None of these becomes a table by adding rows — each needs a fact the fleet does not yet carry.

RaceCategory → (b)(7) Child’s race

"Indicate whether each race category listed in paragraphs (b)(7)(i) through (viii) applies with a 'yes' or 'no.'" — American Indian or Alaska Native, Asian, Black or African American, Native Hawaiian or Other Pacific Islander, White, unknown, abandoned, declined. The element is EIGHT per-category answers (each(…; yes|no)), and since #1991 the fleet captures exactly that: person_demographic_facts.race_<category> ×8 (BOOLEAN; the eight RaceCategory tokens, the wire struct RaceResponses), mapped Each in craig_cases_fields::afcars::AFCARS_ELEMENT_COLUMNS — capture-sourced, no crosswalk table (see the demographics ledger). The provider race series (e)(11) / (e)(16) / (h)(5) / (h)(10) stay P-B captures.

PlacementEndReason, ClosureReason → (g)(3) Exit reason

"Indicate the reason for each of the child’s exits from out-of-home care" — not applicable, reunify with parent(s)/legal guardian(s), live with other relatives, adoption, emancipation, guardianship, runaway or whereabouts unknown, death of child, transfer to another agency. The fleet reason ends a LIVING ARRANGEMENT row (placements.end_reason) or a CASE; the element ends the out-of-home-care EPISODE. P-B’s removal_episodes carries the exit facts (and (g)(4)'s agency kind, for which no vocabulary exists).

PlacementType, LicenseType → (e)(2)–(e)(4)

(e)(2) "Foster family home" — yes / no; (e)(3) "indicate whether each foster family home type listed in paragraphs (e)(3)(i) through (vi) applies or does not apply" — licensed home, therapeutic, shelter care, relative, pre-adoptive, kin (MULTI-select); (e)(4) Other living arrangement type — ONE of fourteen settings from group home (family operated) to placed at home. One fleet placement type straddles a yes/no gate, a multi-select and a single-select at two levels; a license kind is a home attribute, not an arrangement type. P-B’s per-arrangement arrangement_type answers all three.

KinshipRelationship → (e)(8)

"Child’s relationship to the foster parent(s)" — relative(s), non-relative(s), kin (the CFR’s own definitions). The fleet token names a person-to-person relationship at intake (stepparent, godparent, family friend, other); the element is a per-arrangement provider fact with a defined three-way split — and (h)(2) adds "foster parent(s)" for adoptive parents or guardians. P-B provider facts.

MaritalStatus → (e)(7)

"Marital status of the foster parent(s)" — married couple, unmarried couple, separated, single adult ((h)(1) adds "married but individually adopting or obtaining legal guardianship"). The CFR value describes the provider HOUSEHOLD; the fleet token describes ONE intake adult and is never recorded for a foster parent. P-B provider facts.

ContactType → (f)(6)

"Caseworker visit locations" — child’s residence / other location, one per (f)(5) in-person, face-to-face visit. phone_call / video_call / collateral are not visits, so no total table exists; P-C captures caseworker visits WITH their location directly.

AbuseType → (d)(4)

"Indicate whether each circumstance described in paragraphs (d)(4)(i) through (xxxiv) 'applies' or 'does not apply'" — physical abuse, sexual abuse, psychological or emotional abuse, neglect, medical neglect, sex trafficking and twenty-eight more. An ALLEGATION on a referral is not a circumstance AT REMOVAL, and the element is thirty-four answers, not one; P-B captures circumstances on the removal episode ((d)(5) / (d)(6) sex trafficking yes/no likewise).

HouseholdRole → (d)(3)

"Environment at removal" — parent household, relative household, legal guardian household, relative legal guardian household, justice facility, medical/mental health facility, other. A membership ROLE (child / parent / caregiver / sibling / other) is not an environment, and the intake caregiver relationship is not the removal-time household; P-B captures environment on the episode.

CourtOrderType → (c)(5)

"Termination/modification of parental rights" — voluntary / involuntary / not applicable, with (c)(5)(i) the petition date and (c)(5)(ii) the TPR date or date of death. The element is PER PARENT with a voluntary / involuntary axis; the fleet’s termination_of_parental_rights is one per-case order kind with neither. P-C’s per-parent TPR events with dates. ((f)(3) / (f)(4) periodic review and permanency hearing dates are date-list elements — no vocabulary at all.)

PaymentType / SubsidyProgram → (b)(17)–(b)(18)

(b)(17) "Child financial and medical assistance" — whether the child has received support, then which of State/Tribal adoption assistance, State/Tribal foster care, Title IV-E adoption subsidy, Title IV-E guardianship assistance, Title IV-A TANF, Title IV-B, Chafee Program, Other applies; (b)(18) "Title IV-E foster care during report period" — yes / no. PaymentType is curated-only (the live payments.payment_type is free text) and neither answer is a token rename. Erratum (2026-09-22, P-C U0, R-C3): (b)(17) is a CASES capture — child_assistance_facts holds the parent response and the eight sources per child (four of the sources are outside financial’s ledger; capture-first). (b)(18) stays a per-PERIOD fact derived over the ledger: financial’s afcars-facts sourcing (P-D / P-E; (h)(14) assistance agreement type likewise P-E).

ICPC (IcpcRequestType, IcpcDirection) / fips::State → (e)(5)–(e)(6)

(e)(5) "Location of living arrangement" — out-of-state or out-of-tribal service area, in-state or in-tribal service area, out-of-country, runaway or whereabouts unknown; (e)(6) "Jurisdiction or country where child is living" — free text in ACF’s format, a text atom that admits no crosswalk code by rule. Location is a per-arrangement fact (P-B), not an attribute of an ICPC request; State tokens are USPS codes, outside the [a-z0-9_]+ value grammar besides.

RemovalManner → no target

(d)(1)–(d)(6) carry no manner-of-removal element (confirmed against the govinfo paragraph headings). It stays a CRAIG fact with no federal target — R-A9 as recorded.

Vocabularies with no §1355.44 element at all — the NCANDS Child File set (Disposition, ReportSource, ReporterType, the relationship and SafetyDecision enums) and the operational enums — are outside this document’s question entirely.

The verified surface and the metadata GET (#1972)

craig-reporting consumes the class through AfcarsSurfaceClient (services/craig-reporting/src/afcars_surface/), the ADR-074 verified-surface shape copied onto two by-name reads: federal-afcars-2020 and {configured}-afcars-crosswalk, both under ONE 4 s budget with a per-read timeout, re-run by the Critical worker afcars-surface-verifier on the 2 s → 60 s ladder. The surface PARSES and VERIFIES — the shared afcars_dictionary / afcars_crosswalk readers and the crosswalk verifier above — and RETAINS; it never compiles a document (R-A8) and nothing evaluates a dictionary before P-D. Its closed check order is the AfcarsReason token set: dictionary-absent → crosswalk-absent → read-timeout → read-failed → the readers' structural tokens → crosswalk-incomplete (a dictionary-side rule: every series named in crosswalked_elements has a table and a version in force in the dictionary view) → layout-unpinned → dictionary-unsupported-by-binary (the injected RecordSchemaContract::covers checks the element rows of the build’s files — oohc since P-D2 U2, #2139 — but supports no record layout until P-D5, so a pinned dictionary is a LayoutUnsupported delta) → jurisdiction-unregistered (the deployment’s bundle declares no business timezone, #2207) → verified. From the structural check on, a Candidate { dictionary, crosswalk, identity, documents } is retained even when a later arm fails (documents keeps the two documents the pass read, whole, for the policy snapshot); snapshot() answers only a VERIFIED state (Err(NotReady(reason)) otherwise — the RFC-9457 503 afcars-surface-not-ready mapping rides its first caller, P-D), and the gauge afcars_surface_verified{jurisdiction} mirrors the gate — 0 by design until P-A2 pins the layout and P-D extends the contract. Each retained document carries its RulesetIdentity { rule_set_id, revision, content_sha256 }, hashed by craig_rules_contracts::identity::canonical_content_sha256 — the ONE body craig-rules' promotion snapshot also uses, so the surface’s hash equals rule_set_snapshots.content_sha256 by construction.

GET /v1/reporting/afcars/metadata (AfcarsMetadata; the AfcarsSubmission nil-id read rows; Cache-Control: no-store) is the operator’s read over the CANDIDATE, never the verified-only path: surface { state: verified | not_ready, reason, dictionary, crosswalk }, current_period { label, start, end, due } on the jurisdiction clock (the half containing the business date is in progress; the completed half stays CURRENT through its due date, a Saturday / Sunday due date rolled to the next Monday; label = <end-year><half>) and the crosswalk’s supported_from — every field but the state null when no candidate is retained, view_for(d) errs or a half is missing. The rollout order (both documents bootstrapped BEFORE the reporting image) and what a new jurisdiction registers are in Deployment Guide § "AFCARS federal ruleset bootstrap".

Key Differences Between Jurisdictions

Georgia DFCS vs Texas DFPS

Domain Georgia Texas

Safety outcomes

Binary: SAFE/UNSAFE. UNSAFE needs an identified danger AND caregiver protective capacities that are not sufficient (Policy 19.11): present danger with caregiver_protective_capacities_sufficient true is SAFE, and with it false or absent is UNSAFE; confirmed impending danger is UNSAFE when it is false and SAFE when it is true

Three-tier: SAFE/CONDITIONALLY_SAFE/UNSAFE; present danger is UNSAFE whatever the capacities

Child vulnerability (vulnerability_level)

Binary: VULNERABLE / NOT_VULNERABLE (Policy 19.11: "Child vulnerability is not a matter of degree"). A child aged 6 or under is always VULNERABLE, and a child with a physical or mental disability is VULNERABLE at any age; any other child is NOT_VULNERABLE on these two facts. No safety-decision row reads the level

Graded: HIGH / MODERATE / LOW from age, disability and child_nonverbal; the safety decision reads it

Removal and safety-plan flags

emergency_removal_indicated is true only on an UNSAFE decision whose in_home_safety_plan_criteria_met input is false (Policy 19.12: an out-of-home safety plan is required when the in-home criteria are not met). With that input true or absent it is false. safety_plan_applicable is true on every UNSAFE decision and false on every SAFE one

removal_indicated is true on present danger and on impending danger with insufficient capacity; safety_plan_required is true on CONDITIONALLY_SAFE

IV-E age limit

18, no exception (DFCS opted out of the federal extension — Policy 10.1)

21 (extended foster care with the five § 264.101(a-1) participation categories, gated by the CPS 10420 entry prerequisites — DFPS conservatorship the day before the 18th birthday and a signed Form 2540 VEFCA — the six-hour post-secondary floor (10420 / 10421.1) and the 30-day transition window between activities (10421); v1.6 #1718)

AFDC income test

$1,850/mo flat proxy (no PAMMS dollar standard exists)

Appendix 1530-C needs standards by certified group size and parent count — 185% on countable income, 100% after the 1530-F deductions

Judicial timing

The contrary-to-the-welfare (or best-interest) finding in the FIRST ruling sanctioning removal, incl. an earlier TAFC order; reasonable efforts to prevent removal within 60 days (Policy 9.4/9.5); a breach = judicial_fatal_flaw

same two clocks (45 CFR 1356.21(b)(1)/(c); CPS 14132.1) PLUS the CPS 14132.4 valid-removal coincidence (v1.5, #1716): DFPS must physically take the child by the end of the next business day following the contrary-to-the-welfare finding — a documented extenuating-circumstances / court-ordered-time-frame exception admits (a recorded reading: the handbook names the exceptions and the consultation, not its outcome), an attested breach without one is a judicial_fatal_flaw, an unattested coincidence is pending

FFP rate

not a ruleset output (U-FMAP): StateBundle fmap_rates() — real FY-dated Georgia FMAP, Federal-Register-cited

not a ruleset output: the Texas layer’s bundle/fmap_rates.toml — FY-dated Texas FMAP from federal FY2024 (2023-10-01), Federal-Register-cited (#2328); an eligible determination dated earlier refuses fail-closed

Intake priorities

IMMEDIATE/PRIORITY_24HR/STANDARD

P1 (24hr) / P2 (72hr)

Response window ({j}-response-window)

IMMEDIATE → 24 HOURS; PRIORITY_24HR → 24 HOURS; STANDARD → 5 WEEKDAYS, receipt day = day one, weekends skipped, holidays INCLUDED, end of day (PAMMS 3.32 "Calculate the duration": '5 weekdays: from the day of the receipt of the Intake Report (day one) to the end of the fifth weekday (Monday through Friday, including holidays)')

P1 → 24 HOURS; P2 → 72 HOURS (SWI Handbook 4310 / 4320: CPI initiates within 24 h of a P1 intake, 72 h of a P2 intake); no day-unit arm

Deadline override ({j}-response-deadline-override)

CLOSED — one catch-all refuse row (⁂ #1073): PAMMS 3.32’s CISS-supervisor review of the RECOMMENDED response time is the only override text located, and it governs the recommendation, not an opened investigation’s deadline

CLOSED — one catch-all refuse row (⁂ #1073): CPS Handbook 2291.5 is the only extension text located and it governs investigation COMPLETION, not the response window

Attested priority floor ({j}-response-priority)

cicc_supervisor, county_director, regional_fps on a screened-in decision (⁂ #1073 — Policy 3.32’s CISS review is the supervisory response-time assignment)

swi_supervisor, county_director, regional on a screened-in decision

Investigation tracks

CPS_INVESTIGATION/FAMILY_ASSESSMENT

INVESTIGATION/ALTERNATIVE_RESPONSE

Placement LOC tiers

3 (basic/therapeutic/residential)

5 — the DFPS service levels (basic/moderate/specialized/intense/intense-plus; only Intense-Plus is RTC-only, 40 TAC §700.2365)

Placement eligibility (license_gate / training_gate)

a DERIVED expiry (stored active, license_expires < business date) refuses both matching and activation, grace 0 (PAMMS 14.13 / 14.15); stored terminal expired and pending / suspended / revoked keep the #1635 license_not_active reason; training_gate (v1.1): an EXPIRED or UNDATED cpr_first_aid certificate refuses both, grace 0 (PAMMS 14.9 — current CPR / First Aid certification throughout the approval period, the expiration date checked), every other type and an absent type admit; matching-scope (v1.2): presents stored active only (PAMMS 14.15 NOTE — no new placements in a pending or closed home; item 3 — CPA homes only in Full Approval / Full Approval-Special); child_criteria (v1.3): age band require (PAMMS 10.4 placement selection), ICWA require on either carrier (25 USC §1915(b) via Policy 1.6 — person OR case, ⁂ #1073), siblings prefer at ≥ 2 (PAMMS 10.4 item 4.d / 10.20 item 2; 42 USC §671(a)(31)(A) reasonable efforts — ⁂ #1073), no refusing arm

the same arms, cited to the HHSC Minimum Standards for CPAs (26 TAC §749.925(b),(d),(e), §749.927(b), §749.923(a), §749.43, §749.1107, §749.1109, §749.933, §749.937, §749.4401); Texas verifications are NON-EXPIRING (§749.925(d)), so the expired arms apply only where a CPA records an end date; training_gate: the same CPR arms cited to §749.831(e) (first-aid / CPR certificates must carry an expiration date), §749.831(c),(d), §749.805(a), §749.803(a)-(b), §749.807(a), §749.4421(b) / §749.4425(a); matching-scope (v1.2): stored active only (§749.923(a) verification; §749.925(e); §749.1109(2)(A) inactive homes accept no placement); child_criteria (v1.3): the same tokens — age band require (CPS Handbook 4114 / 4114.3 best-interest and special-needs fit), ICWA require on either carrier (25 U.S.C. § 1915(b)), siblings prefer at ≥ 2 (42 U.S.C. § 671(a)(31)(A); CPS Handbook 4114.2), no refusing arm

Timeliness milestones

10 types (incl. the VPA best-interest court order: 180 days from the VPA execution date as day 1, warn after the Policy 10.2 FTM at day 150 — v2.2, #2289)

14 types (incl. adversary hearing 14d, initial permanency hearing 180d after the TMC order, dismissal 365d, medical exam 3d, and the CTW first-ruling + 60-day reasonable-efforts pair — v1.1 #1668)

ICPC home study deadline

60 calendar days (Policy 15.2; 42 USC §671(a)(26)(A) — v2.1, #1662; the craig-exchange default stamps the same 60 since #1734)

60 calendar days (42 USC §671(a)(26)(A)(i); DFPS CPS Handbook 4522.1 — v1.1, #1668)

Protective capacity

Single boolean

3 dimensions (cognitive/affective/behavioral)

Deprivation types

5

6 (adds abandonment)

Twin parity (rules check, #1795)

The table above is the human list of what differs; cargo xtask rules check holds the machine one (xtask/src/cmd/rules_twins.rs). A ruleset FAMILY is a name shipped as <j>-<name>.json in layer <j> under two or more jurisdiction dirs; the fixture jurisdiction is never paired. Every pair of twins must:

  • carry the same decision tables (by node id), each with the same hitPolicy and ending in a total row (every input cell "") on both or neither;

  • emit the same output fields;

  • declare the same input / output node schemas — property names, per shared property its type and enum, required over the shared properties, additionalProperties;

  • carry metadata blocks of the same shape.

A legitimate difference is a TWIN_ALLOWED row with its reason (only tables, output fields, schema properties and enums can be allowed). A difference no row admits fails the gate, and so does a row no twin pair shows any more — delete it when the twins converge. Decision-table INPUT columns are not compared: they are each jurisdiction’s policy (the authz family’s are pinned by texas_authz_inputs_are_the_georgia_twins_plus_the_declared_extras), and a dropped column is policy, not drift.

Lifecycle: history, promote, rollback, pinning (#1556 / D2)

Every API-path mutation of a rule set writes a rule_set_snapshots row in the SAME transaction — insert-only content history keyed by the cache CAS token (rule_set_id, revision), opened by a migration-time baseline snapshot per pre-existing row. Every evaluation stamps rule_evaluations.rule_set_revision from the cache entry that ran, so "which exact rules produced this determination" is a total join for post-D2 rows (the free-text version string never identified content).

Promote is the blessed operator path for content rollout, a two-step:

  1. POST /v1/rules/sets/{id}/promote/preview compiles the candidate, replays the last-100 real evaluation inputs against live AND candidate on an isolated thread (never the shared eval queue), and persists
    returns a CATEGORICAL diff report — verdict deltas, evaluation-id pointers, corpus provenance, per-input-key coverage; corpus inputs never ride the report (#1130 single copy). Requires RuleSet Update AND RuleEvaluation List.

  2. POST /v1/rules/sets/{id}/promote (the consent act) re-binds the candidate by canonical hash to the named preview and re-CASes the live revision against the preview’s from_revision inside the flip transaction — 409 promote-preview-stale on drift, preview never burned. A below-floor corpus (thin_corpus) refuses without the explicit acknowledged_thin_corpus consent: an empty diff over an empty corpus is not evidence. The promote snapshot carries the report as its evidence; rules.ruleset_promoted rides the same transaction.

Traffic-split canary is REJECTED as policy, not engineering: eligibility is a legal determination under the rules in effect — similarly-situated children must never be adjudicated under different rules simultaneously. Shadow-replay + human-confirmed atomic flip is the mechanism.

Rollback (POST /v1/rules/sets/{id}/rollback) restores a snapshot’s content as a NEW revision (monotone history; the counter never rewinds), compile-revalidates (the engine may have moved since the snapshot’s recorded engine_version), requires a reason, refuses soft-deleted sets (recreate is the path), and stages rules.ruleset_rolled_back.

Pinning: POST /v1/rules/evaluate accepts an optional pin {rule_set_id, revision} — a snapshot replay for dispute review, keyed by the FULL token (never name+revision; rebinding). Pinned evaluations are NON-OPERATIVE: gated like the evaluations LIST (supervisor+), no rules.evaluated event staged, the audit row carries pinned = true. Absent snapshot / no-longer-compiling content are typed refusals BEFORE an evaluation id exists.

Operator tooling: craig rules promote <file> --reason '…' renders the preview report and prints the preview id; executing is a DELIBERATE second invocation with --confirm-preview <id> — the human-read report is the control, and there is no auto-confirm. A promote targets an EXISTING set: a brand-new family’s first load per environment is craig rules bootstrap <file> --profile … [--bearer-token …] (#1786, ADR-074 decision 14 — create-if-absent through POST /v1/rules/sets as the human admin; an existing row is reported, never touched). For the administrative-authority family a --acknowledged-thin-corpus execute must quote the authority-evidence:<sha256> digest cargo xtask authority-evidence printed for the candidate (§ metadata.authority). Which act a file needs is answered by craig rules drift --rulesets target/config/layers [--strict] --profile … [--bearer-token …] (#1900, ADR-077 D8): it walks exactly the file set cargo xtask rules check compiles and classifies each against the live service — absent (no active row → rules bootstrap), behind (the live version differs and is not newer than the file’s: older, the same number spelled differently, or unorderable; OR the same version with drifted canonical content — whole-document serde_json::Value equality, key order and whitespace irrelevant → rules promote), ahead (#1920 — the live version is strictly NEWER than the file’s: an environment promoted from a later branch, or a hot-fix promoted ahead of the commit → bring the tree up to the live row, by rebasing onto the commit that carries it or committing the live content to the file; never a promote, which would regress the row), current, or fixture (a FIXTURE-JURISDICTION dir, #1621 — never seeded, never looked up). Versions order numerically, component by component, over the two shapes the tree carries (semver 1.3.0 and the seed’s v1.0 default; a missing component reads as 0); a pair with a side of any other shape (a pre-release suffix, an upper-case V) is never ordered and reads behind by inequality. --strict exits non-zero after the table when any file is absent, behind or ahead, and every summary count is derived from the walk. DELETE /v1/rules/sets/{id} requires ?reason= (recorded on the delete snapshot). The report-only rule_set_snapshot_revision_gap invariant flags out-of-protocol writes (revision bumps without snapshots).

Event-Triggered Evaluations — none

craig-rules binds NO domain event. Every rule set is evaluated on demand via POST /v1/rules/evaluate by the service that owns the act. The last binding, case.intake_created → {jurisdiction}-intake-screening, was retired by #1670 (ADR-003 § Amendment #1670): its payload ({investigation_id, referral_id}) carried no screening fact, so every evaluation it produced was a catch-all artifact (#1054’s payload gap). Earlier retirements: eligibility.submitted (#1054, never had a producer) and placement.requested (#971, its only emitter never carried a placement_id).

The intake-screening rulesets own the screening act (#1670)

georgia-intake-screening v1.3 and texas-intake-screening v1.2 carry, in ONE file, the vocabulary and contracts of the cases service’s screening-decision act (plan v2.3, epic &88; the consult itself lands with U2, #1672):

  • metadata.screening — the realm-role → policy-role mapping (actor_roles with ranks), the disposition / follow-up / convertible allowlists, the override_authority edges, and the attestable_facts the UI renders (per jurisdiction, in the jurisdiction’s own words).

  • Draft-7 input and output schemas on the input / output nodes, carried as JSON strings (zen’s wire shape — an inline object fails deserialisation, and a string that does not parse silently becomes no schema, so cargo xtask rules check parses AND compiles both). The input schema is closed (additionalProperties: false) and declares every attestable and every server-derived key (craig_cases_contracts::reports::SERVER_DERIVED_FACT_KEYS).

  • An INSUFFICIENT_INFORMATION terminal row that makes the criteria table total, and a disposition-admissibility table whose single row is ADVISORY (the verdict is recorded beside the human disposition without binding on it; binding rows arrive with #1693).

  • metadata.screening.allegation_tokens (#2388): [{concern, tokens}], the allegation_type tokens craig-cases evaluates each fleet AbuseType concern under. A concern listing several tokens evaluates every subject once per token. The evaluations must agree on every persisted output, or the act refuses with a 500 and records nothing; the subject’s row keeps the first token’s evaluation. A concern the map leaves out is sent with no token, and a ruleset without the key passes every concern through as its fleet token. cargo xtask rules check holds the map to the input enum and requires every enum token to be reached. Georgia (v1.5) declares the identity. Texas closes allegation_type to the eight DFPS tokens its rows match (v1.4; emotional_abuse since v1.7, #2949) and maps neglect to both neglectful_supervision and physical_neglect, sexual_exploitation to sexual_abuse and every other concern to its own token.

  • Texas screening follows the DFPS handbooks (#1664, #2949). Three more attestable facts (ar_ineligible_element, history_red_sunburst, uninvestigated_child_death) bring the Texas set to ten. A red sunburst in the history and an uninvestigated child death are each P1 (SWI 4310 / CPS 2143.1). Alternative Response needs a P2 intake attested free of every AR-ineligible element (CPS 2610 / 2611.1) for a child aged 6 or older alleging neglectful supervision, physical neglect, medical neglect or emotional abuse, and completes in 60 days (CPS 2652); every other screened-in intake is an Investigation completing in 45 (CPS 2291.3). texas-timeliness carries the same two clocks.

  • Georgia: every governing row cited in the georgia layer’s citations.toml, with a derivation wherever the encoding narrows or widens Policy 3.2 / 3.32. Texas: a structural mirror, every value ⁂ uncited pending #1694.

Build note: the patch tool is a build dependency

rquickjs-sys (transitive: zen-engine → rquickjs → rquickjs-core → rquickjs-sys) needs the patch tool at build time. The Docker builder stage installs it (apk add … patch in the root Dockerfile); CI builds through the same pinned rust:1.97-alpine image. A bare host build needs patch on the PATH too — most distros ship it.

Ruleset Files

The jurisdiction layers (craig-config-{jurisdiction}) are the source of truth (the discovery test picks up every file automatically, so counts drift). Both jurisdictions carry the shared domains below plus case-routing and the {jurisdiction}-authz-* fixture family; Texas defers person-match per ADR-019 Open questions. Georgia additionally carries the non-JDM .toml parameter files (dashboard, case_detail); BOTH carry the non-JDM field_ownership.toml field-owner map (#634 — its schema is the subsection below). The former georgia-screening-policy.json was retired by #1672: its allowlists, override table and role mapping live in metadata.screening of the intake-screening ruleset (the section above), and cargo xtask rules check now REFUSES the top-level shape:

  • {jurisdiction}-safety-assessment.json — child safety decision

  • {jurisdiction}-intake-screening.json — screen-in/screen-out + priority

  • {jurisdiction}-ive-eligibility.json — Title IV-E foster care eligibility

  • {jurisdiction}-placement-matching.json — level of care + placement type (on demand only; no event trigger since #971)

  • {jurisdiction}-placement-eligibility.json — the license and training expiry gates for matching + activation (#1641 / #1642; on demand, consulted by craig-placement)

  • {jurisdiction}-timeliness.json — ASFA regulatory deadline tracking

  • {jurisdiction}-response-priority.json — the per-child → intake response_priority roll-up at conversion (#895 / #1743; on demand, to be consulted by craig-cases at conversion — plan MR-D)

  • {jurisdiction}-response-window.json — the response window spec per priority token at investigation open (#895 / #1743; on demand)

  • {jurisdiction}-response-deadline-override.json — the audited deadline-override arms (#895 / #1743; Georgia and Texas CLOSED ⁂ #1073; on demand)

  • georgia-person-match.json — report-entry ↔ persons-table linking (ADR-019); Texas counterpart deferred

  • field_ownership.toml — NOT a JDM file: the per-jurisdiction field-owner MAP of the ADR-037 surfaces (#634 / ADR-076 D10; georgia AND texas, identical content; read FAIL-CLOSED by craig-placement at boot — schema below)

  • authz-unsupplied-keys.toml — NOT a JDM file: the reviewed list of authz rows whose ownership key no check site supplies (#1912; schema below; absent = none)

field_ownership.toml — the field-owner map (ADR-037 §5, #634)

The per-jurisdiction owner MAP of every field-ownership surface the active bundle DECLARES (craig_state_bundle::FieldOwnershipContribution, ADR-037 §4 — the declaration names the surface and its table.column roster; the classifications live ONLY here). ONE file per jurisdiction: ADR-076 D10 folded ADR-037’s per-surface <surface>_ownership.toml into one file with per-surface sections, so a new surface adds a table, never a file.

schema_version = 1

[surface.foster_home_portal]
"placements.status" = "state"
"education_records.school_name" = "shared"
"education_records.grade_level" = "shared"
"health_records.next_due_date" = "shared"
"foster_homes.phone" = "shared"
"foster_homes.primary_contact" = "shared"
  • schema_version = 1 — the only version the loader understands.

  • [surface.<name>] — one table per declared surface; <name> is the bundle’s surface key (FOSTER_HOME_PORTAL_SURFACE = foster_home_portal).

  • "table.column" = "state" | "shared" | "provider" — the governed token (the ONE spelling the bundle roster, the authz field argument, the field-audit payloads and the pending_edits_<surface>.field column share) → its owner. state: staff write, a bound caregiver reads only — never proposable; shared: staff write, the bound caregiver may PROPOSE (ADR-037 §6); provider: reserved for the provider portal (no such field on any shipped surface).

The consuming service (craig-placement for foster_home_portal; craig_placement::field_ownership::load) reads field_ownership.toml from its config layers (CRAIG_CONFIG_SOURCE, #2955) ONCE at boot, AFTER the ADR-063 migrate process mode has returned (the gate needs neither the bundle env nor the file), and REFUSES startup — naming file, surface and field — on every arm: the file missing or unreadable; a parse error; schema_version != 1; a [surface.*] table the active bundle does not declare; a declared surface with no table; a roster token the file does not classify; a file token outside the roster; a token that is not table.column; an owner outside the three tokens; a roster token the service’s value-kind table (the per-token text cap / date rule the propose act validates with) does not know. Reload is boot-only, the composition-baseline posture — a classification change is a redeploy. Staff WRITE authority is not decided here: the prepended field_permission rows below govern staff; the map decides what a caregiver may propose and which staff writes are field-audited.

The prepended field_permission rows (ADR-037 §2/§3, #634)

AuthzEngine::resolve_field_permission(claims, resource, field, field_owner) evaluates the SAME {j}-authz-<resource> family as the boolean check, under action == "update", and reads a SEPARATE output. The eight files hosting a governed table — {j}-authz-{placement,education_record,health_record,foster_home} for georgia AND texas — carry the contract:

  • Inputs i_has_fo = resource.attrs.field_owner != null and i_fo = resource.attrs.field_owner (the engine injects field / field_owner into resource.attrs itself — callers pass bare strings and never pre-populate attrs). The staff families carry NEITHER claims.channel nor foster_parent: the field-eval path never sees a caregiver, so the caregiver’s propose is DERIVED from the owner map (shared) after the foster_portal create × projection == 'proposal' row admits the act — the rows here govern STAFF only.

  • Output field_permission (o_fp) on EVERY row — "none" on every pre-existing row (zen emits {} when a declared output is unset, which the parser refuses); the field rows answer read | write | propose | none.

  • The field rows are PREPENDED, gated i_has_fo == true, ABOVE the #1062 service sandwich: for each row that admits update (wildcard-action rows and explicit update rows) a 'state' row and a 'shared' row with the SAME role / scope cells (i_assigned, i_supervises, admin-unit cells …) → "write" (o_allow false, o_reason "field-eval" — the boolean is never read on this path); 'provider' × any staff row → "read" (token readiness); readonly × any owner → "read"; a trailing i_has_fo == true catch-all → "none". Plan portals decision 12’s invariant: NO staff role loses a write it holds today — the write rows mirror the update rows scope for scope, so a Texas plain supervisor’s write still needs i_supervises and a Georgia caseworker’s placement write still needs i_assigned. A role-less service token resolves to the catch-all none (pinned).

  • Versions (all 2026-09-15): georgia-authz-placement 1.4.0, texas-authz-placement 1.5.0, the six education_record / health_record / foster_home files 1.2.0. Existing families → craig rules promote (never rules bootstrap); the devstack converges through seed.sh on the version bump. Pins: crates/craig-authz/tests/default_rulesets.rs (georgia + texas, the live ref shapes — assigned_worker_sub: None, supervisor_sub: None for education / health / foster_home), plus check(target_ref, Action::Approve) for the accept authority.

  • #1904 (ADR-077 D7, the Texas re-author): texas-authz-placement 1.6.0, texas-authz-foster_home / health_record / education_record 1.3.0. foster_home’s two regional field rows are RE-KEYED i_regional_director == true + i_unit_match == true beside their unit CHECK twin (the home’s attrs.admin_unit decides: in-unit write, out-of-unit none → 403 FIELD_PERMISSION_DENIED); health_record / education_record’s two regional field rows AND their CHECK twin are DELETED (no admin_unit column, refs supervisor_sub: None — Texas accept is admin only there); placement’s two regional field rows are DELETED (the Texas placement supervisor admits read + list only, so a field row has no update twin to mirror — a regional PUT fails Action::Update before any field consult). Pins: the same file’s Texas legs boot over a StaticUnitsSource; the foster_home ref carries attrs.admin_unit (in-unit write / Approve, out-of-unit none / 403); assigned_worker_sub: None, supervisor_sub: None stays on all three, attr-less for education / health only.

  • #1909 (b) (ADR-077 D7, the child-record unit stamp): texas-authz-health_record / education_record 1.4.0. The refs now carry the record’s creation-time admin_unit stamp, so the two regional field rows return beside a new unit CHECK twin, keyed i_regional_director == true
    i_unit_match == true (in-unit write, out-of-unit or unstamped none), and a bound regional_director accepts or rejects a proposal on an in-unit record. Pins: texas_field_writes_mirror_update (every staff role × stamp shape: write exactly when Update admits) and the re-authored admin and approve legs of the same file.

authz-unsupplied-keys.toml — the unsupplied-resource-key census (#1912)

An authz row whose input is claims.sub == resource.assigned_worker_sub (or … == resource.supervisor_sub) matches only when the check’s ResourceRef carries that key: the engine copies the two ownership fields into resource. verbatim, so a ref built with None gives null, and the comparison is false. A row that requires a key which no production check site of its resource type supplies never matches on a check. The census lists every such row it can judge in each jurisdiction directory and pins the list against that directory’s reviewed baseline. A ruleset shape it cannot judge is refused, and its one blind spot is named under *Not detected below.

The walker is a test, xtask/src/authz_key_census.rs, not a gate or a command. It reads:

  • every -authz-.json in every config layer; the text after -authz- names the ResourceType variant. No directory or file name appears in the source.

  • every ResourceRef { .. } literal in production services//src/ and crates//src/. It skips the test-support crates, test-named files, [cfg(test)] items and [test] fns. It also skips every file that an out-of-line mod name; under [cfg(test)] in any src/ file (test files included) loads, and the module files that file declares in turn. It finds each file the way rustc does: the [path] value, else name.rs or name/mod.rs in the declaring scope’s module directory. A walked file other than a mod.rs may own its directory or not, so both readings are searched. A coincidence can only skip a file too many, which adds rows and never hides one. A literal supplies a key unless that field is None, and the supply counts for the variant its resource_type names (ResourceType::<Variant>).

# (the header comment: what the file is, and that per-row readings stay open on #1912)

[[row]]
ruleset = "<an authz file in this directory>"
row = "<the row's _description>"
key = "supervisor_sub"            # or "assigned_worker_sub"
tracking = "#1912"                # the issue that owns this row's reading
  • An absent file is an empty baseline. ruleset must be one of the directory’s own authz files, key an ownership key, and tracking an issue reference #N. A duplicate entry is refused.

  • Join / leave. A row that newly requires an unsupplied key fails the test until it is reviewed and entered here. A row that is fixed (its key is now supplied, or it is re-keyed or removed) fails the test until its entry is removed. The failure message prints the blocks to paste. An "add" block carries tracking = "#<issue>", which is refused until a real issue replaces it.

  • Refusals. The walker refuses these shapes rather than skipping them:

    • a literal whose type is not spelled ResourceType::<Variant> but which supplies a key;

    • a struct-update ResourceRef { .., ..base }, or a ResourceRef { .. } inside a macro body;

    • a production file that names ResourceRef and does not parse;

    • a file the test-only module search must read that does not parse: one holding a mod name; that either holds cfg(test) or is itself a test-only module file;

    • a resource. path outside the census, in an input’s field or in an input cell;

    • an ownership-key input in any shape but claims.sub == resource.<key>;

    • a cell other than == true on such an input;

    • an ownership key named in a cell of any other input;

    • a non-empty cell on an input with no field. zen evaluates such a cell as a whole expression, which the census cannot judge. An empty cell conditions nothing, so a field-less input whose cells are all empty passes;

    • a missing or repeated _description (the row’s identity);

    • a JDM node kind other than input, output or decision table;

    • an authz file whose token names no ResourceType variant.

  • Not detected. An assignment to a ResourceRef ownership field after construction (r.supervisor_sub = …; the fields are pub). The census counts what each literal spells, so such an assignment changes a check site’s real supply without the census seeing it.

  • Out of the census. resource.id, resource.type and resource.jurisdiction are always filled. resource.attrs.* is out of scope: the admin-unit key has its own #1902 rule in validate-authz-coverage, and the engine layers in field / field_owner for field permissions.

  • Two classes in one list. A resource type that no check site names at all lists every key-requiring row of its rulesets, because those rulesets are never consulted at a check. Its entries sit beside the rows of types whose check sites pass None, and the census does not tell the two apart. Each #1912 reading has to.

Policy References in Rulesets

  • Georgia: GA DFCS Policy 19.11 and 19.12 (safety decision, safety plans), Chapter 3 (intake), Chapter 11 (placement)

  • Texas: TFC §262/263 (safety, timeliness), 42 USC §672 (IV-E eligibility), DFPS timeliness standards

Edit this page · latest