Plan: The person index — a worker asks a jurisdiction’s person index about a person, and the id comes back with its source

Status

Done (2026-12-02) — a worker asks a jurisdiction’s person index about a household member from the case’s Household tab, selects a record the jurisdiction’s score rules allow or registers the person, and the index’s id is on the person’s record with its source (partner_matched or partner_assigned); Georgia’s EMPI is the first index, and the reunification journey walks it against Georgia’s simulator.

Closes: #3192.
Epic: &124. Relates to: #3187 (the programme; rules R1 to R6 are in plans/archive/lifecycle-journeys.adoc), #3200 (partner code lives in the jurisdiction’s layer), #3193 (waits on this plan), #3172 (rows S4, X6, X7), #1433, ADR-041, ADR-089, ADR-090. Tree: written against main at 9c8fdb39f with #3200’s last two steps (the switch and the close) on the train; step 1 starts after they merge.
Rulings (maintainer, 2026-11-29, note on #3192): match, register and program participation are in scope, and alerts wait for #3193; the person facts a registration needs are added here; craig-cases runs the conversation and craig-exchange keeps counts only; no SSN on a match; the score rules live in Georgia’s ruleset; a candidate is shown as the SHINES page showed it and stored nowhere, craig-cases keeping each candidate’s id and score only for the minutes it takes to choose.
Ruling (maintainer, 2026-12-01): participation is sent in the select act: the index is told first, then the id is recorded.

Erratum (2026-12-01): step 1 was begun on the branches of #3200’s last two steps, before they merged, so that nothing waited on the train; its MR follows them.

Erratum (2026-12-01): of "D2. Module contract 1.1". no_published_interface_changed is decided by wit-component’s own semver_check between the published 1.0 worlds and the worlds this host requires, which compares structure and not text; the_published_copy_is_version_1_0 pins the published copy by its digest, and an_edited_interface_is_refused shows the check failing. The legacy fixture’s adapter sends through the host’s transport, so that the test also covers an import a module names at 1.0. The SDK-built fixtures' manifests state contract 1.1, since they are built for it.

Erratum (2026-12-01): of step 2. The devstack runs Georgia’s layer, which provides no person index until step 5, so no test can earn the three routes a 2xx over HTTP at step 2: xtask/baselines/coverage-signatures.toml lists their three success signatures, and step 5’s CRAIG half adds the HTTP test that earns them and deletes the entries. Their refusals are earned at step 2 (a_nul_in_a_requests_text_is_refused_on_each_route, a_human_and_another_service_are_refused_on_each_route). D3 did not say that a request’s text refuses a NUL, as the product’s other text passed to a store or a partner does; it does. The reference partner’s index mints ten-digit ids, the shape of the fixture layer’s tid kind, which the fixture layer names as its person_index_identifier_kind.

Erratum (2026-12-01): of "D4. The person facts a registration needs", second bullet (step 4). person_residences holds the administrative unit and no street address. No window ledger is encrypted today: the shared ledger route has nowhere to seal a fact, a ciphertext binds to a row id that must be fixed before the write, and the shared idempotency intent hashes the facts in the clear. Nothing in this plan reads an address (a registration sends the county), so the maintainer ruled the county-only ledger for step 4 and the encrypted address as an issue of its own; its columns are additive. The ledger’s fact is named admin_unit and stored under the jurisdiction’s canonical unit name (ADR-077), for which the shared ledger route gained one hook (stored_facts). The person columns of step 3 are plaintext, as the first bullet lists them.

Erratum (2026-12-02): of step 5. The eighth mock partner row moves the seed’s later draws, as Risks says. Under the inputs the seed’s SQL pins use (seed 42, nine families) the one sampled ICPC request is now a draft, which has no home study, so icpc_home_studies joins exit_responses among the tables those pins do not render (DELIBERATELY_UNRENDERED in tools/craig-seed/tests/sql_byte_identity.rs), and its render is held at the devstack’s scale by the_devstack_scale_renders_its_icpc_home_study. The seeded partner row links no agreement (the seed sets no partner’s data_sharing_agreement_id), so the tests that ask the index install a partner and an agreement of their own (craig_test_lib::person_index_slot) and run one at a time.

Erratum (2026-12-02): of "D6. The conversation, in craig-cases" (step 6), three things. The rules engine leaves a null output out of its answer, so the ruleset cannot answer "`selectable_from` null for none": Georgia’s ruleset answers selection_open, selectable_from exactly when selection is open, and registration_open, and craig-cases refuses any other shape (an_unknown_ruleset_answer_refuses_the_ask). An ask could replace the row a registration had just been begun from, and the new row would have let a second registration go out: the ask’s check-and-replace and the register’s check-and-mark run under one advisory lock per person (two_registrations_at_once_send_one, a_registering_inquiry_registers_nothing_more). A select and a register made from one answer at the same moment would both have gone out, so that the index created a person the product had just matched: a select marks the row too (selecting_at), a row a selection was begun from sends no registration, and each act checks again inside its transaction that the person is unidentified (a_select_and_a_register_at_once_send_only_one_of_them, a_selection_begun_closes_registration_on_that_inquiry, an_act_on_a_person_identified_since_the_ask_is_refused). The refusals are tested in process over doubles of craig-exchange and craig-rules, which count what reached them; the devstack suites run the two successes, the score rules and the three races against Georgia’s simulator.

Erratum (2026-12-02): of "D9. The worker’s page" (step 7). The page is English only. craig-web ships one locale and offers another only when its catalog is complete, so Spanish strings for one page would be shown to nobody; the complete Spanish worker catalog is #3181. Every string of the page is in the catalog, none literal, so #3181 translates it with the rest. The ask’s answer is rendered as a fragment in the member’s row and not as a page: a candidate must not pass through a flash, a cookie or a redirect.

Erratum (2026-12-02): at the close, four things. The journey asks the index once the case is open and before custody, not "in care": recording the child’s sex and the index’s id changes the child’s record, and craig-exchange abandons a send to the education agency that was staged for the record as it was (it is superseded and staged again), which the education beats count as a second listing send. Georgia’s configuration agent, asked to bind its scenario row to the tests, found that every devstack test asked about a child with one record in the index, so the score floors were shown by none; two tests with a second record of the child’s name and date of birth were added (beside_a_near_record_a_weaker_one_may_not_be_selected, beside_a_sure_record_a_weaker_one_is_refused_and_records_nothing), and the scenario row was bound after them. The encrypted street address the step-4 erratum leaves to "an issue of its own" is #3214. Issues filed for what the work exposed: #3211 (fixed), #3212 (the EMPI’s required fields the contract cannot carry), #3213 (fixed), #3214.

Context

Georgia’s person index (EMPI) gives a person one id across agencies. Georgia’s configuration requires a live empi identifier before a Medicaid application and before an SSA screening, and today a worker types it in: every person_identifiers row is worker_attested (services/craig-cases/migrations/20261014130000_person_identifiers.sql). Georgia’s craig-partner-empi sends a registration through the manual send, nothing calls it, and its mock answers one fixed id for everyone (#3192, "What exists"). The specification (interfaces/empi-interface.adoc, empi-inquiry.adoc, empi-registration.adoc) describes a match (up to 250 candidates, each scored 0 to 100), a registration that is open only when no candidate scores 90 or more, and an update that tells the index CRAIG now holds the person.

A jurisdiction’s partner code is a module of its configuration layer, built against the module contract (crates/craig-partner-host/wit/craig-partner.wit, version 1.0). The contract has one inquiry, the SSA benefit screening. This plan adds the person index, the first addition to the contract after a jurisdiction built against it.

Scope

In: the person-index contract; module contract 1.1; craig-exchange’s three service-only routes; the person facts a registration needs; identifier provenance; the conversation in craig-cases and craig-web; the reference partner’s index and the kit’s checks; Georgia’s layer (wire, simulator, ruleset, scenario); the journey.

Out: alerts from the index (#3193); the SSN on a match; person merge; the index’s SOAP encoding (#3172); the manual send of a registration through the generic pipeline, which stays an admin’s act outside the score rules until a typed-only interface can be active against a non-loopback endpoint (#1433; an issue is filed at the close).

Design

D1. A person index is a product contract

craig_exchange_contracts::person_index states the conversation in the product’s words (R5, layer 2), beside crates/craig-exchange-contracts/src/inquiry.rs, whose InquiryFailure it reuses:

  • IndexSubject: first name, last name, sex, and the date of birth when known. A match sends nothing else (the_subject_carries_name_sex_and_birth_date_only).

  • IndexCandidate: the index’s id for the person (1 to 64 printable ASCII bytes), a score 0 to 100, and what a worker is shown: names, date of birth, sex, the last four of the SSN, one line of residence (at most 200 bytes). A find answers at most 250; more, or a field over its cap, is Malformed.

  • IndexRegistration: the subject with a required date of birth, how it was verified, the county of residence, and, when recorded, middle name, suffix, races, ethnicity, place of birth, primary language and marital status.

  • IndexParticipation: the index’s id, CRAIG’s person id and the subject.

  • trait PersonIndex: interface(), find, register (answers the new id) and participate, each taking the endpoint and the credential as Inquiry::ask does and failing with InquiryFailure.

There is no authority(). An index is gated as a send is (an active partner row, an admitting agreement, the deployment’s consent), not by a witness.

D2. Module contract 1.1: an addition lands alone

ADR-090 decided that an addition to the contract lands here alone and a jurisdiction takes it when it next rebuilds. This is the first, so it also builds how one is taken.

  • The WIT becomes craig:partner@1.1.0 and gains the interface person-index (interface, find, register, participate; D1’s records; a failure enum with InquiryFailure’s cases). No published interface changes: a host and a module built at different minors are matched by name alone (`no_published_interface_changed compares each interface of a frozen copy of the 1.0 file with the live one). The file has three worlds: partner-set (five exports, what the SDK builds), partner-set-core (the four exports of 1.0) and partner-set-person-index.

  • The host (crates/craig-partner-host/src/runtime.rs, Module::compile) binds partner-set-core as it binds partner-set today, asks the component whether it exports person-index (Component::get_export_index), and binds partner-set-person-index from the same instance only then. A module built for 1.0 loads unchanged and provides no index.

  • The manifest states contract = "1.1". The host refuses a minor above its own, as it refuses another major (a_newer_minor_refuses_boot).

  • The SDK gives PartnerSetSource::person_index (crates/craig-partner-sdk/src/guest/partner_set.rs) a default of none, so a source that does not mention it compiles and exports an index that answers "none".

  • PartnerSet (crates/craig-state-bundle/src/types.rs) gains person_index: Option<(&'static str, PersonIndexFactory)>, validated as ssa_benefits is, and InterfaceManifest lists it.

  • A fixture, crates/craig-partner-host/tests/modules/legacy: one adapter, built with wit_bindgen::generate! straight from the frozen 1.0 file, with no SDK. a_module_built_for_1_0_provides_no_person_index loads it.

wasmtime 51 matches import and export names across the minors of one major; that is read in its source and not yet run here. The legacy fixture and every_pinned_layers_modules_load (Georgia’s pinned module is a 1.0 module) run it first in step 1. If either fails, the step stops and the question returns to the maintainer.

D3. craig-exchange asks, and stores nothing it is told

Three service-only routes for craig-cases, written after services/craig-exchange/src/api/screening.rs (the service caller, service_id == "craig-cases", the worker relayed in X-Craig-Actor by screening_relay.rs):

  • POST /v1/exchange/person-index/matches: a subject in, the candidates out.

  • POST /v1/exchange/person-index/registrations: a registration in, the index’s id out.

  • POST /v1/exchange/person-index/participations: a participation in, 204 out.

Each resolves the one active partner row of the index’s interface and requires its active agreement, as resolve_ssa_partner and require_active_dsa do, and the deployment’s consent: a third InterfaceConsents group (crates/craig-common/src/settings.rs), CRAIG_EXCHANGEPERSON_INDEX<INTERFACE>__ENABLED, default off, checked at boot by ExchangeRegistries::check_consents like the other two. The boot holds the index of a listed interface only, as it holds the SSA inquiry. A call writes no row: it counts by operation and outcome and logs ids only. The service gives the index 3 seconds, a bound of its own around the call, inside the 5 seconds craig-cases waits (REQUEST_TIMEOUT in services/craig-cases/src/exchange_client.rs); the_index_budget_fits_the_callers_timeout holds the order. No route retries: a failed call has reached the transport once (a_failed_call_is_sent_once).

Step 2 also adds the bundle setting person_index_identifier_kind (bundle/settings.toml, beside screening_identifier_kind; StateBundle, and setting_kinds_are_declared in crates/craig-config-bundle/src/read.rs): the identifier kind an index’s id is recorded under.

D4. The person facts a registration needs

  • persons gains middle_name, name_suffix (plaintext, as the other name parts are by ADR-041), birth_city, birth_state, primary_language, marital_status (craig_reference::enums::Language, MaritalStatus) and dob_verification with dob_verified_at and dob_verified_by, after the ssn_verified columns. craig_reference::DobVerification is new: birth certificate, hospital record, government record, immigration document, court order, client statement, other document, not verified. They join UpdatePersonRequest, the field registry (crates/craig-cases-fields/src/persons.rs), the person edit page, the CLI and the seed.

  • person_residences: a window ledger of where a person lives: the county as an admin-unit code (required), and address lines, city, state and postal code (encrypted). It follows person_demographic_facts end to end (services/craig-cases/migrations/20260922150000_person_demographic_facts.sql and its field registry, contracts, store, intents, event, API route, craig-web panel, CLI, seed and tests).

A registration needs the sex, the date of birth, how it was verified and the county of residence. That is the product’s rule; the rest is sent when recorded.

D5. An id the index returned says so

IdentifierProvenance (crates/craig-cases-contracts/src/person_identifiers.rs) gains partner_matched and partner_assigned, and a migration widens the CHECK to the three tokens. Only the conversation writes the new two (a_selected_id_is_partner_matched, a_registered_id_is_partner_assigned); the record route’s request has no provenance and still writes worker_attested (the_record_route_takes_no_provenance). The identifiers panel shows which it is.

D6. The conversation, in craig-cases

It is opened from a case. The specification limits it to the workers of the person’s stage, and a person has no owner to check (in the fetched Georgia layer, target/config/georgia/current/georgia-authz-person.json, any caseworker may update any person). So each act is an update on the case, as services/craig-cases/src/api/case_screening.rs authorises, and the person must be an active member of its household. The calls go through exchange_client.rs.

  • Ask: POST /v1/cases/cases/{id}/persons/{person_id}/index-inquiries. Refused when the jurisdiction sets no person_index_identifier_kind, when the person holds a live identifier of that kind, or when the sex is not recorded. craig-cases stages a case.person_pii_exported event (purpose person_index_match, after the domain_event! named publish_person_pii_released_for_reveal in services/craig-cases/src/events.rs, which person_identifier_acts.rs commits before it reveals), asks craig-exchange, and consults the ruleset {jurisdiction}-person-index-choice on count and top_score, as services/craig-cases/src/icwa_status.rs consults its ruleset. The ruleset answers selectable_from (a score, or null for none) and registration_open; any other answer refuses the ask. It then keeps one person_index_inquiries row for the person, replacing an earlier one: the case, the worker, the two answers, an expiry fifteen minutes on, and for each candidate a keyed digest of its id (the value_hmac of that kind) and its score. The response carries the candidates as the index described them, each marked selectable or not, whether registration is open, and which of D4’s four facts are missing.

  • Select: …/index-inquiries/{inquiry_id}/select with the candidate’s id. The row must be the person’s, unexpired and not registering; the id’s digest must be one the row holds, at or above selectable_from. craig-cases tells the index through the participation route and then, in one transaction, records the identifier as partner_matched and deletes the row. An index that was not told records nothing.

  • Register: …/index-inquiries/{inquiry_id}/register. Open only when the row says so and the four facts are recorded. The row is marked registering before craig-exchange is called. An id that comes back is recorded as partner_assigned and the row deleted; the index holds the person for CRAIG from the registration, so no participation follows. Any failure records nothing and leaves the row registering: the worker asks again, and a registration that landed is then found and selected. An ask is refused for one minute after a row began registering, so two workers cannot register one person at once.

  • Select and register take a client_request_id and replay as the identifier acts do (services/craig-cases/src/api/intents/person_identifiers.rs). An ask is not replayed: a repeated ask is a new one.

  • A sweep deletes expired rows, as services/craig-cases/src/jws_cleanup_worker.rs does for its table.

Participation is sent in the select act and is not a triggered send. The specification queues the update after the save; here an id is recorded only once the index has been told, which needs no queue. A triggered send would go through the identifier-keyed arm of the trigger substrate, which serves one identifier kind (gtid, crates/craig-cases-contracts/src/outbound_principals.rs) to a person with a custody episode and orders its records as a custody list’s.

D7. The reference partner and the kit

The Testonia registry gains an index over its residents, and its simulator a control route that sets a resident’s standing at the index (known, near, weak), beside PUT _sim/residents/{person_id}. craig-partner-test-harness gains person_index: a_known_person_is_found_at_full_score, an_unknown_person_has_no_candidate, a_registered_person_is_then_found, a_participation_is_held_by_the_index, a_fault_reads_as_its_failure and the_index_is_registered_under_its_interface. The kit’s own tests show each failing on an index built with the matching flaw. The reference partner runs them natively and on its built module.

D8. Georgia’s layer

Briefed to Georgia’s agent and landed in craig-config-georgia, built against this repository’s main after step 2:

  • craig-partner-empi: the match and participation wire types, impl PersonIndex, and a simulator in place of the mock (R1 to R3). A loaded person with an empi identifier is in the index under it; a control route sets a person’s standing (known, near, weak); a registration mints an id from a v5 digest of the person id and holds the person from then on. The fixed id and REJECT_FOR_TEST are deleted.

  • The manifest states contract 1.1 and gives empi a seed row, last in its order.

  • bundle/settings.toml: person_index_identifier_kind = "empi".

  • The ruleset georgia-person-index-choice: a top score of 100 selects from 100; 90 to 99 selects from 90; 89 or less selects from 0 with registration open; no candidate selects none with registration open. Registration is closed otherwise. The rule-evaluation authorisation admits the workers who may update a case.

  • A scenario row, georgia.exchange.empi-person-index.

Step 5 then pins that commit here, sets CRAIG_EXCHANGEPERSON_INDEXEMPI__ENABLED in docker-compose.yml, and re-blesses the seed’s SQL golden and tests/e2e/lib/seed.ts for the new partner row (tools/craig-seed/src/datagen/exchange.rs draws its ids in order).

D9. The worker’s page

On a case’s Household tab (services/craig-web/templates/cases/_tab_household.html) each member gains "Person index": ask; the candidates (names, date of birth, last four of the SSN, residence, score) with a choice wherever one is selectable, preselected when there is exactly one; and "Register" where it is open, naming the facts still missing with a link to record each. English and Spanish.

D10. The journey

tests/e2e/specs/journey-lifecycle-reunification.spec.ts asks the index for the child once custody opens: found at full score, the id recorded partner_matched, and the simulator holds CRAIG’s participation (tests/e2e/lib/partner-sim.ts). Two more tests in the file: a near match must be chosen and registration is closed; an unknown child is registered once the missing facts are recorded, and the id is partner_assigned.

Steps

Each step is one MR with its tests, docs and changelog fragment. Steps 3 and 4 depend on no other step.

  1. Contract 1.1 and the person-index contract (D1, D2, D7).

  2. craig-exchange’s routes, the consent group and the bundle setting (D3), tested in process on the reference partner.

  3. The person columns (D4, first bullet).

  4. The residence ledger (D4, second bullet).

  5. Georgia’s layer, then this repository’s pin (D8).

  6. Provenance and the conversation (D5, D6), tested on the devstack against Georgia’s simulator.

  7. The worker’s page (D9).

  8. The journey and the close (D10): the spec, the scenario’s coverage, the pages, the notes, the issues.

Risks

  • A module built for 1.0 stops loading in a 1.1 host — fail-closed at boot. Mitigation: a_module_built_for_1_0_provides_no_person_index; every_pinned_layers_modules_load on every car.

  • A published interface is edited — silent (a module traps at its first call). Mitigation: no_published_interface_changed.

  • A candidate’s value is stored — silent. Mitigation: no_candidate_value_is_stored (after an ask, no table of craig-cases or craig-exchange holds a candidate’s name, date of birth, SSN digits, residence or plain id).

  • A worker with no hold on the case, or a person outside it, reaches the conversation — fail-open (the ask releases the person’s facts and answers other people’s). Mitigation, for each of the three acts: a_worker_who_may_not_update_the_case_is_refused, a_person_outside_the_household_is_refused; nothing is sent in either case.

  • A worker selects a candidate the rules exclude, or one the index did not return — fail-open. Mitigation: a_selection_outside_the_kept_set_is_refused, a_selection_below_the_floor_is_refused.

  • A registration is sent twice — silent (a duplicate person in the index). Mitigation: a_registering_inquiry_registers_nothing_more, two_registrations_at_once_send_one (concurrency), a_failed_registration_records_nothing.

  • A registration is sent while a strong match exists — fail-open. Mitigation: registration_is_closed_when_the_ruleset_closes_it.

  • An id is recorded that the index was not told about — silent. Mitigation: a_selection_the_index_was_not_told_records_nothing.

  • A typed id is taken for one the index confirmed — silent. Mitigation: D5’s three tests.

  • Two workers select at once — silent. Mitigation: the unique live (person, kind) index; two_selections_at_once_record_one_identifier (concurrency).

  • The ruleset answers something the product does not know — fail-closed. Mitigation: an_unknown_ruleset_answer_refuses_the_ask.

  • A person’s facts are released with no agreement or consent — fail-open. Mitigation: an_ask_without_an_agreement_is_refused, an_ask_without_consent_is_refused, a_consent_for_an_interface_with_no_index_refuses_boot.

  • An expired inquiry is used — fail-open. Mitigation: an_expired_inquiry_is_refused; the sweep.

  • craig-exchange hangs or refuses — fail-closed (the act answers 503 and records nothing). Mitigation: the hung and refused legs of each act, after case_screening_relay_fault_tests.rs.

  • The seed’s ids move with the new partner row — fail-closed (the golden and the browser suites fail). Mitigation: both are regenerated in step 5’s MR, whose car runs the whole battery.

Tests

  • Contract (wire): the kit’s person_index checks on the reference partner, natively and on its built module; the_subject_carries_name_sex_and_birth_date_only; no_candidate_exceeds_its_caps; Georgia’s goldens for the match, registration and participation records, in its repository.

  • Boot: a_newer_minor_refuses_boot; the consent refusal; a set whose index names an interface with no adapter.

  • Security: the authorisation, storage, selection, provenance, agreement and consent tests named under Risks.

  • Concurrency: two_selections_at_once_record_one_identifier, two_registrations_at_once_send_one.

  • Fault: the hung and refused craig-exchange legs; the_index_budget_fits_the_callers_timeout.

  • Regression: the identifier routes' suites pass unchanged; a worker_attested row written before the migration still reads.

  • Journey: the three tests of D10.

Delivery

  • Decision record: an amendment to ADR-090 that says how the contract takes an addition (D2).

  • Canonical page: partner-crates.adoc gains "A person index". Also touched: shared-crates.adoc, data-model-cases.adoc, the API pages of craig-cases and craig-exchange, deployment-guide.adoc and configuration-reference.adoc (the consent variable), testing-reference.adoc (the simulator), devstack.adoc.

  • CHANGELOG entry: one changelog.d/3192.<slug>.<type>.adoc fragment per step.

  • The close: step 8’s MR closes #3192. This page is archived with its Status; notes go on #3192, #3187 and #3193; issues are filed for the gaps the journey exposed and for the manual send named under Scope.

Review log

Round Vendor Resolved model Verdict

1

Anthropic (Vertex)

vertex-anthropic/claude-fable-5-2

FLAGS on the second question: the case and household gate and "no route retries" named no test, and one function name was to be confirmed. Fixed: the gate’s two tests for each act, a_failed_call_is_sent_once, and the domain_event! named with the file that commits it.

2

Google (Vertex)

vertex-gemini/gemini-4-carbon

CLEAN.

Edit this page · latest