ADR-003: RabbitMQ Event Topology

Status

Accepted

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.

Exchange

  • Name: craig.events

  • Type: topic

  • Durable: true

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 of rule_evaluations archived-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 into archive_records (D16 — envelope fields are data, not transport identity; forged/malformed envelopes are refused loudly and land only in the generic audit row). Rules' own archive_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; carries user_id, the purging operator — purged_by until #2211)

  • rules.evaluated, rules.cache_invalidated, rules.authz_fallback_admit (rules.evaluated is a pointer payload since #1130 — rule-set identity + evaluation_id + context, never the input/output documents; the single durable copy is the producer’s rule_evaluations row; since #1556 it also carries rule_set_revision, the content-exact identity joining straight to rule_set_snapshots. #786: authz_fallback_admit staged on every craig-rules bootstrap fallback admit; attribution payload, no PII. Since #2330 craig-security records rules.evaluated as evaluate on rule_evaluation with evaluation_id, and a fallback admit as authz_fallback_admit on the payload’s resource_type when craig-authz knows it (authz_decision otherwise) with its resource_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 the preview_id pointing at the persisted canary evidence, and for rollback the restored_revision (the snapshot the content came FROM — from_revision is the live state it moved off). Security parses them as promote/rollback on rule_set with the rule_set_id resolved — 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 by rule_set_acts::stage_rule_set_act in 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 }: revision joins the act to its rule_set_snapshots row and user_id is the acting worker (spec.actor on the claimed create and import, the acting worker’s sub on update and delete). Audit-only, no consumer binds them: craig-security’s parse_rules_event_type records create / update / delete / import on rule_set and resolves rule_set_id through the rules.ruleset_ family)

  • ruleset.changed.<name> (ADR-006 / ADR-024 — the rules-side dynamic-suffix key: staged by RulesEngine::stage_ruleset_changed next to rules.cache_invalidated on 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 to ruleset.changed. and refreshes ONE cache entry. #810: the interpolation is injection-safe because both API writers of rule_sets.name run the strict lowercase-kebab garde binding — a write-boundary invariant, not a DB CHECK. The signal names no actor by design: each create / update / delete / import’s own record is its rules.ruleset_ act event, #2322, below)

  • authz.access_denied (ADR-050 §Amendment #1063 — staged by the craig-authz engine on every EXPLICIT PolicyDenied row-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 emits kind: "deny" (acting worker under sub, user_roles, resource + action + jurisdiction, ruleset_name/ruleset_version, categorical denied_reason, suppressed_prior when a prior window closed, aggregate_overflow at cap); drained windows emit kind: "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 injected OutboxAuditSink; source_service names the emitter. Miss payload: ruleset/jurisdiction/resource-type lookup + acting-worker attribution (sub pseudonymous UUID, is_service, service_id — no PII), emitted ONLY on source-attested absence, never on PolicyLoad faults. Refresh payload: trigger rmq_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 through ApiServer::router, source_service naming 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_id the 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 records replay / event_outbox at 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-typed priority, icwa_flag; user_id — the acting worker, #2277; craig-security resolves referral_id through the case.referral_ family since #2330, NULL before), case.intake_created (audit-only since § Amendment #1670 — no consumer binds it; craig-security records it as create / investigation (the authz token, since #2515; intake before) and, since #2330, resolves investigation_id, the investigation the act creates, through the case.intake_ family — NULL before; user_id — the acting worker, #2277), case.investigation_closed (a Phase 3 original alongside the referral/intake pair — investigation_id + the disposition token + user_id, the acting worker (#2277); ids only; since #648 the token’s value space is the seven NCANDS outcomes substantiated / indicated / alternative_response_victim / alternative_response_nonvictim / unsubstantiated / unsubstantiated_false_report / closed_no_finding — pre-1.0 wire change, inconclusive retired), 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 strict craig-cases-contracts payload: 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 trimmed reason (nullable), rule_set_revision + evaluation_id of the ONE {j}-response-deadline-override consult; audit-only, no consumer — craig-security records it as update / investigation and resolves investigation_id through the case.investigation_ resource family, which as a side effect also resolves case.investigation_closed’s resource id — previously NULL), `case.created (case_id, case_number, admin_unit, assigned_worker, nullable supervisor — #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; the permanency_goal key left with the per-case goal in #1995 — a child’s plans ride case.permanency_plan_established; craig-security audits the four plan events against the plan — create / update on case_plan, case_plan_id through the case.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/new assigned_worker + old/new supervisor UUIDs, and the monotonic assignment_revision consumers apply strictly-greater-than; bound by placement, financial and exchange; ids only; since #2248 also user_id, the reassigning worker)

  • placement.created, placement.activated, placement.ended (placement.activated is the billing trigger — its payload is the shared typed craig-placement-contracts DTO both the producer and the craig-financial consumer compile against; #979; since P-B1 U5, #2020, it carries the optional replaces_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, its placement_type is the typed federal setting — foster_family_home or an (e)(4) token — and the optional ffh_types, the family row’s applying (e)(3) categories, omitted on any other setting, joins it; since #2277 it and placement.ended also carry the defaulted user_id, the acting worker; craig-security’s explicit arms record (create / update / update, placement) and, since #2035, resolve placement_id through the exact placement.created, placement.activated and placement.ended resource families — the generic order took the denormalized case_id on 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 on attempt_id and carries the sanitized file_name so reap-path failures name the file, no other PII; #1851 added created_by — the uploader’s sub, a caregiver’s on the portal path — and document_type to the UPLOADED payload, additive keys, so security’s first-present actor walk lands the row on the uploader instead of system; since #2330 the upload is create on home_document (document_id) and the failure upload_failed on foster_home (home_id), through the placement.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 archived plans/archive/case-placement-completion.adoc; commit 914e6a76, pre-issue-numbered work so no #N: education_record_id / health_record_id + child_id on create, the record id on update, and on all four user_id the acting worker since #2248; ids only, no record content; since #2330 craig-security records create / update on education_record / health_record with the record id — the raw split’s placement / 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 the foster_home_expiry_notices ledger; payload the typed craig-placement-contracts FosterHomeLicenseNoticePayload { notice_id, foster_home_id, expires_on, days, created_by } — created_by = system for 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 typed FosterHomeTrainingNoticePayload { notice_id, foster_home_id, training_type, expires_on, days, created_by }; the training_type token 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; typed craig-placement-contracts::caregivers payloads, ids only, a binding keys foster_home_id XOR kinship_household_id (P-B2 U5, #2058; was placement_id), never a code or its hash; attribution: every staff act carries created_by = the acting staff sub, the enrolment act carries sub = the caregiver’s own subject and NO created_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_ended are create / update on foster_home_caregiver (binding_id; the craig-authz token since #2888, caregiver_binding before), the invitation pair create / update on portal_invitation (invitation_id), the identity pair create / update on caregiver_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 keep placement and 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. Typed craig-placement-contracts::portal::PortalReadPayload { sub, role, jurisdiction, surface, unit_id? }, surface ∈ units | unit | training | documents | document_download | document_upload; ids and tokens only; attribution sub = the caregiver’s own subject and NO created_by, so the audit row lands on the foster parent. Since #2249 its own parse arm records action portal_read (the token financial.portal_read shares) on resource_type foster_portal, and the exact placement.portal_read family resolves unit_id, the unit the request read (the FosterPortal authz ref’s resource); the units-list read names no unit (NULL). Rows written before #2249 keep placement / NULL. Volume note: unlike its neighbours this key fires per READ — one outbox row (30 d) + one audit_log row (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 — the foster_home_portal field-ownership family; typed craig-placement-contracts::field_ownership payloads. 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_household since #2058), staged in the claimed propose transaction — attribution sub = 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 — attribution approved_by = the deciding staff member, the caregiver deliberately under proposed_by_sub and never sub; 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 — attribution user_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}, the case.updated key shape — and never a DOB / SSN column (the six-token roster is pinned against those columns in the contracts crate); placements.* tokens ride field_written only. Parser posture (#2330): explicit arms keep the three action tokens; a proposal and its decision file under field_proposal (proposal_id), a write under the record type of its target_table (education_record / health_record / foster_home / placement; governed_record for any other table) with target_id — the raw split’s placement / 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 — plan afcars-placement-capture D6 / R-B11): the AFCARS release audit, craig_placement_contracts::events::PlacementAfcarsReleasedPayload — { requestor, purpose, child_ids, child_count, from, to, as_of }, strict, requestor closed at craig-reporting and purpose at afcars-2020 federal reporting; catalogued + parsed BEFORE its producer exists (the ADR-057 runbook precedent): P-D’s service-only afcars-export (#1965) stages it in its own transaction before answering no-store. craig-security’s explicit arm records (read, placement); no resource id (children travel as a list); actor system (no staff key)

  • placement.episode_facts_changed (P-B1 U3, #2018 — plan afcars-placement-capture D2): 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 is removal_episodes / recorded with row_id = the episode; an episode retract is ONE removal_episodes / retracted, also when it retires the episode’s live exit; P-B1 U4, #2019: an exit record is exit_responses / recorded with row_id = the new exit, a correction exit_responses / corrected with the successor, an exit retract exit_responses / retracted with the retired row, and a historical episode stages TWO events, removal_episodes / recorded (the episode) then exit_responses / recorded (its exit); P-B3 U3, #2082: a trafficking statement or report act is <table> / recorded with row_id = the new row, a correction corrected with the successor, a retract retracted with the retired row; an episode retract that also retires the episode’s live trafficking rows still stages only its ONE removal_episodes / retracted); ids, the act and the actor — never a fact value. Audit-only, no consumer acts on it: reporting’s placement.* binding receives it and its validator treats it as a no-op; financial binds nothing. craig-security’s explicit arm records (update, removal_episode), resolves episode_id through the placement.episode_ resource family (the generic order would take the denormalized case_id), and the actor rides user_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 published placement.activated); reporting’s placement.* binding receives it and its validator treats it as a no-op. craig-security’s explicit arm records (update, placement), resolves placement_id through the exact placement.cancelled resource family, and the actor rides user_id. U3 removes planned → ended, so placement.ended is 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 → retracted or ended → 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: the placement.ended money leg without its end-reason arms — the termination tombstone, then the void of the arrangement’s undisbursed (pending / approved) per-diems with payments_voided.cause = placement_retracted, identical for both origins; issued and cleared payments stay (follow-up #2041). Reporting’s placement.* binding receives it and its validator treats it as a no-op. craig-security’s explicit arm records (update, placement), resolves placement_id through the exact placement.retracted resource family, and the actor rides user_id

  • placement.recorded (P-B1 U5, #2020 — plan D3): a past arrangement recorded born ended (POST /v1/placement/placements/historical), staged in the record transaction — the act publishes no placement.created, placement.activated or placement.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_id present only when the record re-records a retracted arrangement (R-B21); P-B2 U3, #2056, adds placement_type (the federal setting) and ffh_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): with replaces_placement_id it re-anchors the retracted arrangement’s subsidy agreements onto the recorded one (financial.subsidy_anchor_replaced, below), without it only logs. Reporting’s placement.* binding receives it and its validator treats it as a no-op. craig-security’s explicit arm records (create, placement), resolves placement_id through the exact placement.recorded resource family, and the actor rides user_id

  • placement.episode_exited (P-B1 U6a, #2021 — plan afcars-placement-capture D4, ADR-079 D4): one act on a removal episode’s exit, staged in the act’s transaction after its placement.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; current is the shared lenient craig_placement_contracts::episodes::EpisodeExit { exit_on, exit_reason } the subsidy-eligibility read also serves — the episode’s live exit AFTER the act, null after a retract (exit_on the exit’s date on the jurisdiction’s business calendar, exit_reason the typed ExitReason: fleet vocabulary and a date, never PII); arrangement_ids every live arrangement of the episode — planned, active or ended, never cancelled or retracted — by started_at, then id, empty for a historical episode; act_at the act’s clock_timestamp() under the episode lock and act_id a 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 by child_id + arrangement_ids (ADR-056’s #2021 amendment). Reporting’s placement.* binding receives it and its validator treats it as a no-op. craig-security’s explicit arm records (update, removal_episode), resolves episode_id through the placement.episode_ resource family (the generic order would take the denormalized case_id), and the actor rides user_id

  • exchange.sent, exchange.failed (transaction_id + partner_id; failed adds error) — craig-security audits both against the transaction (exchange_transaction, transaction_id through an exact family each since #2249; NULL before), exchange.send_requested (platform-stab-2 §D5 — staged with the transaction’s send claim in api/transactions.rs: transaction_id, partner_id, correlation_id, user_id (the acting worker, null on a trigger dispatch; #2277); audit-only, no consumer — emitted for the audit chain by design, no service binds it; § Amendment #1652; since #2330 audited as send_requested on exchange_transaction with transaction_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 carries attachment_id + icpc_request_id + attachment_type + user_id, the upload attempt’s claimant (#2277); failed keys on attempt_id and carries error) — craig-security audits the four against the request (icpc_request, icpc_request_id: create / update, the failed upload as upload_failed) or the attachment (create on icpc_attachment, attachment_id) since #2330, through the icpc. family; icpc.created recorded 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_changed is the fork-5 MINIMAL shape — case_id + the monotonic cohort_revision + a categorical change token ∈ {household, screening_identifier} (#3175: screening_identifier — a record, end or retract of a person identifier of the jurisdiction’s screening kind — replaced person_digest, ssn_cleared and link_promoted, since the cohort binds the identifier, not the SSN); deliberately NO person_id and 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 as update/screening_cohort so 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_invalidated carries run_id + the denormalized case_id + reason ∈ {cohort_changed, operator_cancelled, freshness_expired}, plus present-only superseded_by_run_id (the fork-3 auto-supersede) and present-only user_id = the relayed requested_by sub on operator_cancelled ONLY (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 as update/screening_run with run_id resolved before case_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 the case.screening_cohort_changed it bumps; id is the case_household row and user_id the 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 by lifecycle::stage_household_add in the add’s claimed transaction, beside the P1 case.screening_cohort_changed: id is the case_household row, user_id the 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 by screening::stage_fresh_run on every fresh run start; the supersede arm’s actor-less exchange.screening_run_invalidated is unchanged. Its user_id is the relayed requested_by: craig-cases forwards the stage under its own service bearer with no X-Craig-Actor, and the allowlisted producer asserts the caseworker as data (the operator_cancelled posture). craig-security records create on household_member (id, the generic selector; case_household before #2888) and create on screening_run (ssa_screening_run before #2888; run_id, the exchange.screening_ family); craig-reporting’s case.* 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 denormalized case_id, user_id = the acting admin’s sub (a hold is never a system act — the human-admin-only endpoint gate is the fork-6 screening_resume posture), and the operator-entered bounded reason (the hold’s narrative lives HERE, never on the run row — the flag is a bare boolean, the archive_records precedent). Audited as update/screening_run with run_id resolved via the exchange.screening_ family; same same-MR parser-arm deploy-order note as ssa.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? }: id the partner or agreement, user_id the acting worker (claims.worker_subject(), so a relayed write names the lifted worker), and on an update fields, the body fields it named, by NAME only, never a value. Each is staged in the write’s own transaction; a refused write (a stale If-Match, an illegal transition, a repeat delete, a lost race) or an ADR-062 create replay stages none. craig-security records create / update / delete on exchange_partner / exchange_agreement, id through 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_id is the acting admin (the acts refuse a service and a relay). The dismissal reason stays on the rows, beside the new dismissed_by. Batch grain, the ssa.jobs_resumed shape: craig-security records release / dismiss on trigger_admission and restage on exchange_send_job, with no singular resource id; nothing else binds them. The arms ship with the producer (the ssa.jobs_resumed deploy-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, completed or failed; 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_id the walking admin, the counts stay on the run row. Batch grain: craig-security records catch_up on trigger_admission with 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’s exchange_transactions row, completed or failed; 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_id the 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 no user_id, and its audit header names the system as the actor. craig-security records create on exchange_transaction from 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 records update on person as 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-only reason_filter/run_id), and each re-admitted job with its PRE-reset attempts count. Batch grain — no singular resource id (the payments_voided shape); audited update/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 categorical latest_reason the item carried, and the bounded free-text dismissal_reason (the substance of the decision — no PII beyond what the worker types; the UI labels the field audit-visible). Parsed as update/screening_review)

  • case.ive_determination_invalidated (#1313 U5b — the LATEST determination’s witness run was invalidated: { case_id, determination_revision }, the STRICT shared contract in craig-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 its ive_invalidated_revisions SET (both arrival orders converge on invalidated = true; a duplicate re-stage is a consumer no-op). Ids + revision only — no PII. Parsed as update/ive_determination — the arm ships in the SAME MR as the producer (the ssa.jobs_resumed deploy-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. and authz. 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 contract craig-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 as None and audits system; financial’s consumer applies it by revision-CAS into ive_child_verdicts and reprices live per-diem rows — the #1054 money fence, opened by the G-C ruling of 2026-09-02. Audited as evaluate by an explicit parser arm, same-MR-as-producer; since #2330 as evaluate/ive_determination with determination_id (an exact family), the act every per-child verdict belongs to — a verdict has no id of its own, and the row recorded ive_child_verdict beside the case id before)

  • ssa.stale_cohorts_invalidated (no producer since #3175 retired the digest-rotation sweep, whose only query read the dropped ssa_screening_members.ssn_digest; rows already filed stay in audit_log as 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, and run_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 own exchange.screening_run_invalidated event (reason cohort_changed, no user_id in 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 as update/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-only case_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 — a placement.activated no-payment fail-safe fired: placement_id, case_id, child_id + the categorical reason; staged on the consuming attempt tx, so exactly once per activation envelope; craig-reporting turns it into a data_quality_issues row. Since #2057 a non-caregiving activation (plan afcars-placement-facts D3: 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 stages no_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; audited delete / 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? }, id the rate row, user_id the acting worker, and on an update fields, 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 stale If-Match or a repeat delete stages none; audited create / update / delete on rate_table, id through 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 ride claim_submitted); staged in the claimed build transaction, a replay stages none; audited create / claim), financial.subsidy_generation_completed (payments_voided is one bulk event per set-based void — voided ids + count + cause (placement_ended | subsidy_reconciliation, #1068 | placement_retracted, #2020 — scoped by placement_id like placement_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 as user_id; #978 made issue/clear reachable and stopped approval re-emitting payment_created. payment_created + the lifecycle events OMIT case_id when the payment has none — post-case subsidy rows, #1068. subsidy_generation_completed is one event per generation run: run id, month, initiator kind, the report counters and user_id (the initiating worker’s sub, system on the scheduled tick — #2248) — no PII; ADR-053; craig-security files it under the run, run_id through the financial.subsidy_ family, since #2330 — NULL before)

  • financial.payment_period_shortened (#3189 — one per per-diem the placement.ended consumer 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’s update on payment from 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: one imported event 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 plus user_id, the finalizing operator (#2248), filed by craig-security under its batch (batch_id through the financial.subsidy_ family) since #2330 — NULL before. No PII in either payload) Since #1787 the imported event also carries authority_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, plan backpay-import-path U2 — one summary per finalized backpay batch, {batch_id, expected_count, materialized, superseded, user_id} (user_id the finalizing operator, #2248), no PII; craig-security files it under its batch (batch_id through the financial.subsidy_ family) since #2330 — NULL before; the craig-security parser lands with the producer, which nothing calls until U-AUTHZ (#2225) wires the backpay_finalize job)

  • financial.subsidy_backpay_batch_aborted, financial.subsidy_import_batch_aborted (#3001 — a staging backpay 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 records abort on subsidy_backpay_batch / subsidy_import, batch_id through the financial.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 and created_by = the acting worker’s sub; no money, no term content, no notes. subsidy_agreement_created adds program, effective_from, initial_status, approval_level, client_request_id; transitioned is the new head interval’s { agreement_id, interval_id, from_status, to_status, business_date } with present-only reason_code — emitted by TWO wrappers, see the NOTE below; terms_amended names the NEW term_id first (the audited resource) + previous_term_id; the three review events carry review_id + chain identity (review_type, cycle) and their dates — completed with present-only resulting_term_id / resulting_interval_id, rescheduled with successor_review_id + new_due_on + the operational reason; sweep_completed is one summary per run — mode flags + leg counters + user_id (the executing worker’s sub on a manual execute, system on a scheduled pass — #2248), no agreement identities; security files it under the run (run_id through the financial.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 of placement.activated or placement.recorded (whichever carries replaces_placement_id); payload { agreement_id, from_placement_id, to_placement_id, agreement_status, previous_started_on?, placement_started_on?, created_by } — agreement_id first (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), and created_by = system on 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 resolves agreement_id through the financial.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 of placement.portal_read: ONE per ADMITTED GET /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 } with surface = payments (a closed enum of financial’s own surfaces, never placement’s), attributed to the caregiver’s sub — there is deliberately no created_by; ids and tokens only, no money. Recorded by craig-security as portal_read on foster_portal with unit_id (its exact family), the placement.portal_read twin, since #2330 (the generic split’s financial / NULL before). Volume: one outbox row (30 d) + one audit_log row (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 carry export_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 on attempt_id and 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’s issue_id and every AFCARS / NCANDS row’s submission_id through the reporting. family — NULL before — and records every AFCARS / NCANDS arm on afcars_submission / ncands_submission and the quality issue on data_quality_issue (the craig-authz ResourceType tokens, since #2515; afcars_report / ncands_report / quality_issue before, which older rows keep), keeping the export pairs' export action tokens for the bulk-export detection rule; reporting.ncands_transmitted is 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, whose assessed_by is the caller’s free-text claim, never the authenticated actor: id (the row, the generic selector), control_id, the resulting implementation_status on a create or update, and user_id, the acting worker; staged in the write’s transaction, a refused write stages none; audited create / update / delete on nist_control. craig-security is the audit store, but its own acts reach audit_log the 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 the reported flip): { id, user_id, fields? }, a major change’s under change_id (its family’s key), user_id the acting worker and fields the 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; audited create / update / delete on admin_unit, detection_rule, partner, security_review and major_change, the row through the generic id or the security.major_change. family’s change_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 one event_type’s dead letters cross `THRESHOLD_PER_HOUR, under a per-type advisory lock: event_type, count, threshold, window). Spelling note (#1649): the four dotted major_change. / alert. keys were catalogued as major_change_recorded / alert_created (underscore) from the start; the emitters have always been the dotted form, and the wildcard subscriber records every security. type, through an explicit arm or its system/security catch-all arm, so the misspelling never affected delivery; and since #2211 every security. type craig-security stages has an explicit arm (the system/security catch-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) and security.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 from created_by / user_id, the audit resource is the binding_id (the record the event’s audit header names), and every engine-bearing service’s units snapshot invalidates on security.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 through PUT /v1/security/admin/workers/{sub}/contact, staged in the write’s own transaction (an unchanged value stages nothing); contact_phone is the NEW value (E.164) or null on 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 from user_id (the admin), and the audit resource is worker_sub (update on worker_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_converted carries report_id, referral_id, admin_unit, user_id (the converting worker; converted_by until #2211) and the nullable seed_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_linked carries the report_persons row — id, report_id, person_id, role, jsonb_index, user_id (the row’s linked_by, linked_by on the wire until #2211; NULL = system auto-link), linked_at + ruleset identity; report_person_unlinked carries the same row with the link provenance renamed originally_linked_by / originally_linked_at plus user_id (the unlinking worker; unlinked_by until #2211) / unlinked_at, so the audit trail keeps what the table no longer holds; persons_auto_linked is the per-convert batch: report_id, referral_id, count, skipped_due_to_ambiguity, and the #1066 ssn_promoted COUNT — 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 + sanitized file_name (+ file_size; court-order adds attempt_id for the pointer-invariant oracle) + user_id, the upload attempt’s claimant (#2277); failed events key on attempt_id (court_order_document_upload_failed on court_order_id + case_id) and carry error) — craig-security audits the report tree against the entity each event is about (#2249, the case.report_ family): the attachment upload under report_attachment / attachment_id, a link and its unlink under report_person / the link id (create / delete; before #2249 case paired with the link id), and every other report event under report / report_id (persons_auto_linked as link_persons, attachment_upload_failed as upload_failed); since #2330 the contact attachment pair audits as create on contact_attachment / upload_failed on contact and the court-order document pair as update / upload_failed on court_order, through the case.contact_attachment_ / case.court_order_ families (NULL, or the raw split’s case beside 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 the audit subscriber; person payloads carry no PII; the three task keys audit as create / update / delete on case_plan_task, task_id through the case.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’s case.person_ssn_release_refused with the SSN release it audited — the screening identifier release REFUSED: person_id, identifier_id, requestor, purpose = income_inquiry_screening, categorical refusal_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 to audit_log; the one person payload with worker-authored text, deliberately kept OUT of tracing logs). Audit (#2032): craig-security files every case.person_* key under resource type person through its own arm — person_created a create; person_updated and person_ssn_admin_action an update; person_screening_release_refused (before #3175, person_ssn_release_refused) a refuse_release (not deny: its row keeps success = true) — each resolving person_id through the case.person_ family; person_pii_exported is an export, so it stays under the data_export detection rule, and resolves no resource id (person_ids is 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 no closed; a review row a court order’s update or delete retired publishes order_corrected / order_deleted); ledger names the table — child_facts_changed covers the four #1992 window ledgers, child_icwa_facts (#1993), parental_rights_actions (#1994) and child_review_events (#1995); person_parents_changed covers person_parentage_facts and child_parents. Ids and the act only — never a fact value; consumers re-read the authz-gated ledger. No consumer binds them. craig-security audits child_facts_changed by the generic split, resource id case_id (generic); the three person-keyed keys audit as update on resource type person through their own arms (#2032), the person resolved by the case.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 strict craig-cases-contracts PermanencyPlanEstablishedPayload { 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_at read 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, plan afcars-placement-capture R-B10); the generic split, resource id case_id, actor user_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 (update on person, 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 — plan custody-episodes-doe-slds D3, ADR-081 D4 — one event per custody transition, staged in the act’s claimed transaction by one wrapper whose key is CustodyEvent::routing_key(), a const fn over the five craig_cases_contracts::custody consts; 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-gated legal_status_facts / custody_episodes); episode_id is null only on case.legal_status_changed for a history row; row_id the legal_status_facts row the transition is about (an episode retract: the episode’s latest live in-custody row); act ∈ recorded / corrected / retracted / episode_retracted; act_at the act’s clock_timestamp(), read once after its writes, and act_id a 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 open opened; a close _closed; a record with until _opened then _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 four case.custody* keys in a later unit (plan D7); since #1821 craig-exchange binds the four case.custody_* keys and both case.person_identifier_* keys through the GA outbound matrix (the consumer queue binds every event the matrix names); case.legal_status_changed binds nothing. Reporting’s case. 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 against custody_episode — opened a create, the rest an update — resolving episode_id through the case.custody resource family (the generic order would take the denormalized case_id), and case.legal_status_changed as an update of case, case_id through the case.legal_status_ family; the actor rides user_id. The arms ship in the same MR as the producer (the ssa.jobs_resumed deploy-order note)

  • case.person_identifier_recorded, case.person_identifier_ended (#1806 — plan custody-episodes-doe-slds D5 — one event per identifier act, staged in the act’s claimed transaction by one wrapper, publish_person_identifier_event, whose key is PersonIdentifierAct::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 v7 act_id only — never the value. A record stages recorded (act = recorded); an end and a retract both stage _ended (act = ended / retracted says which). No consumer in #1806 (the DOE-SLDS legs bind them in U6); since #1821 craig-exchange binds the four case.custody* keys and both case.person_identifier_* keys through the GA outbound matrix (the consumer queue binds every event the matrix names). craig-security files both as an update of person, resolving person_id through the existing case.person_ resource family (a case.person_identifier_ family would fail resource_id_families_are_prefix_disjoint); the actor rides user_id. The arms ship in the same MR as the producer

  • case.medicaid_application_submitted, case.medicaid_application_retracted (#1807 — plan partner-auth-medicaid-application D7 — one event per Medicaid application act, staged in the act’s claimed transaction by one wrapper, publish_medicaid_application_act, whose key is MedicaidApplicationAct::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 v7 act_id and the act’s instant (act_at = the row’s submitted_at on a submit, its retired_at on a retract) only — never citizenship_status, prior_medical_assistance or legal_admin_unit. No service may read the application routes (every one is deny_pure_service); TP-3 owes a service read. A submit stages submitted; 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) names case.medicaid_application_submitted as its trigger and owes an idempotent backfill of every application submitted before it. Reporting’s case.* 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 `_submitted as a create and _retracted as an update of medicaid_application, resolving application_id through the case.medicaid_application resource family (the generic order would take case_id; the payload has no id); the actor rides user_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 by publish_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’s case.* binding receives it as a no-op. craig-security audits it as an update of medicaid_application (the header’s record is application_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 as created_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 by stage_invalidation in 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 exclusive composition-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 is composition.override_written, #2322, below)

  • composition.override_written (#2322 — an override write’s act record, staged by write_support::stage_write_events in the write’s own transaction beside its unchanged composition.invalidated.<jurisdiction>. Payload { id, jurisdiction, surface, layer, user_id }: id is the written composition_overrides row, layer is jurisdiction_live, role or user (a Studio write or a self-service personalization; one key covers both the If-None-Match: * create and the If-Match replace), and user_id is the acting worker. No user_sub: on the user layer the actor is the scope. Audit-only: craig-security records update on composition_override with id through the generic selector; no service binds it, craig-composition’s replicas bind only composition.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=classic argument — the production choke-point (SubscriptionSpec::prepare_queue via queue_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, so x-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-death count grammar, 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_FAILED naming x-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; readyz reflects the publisher path only.

  • B — source lint: a clippy::disallowed_methods entry (clippy.toml, 2299): declarations only in craig-mq’s Subscriber fns (each through the one `[expect]-sanctioned declare_queue helper), 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.conf sets default_queue_type = classic (node) and quorum_queue.property_equivalence.relaxed_checks_on_redeclaration = false (load-bearing: relaxing it makes the broker ignore x-queue-type on redeclare — a subscriber would silently consume from a quorum queue); definitions.json pins the / vhost metadata DQT (canonical exported nested-metadata shape). Definitions import never overwrites existing broker state — the devstack broker is volume-less, so drift is cured by container recreation; the live remedy is rabbitmqctl 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 / TransientPark capture / inbox error_count stamp) — the dlq_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.default write 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 any dlq.* key to craig.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: read on craig.dlx appears 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

SubscriptionSpec::build_session (whole build, not just the dial)

the #1127 consume supervisor + both eager boot builds (supervise_regular, subscribe_dlq)

build_replayer_session

the ADR-059 §D4 DLQ parking replayer

ensure_sampler_conn + create_channel + sample_queue (all three steps of a cycle)

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

craig_mq::connect

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 archived case-placement-completion plan. 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’s security.* 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.requested was verified gone (the #971 retirement held).

  • Contradicting notes: case.person_pii_exported and financial.subsidy_agreement_transitioned are 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 stays archive_records.purged_by.

  • case.report_converted: converted_by → user_id.

  • case.report_person_linked: linked_by → user_id, the row’s linked_by (NULL = system auto-link). The table column stays report_persons.linked_by.

  • case.report_person_unlinked: unlinked_by → user_id. originally_linked_by stays, 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 naming domain_event, stage_json_event, stage_event or EventEnvelope::new;

  • a conditionally inserted key (insert("k", …)) in a publisher file;

  • a field’s wire name (serde rename honored) in a *Payload / *Event struct that derives Serialize but not ToSchema.

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

superseded_by

services/craig-cases/src/events.rs

case.plan_superseded: the newly approved PLAN’s id

superseded_by_run_id

services/craig-exchange/src/events.rs

exchange.screening_run_invalidated: the replacement run

originally_linked_by

services/craig-cases/src/events.rs

case.report_person_unlinked: the deleted link’s provenance

requested_by

services/craig-cases/src/events.rs

case.person_pii_exported (screening) / case.person_screening_release_refused: the stage-time caseworker, carried as data (ADR-065 §D2); the release’s actor is the service

proposed_by_sub

crates/craig-placement-contracts/src/field_ownership.rs

placement.field_proposal_decided: the proposing caregiver; the decider rides approved_by

assigned_worker_sub, supervisor_sub

crates/craig-placement-contracts/src/events.rs

placement.activated: the case’s assignment, denormalized

worker_sub

services/craig-security/src/events.rs, services/craig-security/src/event_parsing.rs (in-file test fixture)

security.worker_admin_unit.*: the BOUND worker, never the acting admin; security.worker_identity.contact_changed: the worker whose line changed (#1857)

user_sub

services/craig-composition/src/events.rs, services/craig-composition/src/cache.rs (in-file test fixture)

composition.invalidated.<jurisdiction>: the override’s scope

actor_role

crates/craig-cases-contracts/src/events.rs, services/craig-security/src/event_parsing.rs (in-file test fixture)

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

security.alert.created

create / security_alert

alert_id, through the security.alert. family (widened from the exact security.alert.acknowledged)

security.review_due

create / security_review

review_id, the generic order (unchanged)

security.major_change.recorded, .reported

create, update / major_change

change_id, through the security.major_change. family

security.dlq.threshold_exceeded

system / dead_letter

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

action

a token of the closed AuditAction set: the text audit_log.action already holds, which the detection rules match by exact token (#3114)

resource_type

a token of the closed AuditResource set: the text audit_log.resource_type already holds, and every craig-authz resource type

resource_id

the record’s UUID; omitted when the act names none

actor

a worker’s UUID, system, or a named actor’s text (service:<name>, system:retention)

outcome

done or refused

actor_roles

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.

Edit this page · latest