ADR-073: Identity-Based Placement Matching — Synchronous Data-Minimised Child-Facts Projection Under Relayed Credentials
Status
Accepted (2026-09-11) — implemented by MR-3 (#1776), the pre-1.0 cutover. Drafted FIRST per the draft-first path as U0 of #972 (epic &94); plan: Identity-Based Placement Matching (#972). The design took the maintainer’s 12-finding plan-mode review (2026-09-11, folded into rev 4) and was validated against the #1721 as-built (!1587).
As-built note (2026-09-11, #1776). The implementation follows the Decision; what differs from the Proposed
text is names and three refinements. The client is services/craig-placement/src/cases_client.rs
(CasesClient::placement_facts, CASES_FACTS_BUDGET = 4 s set on the request, the bearer relayed VERBATIM
X-Craig-Actor, send_with_metrics); its error is FactsError { Transport, Unauthorized, Forbidden { detail },
NotFound { detail }, Refused { status, problem: ProblemBody }, Upstream { status }, Malformed } (the Decision’s
Refused{status, body}), folded by eligibility::map_facts_error — 5xx / 429 → 503 matching-facts-unavailable,
any OTHER unexpected status → the named 500 (a contract or relay drift, not an outage), a Refused re-emitted by
problem TYPE with the canonical constructor + status and the RFC-9457 field relayed when it is one of the
projection’s own (child_id / case_id / on), an unknown type → 500, a body-read failure at any status →
Transport → 503, and BOTH 401 (a bearer without the cases audience) and 403 → forbidden_policy(FORBIDDEN,
detail). The merged consult is consult_matching_request (ONE evaluate over MatchingProbe { child }, two
parsers — parse_matching_scope + parse_child_criteria → ChildCriteria { age_band, icwa, sibling:
CriterionMode, refusal }) under ConsultContext::MatchingRequest(child_id) = ("placement-matching-criteria",
Some(child_id)). Refinement 1 — the refusal vocabulary is OPEN: child_refusal_reason = none is matchable,
any other string is a jurisdiction’s reason relayed verbatim as the 409 child-not-matchable detail with the
ruleset revision; the drift 500 is reserved for a missing / non-string key or an unknown mode token.
Refinement 2 — the home-less activation consult and its audit row: with a home, consult_for_activation
evaluates ActivationProbe { flatten facts, child } under Activation(home_id) and refuses in the order license
→ training → matchability (409 child-not-matchable) → home_meets_child_criteria (require arms only, age band
→ ICWA → sibling, an unset bound fails the arm; 409 child-criteria-violated naming the arm, the home’s value and
the child’s fact) → the untyped capacity 400, and the locked-row gate re-runs ONLY home_meets_child_criteria
(child facts are not re-derived under the lock — accepted, recorded); without a home, consult_child_only runs
MatchingProbe { child } under MatchingRequest(child_id) and the placement row’s activation_evaluation_id /
activation_rule_set_revision are STAMPED from that consult (previously NULL for a home-less activation) — the
§6 audit context, now also the provenance pointer. Refinement 3 — ordering: fetch_child_facts runs after
the ADR-062 precheck for every activating transition; per_page=0 returns before the cases read. Honest
residue: Georgia’s child-matchability row answers none for every child, so the 409 child-not-matchable arm
has unit-level pins only until a jurisdiction adds a refusing row; the handler-level fold of a cases timeout /
5xx / malformed body is the s2s-client.craig-placement.cases contested entry’s recorded gap (the client legs
are unit-pinned). The Appendix A row landed in ADR-068 with this MR; the budgets are const-asserted at 18 s
(matching) and 10 s (both activation routes); cases_base_url is the shared leaf and the devstack compose sets
CRAIG_PLACEMENT__CASES_BASE_URL.
Context
GET /v1/placement/matching is attribute-based: the caller supplies child_age / icwa_required /
sibling_group_size and the SQL prefilter matches homes against those client-supplied values. #837 deleted the
vestigial required child_id and named #972 as the identity-based redesign. For a CCWIS the match must be FOR
A CHILD — the facts come from the authoritative record and the search is scoped by the child’s case assignment.
The blocker named on #972 is a cross-service consistency question: craig-cases owns the child (persons, case
household, ICWA carriers); craig-placement owns the search and the activation gates. How does placement learn
the child’s facts, under whose authority, and what copy of them may exist outside cases?
Constraints that shape the answer (file:line in the plan’s research map):
-
Placement holds NO cases client today and ONE cases projection —
case_assignments(case_id → assigned_worker_sub, supervisor_sub, fed bycase.created/case.assignment_changed).placements.child_id/case_idare UNVERIFIED bare UUIDs. As-built (#1901, ADR-077 D6): the projection also carries the case’sadmin_unit(nullable), seeded from both events and copied ontoplacements/kinship_optionsat birth. -
Person events are id-only by design ("re-read the authz-gated record"), so no payload-fed projection of DOB or ICWA can exist;
persons.date_of_birthis BlindIndex ciphertext and a full person GET hands the caller the whole decrypted PII row — the #1107 / #1158 posture is a purpose-built, data-minimised projection instead. -
"The child’s case" is undefined without a
case_id(a person may be achild-role member of several cases;case_householdhas no(case_id, person_id)uniqueness; the reverse lookup is a service-DENIED list). As-built (#1831): a partial unique index now holds at most one ACTIVE row per(case_id, person_id); a person may still be achild-role member of several cases. -
ICWA has three worker-entered carriers with no derivation (
persons.icwa_eligible,cases.icwa_flag,referrals.icwa_flag); no person↔person relation exists — sibling structure is the case’schild-role household. -
The financial→cases
CasesClientprecedent carries NO per-request timeout (an ADR-068 hazard a new client must not copy); ADR-068 bounds every Standard route at 20 s with caller budgets summing strictly under it. -
Under ADR-072, WHICH child facts matching requires / prefers / ignores is tier-1 policy — the criteria are rows of
{j}-placement-eligibilityv1.3 (its § Amendment — #972), and the merged consult sends the derived child facts to craig-rules, which persists every evaluation’s input (ADR-058’srule_evaluationsclass). -
#1688 (cases ← placement history) asks the mirror-image question and must get the same answer.
Decision
Cross-service child facts are read synchronously at request time from a purpose-built, data-minimised projection endpoint owned by the authoritative service, under the acting worker’s relayed credentials, bounded and fail-closed. Concretely:
-
The projection. craig-cases exposes
GET /v1/cases/cases/{case_id}/children/{child_id}/placement-facts?on=YYYY-MM-DD→PlacementFacts { age_years, icwa_person, icwa_case, sibling_group_size }— a CLOSED shape carrying only what the consumer reads (no DOB, no name, nocohort_revision; both ICWA carriers raw because the derivation is a cited ruleset row). Cases derives age on the caller’s business date (on, refused beyond ±1 day of its own clock), requires activechild-role membership in THAT case, counts distinctchild-role members for the sibling group, and refuses a missing DOB (typed 422). Both identities (case_id,child_id) are required on the placement wire; the attribute parameters are deleted pre-1.0 with no dual-accept. -
Authority = the acting worker, relayed. Placement forwards the caller’s own bearer +
X-Craig-Actor(therelayed_authpair already used for rules); cases evaluates the ACTING WORKER against the case with its existingcase: readrows. A bare service principal is refused (deny_pure_service). Placement keeps its ownFosterHome / Listentry gate and duplicates no scoping logic. Deployment precondition: relayed tokens must carryaud ∋ craig-cases— the BFF pair and the devstackcraig-apiclient already do; an IdP that mints per-service audiences must include cases on the placement caller’s token or every search 403s. -
Bounded. The read runs under a 4 s client budget (
CASES_FACTS_BUDGET,.timeouton the request — never the 30 s shared-client default), inside the ADR-068 Standard ceiling with the const-asserted partition4 + 4 + 8 + 2 = 18 s < 20 sfor matching and4 + 4 + 2 = 10 sfor both activation routes; synchronous graph depth is 3 on a COLD authz cache (cases'authz.checkmay lazily load a ruleset over the rules client) and placement’s own bound still caps its wait. The hop joins ADR-068 Appendix A with MR-3. -
Fail-closed. Timeout / transport / 5xx / 429 → typed 503
MATCHING_FACTS_UNAVAILABLE; cases' 403 → 403; cases' typed 400 / 422 (CHILD_NOT_IN_CASE,CHILD_DOB_MISSING,PLACEMENT_FACTS_CLOCK_DRIFT) re-emitted with the same type + status; malformed → a named 500; a jurisdiction’schild_refusal_reason(an OPEN vocabulary —none= matchable, any other string a reason relayed verbatim) → 409CHILD_NOT_MATCHABLE. Matching NEVER degrades to client-supplied attributes, and both activation sites (birth-activecreate,planned → activeupdate, with or without a home) prove the same facts after the ADR-062 replay precheck — a committed replay makes no S2S call. -
No copy, no replica. Placement stores NO child PII and builds NO event-fed replica of child facts; its only cases replica stays
case_assignments(assignment facts). Child facts live for the request and are gone. -
The one retained data flow, recorded. The merged eligibility consult sends the derived child facts (age in years, two ICWA booleans, a sibling count) to craig-rules with
context_id = child_idfor the matching and home-less activation consults (a with-home activation keepscontext_id = home_id), and craig-rules persists every evaluation’s input + context inrule_evaluations, archived whole under ADR-058’s evaluations class. This snapshot is minimised (no DOB, no name, no case membership list), reachable only through the rules admin surface underrule_evaluationauthz, and retained for the ADR-058 window — a policy-audit record of WHY a home was admitted or refused for a child, not a child record. -
The reverse-hop rule. When #1688 (cases ← placement history) lands it follows the same rule: a purpose-built projection owned by placement, read synchronously under the relayed worker, bounded, fail-closed, no replica in cases.
Consequences
-
Matching and activation become correct FOR A CHILD; a stale client’s attribute parameters are a typed 400 (
deny_unknown_fields), and a home-less active placement can no longer skip membership / DOB proof. -
craig-placement gains its first cases client and a second S2S dependency at request time; a cases outage is a typed 503 on search and activation within 4 s (owned; the alternative was silently wrong matches).
-
readonlyperforms one cases read and is then refused at the rules consult, as today (recorded). -
cases_base_urlbecomes a sharedServiceSettingsleaf (exchange + placement) — a serde-flatten ordering trap otherwise makes a per-service duplicate silently keep its default. -
Per-request child facts do NOT enter the per-home
EligibilityFactsmemo key (MAX_DISTINCT_TUPLES = 64) — the child criteria are applied mechanically by the SQL, so the tuple cap is unaffected. -
County-scoped matching stays out of reach until #1086 (placement’s inbox drops
admin_unit). As-built (#1901, ADR-077 D6): the inbox now keepsadmin_uniton thecase_assignmentsprojection; the scoping itself lands with the #1086 engine + Texas units (U2 / U4). -
Follow-ups: #1778 (retire
sibling_placements), #1779 (CLI column drift), #1780 (care-needs facts
level-of-care criterion for the deferred #1666 RTC precedence), #1781 (Appendix A census refresh).
Open questions
-
The authoritative ICWA carrier (person vs case) and the sibling-count semantics ride #1073 as ⁂ readings; the ruleset rows encode today’s ruling (person OR case ⇒
require; ≥ 2 ⇒prefer) and flip by promotion. -
Whether the rules-audit snapshot needs its own retention class narrower than ADR-058’s evaluations window is a DFCS records-schedule question (#1073), not decided here.
Alternatives considered
-
A bare service-principal read with placement-side scoping (plan alternative B). Placement calls cases with its own service token, cases gates on
claims.service_id == 'craig-placement'+resource.attrs.projection(the #1107 pattern), and placement scopes the search from its owncase_assignmentsprojection. Rejected: it needs theservice_idinput ADDED to the person / case rulesets (tier-1 content merges in two jurisdictions) and duplicates cases' assignment rule in placement — two sources of "may this worker see this child", drifting independently. -
An event-fed placement-side projection of child facts. Rejected: person events are id-only by design, so the projection would need a payload change that copies DOB / ICWA into every consumer’s inbox, and the copy would then need its own retention, re-encryption and lineage story (ADR-048) in a service that does not otherwise hold child PII.
-
Copying the DOB (or the age) onto the placement row at create time. Rejected: the age is a function of the business date, ICWA / sibling structure change after creation, and the copy would be a second PII home that the matching search reads without the worker’s case authority being evaluated.
-
Keeping the client-supplied attributes as a fallback when cases is unavailable. Rejected outright: it reintroduces the defect (a match on facts nobody verified) exactly when the system is least observable; pre-1.0 the wire simply changes.
Amendments
Amendment (2026-09-23, P-C U3, #1993). The person carrier is no longer raw. persons.icwa_eligible is dropped
(refuse-on-data, schema_compat_floor bump — ADR-078 D3), and
PlacementFacts.icwa_person is now the answer of the federal ICWA-status decision ruleset federal-icwa-status
(rulesets/federal/federal-icwa-status.json, cited row by row to 25 CFR 23.107 — federal text binding every
jurisdiction, so it sits in the federal tree per the ADR-072 § Amendment — #949, neither in Rust nor in a
jurisdiction’s tables) evaluated over the case’s CURRENT child_icwa_facts row: court_determination =
yes_icwa_applies → true; no_icwa_does_not_apply → false; otherwise reason_to_know = yes OR icwa_applies = yes;
no row → false. The carrier is therefore case-scoped — keyed (child, case), so an ICWA row on another case never
reaches this projection — where the dropped flag was person-global; a closed or retracted ledger reads as no row
(every input null, the table’s catch-all). craig-cases' placement-facts projection ALWAYS consults
(POST /v1/rules/evaluate, context_type = icwa-status, context_id = case_id) after its membership gate,
relaying the acting worker as the safety and screening consults do — never cases' own service leg, which would let
a principal that may not evaluate rules obtain a service-attributed evaluation. The nested hop is budgeted by
ICWA_STATUS_BUDGET = 2 s, and craig-placement const-asserts ICWA_STATUS_BUDGET + MARGIN_MS ⇐
CASES_FACTS_BUDGET (2 + 2 ≤ 4 s). A rules 403 for the relayed worker is the typed 403 rules-consult-denied; a
rules 503 / 504 passes through; every other failure is a 500. Consequence, accepted: a principal the
jurisdiction’s rule_evaluation rows do not let create an evaluation (the realm-flat readonly auditor) now
receives that 403 from placement-facts instead of the four facts; placement’s outcome for it is unchanged — its own
eligibility consult already requires the same rule_evaluation: create for the same worker — only the refusing hop
moves. Unchanged: the wire (icwa_person and icwa_case stay two booleans); icwa_case = cases.icwa_flag, the
case-level triage flag, which a court determination does NOT override; each jurisdiction’s person-OR-case
child-icwa table (logic unchanged, provenance prose re-tethered); the open question on the authoritative carrier
(the OR is still the jurisdiction ruleset’s). The one retained data flow gains a second snapshot:
rule_evaluations now also retains each consult’s three ICWA tokens (court_determination, reason_to_know,
icwa_applies; null when unanswered) under context_id = case_id, behind the same rule_evaluation authz and
ADR-058 retention. The Context’s "three worker-entered carriers with no derivation" and the Decision’s "both ICWA
carriers raw" are superseded here for the person carrier; the Context stays as written — it is the history.
Amendment (2026-10-06, #2029). The projection refuses a case that is not open. After the acting worker’s
case: read check (a refused caller still reads 403), and before the one-clock rule, a closed or transferred
case is the typed 409 case-closed (refuse_unless_open, the #1631 type). The check is advisory: placement holds
no case lock, so a case can close between the read and placement’s commit. craig-placement’s classify_refusal
relays a 409 as FactsError::Refused, and refused_facts_error re-emits case-closed unchanged; any other 409
type stays the drift 500. Every consumer therefore inherits the refusal: matching, a caregiving birth-active
create and planned → active, the episode open and the historical episode. The routes that read no facts are not
refused on a closed case: a non-caregiving activation, a birth-planned create, the historical arrangement record
(POST /v1/placement/placements/historical), the exit act, the plain end, and removal and exit corrections. A
replay of an act committed while the case was open still answers its stored row after the case closes, because
the replay precheck runs before the read. The Decision’s projection clause gains this gate. The PlacementFacts
wire is unchanged; serving the status as a fifth fact would have widened the closed shape.
Amendment (2026-10-11, #1800). A consult craig-rules never answers (unreachable, or ICWA_STATUS_BUDGET elapsing)
is the fail-closed 503 service-unavailable naming the ruleset and, on an elapse, the budget (ADR-068 §D1’s hop
503), not a 500; the #1993 "every other failure is a 500" now covers only answers. Placement folds a cases 500 and
503 on the facts read alike, so its outcome is unchanged.
Amendment — #2999 (2026-11-08): the configuration layers left CRAIG’s source
ADR-087 U4 (#2955) moved the configuration layers out of CRAIG’s source. A rulesets/<j>/<file> path above now names
<file> in layer <j>: the federal, Georgia and Texas layers are the craig-config-{federal,georgia,texas}
repositories, pinned in config-sources.lock and fetched to target/config/layers/<j>/ by cargo xtask config
fetch, and the synthetic testonia layer is fixtures/config/testonia/. The decision above is unchanged.