Plan: Outbound Partner Authentication and the Initial Medicaid Application (#1813, #1805 slice, #1807)
- Archive record
- Status
- Context (census 2026-10-15 on
main) - Scope
- Restated acceptance
- Design
- D1 — The vocabulary, the reference shape, the endpoint rules (U2; A-F1, A-F3, A-F7, A-F9)
- D2 — The credential channel (U1; A-F2, A-F10)
- D3 — Resolution, binding, application, redaction, recovery (U2, U3; A-F1, A-F5, A-F6, A-F8)
- D4 — Deployment consequences (U3,
deployment-guide.adoc; stated, never mandated) - D5 — The EMPI identifier kind (U4; #1805 slice)
- D6 — The application record (U5; M-F1, M-F2, M-F3, M-F7, M-F9)
- D7 — Acts, reads, events (U5; M-F2, M-F6)
- D8 — The IES field gap list (AC7)
- D9 — Web (U6)
- Forks (rec = recommended; the maintainer rules each at approval)
- Units — each its own MR, one epic
- Test matrix (each row red on
main; "in-process" runs over the injectedSecretSource) - Rollout and risks
- Review log
Archive record
Merge requests: !1931 (U0 plan page + ADR-083, Relates #1813) + !1934 (U4, Closes #2428) + !1935 (U1, Closes #2426) + !1940 (U5, Closes #1807) + !1941 (U2, Closes #2427) + !1938 (U6, Closes #2429); the close-out !1939 (U3, Closes #1813)
2026-10-19 — approved in plan mode on 2026-10-15 after a contextless round 1 (no-ship, 2 blockers fixed) and
the maintainer’s round 2 on GPT Astra (no-ship, 10 findings fixed). What landed:
the outbound credential channel across the partner crates, inert (U1);
the typed auth vocabulary, the endpoint rules, the fail-closed gate, the auth-class record release, the scrub (U2);
per-send resolution, host binding, application at three sites, auth-refused, redaction, the probe’s authority (U3);
the GA empi identifier kind (U4);
the Initial Medicaid Application record, acts and events (U5);
the web Medicaid application section on the child’s legal-status panel (U6).
Follow-ups stay open: #1073 (the DFCS readings), #1805, #1811, #1812, #1822, #2345, #2430-#2437, #2448, #2457.
Status
Done (2026-10-19) — !1939
Erratum (2026-10-15): D5’s services/craig-web/src/bundle.rs:261 is fixture-based (its own testid kind) and stays as it is; tools/craig-seed/src/bundle.rs:230 is the fifth spec change (U4, #2428).
Erratum (2026-10-15): the a_broker_egress_or_ssa_send_refuses_auth row is two tests, one in craig-exchange-transport (broker, egress) and one in craig-partner-ssa-solq (SSA), since neither crate can see the other; craig-exchange-transport gains a craig-exchange-contracts edge and re-exports OutboundAuth (U1, #2426).
Erratum (2026-10-15): D6’s "the encryption registry and xtask verify-seed cover it" — verify-seed asserts only SEEDED_TABLES,
each non-empty, and the seed writes no custody episode, so medicaid_applications is deliberately left off that list (documented
there; pinned by the_unseeded_medicaid_application_stays_registry_covered); the registry covers citizenship_status and its
at-rest proof is the devstack test citizenship_status_rests_encrypted_and_stays_out (U5, #1807).
Erratum (2026-10-15): D7 "hashes citizenship_status through crate::api::intents::blind_digest`" — that fn requires a
`BlindIndex spec and the column is Opaque, so the submit intent digests the token through the sibling keyed_token_digest
(keyed: hmac_domain("medicaid_application_citizenship", BLIND_INDEX_SCHEME_V1, token); keyless: the plaintext), the same
keyed-HMAC property; the V1 projection’s fields are in sorted order (U5, #1807).
Erratum (2026-10-15): D7’s field refusals (an unknown citizenship_status / prior_medical_assistance token, a
legal_admin_unit validate_admin_unit refuses) are 422 validation-failed bound to the field (ApiError::unprocessable), not
invalid-enum-value (a 400 sub-type); a token refusal’s detail lists its vocabulary, the county refusal’s names the
deployment’s state (not an administrative unit of Georgia), and none echoes the input (U5, #1807).
Erratum (2026-10-15): D7 "No consumer in TP-2" — as built, reporting’s case. queue RECEIVES both case.medicaid_application_
keys (a no-op fallthrough) and craig-security’s # queue audits them (create / update of medicaid_application); "no
consumer" holds for craig-exchange, the only service that would ACT on them. No service may read the application routes
(deny_pure_service), so TP-3 owes a service read beside its backfill (#1822). ADR-003 and data-model-cases say both (U5, #1807).
Erratum (2026-10-15): the PLAIN_HTTP_HOSTS compose line ships in U2, whose endpoint test needs it (U2, #2427).
Erratum (2026-10-15): U2 adds auth-unsupported and auth-misconfigured (U3 adds auth-unavailable and auth-refused with their ladder); in U2 an off-shape config on a non-none row answers auth-unsupported; its migration is two files so the scrub test re-applies the scrub’s own SQL; a stored row’s type is judged before its endpoint (U2, #2427).
Erratum (2026-10-15): release’s record arm keeps the old job’s partner (the chain must admit it), answers through the one ReleaseResponse with restaged and refused added, and stage_one_record now returns the staged job; release_restages_only_auth_class_records is two tests, its concurrent half two_concurrent_record_releases_stage_one (U2, #2427).
Erratum (2026-10-15): the send-job retention sweep keeps a failed record job of a restageable auth class until it is released, so the plan’s never-lost holds past the retention window (U2, #2427).
Erratum (2026-10-16): D9 "the submit form (legal county prefilled)" — as built the field is labelled "Legal admin unit" (the product’s neutral admin-unit copy, web.ftl:48-82; ADR-072: nothing presupposes an admin-unit design) and is prefilled from the case’s admin_unit, which the Federal facts tab passes in the custody slot’s query (U6, #2429).
Erratum (2026-10-16): D9 "'Recorded; not yet sent to IES'" — as built the product default reads "Recorded; not yet sent to the eligibility system"; the system’s name is the term-medicaid-eligibility-system terminology message (ADR-034 §6), which the Georgia overlay sets to IES, so a Georgia deployment reads exactly "Recorded; not yet sent to IES". The U6 Pages cell gains crates/craig-state-ga/terminology/{en,es}/worker.ftl (U6, #2429).
Erratum (2026-10-16): the boot warning names every active partner whose credential would be refused (any auth class, with the reference name where one is the cause), not only an unresolvable or unbound reference (U3, #1813).
Erratum (2026-10-16): craig-exchange gains a direct secrecy dependency (and tempfile for tests) to build the resolved SecretStrings (U3, #1813).
Erratum (2026-10-16): the resolver reads a reference’s value before its host binding: a reference with neither is auth-unavailable (D1’s seed rows), one with a value but no list, or not listing the endpoint’s host, is auth-misconfigured (U3, #1813).
Erratum (2026-10-16): from U3 an off-shape stored config, including U2’s scrubbed {} on a credential-bearing row, is auth-misconfigured; Rollout item 1’s release follows rewriting the row’s reference config (U3, #1813).
Erratum (2026-10-16): auth-refused is the trigger lane’s class (the leg’s family classifies the status); the manual lane and the probe hold no family, so a manual 401/403 rides the shared ladder to retries-exhausted (manual retry recovers it) and the probe reports the adapter’s own error with its status (U3, #1813).
Erratum (2026-10-16): the close-out’s --allow-open list also names the closing unit’s own issue (open until its MR merges) and #2448, plus any follow-up an erratum cites (U3, #1813).
Erratum (2026-10-16): no accepted acknowledgement of a shipped leg can carry partner text, so the redaction row asserts the stored response and the transaction read on the generic path; the acknowledgement site redacts for later legs (U3, #1813).
Erratum (2026-10-16): U3 also updates data-model-exchange.adoc’s auth-class recovery paragraph (four classes; the U2 interim gone) (U3, #1813).
Erratum (2026-10-16): redaction also covers the \/ JSON spelling, a partner body clipped mid-secret by the #1460 bound, object keys and numbers (U3, #1813).
Erratum (2026-10-16): the U3 half of a_pending_record_survives_the_auth_rollout starts from a terminal auth-misconfigured ref=rollout_ref (the reference provisioned with no host binding), since U3 removes the auth-unsupported interim; release re-stages it, a non-auth class refused, and once bound it sends once, authenticated (U3, #1813).
Glossary. This page is docs/modules/ROOT/pages/plans/archive/partner-auth-medicaid-application.adoc (TP-2). ⁂ marks a reading DFCS may rule
otherwise, logged on #1073 (it confirms a reading, it does not gate the build). D = design, F = fork (A- auth, M- application, B- the TP-3
bind), U = merge request, AC = a restated criterion. :line prefixes (on main, a citation anchor): ex/ =
services/craig-exchange/src/, tr/ = crates/craig-exchange-transport/src/, ec/ = crates/craig-exchange-contracts/src/, cases/ =
services/craig-cases/src/, IES/ = docs/modules/ROOT/pages/interfaces/ies-medicaid-eligibility.adoc, ies/ =
crates/craig-partner-ies/src/types.rs, tp1/ = docs/modules/ROOT/pages/plans/archive/custody-episodes-doe-slds.adoc.
| Anchor | What binds here |
|---|---|
#1813, #1807 (P2), #1805 (a slice) |
one program, two lanes; ADR-075 names #1813 a prerequisite of every real send ( |
ADR-075 ( |
the consent chain and its rebind (decision 5), categorical settlement (decision 10), release (decision 13) |
ADR-064 ( |
the sops store is dev/CI only; production secrets come from the orchestrator’s store |
ADR-081, tp1/ D5 ( |
the custody episode (the application’s parent); |
#1822 → TP-3 |
the IES bind, its facts (D8) and its backfill duty (D7) |
Context (census 2026-10-15 on main)
-
auth_configis stored and read by nothing.auth_type TEXT DEFAULT 'none',auth_config JSONB DEFAULT '{}', no CHECK (services/craig-exchange/migrations/20240401000000_create_exchange_tables.sql:8-9); the DTOs accept any string and JSON (ex/api/partners_dtos.rs:46-53,:96-99); the read model omits the column (#757, ex/store/models.rs:10-19). A plaintext secret posted today is stored. The seed’s sister-state rows sayoauth2(tools/craig-seed/src/datagen.rs:2532-2536), the CLI testapi_key(services/craig-cli/tests/cli/exchange.rs:30). -
The seam carries a URL only.
ExchangeAdapter::send(endpoint_url, payload)/test_connectivity(endpoint_url)(ec/lib.rs:139-150), the erased seam likewise (ec/erased.rs:62-110, macro arms:247-419); adapters are per-kind boot singletons over one transport (ex/bundle_orchestrator.rs:423-472);JsonAdapterCorebuilds every request of the ten JSON crates (tr/json_adapter.rs:129-162),StandardAdapterits own (ex/adapters/standard.rs:210-213), and stores any successful JSON (:221) as the transaction response (ex/send_worker.rs:690). -
Nothing stops a credential in clear, in a URL or in an error. Any
http://DNS name passes the vet (ex/api/dispatch_guard.rs:127-160), and the vet is skipped for an update leaving a row inactive (ex/api/partners.rs:296-306), sohttps://user:pass@hostcan be stored and probed, and reqwest derives Basic from it. Areqwesterror renders its URL (tr/wire.rs:13-21, ex/api/partners.rs:403-406). -
Authority. GA supervisors write partners (
rulesets/georgia/georgia-authz-exchange_partner.json:98); the probe needsAction::Read(ex/api/partners.rs:391); manual dispatch reads the partner without checkingactive(ex/send_worker.rs:494). -
Auth failures drop records. Every non-5xx is terminal
bad-status(ex/triggers/legs.rs:666-683); a terminalrecordjob is never walked back (ex/send_worker.rs:604-618); send jobs knowpending | in_flight | sent | failedonly (20260505185937_exchange_send_jobs.sql:23); the ladder is 5, 5, 30, 120, 300, 900 s over attempts already spent (ex/send_worker.rs:195,:236). -
No catalogue names a CRAIG-presented scheme (broker-held or SSL plus IP filtering:
interfaces/cprs-fcc-case-plans.adoc:461-463,:510;interfaces/stars-integration-architecture.adoc:226). Production secrets arrive as env or_FILE(crates/craig-auth/src/keypair_env.rs:130-132,:167-172). -
No Medicaid application anywhere. The trigger is "Save and Submit of the Initial Medicaid Application page" (IES/
:655,:1676;:1672retires Sign + Save), by the Case Manager within 48 h of custody (IES/:655,:978), only once the child has an EMPI (IES/:665,:2160). GA declaresgtidonly (crates/craig-state-ga/src/identifier_kind.rs:12-16). Exchange binds explicit and declared trigger keys only (ex/main.rs:695-715): a later subscription never replays earlier publications.
Scope
In: D1–D9 (F0 A). Out: the IES bind and its facts (TP-3, D8); the EMPI registration exchange (#1805 stays open); mtls #2434,
oauth2_client_credentials #2435; recovery of a record job failed under a non-auth class #2436; SSA SOLQ auth (Phase P, ADR-066
:287-289); the broker transport; an IES outcome on the record (M-F8); a CPRS push endpoint (#1812).
Restated acceptance
#1813 (stale: "sourced from the sops store", dev/CI only by ADR-064 :50-52; "mTLS as the catalogue requires", where none does). AC1. A
closed auth_type vocabulary (none, bearer, basic, api_key) applied by the shared transport; an unsupported or misconfigured row
never sends. AC2. auth_config holds secret references only; anything else is a typed 422 naming the field, never echoing it; U2 empties
stored configs; no credential rests in a URL, log, error, event, stored response or read model. AC3. Each reference reaches only the hosts
the deployment binds to it; the probe sends the configured auth and reports the type applied; no credential crosses plain http to an
unlisted host. AC4. A record job ended by an auth class is recoverable by release.
#1805, the slice. AC5. GA declares empi, nine digits ⁂, worker-attested, on person_identifiers; no DOE leg admits it.
#1807 (stale: feat(financial), financial.medicaid_application_submitted (M-F1); "supervisor+" (M-F6)). AC6. One live application per
child per custody episode; submit and retract acts with a keyed intent; case.medicaid_application_submitted / _retracted, ids-only, with
ADR-003 rows and security arms in the same MR. AC7. The IES gap list (D8) here, on #1822 and the TP-3 issues. AC8. #1822 names
case.medicaid_application_submitted as its trigger and owes an idempotent backfill of every application submitted before it (U0).
Design
D1 — The vocabulary, the reference shape, the endpoint rules (U2; A-F1, A-F3, A-F7, A-F9)
-
PartnerAuth, a typed enum in craig-exchange parsed from(auth_type, auth_config),deny_unknown_fieldsper variant:auth_typeauth_configSent as none{}nothing
bearer{token_ref}Authorization: Bearer <secret>basic{username, password_ref}Authorization: Basic base64(username:secret)api_key{header, key_ref}<header>: <secret> -
SecretRef:^[a-z][a-z0-9_]{0,62}$, refusing a name ending_fileor_hosts(D3’s variables never alias): a name, never a value.username1–128 printable ASCII, no:.headeran HTTP token, neverauthorization,proxy-authorization,cookie,content-type,content-length,host,connection,transfer-encoding,te,upgrade,keep-alive,trailerorexpect. No credential in a query string. -
Create and update: an unknown type 422
partner-auth-type-unknown; a config off its shape 422partner-auth-config-invalidnaming the JSON path only; an update names both fields or neither. -
Endpoint rules, regardless of
active. An endpoint carrying userinfo is 422partner-endpoint-userinfoat create and every update (today’s vet runs only for active rows). A non-nonerow onhttp://is 422partner-auth-requires-httpsunless its host is inCRAIG_EXCHANGE__PARTNER_AUTH_PLAIN_HTTP_HOSTS(default empty; thecomma_listprecedent,crates/craig-common/src/settings.rs:1073-1080). A stored row breaking either rule (written before U2) is refused at admission, send and probe asauth-misconfigured, nothing sent. -
Admission and dispatch run the parse and endpoint rules (D3’s classes). In U2, before D3 applies credentials, every non-
nonetype counts as unsupported: occurrences hold, record jobs failauth-unsupported(recoverable, D3), manual jobs settle it, so nothing claiming auth is sent unauthenticated again. -
Read model unchanged (#757). The unit pin (ex/
store/models.rs:384-415) stays; the API test (services/craig-exchange/tests/api/partners.rs:262-308) posts a reference config, names both fields on update and still asserts omission (said in the commit).PartnerIntentV1unchanged. -
Migration (U2): every
auth_configother than{}becomes{};schema_compat_floorbumped. A plaintext secret leaves the live table only (WAL, backups and replicas keep it: rotation is the revocation, ADR-064 D3:80-88). -
Seed: the sister-state rows become
bearerwith an unprovisioned ref (their sends settleauth-unavailable); the CLI test keepsapi_key.
D2 — The credential channel (U1; A-F2, A-F10)
-
craig_exchange_contracts::OutboundAuth { None, Bearer(SecretString), Basic { username, password: SecretString }, ApiKey { header, key: SecretString } }: redactedDebug, noSerialize; contracts and the transport gainsecrecy(workspace0.10,Cargo.toml:118). -
ExchangeAdapter::send(endpoint_url, auth: &OutboundAuth, payload),test_connectivity(endpoint_url, auth);ErasedAdapterlikewise, the three macro arms forwarding it (one lifetime shared by&selfand&OutboundAuthon theBoxFuture<'_>returns). The ten JSON crates hand it toJsonAdapterCore;StandardAdaptertoo;noop://ignores it. -
TransportRequest.auth,ProbeRequest.auth, apart fromheaders.DirectHttpTransportappliesbearer_auth/basic_auth, andApiKeyas aHeaderValuewithset_sensitive(true);probe_healthcarries it. -
Fail closed off the generic path.
WebMethodsTransport,EgressControlledTransport(tr/egress.rs:328) and the SSA adapter refuse an auth other thanNonewith a typed error before building anything.StubTransportrecords the auth’s kind and header name (its value undertest-utilonly). -
U1 is inert: every call site passes
OutboundAuth::None.
D3 — Resolution, binding, application, redaction, recovery (U2, U3; A-F1, A-F5, A-F6, A-F8)
-
Resolver (U3). A ref resolves to env
CRAIG_PARTNER_SECRET_<REF>inline, elseCRAIG_PARTNER_SECRET_<REF>_FILEread per send (capped at 8 KiB, one trailing LF / CRLF stripped); inline wins, empty is absent (the keypair precedent). A value with a control byte or over the cap isauth-unavailable, its bytes never rendered. Values live inSecretString, nothing cached. The resolver’s only input is an injectedSecretSource(an env lookup plus a bounded file reader) thatmainbuilds from the process env: the value- and file-varying tests run in-process over a tempdir source (the send worker overStubTransport, theservices/craig-exchange/tests/api/ssa_worker.rs:28,:79-86precedent, or acraig-mock-serverspawn_for_testcapture), since a devstack test cannot change the container’s environment andstd::env::set_varisunsafeunderunsafe_code = "deny"(Cargo.toml:404;crates/craig-auth/src/keypair_env.rs:327-333). -
Destination binding (U3, A-F1). Each ref also needs
CRAIG_PARTNER_SECRET_<REF>_HOSTS, a comma list of exact hosts (case-insensitive, no wildcard). The resolver refuses a send or probe whose endpoint host is not listed, or whose ref has no list, asauth-misconfigured(the ref name, never the host list, in the class detail): a partner writer can no longer aim a provisioned secret at another host, and the probe cannot extract one. The deployment owns which hosts a secret reaches. -
Where (U3). The manual worker (ex/
send_worker.rs:520-576), trigger dispatch after its rebind (ex/triggers/dispatch.rs:624-680), the probe (ex/api/partners.rs:360-415). One auth-bearing store read returns the row withauth_config(ExchangePartnercarriesauth_type, ex/store/models.rs:32) and serves admission, release, both workers and the probe;ExchangePartnerstays withoutauth_config. Free functions throughout (impl TriggerRuntimeis at its 16-method cap, tp1/ erratum). Manual dispatch refuses an inactive partner (partner-inactive, terminal, nothing resolved; manual retry recovers). -
Classes (ex/
triggers/settlement.rs:79-94), a bounded label set:Class When Record job / manual job Admission auth-unsupportedtype outside the vocabulary (and every non-
nonetype in U2)fails, nothing sent; record recoverable
held
auth-misconfiguredconfig off shape, userinfo, http to an unlisted host, host off the ref’s binding
fails, nothing sent; record recoverable
held
auth-unavailablea ref resolves to nothing usable
ladder, then fails; record recoverable
—
auth-refusedthe partner answers 401 or 403
ladder, then fails; record recoverable
—
-
Auth-class record recovery (U2, A-F6).
ReleaseRequest(ex/api/triggers.rs:71) gainsrecord_class, exclusive withheld_reason(both 422):{interface, record_class: <auth-*>, ids?}(ids= send job ids). A free fn besiderelease(ex/triggers/acts.rs:93-157) locksFOR UPDATEeachkind = 'record',status = 'failed'job of the interface whoselast_errorleading token (theSendFailuregrammar, ex/triggers/settlement.rs:154-166) is that class and whose newrestaged_asis NULL. It re-runs the admission chain, then re-stages throughstage_one_record(ex/triggers/dispatch.rs:921, madepub(crate)) with the old job’s ordering key, admission, recipient, source version and closure, assupersededoes (:693-760, decision 8): a new correlation and transaction, a fresh attempt budget. It sets the old row’srestaged_as(the U2 migration addsrestaged_as UUID NULL REFERENCES exchange_send_jobs(id); the old row keeps its auth class, so the trail says why it failed). Response{restaged, refused}. A non-auth class 422release-record-class-unsupported(#2436); a chain that no longer admits countsrefusedand leaves the row. A second or concurrent release is a no-op. So the U2 interim, a long credential outage and a job that met a 401 on its last attempt all end recoverable, never lost. -
Admission gains a fifth link after the DSA: parse and endpoint rules, no secret read in the inbox transaction; release re-runs it.
-
401/403:
partner_error(ex/triggers/legs.rs:672-683) maps both toauth-refusedwith the status and no body digest, every family;failure_disposition(ex/send_worker.rs:236-262) retries it on the remaining ladder; the manual worker ends a spent one under that class. -
Response-persistence boundary (U3). Every byte string exchange stores or serves from a send — the transaction response (ex/
send_worker.rs:690), an ack,last_error,exchange.failed{error}, the probe result, the transaction read — passesredact_credential(bytes, &OutboundAuth)first: each exact occurrence of the secret, of its header value (Bearer <secret>, the api key), of Basic’s base64 token and of their JSON-string-escaped forms becomes[credential]. -
Probe (A-F8): carries the auth, needs partner
update(todayread), reportsauth_applied: <type>(applied, not verified:/healthmay ignore auth), a 401/403 asauth-refused, a resolve failure by class and ref name. -
No credential leaves. Logs, events and metric labels carry a class and a ref name only. Boot logs one
warn!per active partner whose ref does not resolve or has no host binding. -
Devstack (A-F11): compose sets
CRAIG_EXCHANGE__PARTNER_AUTH_PLAIN_HTTP_HOSTS=mock-server, two fixture refs (CRAIG_PARTNER_SECRET_DEVSTACK_TOKEN,CRAIG_PARTNER_SECRET_DEVSTACK_REFUSED, obviously fake low-entropy values, each with_HOSTS=mock-server); a new layer in the mock’s router seam (tools/craig-mock-server/src/lib.rs:166-178) answers 401 to the refused marker and an echo route returns the received Authorization header in a 200 body. No sops entry, no ADR-064 amendment.
D4 — Deployment consequences (U3, deployment-guide.adoc; stated, never mandated)
-
Inline env rotates by restart; a mounted
_FILErotates on the next send. Either comes from the orchestrator’s store; ADR-064’s sops store holds devstack values only. -
Binding a host to a ref lets every partner row naming that ref reach it; an empty or absent binding refuses the ref. Listing a host in
PARTNER_AUTH_PLAIN_HTTP_HOSTSsends credentials to it in clear. -
A credential problem (missing, wrong, rotated) holds or fails its jobs under an
auth-*class: fix the secret, thenreleasethe interface’s record jobs of that class; nothing is lost. The ladder rides out blips only as far as each job’s remaining attempts. -
Deactivating a partner stops its queued manual and trigger jobs (
partner-inactive,partner-changed). -
Activation per partner: provision the secret and its host binding, set
auth_type/auth_config, run the probe, then (trigger interfaces) the knob. -
The rollout (Rollout and risks, item 1) names the U2 → U3 sequence and the release step.
D5 — The EMPI identifier kind (U4; #1805 slice)
-
GA appends
{ token: "empi", label: "EMPI Client Identifier", format: Digits(9) }⁂ (IES/:753-757,:1574-1575) toGEORGIA_IDENTIFIER_KINDS; all else is tp1/ D5 unchanged (CGEF plusBlindIndex, the uniques,worker_attested(services/craig-cases/migrations/20261014130000_person_identifiers.sql:66), acts, events withkind = empi, the audited reveal, the person’s authz). The web section lists the bundle’s kinds (services/craig-web/src/routes/cases/person_identifiers.rs:356). DOE admitskind = gtidonly (ex/triggers/legs.rs:277-279). -
Spec changes U4 makes, each said in the commit: the GA proptest’s
vocab.len() == 1(crates/craig-state-ga/src/identifier_kind.rs:40) and its only-gtid-parses assertion (:51); the cases boot test’s one-kind assertion (services/craig-cases/src/identifier_kind.rs:62); the web bundle tests' two one-kind assertions (services/craig-web/src/bundle.rs:261,:274); the cases unknown-kind example (services/craig-cases/tests/api/person_identifiers.rs:535-537) moves to a kind no bundle declares.
D6 — The application record (U5; M-F1, M-F2, M-F3, M-F7, M-F9)
-
craig-cases
medicaid_applications:id(v7),case_id,child_id,episode_id(FKcustody_episodes, the child’s open episode in the case),citizenship_status(CGEF; tokenus_citizen | qualified_alien | other | unknown⁂),prior_medical_assistance(yes | no | unknown),legal_admin_unit(the page’s County, IES/:1607),submitted_onDATE (BusinessClock::date_of),submitted_by,submitted_at, retire columns (retracted,note). A partial UNIQUE onepisode_idover live rows; a row guard admitting the retire only; field specs incrates/craig-cases-fields/src/medicaid_applications.rs; the encryption registry andxtask verify-seedcover it. -
citizenship_statusis encrypted although cases encrypts identifiers only (crates/craig-cases-fields/src/person_demographic_facts.rs:6-8): deliberate, an immigration status. An episode later retracted as entered-in-error leaves its application live; TP-3’s assembly checks the episode. -
Not on it: names, DOB, sex, race, ethnicity, pregnancy, EMPI, removal date (standing cases facts TP-3 reads); no SSN (M-F7); no placement fact.
-
EMPI gate (M-F9):
StateBundle::medicaid_application_identifier_kind() → Option<&'static str>(defaultNone, the TX stub; GASome("empi"); boot refuses an undeclared kind). Submit needs the child’s live identifier of that kind through commit (D7), else 422medicaid-application-identifier-missing.
D7 — Acts, reads, events (U5; M-F2, M-F6)
-
ADR-062 idempotent:
POST /v1/cases/cases/{case_id}/children/{child_id}/medicaid-applications{client_request_id, citizenship_status, prior_medical_assistance, legal_admin_unit}→ 201;POST …/medicaid-applications/{id}/retract{client_request_id, note};GET …/medicaid-applications[?child_id=],GET …/{id}, each row{id, case_id, child_id, episode_id, citizenship_status (decrypted for `case: read), prior_medical_assistance, legal_admin_unit, submitted_on, submitted_by, submitted_at, retired_at, retired_reason, note}`. Submit-only, immutable, a retract frees the episode. -
Keyed intent.
MedicaidApplicationIntentV1hashescitizenship_statusthroughcrate::api::intents::blind_digest(keyed HMAC), never the token, as the person-identifier intent does (cases/api/intents/person_identifiers.rs:10): the persisted claim’s hash (the default is unkeyed SHA-256,crates/craig-api/src/request_claims.rs:133) cannot be matched by trying the four tokens. -
Refusals: no child-role row 400
child-not-in-case; no open episode of the child in this case 409custody-not-open; a live application on it 409medicaid-application-exists; an unknown token 422; alegal_admin_unitthatcraig_reference::validation::validate_admin_unit(crates/craig-reference/src/validation.rs:66) refuses for the case’s state is 422 onlegal_admin_unit, the canonical name stored (calling the predicate directly;canonical_admin_unit, cases/api/admin_unit.rs:28, answers 400 onadmin_unit). -
Lock order (ADR-081 D3,
:49-52): claim → caseFOR KEY SHARE→ the child’s advisory lock → the episodeFOR SHARE→ the child’s live EMPI rowFOR SHARE→ insert. Identifier end and retract take that rowFOR UPDATE, so liveness holds through commit; neither path takes the other’s earlier locks, so no cycle. The partial UNIQUE answers a racing submit 409. -
Authz (M-F6): the case resource (cases/
api/ledgers/child_facts.rs:95-101): submit and retractcase: update, readscase: read;deny_pure_servicebefore every route; no new ruleset. -
Events, ids-only:
case.medicaid_application_submitted/retracted{application_id, child_id, case_id, episode_id, act, act_id, act_at, user_id}, strict. ADR-003 rows; craig-security familycase.medicaid_application→application_id, resourcemedicaid_application(_submittedacreate,_retractedanupdate); the family pin (services/craig-security/src/event_parsing.rs:3324) becomes 35. No consumer in TP-2: exchange binds only declared keys, so TP-3 owes the backfill (AC8). Citizenship never enters an event, log or error.
D8 — The IES field gap list (AC7)
IesMedicaidReferral field (ies/:95-246) |
Source after TP-2 | Gap → TP-3 |
|---|---|---|
|
none (the correlation is a UUID) |
numeric transaction id #2433 |
|
the live |
registration exchange (#1805) |
|
constants |
— |
|
the episode’s |
— |
names, |
persons |
CSEX map #2432; |
|
omitted (M-F7) |
— |
|
|
CRACE / CINDETHN crosswalks #2432 |
|
the application (D6) |
IES code crosswalk #2432 |
|
|
— |
|
the application’s |
county code ⁂ #2432; String(15) ⁂ |
|
the application |
— |
|
free-text |
structured placement address #2430 |
|
none |
DFCS office source #2431 |
|
|
#1811 ⁂ |
|
|
optional; TP-3 decides |
D9 — Web (U6)
A Medicaid application section on the child-in-case view (services/craig-web/src/routes/cases/custody.rs): the submit form (legal county
prefilled), the list, retract; each row states its delivery plainly: "Recorded; not yet sent to IES" until TP-3 sends it (no delivery claim
in TP-2); Fluent keys; a Playwright journey by test id.
Forks (rec = recommended; the maintainer rules each at approval)
F0 — scope. A (rec): TP-2 = #1813, the EMPI kind, #1807; #1822 to TP-3 with #2430–#2433, #1811 and the backfill duty. Consequence: two usable lanes; IES sends nothing until TP-3, which then backfills every TP-2 application once. B: bind IES now. Consequence: four required fields with no home (D8) are invented or every record refused, and the sync-vs-async reading (⁂14) may amend ADR-075 decision 10. C: #1813 only. Consequence: no way to capture an application meanwhile.
A-F1 — credential home. A (rec): references resolved per send from env or _FILE, each bound to deployment-listed hosts. Consequence: no
secret at rest; partner-write authority cannot redirect a secret; a partner needs its secret and binding first. B: env keyed by partner id.
Consequence: runtime rows coupled to deploy config. C: encrypted in Postgres. Consequence: the database becomes a credential store. D:
references with no host binding. Consequence: a partner writer (a GA supervisor) can aim any secret at a host it controls and extract it
through the probe.
A-F2 — channel. A (rec): an explicit &OutboundAuth per call. Consequence: one mechanical signature change across the partner crates. B:
per-partner adapter caches. Consequence: invalidation logic. C: a host-keyed decorator. Consequence: two rows on one host cannot differ.
A-F3 — types. A (rec): none, bearer, basic, api_key; mtls #2434. Consequence: headers on the shared client. B: mtls now.
Consequence: +W5, per-partner clients, a TLS mock, before any reading names a partner that needs it (⁂1).
A-F4 — OAuth2 client credentials. A (rec): #2435. Consequence: the seed’s oauth2 rows become bearer. B: now. Consequence: a token
cache, refresh, a second egress target.
A-F5 — rotation. A (rec): resolve per send, no cache. Consequence: a mounted file rotates on the next send. B: load at boot. Consequence: rotation is a restart.
A-F6 — auth failures. A (rec): auth-* classes, record jobs recoverable by release’s record arm; 401/403 ride the remaining ladder
first. Consequence: no record lost to a credential problem; a long outage needs one operator release. B: terminal `bad-status. Consequence:
a rotated credential drops every record it meets. C: a general record-job hold for every class. Consequence: new substrate beyond auth
(#2436).
A-F7 — plain http. A (rec): refused unless the host is listed. B: left to the deployment. Consequence: a mistyped row sends in clear.
A-F8 — probe. A (rec): the probe carries the auth, needs update, reports it applied. B: an authenticated no-op POST. Consequence: may
create records.
A-F9 — read model and stored rows. A (rec): auth_config stays out of the read model; U2 empties stored configs. B: serve the refs.
Consequence: every partner reader sees ref names. C: no scrub. Consequence: pre-U2 secrets stay at rest.
A-F10 — SSA and SHINES. Rec: StandardAdapter in (the generic path), SSA out (its adapter refuses an auth; Phase P owns it).
A-F11 — devstack values. A (rec): public markers in compose. B: ADR-064 store entries. Consequence: an amendment, and identity-less
contributors lose the tests (:217-218).
M-F1 — owner. A (rec): craig-cases. Consequence: every source fact is local; #1807’s financial label is restated. B: craig-financial.
Consequence: an exchange → financial client and a PII fan-out or snapshot; rollout step 1 changes (deployment-guide.adoc:906-908).
M-F2 — shape. A (rec): one live per (child, episode), submit-only, immutable, retract. B: drafts. Consequence: a lifecycle and routes. C: per (child, case). Consequence: a re-entry reuses the old application.
M-F3 — contents. A (rec): only the page facts with no other home. B: every page fact. Consequence: a second DOB at rest. C: none. Consequence: citizenship, prior MA and legal county have no home.
M-F4 — placement gate (IESM.1.3). A (rec): TP-3’s leg (the catalogue gates the sending, IES/:622-623). B: at submit. Consequence: cases
gains a placement client now.
M-F6 — who submits. A (rec): case: update, the catalogue’s actor ⁂. Consequence: differs from the issue. B: supervisor and admin.
Consequence: a GA and TX ruleset; every submit waits on a supervisor inside 48 h.
M-F7 — SSN. A (rec): omitted. B: a second release purpose. C: a snapshot. Consequence: a second SSN at rest.
M-F8 — return path. A (rec): the outcome stays in exchange’s settlement. B: outcome columns now. Consequence: inbound plumbing not asked for.
M-F9 — EMPI gate. A (rec): a live EMPI through commit. B: no gate. Consequence: TP-3 refuses at send, after the 48 h window.
Minor. M-F5: the removal date is the episode’s custody_from (rec) OR placement’s removal episode (⁂8). Citizenship tokens: a neutral
four (rec) OR a bundle vocabulary. The plain-http list: a setting (rec) OR a hard-coded mock-server.
What TP-3 must honour. B-F1: the IES stage is the application (a MedicaidApplication stage kind): a retract and resubmit give a new
application id inside one episode, and the recipient ledger dedupes by stage and person (ex/store/trigger_ledgers.rs:186), so the episode
is not a usable stage. B-F2/F3: the record carries the page facts; the person projection need not widen for citizenship. B-F4: TP-2 adds
nothing to job identity. B-F6: auth applies to any HTTP send; no class assumes an acknowledgement shape. B-F8: no correction leg is owed.
B-F10: the backfill (AC8) is an open-applications walk plus catch_up_leg(ies, MedicaidApplication), idempotent through the recipient
ledger. B-F11: the gate leaves only an EMPI ended after submit to assembly.
Units — each its own MR, one epic
Order: U0, then U1 → U2 → U3 (auth) and U4 → U5 → U6 (application). Each MR closes its unit issue and Relates to its parent; U3 closes
1813, U4 Relates to #1805, U5 closes #1807. The first code unit sets Status In progress; each MR is green alone with its CHANGELOG
entry; each new test carries // @axis:, a devstack one [ignore = "requires devstack"]. Whichever of U3 and U6 merges last closes out
(Status Done, the archive row, plan-lint --done --allow-open 1073,1805,1811,1812,1822,2345,2430,2431,2432,2433,2434,2435,2436,2437).
| U | W | Content | Pages |
|---|---|---|---|
U0 |
1 |
The TP-2 epic (&108) and unit issues #2426 (U1), #2427 (U2), #1813 (U3), #2428 (U4), #1807 (U5), #2429 (U6); the TP-3 epic (&109)
with #2430 structured placement address, #2431 DFCS office source, #2432 GA IES crosswalks, #2433 numeric partner transaction id; #1811 and
#1822 re-parented, #1822 restated (trigger, D8, blockers #1805 #1811 #2430–#2433, the IES mock |
this page (Active nav), ADR-083 (Proposed) |
U1 |
5 |
D2: |
|
U2 |
8 |
D1 and D3’s U2 parts: vocabulary, typed validation, the endpoint rules (userinfo regardless of |
|
U3 |
8 |
D3’s U3 parts and D4: resolver and |
|
U4 |
2 |
D5 with every spec-changed test it lists |
|
U5 |
5 |
D6 + D7 with ADR-003 rows and security arms (the same-MR rule); the ledger-lift golden re-blessed |
|
U6 |
3 |
D9 and Playwright |
|
Test matrix (each row red on main; "in-process" runs over the injected SecretSource)
| Test | Axis | U | Asserts; why red on main |
|---|---|---|---|
|
evil |
U1 |
|
|
happy |
U1 |
each JSON kind and |
|
happy |
U1 |
a local server sees each type’s header, built sensitive. Red: no field |
|
evil |
U1 |
typed refusal; nothing built. Red: no field |
|
evil |
U2 |
any |
|
sad |
U2 |
|
|
evil |
U2 |
|
|
evil |
U2 |
userinfo on create and on an update leaving the row inactive: 422; |
|
evil |
U2 |
SQL-written userinfo and http rows: admission held, send and probe
|
|
happy |
U2 |
|
|
happy |
U2 |
rows inserted first, the migration’s SQL applied on a scratch DB: configs become
|
|
evil |
U2 |
a SQL-written |
|
fault |
U2 |
a CPRS record pending for a |
|
sad |
U2 |
|
|
happy |
U3 |
in-process: bearer, basic, api_key from inline and from a file: exact headers; |
|
evil |
U3 |
in-process: a ref bound to host A, a partner (and the probe) on host B:
|
|
evil |
U3 |
in-process: 200 bodies echoing each type’s header (Basic’s encoded value
and JSON-escaped forms too): the stored response, the transaction read and the ack hold |
|
happy |
U3 |
in-process: the file changes between sends; each carries its value. Red: no header |
|
conc |
U3 |
in-process: concurrent sends to two same-kind partners: each capture holds its own. Red: no header |
|
fault |
U3 |
in-process: unset ref: |
|
fault |
U3 |
in-process: five prior failures, then a 401: fails |
|
fault |
U3 |
devstack: the refused marker’s 401: CPRS and DOE records retried, |
|
evil |
U3 |
in-process: a queued manual job, then deactivate: |
|
happy |
U3 |
devstack: the probe’s capture carries the header; the result names the type; a read-only caller 403. Red: no header |
|
evil |
U3 |
across 401, 5xx, timeout, unresolvable, unbound host and the probe: no
marker byte in |
|
evil |
U4 |
accepted ⇔ nine ASCII digits ⁂, never trimmed; two kinds. Red: no kind |
|
evil |
U4 |
201; CGEF and hmac; another’s live EMPI 409 naming no one. Red: 422 |
|
evil |
U4 |
record and end on a listed child: no DOE admission. Red: 422 |
|
happy |
U5 |
201; |
|
sad |
U5 |
no or a closed episode 409; no or an ended EMPI 422; a non-member 400; TX ungated. Red: 404 |
|
conc |
U5 |
an EMPI end racing a submit: either the submit commits first and the end waits, or the end commits first and the submit 422; never an application whose EMPI ended before its commit (a pg_locks census). Red: 404 |
|
conc |
U5 |
racing submits: one 201, one 409; a submit racing the close: no 500; retract then submit 201. Red: 404 |
|
replay |
U5 |
the same |
|
evil |
U5 |
the persisted claim’s hash differs from the unkeyed SHA-256 of the intent under each of the four tokens. Red: no route |
|
evil |
U5 |
the assigned caseworker submits; outside the unit 403; read-only reads; a pure service 403. Red: 404 |
|
evil |
U5 |
the column is CGEF; no event, log or problem body holds the token. Red: no table |
|
sad |
U5 |
an unknown token 422; a refused admin unit 422 on |
|
sad |
U5 |
a bundle naming an undeclared kind is a boot error. Red: no hook |
|
evil |
U5 |
both keys resolve |
|
happy |
U6 |
submit, list ("Recorded; not yet sent to IES"), retract by test id. Red: no UI |
Rollout and risks
-
The auth lane’s sequence. U1 is inert. U2 is the fail-closed step: every non-
nonerow holds or failsauth-unsupported(record jobs recoverable). Before or with U3: provision each partner’s secret and_HOSTSbinding. After U3:releasethe interface’sauth-unsupportedadmissions and record jobs; they send once, authenticated. A deployment that relied on unauthenticated sends sets those rows tonone(the ops note). U2’s floor bump stops an older exchange from starting, not one running: write partners only after the roll. -
Downgrade. Exchange cannot roll back below U2. U4–U6 are additive in cases with no floor bump; a cases rollback below U5 answers the application routes 404 and leaves the rows.
-
Risks. A host binding grants every row naming the ref; bind narrowly. A short secret typed as a ref name is stored like a name (it then fails to resolve). Scrubbed values survive in WAL and backups. A partner’s
/healthmay not exercise auth. A content-based 403 is resent on the remaining ladder. Redaction matches the exact applied forms; a partner that transforms the secret (hashes it) defeats it.
⁂ readings for #1073 (U0 posts them):
-
Which scheme each endpoint requires; who issues and rotates credentials. . Whether GTA webMethods stays in the path. . Whether SSL plus IP filtering stays sufficient (
cprs-fcc-case-plans.adoc:510). . Save and Submit with no signature step (IES/:1672-1677vs:1750,:2130,:2152). . EMPI sent, nine digits; DHR Client Number and EMPI ID are one identifier (IES/:753-757,:777; CR 256:2615). . EMPI precedes submit (IES/:665,:2160). . The Case Manager submits (IES/:655,:978). . The removal date is the episode’s In-Care date (IES/:769-770). . CRAIGactive/plannedplacements pass IESM.1.3 (IES/:1646-1669). . The code tables: CRACE for a multi-race child, CINDETHN, citizenship String(3), CSEXU, county code. . Office name String(15); whose office. . A display name as SSCM name (#1811). . One application per episode; does IES dedupe a second REF. . A direct POST answers synchronously (ies/:12-16vs IES/:638,:1750); a 7- or 60-day horizon. . The 548.x rows are superseded (IES/:28-605). . The four citizenship tokens cover DFCS’s categories.
Review log
| Round | Vendor | Resolved model | Verdict |
|---|---|---|---|
1 |
Anthropic, one fresh contextless reviewer (the page, the rules, the four questions) |
Claude Opus 5.5 |
no-ship: 2 blockers
(secret-varying tests unbuildable without an injected source; a |
2 |
OpenAI (maintainer-run) |
GPT Astra |
no-ship: 10 findings (5 P1, 5 P2) and 2 contract details, all fixed (deployment-bound secret
hosts, a keyed application intent, auth-class record recovery for the U2 rollout, a response-persistence redaction boundary, TP-3’s backfill
duty and the "not yet sent" UI, userinfo refused regardless of activation, the application as TP-3’s stage, U4’s full test inventory, the
cut-over claim, deactivation stopping manual sends, EMPI liveness through commit, 422 on |