ADR-003: RabbitMQ Event Topology
Context
CRAIG services need to communicate asynchronously for domain events (e.g., a case being created triggers placement evaluation, rules evaluation triggers case updates). We needed to design a messaging topology that supports both competing consumers (for DB-mutating handlers) and fan-out (for cache invalidation).
Decision
Use a single topic exchange (craig.events) with service-owned queues and dotted routing keys.
Routing Keys
Events use the format {service}.{event_type}, where the prefix is the OWNING domain rather than
always the binary name (icpc. and ssa. are craig-exchange’s, ruleset. is craig-rules',
authz. is the shared craig-authz crate’s, admin.* is the shared craig-api crate’s,
eligibility.evaluated is craig-cases'), and two keys
carry a dynamic suffix
(ruleset.changed.<name>, composition.invalidated.<jurisdiction>). This catalog is hand-maintained
against the emitters — a new key lands with its row in the same MR (Amendment #1649 below; census
2026-09-03):
-
rules.evaluations_archived(#1129 / ADR-058: rules' fleet-bookkeeping fact — one archive batch ofrule_evaluationsarchived-and-pruned; staged inside the prune transaction. Payload = the batch manifest facts incl. the D9 store identity +archived_by; craig-security validate-then-writes it intoarchive_records(D16 — envelope fields are data, not transport identity; forged/malformed envelopes are refused loudly and land only in the generic audit row). Rules' ownarchive_ledger— not this event — is the authority its orphan GC consults) -
security.archive_completed(REDEFINED by #1129: now marks a REAL archive act — one batch of security’s own audit-class rows archived-and-pruned, payload = manifest facts +archived_by; the pre-#1129 event announced a stale purge_eligible sweep),security.archive_purged(#1129 D15: one expired archive destroyed; carriesuser_id, the purging operator —purged_byuntil #2211) -
rules.evaluated,rules.cache_invalidated,rules.authz_fallback_admit(rules.evaluatedis a pointer payload since #1130 — rule-set identity +evaluation_id+ context, never the input/output documents; the single durable copy is the producer’srule_evaluationsrow; since #1556 it also carriesrule_set_revision, the content-exact identity joining straight torule_set_snapshots. #786:authz_fallback_admitstaged on every craig-rules bootstrap fallback admit; attribution payload, no PII. Since #2330 craig-security recordsrules.evaluatedasevaluateonrule_evaluationwithevaluation_id, and a fallback admit asauthz_fallback_admiton the payload’sresource_typewhen craig-authz knows it (authz_decisionotherwise) with itsresource_id— a create gate’s nil id names no record; both exact families, both NULL before) -
rules.ruleset_promoted,rules.ruleset_rolled_back(#1556 / D2: the operator lifecycle flips of live rule policy, staged on the flip transaction —rule_set_id, name, version,from_revision→to_revision,user_id(the acting operator, feeding the security actor chain),reason, for promote thepreview_idpointing at the persisted canary evidence, and for rollback therestored_revision(the snapshot the content came FROM —from_revisionis the live state it moved off). Security parses them aspromote/rollbackonrule_setwith therule_set_idresolved — never the raw-split fallback) -
rules.ruleset_created,rules.ruleset_updated,rules.ruleset_deleted,rules.ruleset_imported(#2322 — the act records of the four rule-set writes whose only other events are the actor-less cache pair,rules.cache_invalidated+ruleset.changed.<name>; staged byrule_set_acts::stage_rule_set_actin the write’s own transaction, beside its unchanged signals, on the fresh arm only, so a replay stages none. Payload{ rule_set_id, name, version, revision, user_id }:revisionjoins the act to itsrule_set_snapshotsrow anduser_idis the acting worker (spec.actoron the claimed create and import, the acting worker’s sub on update and delete). Audit-only, no consumer binds them: craig-security’sparse_rules_event_typerecordscreate/update/delete/importonrule_setand resolvesrule_set_idthrough therules.ruleset_family) -
ruleset.changed.<name>(ADR-006 / ADR-024 — the rules-side dynamic-suffix key: staged byRulesEngine::stage_ruleset_changednext torules.cache_invalidatedon every rule-set create/update/delete/import and on the #1556 promote/rollback flips; payload{ name, version }. The suffix is the rule-set name, so the craig-authz engine inside every hosting service binds its exclusive queue toruleset.changed.and refreshes ONE cache entry. #810: the interpolation is injection-safe because both API writers ofrule_sets.namerun the strict lowercase-kebabgardebinding — a write-boundary invariant, not a DB CHECK. The signal names no actor by design: each create / update / delete / import’s own record is itsrules.ruleset_act event, #2322, below) -
authz.access_denied(ADR-050 §Amendment #1063 — staged by the craig-authz engine on every EXPLICITPolicyDeniedrow-check outcome, volume-gated by the full-dimension per-emitter aggregate: first occurrence per(sub, resource_type, resource_id, action, ruleset_name, denied_reason)per 60 s window emitskind: "deny"(acting worker undersub,user_roles, resource + action + jurisdiction,ruleset_name/ruleset_version, categoricaldenied_reason,suppressed_priorwhen a prior window closed,aggregate_overflowat cap); drained windows emitkind: "suppression-flush"with the suppressed count on the SAME routing key — consumed by craig-security’s wildcard audit subscriber like the sibling authz events) -
authz.cache_miss,authz.cache_refreshed(ADR-050 / #908 — staged by the craig-authz engine inside EVERY hosting service via its injectedOutboxAuditSink;source_servicenames the emitter. Miss payload: ruleset/jurisdiction/resource-type lookup + acting-worker attribution (subpseudonymous UUID,is_service,service_id— no PII), emitted ONLY on source-attested absence, never onPolicyLoadfaults. Refresh payload: triggerrmq_event|ttl_refresh|boot|warmup|lazy_load+ version diff,new_version: null= upstream eviction) -
admin.events_replayed(#3040 — staged by craig-api’s admin replay (ADR-022 §D4) inside EVERY service that mounts it throughApiServer::router,source_servicenaming the replayed outbox’s service; one act per admitted call, a dry run included, in its own transaction after the re-stage loop:{ from, to, event_type, dry_run, resume_from, matched, re_staged, completed, more, next_resume_from, user_id },user_idthe acting worker, counts and opaque keyset cursors only, never an outbox row’s envelope; a refused call stages none. Audit-only, no consumer binds it: craig-security recordsreplay/event_outboxat batch grain, no resource id) -
case.referral_created(referral_id,admin_unit,response_priority— the jurisdiction ruleset token rolled up at conversion, #1746; was the caller-typedpriority,icwa_flag;user_id— the acting worker, #2277; craig-security resolvesreferral_idthrough thecase.referral_family since #2330, NULL before),case.intake_created(audit-only since § Amendment #1670 — no consumer binds it; craig-security records it ascreate/investigation(the authz token, since #2515;intakebefore) and, since #2330, resolvesinvestigation_id, the investigation the act creates, through thecase.intake_family — NULL before;user_id— the acting worker, #2277),case.investigation_closed(a Phase 3 original alongside the referral/intake pair —investigation_id+ thedispositiontoken +user_id, the acting worker (#2277); ids only; since #648 the token’s value space is the seven NCANDS outcomessubstantiated/indicated/alternative_response_victim/alternative_response_nonvictim/unsubstantiated/unsubstantiated_false_report/closed_no_finding— pre-1.0 wire change,inconclusiveretired),case.investigation_response_deadline_overridden(#1748 / #895 MR-F — the audited response-deadline override, staged in the CLAIMED override transaction beside the row write; the strictcraig-cases-contractspayload:investigation_id,referral_id,user_id(the acting worker),actor_role(the screening-surface token the arm judged),original_due_at(the deadline the open derived — constant across overrides),previous_due_at,new_due_at, the trimmedreason(nullable),rule_set_revision+evaluation_idof the ONE{j}-response-deadline-overrideconsult; audit-only, no consumer — craig-security records it asupdate/investigationand resolvesinvestigation_idthrough thecase.investigation_resource family, which as a side effect also resolvescase.investigation_closed’s resource id — previously NULL), `case.created(case_id,case_number,admin_unit,assigned_worker, nullablesupervisor— #1084;user_id— #2248),case.updated,case.closed,case.plan_created(case_plan_id,case_id,user_id— the draft-plan birth the #821 approve/supersede/update trio follows; thepermanency_goalkey left with the per-case goal in #1995 — a child’s plans ridecase.permanency_plan_established; craig-security audits the four plan events against the plan —create/updateoncase_plan,case_plan_idthrough thecase.plan_family since #2330; the birth recorded the case id before),case.assignment_changed(Plan A §D6 / #1084 / #1214 — the cross-service assignment denormalization:case_id, old/newassigned_worker+ old/newsupervisorUUIDs, and the monotonicassignment_revisionconsumers apply strictly-greater-than; bound by placement, financial and exchange; ids only; since #2248 alsouser_id, the reassigning worker) -
placement.created,placement.activated,placement.ended(placement.activatedis the billing trigger — its payload is the shared typedcraig-placement-contractsDTO both the producer and the craig-financial consumer compile against; #979; since P-B1 U5, #2020, it carries the optionalreplaces_placement_id— present only when the activated arrangement re-records a retracted one (R-B21), omitted otherwise, and the payload stays lenient — on which craig-financial re-anchors the retracted arrangement’s subsidy agreements; since P-B2 U3, #2056, itsplacement_typeis the typed federal setting —foster_family_homeor an (e)(4) token — and the optionalffh_types, the family row’s applying (e)(3) categories, omitted on any other setting, joins it; since #2277 it andplacement.endedalso carry the defaulteduser_id, the acting worker; craig-security’s explicit arms record (create/update/update,placement) and, since #2035, resolveplacement_idthrough the exactplacement.created,placement.activatedandplacement.endedresource families — the generic order took the denormalizedcase_idon the first two, so their rows written before #2035 keep the case id, as audit rows are immutable),placement.home_document_uploaded,placement.home_document_upload_failed(#1251 / ADR-062 §U — staged in the same transaction as the finalize/reap; the failed payload keys onattempt_idand carries the sanitizedfile_nameso reap-path failures name the file, no other PII; #1851 addedcreated_by— the uploader’s sub, a caregiver’s on the portal path — anddocument_typeto the UPLOADED payload, additive keys, so security’s first-present actor walk lands the row on the uploader instead ofsystem; since #2330 the upload iscreateonhome_document(document_id) and the failureupload_failedonfoster_home(home_id), through theplacement.home_document_family — NULL before),placement.education.created,placement.education.updated,placement.health.created,placement.health.updated(the child education/health record lifecycle — Phase 3/4 feature completion, documented only in the archivedplans/archive/case-placement-completion.adoc; commit 914e6a76, pre-issue-numbered work so no#N:education_record_id/health_record_id+child_idon create, the record id on update, and on all fouruser_idthe acting worker since #2248; ids only, no record content; since #2330 craig-security recordscreate/updateoneducation_record/health_recordwith the record id — the raw split’splacement/ NULL before),foster_home.license_expiring,foster_home.license_expired(#1641 — staged by the expiry sweep INSIDE the notice transaction, exactly once per(home, kind, expires_on)via thefoster_home_expiry_noticesledger; payload the typedcraig-placement-contractsFosterHomeLicenseNoticePayload { notice_id, foster_home_id, expires_on, days, created_by }—created_by=systemfor the scheduled pass or the triggering worker’s sub, the key craig-security’s actor chain reads),foster_home.training_expiring,foster_home.training_expired(#1642 — the same sweep, one notice transaction per(home, training type), key(home, kind, expires_on, training_type); payload the typedFosterHomeTrainingNoticePayload { notice_id, foster_home_id, training_type, expires_on, days, created_by }; thetraining_typetoken names the certificate, no person data)placement.caregiver_bound/caregiver_ended/portal_invitation_issued/portal_invitation_revoked/caregiver_identity_enrolled/caregiver_identity_revoked(#1848 / ADR-076 — the caregiver ledger; typedcraig-placement-contracts::caregiverspayloads, ids only, a binding keysfoster_home_idXORkinship_household_id(P-B2 U5, #2058; wasplacement_id), never a code or its hash; attribution: every staff act carriescreated_by= the acting staff sub, the enrolment act carriessub= the caregiver’s own subject and NOcreated_by, so craig-security’s first-present-key walk lands each row on the right principal; since #1877 each key has its own arm and resource family —caregiver_bound/caregiver_endedarecreate/updateonfoster_home_caregiver(binding_id; the craig-authz token since #2888,caregiver_bindingbefore), the invitation paircreate/updateonportal_invitation(invitation_id), the identity paircreate/updateoncaregiver_identity(identity_id); no family reads another id its payload carries, so a binding’s history, an invitation’s and an identity’s are three resource lists; rows written before #1877 keepplacementand a NULL id),placement.portal_read(#1851 / ADR-076 D4, ruling R4 — ONE per ADMITTED foster-portal request on craig-placement, staged after the data read; a refused 403 / 404 emits nothing. Typedcraig-placement-contracts::portal::PortalReadPayload { sub, role, jurisdiction, surface, unit_id? },surface ∈ units | unit | training | documents | document_download | document_upload; ids and tokens only; attributionsub= the caregiver’s own subject and NOcreated_by, so the audit row lands on the foster parent. Since #2249 its own parse arm records actionportal_read(the tokenfinancial.portal_readshares) on resource_typefoster_portal, and the exactplacement.portal_readfamily resolvesunit_id, the unit the request read (theFosterPortalauthz ref’s resource); the units-list read names no unit (NULL). Rows written before #2249 keepplacement/ NULL. Volume note: unlike its neighbours this key fires per READ — one outbox row (30 d) + oneaudit_logrow (90 d hot; archive OFF by default) per portal request),placement.field_proposed,placement.field_proposal_decided,placement.field_written(#634 / ADR-037 §6, ADR-076 D10 — thefoster_home_portalfield-ownership family; typedcraig-placement-contracts::field_ownershippayloads.FieldProposedPayload { proposal_id, surface, unit_kind, unit_id, target_table, target_id, field, field_owner, old_value?, new_value, sub, role, jurisdiction }(unit_kind∈home\|kinship_householdsince #2058), staged in the claimed propose transaction — attributionsub= the caregiver and NO staff key, so the row lands on the foster parent;FieldProposalDecidedPayload { …the same target keys…, decision, proposed_by_sub, approved_by, roles, reason? }, staged in the ONE accept / reject transaction beside the live write — attributionapproved_by= the deciding staff member, the caregiver deliberately underproposed_by_suband neversub;FieldWrittenPayload { surface, target_table, target_id, field, field_owner, old_value?, new_value?, user_id, roles, jurisdiction }, staged in every LIVE staff write transaction (the four PUTs and the four creates) once per governed token whose text changed — attributionuser_id= the acting worker. PII posture: these payloads carry GOVERNED VALUES — a school name, a grade, a visit date, the home’s phone / primary contact, as{field, old_value, new_value}, thecase.updatedkey shape — and never a DOB / SSN column (the six-token roster is pinned against those columns in the contracts crate);placements.*tokens ridefield_writtenonly. Parser posture (#2330): explicit arms keep the three action tokens; a proposal and its decision file underfield_proposal(proposal_id), a write under the record type of itstarget_table(education_record/health_record/foster_home/placement;governed_recordfor any other table) withtarget_id— the raw split’splacement/ NULL before. Volume: one row per caregiver proposal, per staff decision and per governed staff write that changed a value — bounded by editing rates, not by reads). -
placement.afcars_released(P-B1 U2, #2017 — planafcars-placement-captureD6 / R-B11): the AFCARS release audit,craig_placement_contracts::events::PlacementAfcarsReleasedPayload—{ requestor, purpose, child_ids, child_count, from, to, as_of }, strict,requestorclosed atcraig-reportingandpurposeatafcars-2020 federal reporting; catalogued + parsed BEFORE its producer exists (the ADR-057 runbook precedent): P-D’s service-onlyafcars-export(#1965) stages it in its own transaction before answeringno-store. craig-security’s explicit arm records (read,placement); no resource id (children travel as a list); actorsystem(no staff key) -
placement.episode_facts_changed(P-B1 U3, #2018 — planafcars-placement-captureD2): one act on a child’s removal-episode ledgers, staged in the act’s transaction;craig_placement_contracts::events::EpisodeFactsChangedPayload—{ episode_id, child_id, case_id, ledger, row_id, act, user_id }, strict,ledger ∈ removal_episodes | removal_responses | exit_responses | episode_trafficking_statements | trafficking_law_enforcement_reports,act ∈ recorded | corrected | retracted(the open isremoval_episodes/recordedwithrow_id= the episode; an episode retract is ONEremoval_episodes/retracted, also when it retires the episode’s live exit; P-B1 U4, #2019: an exit record isexit_responses/recordedwithrow_id= the new exit, a correctionexit_responses/correctedwith the successor, an exit retractexit_responses/retractedwith the retired row, and a historical episode stages TWO events,removal_episodes/recorded(the episode) thenexit_responses/recorded(its exit); P-B3 U3, #2082: a trafficking statement or report act is<table>/recordedwithrow_id= the new row, a correctioncorrectedwith the successor, a retractretractedwith the retired row; an episode retract that also retires the episode’s live trafficking rows still stages only its ONEremoval_episodes/retracted); ids, the act and the actor — never a fact value. Audit-only, no consumer acts on it: reporting’splacement.*binding receives it and its validator treats it as a no-op; financial binds nothing. craig-security’s explicit arm records (update,removal_episode), resolvesepisode_idthrough theplacement.episode_resource family (the generic order would take the denormalizedcase_id), and the actor ridesuser_id -
placement.cancelled(P-B1 U3, #2018 — plan D3): a planned arrangement cancelled (planned → cancelled), staged in the cancel transaction;craig_placement_contracts::events::PlacementCancelledPayload—{ placement_id, episode_id, child_id, case_id, user_id }, strict. Audit-only, no consumer acts on it: financial binds nothing (a planned row never publishedplacement.activated); reporting’splacement.*binding receives it and its validator treats it as a no-op. craig-security’s explicit arm records (update,placement), resolvesplacement_idthrough the exactplacement.cancelledresource family, and the actor ridesuser_id. U3 removesplanned → ended, soplacement.endedis no longer emitted for a planned row: it now comes only from an active one -
placement.retracted(P-B1 U5, #2020 — plan D3): an arrangement entered in error retracted (active → retractedorended → retracted; the row stays as the record), staged in the retract transaction;craig_placement_contracts::events::PlacementRetractedPayload—{ placement_id, episode_id, child_id, case_id, retracted_from, user_id }, strict,retracted_from ∈ active | ended; ids and the left status only, the retract note stays on the row. craig-financial consumes it: theplacement.endedmoney leg without its end-reason arms — the termination tombstone, then the void of the arrangement’s undisbursed (pending / approved) per-diems withpayments_voided.cause=placement_retracted, identical for both origins; issued and cleared payments stay (follow-up #2041). Reporting’splacement.*binding receives it and its validator treats it as a no-op. craig-security’s explicit arm records (update,placement), resolvesplacement_idthrough the exactplacement.retractedresource family, and the actor ridesuser_id -
placement.recorded(P-B1 U5, #2020 — plan D3): a past arrangement recorded bornended(POST /v1/placement/placements/historical), staged in the record transaction — the act publishes noplacement.created,placement.activatedorplacement.ended;craig_placement_contracts::events::PlacementRecordedPayload—{ placement_id, episode_id, child_id, case_id, started_at, placement_type, ffh_types?, replaces_placement_id?, user_id }, strict,replaces_placement_idpresent only when the record re-records a retracted arrangement (R-B21); P-B2 U3, #2056, addsplacement_type(the federal setting) andffh_types(a family row’s applying (e)(3) categories, omitted otherwise), so craig-financial rolls before placement. craig-financial consumes it and never bills it (no payment, rate or skipped-generation signal): withreplaces_placement_idit re-anchors the retracted arrangement’s subsidy agreements onto the recorded one (financial.subsidy_anchor_replaced, below), without it only logs. Reporting’splacement.*binding receives it and its validator treats it as a no-op. craig-security’s explicit arm records (create,placement), resolvesplacement_idthrough the exactplacement.recordedresource family, and the actor ridesuser_id -
placement.episode_exited(P-B1 U6a, #2021 — planafcars-placement-captureD4, ADR-079 D4): one act on a removal episode’s exit, staged in the act’s transaction after itsplacement.episode_facts_changed— one per exit record, correction and retraction, and one from the historical episode; an episode retract, which also retires a live exit, stages none.craig_placement_contracts::events::EpisodeExitedPayload—{ episode_id, child_id, case_id, arrangement_ids, current, act_id, act_at, user_id }, strict at its top level;currentis the shared lenientcraig_placement_contracts::episodes::EpisodeExit { exit_on, exit_reason }the subsidy-eligibility read also serves — the episode’s live exit AFTER the act,nullafter a retract (exit_onthe exit’s date on the jurisdiction’s business calendar,exit_reasonthe typedExitReason: fleet vocabulary and a date, never PII);arrangement_idsevery live arrangement of the episode — planned, active or ended, never cancelled or retracted — bystarted_at, then id, empty for a historical episode;act_atthe act’sclock_timestamp()under the episode lock andact_ida v7 minted per act, the pair a consumer orders an episode’s messages by. craig-financial consumes it: the #1070 guardianship WARN arms (log-only, no write), keyed bychild_id+arrangement_ids(ADR-056’s #2021 amendment). Reporting’splacement.*binding receives it and its validator treats it as a no-op. craig-security’s explicit arm records (update,removal_episode), resolvesepisode_idthrough theplacement.episode_resource family (the generic order would take the denormalizedcase_id), and the actor ridesuser_id -
exchange.sent,exchange.failed(transaction_id+partner_id; failed addserror) — craig-security audits both against the transaction (exchange_transaction,transaction_idthrough an exact family each since #2249; NULL before),exchange.send_requested(platform-stab-2 §D5 — staged with the transaction’s send claim inapi/transactions.rs:transaction_id,partner_id,correlation_id,user_id(the acting worker,nullon a trigger dispatch; #2277); audit-only, no consumer — emitted for the audit chain by design, no service binds it; § Amendment #1652; since #2330 audited assend_requestedonexchange_transactionwithtransaction_id, per that amendment’s #2330 note),icpc.created(icpc_request_id,case_id,user_id— the acting worker, #2277),icpc.status_changed(icpc_request_id,from_status,to_status,user_id— the acting worker, #2277),icpc.attachment_uploaded,icpc.attachment_upload_failed(#1250 / ADR-062 §U — the ICPC attachment finalizer pair: uploaded carriesattachment_id+icpc_request_id+attachment_type+user_id, the upload attempt’s claimant (#2277); failed keys onattempt_idand carrieserror) — craig-security audits the four against the request (icpc_request,icpc_request_id:create/update, the failed upload asupload_failed) or the attachment (createonicpc_attachment,attachment_id) since #2330, through theicpc.family;icpc.createdrecorded the case id before, the rest NULL -
case.screening_cohort_changed,exchange.screening_run_invalidated(#1467 / ADR-065 D1 rule 2 + ADR-066 — the SSA-screening pair, catalogued + parsed BEFORE any producer exists per D17/H25, the ADR-057 runbook precedent; B6b ships the emitters.screening_cohort_changedis the fork-5 MINIMAL shape —case_id+ the monotoniccohort_revision+ a categoricalchangetoken ∈ {household,screening_identifier} (#3175:screening_identifier— a record, end or retract of a person identifier of the jurisdiction’s screening kind — replacedperson_digest,ssn_clearedandlink_promoted, since the cohort binds the identifier, not the SSN); deliberately NOperson_idand NO SSN digest, person-level tokens are activity-revealing to every queue reader — consumed by craig-exchange’s inbox (watermark GREATEST-upsert → strict<invalidation → sweep) and audited asupdate/screening_cohortso the derived signal never double-counts as a case update. Since #2322 the household add, whose only event this signal was, also stages its own act record,case.household_member_added(below).screening_run_invalidatedcarriesrun_id+ the denormalizedcase_id+reason∈ {cohort_changed,operator_cancelled,freshness_expired}, plus present-onlysuperseded_by_run_id(the fork-3 auto-supersede) and present-onlyuser_id= the relayedrequested_bysub onoperator_cancelledONLY (the fork-1 actor-naming obligation; system variants carry no attribution key). NO sweep counts ride either payload — the DB stamps are the accounting (the ADR-066 as-built posture); audited asupdate/screening_runwithrun_idresolved beforecase_id(the adjustment-family shape)) -
case.household_member_ended(#2460): the act record of ending a case household membership,{ id, case_id, ended_on, user_id }, staged by the end’s claimed transaction beside thecase.screening_cohort_changedit bumps;idis thecase_householdrow anduser_idthe claim’s actor. A replay and a refused end stage neither. -
case.household_member_added,exchange.screening_run_staged(#2322 — the act records of the two screening acts that named no actor: the household add’s only event was a derived signal, and a run start staged none, or on a supersede only the actor-less invalidation of the old run; a replay stages neither).case.household_member_added{ id, case_id, user_id }is staged bylifecycle::stage_household_addin the add’s claimed transaction, beside the P1case.screening_cohort_changed:idis thecase_householdrow,user_idthe claim’s actor (spec.actor); ids only, the cohort signal’s fork-5 minimal posture.exchange.screening_run_staged{ run_id, case_id, user_id }is staged byscreening::stage_fresh_runon every fresh run start; the supersede arm’s actor-lessexchange.screening_run_invalidatedis unchanged. Itsuser_idis the relayedrequested_by: craig-cases forwards the stage under its own service bearer with noX-Craig-Actor, and the allowlisted producer asserts the caseworker as data (theoperator_cancelledposture). craig-security recordscreateonhousehold_member(id, the generic selector;case_householdbefore #2888) andcreateonscreening_run(ssa_screening_runbefore #2888;run_id, theexchange.screening_family); craig-reporting’scase.*binding receives the household key and its validator no-ops on it; nothing else binds them) -
exchange.screening_hold_set,exchange.screening_hold_cleared(#1566 / UD10 — the legal-hold transition pair, staged in the SAME transaction as the run-row flag flip; one event per genuine TRANSITION (a replay of an already-held/already-clear run stages nothing, so the audit trail IS the transition history). Payload:run_id+ the denormalizedcase_id,user_id= the acting admin’s sub (a hold is never a system act — the human-admin-only endpoint gate is the fork-6screening_resumeposture), and the operator-entered boundedreason(the hold’s narrative lives HERE, never on the run row — the flag is a bare boolean, thearchive_recordsprecedent). Audited asupdate/screening_runwithrun_idresolved via theexchange.screening_family; same same-MR parser-arm deploy-order note asssa.jobs_resumed) -
exchange.partner_created,exchange.partner_updated,exchange.partner_deactivated,exchange.agreement_created,exchange.agreement_updated,exchange.agreement_deleted(#2496 — the partner and agreement write acts, which staged nothing before #2496, so a partner endpoint or credential reference set or changed never reached the audit log; the two creates came in its second part). Payload{ id, user_id, fields? }:idthe partner or agreement,user_idthe acting worker (claims.worker_subject(), so a relayed write names the lifted worker), and on an updatefields, the body fields it named, by NAME only, never a value. Each is staged in the write’s own transaction; a refused write (a staleIf-Match, an illegal transition, a repeat delete, a lost race) or an ADR-062 create replay stages none. craig-security recordscreate/update/deleteonexchange_partner/exchange_agreement,idthrough the generic selector; nothing else binds them -
exchange.trigger_admissions_released,exchange.trigger_records_restaged,exchange.trigger_admissions_dismissed(#2496 — the three operator acts over an outbound-trigger backlog, ADR-075 decision 16 and #2427). One per pass that wrote a row, staged in the pass’s transaction; a refused act or a pass that wrote nothing stages none. Payloads:{ user_id, interface, held_reason?, released_ids, still_held },{ user_id, interface, record_class, restaged_job_ids, refused }and{ user_id, interface, admission_ids };user_idis the acting admin (the acts refuse a service and a relay). The dismissal reason stays on the rows, beside the newdismissed_by. Batch grain, thessa.jobs_resumedshape: craig-security recordsrelease/dismissontrigger_admissionandrestageonexchange_send_job, with no singular resource id; nothing else binds them. The arms ship with the producer (thessa.jobs_resumeddeploy-order note) -
exchange.trigger_stages_caught_up(#3001 — the catch-up walk, ADR-075 decision 15). One per walk that opened its run row, staged in the transaction that closes the run,completedorfailed; a walk refused before its run row (an undeclared leg, a held lease, a service or relayed caller) stages none. Payload{ run_id, user_id, interface, stage_kind, status }:user_idthe walking admin, the counts stay on the run row. Batch grain: craig-security recordscatch_upontrigger_admissionwith no singular resource id; nothing else binds it -
exchange.collection_completed(#3188, the collection run). One per run that resolved its partner, staged in the transaction that records the run’sexchange_transactionsrow,completedorfailed; a run refused before it called the partner (an undeclared leg, consent off, a held lease, no admitting partner, a service or relayed caller) stages none. Payload{ transaction_id, partner_id, user_id, interface, leg, status, applied, stale, not_listed, unattributable, failed }:user_idthe admin who ran it, the rest ids, closed tokens and counts; nothing a partner reported is in it. A run the collection schedule started (#3190) carries nouser_id, and its audit header names the system as the actor. craig-security recordscreateonexchange_transactionfrom the audit header; nothing else binds it -
exchange.listing_ended(#3188). One per stamp that ends a recipient row’s listing: its closure staged, or the recipient removed. Staged by the ledger’s two writers of an end (store::trigger_ledgers), in the transaction of the stamp, so no pass ends a listing without it; a stamp that finds the row already stamped stages none. Payload{ listing_id, interface, person_id }, strict (craig_placement_contracts::partner_listings::ListingEndedPayload). craig-security recordsupdateonpersonas the system’s act. craig-placement binds it: it records the ended listing and withdraws the partner reports admitted under it -
placement.education_report_received,placement.education_report_withdrawn(#3188). A partner’s report became, or was confirmed as, a child’s partner-reported education record; and a row stopped being the live one (reason ∈ superseded | listing_ended). Payloads{ report_id, child_id, listing_id, interface, as_of }and{ report_id, child_id, listing_id, interface, reason }, strict (craig_placement_contracts::education_reports): ids, the interface token, a day or a reason, and nothing a partner reported. The actor is the posting service (service:craig-exchange), or the system for a withdrawal on a listing’s end. Audit-only: nothing else binds them -
ssa.jobs_resumed(#1469 / ADR-066 fork 6 — ONE event per operator resume act, staged in the same tx as the fork-6 attempts-reset:user_id= the resuming admin’s sub, the filters as sent (present-onlyreason_filter/run_id), and each re-admitted job with its PRE-reset attempts count. Batch grain — no singular resource id (thepayments_voidedshape); auditedupdate/ssa_screening_job. Categorical only: ids, counts, closed tokens. Deploy-order note: the parser arm ships in the same MR as the producer — safe because the wildcard subscriber’s raw-split fallback records unknown types losslessly; a security instance older than the arm labels rows(jobs_resumed, ssa)until restarted, never drops them) -
case.screening_review_dismissed(#1557 / UD5: ONE event per human dismissal of a screening-review worklist item — the audited decision that new SSA data does NOT warrant re-determination, staged in the dismiss transaction. Payload:item_id,case_id(the audited subject; resolves via the generic selector),user_id(the acting worker), the categoricallatest_reasonthe item carried, and the bounded free-textdismissal_reason(the substance of the decision — no PII beyond what the worker types; the UI labels the field audit-visible). Parsed asupdate/screening_review) -
case.ive_determination_invalidated(#1313 U5b — the LATEST determination’s witness run was invalidated:{ case_id, determination_revision }, the STRICT shared contract incraig-cases-contracts::events, staged by the run-invalidation consumer in the SAME tx as the cases-local marker under the case row lock. Consumed by financial into itsive_invalidated_revisionsSET (both arrival orders converge oninvalidated = true; a duplicate re-stage is a consumer no-op). Ids + revision only — no PII. Parsed asupdate/ive_determination— the arm ships in the SAME MR as the producer (thessa.jobs_resumeddeploy-order note); `eligibility.evaluated’s arm rides U6 with its own producer) -
eligibility.evaluated(a key outside the literal{service}.shape — it predates the convention and financial’s binding is pinned to it, so it is kept, recorded here;icpc.,ssa.,ruleset.andauthz.share the property, see the intro; #1313 U6 — ONE event per witnessed CHILD of a determination act, staged in the act tx after the child verdict row: the STRICT shared contractcraig-cases-contracts::events::EligibilityEvaluatedPayload{ determination_id, determination_revision, case_id, child_id, ive_eligible, ffp_rate, business_date, user_id };user_id(#2323) is the act’s effective actor and the one defaulted field: a pre-#2323 envelope decodes asNoneand auditssystem; financial’s consumer applies it by revision-CAS intoive_child_verdictsand reprices live per-diem rows — the #1054 money fence, opened by the G-C ruling of 2026-09-02. Audited asevaluateby an explicit parser arm, same-MR-as-producer; since #2330 asevaluate/ive_determinationwithdetermination_id(an exact family), the act every per-child verdict belongs to — a verdict has no id of its own, and the row recordedive_child_verdictbeside the case id before) -
ssa.stale_cohorts_invalidated(no producer since #3175 retired the digest-rotation sweep, whose only query read the droppedssa_screening_members.ssn_digest; rows already filed stay inaudit_logas filed. #1489 / ADR-065 fork 4 — ONE summary per executed rotation sweep, staged BEFORE the per-run stamps as the sweep INTENT:user_id= the sweeping admin’s sub,current_version, andrun_ids+count= the CANDIDATE set the operator executed against. Every stamp that follows is a subset of the declared candidates, so a crash mid-sweep can never leave an invalidation without an attributing summary; each stamped run carries its ownexchange.screening_run_invalidatedevent (reasoncohort_changed, nouser_idin its payload; its audit row names the sweeping admin, #3116) as the completion evidence, and a post-crash re-run declares a fresh intent over the remainder. Batch grain, categorical only; craig-security filed it from its audit header asupdate/screening_run) -
financial.payment_created,financial.payment_approved,financial.payment_issued,financial.payment_cleared,financial.payments_voided,financial.payment_voided(#1028 — ONE attributed event per deliberate operator void:payment_id, present-onlycase_id,child_id,created_by= the acting worker’s sub; no money and no reason text — the reason stays on the row),financial.payment_generation_skipped(#1058 / #1359 — aplacement.activatedno-payment fail-safe fired:placement_id,case_id,child_id+ the categoricalreason; staged on the consuming attempt tx, so exactly once per activation envelope; craig-reporting turns it into adata_quality_issuesrow. Since #2057 a non-caregiving activation (planafcars-placement-factsD3: a run, a stay outside care, placed at home) has no caregiver to pay and stages none; a homed caregiving setting the bundle’s rate-class policy leaves unclassed stagesno_applicable_rate, #2056),financial.claim_submitted(user_id— the acting worker, #2277),financial.claim_accepted(#1079 — federal acceptance recorded on a claiming record; ids/period/actor only),financial.adjustment_created,financial.adjustment_resolved(#1078 — the payment-correction pair: ids/actor only,resolution=approved|denied; no reason text, no money),financial.adjustment_deleted(#2496 — a pending adjustment withdrawn: the row is hard-deleted, so this act is its only record;{ adjustment_id, payment_id, user_id }, the withdrawing worker, staged in the delete’s transaction; a refused or race-lost delete stages none; auditeddelete/payment_adjustment),financial.rate_created,financial.rate_updated,financial.rate_deleted(#3001 — the rate-table writes, which kept no actor and staged nothing:{ id, user_id, fields? },idthe rate row,user_idthe acting worker, and on an updatefields, the body fields it named, by NAME only, never a rate or a date; staged in the write’s transaction, and a create replay, a staleIf-Matchor a repeat delete stages none; auditedcreate/update/deleteonrate_table,idthrough the generic selector),financial.claim_generated(#3001 — a fresh claiming record built:{ claiming_record_id, period, payment_type, user_id }, the generating worker, no money (the figures rideclaim_submitted); staged in the claimed build transaction, a replay stages none; auditedcreate/claim),financial.subsidy_generation_completed(payments_voidedis one bulk event per set-based void — voided ids + count +cause(placement_ended|subsidy_reconciliation, #1068 |placement_retracted, #2020 — scoped byplacement_idlikeplacement_ended) with present-only scope keys (placement_id|agreement_id+month), no PII; #953. The three lifecycle events share one payload shape carrying the acting worker’s sub asuser_id; #978 made issue/clear reachable and stopped approval re-emittingpayment_created.payment_created+ the lifecycle events OMITcase_idwhen the payment has none — post-case subsidy rows, #1068.subsidy_generation_completedis one event per generation run: run id, month, initiator kind, the report counters anduser_id(the initiating worker’s sub,systemon the scheduled tick — #2248) — no PII; ADR-053; craig-security files it under the run,run_idthrough thefinancial.subsidy_family, since #2330 — NULL before) -
financial.payment_period_shortened(#3189 — one per per-diem theplacement.endedconsumer cut back to the last paid day, staged in the transaction that shortened it:{ payment_id, placement_id, child_id, case_id, period_start, period_end, previous_period_end, day_count, previous_day_count, returned_to_pending, cause },cause=placement_ended; ids, dates and day counts, no money. craig-security records the system’supdateonpaymentfrom the audit header; nothing else binds it) -
financial.subsidy_agreement_imported,financial.subsidy_import_batch_finalized(#1071 / ADR-057 — the conversion import; the PRODUCER landed with the MR-B surface, the parser deploy-first: oneimportedevent per agreement MATERIALIZED at batch finalize (agreement/child/program/head-status/slot-count/batch/cutover — the source-system record reference deliberately does NOT ride events; it is readable via the records ledger / detail API / web provenance block by authorized operators), and one summary per finalized batch: its counters plususer_id, the finalizing operator (#2248), filed by craig-security under its batch (batch_idthrough thefinancial.subsidy_family) since #2330 — NULL before. No PII in either payload) Since #1787 the imported event also carriesauthority_revision— the administrative-authority family revision that answered the finalizing proof’s floor — present iff the proof was resolved (ADR-074 decision 8). -
financial.subsidy_backpay_batch_finalized(#2224, planbackpay-import-pathU2 — one summary per finalized backpay batch,{batch_id, expected_count, materialized, superseded, user_id}(user_idthe finalizing operator, #2248), no PII; craig-security files it under its batch (batch_idthrough thefinancial.subsidy_family) since #2330 — NULL before; the craig-security parser lands with the producer, which nothing calls until U-AUTHZ (#2225) wires thebackpay_finalizejob) -
financial.subsidy_backpay_batch_aborted,financial.subsidy_import_batch_aborted(#3001 — astagingbackpay or conversion-import batch aborted, which before #3001 kept no actor and staged nothing:{ batch_id, user_id }, the aborting worker, staged in the abort’s transaction only by the call that flipped the batch; an already-aborted replay or a refused abort stages none. craig-security recordsabortonsubsidy_backpay_batch/subsidy_import,batch_idthrough thefinancial.subsidy_family) -
financial.subsidy_agreement_created,financial.subsidy_agreement_transitioned,financial.subsidy_terms_amended,financial.subsidy_review_scheduled,financial.subsidy_review_completed,financial.subsidy_review_rescheduled,financial.subsidy_review_sweep_completed(#1069 M2 / #1095 / #1096 — ADR-054/055/056, the subsidy-agreement lifecycle: ids, status tokens, business dates andcreated_by= the acting worker’s sub; no money, no term content, no notes.subsidy_agreement_createdaddsprogram,effective_from,initial_status,approval_level,client_request_id;transitionedis the new head interval’s{ agreement_id, interval_id, from_status, to_status, business_date }with present-onlyreason_code— emitted by TWO wrappers, see the NOTE below;terms_amendednames the NEWterm_idfirst (the audited resource) +previous_term_id; the three review events carryreview_id+ chain identity (review_type,cycle) and their dates —completedwith present-onlyresulting_term_id/resulting_interval_id,rescheduledwithsuccessor_review_id+new_due_on+ the operationalreason;sweep_completedis one summary per run — mode flags + leg counters +user_id(the executing worker’s sub on a manual execute,systemon a scheduled pass — #2248), no agreement identities; security files it under the run (run_idthrough thefinancial.subsidy_family) since #2330 — NULL before).financial.subsidy_anchor_replaced(P-B1 U5, #2020 — the ADR-052 anchor-replacement amendment): ONE per agreement the re-anchor moves off a retracted placement onto its replacement, staged in the consuming attempt’s transaction ofplacement.activatedorplacement.recorded(whichever carriesreplaces_placement_id); payload{ agreement_id, from_placement_id, to_placement_id, agreement_status, previous_started_on?, placement_started_on?, created_by }—agreement_idfirst (the audited resource), the two dates present only when a pending SG / NRSG agreement’s residence snapshot was re-snapshotted (omitted, never null, on an id-only move), andcreated_by=systemon both paths (the move is an inbound event’s consequence, not a worker act); ids, a status token and dates only, no money. craig-security’s explicit arm records (update,subsidy_agreement) and resolvesagreement_idthrough thefinancial.subsidy_family; the arm rolls in U5’s security step, and a pre-U5 craig-security records the row by the raw split, never dropping it. Reporting routes it past the payment-shape validator -
financial.portal_read(#1852 / ADR-076 D5 — the foster-parent portal’s read audit on craig-financial, the twin ofplacement.portal_read: ONE per ADMITTEDGET /v1/financial/portal/units/{unit}/payments(a 403 / 404 / 503 refusal stages nothing), staged in its own transaction after the data read; payload{ sub, role, jurisdiction, surface, unit_id }withsurface=payments(a closed enum of financial’s own surfaces, never placement’s), attributed to the caregiver’ssub— there is deliberately nocreated_by; ids and tokens only, no money. Recorded by craig-security asportal_readonfoster_portalwithunit_id(its exact family), theplacement.portal_readtwin, since #2330 (the generic split’sfinancial/ NULL before). Volume: one outbox row (30 d) + oneaudit_logrow (90 d hot) per admitted portal request — per-caregiver traffic, bounded by the enrolled population) -
reporting.quality_issue_detected,reporting.afcars_transmitted(no producer since #2180; reserved for the delivery program #1967, whose audit arm craig-security keeps),reporting.afcars_ready_for_transmission,reporting.afcars_export_generated,reporting.ncands_export_generated,reporting.afcars_export_failed,reporting.ncands_export_failed(#1252 / ADR-062 §U — the export-attempt pointer flips and reconciler reaps; generated payloads carryexport_sha256(the delivered file’s digest, never the sealed stored object’s; #2177) + generation +user_id, the upload attempt’s claimant (#2277), failed payloads key onattempt_idand carry the deterministic filename, no PII;reporting.afcars_ready_for_transmission(#2179, P-D4 D4) is the act certifying a submission’s current export —submission_id,reporting_period,export_generation,export_sha256,user_id(the acting worker), no PII; since #2330 craig-security resolves the quality issue’sissue_idand every AFCARS / NCANDS row’ssubmission_idthrough thereporting.family — NULL before — and records every AFCARS / NCANDS arm onafcars_submission/ncands_submissionand the quality issue ondata_quality_issue(the craig-authzResourceTypetokens, since #2515;afcars_report/ncands_report/quality_issuebefore, which older rows keep), keeping the export pairs'exportaction tokens for the bulk-export detection rule;reporting.ncands_transmittedis retired with NCANDS’s marking-only transmit route (#2130): no producer, and, unlike the AFCARS key, no craig-security arm, because no NCANDS delivery program exists to reserve it for) -
security.review_due(review_id,review_type,scheduled_date,user_id— the acting worker, #2248),security.archive_completed+security.archive_purged(rows above, #1129),security.major_change.recorded(change_id,change_type,affected_scope,user_id),security.major_change.reported(change_id,reported_date,user_id— on both, the acting worker, #2248),security.nist_control.created,security.nist_control.updated,security.nist_control.deleted(#2496 — the NIST control-mapping writes, which kept only the row, whoseassessed_byis the caller’s free-text claim, never the authenticated actor:id(the row, the generic selector),control_id, the resultingimplementation_statuson a create or update, anduser_id, the acting worker; staged in the write’s transaction, a refused write stages none; auditedcreate/update/deleteonnist_control. craig-security is the audit store, but its own acts reachaudit_logthe way every producer’s do, through its outbox and the wildcard subscriber, so a row stamp alone is not its audit),security.admin_unit.created,security.admin_unit.updated,security.admin_unit.deleted,security.detection_rule.created,security.detection_rule.updated,security.detection_rule.deleted,security.partner.updated,security.partner.deleted,security.review.updated,security.review.deleted,security.major_change.updated,security.major_change.deleted(#3001 — the admin-unit, detection-rule, partner and review writes and the major-change update and delete, which before #3001 kept no actor and staged nothing (a major-change update staged only thereportedflip):{ id, user_id, fields? }, a major change’s underchange_id(its family’s key),user_idthe acting worker andfieldsthe field NAMES a partial update set, never a value (the admin unit’s whole-row update names none); staged in the write’s transaction, a refused write, a lost version or status CAS, a repeat delete and a create replay stage none; auditedcreate/update/deleteonadmin_unit,detection_rule,partner,security_reviewandmajor_change, the row through the genericidor thesecurity.major_change.family’schange_id),security.alert.created(alert_id,rule_name,severity),security.alert.acknowledged(alert_id,user_id— the acting worker, #1913),security.dlq.threshold_exceeded(ADR-022 §D3 — staged by the DLQ handler exactly when oneevent_type’s dead letters cross `THRESHOLD_PER_HOUR, under a per-type advisory lock:event_type,count,threshold,window). Spelling note (#1649): the four dottedmajor_change./alert.keys were catalogued asmajor_change_recorded/alert_created(underscore) from the start; the emitters have always been the dotted form, and the wildcard subscriber records everysecurity.type, through an explicit arm or itssystem/securitycatch-all arm, so the misspelling never affected delivery; and since #2211 everysecurity.type craig-security stages has an explicit arm (thesystem/securitycatch-all is left to types nothing emits — § Amendment #2211) -
security.worker_admin_unit.assigned(binding_id,worker_sub,admin_unit_id,unit_name,jurisdiction,created_by) andsecurity.worker_admin_unit.revoked(binding_id,worker_sub,unit_name,jurisdiction,user_id) — #1899 / ADR-077 D1: the worker→admin-unit registry’s two audited acts; the actor is lifted fromcreated_by/user_id, the audit resource is thebinding_id(the record the event’s audit header names), and every engine-bearing service’s units snapshot invalidates onsecurity.worker_admin_unit.*(U2). -
security.worker_identity.contact_changed(worker_sub,contact_phone,user_id) — #1857: an admin set or cleared a caseworker’s agency work line throughPUT /v1/security/admin/workers/{sub}/contact, staged in the write’s own transaction (an unchanged value stages nothing);contact_phoneis the NEW value (E.164) ornullon a clear — an agency business line, not client PII (ADR-020/048), carried so the trail shows which number caregivers were shown, when, and who set it; the actor is lifted fromuser_id(the admin), and the audit resource isworker_sub(updateonworker_identity, the worker as the record its audit header names). No consumer binds it. -
case.report_submitted,case.report_disposition_recorded,case.report_attachment_uploaded,case.report_converted(cases owns the report lifecycle per ADR-017;report_convertedcarriesreport_id,referral_id,admin_unit,user_id(the converting worker;converted_byuntil #2211) and the nullableseed_case_id— #1269, the auto-link consumer’s input),case.report_person_linked,case.report_persons_auto_linked,case.report_person_unlinked(ADR-019 — the report↔person link lifecycle:report_person_linkedcarries thereport_personsrow —id,report_id,person_id,role,jsonb_index,user_id(the row’slinked_by,linked_byon the wire until #2211; NULL = system auto-link),linked_at+ ruleset identity;report_person_unlinkedcarries the same row with the link provenance renamedoriginally_linked_by/originally_linked_atplususer_id(the unlinking worker;unlinked_byuntil #2211) /unlinked_at, so the audit trail keeps what the table no longer holds;persons_auto_linkedis the per-convert batch:report_id,referral_id,count,skipped_due_to_ambiguity, and the #1066ssn_promotedCOUNT — never a value),case.report_attachment_upload_failed,case.contact_attachment_uploaded,case.contact_attachment_upload_failed,case.court_order_document_uploaded,case.court_order_document_upload_failed(platform-stab-2 §D4 + #1249 / #1296 / ADR-062 §U — the attachment finalizer pairs: uploaded events carry the entity ids + sanitizedfile_name(+file_size; court-order addsattempt_idfor the pointer-invariant oracle) +user_id, the upload attempt’s claimant (#2277); failed events key onattempt_id(court_order_document_upload_failedoncourt_order_id+case_id) and carryerror) — craig-security audits the report tree against the entity each event is about (#2249, thecase.report_family): the attachment upload underreport_attachment/attachment_id, a link and its unlink underreport_person/ the linkid(create/delete; before #2249casepaired with the link id), and every other report event underreport/report_id(persons_auto_linkedaslink_persons,attachment_upload_failedasupload_failed); since #2330 the contact attachment pair audits ascreateoncontact_attachment/upload_failedoncontactand the court-order document pair asupdate/upload_failedoncourt_order, through thecase.contact_attachment_/case.court_order_families (NULL, or the raw split’scasebeside the case id, before) -
case.plan_approved,case.plan_superseded,case.plan_updated,case.task_created,case.task_updated,case.task_deleted,case.person_created,case.person_updated(cases owns the case-plan / task / person mutation lifecycle; 821 — all carried to theaudit subscriber; person payloads carry no PII; the three task keys audit ascreate/update/deleteoncase_plan_task,task_idthrough thecase.task_family, #2249),case.person_pii_exported(#1064 / ADR-051 — the person-PII READ-audit: requestor service, person-id list,include_full_ssn, purpose; the repo’s first read-access audit event, still zero PII; emitted by FOUR wrappers, see the NOTE below),case.person_screening_release_refused(#3175 / ADR-065, renamed from #1463’scase.person_ssn_release_refusedwith the SSN release it audited — the screening identifier release REFUSED:person_id,identifier_id,requestor,purpose=income_inquiry_screening, categoricalrefusal_reason=identifier_stale,screening_run_id,screening_member_id,requested_by; UUIDs + token only, never a value),case.person_ssn_admin_action(#1064 — SSN verification revoked / SSN cleared, carrying the worker-entered reason toaudit_log; the one person payload with worker-authored text, deliberately kept OUT of tracing logs). Audit (#2032): craig-security files everycase.person_*key under resource typepersonthrough its own arm —person_createdacreate;person_updatedandperson_ssn_admin_actionanupdate;person_screening_release_refused(before #3175,person_ssn_release_refused) arefuse_release(notdeny: its row keepssuccess = true) — each resolvingperson_idthrough thecase.person_family;person_pii_exportedis anexport, so it stays under thedata_exportdetection rule, and resolves no resource id (person_idsis a list). Rows written before #2032 keep the raw split (case, the key’s suffix) and are not rewritten -
case.person_demographics_changed(person_id,row_id,act,user_id),case.child_facts_changed(case_id,child_id,ledger,row_id,act,user_id),case.person_siblings_changed(person_a,person_b,row_id,act,user_id),case.person_parents_changed(child_id,ledger,row_id,act,user_id) (P-C #1991 / #1992 / #1994, ADR-078 D1 — the ledger family events, one per committed act, staged in its claimed transaction:act∈recorded/corrected/retracted/closed(an event ledger has noclosed; a review row a court order’s update or delete retired publishesorder_corrected/order_deleted);ledgernames the table —child_facts_changedcovers the four #1992 window ledgers,child_icwa_facts(#1993),parental_rights_actions(#1994) andchild_review_events(#1995);person_parents_changedcoversperson_parentage_factsandchild_parents. Ids and the act only — never a fact value; consumers re-read the authz-gated ledger. No consumer binds them. craig-security auditschild_facts_changedby the generic split, resource idcase_id(generic); the three person-keyed keys audit asupdateon resource typepersonthrough their own arms (#2032), the person resolved by thecase.person_family (person_id/person_a/child_id);user_id(the acting worker) attributes every act — #2009, closed by #2016),case.permanency_plan_established(P-C #1995, ADR-078 D4 — every act on a child’s permanency plans: the strictcraig-cases-contractsPermanencyPlanEstablishedPayload { event_id, person_id, case_id, action ∈ established | corrected | retracted, plan, established_on, supersedes_id, act_id, act_at, current: { event_id, plan, established_on } | null, user_id },act_atread after the per-case plan lock; a consumer applies the LATEST message per(person_id, case_id)by(act_at, act_id)and discards older ones. A plan token is fleet vocabulary, not PII. No consumer binds it (the placement portal-label projection was dropped, planafcars-placement-captureR-B10); the generic split, resource idcase_id, actoruser_id) -
case.person_residences_changed(person_id,row_id,act,user_id; #3192): one per committed residence-ledger act, ids and the act only. It is audited from the audit header its publisher states (updateonperson, the person named), with no arm of its own in craig-security. -
case.custody_opened,case.custody_closed,case.custody_retracted,case.custody_close_corrected,case.legal_status_changed(#2342 — plancustody-episodes-doe-sldsD3, ADR-081 D4 — one event per custody transition, staged in the act’s claimed transaction by one wrapper whose key isCustodyEvent::routing_key(), a const fn over the fivecraig_cases_contracts::custodyconsts; a replay stages none).craig_cases_contracts::custody::CustodyEventPayload—{ episode_id, child_id, case_id, row_id, act, act_id, act_at, user_id }, strict at its top level; ids, the act token and the act’s instant only — never a status token or an effective date (consumers re-read the authz-gatedlegal_status_facts/custody_episodes);episode_idisnullonly oncase.legal_status_changedfor a history row;row_idthelegal_status_factsrow the transition is about (an episode retract: the episode’s latest live in-custody row);act∈recorded/corrected/retracted/episode_retracted;act_atthe act’sclock_timestamp(), read once after its writes, andact_ida v7 minted per act, both shared by every event of the act — the pair a consumer orders an episode’s messages by. Which act stages which: an openopened; a close_closed; a record withuntil_openedthen_closed, each with its own row’s id; an episode retract, or the retraction of its last live in-custody row,_retracted; a correction or a row retraction that changes a closed episode’s instants or closing token_close_corrected; every other act (a change, a correction or row retraction on an open episode or of an unchanged closed one, any act on a history row)case.legal_status_changed. No consumer in #2342: the DOE-SLDS legs bind the fourcase.custody*keys in a later unit (plan D7); since #1821 craig-exchange binds the fourcase.custody_*keys and bothcase.person_identifier_*keys through the GA outbound matrix (the consumer queue binds every event the matrix names);case.legal_status_changedbinds nothing. Reporting’scase.binding receives all five and its validator treats them as no-ops (validate_case_data’s fallthrough arm). craig-security audits the four `case.custody_keys againstcustody_episode—openedacreate, the rest anupdate— resolvingepisode_idthrough thecase.custodyresource family (the generic order would take the denormalizedcase_id), andcase.legal_status_changedas anupdateofcase,case_idthrough thecase.legal_status_family; the actor ridesuser_id. The arms ship in the same MR as the producer (thessa.jobs_resumeddeploy-order note) -
case.person_identifier_recorded,case.person_identifier_ended(#1806 — plancustody-episodes-doe-sldsD5 — one event per identifier act, staged in the act’s claimed transaction by one wrapper,publish_person_identifier_event, whose key isPersonIdentifierAct::routing_key(); a replay stages none).craig_cases_contracts::person_identifiers::PersonIdentifierEventPayload—{ identifier_id, person_id, kind, act, act_id, user_id }, strict (deny_unknown_fields); ids, the kind token, the act and a v7act_idonly — never the value. A record stagesrecorded(act = recorded); an end and a retract both stage_ended(act=ended/retractedsays which). No consumer in #1806 (the DOE-SLDS legs bind them in U6); since #1821 craig-exchange binds the fourcase.custody*keys and bothcase.person_identifier_*keys through the GA outbound matrix (the consumer queue binds every event the matrix names). craig-security files both as anupdateofperson, resolvingperson_idthrough the existingcase.person_resource family (acase.person_identifier_family would failresource_id_families_are_prefix_disjoint); the actor ridesuser_id. The arms ship in the same MR as the producer -
case.medicaid_application_submitted,case.medicaid_application_retracted(#1807 — planpartner-auth-medicaid-applicationD7 — one event per Medicaid application act, staged in the act’s claimed transaction by one wrapper,publish_medicaid_application_act, whose key isMedicaidApplicationAct::routing_key(); a replay stages none).craig_cases_contracts::medicaid_applications::MedicaidApplicationEventPayload—{ application_id, child_id, case_id, episode_id, act, act_id, act_at, user_id }, strict (deny_unknown_fields); ids, the act token (submitted/retracted), a v7act_idand the act’s instant (act_at= the row’ssubmitted_aton a submit, itsretired_aton a retract) only — nevercitizenship_status,prior_medical_assistanceorlegal_admin_unit. No service may read the application routes (every one isdeny_pure_service); TP-3 owes a service read. A submit stagessubmitted; a retract stages_retracted. No consumer in craig-exchange, the only service that would act on them: it binds only its explicit keys and the keys its trigger matrix declares (services/craig-exchange/src/lib.rs,inbox_routing_keys) and no matrix row names these, so a later subscription never sees earlier publications — the IES bind (#1822, TP-3) namescase.medicaid_application_submittedas its trigger and owes an idempotent backfill of every application submitted before it. Reporting’scase.*binding (services/craig-reporting/src/main.rs) receives both and treats them as no-ops (validate_case_data’s fallthrough). craig-security audits them: it files `_submittedas acreateand_retractedas anupdateofmedicaid_application, resolvingapplication_idthrough thecase.medicaid_applicationresource family (the generic order would takecase_id; the payload has noid); the actor ridesuser_id. The arms ship in the same MR as the producer. -
case.medicaid_application_report_received(#3193 — one event per partner report stored on a Medicaid application, staged in the write’s transaction bypublish_medicaid_application_report_received; a report that is a replay, names no application or meets a retracted one stages none).craig_cases_contracts::medicaid_application_reports::MedicaidApplicationReportReceivedPayload—{ report_id, application_id, child_id, case_id, kind, interface, exchange_transaction_id, received_at }, strict (deny_unknown_fields); ids, the kind token (receipt/outcome) and the partner interface only — never the partner’s reference, case reference, program id or status. No consumer acts on it: reporting’scase.*binding receives it as a no-op. craig-security audits it as anupdateofmedicaid_application(the header’s record isapplication_id) by the service that posted the report, which the route admits only as craig-exchange. -
security.partner.created,security.partner.key_issued,security.partner.key_revoked,security.partner.signer_key_registered,security.partner.signer_key_approved,security.partner.signer_key_revoked(security owns partner identity + signer keys per ADR-018;partner_id+kind/key_id/signer_key_id+kid, and the actor ascreated_by/approved_by/user_id— a revocation’s, #1913) -
composition.invalidated.<jurisdiction>(ADR-035 — craig-composition’s cross-replica cache invalidation, the second dynamic-suffix key: staged bystage_invalidationin the same transaction as the override write; payload{ instance_id, jurisdiction, surface, role, user_sub }— the emitter’s self-skip id plus the scope the subscriber needs for the eviction blast radius. Every replica binds an exclusivecomposition-cache.{uuid}queue to its OWN jurisdiction’s key, so cross-jurisdiction events are filtered at the broker. It names no actor by design: the write’s own record iscomposition.override_written, #2322, below) -
composition.override_written(#2322 — an override write’s act record, staged bywrite_support::stage_write_eventsin the write’s own transaction beside its unchangedcomposition.invalidated.<jurisdiction>. Payload{ id, jurisdiction, surface, layer, user_id }:idis the writtencomposition_overridesrow,layerisjurisdiction_live,roleoruser(a Studio write or a self-service personalization; one key covers both theIf-None-Match: *create and theIf-Matchreplace), anduser_idis the acting worker. Nouser_sub: on the user layer the actor is the scope. Audit-only: craig-security recordsupdateoncomposition_overridewithidthrough the generic selector; no service binds it, craig-composition’s replicas bind onlycomposition.invalidated.<jurisdiction>)
Three catalogued keys are emitted by more than one wrapper with DIFFERENT payload shapes, so a
consumer must branch on the discriminator, never on the key alone. case.person_pii_exported (its first
wrapper, publish_person_pii_exported — the persons/federal-export read-audit — was removed with the route
in #1990) — publish_person_pii_released_for_screening (#3175, replacing #1463’s SSN release —
the screening identifier release: a one-element person_ids, include_full_ssn: false,
purpose = income_inquiry_screening, plus identifier_id, screening_run_id, screening_member_id,
requested_by), since
#1827 (ADR-075), publish_person_pii_released_for_outbound (the outbound-principals projection’s release audit:
a person_ids list, include_full_ssn: false, purpose = outbound_principals, requestor = craig-exchange, plus
interface, correlation_id — the requesting exchange job’s — stage_kind, stage_id) and, since #2121 (plan
afcars-pipeline-sources D5), publish_person_pii_released_for_afcars (the AFCARS persons export’s page audit: person_ids with
person_count, date_of_birth_person_ids, include_full_ssn: false, purpose = afcars-2020 federal reporting,
requestor = craig-reporting, plus from, to, as_of) and, since #1806 (plan custody-episodes-doe-slds D5),
publish_person_pii_released_for_reveal (the identifier reveal’s audit, staged and committed before the value is decrypted:
a one-element person_ids with person_count, include_full_ssn: false, purpose = person_identifier_reveal, plus identifier_id, kind
and the revealing worker as user_id; no requestor) and, since #3192,
publish_person_pii_released_to_index (the audit of a release to the jurisdiction’s person index, staged and committed
before the index is called: a one-element person_ids with person_count, include_full_ssn: false, purpose =
person_index_match, person_index_registration or person_index_participation, plus case_id and the acting worker as
user_id; no requestor, no fact that was sent and nothing the index answered), all five
in services/craig-cases/src/events.rs. financial.subsidy_agreement_transitioned —
publish_subsidy_agreement_transitioned (services/craig-financial/src/events.rs, the human mutation surface; created_by = the
acting worker’s sub) and publish_subsidy_sweep_enforcement (services/craig-financial/src/payment_events.rs, the #1096 sweep
legs; adds run_id and, on leg-1 suspensions, trigger_review_id; created_by = system or the
executor’s sub). The third, authz.access_denied, carries two kind`s (`deny / suppression-flush)
from build_access_denied_event / build_access_denied_suppressed_event in
crates/craig-authz/src/audit.rs, recorded in its own row above.
|
Wildcard Audit Subscriber
craig-security binds the queue craig-security.events to craig.events with routing key # — every event published to the exchange is written to the audit_log table by a single subscriber.
This is the mechanism through which CRAIG achieves audit coverage for all domain mutations without per-service wiring.
See Architecture — Cross-cutting Service Contracts for the wider pattern.
Consumer Patterns
(Retitled from "Queue Types" by the #1198 amendment below — "queue type" now unambiguously means the RabbitMQ classic/quorum/stream property, not the consumer pattern.)
-
Competing consumer queues (e.g.,
craig-cases.events): Shared across all instances of a service. Each message is delivered to exactly one consumer. Used for DB-mutating event handlers. -
Exclusive queues (e.g.,
craig-rules.cache.{uuid}): Per-instance, auto-delete. Every instance receives every message. Used for cache invalidation.
Rationale
-
Single exchange: Simplifies topology. Topic routing provides flexible filtering without creating per-service exchanges.
-
Service-owned queues, operator-owned exchanges: Each service declares its own queues and bindings on startup. The exchanges (
craig.events,craig.dlx) are provisioned by the operator (definitions.json/ management API), NOT declared by services — see Amendment #1202. -
Competing vs exclusive: This dual-queue pattern supports horizontal scaling. DB mutations must be processed once (competing); cache invalidation must reach all instances (exclusive).
-
Why not direct exchange: Topic exchange supports wildcard routing (e.g.,
case.*) which may be useful for future audit/logging consumers. -
Why not pub/sub (fanout): Fanout doesn’t support selective subscription. Topic exchange provides both fan-out (exclusive queues with
#binding) and point-to-point (competing queues with specific bindings).
Consequences
-
Services must handle idempotent event processing — messages may be redelivered on connection failure.
-
Event consumers are best-effort — publishers do not wait for consumer acknowledgment.
-
Adding a new event type requires no infrastructure changes — just publish with a new routing key and bind consumers.
Amendment — #1198 (2026-07-29): queue-type & delivery-limit contract (epic &75 C4)
Nothing previously pinned the RabbitMQ queue type (classic vs quorum vs stream). The fleet’s
redelivery semantics — the client 2-strike nack ladder, the #1181 x-death token grammar
(ADR-022), and the planned #1197 parking
tier — all assume classic queues with no broker-autonomous redelivery bound, which was
default-behavior-in-absence-of-config, not an invariant: RabbitMQ 4.x quorum queues default
delivery-limit = 20 (breach → drop, or DLX if configured — the DLQ deliberately has none, so
a quorum DLQ would silently drop forensic records), and a one-dropdown vhost
default_queue_type changes what type-omitting declarations get.
Decision
-
Every CRAIG-declared queue is classic, with an explicit
x-queue-type=classicargument — the production choke-point (SubscriptionSpec::prepare_queueviaqueue_args, all three subscribe variants) and the in-tree test helpers (EventCollector,DlxCollector). The complete argument table per role is unit-pinned by full-table equality, sox-delivery-limit(or any other arg) can never appear silently. -
Delivery limits: a quorum-queue feature classic queues do not implement — type enforcement transitively neutralizes delivery-limit policies. The machine-checked invariant is the queue type; the no-limit posture follows from it. Residually an operator convention (devstack ships no
policies; the deployment guide prohibits delivery-limit or queue-type-affecting policies/operator-policies). It is NOT runtime-enforced — services hold AMQP credentials only, no management API — and this ADR does not claim otherwise. -
Quorum migration is a named future gate: only with broker clustering, and only through a new ADR that revisits together the #1181
x-deathcountgrammar, at-least-once dead-lettering, and the delivery-limit posture.
What the explicit argument actually buys
RabbitMQ 4.x resolves and compares the queue type on every declare even when the client omits
it, so the redeclare-conflict 406 largely pre-exists. Explicit classic adds: (1) immunity to a
vhost/node default_queue_type at fresh declare — the real silent-loss hole; (2)
independence from broker-version-dependent type-injection behavior; (3) auditable intent in the
stored queue arguments.
Enforcement layers
-
A — declare-time: the eager first session means a conflicting pre-existing queue fails the service boot with 406
PRECONDITION_FAILEDnamingx-queue-type. -
A′ — runtime: the reconnect path classifies AMQP 406 into an
error!-level "operator action required" log (generic about queue-vs-exchange — exchanges are declared before queues and 406 is not type-specific) while preserving retry-forever (#1127). Degraded mode is deliberate: the service stays up and loud;readyzreflects the publisher path only. -
B — source lint: a
clippy::disallowed_methodsentry (clippy.toml, 2299): declarations only incraig-mq’s Subscriber fns (each through the one `[expect]-sanctioneddeclare_queuehelper), craig-test-lib, and test code. It does not prove declarations carry the type;queue_args+ its unit pins do, inside the boundary. -
C — devstack pins:
rabbitmq.confsetsdefault_queue_type = classic(node) andquorum_queue.property_equivalence.relaxed_checks_on_redeclaration = false(load-bearing: relaxing it makes the broker ignorex-queue-typeon redeclare — a subscriber would silently consume from a quorum queue);definitions.jsonpins the/vhost metadata DQT (canonical exported nested-metadatashape). Definitions import never overwrites existing broker state — the devstack broker is volume-less, so drift is cured by container recreation; the live remedy israbbitmqctl update_vhost_metadata / --default-queue-type classic.
Rollout & residuals
-
4.x-born queues store the injected classic type, so the explicit-classic redeclare is equivalent — no queue wipe, no operator action on sanctioned brokers (live-pinned for both durable arg shapes). Residual: queues first declared on pre-3.13 brokers and upgraded in place may 406 at boot; the deployment guide carries the symptom and the shovel/drain remedy.
-
The exclusive fan-out variant’s explicit type is hygiene, not enforcement (uuid-named, live collision is 405, quorum structurally impossible for exclusive queues).
-
Crash-path residual — RETIRED by #1203 (2026-07-30): a handler panic no longer unwinds the supervisor. Every user-handler path (events, DLQ, inbox) runs inside a per-delivery task boundary that converts UNWIND panics to the normal failure ladder (2-strike nack /
TransientParkcapture / inboxerror_countstamp) — thedlq_handler_panics_total{path}counter is the code-defect tell. Unwind-only:panic = "abort"builds are not contained (the workspace is unwind-everywhere). -
Broker permission separation (per-service credentials) landed as Amendment #1202 (below) — the single administrator credential this amendment inherited is retired there.
-
Live pins:
crates/craig-mq/tests/queue_contract.rs(DQT-vhost, node-default, both conflict tripwires, both rollout shapes, mid-life drift loudness).
Amendment — #1197 (2026-07-29): parking + quarantine companion queues (epic &75 C3)
ADR-059 adds two durable classic queues per
DLQ subscription, declared through the same craig-mq choke-point the #1198 amendment pins
(classic-only argument tables; the clippy::disallowed_methods boundary applies (#2299)): {queue}.parking — a
plain holding queue consumed by the client-driven replayer (prefetch 1; NO TTL or DLX
arguments, so no redeclare hazard ever) — and {queue}.quarantine — terminal, no consumer,
operator-drained per the deployment guide’s manual-ack replay procedure. Both are published
to via the DEFAULT exchange with publisher confirms + mandatory + persistent delivery; no
broker-managed dead-letter hop exists anywhere in the retry path (classic-queue
dead-lettering is best-effort — rejected as a return leg by ADR-059’s review). Production
footprint: craig-security.dlq.parking / craig-security.dlq.quarantine. The deployment
guide’s policy MUST-NOTs are extended by #1197 (message-ttl, max-length,
max-length-bytes, expires — which would DELETE the consumer-less quarantine queue —
and destructive overflow on craig* queues).
Amendment — #1202 (2026-07-30): operator-owned exchanges + per-service credentials (epic &75 addendum)
Two coupled changes retire the shared single-credential posture this ADR shipped with.
Operator-owned exchange topology
Services no longer declare exchanges. craig_mq::declare_dlx and the open_channel
exchange declares are removed (pre-1.0, no shims); craig.events and craig.dlx are
provisioned by the operator (devstack/rabbitmq/definitions.json; production per the
deployment guide). Reason: a service that declares an exchange needs configure on it,
and configure includes DELETE — a compromised service could delete/redeclare
craig.dlx and silently suppress forensic delivery without ever touching the DLQ,
falsifying ADR-022's #1181 bound.
Recovery-semantics change (deliberate): a WIPED broker is no longer silently self-healed. Boot fails loudly; the mid-life session rebuild retries the bind under the #1127 supervisor backoff (promoting that 404-at-rebuild to the operator-action-required error class is #1210). The old silent redeclare masked the data loss a wipe implies.
Per-service least-privilege credentials
Ten accounts replace the one shared craig administrator: craig keeps
administrator as the operator/management-plane identity (no service connects as it),
craig-test is the broad AMQP test identity (no tags), and eight per-service accounts
are each scoped by anchored regex (RabbitMQ patterns are substring matches — anchors
mandatory) to their own queues plus the shared exchanges they use. The exact triples
are devstack/rabbitmq/definitions.json (the executable spec) and the deployment
guide re-renders them with the rabbitmqctl forms + the ordered cutover/rollback
runbook.
Accepted bounds (named, not silently accepted):
-
craig-security’s `amq.defaultwrite is write-anywhere-via-default-exchange for the audit principal — per-queue default-exchange scoping is inexpressible; a dedicated capture exchange is future work. -
Injection residuals: any service may publish any routing key to
craig.events(event forgery) and anydlq.*key tocraig.dlx(forensic-record forgery). Topic permissions are the future hardening; the residual is recorded now. -
Events-plane eavesdropping: any service may bind any routing key on
craig.events. -
Enforcement line:
readoncraig.dlxappears only in `craig-security’s set — "only craig-security reads `dlq.*`"; delete-on-shared-exchanges is denied fleet-wide.
Devstack honesty posture: devstack credentials are a FUNCTIONAL ACL FIXTURE, not a
containment boundary — the port binds the host, passwords equal the account name and are
public, craig/craig-test retain broad rights on the operator/test plane. Production
gets generated secrets, network restriction, and no craig-test analogue. The devstack
broker is rabbitmq:4.2-management-alpine; the 4.3.1+ passive-declare ACL is not yet
enforced, so the grants are forward-compatible, never relied on as current enforcement.
Live pins: crates/craig-mq/tests/broker_permissions.rs (the mgmt-exact fleet pin
against definitions.json + the least-privilege probes, incl. both exchange_delete
403s) and the empty-vhost bind-refusal pin in queue_contract.rs.
Amendment — #1186 (2026-07-31): readiness scope superseded in part (epic &76)
The recurring statement "`readyz` reflects the publisher path only" (Enforcement layers A′
above, echoed in the craig-mq module doc and shared-crates) is superseded in part by
ADR-061, whose epic-&76 implementation
CHANGES /readyz to gate on the publisher connection (the pre-#1186 Extension wiring never
delivered it — readiness has been DB-only) AND on registered critical-worker liveness, so a
subscriber SUPERVISOR’s death will gate readiness once the program’s U2 lands (the ADR-061
plan’s Status table is authoritative for what has shipped). Unchanged either way: the #1127
self-heal semantics inside a live supervisor (reconnect-forever, degraded-and-loud) — a
reconnecting subscriber does NOT flip readiness; only the supervisor task dying does.
Amendment — #1528 (2026-08-20): AMQP establishment carries a liveness bound
"Retry-forever" (Enforcement layer A′) presupposes the retry loop keeps ticking. It did not.
lapin is constructed with ConnectionProperties::default(), and no connect, handshake, or
per-RPC timeout exists anywhere in the client. The AMQP URL is not an escape hatch either:
amq-protocol-uri parses a ?connection_timeout= query parameter, but the async TCP path never
reads it. Nor does the heartbeat cover the gap — lapin arms the heartbeat timer only on
StartHeartbeat, i.e. after Tune, so before the handshake completes no timer exists at all
(afterwards there is a ~4×(heartbeat/2) killswitch, far above any liveness budget). A
broker path that accepts TCP and never answers (a half-open NAT/LB entry, a paused or wedged
node, a saturated proxy hop) therefore parks the awaiting task indefinitely. The
#1141 shield in reconnect() raced only the shutdown token, and a running service never fires
it, so ONE black-holed rebuild pinned the #1127 supervisor permanently: the capped-backoff
ladder never got another tick, subscriber reconnected never logged, and the queue silently
accumulated behind a service that stayed up and — per A′ — stayed "ready".
Every AMQP operation that would otherwise park a long-lived task now runs under the crate-level
AMQP_LIVENESS_TIMEOUT (15 s) via one bounded_amqp helper — one bound, applied at every such
site rather than a fix at the one that was observed. (Every site today; nothing structurally
prevents a future unbounded Connection::connect, so this is review-enforced, not
compiler-enforced.)
| Bounded site | Task it would otherwise pin |
|---|---|
|
the #1127 consume supervisor + both eager boot builds ( |
|
the ADR-059 §D4 DLQ parking replayer |
|
the #1199 DLQ depth sampler (a parked tick loop freezes the gauges at their last value, and a stale depth gauge reads as a healthy queue). The sampler REUSES its connection across ticks, so its realistic black hole is a mid-stream one — the channel open is as exposed as the dial |
|
every service’s boot publisher connect — now a loud failure instead of a startup that hangs with no error and no readiness |
The bound wraps the WHOLE establishment, not just Connection::connect: once the TCP handshake
completes, a black hole that starts mid-stream parks queue_declare / queue_bind /
basic_consume identically, and there is no per-RPC timeout either.
Two contracts hold the amendment together. First, expiry maps to a TimedOut I/O error, which
lapin::Error::is_io_error classifies TRANSIENT — so log_rebuild_failure keeps its warn!
arm and the ladder retries; the operator-action error! arm stays reserved for the 406/404 that
retrying can never clear (layer A′, #1210). That chain is driven end-to-end rather than inspected
— an_expired_establish_lets_the_backoff_ladder_tick_again runs the real reconnect() against a
black-holed listener and asserts from the supervisor’s own narration that the delay ADVANCES past
the expiry and that no operator-action arm was taken. Second, 15 s sits between the crate’s single-RPC
bounds (SETTLE_TIMEOUT 5 s, CONFIRM_TIMEOUT 10 s — unit-pinned as a floor, since a session
build is several RPCs) and the contested suite’s 90 s reconnect-barrier floor
(craig_test_lib::fault::mq_sever::RECONNECT_DEADLINE), at no more than a third of the latter:
one stalled establish costs at most a third of a recovery envelope instead of all of it. That is
an ordering pin and not a budget — it does NOT say how many attempts fit, and the arithmetic that
would is wrong, because it omits the backoff: past the ladder’s 30 s cap, one stalled attempt
plus one cap-length wait is 45 s, so two fill the barrier exactly. Sizing the barrier against a
contested ladder remains the harness’s job (#1509); the bound’s job is that a stall costs one
tick rather than every tick. The ordering is itself pinned
(transport_faults.rs, no broker required) — neither
crate’s own unit tests can hold an invariant that spans both. The second-order effect is
accepted deliberately: an establish that legitimately needs more than 15 s now fails and
restarts the ladder, i.e. a retry inside the same recovery envelope rather than a park outside
every envelope.
Deliberately NOT bounded: the consume loop’s wait for the next delivery (idling on an empty
queue is correct, not a stall). #1531 closed the residual settle/publish gaps: EVERY settle —
the inline ack, all five nacks, the post-capture acks — is bounded by SETTLE_TIMEOUT (a hang
maps to the transient TimedOut class, ends the session as SettlementFailed, and the
supervisor rebuilds instead of the delivery loop parking behind an accept-and-stop-answering
broker path); every basic_publish SEND (both Publisher paths and the capture/replayer
primitive) is bounded by AMQP_LIVENESS_TIMEOUT, with the recorded classification: an expired
send stays RETRYABLE (PublishError::Amqp carrying TimedOut; the capture arm’s Failed) —
the broker may have accepted the frame, and the confirm layer plus the consumer-side inbox
dedup own the resulting duplicate.
The cost: since #1530, zero stranded threads. lapin spawns its lapin-io-loop OS thread
before the handshake completes and exposes no cancel-safe teardown; under the original #1528
timeout-and-drop posture each abandoned attempt stranded one thread on the black-holed socket
until the peer closed (measured: exactly +1 per attempt, reaped ≤3 s after peer close).
connect_owned removed the strand outright: craig-mq dials the TCP socket itself (bounded — no
lapin machinery exists yet), hands the connected stream to Connection::connector through a
single-shot cell, and holds a dup’d fd in a SocketReaper across the handshake — when the bound
expires, or ANY outer bound drops the future mid-handshake, the reaper’s Drop shuts the socket
down and the io-loop reads an error and exits immediately.
owned_connect_strands_no_io_loop_threads is the regression contract on BOTH kill paths (own
expiry; outer drop) — it counts lapin-io-loop threads by name and requires ZERO after each
abandoned-attempt volley while the peer STILL holds the socket. The AMQPS scheme falls back to
lapin’s own dial under the same bound (no deployment terminates TLS at the client today) and
keeps the old strand-until-peer-close cost — recorded, not hidden. The contract reads
/proc/self/task and is therefore cfg(target_os = "linux"): it holds on CI and on Linux
workstations, and is simply absent elsewhere — the cost claim is unverified on a non-Linux dev
box, not asserted there.
Pre-1.0 behavioral change: against an unreachable-but-accepting broker, a service boot now fails after 15 s where it previously hung indefinitely.
Amendment — #971 (2026-09-03): placement.requested retired without a producer
The routing key placement.requested left this catalog without a producer ever having
existed in a form a consumer could act on. Its one emitter — the matching GET in
craig-placement — reused child_id as a case_id placeholder and never carried a
placement_id, so the rules-engine arm that keyed on placement_id resolved its subject to
None on every delivery: no placement-matching evaluation was ever triggered from the wire.
#837 deleted that emitter (a GET performing a DB write); the consumer side lingered as a
dangling binding.
#971 retired the consumer half. craig-rules no longer binds craig-rules.events to the key
(DOMAIN_EVENT_BINDINGS is exactly case.intake_created, unit-pinned) and its
evaluation_target arm is gone; craig-security’s audit parser dropped the explicit
create/placement_request arm — a stray envelope now lands through the raw-split fallback
as requested/placement, recorded losslessly (unit-pinned so the retirement stays visible).
The placement-matching rule set itself is untouched and remains evaluable on demand via
POST /v1/rules/evaluate; craig-placement’s matching regression test still asserts the GET
stages no outbox row, now against the lifecycle catalog rather than the retired key.
The alternative — a real producer staged from the placement create/activate path — was weighed and declined: it would be NEW product behaviour (an event-driven matching evaluation nobody specified), not a repair. If placement requests ever become a workflow in their own right, that is a product decision to raise then, and it starts with the producer and its payload contract, never with a binding.
Ops note: a durable queue keeps the bindings it was declared with, so a broker that predates
this change carries a stale placement.requested binding on craig-rules.events until the
queue is recreated (the devstack wipe does it) or an operator unbinds it. It is inert —
nothing publishes the key — and the consumer-before-producer deploy-order rule is not engaged
because there is no producer.
Amendment — #1649 (2026-09-03): catalog reconciled against the emitters; hand-maintained by rule
A census of every emitted routing key — every domain_event! invocation and every hand-written
stage_json_event / EventEnvelope::new staging site across services/*/src and
crates/craig-authz, consts resolved to their literals (PLACEMENT_ACTIVATED, PLACEMENT_ENDED,
ELIGIBILITY_EVALUATED, CASE_IVE_DETERMINATION_INVALIDATED, PaymentTransition::event_type), tests
and test-support excluded — found 109 distinct keys (the two dynamic-suffix families counted once
each) and four kinds of drift in the catalog above, all corrected in this amendment:
-
Missing rows — 31 emitted keys had none:
case.investigation_closed,case.plan_created,case.assignment_changed,case.person_ssn_release_refused, the ADR-019 report-person link trio, the five cases attachment-finalizer keys, the placement education/health quartet,exchange.send_requested, the ICPC attachment pair,financial.payment_voided,financial.payment_generation_skipped, the seven-key subsidy-agreement lifecycle family,security.dlq.threshold_exceeded, and both dynamic-suffix keys (ruleset.changed.<name>,composition.invalidated.<jurisdiction>). Most were documented in their own ADR, plan or the implementation guide; the exception is the placement education/health quartet, which appeared only in the archivedcase-placement-completionplan. None was here. -
Spelling drift — four security keys: catalogued
security.major_change_recorded,security.major_change_reported,security.alert_created,security.alert_acknowledged; emitted (always)security.major_change.recorded,.reported,security.alert.created,.acknowledged. Corrected to the emitted spelling. Delivery was never affected — the wildcard subscriber’ssecurity.*catch-all arm records them regardless. -
Catalogued without a producer — one key:
exchange.received(a craig-security parser arm and an implementation-guide row exist; nothing emits it). Kept and marked documented-only; the #971 rule applies when inbound exchange is built, or the row retires with its arm (it did — retired by § Amendment #1652 below).placement.requestedwas verified gone (the #971 retirement held). -
Contradicting notes:
case.person_pii_exportedandfinancial.subsidy_agreement_transitionedare each emitted by two wrappers with different payload shapes — the NOTE under the catalog names them; and "the ONE key outside the{service}.shape" (eligibility.evaluated) was overstated (icpc.,ssa.,ruleset.,authz.share the property) and is reworded in the intro.
Decision
The catalog stays hand-maintained, under one rule: a new domain_event! key (or hand-written
staging site) lands with its catalog row in the same MR, and a renamed key moves its row in that
MR. The row is part of the event’s contract review — it is where the no-PII posture, the
attribution key and the security parser arm get named — so it belongs with the code change, not
with a periodic sweep.
A routing-key cross-check lint (scan every domain_event! / staging literal and const, diff the
set against this section, fail on an unlisted or misspelled key) was considered and deferred:
post-#993 every key is a macro literal or a resolvable const, so the scan is cheap, and the
format! keys are a known allowlist of two. It is recorded here as a follow-up idea only — this
amendment files nothing. Until it exists the same-MR rule is review-enforced, and the census
method above is the manual re-run.
Census date: 2026-09-03. The implementation guide’s Publishes/Consumes tables were reconciled in
the same change: the never-emitted security.breach_detected row removed and the emitted security
keys added NET-NEW (the guide’s table had carried only review_due / archive_completed /
breach_detected, so it never had the underscore spellings to fix); the missing rows across rules /
cases / placement / exchange / reporting / security; the payload columns that named keys the
wrappers do not emit; and the Consumes rows that did not match the services' declared bindings or
handlers (cases: three design-era rows replaced by the two real bindings; exchange:
eligibility.evaluated removed as never bound, case.assignment_changed
case.screening_cohort_changed added, the two debug-log stubs labelled as such; financial:
case.created + case.assignment_changed added and the rules.evaluated row made honest about its
log-only rate arm). Placement’s Consumes table (case.created, case.assignment_changed) and rules'
(case.intake_created) already matched their bindings and were left as they were.
Amendment — #1652 (2026-09-03): exchange.received retired without a producer; exchange.send_requested recorded audit-only
The #1649 census left two exchange keys open: exchange.received, catalogued and parsed but emitted
by nothing, and exchange.send_requested, emitted but bound by nothing. This amendment closes both
as engineering decisions — one retirement, one record.
exchange.received — retired. The key had a craig-security audit-parser arm
(update/exchange_transaction) and an implementation-guide row, and no producer anywhere in the
tree — the exact shape #971 retired for placement.requested. Nothing has ever been dropped or
mislabelled by it, and nothing can be: an inbound-exchange path does not exist, so the arm was a
label for an envelope that cannot arrive. The row above is gone, the implementation guide’s row is
gone, and the parser arm is deleted; a stray envelope now lands through the raw-split fallback as
received/exchange, recorded losslessly (unit-pinned, retired_exchange_received_falls_to_the_raw_split,
so the retirement stays visible, not silent). When inbound exchange is built, the producer and its
payload contract land first and the arm returns in the same MR — the #971 rule, and the hand-
maintained-catalog rule of § Amendment #1649. No consumer ever bound the key, so the durable-queue
stale-binding ops note from #971 does not apply here.
exchange.send_requested — kept, recorded AUDIT-ONLY by design. craig-exchange stages it with
the transaction’s send claim (platform-stab-2 §D5; transaction_id, partner_id,
correlation_id; ids only) so the audit chain carries the intent to send as a durable fact
distinct from the later exchange.sent / exchange.failed outcome. Its only reader is
craig-security’s wildcard audit subscriber, which records it through the raw-split fallback as
send_requested/exchange; no service binds the key, and that is the design, not a gap. It stays
in the catalog above, annotated audit-only, no consumer. Naming a consumer later is additive
(a new binding on an existing key — no producer or payload change), and the consumer-before-producer
deploy-order rule is not engaged because the producer already exists.
Superseded in part by #2330 (2026-10-21): the parser posture. The audit-only, no-consumer ruling
stands; the raw-split classification does not. A row that exists only for the audit chain must
name the record it is about, and the raw split filed it as send_requested/exchange with a NULL
resource id. craig-security now has an explicit arm, send_requested on exchange_transaction
(the action token kept), and an exact exchange.send_requested family that resolves
transaction_id, so GET /v1/security/audit/resource/exchange_transaction/{id} lists the intent
beside the exchange.sent / exchange.failed outcome. The pin is now
audit_only_exchange_send_requested_classifies_as_its_transaction. Rows written before #2330 keep
the raw split (audit rows are immutable).
Amendment — #1670 (2026-09-06): the case.intake_created → craig-rules binding retired
craig-rules' domain-event subscriber had ONE binding left, case.intake_created →
craig-rules.events (§ Amendment #971 had retired placement.requested; #1054 the
dead-from-birth eligibility.submitted). Its payload is {investigation_id, referral_id}
— no screening fact at all — so every evaluation it triggered was a catch-all artifact
with no screening_decision. The intake-screening consult now belongs to the cases
service’s screening-decision act (plan v2.3, epic &88; U2 #1672), which evaluates over
POST /v1/rules/evaluate with the real attested facts and per-victim-child evidence, and
the {j}-intake-screening rulesets (Georgia v1.3, Texas v1.2) carry closed Draft-7 input
schemas under which the old payload is an engine error — retirement and schema shipped in
one MR, retirement first.
What went. The subscriber, its queue constant and binding list, the events-subscriber
worker (and its EXPECTED_WORKERS entry — /readyz no longer expects it), the
evaluation_target / handle_domain_event pair, the engine’s evaluate_in_tx inbox-tx
seam (its only production caller; the own-transaction failure-row rule stands on the direct
path), the census entries, and craig-rules\.events from the principal’s grant. The
producer stays: case.intake_created is still staged by craig-cases and recorded by
craig-security’s wildcard audit subscriber — it is catalogued above as audit-only, the
exchange.send_requested shape of § Amendment #1652.
Pins. The events-subscriber row is gone from craig-rules' exact worker set
(tests/api/health.rs); craig_rules_events_queue_declare_is_refused proves the principal
can no longer recreate the queue.
Ops note. A broker declared before #1670 keeps a durable craig-rules.events bound to
case.intake_created with no consumer and no principal able to delete it — inert, but
retire it: the deployment guide’s § Retiring craig-rules.events gives the forward order
(roll the rules image, drain, promote the strict rulesets, unbind → delete queue →
set_permissions) and the full rollback order across the ruleset revisions, the policy row,
the cases gate and the rules image.
Re-adding a domain-event trigger to craig-rules is a deliberate act that starts with a producer whose payload carries the facts a ruleset’s input schema declares — the #971 rule, now with a machine-checked schema behind it.
Amendment — #2211 (2026-10-10): every payload names its actor under a lifted key
Superseded by the #2314 amendment (2026-11-17), below. This section is kept as the record of the rule as it stood:
the lift chain (event_parsing::ACTOR_KEYS, extract_actor), the census file and the tables it names
(CONTEXT, CHAIN_PINS) no longer exist, and craig-security reads no payload key to attribute an audit row.
craig-security’s wildcard audit subscriber attributes each audit_log row by lifting the actor out
of the event payload. Four events named their actor under a key the lift never read —
security.archive_purged (purged_by), case.report_converted (converted_by),
case.report_person_linked (linked_by) and case.report_person_unlinked (unlinked_by) — so
their rows recorded system and a NULL actor_user_sub, the defect #1913 fixed for three security
events. Five types craig-security stages itself still fell to the security. catch-all.
Decision
One chain, five keys, closed. The lift is one definition, craig-security’s
event_parsing::ACTOR_KEYS, read in this order: created_by, approved_by, user_id,
archived_by, sub. The first key PRESENT wins; a present JSON null stops the walk and names no
actor (a partner-path case.report_submitted, a system auto-link). extract_actor returns that
text verbatim for the audit_log.user_id column (system when it is absent), and
extract_actor_user_sub keeps it for actor_user_sub only when it parses as a UUID. The
subscriber’s second copy of the chain is gone. The key set does not change.
Publishers conform; the chain never grows. An event names its actor under one of the five keys; a
typed payload renames its field onto the wire (#[serde(rename = "user_id")]). #1899, #1913,
craig-exchange’s four user_id renames, craig-financial’s created_by mappings and the placement
contracts already follow this rule. A new actor key is then a one-line change in the publisher’s own
MR, with no craig-security edit and no parsers-deploy-before-producers ordering. Teaching the chain
each publisher’s spelling was rejected: the chain would become a registry of spellings, it cannot
be a *_by suffix rule (superseded_by is a plan id), and the contracts crates' staff-key lists,
which enumerate the chain, would go silently stale.
The four renames (no consumer reads the old keys):
-
security.archive_purged:purged_by→user_id. The ledger column staysarchive_records.purged_by. -
case.report_converted:converted_by→user_id. -
case.report_person_linked:linked_by→user_id, the row’slinked_by(NULL = system auto-link). The table column staysreport_persons.linked_by. -
case.report_person_unlinked:unlinked_by→user_id.originally_linked_bystays, as context.
The census pin. services/craig-security/src/event_parsing/audit_census_tests.rs lexes every
non-test .rs under services//src and crates//src into proc-macro2 tokens (so comments and
string values never trip it; in-file #[cfg(test)] modules stay in scope) and collects every
payload key shaped like an actor — sub, by, *_by, _sub, actor, acting*,
operator — from three shapes:
-
a JSON key (
"k":) in a publisher file, one namingdomain_event,stage_json_event,stage_eventorEventEnvelope::new; -
a conditionally inserted key (
insert("k", …)) in a publisher file; -
a field’s wire name (serde
renamehonored) in a*Payload/*Eventstruct that derivesSerializebut notToSchema.
Each hit is LIFTED (in ACTOR_KEYS) or CONTEXT in the file that carries it, and the CONTEXT table is
exhaustive both ways: a listed (key, file) pair no source carries fails too. Two companion pins
hold ACTOR_KEYS to the five keys in order and every security.* type craig-security stages to an
explicit arm.
The CONTEXT keys are identities a payload carries that are deliberately not the act’s actor. Each is valid only in its listed file(s):
| Key | File(s) | Why it is not the actor |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
the act’s derived policy role, a token, not an identity |
Explicit arms. Every type craig-security stages that rode the security. catch-all
(system / security) gets its own arm; the catch-all is left to security.* types nothing emits.
| Type | action / resource_type |
Resource id |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
none: the payload names an event type, not a row |
The six security.partner. arms are unchanged, but their rows now name a resource through three
families: the exact security.partner.created resolves partner_id, every security.partner.key_
type key_id, and every security.partner.signer_key_* type signer_key_id. Each key payload also
carries partner_id, which the family never reads, so a key rotation’s revoke and issue land on two
keys. extract_resource_id now has twenty-one families.
Accepted limits (the census module’s doc lists them). The census is per key, not per event, so a
CONTEXT key reused as an actor in its OWN file passes. It misses a payload built outside a publisher
file, a payload struct named otherwise, a struct-level rename_all, and identity keys of other
shapes; those were hand-checked at #2211 and none is the act’s actor (assigned_worker /
supervisor and their old_ / new_ pairs, requestor, initiator, responsible, service_id,
role / roles / user_roles). It does not pin the chain’s priority: a subject riding a chain key
(placement.caregiver_identity_revoked’s `sub) is outranked by the staff created_by by design.
As-built (#2251): the census now also reads each payload whole (a JSON literal under the fn or
domain_event! wrapper that builds it, a payload struct under its name). A payload that carries two
chain keys, or sub, is attributed by the chain’s order, not by meaning, so each one is pinned in
CHAIN_PINS (audit_census_tests.rs) with the chain keys it carries, the key that names its actor
and why, and the census runs the real extract_actor to check that the chain picks that key. A
payload that needs a pin and has none fails, and so does a pin no payload matches. Thirteen pins at
#2251: the revoked-identity payload (created_by over the subject sub), eight payloads whose
sub is the actor (the three authz audit payloads, rules.authz_fallback_admit, the two portal
reads, the caregiver’s enrolment and field proposal) and four craig-security unit-test fixtures
(two of the chain’s own tests, two of the authz.access_denied column lift’s). A lone
created_by / approved_by / user_id / archived_by is an actor key by the #1913 rule; the
census cannot read meaning there.
An operator act whose payload names no actor at all (the security.major_change.* pair,
security.review_due) still audits system; that is outside this rule. As-built (#2248): those
operator acts — and the craig-cases, craig-placement and craig-financial acts the #2211 critic
listed — now name the acting worker as user_id; a scheduled or service act states that it has
none (system in craig-financial, a JSON null in craig-cases). The per-publisher tests pin each
key; the census still pins key shapes only. A fresh census of the operator acts #2248 did not
audit is #2277.
As-built (#2277): that census found sixteen more operator acts with no actor key — three craig-cases
intake events, the six uploaded / generated events of the upload-attempt finalizers (the claim’s effective
actor), placement.activated / placement.ended, icpc.created, icpc.status_changed and
exchange.send_requested (null on a trigger dispatch), financial.claim_submitted,
reporting.ncands_transmitted (retired since, #2130) — and each now names the acting worker as user_id. Left out on purpose: upload
failures (a machine outcome), cache / revision signals, and the strict eligibility.evaluated (its own issue,
#2323).
As-built (#2250): every actor craig-security’s own publishers stage is the acting worker (spec.actor or
claims.acting_worker()), so a BFF-lifted act names the lifted worker, never the service principal; the private
Claims fields and crates/craig-test-lib/tests/acting_identity_census.rs pin it at the source (#2522).
As-built (#2322): the cache and revision signals stay actor-less. Each operator act whose only event was such a
signal, and the SSA run start, which staged none (on a supersede only the actor-less invalidation of the old run),
now stages its own act event naming the acting worker as user_id, in the act’s own transaction beside any
unchanged signal: case.household_member_added, rules.ruleset_created, rules.ruleset_updated,
rules.ruleset_deleted, rules.ruleset_imported, composition.override_written and
exchange.screening_run_staged (§ Routing Keys). Deploy craig-security first or with the producers: a producer
ahead of it files the new key under the raw split, still attributed through user_id, never system.
As-built (#2496): seven craig-exchange operator writes staged no event at all — partner update and
deactivation, agreement update and delete, and the three trigger-backlog acts (release, its record arm, dismiss) —
and now each stages its own act event naming the acting worker as user_id, in the write’s own transaction
(§ Routing Keys). A dismissal also stamps exchange_trigger_admissions.dismissed_by. The same issue’s
craig-financial, craig-rules and craig-security writes are its follow-up.
As-built (#2496, part 2, 2026-11-08): the partner and agreement creates, the pending-adjustment withdrawal and the
three NIST control writes now stage their own act events (§ Routing Keys). Every staff write route of craig-exchange,
craig-financial, craig-rules and craig-security carries a verdict in xtask/audit-write-census.txt (since #2300 the ledger
xtask/baselines/audit-write-census.toml), held to the
served routes by xtask/src/cmd/audit_write_census.rs: an act event, an exemption with its reason, a #3001 gap, or
row-audited. The row-audited acts are the home-study submission (icpc_home_studies.assessed_by), the sweep preview
(subsidy_sweep_runs.initiated_by), the backpay batch create, record stage and supersede (backpay_batches.created_by,
backpay_records.staged_by, backpay_records.superseded_by), the import batch create and record stage
(subsidy_import_batches.created_by, subsidy_import_records.created_by), the rules evaluation
(rule_evaluations.evaluated_by) and the promotion preview (rule_set_promotion_previews.actor_sub, a no-flip
dry run whose execute stages rules.ruleset_promoted naming its preview_id). A request_claims or
background_jobs stamp never counts: both are pruned. Nineteen routes are #3001 gaps, and the census pins that set.
As-built (#3001, part 1): the craig-financial rate create, update and delete, the claim generation, the backpay and
conversion-import batch aborts, and the craig-exchange catch-up walk now stage their own act events naming the
acting worker (§ Routing Keys), and their census verdicts name those keys. Twelve craig-security routes remain #3001
gaps. Deploy craig-security first or with the producers (the #2322 note).
As-built (#3001, part 2): the twelve craig-security routes (admin units, detection rules, partners and reviews, the
major-change update and delete) now stage their own act events naming the acting worker (§ Routing Keys). The census
holds no gap: its gap verdict stays, so a future unaudited write must cite its issue and be pinned by a reviewed
change, and the empty pin fails any gap line. One service, so no deploy order.
As-built (#3040): the admin replay craig-api mounts on every service, POST /v1/admin/events/replay, now stages
admin.events_replayed naming the acting worker (§ Routing Keys). The census rule for an event verdict accepts,
for a route craig-api mounts (CRAIG_API_ROUTES in xtask/src/cmd/audit_write_census.rs), a key that is a literal
in craig-api’s source, so the four services' verdicts need not repeat it. Deploy craig-security first or with the
services (the #2322 note).
As-built (#2323): the strict eligibility.evaluated names the act’s effective actor as a defaulted
user_id. Deploy craig-financial before craig-cases (an older craig-financial refuses the key).
Ops note. No deploy ordering: the chain already lifted user_id; the one exception is #2323’s strict
eligibility.evaluated: deploy craig-financial first. An event staged with an old key before the upgrade still
lands system. Audit rows are immutable, so historical audit_log.details keep the old keys and historical rows
keep the catch-all labels (CHANGELOG #2211).
Census date: 2026-10-10.
Amendment — #2314 (2026-11-16): the envelope carries an audit header
Completed by the #2314 amendment of 2026-11-17, below: the header is now required, and a headerless event is no longer classified by the #2211 rule.
The #2211 rule above makes craig-security infer each audit row: the action and resource type from a string table
keyed by event_type, the record from a payload key guess, the actor from the first of five payload keys. Every
publisher must stay in step with a table in another service, and each attribution fix (#1913, #2231, #2245) was a
miss of that kind. The publisher holds all four as typed values where it stages the event.
Decision
The envelope gains an optional audit object, the publisher’s statement of the event’s audit facts
(craig_mq::AuditMeta):
| Key | Value |
|---|---|
|
a token of the closed |
|
a token of the closed |
|
the record’s UUID; omitted when the act names none |
|
a worker’s UUID, |
|
|
|
the actor’s roles; omitted when none are stated |
Decode never fails. A consumer reads the object field by field and replaces a field it cannot read, so an unknown
token or a malformed header never dead-letters the message and never erases a refusal: an unreadable outcome on a
deny stays refused. An older consumer ignores the key. A publisher cannot stage a header naming a token outside
the sets: staging refuses it.
The audit subscriber reads the header when the envelope carries one and writes the row from it without reading the payload. An envelope with no header is classified as before, by the #2211 rule, so nothing changes for a publisher that has not moved.
Publishers move one service at a time (plan audit-header). While they move, a source census holds each migrated
site’s header to the columns the #2211 inference derives for the same routing key and payload, so the move changes
no audit row.
This amendment supersedes #2211 ("every payload names its actor under a lifted key") once every publisher states a
header and the header becomes required to stage: the string table and its two source censuses are deleted then, and a
headerless message lands a degraded row attributed to system. Until that change, #2211 stays in force for every
envelope with no header.
The header is data, as the payload is. It is written by the publishing service; a compromised publisher can name
any actor in it, exactly as it can put any user_id in a payload today. Nothing in CRAIG authorises on it.
Ops note. No deploy ordering. A consumer that predates the header ignores it, and a subscriber that knows it files a headerless event as before.
Amendment — #2314 (2026-11-17): the header is required, and supersedes #2211
Every publisher in the workspace states an audit header, so the change the 2026-11-16 amendment announced has landed.
The header is required to build and to stage an event. EventEnvelope::new and stage_json_event take the
AuditMeta, a domain_event! wrapper without its audit = (..) clause does not compile, and staging refuses an
envelope with no header (Unpublishable::MissingAuditHeader). The wire field stays optional for good: decode keeps
accepting a headerless message.
#2211 is superseded ("every payload names its actor under a lifted key"). craig-security no longer reads a payload
to file an audit row: the event-type string table, the payload key families, the five-key actor chain and the two
source censuses that held publishers to them are deleted, with the CONTEXT and CHAIN_PINS tables. A payload key’s
name is no longer an audit contract. Payloads keep their keys (user_id, created_by, sub, …) as data for
consumers and for details; nothing requires a new payload to name its actor under one of them.
A headerless message lands a degraded row. It is attributed to system, names no record, and takes nothing from
its payload. authz.access_denied stays deny on authz_decision with success = false; any other security.*
type is system on security; every other type stores the two halves of its event type. Each such delivery
increments audit_headerless_events_total and logs audit event carries no header. This path is permanent
(data model § audit_log).
What guards the header. A source census in craig-security (audit_header_census_tests.rs) reads every crate but
craig-mq. It fails on an envelope built round the constructor, on a publisher naming the Unknown token, on a
case.person_* event that does not audit against the person, and on a site whose header states the system as actor
or no record without a row in SYSTEM_OR_RECORDLESS saying why. That table only shrinks: its length is capped by
SYSTEM_OR_RECORDLESS_CEILING. What no census proves is that a header names the right variable of the right type;
review does.
Not carried forward from #2211. The per-file discipline on actor-shaped payload keys (CONTEXT) and the pin that
a payload carrying both created_by and sub is attributed to created_by (CHAIN_PINS) are gone with the chain
they described. Each constrained which payload key the subscriber would pick; it picks none now, and the actor a
site states is in its header, where the allowlist census reads it.
Ops note. Drain or discard each service’s outbox before upgrading: an outbox row written before its publisher
stated a header, or an admin replay of one, lands a degraded row. Watch audit_headerless_events_total and
audit_degraded_headers_total; both should stay at zero.