Plan: Outbound Interface Trigger Parity — The OUTBOUND Ledger, Late-Bound Single-Record Sends, the CPRS Legs (&87)
Archive record
Merge requests: !1621 (U0 plan page + ADR-075, Closes #1826) + !1623 (U1, Closes #1827) + !1624 (U2a, Closes #1828) + !1625 (U2b, Closes #1835) + !1626 (U3, Closes #1829 / #243) + the close-out MR (U4, Closes #1830)
2026-09-13 — outbound partner sends became EVENT-DRIVEN for the CPRS INV/ONG interface: a jurisdiction declares its
trigger matrix through StateBundle::outbound_triggers(), exchange validates every row against the live adapter
registry at boot AND binds every declared event on its consumer queue (the two halves of ADR-032 §1.3), admits each
occurrence inside the inbox attempt transaction under a partner-free identity, runs the per-interface consent chain
(knob → exactly one active partner → an agreement owned, active and inside both dates → a Generic adapter; a
refusal is a recorded held(<reason>) row, never a dropped event), resolves membership ONCE into the catalogue’s
OUTBOUND ledger, assembles ONE record per job at dispatch under a whole-read budget (PII never at rest in exchange),
pins bytes to a source_version with supersession on drift, decides a record’s closure framing at resolve, settles
on the partner’s ACKNOWLEDGEMENT with categorical failures, and keeps per-stage FIFO. Three operator acts (catch-up,
release, dismiss), server-owned provenance, stage-qualified leg tokens, three deliberate schema-floor bumps. Six
interfaces (WIC, DOE-SLDS, IES, STARS, SMILE, TCM) stay blocked on facts CRAIG does not model yet (#1804–#1810);
production delivery to CPRS waits on the protocol bridge (#1812) and outbound auth (#1813). The epic stays OPEN as
the tracker of those bind issues.
Status
Done (2026-09-13) — !1626
Erratum (2026-09-13, U1 #1827): the release audit rides the EXISTING case.person_pii_exported key discriminated by
purpose = outbound_principals (the third wrapper, per ADR-003’s multi-wrapper rule and the SSN-release precedent) —
not a new case.outbound_principals_released key; the security parser needs no new arm. Decision 12’s route list
gained the single-record arms for BOTH stage kinds and the report → open-investigations arm at round 1 (already on
the page); the projection returns every member’s role verbatim and never pre-filters — the consumer’s admission rule
(child roles under 18) is exchange’s (decision 6).
Erratum (2026-09-13, U2 #1828 / #1835): U2 shipped as the two MRs the unit table permits. U2a (#1828) carried the
substrate and the CPRS ONG stage_opened leg; U2b (#1835) carries stage_closed, the catch-up and release /
dismiss acts and the mock _capture surface. Three deviations, all in U2b. The catch-up act takes {interface,
kind} and NOT decision 15’s since: the cases open-stages arm is an id cursor with no time filter, the walk is
idempotent by the admission identity, and a parameter the projection cannot honour would be a lie. A closure
resolve that finds a recipient absent from the stage’s current membership records removed_at and stages nothing —
decision 6 does not cover the case, and CRAIG has no ONG household-removal event, so absence at closure is the only
evidence there is. A record’s closure indicator is decided at RESOLVE and recorded on the job
(exchange_send_jobs.record_closure), not derived from its leg and never re-read from the stage at assembly:
an opening record and the closure that follows it are two sends the partner receives in that order, so reading
the stage at dispatch would make both say closed. The same column is what makes decision 9’s "a stage_opened
resolve of an already-closed case emits closed records directly" true without a second code path.
Erratum (2026-09-13, U3 #1829): the leg TOKEN is stage-qualified (ong_* / inv_*) rather than bare, because the
pair (interface, leg) is what the ledger stores and what dispatch resolves a leg from — a bare stage_opened
stopped identifying one leg the moment the INV stage existed. Decision 14’s INV principal_added /
principal_removed key on the REPORT as written; what the page did not say is that a report is not a stage, so the
resolve maps it to the referral’s open investigations and acts on each in its OWN transaction, and that the removal
leg reads no principals projection (only the shared report → open-investigations id arm) — the subject rides the
admission (subject_person_id), which is the only place a released held admission could still find it. The per-stage FIFO key of decision 9 is taken from the STAGE a record
belongs to, not from the job that staged it, because a report-keyed occurrence spans stages. Decision 1’s dual-site
boot check gained its missing half: the consumer binds every event the matrix declares, since a declared row nobody
bound passes validation and then never fires.
- Anchors
-
epic &87 (children #1826 U0, #1827 U1, #1828 U2, #1829 U3, #1830 U4; the six prerequisite-bound bind issues #1820 WIC, #1821 DOE-SLDS, #1822 IES, #1823 STARS, #1824 SMILE, #1825 TCM; #243 the CPRS anchor closed by U3; #244 closed as superseded), ADR-075 (Proposed at U0), ADR-032 (the adapter registry this extends; amended), ADR-062 (the inbox attempt machine every consumer uses), ADR-065 §D2 (the service-only allowlist-of-one precedent), ADR-063 §D3 (the schema floor the rollout leans on), ADR-067 (the two-path census), ADR-058 (retention classes); prerequisites #1804 (legal status / custody), #1805 (EMPI id), #1806 (GTID), #1807 (Initial Medicaid Application), #1808 (child-support referral decision
NCP), #1809 (SMILE acts), #1810 (TCM claims), #1811 (structured worker names), #1812 (CPRS protocol bridge), #1813 (outbound partner auth); fixes #1814, #1815; follow-ups #1816, #1817, #1818, #1819, #1836 (the db-error lint’s closure form), #1837 (the trigger act bounds + the catch-up lease conflict unasserted), #1838 (trigger DISPATCH legs in the contested census), #1839 (admit / removal TOCTOU + the INV resolve lane split); ⁂ readings on #1073 (CPRS stage identity).
Context
Outbound partner sends are staged MANUALLY today — POST /v1/exchange/send
(services/craig-exchange/src/api/transactions.rs:159-254; callers: craig-cli exchange send, the test-lib; craig-web only
LISTS transactions) — while the catalogued SHINES specs define trigger points SHINES fires automatically. The maintainer’s
2026-09-02 re-scope of #243 / #244: "event-driven legs assembled from cases/placement data via S2S, enabled per partner via
exchange_partners + DSA, dispatched through the existing send-job outbox; the design questions are answered by the
program plan". What the research established:
-
Every target adapter exists as typed wire code (
crates/craig-partner-cprs/src/adapter.rs:62-91— ONECprsInvOngStageDataper send; the ackCprsInvOngAck { transaction_id, person_id, return_code ∈ {0, 300, 301, 305} }). GA registers all eleven; the seven targets areDispatchClass::Generic. Absent: the TRIGGER, the PAYLOAD ASSEMBLY, and the per-recipient state the catalogue calls the OUTBOUND table. -
The legacy CPRS protocol is a PULL over SOAP/XML against SHINES’s
CPRS_CPS_INSERT_OUTBOUNDstaging table (CPRS INV/ONG lines 112, 553); the crate inverted it to a JSON push. The catalogue’s semantics are TABLE semantics: insert on admission, update on change, entry removed so no further updates are sent (156), closure indicator on stage close (170), continuation six months past 18 and after conversion to collateral (118–121), initial pre-population of open stages at release (567), andDT_LAST_UPDATEis NOT provided to CPRS (110). -
The manual path is the reusable staging trio —
claim_first→create_transaction+stage_send_job
publish_exchange_send_requestedin ONE tx (transactions.rs:208-236); the workerclaim_pending(FOR UPDATE SKIP LOCKED, lease 90 s),MAX_ATTEMPTS = 6, backoff[5,5,30,120,300,900],send_valuevia the boot registry; settlement persistserr.to_string()intolast_error/error_message/exchange.failed{error}and logs it; any decoded 2xx is success; the worker’s own doc assumes identical retries (send_worker.rs:36-38). Retention never age-deletes live work. -
The consumer shape is fixed:
subscribe_idempotent(ADR-062,INBOX_MAX_RETRIES = 5) oncraig-exchange.events;case.created/placement.createdare debug stubs;case.assignment_changed(ICPC ownership) andcase.screening_cohort_changed(the SSA watermark + run invalidation) have REAL handlers that must keep running. The mq-consumer census is BLOCKING. -
Per-partner enablement precedent: the SSA worker’s chain (knob → exactly ONE active partner by
adapter_kind→dsa_is_active→ egress).dsa_is_activechecks status + expiration ONLY — notdsa.partner_id == partner.id, noteffective_date; the partner-update guard checks only that the agreement EXISTS;adapter_kindis mutable. -
Facts available vs required (matrix below): CPRS needs case + principals (names, gender plaintext; DOB BlindIndex-encrypted;
case_household;admin_unit→ FIPS) — present; the Primary Case Manager’s NAMES are structured nowhere. WIC requiresempi_id(none), DOE-SLDSgtid(none); IES, STARS, SMILE, TCM trigger on acts CRAIG does not model; four of them on "in DFCS custody", a fact that exists nowhere. -
Events:
case.created,case.closed,case.screening_cohort_changed(no person id, by design),case.intake_created,case.investigation_closed,case.report_person_linked / _unlinked,case.report_persons_auto_linked(the ASYNC link pass after conversion — investigation creation does not wait for it),case.person_updated(id-only). Household removal has no route. -
PII posture:
exchange_send_jobs.payload/exchange_transactions.request_payloadare plaintext JSONB read by two API paths (the web UI lists transactions without them); error columns andexchange.failedecho upstream bodies. The cases-side service-only precedent is the SSN release — allowlist of ONE, the release AUDIT EVENT staged BEFORE responding (ADR-065 §D2 / H21).CasesClientacquires the bearer OUTSIDE its 5 s budget. The mock-server HOST buffers every request; the partner routers are stateless. -
ADR-063 §D3: a migration that bumps
schema_compat_floormakes an OLDER binary refuse to BOOT; it does not stop a running replica.__is the settings nesting separator.
Decisions (recorded in ADR-075; ADR-032 amended)
-
A trigger is registry data; the matrix is bundle-declared.
craig-state-bundlegainsOutboundTriggerSpec { event, interface, leg }and a defaultedStateBundle::outbound_triggers()(theuas_codes()shape; default empty). GA declares the CPRS rows; TX none — nojurisdiction == "georgia"literal in exchange. craig-exchange owns the LEGS (membership resolver + single-record assembler + ack classifier);triggers::Registrykeyed by(event, interface, leg); boot validates dual-site (ADR-032 §1.3): every declared spec has a registered leg whose adapter kind is registered ANDGeneric; an unknown spec fails boot naming the row. -
ADDITIVE dispatch inside the same inbox transaction. Every existing arm stays; after it,
triggers::admit(envelope, tx, ctx)runs for any event type with matrix rows; no rows → today’s no-op; the debug stubs go. Both effects commit or roll back together (each idempotent under retry); a regression test pins the cohort event bumping the SSA watermark AND writing the CPRS admission in one tx. Contested: anchor unchanged; the admission dispatcher gets its own two-path
ordering triple (oracle = the two ledgers). -
Two ledgers, two identities.
exchange_trigger_admissions— ONE row per trigger OCCURRENCE, partner-free:UNIQUE (interface, leg, entity_kind, entity_id, entity_revision TEXT),event_id(the envelope id),status ∈ {staged, held, resolved, dismissed},held_reason,dismiss_reason,partner_id NULL,created_at,resolved_at;ON CONFLICT DO NOTHINGinside the inbox attempt tx (redelivery absorbed by the inbox triple, re-emission by this index; the partner is RESOLUTION, not identity). Transitions:held --release-→ staged;staged --resolve tx-→ resolved(terminal);held --dismiss-→ dismissed(terminal);stagedmeans aresolvejob is pending.exchange_outbound_recipients— the catalogue’s OUTBOUND table per (interface, partner, stage, person):UNIQUE (interface, partner_id, stage_kind, stage_id, person_id),admitted_at,role,dob_year_month(the 18 y 6 m cut-off — no full DOB),removed_at,closed_sent_at,last_correlation_id,last_source_version,last_record_digest— ids, dates, digests only. Both are RECOVERABLE WORK: never age-pruned;heldrows persist until released or dismissed; recipient rows are provenance (archive-then-prune later, #1819). -
Server-owned provenance.
exchange_transactions.origin ∈ {manual, trigger}(DEFAULTmanual) +admission_idFK;exchange_send_jobs.kind ∈ {payload, resolve, record}(DEFAULTpayload) +admission_id,recipient_id,source_version,ordering_key;transaction_idrelaxed to NULL withCHECK kind = 'resolve') = (transaction_id IS NULL(aresolvejob has no transaction; itspayloadis the reference{admission_id};recordandpayloadjobs keep the FK + cascade). Only the worker’s admission path writesorigin = trigger/kind ≠ payload; the late-bound branches key onkind, NEVER onexchange_type.send_exchangeREFUSES anexchange_typematching a registeredTriggerKindtoken (typed 400EXCHANGE_TYPE_RESERVED);originis not wire-settable. -
Consent = per-interface knob + the corrected chain, at admission AND re-bound at every dispatch.
TriggerSettings { cprs: InterfaceTriggerSettings { enabled } }⇒CRAIG_EXCHANGETRIGGERSCPRS__ENABLED=true(default off; the settings test loads that exact string). Chain: knob → exactly one active partner byadapter_kind→dsa_admits(partner, today)— NEW instore/agreements:dsa.partner_id == partner.idANDeffective_date ⇐ todayAND (expiration_date IS NULLOR>= today) on the jurisdiction clock ANDstatus = Active→ dispatch classGeneric. Every failure =held(<reason>)∈ {knob-off,no-partner,partner-ambiguous,dsa-missing,dsa-inactive,dsa-not-yet-effective,dsa-expired,dsa-not-owned,not-generic}. At dispatch the job’spartner_idmust still resolve to an active partner whoseadapter_kindEQUALS the staged interface and whose DSA still admits — else terminalpartner-changed. The SSA worker’s predicate is a pre-existing defect (#1814) and adoptsdsa_admitson its own branch under that issue — not in U2. -
Two job kinds; membership resolves ONCE, in a worker transaction, never in the inbox tx. An admission stages ONE
resolvejob. Its dispatch (ONE bounded S2S read) resolves the CURRENT membership, then in ONE tx: per person admitted by the leg’s rule and absent from the recipient ledger → recipient row + ONE transaction (origin = trigger,exchange_type = "cprs.<leg>",initiated_by = "system",initiated_by_name = "trigger:cprs/<leg>",record_count = 1) + ONErecordjob (reference payload,source_version,ordering_key = "cprs:<stage_id>") +exchange.send_requested; admission →resolved. A crash-repeated resolve converges on the recipient UNIQUE; a child added between the open event and its delayed resolution is admitted ONCE.stage_closedresolves to EVERY non-removed recipient (no age filter) and stampsclosed_sent_at; the admission rule (under 18 on the jurisdiction clock) applies only to NEW recipients; continuation (18 y 6 m, collaterals) rides the recipient row for the deferredprincipal_updatedleg. An empty resolution completesresolvedwith zero transactions — recorded, nothing sent. The admission rule is age AND role: household members in the child roles (child,sibling) and report persons / allegation victims in the child roles (victim, neverreporteror an adult role — the unit pins the exact tokens againstcraig_reference). -
One record per job; late-bound assembly; PII never rests in exchange. A
recordjob: ONE bounded S2S read of the single person record (outertokio::time::timeout(ASSEMBLY_BUDGET = 5 s)around bearer + GET + decode) → the typedCprsInvOngStageDatawithtransaction_id = job.correlation_id(the CPRS wire idempotency field; the genericcraig_correlation_idinjection is dropped by every typed adapter — #1815) →send_value. Lease arithmetic: 5 s + one adapter send (≤ 30 s) + settlement ≪ 90 s. After settlementrequest_payloadstores the reference
source_version+ SHA-256 of the transmitted bytes; the recipient row the digest + correlation. Early assembly is REJECTED: two API read paths render those columns. -
Immutable identity per attempt. The projection returns
source_version(opaque, overpersons.updated_at,cases.updated_at,case_household.added_at); therecordjob pins it; every dispatch re-reads and compares: equal → the SAME bytes under the SAME correlation; changed after an attempt with an unknown outcome → the job is finalizedsupersededand a NEWrecordjob with a NEW correlation is staged in the same tx — the partner never sees payload B under identity A; changed before any attempt → the job adopts the new version. -
Per-stage FIFO, enforced locally.
claim_pendingskips a job whoseordering_keyhas an earlier (by id — UUID v7 order) non-terminal job;resolveandrecordjobs of one stage share the key. Truth-at-resolve covers producer reordering: astage_openedresolve on an already-closed case emits closed records; the laterstage_closedadmission findsclosed_sent_atset. The catalogue’s silence on partner ordering is recorded; a terminal-failed predecessor does not block successors. -
Acknowledgements are classified. Each leg carries
classify_ack(sent, inbound) → Accepted | Rejected(code) | Mismatch; CPRS:return_code = 0ANDack.transaction_id == sent.transaction_idANDack.person_id == sent.person_id→ Accepted;300 | 301 | 305→ terminalpartner-rejected(<code>); an id mismatch → terminalack-mismatch. The decoded-2xx-is-success path stays forpayloadjobs. -
Categorical settlement, every path.
SendFailure { class ∈ {transport, timeout, bad-status, malformed-response, partner-rejected, ack-mismatch, assembly-refused, assembly-unavailable, partner-changed, superseded, retries-exhausted}, status, body_digest }rendersclass[:status] digest=…; that string — never the body — lands inlast_error,error_message,exchange.failed{error}and tracing. PII-echo tests drive a mock echoing a child’s name
DOB in a 4xx body AND a 200 rejection ack and assert every persistence path clean.payloadjobs adopt the same rendering (pre-1.0Changed). -
The cases projection: service-only, allowlist of one, data-minimised, audited per release.
GET /v1/cases/cases/{case_id}/outbound-principals(ONG),GET /v1/cases/investigations/{id}/outbound-principals(INV: the referral’s report persons + allegation victims),GET /v1/cases/cases/{case_id}/outbound-principals/{person_id}andGET /v1/cases/investigations/{id}/outbound-principals/{person_id}(one record, ONG / INV),GET /v1/cases/reports/{report_id}/outbound-stages?interface=(ids of the open investigations reached through the report’s referral — the link legs' resolve step),GET /v1/cases/outbound-principals/open-stages?interface=&cursor=(ids, paged — the catch-up arm).source_version: ONG overpersons.updated_at,cases.updated_at,case_household.added_at; INV overpersons.updated_at,investigations.updated_at,report_persons.linked_at. Each call takes?correlation=&interface=(aresolveread passescorrelation = admission_id, arecordread the job’scorrelation_id) and STAGEScase.outbound_principals_released {entity_kind, entity_id, person_id?, interface, correlation_id, requester, record_count}in its own tx BEFORE responding (ADR-003 row + security parser arm in the same MR). Behindrequire_service_caller()+service_id() == "craig-exchange"(handler const, H21). DOB decrypts under the ADR-048 storage context on the boot-verified path; fields = names, gender, DOB, role, primary_caregiver, active, added_at,source_version; no SSN / race / ethnicity. -
CPRS identity and mapping, ruled now.
stage_id= the case id (ONG,FPR) or investigation id (INV). CPRScase_id=cases.referral_id ?? cases.id(ONG) and the referral id (INV) — ONE immutable identity per SHINES-case analogue (⁂ #1073).county_fips = admin_unit_to_fips(admin_unit, Georgia); gendermale|female→M|F, elseU; DOB from the decrypt. The Primary Case Manager record is OMITTED andprimary_case_manager_person_id = Noneuntil #1811 lands (catalogue rows 72–84, 523 are the recorded coverage gap). -
The CPRS legs. ONG:
stage_openedoncase.created(entity case, rev 0);principal_addedoncase.screening_cohort_changedwithchange = "household"(entity case, rev =cohort_revision; the diff happens at resolve);stage_closedoncase.closed(rev 0); household removal has no route — nothing to bind. INV:stage_openedoncase.intake_created(entity investigation, rev 0);principal_addedoncase.report_person_linkedandprincipal_removedoncase.report_person_unlinked— the payload carriesreport_id+person_idonly, so both admit as(entity_kind = report, entity_id = report_id, entity_revision = link id)and theirresolvejob maps the report to its open investigation(s) through theoutbound-stagesarm (a report with no investigation resolves empty; async auto-links are admitted when they land, no readiness barrier needed); removal stampsremoved_aton the recipient row, NO partner call (catalogue 156);stage_closedoncase.investigation_closed(entity investigation, rev 0). OUT:principal_updated(#1816), merges / splits (#1817). -
Catch-up covers initial population AND the rollout window.
POST /v1/exchange/triggers/catch-up {interface}(admin; CLIexchange trigger-catch-up): walks the open-stages arm (paged) and writesstage_openedadmissions for every open stage without a recipient row — idempotent by both ledgers; one run per interface under an advisory lease; a run record with counts (catalogue 567). -
Held rows are released by an act, in scope.
POST /v1/exchange/triggers/admissions/release {interface, held_reason?, ids?}(admin) re-runs the chain →staged(aresolvejob) or re-held;…/dismiss(admin) marksdismissedwith a boundeddismiss_reason. Countersexchange_trigger_admissions_total{interface,leg,status},exchange_trigger_held_total{interface,reason},exchange_trigger_dispatch_total{interface,kind,class}. -
Deployment sequence. (1) cases image (additive); (2) the exchange migration BUMPS
schema_compat_floorso no older exchange binary can (re)start; (3) roll every replica and verify by the orchestrator’s rollout status that every replica runs the new image digest (CRAIG exposes no build endpoint); (4) run catch-up; (5) flip the knob. Until (5) admissions writeheld(knob-off); events an old stub consumed between (2) and (3) are repaired by (4). Rollback = the newest release whose embedded max ≥ the floor (ADR-063 §D3). -
Production interoperability is a named prerequisite. CPRS pulls SOAP/XML; the crate pushes JSON — #1812; outbound partner auth — #1813. The devstack mock proves the CRAIG side only.
-
Test oracle. The mock-server host gains a devstack-only
GET /_capture?path=&since=(bounded ring buffer)
DELETE /_captureover its existing capture buffer, so end-to-end legs assert transmitted bytes.
Readiness matrix
| Interface | Trigger fact in CRAIG | Payload identifiers in CRAIG | Verdict |
|---|---|---|---|
CPRS INV/ONG |
case / investigation open + close; household cohort; report-person link / unlink |
names, gender, DOB (decrypt), role, county FIPS; case-manager names ABSENT (record omitted) |
BUILD (U2 ONG, U3 INV) |
WIC |
"in DFCS custody" — no legal-status fact |
|
blocked: #1804 + #1805 |
DOE-SLDS |
GTID validated + custody |
|
blocked: #1806 + #1804 |
IES Medicaid |
Initial Medicaid Application act — no model |
client identifiers |
blocked: #1807 |
STARS |
child-support referral "Yes" at the IV-E determination — no decision |
NCP records, per-diem, medicaid class |
blocked: #1808 |
SMILE |
service-authorization / payment-of-care / vendor-contract approval |
client / vendor records |
blocked: #1809 |
TCM |
contact-claim scan — no model |
claim fields |
blocked: #1810 |
Units — each its own MR; the epic is &87
| MR | Scope | W |
|---|---|---|
U0 #1826 |
This page (Active nav), ADR-075 (Proposed), the |
1 |
U1 #1827 |
The cases projection (deploys FIRST): DTOs in |
3 |
U2 #1828 |
The substrate + CPRS ONG |
8 |
U3 #1829 |
ONG |
5 |
U4 #1830 |
Close-out: Status Done, archive, |
1 |
Test matrix (by risk)
-
Boot: undeclared leg / unregistered or non-Generic kind → refusal naming the row; TX boots unchanged; the settings test loads
CRAIG_EXCHANGETRIGGERSCPRS__ENABLED=trueintotriggers.cprs.enabled. -
Admission (
services/craig-exchange/tests/api/outbound_triggers.rs,// @axis:per test):case.created→ one admission
oneresolvejob (happy); the same envelope redelivered / a re-emitted event → still one (replay); knob off →held(knob-off)(sad); zero / two partners →held(no-partner | partner-ambiguous); a DSA owned by ANOTHER partner, not yet effective, expired yesterday, inactive → the fourheld(dsa-*)reasons; cohorthousehold→ the SSA watermark bump AND the admission in ONE tx (regression); manualsend_exchangewithexchange_type = cprs.ong_stage_opened→ 400EXCHANGE_TYPE_RESERVED, noorigin = triggerrow anywhere (evil). -
Resolve + record (real devstack cases + the worker + the devstack mock): two children + one adult → two recipient rows, two transactions, two captured records (
transaction_id == correlation_id,county_fipsfromadmin_unit,case_id = referral_id ?? case_id); no name / DOB inrequest_payload,payload,last_error; a child added between the open event and the resolve → sent ONCE (U3; conc);case.closed→ closure records for every non-removed recipient incl. one now 18 y 2 m; the mock rejecting305→partner-rejected:305with no body persisted; a foreignperson_idin the ack →ack-mismatch; a 4xx body echoing name + DOB → every persistence path clean (evil); cases unreachable via thes2s-client.craig-exchange.casestoxiproxy lane →assembly-unavailable…retries-exhausted, the retry endpoint restages and succeeds once healed (fault); a person edited after an unknown-outcome attempt →superseded+ a fresh correlation (replay); astage_closedjob never claims while the stage’srecordjobs are pending (conc);adapter_kindflipped between stage and send →partner-changed; the case deleted →assembly-refused. -
Catch-up / release: open stages without recipients → admissions once, idempotent on re-run;
heldrows →stagedafter the knob flips;dismissaudited. -
Cases projection: worker bearer → 403; foreign service → 403; craig-exchange → 200 with decrypted DOB
source_version; the release event’s outbox row exists when the body arrives; DTO key set pinned (contract); the INV arm returns report persons + allegation victims. -
Contested: the admission dispatcher’s graceful-close + tcp-reset + ordering-burst legs by name; the widened S2S client.
-
Property:
TriggerKindtoken round-trip; recipient identity equality ⇔ tuple equality;SendFailurerender never contains a byte of the input body.
Verification
Per MR: fmt, clippy, budgets (B1 on send_worker.rs / main.rs; B3 — typed references, ONE serde_json::Value boundary
at send_value), the 22 lints (mq-topology, route-to-client regen, tracing-pii-fields), axis-coverage,
contested-census, check-docs, plan-lint; the pre-push battery. Live probe after U2: seed a case with a household as
dana.county → GET /_capture?path=/partner/cprs shows one record per child with transaction_id = the job’s correlation;
GET /v1/exchange/transactions lists the system rows; knob off → held(knob-off); expire the DSA → held(dsa-expired);
run catch-up twice → idempotent counts.
Rollout
Decision 17’s sequence, per environment; the knob stays off until every replica is new and catch-up has run. Pre-1.0
Changed: the two debug stubs become real consumers; exchange_transactions gains origin / admission_id and
system-initiated rows; last_error / error_message / exchange.failed{error} become categorical for ALL jobs.
Production delivery to CPRS stays blocked on #1812 and #1813.
Risks
PII on a new S2S route — allowlist of one, data-minimised, audited per release, never at rest in exchange (columns, errors, events, logs all pinned). Event floods — one admission per occurrence, one recipient per person. The worker gains a network read — one 5 s outer budget per job inside the 90 s lease. Ordering — enforced locally per stage; partner ordering unknown and recorded. Mixed fleets — excluded by the floor bump; the rollout window repaired by catch-up. Case-manager records — omitted, a recorded gap with a filed prerequisite. Scope — six interfaces wait on domain facts this program names and files rather than fakes.
Rulings (approved 2026-09-12, plan mode)
R1 scope = substrate + CPRS (ONG then INV); #244 split into six prerequisite-bound bind issues and closed. R2 late-bound
single-record assembly with the two ledgers; no PII at rest in exchange. R3 the service-only principals projection with
decrypted DOB, allowlist of one, a per-release audit event. R4 consent = per-interface knob + one active partner
dsa_admits (ownership + both boundaries); HELD rows preserved and releasable. R5 the matrix is bundle-declared, legs live
in exchange. R6 CPRS identity: stage_id = case / investigation id; case_id = referral_id ?? case_id (ONG) / referral
id (INV), immutable, ⁂ #1073. R7 the case-manager record is omitted until a structured worker-name source exists. R8
categorical settlement applies to ALL send jobs (pre-1.0 Changed). R9 the legal-status / custody model and the CPRS
protocol bridge are filed prerequisites, not built here. The maintainer’s 25-finding gate on rev 1 (2026-09-12) was folded
into rev 2 before approval; the fold table is on ADR-075.
Review log
| Round | Vendor | Resolved model | Verdict |
|---|---|---|---|
1 |
Anthropic — one fresh contextless subagent, the four plan-lifecycle questions, over this page + ADR-075 |
Claude Fable 5.1 |
no-ship (2026-09-12) — Q1 conforms, Q3 clean, Q4 readable; six Q2 gaps folded in-plan the same day: the admission state machine ( |
2 |
open — run by the maintainer through another vendor’s model |
open |
open |